|
|
@@ -7,7 +7,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
|
|
|
-
|
|
|
+
|
|
|
<el-form-item label="产品名称:" prop="name">
|
|
|
<el-input disabled v-model="form.name" readonly />
|
|
|
</el-form-item>
|
|
|
@@ -50,7 +50,7 @@
|
|
|
<el-tabs v-model="tabsValue" type="card" closable @tab-click="handleTab" @tab-remove="removeTab">
|
|
|
<el-tab-pane v-for="(item, index) in tabsList" :key="item.id + index" :label="item.name" :name="item.id">
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
<header-title title="物料BOM" style="margin-top: 10px">
|
|
|
<div>
|
|
|
@@ -367,7 +367,6 @@ export default {
|
|
|
},
|
|
|
|
|
|
removeTab(targetName) {
|
|
|
-
|
|
|
this.tabsList.forEach(e => {
|
|
|
if (e.id == targetName) {
|
|
|
bomTaskDelete([e.oldId]).then(res => {
|
|
|
@@ -398,7 +397,6 @@ export default {
|
|
|
|
|
|
if (this.tabsList.length > 0) {
|
|
|
this.tabsValue = this.tabsList[0].id
|
|
|
-
|
|
|
this.saveBatchFn()
|
|
|
}
|
|
|
|
|
|
@@ -422,7 +420,8 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- taskListHead() {
|
|
|
+ taskListHead(isFirst) {
|
|
|
+ console.log(isFirst)
|
|
|
bomTaskList(this.categoryId).then(res => {
|
|
|
let arr = []
|
|
|
arr = res.map(m => {
|
|
|
@@ -434,7 +433,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.tabsList = arr
|
|
|
+
|
|
|
+ if (isFirst && this.tabsList.length > 0) {
|
|
|
+ this.tabsValue = this.tabsList[0].id
|
|
|
+ this.getCategoryBomFn(this.tabsList[0].id);
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
},
|
|
|
@@ -446,14 +452,14 @@ export default {
|
|
|
|
|
|
if (this.data) {
|
|
|
this.categoryId = this.data.id;
|
|
|
-
|
|
|
+
|
|
|
this.$util.assignObject(this.form, {
|
|
|
...this.data
|
|
|
});
|
|
|
} else {
|
|
|
}
|
|
|
|
|
|
- this.taskListHead()
|
|
|
+ this.taskListHead(true)
|
|
|
} else {
|
|
|
this.$refs.form.clearValidate();
|
|
|
this.form = { ...this.defaultForm };
|