@@ -639,6 +643,20 @@ export default {
const processExceptionNo = this.resolveProcessExceptionNo(row)
return processExceptionNo || '-'
},
+ buildTodoDefectLabel (row) {
+ if (!row) {
+ return '-'
+ }
+ const defectCode = (row.defectCode || '').trim()
+ const defectDesc = (row.defectDesc || '').trim()
+ if (!defectCode && !defectDesc) {
+ return '-'
+ }
+ if (defectCode && defectDesc) {
+ return defectCode + ' / ' + defectDesc
+ }
+ return defectCode || defectDesc
+ },
buildMinTriggerTotalYieldRateLabel (row) {
const minTriggerTotalYieldRate = this.resolveMinTriggerTotalYieldRate(row)
return minTriggerTotalYieldRate || '-'
diff --git a/src/views/modules/yieldReport/com_separate_roll.vue b/src/views/modules/yieldReport/com_separate_roll.vue
index cea0af5..5c63204 100644
--- a/src/views/modules/yieldReport/com_separate_roll.vue
+++ b/src/views/modules/yieldReport/com_separate_roll.vue
@@ -372,6 +372,42 @@
+
+
@@ -665,6 +701,14 @@ export default {
},
rollDefectMap: {},
currentRollDefectList: [],
+ hintRuleConfirmVisible: false,
+ hintRuleConfirmHtml: '',
+ hintRuleConfirmResolver: null,
+ hintRuleDefectPickerActive: false,
+ hintRuleDefectForm: {
+ defectCode: '',
+ defectDesc: ''
+ },
operatorData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
@@ -1227,12 +1271,19 @@ export default {
getBaseData(val) {
if (this.tagNo === 89) {
+ if (this.hintRuleDefectPickerActive) {
+ this.hintRuleDefectForm.defectCode = val.DefectCode || ''
+ this.hintRuleDefectForm.defectDesc = val.DefectDesc || ''
+ this.hintRuleDefectPickerActive = false
+ return
+ }
this.rollDefectForm.defectCode = val.DefectCode || ''
this.rollDefectForm.defectDesc = val.DefectDesc || ''
}
},
getBaseList(val) {
+ this.hintRuleDefectPickerActive = false
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
@@ -2120,6 +2171,9 @@ export default {
},
async confirmContinueForHintRule (resultMap, action) {
+ if (action === 'OPEN_DEFECT') {
+ return this.openHintRuleConfirmDialog(resultMap, action)
+ }
const content = this.buildHintRuleConfirmContent(resultMap || {}, action)
try {
await this.$confirm(content, '规则触发确认', {
@@ -2137,6 +2191,63 @@ export default {
}
},
+ openHintRuleConfirmDialog (resultMap, action) {
+ this.hintRuleConfirmHtml = this.buildHintRuleConfirmContent(resultMap || {}, action)
+ this.hintRuleDefectForm = {
+ defectCode: '',
+ defectDesc: ''
+ }
+ this.hintRuleConfirmVisible = true
+ return new Promise(resolve => {
+ this.hintRuleConfirmResolver = resolve
+ })
+ },
+
+ openHintRuleDefectPicker () {
+ const workCenterNo = this.getCurrentWorkCenterNo()
+ if (!workCenterNo) {
+ this.$message.error('当前派工单未维护加工中心,无法选择不良代码')
+ return
+ }
+ this.hintRuleDefectPickerActive = true
+ this.tagNo = 89
+ this.$nextTick(() => {
+ const strVal = this.hintRuleDefectForm.defectCode || ''
+ const conSql = " and isnull(A.workCenter_no,'') = '" + workCenterNo + "'"
+ this.$refs.baseList.init(89, strVal, conSql)
+ })
+ },
+
+ resolveHintRuleConfirm (passed) {
+ this.hintRuleConfirmVisible = false
+ const resolver = this.hintRuleConfirmResolver
+ this.hintRuleConfirmResolver = null
+ if (typeof resolver === 'function') {
+ resolver(!!passed)
+ }
+ },
+
+ cancelHintRuleConfirm () {
+ this.resolveHintRuleConfirm(false)
+ },
+
+ submitHintRuleConfirm () {
+ if (!this.hintRuleDefectForm.defectCode) {
+ this.$message.warning('请选择不良代码')
+ return
+ }
+ this.resolveHintRuleConfirm(true)
+ },
+
+ async persistOpenDefectTodo (actionName) {
+ const payload = this.buildSplitRuleCheckPayload(actionName)
+ payload.defectCode = this.hintRuleDefectForm.defectCode
+ const { data } = await checkSplitRollExceptionRule(payload)
+ if (!data || data.code === 500) {
+ throw new Error((data && data.msg) || '保存不良代码失败')
+ }
+ },
+
async completeSplitRuleTodoOperationIfNeeded () {
const payload = this.buildSplitRuleCompletePayload()
if (!payload.site || !payload.buNo || !payload.orderNo || !payload.seqNo) {
@@ -2200,7 +2311,12 @@ export default {
const action = resultMap.action || 'NONE'
const message = resultMap.message || '触发异常规则,请先处理。'
if (action === 'OPEN_DEFECT') {
- return await this.confirmContinueForHintRule(resultMap, action)
+ const confirmed = await this.confirmContinueForHintRule(resultMap, action)
+ if (!confirmed) {
+ return false
+ }
+ await this.persistOpenDefectTodo(actionName)
+ return true
}
if (action === 'OPEN_DOWNTIME') {
return await this.confirmContinueForHintRule(resultMap, action)
@@ -3322,6 +3438,30 @@ export default {
font-weight: 600;
}
+.hint-rule-confirm-body {
+ line-height: 1.75;
+ margin-bottom: 8px;
+}
+
+.hint-rule-defect-form {
+ margin-top: 8px;
+}
+
+.hint-rule-defect-form /deep/ .el-form-item {
+ margin-right: 12px;
+}
+
+.hint-rule-defect-form .defect-code-label a {
+ color: #409EFF;
+ font-weight: 600;
+ cursor: pointer;
+}
+
+.hint-rule-defect-form /deep/ .defect-code-input .el-input__inner {
+ color: #409EFF;
+ font-weight: 600;
+}
+