ysy 2 лет назад
Родитель
Сommit
8054366304

+ 3 - 2
src/views/material/product/components/MaterialAdd.vue

@@ -161,7 +161,6 @@ export default {
 
         const defaultForm = {
             id: null,
-
             code: '',
             name: '',
             version: '1.0',
@@ -171,6 +170,8 @@ export default {
             produceVersionId: '',
             baseCount: '',
             baseCountUnit: '',
+            taskId: '',
+            
           
 
         };
@@ -380,7 +381,7 @@ export default {
                     .then((msg) => {
                         this.loading = false;
                         this.$message.success(msg);
-                        this.$emit('done', this.taskId);
+                        this.$emit('done', this.form['taskId']);
                         this.visible = false
                     })
                     .catch((e) => {

+ 13 - 7
src/views/material/product/components/MaterialModal.vue

@@ -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 };

+ 1 - 1
src/views/technology/route/components/production/index.vue

@@ -57,7 +57,7 @@ export default {
           width: 45,
           align: 'center',
           selectable: (row, index) => {
-            return !this.tableData.some((it) => it.sourceTaskId == row.id);
+            return !this.tableData.some((it) => it.sourceTaskId == row.id || it.id == row.id);
           },
 
           reserveSelection: true,