Browse Source

2026-09-07

代办增加“不良代码”
master
fengyuan_yang 2 weeks ago
parent
commit
58cab288dc
  1. 18
      src/views/modules/todo/todoCenter.vue
  2. 142
      src/views/modules/yieldReport/com_separate_roll.vue

18
src/views/modules/todo/todoCenter.vue

@ -189,6 +189,10 @@
<span class="label">责任部门</span>
<span class="value">{{ item.responsibilityDeptName || item.responsibilityDept || '-' }}</span>
</div>
<div class="todo-detail-line">
<span class="label">不良代码</span>
<span class="value" :title="buildTodoDefectLabel(item)">{{ buildTodoDefectLabel(item) }}</span>
</div>
<div class="todo-step-row">
<div class="step-item done">生成</div>
@ -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 || '-'

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

@ -372,6 +372,42 @@
</span>
</el-dialog>
<!-- 异常代码规则触发确认 -->
<el-dialog
title="规则触发确认"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="false"
:visible.sync="hintRuleConfirmVisible"
width="560px"
append-to-body>
<div class="hint-rule-confirm-body" v-html="hintRuleConfirmHtml"></div>
<el-form :inline="true" label-position="top" class="hint-rule-defect-form">
<el-form-item required>
<span slot="label" class="defect-code-label" @click="openHintRuleDefectPicker"><a>不良代码</a></span>
<el-input
v-model="hintRuleDefectForm.defectCode"
readonly
class="defect-code-input"
style="width: 160px"
placeholder="请选择"
@click.native="openHintRuleDefectPicker">
</el-input>
</el-form-item>
<el-form-item label="不良描述">
<el-input
v-model="hintRuleDefectForm.defectDesc"
readonly
style="width: 280px">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="cancelHintRuleConfirm">关闭</el-button>
<el-button type="primary" :disabled="!hintRuleDefectForm.defectCode" @click="submitHintRuleConfirm">继续</el-button>
</span>
</el-dialog>
<!-- 固定载具选择对话框 -->
<el-dialog title="固定载具清单" :close-on-click-modal="false" v-drag :visible.sync="carrierModelFlag" width="950px">
<div class="rq">
@ -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;
}
</style>
<style lang="scss">

Loading…
Cancel
Save