外协工序调整

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

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

Loading…
Cancel
Save