更新精工车间生产计划页面
This commit is contained in:
@@ -27,14 +27,19 @@
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" align="center" label="状态" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.状态 === '派工中' ? 'warning' : scope.row.状态 === '生产中' ? 'success' : 'info'">
|
||||
<el-tag :type="scope.row.状态 === '派工中' ? '' : scope.row.状态 === '生产中' ? 'success' : 'info'">
|
||||
{{ scope.row.状态 }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="140px" align="center" label="订单编号" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
{{ scope.row.MK订单编号 || scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" align="center" label="收货人" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.收货人 || '仓库'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" align="center" label="投产日期" show-overflow-tooltip>
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user