Browse Source

2026-07-15

异常规则配置
master
fengyuan_yang 2 weeks ago
parent
commit
9b85b88ccf
  1. 79
      src/views/modules/yieldReport/com_separate_roll.vue

79
src/views/modules/yieldReport/com_separate_roll.vue

@ -469,6 +469,8 @@ export default {
abnormalCutLoading: false, // loading
exceptionRuleLocked: false, //
exceptionRuleLockMessage: '', //
pendingRuleFollowupAction: '', //
pendingRuleFollowupResultMap: null,
scheduleData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
@ -718,6 +720,7 @@ export default {
//
this.exceptionRuleLocked = false;
this.exceptionRuleLockMessage = '';
this.resetPendingRuleFollowup();
//
this.hasCachedData = false;
this.cachedDataCount = 0;
@ -1304,19 +1307,14 @@ export default {
return false;
}
//
if (!this.validateRollDefectQtyBySurfaceLoss()) {
// Packing List
if (!this.validatePackingListRequired()) {
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; //
}
try {
const passRuleCheck = await this.checkSplitRuleBeforeAction('异常截卷')
if (!passRuleCheck) {
return false
}
} catch (error) {
this.$message.error(error.message || '异常规则校验失败')
return false
}
// loading
this.abnormalCutLoading = true;
@ -1397,7 +1405,7 @@ export default {
buNo: this.scheduleData.buNo,
rollQty: totalGoodQty,
rollNums: 1,
totalDefectQty: totalDefectQty,
defectQty: totalDefectQty,
rollRows: rollRows,
rollDefectDetails: this.getRollDefectDetails(rollIndex + 1),
packingList: rollPackingList,
@ -1478,6 +1486,11 @@ export default {
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查');
}
if (this.triggerPendingRuleFollowupIfNeeded()) {
this.abnormalCutLoading = false;
return true;
}
//
setTimeout(() => {
this.closeDialog();
@ -1704,6 +1717,7 @@ export default {
/*关闭modal*/
closeDialog(){
this.stopSplitRuleLockPolling()
this.resetPendingRuleFollowup()
//
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 () {
const payload = this.buildSplitRuleStatusPayload()
if (!payload.site || !payload.buNo || !payload.orderNo || !payload.seqNo) {
@ -1812,6 +1851,7 @@ export default {
},
async checkSplitRuleBeforeAction (actionName) {
this.resetPendingRuleFollowup()
const payload = this.buildSplitRuleCheckPayload(actionName)
const { data } = await checkSplitRollExceptionRule(payload)
if (!data || data.code === 500) {
@ -1832,15 +1872,15 @@ export default {
const message = resultMap.message || '触发异常规则,请先处理。'
if (action === 'OPEN_DEFECT') {
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') {
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') {
this.exceptionRuleLocked = true
@ -2062,6 +2102,11 @@ export default {
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查')
}
if (this.triggerPendingRuleFollowupIfNeeded()) {
this.yieldReportLoading = false
return true
}
//
setTimeout(() =>{
//

Loading…
Cancel
Save