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

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

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

@ -17,6 +17,8 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
:before-open="beforeOpen"
>
<template #menu-left> </template>
<template #menu-right> </template>
@ -33,6 +35,7 @@ import {
removeOutsourceProcess,
addOutsourceProcess,
updateOutsourceProcess,
getDetailOutsourceProcess
} from '@/api/productionSchedulingPlan/basic';
export default {
components: {},
@ -105,30 +108,9 @@ export default {
value: 'id',
},
change: (val, row) => {
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',
@ -160,22 +142,25 @@ export default {
};
},
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) {
// 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) //

Loading…
Cancel
Save