ysy 2 lat temu
rodzic
commit
85bca4fb2b

+ 9 - 3
src/views/technology/productParam/components/ParamModal.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-dialog :title="title" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+    <el-dialog :title="title" v-if="visible" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
         :close-on-press-escape="false" append-to-body width="70%">
 
         <el-card shadow="never">
@@ -10,6 +10,8 @@
                 row-key="code">
 
 
+
+
                 <template v-slot:status="{ row }">
                     {{ checkType(row.categoryType) }}
                 </template>
@@ -57,9 +59,12 @@ export default {
                     reserveSelection: true,
                     fixed: 'left'
                 },
+
+         
+
                 {
                     prop: 'code',
-                    label: '参数编码',
+                    label: '参数编码2',
                     showOverflowTooltip: true,
                     align: 'center',
                     minWidth: 110
@@ -160,8 +165,9 @@ export default {
             this.$refs.table.reload({ page: 1, where: where });
         },
         open(item, current) {
+           
             if (item) {
-                this.tableData = item
+                this.tableData =  JSON.parse(JSON.stringify(item));  
             }
             if(current) {
                 this.current = current

+ 28 - 8
src/views/technology/productParam/components/process.vue

@@ -22,6 +22,11 @@
               :datasource="row.produceList" :columns="columns2" :key="row.code + '-' + $index">
 
 
+
+              <template v-slot:sort="{ row }">
+                <el-input v-model="row.sort"></el-input>
+              </template>
+
               <!-- 默认值 -->
               <template v-slot:defaultValue="{ row }">
 
@@ -163,6 +168,13 @@ export default {
 
       // 表格列配置
       columns2: [
+
+        {
+          prop: 'sort',
+          slot: 'sort',
+          label: '排序',
+          minWidth: 60
+        },
         {
           prop: 'code',
           label: '参数编码',
@@ -170,6 +182,8 @@ export default {
           align: 'center',
           minWidth: 110
         },
+
+
         {
           prop: 'name',
           label: '参数名称',
@@ -262,10 +276,12 @@ export default {
 
       this.$emit('chooseProcess', _arr)
 
+
+
     },
 
     chooseModal(data, current) {
-      console.log(current)
+
       data.map((m => {
         m.parentId = current.id
         return {
@@ -278,17 +294,16 @@ export default {
       tableList = this.$refs.table.getData()
 
 
-
-
-
       clonedArray = JSON.parse(JSON.stringify(tableList));
 
-
-
-
       clonedArray.forEach(e => {
         if (e.id == current.id) {
-          e.produceList = data
+          if(e.hasOwnProperty('produceList')) {
+            e.produceList = [...e.produceList, ...data] 
+          } else {
+            e.produceList = [ ...data] 
+          }
+      
 
         }
       })
@@ -296,6 +311,11 @@ export default {
 
       this.$refs.table.setData([...clonedArray]);
       this.$emit('chooseProcess', clonedArray)
+
+      this.$nextTick(() => {
+          this.$refs.table.toggleRowExpansionAll()
+          this.$forceUpdate()
+        })
     },