ysy 1 年之前
父節點
當前提交
81aac61377

+ 2 - 2
src/views/material/BOMmanage/components/standardOutput.vue

@@ -202,7 +202,7 @@
         try {
           this.treeLoading = true;
 
-          const res = await getTreeByPid(9);
+          const res = await getTreeByPid(this.type);
           this.treeLoading = false;
           if (res?.code === '0') {
             this.treeList = res.data;
@@ -230,7 +230,7 @@
         if (this.selection.length <= 0) {
           return this.$message.warning('请至少选择一条数据');
         }
-        this.$emit('selection', this.selection);
+        this.$emit('selection', this.type,this.selection);
         this.handleClose();
       }
     }

+ 53 - 38
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -619,6 +619,27 @@
             </template>
           </ele-pro-table>
         </el-tab-pane>
+
+        <el-tab-pane label="关键设备" name="关键设备">
+          <ele-pro-table
+            ref="deviceTabRef"
+            :columns="standardCol"
+            :datasource="datasource"
+            :need-page="false"
+            :immediate="true"
+          >
+            <!-- 表头工具栏 -->
+            <template v-if="!isView" v-slot:toolbar>
+              <el-button type="primary" @click="add">添加</el-button>
+            </template>
+            <template v-slot:action="{ row, $index }">
+              <el-link type="danger" @click="handleDel(row, $index)"
+                >删除</el-link
+              >
+            </template>
+          </ele-pro-table>
+        </el-tab-pane>
+
         <el-tab-pane label="制造资源" name="制造资源">
           <ele-pro-table
             ref="resourceTable"
@@ -982,7 +1003,7 @@
               <el-button type="primary" @click="add">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link    type="danger" @click="handleDel(row, $index)"
+              <el-link type="danger" @click="handleDel(row, $index)"
                 >删除</el-link
               >
             </template>
@@ -1368,34 +1389,6 @@
             minWidth: 90
           },
 
-          {
-            prop: 'weightUnit',
-            label: '重量单位',
-            showOverflowTooltip: true,
-            minWidth: 90
-          },
-
-          {
-            prop: 'roughWeight',
-            label: '毛重',
-            showOverflowTooltip: true,
-            minWidth: 90
-          },
-
-          {
-            prop: 'netWeight',
-            label: '净重',
-            showOverflowTooltip: true,
-            minWidth: 90
-          },
-
-          {
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
-
           {
             columnKey: 'action',
             label: '操作',
@@ -1511,6 +1504,7 @@
         this.$refs.productRefs.open(row, '选择物料', '1', idx);
       },
       handleDel(row, index) {
+      
         let type = '';
         if (this.activeName === '材料定额') {
           type = 'materialQuota';
@@ -1524,9 +1518,10 @@
           type = 'fileParam';
         } else if (this.activeName === '标准产出') {
           type = 'standardOutput';
+        } else if (this.activeName === '关键设备') {
+          type = 'standardDevice';
         }
 
-        console.log(this.currentIndex,44)
         this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
       },
       addProductList(list) {
@@ -1605,7 +1600,10 @@
           this.$refs.productMultipleRefs.open(1);
           return;
         } else if (this.activeName === '标准产出') {
-          this.$refs.standardOutputRefs.open();
+          this.$refs.standardOutputRefs.open(9);
+          return;
+        } else if (this.activeName === '关键设备') {
+          this.$refs.standardOutputRefs.open(4);
           return;
         } else if (this.activeName === '制造资源') {
           type = 'resource';
@@ -1706,6 +1704,10 @@
           this.$refs.standard.setData(
             this.tableData.taskParam[this.currentIndex].standardOutput || []
           );
+        } else if (this.activeName === '关键设备') {
+          this.$refs.deviceTabRef.setData(
+            this.tableData.taskParam[this.currentIndex].standardDevice || []
+          );
         }
       },
       openParam(type) {
@@ -1732,15 +1734,28 @@
         );
       },
 
-      chooseStandardList(data) {
+      chooseStandardList(type, data) {
         let dom = null;
-        dom = this.$refs.standard;
-        dom.setData([ data[0]]);
 
-        this.$set(
-          this.tableData.taskParam[this.currentIndex],
-          dom.getData()
-        );
+        if (type == 9) {
+          dom = this.$refs.standard;
+          dom.setData([data[0]]);
+
+          this.$set(
+            this.tableData.taskParam[this.currentIndex],
+            'standardOutput',
+            dom.getData()
+          );
+        } else if (type == 4) {
+          dom = this.$refs.deviceTabRef;
+          dom.setData([data[0]]);
+
+          this.$set(
+            this.tableData.taskParam[this.currentIndex],
+            'standardDevice',
+            dom.getData()
+          );
+        }
       },
       remove(row, type) {
         let dom = null;