소스 검색

解决BOM管理配置初始化问题

huang_an 1 년 전
부모
커밋
4e35fe1eec
1개의 변경된 파일28개의 추가작업 그리고 6개의 파일을 삭제
  1. 28 6
      src/views/material/BOMmanage/components/workingProcedure.vue

+ 28 - 6
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -1314,6 +1314,9 @@
           createName: userInfo.name,
           createTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
         });
+        this.$refs.fileTable.setData(
+          this.tableData.taskParam[this.currentIndex]['fileParam']
+        );
       },
       addJob() {
         this.$refs.jobRef.open();
@@ -1450,6 +1453,7 @@
       },
       tabsChange() {
         console.log(this.activeName);
+        console.log(this.tableData.taskParam[this.currentIndex]);
         if (this.activeName === '工艺参数') {
           // 工艺参数
           this.$refs.table.setData(
@@ -1480,13 +1484,31 @@
             this.tableData.taskParam[this.currentIndex].replaceMaterial || []
           );
         } else if (this.activeName === '工种') {
-          this.$refs.jobTable.setData(
-            this.tableData.taskParam[this.currentIndex].aptitudeParam || []
-          );
+          if (
+            JSON.stringify(
+              this.tableData.taskParam[this.currentIndex].aptitudeParam
+            ) == '{}'
+          ) {
+            this.tableData.taskParam[this.currentIndex].aptitudeParam = [];
+            this.$refs.jobTable.setData([]);
+          } else {
+            this.$refs.jobTable.setData(
+              this.tableData.taskParam[this.currentIndex].aptitudeParam
+            );
+          }
         } else if (this.activeName === '工艺文件') {
-          this.$refs.fileTable.setData(
-            this.tableData.taskParam[this.currentIndex].fileParam || []
-          );
+          if (
+            JSON.stringify(
+              this.tableData.taskParam[this.currentIndex].fileParam
+            ) == '{}'
+          ) {
+            this.tableData.taskParam[this.currentIndex].fileParam = [];
+            this.$refs.fileTable.setData([]);
+          } else {
+            this.$refs.fileTable.setData(
+              this.tableData.taskParam[this.currentIndex].fileParam
+            );
+          }
         }
       },
       openParam(type) {