外协工序新增多选逻辑调整

dev-scheduling
zhangdi 3 days ago
parent 3be21b8aef
commit 6ca9d43673
  1. 9
      src/api/productionSchedulingPlan/basic.js
  2. 37
      src/views/productionSchedulingPlan/basic/oemProcess.vue

@ -324,3 +324,12 @@ export const updateOutsourceProcess = row => {
data: row, data: row,
}); });
}; };
export const getDetailOutsourceProcess = params => {
return request({
url: '/blade-scheduling/outsourceProcess/detail',
method: 'get',
params: params,
});
};

@ -17,6 +17,8 @@
@size-change="sizeChange" @size-change="sizeChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@on-load="onLoad" @on-load="onLoad"
:before-open="beforeOpen"
> >
<template #menu-left> </template> <template #menu-left> </template>
<template #menu-right> </template> <template #menu-right> </template>
@ -33,6 +35,7 @@ import {
removeOutsourceProcess, removeOutsourceProcess,
addOutsourceProcess, addOutsourceProcess,
updateOutsourceProcess, updateOutsourceProcess,
getDetailOutsourceProcess
} from '@/api/productionSchedulingPlan/basic'; } from '@/api/productionSchedulingPlan/basic';
export default { export default {
components: {}, components: {},
@ -105,30 +108,9 @@ export default {
value: 'id', value: 'id',
}, },
change: (val, row) => { change: (val, row) => {
console.log('change', val, row);
this.onChangeData(val, 'processIds', 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: '工序', label: '工序',
prop: 'processName', prop: 'processName',
@ -160,22 +142,25 @@ export default {
}; };
}, },
methods: { methods: {
beforeOpen(done, type) {
if (['edit'].includes(type)) {
getDetailOutsourceProcess({id:this.form.id}).then(res => {
this.form.processIds=res.data.data.processId.split(',')
});
}
done();
},
onChangeData(val, type, row) { onChangeData(val, type, row) {
// if (val && type == 'workCenterId') { // if (val && type == 'workCenterId') {
// this.form.workCenterName = val.wcName; // this.form.workCenterName = val.wcName;
// } // }
if (val.value && type == 'processIds') { if (val.value && type == 'processIds') {
// this.form.processName = val.name;
if(!val.value){ if(!val.value){
return false return false
} }
// select
// const processDic = val.dic.find(col => col.prop === 'processId').dicData || [];
// console.log('processDic',val.dic)
// id // id
const selectedNames = val.value.map(id => { const selectedNames = val.value.map(id => {
const item = val.dic.find(dic => dic.id === id); const item = val.dic.find(dic => dic.id === id);
console.log('item',item)
return item ? item.name : ''; return item ? item.name : '';
}) })
.filter(name => name) // .filter(name => name) //

Loading…
Cancel
Save