diff --git a/src/views/SeikoWorkshop/ProductionPlan/index.vue b/src/views/SeikoWorkshop/ProductionPlan/index.vue
index 9c7efbef..d468c060 100644
--- a/src/views/SeikoWorkshop/ProductionPlan/index.vue
+++ b/src/views/SeikoWorkshop/ProductionPlan/index.vue
@@ -27,14 +27,19 @@
-
+
{{ scope.row.状态 }}
- {{ scope.row.订单号 }}
+ {{ scope.row.MK订单编号 || scope.row.订单号 }}
+
+
+
+
+ {{ scope.row.收货人 || '仓库'}}
@@ -222,6 +227,8 @@ export default {
if (!grouped[orderNo]) {
grouped[orderNo] = {
订单号: item.订单号,
+ MK订单编号: item.MK订单编号,
+ 收货人: item.MK订单收货人,
产品名称: item.产品名称,
零件名称: item.零件名称,
零件图号: item.零件图号,
@@ -229,11 +236,13 @@ export default {
计划数: item.计划数,
剩余数: item.剩余数,
状态: item.状态,
- 完成率: item.完成率,
+ 完成率: '',
投产时间: item.投产时间,
精工期限: item.精工期限,
设备: item.设备,
材料: item.材料,
+ _totalProcesses: 0,
+ _completedProcesses: 0,
OP010: '',
OP020: '',
OP030: '',
@@ -247,12 +256,34 @@ export default {
OP110: ''
}
}
+ if (item.工序) {
+ grouped[orderNo]._totalProcesses++
+ if (item.剩余数 <= 0) {
+ grouped[orderNo]._completedProcesses++
+ }
+ }
const opIndex = parseInt(item.工序顺序)
if (opIndex >= 1 && opIndex <= 11) {
const opKey = `OP0${opIndex}0`
grouped[orderNo][opKey] = item.工序
}
})
+ Object.values(grouped).forEach(group => {
+ var rate = 0
+ if (group._totalProcesses > 0) {
+ rate = Math.round(group._completedProcesses / group._totalProcesses * 100)
+ }
+ group.完成率 = rate + '%'
+ if (rate === 100) {
+ group.状态 = '已完成'
+ } else if (rate === 0) {
+ group.状态 = '派工中'
+ } else {
+ group.状态 = '生产中'
+ }
+ delete group._totalProcesses
+ delete group._completedProcesses
+ })
return Object.values(grouped)
}
}