外协工序调整

dev-scheduling
zhangdi 3 days ago
parent b37a6e2447
commit 3be21b8aef
  1. 96
      src/views/productionSchedulingPlan/basic/oemProcess.vue

@ -89,31 +89,52 @@ export default {
searchMenuPosition: 'right',
align: 'center',
column: [
{
label: '工序',
prop: 'processId',
search: true,
prop: 'processIds',
search: false,
sortable: true,
span: 12,
type: 'select',
filterable: true,
multiple: true,
hide: true,
dicUrl: '/blade-scheduling/processSet/findList',
props: {
label: 'name',
value: 'id',
},
change: (val, row) => {
this.onChangeData(val.item, 'processId');
console.log('change', val, row);
this.onChangeData(val, 'processIds', row);
},
},
{
label: '工序',
prop: 'processIds',
search: true,
sortable: true,
span: 12,
type: 'select',
filterable: true,
multiple: false,
hide: true,
display:false,
dicUrl: '/blade-scheduling/processSet/findList',
props: {
label: 'name',
value: 'id',
},
// change: (val, row) => {
// this.onChangeData(val, 'processIds', row);
// },
},
{
label: '工序',
prop: 'processName',
search: false,
sortable: true,
span: 12,
hide: true,
display: false,
},
{
@ -123,7 +144,7 @@ export default {
sortable: true,
span: 12,
type: 'number',
precision: 0
precision: 0,
},
{
label: '备注',
@ -139,16 +160,41 @@ export default {
};
},
methods: {
onChangeData(val, type) {
if (val && type == 'workCenterId') {
this.form.workCenterName = val.wcName;
}
if (val && type == 'processId') {
this.form.processName = val.name;
}
if (val && type == 'craftId') {
this.form.craftName = val.caName;
onChangeData(val, type, row) {
// if (val && type == 'workCenterId') {
// this.form.workCenterName = val.wcName;
// }
if (val.value && type == 'processIds') {
// this.form.processName = val.name;
if(!val.value){
return false
}
// select
// const processDic = val.dic.find(col => col.prop === 'processId').dicData || [];
// console.log('processDic',val.dic)
// id
const selectedNames = val.value.map(id => {
const item = val.dic.find(dic => dic.id === id);
console.log('item',item)
return item ? item.name : '';
})
.filter(name => name) //
.join(',');
// /
if (row) {
// -
this.form.processName = selectedNames;
this.form.processId = val.value.join(',');
} else {
// -
this.form.processName = selectedNames;
this.form.processId = val.value.join(',');
}
}
// if (val && type == 'craftId') {
// this.form.craftName = val.caName;
// }
},
rowSave(row, done, loading) {
addOutsourceProcess(row).then(
@ -215,7 +261,7 @@ export default {
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
// this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
@ -229,14 +275,16 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
getListOutsourceProcess(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(
res => {
this.data = res.data.data.records;
this.loading = false;
this.page.total = res.data.data.total;
this.selectionClear();
}
);
getListOutsourceProcess(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then(res => {
this.data = res.data.data.records;
this.loading = false;
this.page.total = res.data.data.total;
this.selectionClear();
});
},
},
mounted() {},

Loading…
Cancel
Save