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