ysy %!s(int64=2) %!d(string=hai) anos
pai
achega
2d82fe7e9e
Modificáronse 1 ficheiros con 24 adicións e 12 borrados
  1. 24 12
      src/views/technology/productParam/components/process.vue

+ 24 - 12
src/views/technology/productParam/components/process.vue

@@ -15,16 +15,17 @@
 
 
         <!-- 展开内容 -->
-        <template v-slot:expand="{ row }">
+        <template v-slot:expand="{ row, $index }">
 
           <div style="width:100%; min-height: 60px" v-if="row.produceList">
-            <ele-pro-table        :toolbar="false"
-            toolsTheme="none" ref="table2" :need-page="false" :datasource="row.produceList" :columns="columns2"
-              row-key="code">
+            <ele-pro-table :toolbar="false" toolsTheme="none" ref="table2" :need-page="false"
+              :datasource="row.produceList" :columns="columns2" :key="row.code + '-' + $index">
 
 
               <!-- 默认值 -->
               <template v-slot:defaultValue="{ row }">
+
+
                 <el-input v-if="row.textType == 1 || row.textType == 4 || row.textType == 5" v-model="row.defaultValue"
                   placeholder="请输入"></el-input>
                 <el-select v-if="row.textType == 2" v-model="row.defaultValue" placeholder="请选择">
@@ -247,23 +248,24 @@ export default {
 
 
     openEdit() {
-     
       let tableList = []
       tableList = this.$refs.table.getData()
+
       this.$refs.processModalRef.open(tableList)
     },
 
     chooseProcess(data) {
-      
+
       let _arr = [...data, ...this.$refs.table.getData()]
       this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
-   
+
 
       this.$emit('chooseProcess', _arr)
 
     },
 
     chooseModal(data, current) {
+      console.log(current)
       data.map((m => {
         m.parentId = current.id
         return {
@@ -272,18 +274,28 @@ export default {
       }))
 
       let tableList = []
+      let clonedArray = []
       tableList = this.$refs.table.getData()
-      console.log(tableList)
 
-      tableList.forEach(e => {
+
+
+
+
+      clonedArray = JSON.parse(JSON.stringify(tableList));
+
+
+
+
+      clonedArray.forEach(e => {
         if (e.id == current.id) {
           e.produceList = data
 
         }
       })
 
-      this.$refs.table.setData([...tableList]);
-      this.$emit('chooseProcess', tableList)
+
+      this.$refs.table.setData([...clonedArray]);
+      this.$emit('chooseProcess', clonedArray)
     },
 
 
@@ -300,7 +312,7 @@ export default {
 
 
     remove2(row) {
-    
+
       const data = this.$refs.table.getData() ?? [];
       data.forEach((e) => {
         if (row.parentId == e.id) {