Browse Source

2026-07-14

异常规则配置
master
fengyuan_yang 2 weeks ago
parent
commit
54f6600ae1
  1. 6
      src/api/yieldReport/com_separate_roll.js
  2. 2
      src/views/modules/sys/sceneExceptionRuleConfig.vue
  3. 41
      src/views/modules/yieldReport/com_produce_report_normal.vue
  4. 110
      src/views/modules/yieldReport/com_separate_roll.vue

6
src/api/yieldReport/com_separate_roll.js

@ -3,17 +3,18 @@ import { createAPI } from '@/utils/httpRequest.js'
// 校验创建分卷的操作
export const checkCreateSplitSfdcRoll = data => createAPI('schedule/checkCreateSplitSfdcRoll', 'POST', data)
// 创建分卷前异常规则校验
export const checkSplitRollExceptionRule = data => createAPI('schedule/checkSplitRollExceptionRule', 'POST', data)
// 执行创建分卷的操作
export const createSplitSfdcRoll = data => createAPI('schedule/createSplitSfdcRoll', 'POST', data)
// 校验fqc创建分卷的操作
export const otherCheckCreateSplitSfdcRoll = data => createAPI('schedule/otherCheckCreateSplitSfdcRoll', 'POST', data)
// 执行fqc创建分卷的操作
export const otherCreateSplitSfdcRoll = data => createAPI('schedule/otherCreateSplitSfdcRoll', 'POST', data)
// 换包装分卷
export const workbenchCreateslittingrollRepackAction = data => createAPI('schedule/workbench_createslittingroll_Repack_action', 'POST', data)
@ -47,4 +48,3 @@ export const getUnprocessedAbnormalRollData = data => createAPI('schedule/abnorm
// 更新异常截卷数据为已处理
export const markAbnormalRollAsProcessed = data => createAPI('schedule/abnormalRoll/markAsProcessed', 'POST', data)

2
src/views/modules/sys/sceneExceptionRuleConfig.vue

@ -320,7 +320,7 @@ export default {
responsibilityDept: '',
triggerEvent: ''
},
relationFieldOptions: ['排数', '分切卷数', '良品数', '面损', '性能不良', '不良数', '良率', '不良率', '总数'],
relationFieldOptions: ['排数', '分切卷数', '总卷数', '良品数', '面损', '性能不良', '不良数', '良率', '不良率', '总数'],
compareSymbolOptions: ['>', '=', '<', '>=', '<='],
forceTypeOptions: ['强制', '提示'],
applyPageOptions: ['过站采集'],

41
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -696,7 +696,11 @@
<!-- 创建分卷的操作 -->
<comSeparateRoll ref="comSeparateRoll" :close-on-click-modal="false"
:visible.sync="showSeparateFlag" @refreshPageData="refreshPageData">
:visible.sync="showSeparateFlag"
@refreshPageData="refreshPageData"
@openDefectByExceptionRule="onSeparateRuleOpenDefect"
@openDownTimeByExceptionRule="onSeparateRuleOpenDownTime"
@lockPageByExceptionRule="onSeparateRuleLockPage">
</comSeparateRoll>
@ -1083,6 +1087,7 @@ export default {
showOperatorFlag: false,
showSwitchFlag: false,
showSeparateFlag: false,
exceptionRuleForceLock: false,
showFinishFlag: false,
showFinishPartFlag: false,
showMergeFlag: false,
@ -4651,6 +4656,10 @@ export default {
//
async refreshPageButtons() {
if (this.exceptionRuleForceLock) {
this.lockWorkbenchButtonsByRule()
return
}
//
if (this.operatorData.operatorId == null || this.operatorData.operatorId == '') {
this.buttonTags.createNewRollFlag = true;
@ -4871,6 +4880,36 @@ export default {
});
},
lockWorkbenchButtonsByRule () {
Object.keys(this.buttonTags || {}).forEach(key => {
this.buttonTags[key] = true
})
},
onSeparateRuleOpenDefect () {
this.showSeparateFlag = false
this.$nextTick(() => {
this.defectRollModal()
})
},
onSeparateRuleOpenDownTime () {
this.showSeparateFlag = false
this.$nextTick(() => {
this.produceDownModal()
})
},
onSeparateRuleLockPage (resultMap) {
this.showSeparateFlag = false
this.exceptionRuleForceLock = true
this.lockWorkbenchButtonsByRule()
this.$alert((resultMap && resultMap.message) || '触发强制异常规则,当前页面已锁定。', '提示', {
confirmButtonText: '确定',
type: 'warning'
})
},
/*创建分卷的modal调用*/
separateRollModal() {
//1.

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

@ -143,11 +143,14 @@
</el-table>
</div>
</el-form>
<div v-if="exceptionRuleLocked" class="exception-rule-lock-tip">
{{ exceptionRuleLockMessage }}
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="checkCreateSeparateRolllBun" :loading="yieldReportLoading">产量报告</el-button>
<el-button type="success" @click="saveShiftChangeTransfer" :loading="shiftChangeLoading">换班结转</el-button>
<el-button type="warning" @click="executeAbnormalRollCut" :loading="abnormalCutLoading">异常截卷</el-button>
<el-button @click="closeDialog">{{ buttons.closeButton }}</el-button>
<el-button type="primary" @click="checkCreateSeparateRolllBun" :loading="yieldReportLoading" :disabled="exceptionRuleLocked">产量报告</el-button>
<el-button type="success" @click="saveShiftChangeTransfer" :loading="shiftChangeLoading" :disabled="exceptionRuleLocked">换班结转</el-button>
<el-button type="warning" @click="executeAbnormalRollCut" :loading="abnormalCutLoading" :disabled="exceptionRuleLocked">异常截卷</el-button>
<el-button @click="closeDialog" :disabled="exceptionRuleLocked">{{ buttons.closeButton }}</el-button>
</span>
</el-dialog>
@ -384,13 +387,12 @@
<script>
import {
checkCreateSplitSfdcRoll,/*校验是否可以创建分卷*/
checkSplitRollExceptionRule,/*创建分卷前异常规则校验*/
createSplitSfdcRoll,/*执行创建分卷的操作*/
getFixedCarrierList,/*获取固定载具列表*/
getUnprocessedShiftChangeData,/*查询未处理的换班结转数据*/
saveShiftChangeData,/*保存换班结转数据*/
markShiftChangeAsProcessed,/*更新换班结转数据为已处理*/
validateShiftChangeDataCount,/*校验数据条数*/
saveAbnormalRollData,/*保存异常截卷数据*/
} from '@/api/yieldReport/com_separate_roll.js';
import { checkDefectCode } from '@/api/yieldReport/com_defect_roll.js';
@ -438,6 +440,8 @@ export default {
yieldReportLoading: false, // loading
shiftChangeLoading: false, // loading
abnormalCutLoading: false, // loading
exceptionRuleLocked: false, //
exceptionRuleLockMessage: '', //
scheduleData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
@ -454,6 +458,7 @@ export default {
resourceDesc: '',
rollNo: '',
partDesc: '',
totalRollQty: 0,
planStartTime: '',
planFinishTime: '',
qtyRequiredOriginal: 0,
@ -682,6 +687,9 @@ export default {
this.pageData.rowCount = scheduleData.rowCount;
this.pageData.rollCount = scheduleData.rollCount;
this.pageData.fixture = scheduleData.carrierNo;
//
this.exceptionRuleLocked = false;
this.exceptionRuleLockMessage = '';
//
this.hasCachedData = false;
this.cachedDataCount = 0;
@ -1261,6 +1269,16 @@ export default {
return false;
}
try {
const passRuleCheck = await this.checkSplitRuleBeforeAction('异常截卷')
if (!passRuleCheck) {
return false
}
} catch (error) {
this.$message.error(error.message || '异常规则校验失败')
return false
}
//
try {
await this.$confirm('确定执行异常截卷操作吗?该操作将执行产量报告。', '提示', {
@ -1641,6 +1659,65 @@ export default {
this.$emit('update:visible', false);
},
buildSplitRuleCheckPayload (actionName) {
return {
site: this.scheduleData.site,
buNo: this.scheduleData.buNo,
orderNo: this.scheduleData.orderNo,
itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo,
rollNo: this.scheduleData.rollNo,
operatorId: this.pageData.operatorId,
functionName: actionName || '',
rowCount: this.pageData.rowCount || 0,
rollCount: this.pageData.rollCount || 0,
totalRollQty: Number(this.scheduleData.totalRollQty || 0),
rollRows: (this.rowDataList || []).map(row => ({
rowNumber: row.rowNumber,
goodQty: row.goodQty || 0,
surfaceLossQty: row.surfaceLossQty || 0,
poorPerformanceQty: row.poorPerformanceQty || 0,
defectQty: row.defectQty || 0,
totalQty: row.totalQty || 0
}))
}
},
async checkSplitRuleBeforeAction (actionName) {
const payload = this.buildSplitRuleCheckPayload(actionName)
const { data } = await checkSplitRollExceptionRule(payload)
if (!data || data.code === 500) {
throw new Error((data && data.msg) || '异常规则校验失败')
}
const resultMap = data.resultMap || {}
if (!resultMap.matched) {
return true
}
const action = resultMap.action || 'NONE'
const message = resultMap.message || '触发异常规则,请先处理。'
if (action === 'OPEN_DEFECT') {
this.$message.warning(message)
this.$emit('openDefectByExceptionRule', resultMap)
this.$emit('update:visible', false)
return false
}
if (action === 'OPEN_DOWNTIME') {
this.$message.warning(message)
this.$emit('openDownTimeByExceptionRule', resultMap)
this.$emit('update:visible', false)
return false
}
if (action === 'LOCK_PAGE') {
this.exceptionRuleLocked = true
this.exceptionRuleLockMessage = message
this.$message.error(message)
this.$emit('lockPageByExceptionRule', resultMap)
return false
}
return true
},
/*检查材料卷号的数据*/
checkValidQty() {
//
@ -1767,6 +1844,18 @@ export default {
return false
}
try {
const passRuleCheck = await this.checkSplitRuleBeforeAction('参量报告')
if (!passRuleCheck) {
this.yieldReportLoading = false
return false
}
} catch (error) {
this.$message.error(error.message || '异常规则校验失败')
this.yieldReportLoading = false
return false
}
try {
//
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount)
@ -2203,6 +2292,15 @@ export default {
overflow-y: auto !important;
}
.exception-rule-lock-tip {
margin-top: 10px;
padding: 8px 12px;
border-radius: 4px;
background: #fde2e2;
color: #c45656;
font-size: 13px;
}
/* 分卷不良原因对话框 */
.roll-defect-summary {
display: flex;

Loading…
Cancel
Save