From 3457909638c660c0cfcb521b6104ab64c679b914 Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期二, 19 九月 2023 16:23:16 +0800
Subject: [PATCH] 修改页面左右展示比例

---
 src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue |   67 ++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue b/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue
index db933a6..9542396 100644
--- a/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue
+++ b/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue
@@ -20,6 +20,7 @@
             >
               <a-input
                 placeholder="璇疯緭鐢宠鍗曠紪鐮�"
+                :disabled="true"
                 v-decorator="['num', validatorRules.num]"
               />
             </a-form-item>
@@ -30,20 +31,14 @@
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
             >
-              <a-select
-                :placeholder="'璇烽�夋嫨棰嗙敤閮ㄩ棬'"
-                :options="this.departs"
+              <a-tree-select
                 style="width: 100%"
+                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+                :tree-data="treeData"
+                placeholder="璇烽�夋嫨棰嗙敤閮ㄩ棬"
+                tree-default-expand-all
                 v-decorator="['departId', validatorRules.departId]"
               />
-<!--              <j-dict-select-tag
-                allow-clear
-                :disabled="disableSubmit"
-                :placeholder="disableSubmit?'':'璇烽�夋嫨棰嗙敤閮ㄩ棬'"
-                :triggerChange="true"
-                dictCode="sys_depart,depart_name,id,del_flag!='1'"
-                v-decorator="['departId', validatorRules.departId]"
-              />-->
             </a-form-item>
           </a-col>
         </a-row>
@@ -85,6 +80,7 @@
     </a-spin>
     <a-button
       type="primary"
+      :disabled="disableSubmit"
       :style="{ marginRight: '8px',marginBottom:'8px' }"
       :loading="confirmLoading"
       @click="selectSparePartInventory()"
@@ -106,8 +102,10 @@
         <div :key="col.dataIndex">
           <a-input-number
             :value="text"
+
             v-if="col.dataIndex == 'outboundMainQuantity'"
             :min="0"
+            :disabled="disableSubmit"
             :max="record.mainQuantity"
             @change="(e)=>handleChange(e, record.key, col, index)"
           />
@@ -117,9 +115,12 @@
       <span
         slot="action"
         slot-scope="text, record, index"
+
       >
         <a-popconfirm
+
           title="纭畾鍒犻櫎鍚�?"
+          :disabled="disableSubmit"
           @confirm="() => handleDelete(text,record, index)"
         >
           <a>鍒犻櫎</a>
@@ -136,6 +137,7 @@
 
       <a-button
         @click="handleOk()"
+        :disabled="disableSubmit"
         type="primary"
         :loading="confirmLoading"
       >纭畾</a-button>
@@ -162,6 +164,8 @@
   },
   data() {
     return {
+      disabled:false,
+      treeData:[],
       departs: [],
       columns: [
         {
@@ -225,16 +229,16 @@
           dataIndex: 'warehouseLocationNum'
         },
         {
-          title: '涓诲崟浣�',
+          title: '鍗曚綅',
           align: 'center',
           dataIndex: 'mainUnitName'
         },
         {
-          title: '涓绘暟閲�',
+          title: '鏁伴噺',
           align: 'center',
           dataIndex: 'mainQuantity',
         },
-        {
+     /*    {
           title: '杈呭崟浣�',
           align: 'center',
           dataIndex: 'auxiliaryUnitName'
@@ -243,9 +247,9 @@
           title: '杈呮暟閲�',
           align: 'center',
           dataIndex: 'auxiliaryQuantity'
-        },
+        }, */
         {
-          title: '鍑哄簱涓绘暟閲�',
+          title: '鍑哄簱鏁伴噺',
           align: 'center',
           dataIndex: 'outboundMainQuantity',
           scopedSlots: { customRender: 'outboundMainQuantity' }
@@ -307,7 +311,9 @@
       },
       url: {
         add: "/spare/sparePartOutbound/add",
+        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
         getSysDeparts: "/eam/equipment/getSysDeparts",
+        getNum: '/eam/sysIdentity/getNumNew',
         edit: "/spare/sparePartOutbound/edit",
       },
 
@@ -331,10 +337,10 @@
           mainQuantity: data[i].mainQuantity,
           mainUnitId: data[i].mainUnitId,
           mainUnitName: data[i].mainUnitName,
-          auxiliaryQuantity: data[i].auxiliaryQuantity,
-          auxiliaryUnitId: data[i].auxiliaryUnitId,
-          auxiliaryUnitName: data[i].auxiliaryUnitName,
-          conversionRatio: data[i].conversionRatio,
+      /*     auxiliaryQuantity: data[i].auxiliaryQuantity, */
+       /*    auxiliaryUnitId: data[i].auxiliaryUnitId,
+          auxiliaryUnitName: data[i].auxiliaryUnitName, */
+        /*   conversionRatio: data[i].conversionRatio, */
           constructorId: data[i].constructorId,
           constructorName: data[i].constructorName,
           supplierId: data[i].supplierId,
@@ -348,7 +354,6 @@
   },
 
 created() {
-  this.getSysDeparts();
 },
   methods: {
     getSysDeparts() {
@@ -384,6 +389,7 @@
       that.form.resetFields();
       that.model = Object.assign({}, record);
       that.visible = true;
+      that.initOptions()
       that.warehouseId = record.warehouseId
       if (record.sparePartOutboundDetailList != undefined) {
         const temp = [...record.sparePartOutboundDetailList];
@@ -396,9 +402,24 @@
         this.codeDisable = true;
       } else {
         this.codeDisable = false;
+        this.$nextTick(() => {
+          getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
+            if (res.success) {
+              this.form.setFieldsValue({ num: res.message });
+            }
+          })
+        });
       }
     },
-
+    initOptions() {
+      getAction(this.url.loadOptions).then(res => {
+        if (res.success) {
+          this.treeData = res.result
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    },
     close() {
       this.$emit('close');
       this.visible = false;
@@ -454,7 +475,7 @@
       if (target) {
         if (column.dataIndex == 'outboundMainQuantity') {
           target[column.dataIndex] = value;
-          target["outboundAuxiliaryQuantity"] = value * target.conversionRatio
+        /*   target["outboundAuxiliaryQuantity"] = value * target.conversionRatio */
         }
         //鏄剧ず甯﹁繃鏉ョ殑鏁版嵁
         that.dataSource = temp;

--
Gitblit v1.9.3