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