From a01a0b502447a0ca0a45f1849cde4f0bed1ef1f8 Mon Sep 17 00:00:00 2001
From: houjie <714924425@qq.com>
Date: 星期六, 19 八月 2023 18:03:34 +0800
Subject: [PATCH] 备品备件:调整  部门

---
 src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue b/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue
index bd4fd00..1e8fda8 100644
--- a/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue
+++ b/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue
@@ -18,12 +18,20 @@
                 v-model='model.departId'
                 dictCode="sys_depart,depart_name,id,del_flag!='1'"
               />-->
-              <a-select
+              <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-select
                 :placeholder="'璇烽�夋嫨鐢宠閮ㄩ棬'"
                 :options="this.departs"
                 style="width: 100%"
                 v-model='model.departId'
-              />
+              />-->
             </a-form-model-item>
           </a-col>
           <a-col :span='12'>
@@ -51,7 +59,9 @@
           :dataSource='sparesScrapRequirementDetailTable.dataSource'
           :maxHeight='300'
           :disabled='formDisabled'
+          :alwaysEdit='true'
           :rowNumber='true'
+          :bordered='bordered'
           :rowSelection='true'
           :toolbar='true'
           :toolbarConfig='toolbarConfig'
@@ -92,6 +102,8 @@
   },
   data() {
     return {
+      treeData:[],
+      bordered:true,
       departs: [],
       labelCol: {
         xs: { span: 24 },
@@ -133,6 +145,7 @@
             title: '澶囦欢缂栫爜',
             key: 'spareNum',
             fixed: 'left',
+            align:'center',
             type: JVXETypes.normal,
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
@@ -141,6 +154,7 @@
           {
             title: '澶囦欢鍚嶇О',
             key: 'spareName',
+            align:'center',
             fixed: 'left',
             type: JVXETypes.normal,
             width: '200px',
@@ -151,6 +165,7 @@
             title: '鍨嬪彿',
             key: 'model',
             type: JVXETypes.normal,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
@@ -159,6 +174,7 @@
             title: '瑙勬牸',
             key: 'specification',
             type: JVXETypes.normal,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
@@ -168,6 +184,7 @@
             title: '涓诲崟浣�',
             key: 'mainUnitIdName',
             type: JVXETypes.normal,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
@@ -176,6 +193,7 @@
             title: '涓诲崟浣�',
             key: 'mainUnitId',
             type: JVXETypes.hidden,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
@@ -183,6 +201,7 @@
           {
             title: '杈呭崟浣�',
             key: 'auxiliaryUnitIdName',
+            align:'center',
             type: JVXETypes.normal,
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
@@ -192,6 +211,7 @@
             title: '杈呭崟浣�',
             key: 'auxiliaryUnitId',
             type: JVXETypes.hidden,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
@@ -200,6 +220,7 @@
             title: '涓绘暟閲�',
             key: 'mainQuantity',
             type: JVXETypes.inputNumber,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: 0,
@@ -236,6 +257,7 @@
             key: 'auxiliaryQuantity',
             type: JVXETypes.normal,
             width: '200px',
+            align:'center',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: 0
           },
@@ -243,6 +265,7 @@
             title: '澶囦欢id',
             key: 'sparePartId',
             type: JVXETypes.hidden,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
@@ -251,6 +274,7 @@
             title: '鎹㈢畻姣斾緥',
             key: 'conversionRatio',
             type: JVXETypes.hidden,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
@@ -260,6 +284,7 @@
             title: '闇�姹傛棩鏈�',
             key: 'requirementTime',
             type: JVXETypes.date,
+            align:'center',
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: '',
@@ -277,6 +302,7 @@
         add: '/spare/sparePartRequirement/add',
         edit: '/spare/sparePartRequirement/edit',
         queryById: '/spare/sparePartRequirement/queryById',
+        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
         getSysDeparts: "/eam/equipment/getSysDeparts",
         sparesScrapRequirementDetail: {
           list: '/spare/sparePartRequirement/querySparesScrapRequirementDetailByMainId'
@@ -310,9 +336,18 @@
     })
   },
   created() {
-    this.getSysDeparts()
+    this.initOptions()
   },
   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) {

--
Gitblit v1.9.3