|
|
@ -469,6 +469,8 @@ export default { |
|
|
abnormalCutLoading: false, // 异常截卷loading |
|
|
abnormalCutLoading: false, // 异常截卷loading |
|
|
exceptionRuleLocked: false, // 异常规则触发后的强制锁定 |
|
|
exceptionRuleLocked: false, // 异常规则触发后的强制锁定 |
|
|
exceptionRuleLockMessage: '', // 锁定提示文案 |
|
|
exceptionRuleLockMessage: '', // 锁定提示文案 |
|
|
|
|
|
pendingRuleFollowupAction: '', // 提示类规则在成功后需打开的功能动作 |
|
|
|
|
|
pendingRuleFollowupResultMap: null, |
|
|
scheduleData: { |
|
|
scheduleData: { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
username: this.$store.state.user.name, |
|
|
username: this.$store.state.user.name, |
|
|
@ -718,6 +720,7 @@ export default { |
|
|
// 重置异常规则锁定状态 |
|
|
// 重置异常规则锁定状态 |
|
|
this.exceptionRuleLocked = false; |
|
|
this.exceptionRuleLocked = false; |
|
|
this.exceptionRuleLockMessage = ''; |
|
|
this.exceptionRuleLockMessage = ''; |
|
|
|
|
|
this.resetPendingRuleFollowup(); |
|
|
// 重置缓存数据标记 |
|
|
// 重置缓存数据标记 |
|
|
this.hasCachedData = false; |
|
|
this.hasCachedData = false; |
|
|
this.cachedDataCount = 0; |
|
|
this.cachedDataCount = 0; |
|
|
@ -1304,19 +1307,14 @@ export default { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 校验每卷不良原因数量是否等于该卷面损数量 |
|
|
|
|
|
if (!this.validateRollDefectQtyBySurfaceLoss()) { |
|
|
|
|
|
|
|
|
// Packing List 显示时要求必填 |
|
|
|
|
|
if (!this.validatePackingListRequired()) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
const passRuleCheck = await this.checkSplitRuleBeforeAction('异常截卷') |
|
|
|
|
|
if (!passRuleCheck) { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
this.$message.error(error.message || '异常规则校验失败') |
|
|
|
|
|
return false |
|
|
|
|
|
|
|
|
// 校验每卷不良原因数量是否等于该卷面损数量 |
|
|
|
|
|
if (!this.validateRollDefectQtyBySurfaceLoss()) { |
|
|
|
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 确认框 |
|
|
// 确认框 |
|
|
@ -1330,6 +1328,16 @@ export default { |
|
|
return false; // 用户取消 |
|
|
return false; // 用户取消 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
const passRuleCheck = await this.checkSplitRuleBeforeAction('异常截卷') |
|
|
|
|
|
if (!passRuleCheck) { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
this.$message.error(error.message || '异常规则校验失败') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 开启loading |
|
|
// 开启loading |
|
|
this.abnormalCutLoading = true; |
|
|
this.abnormalCutLoading = true; |
|
|
|
|
|
|
|
|
@ -1397,7 +1405,7 @@ export default { |
|
|
buNo: this.scheduleData.buNo, |
|
|
buNo: this.scheduleData.buNo, |
|
|
rollQty: totalGoodQty, |
|
|
rollQty: totalGoodQty, |
|
|
rollNums: 1, |
|
|
rollNums: 1, |
|
|
totalDefectQty: totalDefectQty, |
|
|
|
|
|
|
|
|
defectQty: totalDefectQty, |
|
|
rollRows: rollRows, |
|
|
rollRows: rollRows, |
|
|
rollDefectDetails: this.getRollDefectDetails(rollIndex + 1), |
|
|
rollDefectDetails: this.getRollDefectDetails(rollIndex + 1), |
|
|
packingList: rollPackingList, |
|
|
packingList: rollPackingList, |
|
|
@ -1478,6 +1486,11 @@ export default { |
|
|
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查'); |
|
|
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.triggerPendingRuleFollowupIfNeeded()) { |
|
|
|
|
|
this.abnormalCutLoading = false; |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 延时关闭弹窗 |
|
|
// 延时关闭弹窗 |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
this.closeDialog(); |
|
|
this.closeDialog(); |
|
|
@ -1704,6 +1717,7 @@ export default { |
|
|
/*关闭modal*/ |
|
|
/*关闭modal*/ |
|
|
closeDialog(){ |
|
|
closeDialog(){ |
|
|
this.stopSplitRuleLockPolling() |
|
|
this.stopSplitRuleLockPolling() |
|
|
|
|
|
this.resetPendingRuleFollowup() |
|
|
//刷新报工的页面 |
|
|
//刷新报工的页面 |
|
|
this.$emit('refreshPageData'); |
|
|
this.$emit('refreshPageData'); |
|
|
//关闭当前的页面 |
|
|
//关闭当前的页面 |
|
|
@ -1770,6 +1784,31 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resetPendingRuleFollowup () { |
|
|
|
|
|
this.pendingRuleFollowupAction = '' |
|
|
|
|
|
this.pendingRuleFollowupResultMap = null |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
triggerPendingRuleFollowupIfNeeded () { |
|
|
|
|
|
const action = this.pendingRuleFollowupAction |
|
|
|
|
|
if (!action) { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
const resultMap = this.pendingRuleFollowupResultMap || {} |
|
|
|
|
|
this.resetPendingRuleFollowup() |
|
|
|
|
|
this.$emit('refreshPageData') |
|
|
|
|
|
this.$emit('update:visible', false) |
|
|
|
|
|
if (action === 'OPEN_DEFECT') { |
|
|
|
|
|
this.$emit('openDefectByExceptionRule', resultMap) |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
if (action === 'OPEN_DOWNTIME') { |
|
|
|
|
|
this.$emit('openDownTimeByExceptionRule', resultMap) |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
return false |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
async completeSplitRuleTodoOperationIfNeeded () { |
|
|
async completeSplitRuleTodoOperationIfNeeded () { |
|
|
const payload = this.buildSplitRuleStatusPayload() |
|
|
const payload = this.buildSplitRuleStatusPayload() |
|
|
if (!payload.site || !payload.buNo || !payload.orderNo || !payload.seqNo) { |
|
|
if (!payload.site || !payload.buNo || !payload.orderNo || !payload.seqNo) { |
|
|
@ -1812,6 +1851,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async checkSplitRuleBeforeAction (actionName) { |
|
|
async checkSplitRuleBeforeAction (actionName) { |
|
|
|
|
|
this.resetPendingRuleFollowup() |
|
|
const payload = this.buildSplitRuleCheckPayload(actionName) |
|
|
const payload = this.buildSplitRuleCheckPayload(actionName) |
|
|
const { data } = await checkSplitRollExceptionRule(payload) |
|
|
const { data } = await checkSplitRollExceptionRule(payload) |
|
|
if (!data || data.code === 500) { |
|
|
if (!data || data.code === 500) { |
|
|
@ -1832,15 +1872,15 @@ export default { |
|
|
const message = resultMap.message || '触发异常规则,请先处理。' |
|
|
const message = resultMap.message || '触发异常规则,请先处理。' |
|
|
if (action === 'OPEN_DEFECT') { |
|
|
if (action === 'OPEN_DEFECT') { |
|
|
this.$message.warning(message) |
|
|
this.$message.warning(message) |
|
|
this.$emit('openDefectByExceptionRule', resultMap) |
|
|
|
|
|
this.$emit('update:visible', false) |
|
|
|
|
|
return false |
|
|
|
|
|
|
|
|
this.pendingRuleFollowupAction = action |
|
|
|
|
|
this.pendingRuleFollowupResultMap = resultMap |
|
|
|
|
|
return true |
|
|
} |
|
|
} |
|
|
if (action === 'OPEN_DOWNTIME') { |
|
|
if (action === 'OPEN_DOWNTIME') { |
|
|
this.$message.warning(message) |
|
|
this.$message.warning(message) |
|
|
this.$emit('openDownTimeByExceptionRule', resultMap) |
|
|
|
|
|
this.$emit('update:visible', false) |
|
|
|
|
|
return false |
|
|
|
|
|
|
|
|
this.pendingRuleFollowupAction = action |
|
|
|
|
|
this.pendingRuleFollowupResultMap = resultMap |
|
|
|
|
|
return true |
|
|
} |
|
|
} |
|
|
if (action === 'LOCK_PAGE') { |
|
|
if (action === 'LOCK_PAGE') { |
|
|
this.exceptionRuleLocked = true |
|
|
this.exceptionRuleLocked = true |
|
|
@ -2062,6 +2102,11 @@ export default { |
|
|
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查') |
|
|
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.triggerPendingRuleFollowupIfNeeded()) { |
|
|
|
|
|
this.yieldReportLoading = false |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 延时关闭弹窗 |
|
|
// 延时关闭弹窗 |
|
|
setTimeout(() =>{ |
|
|
setTimeout(() =>{ |
|
|
//关闭当前的页面 |
|
|
//关闭当前的页面 |
|
|
|