|
@@ -179,7 +179,7 @@
|
|
|
import MaterialAdd from './MaterialAdd.vue';
|
|
import MaterialAdd from './MaterialAdd.vue';
|
|
|
import { pageList } from '@/api/technology/version/version.js';
|
|
import { pageList } from '@/api/technology/version/version.js';
|
|
|
import { getCategoryBom } from '@/api/material/product';
|
|
import { getCategoryBom } from '@/api/material/product';
|
|
|
-import { bomDelete } from '@/api/material/BOM';
|
|
|
|
|
|
|
+import { bomDelete, saveBatch, bomTaskList } from '@/api/material/BOM';
|
|
|
import factorySelect from '@/components/CommomSelect/factory-select.vue';
|
|
import factorySelect from '@/components/CommomSelect/factory-select.vue';
|
|
|
import Production from '@/views/technology/route/components/production/index.vue'
|
|
import Production from '@/views/technology/route/components/production/index.vue'
|
|
|
|
|
|
|
@@ -386,20 +386,60 @@ export default {
|
|
|
|
|
|
|
|
/*关闭选择参数*/
|
|
/*关闭选择参数*/
|
|
|
closeAdd() {
|
|
closeAdd() {
|
|
|
- // this.$refs.ProductionCom.$refs.table.setSelectedRows([]);
|
|
|
|
|
|
|
+ this.$refs.ProductionCom.$refs.table.setSelectedRows([]);
|
|
|
this.addDialog = false;
|
|
this.addDialog = false;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
addParamrter() {
|
|
addParamrter() {
|
|
|
- let arr = this.$refs.ProductionCom.selection;
|
|
|
|
|
|
|
+ let arr = [] ;
|
|
|
|
|
+ arr = this.$refs.ProductionCom.selection.map(m => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ sourceTaskId: m.id,
|
|
|
|
|
+ ...m
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
this.tabsList = arr
|
|
this.tabsList = arr
|
|
|
this.addDialog = false;
|
|
this.addDialog = false;
|
|
|
|
|
|
|
|
if( this.tabsList.length > 0) {
|
|
if( this.tabsList.length > 0) {
|
|
|
this.tabsValue = this.tabsList[0].id
|
|
this.tabsValue = this.tabsList[0].id
|
|
|
|
|
+
|
|
|
|
|
+ this.saveBatchFn()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 保存
|
|
|
|
|
+ saveBatchFn() {
|
|
|
|
|
+ let arr = [] ;
|
|
|
|
|
+ arr = this.tabsList.map(m => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ taskId: m.id,
|
|
|
|
|
+ sort: m.sort,
|
|
|
|
|
+ categoryId: this.categoryId
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ saveBatch(arr).then(res => {
|
|
|
|
|
+ this.taskListHead()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ taskListHead() {
|
|
|
|
|
+ bomTaskList(this.categoryId).then(res => {
|
|
|
|
|
+ let arr = []
|
|
|
|
|
+ arr = res.map(m => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ sourceTaskId: m.id,
|
|
|
|
|
+ id: m.taskId,
|
|
|
|
|
+ name: m.taskName
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.tabsList = arr
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -407,6 +447,7 @@ export default {
|
|
|
async visible(visible) {
|
|
async visible(visible) {
|
|
|
if (visible) {
|
|
if (visible) {
|
|
|
this.getVersionList();
|
|
this.getVersionList();
|
|
|
|
|
+
|
|
|
if (this.data) {
|
|
if (this.data) {
|
|
|
this.categoryId = this.data.id;
|
|
this.categoryId = this.data.id;
|
|
|
this.getCategoryBomFn();
|
|
this.getCategoryBomFn();
|
|
@@ -415,6 +456,8 @@ export default {
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ this.taskListHead()
|
|
|
} else {
|
|
} else {
|
|
|
this.$refs.form.clearValidate();
|
|
this.$refs.form.clearValidate();
|
|
|
this.form = { ...this.defaultForm };
|
|
this.form = { ...this.defaultForm };
|