From ee79f53fd9385b087ebd7a93af638d91a9825d10 Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期三, 23 八月 2023 18:04:35 +0800
Subject: [PATCH] lnl,设备台账导入功能+页面字段调整

---
 src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue |   60 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue b/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue
index 798b1a2..29ded9d 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'>
@@ -94,6 +102,7 @@
   },
   data() {
     return {
+      treeData:[],
       bordered:true,
       departs: [],
       labelCol: {
@@ -172,7 +181,7 @@
           },
 
           {
-            title: '涓诲崟浣�',
+            title: '鍗曚綅',
             key: 'mainUnitIdName',
             type: JVXETypes.normal,
             align:'center',
@@ -181,7 +190,7 @@
             defaultValue: ''
           },
           {
-            title: '涓诲崟浣�',
+            title: '鍗曚綅',
             key: 'mainUnitId',
             type: JVXETypes.hidden,
             align:'center',
@@ -189,7 +198,7 @@
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
           },
-          {
+         /*  {
             title: '杈呭崟浣�',
             key: 'auxiliaryUnitIdName',
             align:'center',
@@ -206,7 +215,7 @@
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: ''
-          },
+          }, */
           {
             title: '涓绘暟閲�',
             key: 'mainQuantity',
@@ -215,17 +224,19 @@
             width: '200px',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: 0,
-            formatter({ cellValue, row, column }) {
-
+/*             Function({cellValue, row, column}){
+              console.log(cellValue)
+              console.log(row)
+              console.log(column)
               if (cellValue != null) {
                 let conversionRatio = row.conversionRatio
-
+                console.log(conversionRatio)
                 row.auxiliaryQuantity = Math.abs(cellValue * conversionRatio)
 
               }
+              console.log(cellValue)
               return cellValue
-
-            },
+            }, */
             validateRules: [
               {
                 required: true,
@@ -243,7 +254,7 @@
             ]
           },
 
-          {
+         /*  {
             title: '杈呮暟閲�',
             key: 'auxiliaryQuantity',
             type: JVXETypes.normal,
@@ -251,7 +262,7 @@
             align:'center',
             placeholder: '璇疯緭鍏�${title}',
             defaultValue: 0
-          },
+          }, */
           {
             title: '澶囦欢id',
             key: 'sparePartId',
@@ -293,6 +304,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'
@@ -326,9 +338,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) {
@@ -375,8 +396,6 @@
             auxiliaryUnitId: data[i].auxiliaryUnitId,
             mainUnitIdName: data[i].mainUnitId_dictText,
             auxiliaryUnitIdName: data[i].auxiliaryUnitId_dictText,
-            mainQuantity: data[i].mainQuantity,
-            auxiliaryQuantity: data[i].auxiliaryQuantity,
             requirementTime: data[i].requirementTime,
             conversionRatio: data[i].conversionRatio
 
@@ -439,7 +458,14 @@
       this.visible = false
       this.$emit('close')
       this.$refs.form.clearValidate()
-    }
+    },
+/*     changeAuxiliaryQuantity(target){
+      console.log(target.columnIndex)
+      let num=target.columnIndex
+      if (target.columnIndex ===num){
+        target.row.auxiliaryQuantity=Math.abs(target.row.conversionRatio*target.row.mainQuantity)
+      }
+    } */
   }
 }
 </script>

--
Gitblit v1.9.3