|
|
@ -108,6 +108,13 @@ |
|
|
{{ scope.row.proofingStatus || '进行中' }}</a> |
|
|
{{ scope.row.proofingStatus || '进行中' }}</a> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="Tracking Status" align="center" width="190" show-overflow-tooltip> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<div :class="getTrackingStatusClass(scope.row)"> |
|
|
|
|
|
{{ getTrackingStatusText(scope.row) }} |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
<el-table-column |
|
|
<el-table-column |
|
|
v-for="(item, processColumnIndex) in visibleProcessColumns" |
|
|
v-for="(item, processColumnIndex) in visibleProcessColumns" |
|
|
@ -2166,20 +2173,17 @@ export default { |
|
|
this.$message.error('项目/物料/打样记录ID缺失,无法修改') |
|
|
this.$message.error('项目/物料/打样记录ID缺失,无法修改') |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
if (this.isBlankValue(inData.projectNo)) { |
|
|
|
|
|
this.$message.error('项目编码不能为空') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
if (this.isBlankValue(inData.projectName) && this.isBlankValue(inData.projectDesc)) { |
|
|
|
|
|
this.$message.error('项目名称不能为空') |
|
|
|
|
|
|
|
|
// 修改模式按业务要求仅保留 3 个必填项,其他业务字段允许为空。 |
|
|
|
|
|
if (this.isBlankValue(inData.partDesc)) { |
|
|
|
|
|
this.$message.error('料号描述不能为空') |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
if (this.isBlankValue(inData.testPartNo)) { |
|
|
|
|
|
this.$message.error('项目料号不能为空') |
|
|
|
|
|
|
|
|
if (this.isBlankValue(inData.projectOwner)) { |
|
|
|
|
|
this.$message.error('PjM不能为空') |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
if (this.isBlankValue(inData.partDesc)) { |
|
|
|
|
|
this.$message.error('料号描述不能为空') |
|
|
|
|
|
|
|
|
if (this.isBlankValue(inData.engineer)) { |
|
|
|
|
|
this.$message.error('Engineer不能为空') |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
if (!this.isBlankValue(inData.proofingNumber) && !/^[1-9]\d*$/.test(String(inData.proofingNumber))) { |
|
|
if (!this.isBlankValue(inData.proofingNumber) && !/^[1-9]\d*$/.test(String(inData.proofingNumber))) { |
|
|
@ -3067,6 +3071,103 @@ export default { |
|
|
} |
|
|
} |
|
|
return status.indexOf('完成') > -1 && status.indexOf('未') === -1 |
|
|
return status.indexOf('完成') > -1 && status.indexOf('未') === -1 |
|
|
}, |
|
|
}, |
|
|
|
|
|
getTrackingProcessColumnsByRow (row) { |
|
|
|
|
|
if (!row) { |
|
|
|
|
|
return [] |
|
|
|
|
|
} |
|
|
|
|
|
const processColumnMap = {} |
|
|
|
|
|
const appendProcessColumn = (processCol) => { |
|
|
|
|
|
if (!processCol || !processCol.code || processColumnMap[processCol.code]) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
processColumnMap[processCol.code] = processCol |
|
|
|
|
|
} |
|
|
|
|
|
this.processColumns.forEach(item => { |
|
|
|
|
|
appendProcessColumn(item) |
|
|
|
|
|
}) |
|
|
|
|
|
// 兜底补齐默认工序元信息,避免配置变化导致状态字段找不到。 |
|
|
|
|
|
DEFAULT_PROCESS_COLUMNS.forEach(item => { |
|
|
|
|
|
appendProcessColumn(item) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
let orderedCodes = [] |
|
|
|
|
|
if (this.getSelectedSearchBuNo()) { |
|
|
|
|
|
orderedCodes = this.visibleProcessColumns.map(item => item.code) |
|
|
|
|
|
} else { |
|
|
|
|
|
const configEntry = this.getBuProcessConfigEntry(row.buNo, row.site) |
|
|
|
|
|
const config = configEntry ? configEntry.config : null |
|
|
|
|
|
orderedCodes = config && Array.isArray(config.processOrderCodes) && config.processOrderCodes.length > 0 |
|
|
|
|
|
? this.getValidProcessOrderCodes(config.processOrderCodes) |
|
|
|
|
|
: this.getAllProcessCodes() |
|
|
|
|
|
const visibleCodes = this.getProcessVisibleCodesByBuNo(row.buNo, row.site) |
|
|
|
|
|
if (visibleCodes) { |
|
|
|
|
|
const visibleCodeMap = {} |
|
|
|
|
|
visibleCodes.forEach(code => { |
|
|
|
|
|
visibleCodeMap[code] = true |
|
|
|
|
|
}) |
|
|
|
|
|
orderedCodes = orderedCodes.filter(code => visibleCodeMap[code]) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = [] |
|
|
|
|
|
const usedCodeMap = {} |
|
|
|
|
|
orderedCodes.forEach(code => { |
|
|
|
|
|
const codeVal = code == null ? '' : String(code).trim() |
|
|
|
|
|
if (!codeVal || usedCodeMap[codeVal]) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const processCol = processColumnMap[codeVal] |
|
|
|
|
|
if (!processCol) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
usedCodeMap[codeVal] = true |
|
|
|
|
|
result.push(processCol) |
|
|
|
|
|
}) |
|
|
|
|
|
return result |
|
|
|
|
|
}, |
|
|
|
|
|
getFirstPendingProcessLabel (row) { |
|
|
|
|
|
const processColumns = this.getTrackingProcessColumnsByRow(row) |
|
|
|
|
|
for (let i = 0; i < processColumns.length; i += 1) { |
|
|
|
|
|
const processCol = processColumns[i] |
|
|
|
|
|
if (!this.isProcessComplete(row, processCol)) { |
|
|
|
|
|
return processCol.label || processCol.code |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return '已全部完成' |
|
|
|
|
|
}, |
|
|
|
|
|
getTrackingStatusType (row) { |
|
|
|
|
|
if (!row) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
const requiredDeliveryDate = this.formatDate(row.requiredDeliveryDate) |
|
|
|
|
|
if (!requiredDeliveryDate) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
const today = this.formatDate(new Date()) |
|
|
|
|
|
// 按业务口径:今日 <= 预计完成日期 判定为 On schedule,其余判定为 Delay。 |
|
|
|
|
|
if (today <= requiredDeliveryDate) { |
|
|
|
|
|
return 'onSchedule' |
|
|
|
|
|
} |
|
|
|
|
|
return 'delay' |
|
|
|
|
|
}, |
|
|
|
|
|
getTrackingStatusText (row) { |
|
|
|
|
|
const statusType = this.getTrackingStatusType(row) |
|
|
|
|
|
if (!statusType) { |
|
|
|
|
|
return '-' |
|
|
|
|
|
} |
|
|
|
|
|
const statusPrefix = statusType === 'onSchedule' ? 'On schedule' : 'Delay' |
|
|
|
|
|
return `${statusPrefix}-${this.getFirstPendingProcessLabel(row)}` |
|
|
|
|
|
}, |
|
|
|
|
|
getTrackingStatusClass (row) { |
|
|
|
|
|
const statusType = this.getTrackingStatusType(row) |
|
|
|
|
|
if (statusType === 'onSchedule') { |
|
|
|
|
|
return 'tracking-status tracking-status--on-schedule' |
|
|
|
|
|
} |
|
|
|
|
|
if (statusType === 'delay') { |
|
|
|
|
|
return 'tracking-status tracking-status--delay' |
|
|
|
|
|
} |
|
|
|
|
|
return 'tracking-status tracking-status--unknown' |
|
|
|
|
|
}, |
|
|
formatDate (val) { |
|
|
formatDate (val) { |
|
|
if (!val) { |
|
|
if (!val) { |
|
|
return '' |
|
|
return '' |
|
|
@ -3248,6 +3349,35 @@ export default { |
|
|
color: #e6a23c; |
|
|
color: #e6a23c; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tracking-status { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
min-height: 26px; |
|
|
|
|
|
padding: 4px 6px; |
|
|
|
|
|
box-sizing: border-box; |
|
|
|
|
|
border: 1px solid #dcdfe6; |
|
|
|
|
|
border-radius: 4px; |
|
|
|
|
|
background: #fff; |
|
|
|
|
|
color: #303133; |
|
|
|
|
|
font-weight: 500; |
|
|
|
|
|
line-height: 18px; |
|
|
|
|
|
text-align: left; |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tracking-status--on-schedule { |
|
|
|
|
|
background: #e8f5e9; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tracking-status--delay { |
|
|
|
|
|
background: #fde2e2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tracking-status--unknown { |
|
|
|
|
|
background: #f4f4f5; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.process-cell { |
|
|
.process-cell { |
|
|
background: #fff; |
|
|
background: #fff; |
|
|
min-height: 44px; |
|
|
min-height: 44px; |
|
|
|