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/sparePartCancellingStocks/SparePartCancellingStocksModal.vue |   51 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue b/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue
index bec2b86..117bdce 100644
--- a/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue
+++ b/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue
@@ -19,6 +19,7 @@
               :wrapperCol='wrapperCol'
             >
               <a-input
+                :disabled="true"
                 placeholder='璇疯緭鍗曟嵁鍙�'
                 v-decorator="['num', validatorRules.num]"
               />
@@ -30,18 +31,12 @@
               :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-model='model.departId'
               />
             </a-form-item>
@@ -88,6 +83,7 @@
       type='primary'
       :style="{ marginRight: '8px',marginBottom:'8px' }"
       :loading='confirmLoading'
+      :disabled="disableSubmit"
       @click='selectSparePartInventory()'
     >澧炲姞澶囦欢搴撳瓨淇℃伅
     </a-button>
@@ -108,6 +104,7 @@
         <div :key='col.dataIndex'>
           <a-input-number
             :value='text'
+            :disabled="disableSubmit"
             v-if="col.dataIndex == 'mainQuantity'"
             :min='0'
             :max='record.outboundMainQuantity'
@@ -123,6 +120,7 @@
       >
         <a-popconfirm
           title='纭畾鍒犻櫎鍚�?'
+          :disabled="disableSubmit"
           @confirm='() => handleDelete(text,record, index)'
         >
           <a>鍒犻櫎</a>
@@ -140,6 +138,7 @@
       <a-button
         @click='handleOk()'
         type='primary'
+        :disabled="disableSubmit"
         :loading='confirmLoading'
       >纭畾
       </a-button>
@@ -166,6 +165,7 @@
   data() {
     return {
       departId:[],
+      treeData:[],
       columns: [
         {
           title: '#',
@@ -231,7 +231,7 @@
           dataIndex: 'warehouseLocationNum'
         },
         {
-          title: '涓诲崟浣�',
+          title: '鍗曚綅',
           align: 'center',
           dataIndex: 'mainUnitName'
         },
@@ -240,11 +240,11 @@
           align: 'center',
           dataIndex: 'outboundMainQuantity'
         },
-        {
+        /* {
           title: '杈呭崟浣�',
           align: 'center',
           dataIndex: 'auxiliaryUnitName'
-        },
+        }, */
         {
           title: '閫�搴撴暟閲�',
           align: 'center',
@@ -304,6 +304,8 @@
       url: {
         add: '/spare/sparePartCancellingStocks/add',
         getSysDeparts: "/eam/equipment/getSysDeparts",
+        getNum: '/eam/sysIdentity/getNumNew',
+        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
         edit: '/spare/sparePartCancellingStocks/edit'
       },
 
@@ -326,9 +328,6 @@
           model: data[i].model,
           mainUnitId: data[i].mainUnitId,
           mainUnitName: data[i].mainUnitName,
-          auxiliaryUnitId: data[i].auxiliaryUnitId,
-          auxiliaryUnitName: data[i].auxiliaryUnitName,
-          conversionRatio: data[i].conversionRatio,
           constructorId: data[i].constructorId,
           constructorName: data[i].constructorName,
           supplierId: data[i].supplierId,
@@ -344,10 +343,18 @@
     })
   },
   created() {
-    this.getSysDeparts()
   },
 
   methods: {
+    initOptions() {
+      getAction(this.url.loadOptions).then(res => {
+        if (res.success) {
+          this.treeData = res.result
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    },
     getSysDeparts() {
       getAction(this.url.getSysDeparts).then((res) => {
         if (res.success) {
@@ -381,6 +388,7 @@
       that.form.resetFields()
       that.model = Object.assign({}, record)
       that.visible = true
+      that.initOptions()
       that.warehouseId = record.warehouseId
       if (record.sparePartCancellingStocksDetailList != undefined) {
         const temp = [...record.sparePartCancellingStocksDetailList]
@@ -393,6 +401,13 @@
         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 });
+            }
+          })
+        });
       }
     },
 

--
Gitblit v1.9.3