From 5381292617ad40f2fc7a9266ceb964a672d25a5a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 13 十一月 2023 18:30:42 +0800
Subject: [PATCH] 	modified:   src/views/basic/param/index.vue 	modified:   src/views/basic/template/index.vue 	modified:   src/views/common/param-mergeTemplate.vue 	modified:   src/views/plan/customerorder/index.vue

---
 src/views/basic/param/index.vue |   55 ++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/src/views/basic/param/index.vue b/src/views/basic/param/index.vue
index 113eb28..32c34ef 100644
--- a/src/views/basic/param/index.vue
+++ b/src/views/basic/param/index.vue
@@ -17,7 +17,7 @@
             <el-form-item class="btn-group">
               <el-button type="" @click="onSearch">鏌ヨ</el-button>
               <el-button type="primary" @click="addOrUpdateHandle">鏂板</el-button>
-              <el-button @click="showImportDialog">瀵煎叆</el-button>
+              <el-button type="primary" @click="showImportDialog">瀵煎叆</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -173,16 +173,31 @@
     ...mapGetters(['permissions'])
   },
   created() {
+    this.loading = true
     this.getData()
     this.getParamType()
-  },
-  beforeUpdate() {
-    console.log("updated");
     this.rowSort()
     this.rowCalc()
     this.loading = false
   },
-  watch: {},
+  // beforeUpdate() {
+  //   console.log("updated");
+  //   this.rowSort()
+  //   this.rowCalc()
+  //   this.loading = false
+  // },
+  watch: {
+    tableData:{
+            handler(old,newval){
+                this.loading = true
+                // this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
+                this.rowSort()
+                this.rowCalc()
+                this.loading = false
+            },
+            deep: true
+        }
+  },
   methods: {
     //涓嬭浇妯℃澘
     downloadTemplate() {
@@ -267,32 +282,42 @@
       this.option.column.forEach(item => {
         if (row.paramItemThree == "" && item.prop == 'paramItemThree') {
           item.display = false
+        }else if(row.paramItemThree != "" && item.prop == 'paramItemThree'){
+          item.display = true
         }
         if (row.paramItemTwo == "" && item.prop == 'paramItemTwo') {
           item.display = false
+        }else if(row.paramItemTwo != "" && item.prop == 'paramItemTwo'){
+          item.display = true
         }
       })
+      console.log(row);
+      // let type=this.typeOptions.filter(t=>{
+      //   return t.label==row.paramType
+      // })[0]
+      // row.paramType=type.value
       this.$refs.crud.rowEdit(row, index)
     },
     showDel(row, index) {
       this.$refs.crud.rowDel(row, index)
     },
     updateParam(row, index, done, loading) {
+      // console.log(row);
       // this.formDisabled = true
       let data = {
         dict: '',
-        id: 0,
+        id: '',
         parameterFormat: '',
         parameterItem: '',
         type: row.paramType,
         unit: row.unit,
       }
       row.paramType == '2' ? data.dict = row.paramFormat : data.parameterFormat = row.paramFormat
-      if (row.threeId) {
+      if (row.threeId!="null") {
         data.id = row.threeId
         data.parameterItem = row.paramItemThree
       } else {
-        if (row.twoId) {
+        if (row.twoId!="null") {
           data.id = row.twoId
           data.parameterItem = row.paramItemTwo
         } else {
@@ -300,7 +325,14 @@
           data.parameterItem = row.paramItem
         }
       }
-      console.log(data)
+      if(data.type=='鏂囨湰鏍煎紡'){
+        let type=this.typeOptions.filter(t=>{
+        return t.label==row.paramType
+      })[0]
+      data.type=type.value
+      }
+      // console.log(data);
+      // return
       putObj(data).then(res => {
         if (res.data.data.code == 0) {
           this.$message.success("鏇存柊鎴愬姛")
@@ -353,6 +385,7 @@
     },
     // 鏂板 / 淇敼
     addOrUpdateHandle(row) {
+      console.log("1111",row);
       this.addOrUpdateVisible = true
       this.$nextTick(() => {
         this.$refs.addOrUpdate.init(row == null ? null : row.id)
@@ -442,9 +475,9 @@
 </script>
 
 <style>
-.grid-header {
+/* .grid-header {
   display: none;
-}
+} */
 
 .param-basic {
   margin: 0 10px;

--
Gitblit v1.9.3