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/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue |   71 +++++++++++++++++++++++------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue b/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue
index a4d8c38..ed23d13 100644
--- a/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue
+++ b/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue
@@ -20,6 +20,7 @@
             >
               <a-input
                 placeholder='璇疯緭鍏ュ簱鍗曠紪鍙�'
+                :disabled="true"
                 v-decorator="['num', validatorRules.num]"
               />
             </a-form-item>
@@ -30,18 +31,13 @@
               :labelCol='labelCol'
               :wrapperCol='wrapperCol'
             >
-<!--              <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-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]"
               />
             </a-form-item>
@@ -89,6 +85,7 @@
       type='primary'
       :style="{ marginRight: '8px',marginBottom:'8px' }"
       :loading='confirmLoading'
+      :disabled="disableSubmit"
       @click='selectSparePart()'
     >澧炲姞澶囦欢淇℃伅
     </a-button>
@@ -113,15 +110,17 @@
             :options='record.suppliers'
             @change='(e) => handleChange(e, record.key, col, index)'
             style='width: 100%'
-            :disabled='false'
+            :disabled="disableSubmit"
+
           />
           <a-select
             v-if="col.dataIndex == 'warehouseAreaId'"
             :value='text'
+            :disabled="disableSubmit"
             :options='record.warehouseAreas'
             @change='(e) => handleChange(e, record.key, col, index)'
             style='width: 100%'
-            :disabled='false'
+
           />
           <a-select
             v-if="col.dataIndex == 'warehouseLocationId'"
@@ -129,22 +128,25 @@
             :options='record.warehouseLocations'
             @change='(e) => handleChange(e, record.key, col, index)'
             style='width: 100%'
-            :disabled='false'
+            :disabled="disableSubmit"
           />
           <a-input-number
             :value='text'
             v-if="col.dataIndex == 'mainQuantity'"
             :min='0'
+            :disabled="disableSubmit"
             :max='record.wastageRate'
             @change='(e)=>handleChange(e, record.key, col, index)'
           />
           <a-input
             :value='text'
+            :disabled="disableSubmit"
             v-if="col.dataIndex == 'batchNum'"
             @change='(e)=>handleChange(e, record.key, col, index)'
           />
           <a-date-picker
             :value='text'
+            :disabled="disableSubmit"
             v-if="col.dataIndex == 'manufactureDate'"
             format='YYYY-MM-DD'
             @change='(e)=>handleChange(e, record.key, col, index)'
@@ -159,6 +161,7 @@
       >
         <a-popconfirm
           title='纭畾鍒犻櫎鍚�?'
+          :disabled="disableSubmit"
           @confirm='() => handleDelete(text,record, index)'
         >
           <a>鍒犻櫎</a>
@@ -176,6 +179,7 @@
       <a-button
         @click='handleOk()'
         type='primary'
+        :disabled="disableSubmit"
         :loading='confirmLoading'
       >纭畾
       </a-button>
@@ -204,6 +208,7 @@
   },
   data() {
     return {
+      treeData:[],
       departs: [],
       columns: [
         {
@@ -272,17 +277,17 @@
           scopedSlots: { customRender: 'manufactureDate' }
         },
         {
-          title: '涓诲崟浣�',
+          title: '鍗曚綅',
           align: 'center',
           dataIndex: 'mainUnitName'
         },
         {
-          title: '涓绘暟閲�',
+          title: '鏁伴噺',
           align: 'center',
           dataIndex: 'mainQuantity',
           scopedSlots: { customRender: 'mainQuantity' }
         },
-        {
+        /* {
           title: '杈呭崟浣�',
           align: 'center',
           dataIndex: 'auxiliaryUnitName'
@@ -291,7 +296,7 @@
           title: '杈呮暟閲�',
           align: 'center',
           dataIndex: 'auxiliaryQuantity'
-        },
+        }, */
         {
           title: '鎿嶄綔',
           align: 'center',
@@ -344,10 +349,12 @@
         getSysDeparts: "/eam/equipment/getSysDeparts",
         add: '/spare/sparePartPurchaseStorage/add',
         edit: '/spare/sparePartPurchaseStorage/edit',
+        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
         getSuppliers: '/spare/sparePartPurchaseStorageDeatil/getSuppliers',
         getWarehouseAreas: '/spare/sparePartPurchaseStorageDeatil/getWarehouseAreas',
         getWarehouseLocations: '/spare/sparePartPurchaseStorageDeatil/getWarehouseLocations',
-        getWarehouses: '/base/warehouse/queryById'
+        getWarehouses: '/base/warehouse/queryById',
+        getNum: '/eam/sysIdentity/getNumNew',
       },
 
       dataSource: []
@@ -367,9 +374,9 @@
           model: data[i].model,
           mainUnitId: data[i].mainUnitId,
           mainUnitName: data[i].mainUnitId_dictText,
-          auxiliaryUnitId: data[i].auxiliaryUnitId,
+       /*    auxiliaryUnitId: data[i].auxiliaryUnitId,
           auxiliaryUnitName: data[i].auxiliaryUnitId_dictText,
-          conversionRatio: data[i].conversionRatio,
+          conversionRatio: data[i].conversionRatio, */
           constructorId: data[i].constructorId,
           constructorName: data[i].constructorId_dictText,
           suppliers: this.suppliers,
@@ -380,9 +387,7 @@
     })
   },
 
-  created() {
-    this.getSysDeparts();
-  },
+  created() {},
   methods: {
     getSysDeparts() {
       getAction(this.url.getSysDeparts).then((res) => {
@@ -414,6 +419,7 @@
       that.form.resetFields()
       that.model = Object.assign({}, record)
       that.visible = true
+      that.initOptions();
       if (record.sparePartPurchaseStorageDeatilList != undefined) {
         const temp = [...record.sparePartPurchaseStorageDeatilList]
         that.dataSource = temp
@@ -425,9 +431,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

--
Gitblit v1.9.3