|
|
@ -105,14 +105,64 @@ export default { |
|
|
if (this.isTrackingRowProcessReadonly(row)) { |
|
|
if (this.isTrackingRowProcessReadonly(row)) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
// Delivery&Package 完成会闭环整单并写 NPI,必须先选定打样结论,不能和普通工序一样直接打勾。
|
|
|
|
|
|
if (this.isDeliveryPackageProcess(processCol)) { |
|
|
|
|
|
this.openDeliveryPackageConclusionDialog(row, processCol) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.submitMarkProcessComplete(row, processCol, '') |
|
|
|
|
|
}, |
|
|
|
|
|
openDeliveryPackageConclusionDialog (row, processCol) { |
|
|
|
|
|
this.deliveryPackageConclusionTarget = { |
|
|
|
|
|
row: row, |
|
|
|
|
|
processCol: processCol |
|
|
|
|
|
} |
|
|
|
|
|
this.deliveryPackageConclusionForm = { |
|
|
|
|
|
proofingResultStatus: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.deliveryPackageConclusionVisible = true |
|
|
|
|
|
}, |
|
|
|
|
|
submitDeliveryPackageConclusion () { |
|
|
|
|
|
if (this.deliveryPackageConclusionSaving) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const target = this.deliveryPackageConclusionTarget |
|
|
|
|
|
if (!target || !target.row || !target.processCol) { |
|
|
|
|
|
this.$message.error('工序参数缺失') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const proofingResultStatus = this.deliveryPackageConclusionForm.proofingResultStatus |
|
|
|
|
|
? String(this.deliveryPackageConclusionForm.proofingResultStatus).trim() |
|
|
|
|
|
: '' |
|
|
|
|
|
if (!proofingResultStatus) { |
|
|
|
|
|
this.$message.warning('请选择打样结论') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (this.proofingResultStatusOptions.indexOf(proofingResultStatus) === -1) { |
|
|
|
|
|
this.$message.warning('打样结论不正确') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.deliveryPackageConclusionSaving = true |
|
|
|
|
|
this.submitMarkProcessComplete(target.row, target.processCol, proofingResultStatus).finally(() => { |
|
|
|
|
|
this.deliveryPackageConclusionSaving = false |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
submitMarkProcessComplete (row, processCol, proofingResultStatus) { |
|
|
// 若用户已手工选择日期,打勾仅改状态,不覆盖已选日期;无日期时才补当天。
|
|
|
// 若用户已手工选择日期,打勾仅改状态,不覆盖已选日期;无日期时才补当天。
|
|
|
const currentActualDate = this.formatDate(row[processCol.actualField]) |
|
|
const currentActualDate = this.formatDate(row[processCol.actualField]) |
|
|
const nextActualDate = currentActualDate || this.formatDate(new Date()) |
|
|
const nextActualDate = currentActualDate || this.formatDate(new Date()) |
|
|
this.updateProcessFromTable(row, processCol, { |
|
|
|
|
|
|
|
|
const conclusionText = proofingResultStatus ? String(proofingResultStatus).trim() : '' |
|
|
|
|
|
return this.updateProcessFromTable(row, processCol, { |
|
|
status: '已完成', |
|
|
status: '已完成', |
|
|
actualDate: nextActualDate, |
|
|
actualDate: nextActualDate, |
|
|
remark: '表格一键完成' |
|
|
|
|
|
}, false, '工序已标记为完成') |
|
|
|
|
|
|
|
|
remark: conclusionText ? `表格一键完成,打样结论:${conclusionText}` : '表格一键完成', |
|
|
|
|
|
proofingResultStatus: conclusionText |
|
|
|
|
|
}, false, '工序已标记为完成').then(success => { |
|
|
|
|
|
if (success && conclusionText) { |
|
|
|
|
|
this.deliveryPackageConclusionVisible = false |
|
|
|
|
|
} |
|
|
|
|
|
return success |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handleProcessDateDoubleClick (row, processCol) { |
|
|
handleProcessDateDoubleClick (row, processCol) { |
|
|
if (!row || !processCol || !this.isProcessStatusComplete(row, processCol)) { |
|
|
if (!row || !processCol || !this.isProcessStatusComplete(row, processCol)) { |
|
|
@ -136,7 +186,7 @@ export default { |
|
|
const proofingNoText = this.getRollbackProofingNoDisplay(row) |
|
|
const proofingNoText = this.getRollbackProofingNoDisplay(row) |
|
|
// Delivery&Package 在“打样完成”状态下的撤回需要同时回退整单状态,提示语单独说明影响范围。
|
|
|
// Delivery&Package 在“打样完成”状态下的撤回需要同时回退整单状态,提示语单独说明影响范围。
|
|
|
const rollbackTip = rollbackProofingComplete |
|
|
const rollbackTip = rollbackProofingComplete |
|
|
? `确定撤回打样单(${proofingNoText})的Delivery&Package已完成状态吗?撤回后打样状态恢复为“进行中”。` |
|
|
|
|
|
|
|
|
? `确定撤回打样单(${proofingNoText})的Delivery&Package已完成状态吗?撤回后打样状态恢复为“进行中”,NPI打样结论会一并清空。` |
|
|
: `确定回退该工序状态为“未完成”吗?打样单号:${proofingNoText}` |
|
|
: `确定回退该工序状态为“未完成”吗?打样单号:${proofingNoText}` |
|
|
this.$confirm(rollbackTip, '提示', { |
|
|
this.$confirm(rollbackTip, '提示', { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: '确定', |
|
|
@ -191,14 +241,17 @@ export default { |
|
|
updateProcessFromTable (row, processCol, processData, silentSuccess, successMsg, skipListRefresh) { |
|
|
updateProcessFromTable (row, processCol, processData, silentSuccess, successMsg, skipListRefresh) { |
|
|
if (!row || !processCol || !row.trackingId) { |
|
|
if (!row || !processCol || !row.trackingId) { |
|
|
this.$message.error('工序参数缺失') |
|
|
this.$message.error('工序参数缺失') |
|
|
return |
|
|
|
|
|
|
|
|
return Promise.resolve(false) |
|
|
} |
|
|
} |
|
|
const status = processData && processData.status ? String(processData.status).trim() : '' |
|
|
const status = processData && processData.status ? String(processData.status).trim() : '' |
|
|
if (!status) { |
|
|
if (!status) { |
|
|
this.$message.error('工序状态不能为空') |
|
|
this.$message.error('工序状态不能为空') |
|
|
return |
|
|
|
|
|
|
|
|
return Promise.resolve(false) |
|
|
} |
|
|
} |
|
|
const actualDate = processData && processData.actualDate ? this.formatDate(processData.actualDate) : '' |
|
|
const actualDate = processData && processData.actualDate ? this.formatDate(processData.actualDate) : '' |
|
|
|
|
|
const proofingResultStatus = processData && processData.proofingResultStatus |
|
|
|
|
|
? String(processData.proofingResultStatus).trim() |
|
|
|
|
|
: '' |
|
|
const inData = { |
|
|
const inData = { |
|
|
trackingId: row.trackingId, |
|
|
trackingId: row.trackingId, |
|
|
processCode: processCol.code, |
|
|
processCode: processCol.code, |
|
|
@ -208,7 +261,11 @@ export default { |
|
|
remark: processData && processData.remark ? processData.remark : '', |
|
|
remark: processData && processData.remark ? processData.remark : '', |
|
|
updateBy: this.$store.state.user.name |
|
|
updateBy: this.$store.state.user.name |
|
|
} |
|
|
} |
|
|
updateProofTrackingProcess(inData).then(({ data }) => { |
|
|
|
|
|
|
|
|
// 只有 Delivery&Package 首次完成才带结论;普通工序和改日期不传,避免后端误覆盖 NPI 结论。
|
|
|
|
|
|
if (proofingResultStatus) { |
|
|
|
|
|
inData.proofingResultStatus = proofingResultStatus |
|
|
|
|
|
} |
|
|
|
|
|
return updateProofTrackingProcess(inData).then(({ data }) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.updateRowProcessValue(row, processCol, status, actualDate) |
|
|
this.updateRowProcessValue(row, processCol, status, actualDate) |
|
|
const cacheKey = `${row.trackingId}_${processCol.code}` |
|
|
const cacheKey = `${row.trackingId}_${processCol.code}` |
|
|
@ -222,13 +279,15 @@ export default { |
|
|
if (!skipListRefresh) { |
|
|
if (!skipListRefresh) { |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '工序更新失败') |
|
|
|
|
|
this.getDataList() |
|
|
|
|
|
|
|
|
return true |
|
|
} |
|
|
} |
|
|
|
|
|
this.$message.error(data.msg || '工序更新失败') |
|
|
|
|
|
this.getDataList() |
|
|
|
|
|
return false |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
this.$message.error('工序更新异常') |
|
|
this.$message.error('工序更新异常') |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
|
|
|
return false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
finishProof (row) { |
|
|
finishProof (row) { |
|
|
|