金蝶工序计划
This commit is contained in:
parent
15a8edaa39
commit
81cc61a6c6
@ -45,12 +45,20 @@ export const constantRoutes = [
|
||||
{
|
||||
path: '/system/productionPlan',
|
||||
component: () => import('@/views/system/productionPlan')
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system/operationPlanningMain',
|
||||
component: Layout,
|
||||
hidden: false,
|
||||
redirect: to => ({ path: '/system/operationPlanningMain/index', query: to.query }),
|
||||
children: [
|
||||
{
|
||||
path: '/system/operationPlanningMain',
|
||||
path: 'index',
|
||||
component: () => import('@/views/system/operationPlanningMain'),
|
||||
name: 'OperationPlanningMainPublic',
|
||||
meta: { title: '生产计划' }
|
||||
name: 'OperationPlanningMain',
|
||||
meta: { title: '生产计划', icon: 'table' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产订单编号" prop="moNumber">
|
||||
<el-form-item label="生产订单" prop="moNumber">
|
||||
<el-input
|
||||
v-model="queryParams.moNumber"
|
||||
placeholder="请输入生产订单编号"
|
||||
@ -303,6 +303,26 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备" min-width="220">
|
||||
<template slot-scope="scope">
|
||||
<div class="operator-cell">
|
||||
<el-input
|
||||
v-model="scope.row.__equipmentDraft"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="填写设备"
|
||||
@input="markEquipmentDirty(scope.row)"
|
||||
/>
|
||||
<el-button
|
||||
v-if="scope.row.__equipmentDirty"
|
||||
type="text"
|
||||
size="mini"
|
||||
:disabled="scope.row.__operatorSaving"
|
||||
@click="resetEquipmentDraft(scope.row)"
|
||||
>取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划开始" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getProcessPlanStartTime(scope.row) || '-' }}</span>
|
||||
@ -473,7 +493,7 @@ export default {
|
||||
return [o.productCode, o.productName].filter(Boolean).join(' | ');
|
||||
},
|
||||
processDialogDirtyCount() {
|
||||
return (this.processDialogList || []).filter(p => p && p.__operatorDirty).length;
|
||||
return (this.processDialogList || []).filter(p => p && (p.__operatorDirty || p.__equipmentDirty)).length;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -799,10 +819,13 @@ export default {
|
||||
const safeList = Array.isArray(list) ? list : [];
|
||||
return safeList.map(p => {
|
||||
const operator = p && p.operator != null ? String(p.operator) : '';
|
||||
const equipment = p && p.equipment != null ? String(p.equipment) : '';
|
||||
return {
|
||||
...p,
|
||||
__operatorDraft: operator,
|
||||
__operatorDirty: false,
|
||||
__equipmentDraft: equipment,
|
||||
__equipmentDirty: false,
|
||||
__operatorSaving: false
|
||||
};
|
||||
});
|
||||
@ -863,6 +886,17 @@ export default {
|
||||
row.__operatorDraft = row.operator != null ? String(row.operator) : '';
|
||||
row.__operatorDirty = false;
|
||||
},
|
||||
markEquipmentDirty(row) {
|
||||
if (!row) return;
|
||||
const origin = row.equipment != null ? String(row.equipment) : '';
|
||||
const draft = row.__equipmentDraft != null ? String(row.__equipmentDraft) : '';
|
||||
row.__equipmentDirty = origin !== draft;
|
||||
},
|
||||
resetEquipmentDraft(row) {
|
||||
if (!row) return;
|
||||
row.__equipmentDraft = row.equipment != null ? String(row.equipment) : '';
|
||||
row.__equipmentDirty = false;
|
||||
},
|
||||
buildOperatorUpdatePayload(rows) {
|
||||
const order = this.processDialogOrder || {};
|
||||
const list = Array.isArray(rows) ? rows : [];
|
||||
@ -875,10 +909,13 @@ export default {
|
||||
batchNo: (order.batchNo || order.hbytSclh) ?? null,
|
||||
updates: list.map(p => ({
|
||||
k3DetailId: p.k3DetailId ?? null,
|
||||
fDetailId: p.fDetailId ?? p.FDetailId ?? p.k3DetailId ?? null,
|
||||
FDetailId: p.FDetailId ?? p.fDetailId ?? p.k3DetailId ?? null,
|
||||
entityEntryId: p.entityEntryId ?? null,
|
||||
operNo: p.operNo ?? null,
|
||||
processName: p.processName ?? null,
|
||||
operator: p.__operatorDraft != null ? String(p.__operatorDraft).trim() : ''
|
||||
operator: p.__operatorDraft != null ? String(p.__operatorDraft).trim() : '',
|
||||
equipment: p.__equipmentDraft != null ? String(p.__equipmentDraft).trim() : ''
|
||||
}))
|
||||
};
|
||||
},
|
||||
@ -886,12 +923,14 @@ export default {
|
||||
if (this.processDialogSaving) return;
|
||||
const rows = Array.isArray(targetRows)
|
||||
? targetRows
|
||||
: (this.processDialogList || []).filter(p => p && p.__operatorDirty);
|
||||
: (this.processDialogList || []).filter(p => p && (p.__operatorDirty || p.__equipmentDirty));
|
||||
|
||||
const realRows = rows.filter(r => {
|
||||
const origin = r && r.operator != null ? String(r.operator) : '';
|
||||
const draft = r && r.__operatorDraft != null ? String(r.__operatorDraft).trim() : '';
|
||||
return origin !== draft;
|
||||
const originOperator = r && r.operator != null ? String(r.operator) : '';
|
||||
const draftOperator = r && r.__operatorDraft != null ? String(r.__operatorDraft).trim() : '';
|
||||
const originEquipment = r && r.equipment != null ? String(r.equipment) : '';
|
||||
const draftEquipment = r && r.__equipmentDraft != null ? String(r.__equipmentDraft).trim() : '';
|
||||
return originOperator !== draftOperator || originEquipment !== draftEquipment;
|
||||
});
|
||||
|
||||
if (!realRows.length) return;
|
||||
@ -905,10 +944,14 @@ export default {
|
||||
updateOperationPlanningMainOperators(payload)
|
||||
.then(() => {
|
||||
realRows.forEach(r => {
|
||||
const next = r.__operatorDraft != null ? String(r.__operatorDraft).trim() : '';
|
||||
r.operator = next;
|
||||
r.__operatorDraft = next;
|
||||
const nextOperator = r.__operatorDraft != null ? String(r.__operatorDraft).trim() : '';
|
||||
const nextEquipment = r.__equipmentDraft != null ? String(r.__equipmentDraft).trim() : '';
|
||||
r.operator = nextOperator;
|
||||
r.equipment = nextEquipment;
|
||||
r.__operatorDraft = nextOperator;
|
||||
r.__equipmentDraft = nextEquipment;
|
||||
r.__operatorDirty = false;
|
||||
r.__equipmentDirty = false;
|
||||
});
|
||||
this.$modal.msgSuccess('保存成功');
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user