ysy 2 ani în urmă
părinte
comite
40b4ed3c1c

+ 1 - 0
src/views/factoryModel/productionLine/components/edit.vue

@@ -422,6 +422,7 @@ export default {
        return time
        return time
     },
     },
     open(type, row) {
     open(type, row) {
+     
       this.type = type;
       this.type = type;
       this.visible = true;
       this.visible = true;
       if (type == 'edit') {
       if (type == 'edit') {

+ 19 - 18
src/views/material/materialBOM/components/edit-dialog.vue

@@ -74,8 +74,8 @@
       <template v-slot:toolbar>
       <template v-slot:toolbar>
         <el-button type="primary" @click="add">添加</el-button>
         <el-button type="primary" @click="add">添加</el-button>
       </template>
       </template>
-      <template v-slot:action="{ $index }">
-        <el-link type="primary" @click="handleDel($index)">删除</el-link>
+      <template v-slot:action="{row, $index }">
+        <el-link type="primary" @click="handleDel(row,$index)">删除</el-link>
       </template>
       </template>
       <template v-slot:subCode="{ row }">
       <template v-slot:subCode="{ row }">
         <el-input v-model="row.subCode" placeholder="请输入"></el-input>
         <el-input v-model="row.subCode" placeholder="请输入"></el-input>
@@ -147,6 +147,8 @@ export default {
         status: '-1',
         status: '-1',
 
 
       },
       },
+      removeSubBomIdList: [],
+
       categoryList: [
       categoryList: [
         {
         {
           value: 1,
           value: 1,
@@ -232,7 +234,7 @@ export default {
     };
     };
   },
   },
   methods: {
   methods: {
-    open(type, row) {
+   async open(type, row) {
       this.title = type;
       this.title = type;
       this.row = row;
       this.row = row;
       this.visible = true;
       this.visible = true;
@@ -242,6 +244,11 @@ export default {
         this.isUpdate = true
         this.isUpdate = true
         this._getById(row.id);
         this._getById(row.id);
 
 
+
+      const res  = await  detailPage({pageNum: 1, size: -1,  bomId: row.id})
+      this.tableData = res.list
+ 
+ 
     
     
       }
       }
     },
     },
@@ -275,7 +282,7 @@ export default {
         this.form.categoryCode = res.code;
         this.form.categoryCode = res.code;
         this.form.categoryId = res.id;
         this.form.categoryId = res.id;
         this.form.categoryName = res.name;
         this.form.categoryName = res.name;
-        console.log(res);
+
 
 
         this.getVersion() // 获取版本号
         this.getVersion() // 获取版本号
       });
       });
@@ -307,6 +314,8 @@ export default {
         this.loading = true;
         this.loading = true;
         if (!this.isUpdate) {
         if (!this.isUpdate) {
           delete this.form.id;
           delete this.form.id;
+        } else {
+          this.form.removeSubBomIdList =  this.removeSubBomIdList
         }
         }
 
 
         const data = {
         const data = {
@@ -319,7 +328,7 @@ export default {
           .then((msg) => {
           .then((msg) => {
             this.loading = false;
             this.loading = false;
             this.$message.success(msg);
             this.$message.success(msg);
-            this.updateVisible(false);
+            this.cancel()
             this.$emit('done');
             this.$emit('done');
           })
           })
           .catch((e) => {
           .catch((e) => {
@@ -330,13 +339,13 @@ export default {
 
 
     },
     },
 
 
-    /* 更新visible */
-    updateVisible(value) {
-      this.$emit('update:visible', value);
-    },
 
 
-    handleDel(index) {
+
+    handleDel(row,index) {
       this.tableData.splice(index, 1);
       this.tableData.splice(index, 1);
+      if(row?.id) {
+        this.removeSubBomIdList.push(row.id)
+      }
     },
     },
     cancel() {
     cancel() {
       this.visible = false
       this.visible = false
@@ -348,14 +357,6 @@ export default {
       this.form.status =  this.form.status + ''
       this.form.status =  this.form.status + ''
     },
     },
 
 
-    tableData (res) {
-        const { page, limit, where } = res;
-        return detailPage({
-          pageNum: page,
-          size: limit,
-          ...where
-        });
-      },
 
 
   }
   }
 };
 };

+ 1 - 1
src/views/material/materialBOM/components/view-dialog.vue

@@ -40,7 +40,7 @@
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="分类层级" prop="categoryType">
           <el-form-item label="分类层级" prop="categoryType">
-            {{ categoryList[formData.categoryType - 1].label }}
+            {{ formData.categoryType }}
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">

+ 1 - 1
src/views/material/materialBOM/index.vue

@@ -28,7 +28,7 @@
       </ele-pro-table>
       </ele-pro-table>
     </el-card>
     </el-card>
     <ViewDialog ref="detailDialogRef" :statusOpt="statusOpt" />
     <ViewDialog ref="detailDialogRef" :statusOpt="statusOpt" />
-    <EditDialog ref="editDialogRef" :statusOpt="statusOpt"></EditDialog>
+    <EditDialog ref="editDialogRef" :statusOpt="statusOpt"       @done="reload"></EditDialog>
   </div>
   </div>
 </template>
 </template>