|
|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="customer-css"> |
|
|
<div class="customer-css"> |
|
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" width="820px" style="height: 680px;" class="customer-dialog"> |
|
|
|
|
|
|
|
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" width="820px" style="height: 680px;" class="customer-dialog" :show-close="!exceptionRuleLocked" @close="onDialogClosed"> |
|
|
<el-form :inline="true" label-position="top" style="height: auto;"> |
|
|
<el-form :inline="true" label-position="top" style="height: auto;"> |
|
|
<!-- 时间和固定载具 --> |
|
|
<!-- 时间和固定载具 --> |
|
|
<el-row style="margin-top: -10px;"> |
|
|
<el-row style="margin-top: -10px;"> |
|
|
@ -143,15 +143,19 @@ |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div v-if="exceptionRuleLocked" class="exception-rule-lock-tip"> |
|
|
|
|
|
{{ exceptionRuleLockMessage }} |
|
|
|
|
|
</div> |
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="checkCreateSeparateRolllBun" :loading="yieldReportLoading" :disabled="exceptionRuleLocked">产量报告</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="success" @click="saveShiftChangeTransfer" :loading="shiftChangeLoading" :disabled="exceptionRuleLocked">换班结转</el-button> |
|
|
<el-button type="warning" @click="executeAbnormalRollCut" :loading="abnormalCutLoading" :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> |
|
|
<el-button @click="closeDialog" :disabled="exceptionRuleLocked">{{ buttons.closeButton }}</el-button> |
|
|
</span> |
|
|
</span> |
|
|
|
|
|
<div v-if="exceptionRuleLocked" class="exception-rule-mask"> |
|
|
|
|
|
<div class="exception-rule-mask-content"> |
|
|
|
|
|
<i class="el-icon-lock" /> |
|
|
|
|
|
<div class="exception-rule-mask-message">{{ exceptionRuleLockMessage || '当前异常代办尚未审核,已锁定创建分卷操作。' }}</div> |
|
|
|
|
|
<div class="exception-rule-mask-sub">请等待QC审核通过后继续操作</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<!-- 分卷不良原因对话框 --> |
|
|
<!-- 分卷不良原因对话框 --> |
|
|
@ -388,6 +392,8 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
checkSplitRollExceptionRule,/*创建分卷前异常规则校验*/ |
|
|
checkSplitRollExceptionRule,/*创建分卷前异常规则校验*/ |
|
|
|
|
|
getSplitRuleLockStatus,/*查询创建分卷规则锁定状态*/ |
|
|
|
|
|
completeSplitRuleTodoOperation,/*创建分卷完成后回写代办操作标识*/ |
|
|
createSplitSfdcRoll,/*执行创建分卷的操作*/ |
|
|
createSplitSfdcRoll,/*执行创建分卷的操作*/ |
|
|
getFixedCarrierList,/*获取固定载具列表*/ |
|
|
getFixedCarrierList,/*获取固定载具列表*/ |
|
|
getUnprocessedShiftChangeData,/*查询未处理的换班结转数据*/ |
|
|
getUnprocessedShiftChangeData,/*查询未处理的换班结转数据*/ |
|
|
@ -546,6 +552,7 @@ export default { |
|
|
cachedDataCount: 0, // 缓存数据条数 |
|
|
cachedDataCount: 0, // 缓存数据条数 |
|
|
cachedRowDataList: [], // 缓存的原始行数据(用于校验) |
|
|
cachedRowDataList: [], // 缓存的原始行数据(用于校验) |
|
|
isLoadingCachedData: false, // 是否正在加载缓存数据(防止触发handleRowCountChange) |
|
|
isLoadingCachedData: false, // 是否正在加载缓存数据(防止触发handleRowCountChange) |
|
|
|
|
|
lockStatusTimer: null, // 强制锁定状态轮询定时器 |
|
|
buttons: { |
|
|
buttons: { |
|
|
confirmButton: '确定', |
|
|
confirmButton: '确定', |
|
|
closeButton: '关闭', |
|
|
closeButton: '关闭', |
|
|
@ -714,6 +721,18 @@ export default { |
|
|
this.initRowDataList(); |
|
|
this.initRowDataList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 初始化后立即同步一次强制锁定状态 |
|
|
|
|
|
try { |
|
|
|
|
|
await this.refreshSplitRuleLockStatus(false); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('初始化锁定状态失败:', error); |
|
|
|
|
|
} |
|
|
|
|
|
if (this.exceptionRuleLocked) { |
|
|
|
|
|
this.startSplitRuleLockPolling(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.stopSplitRuleLockPolling(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 取消标记 |
|
|
// 取消标记 |
|
|
this.isLoadingCachedData = false; |
|
|
this.isLoadingCachedData = false; |
|
|
}, |
|
|
}, |
|
|
@ -1354,6 +1373,7 @@ export default { |
|
|
// 构建请求数据 |
|
|
// 构建请求数据 |
|
|
const requestData = { |
|
|
const requestData = { |
|
|
...this.pageData, |
|
|
...this.pageData, |
|
|
|
|
|
buNo: this.scheduleData.buNo, |
|
|
rollQty: totalGoodQty, |
|
|
rollQty: totalGoodQty, |
|
|
rollNums: 1, |
|
|
rollNums: 1, |
|
|
totalDefectQty: totalDefectQty, |
|
|
totalDefectQty: totalDefectQty, |
|
|
@ -1428,6 +1448,15 @@ export default { |
|
|
await this.printLabelsWithTemplate(allPrintList); |
|
|
await this.printLabelsWithTemplate(allPrintList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 放行执行完成后:回写operate_flag=Y并清理对应缓存 |
|
|
|
|
|
try { |
|
|
|
|
|
await this.completeSplitRuleTodoOperationIfNeeded(); |
|
|
|
|
|
await this.refreshSplitRuleLockStatus(false); |
|
|
|
|
|
} catch (completeError) { |
|
|
|
|
|
console.error('回写代办操作状态失败:', completeError); |
|
|
|
|
|
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 延时关闭弹窗 |
|
|
// 延时关闭弹窗 |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
this.closeDialog(); |
|
|
this.closeDialog(); |
|
|
@ -1653,12 +1682,86 @@ export default { |
|
|
|
|
|
|
|
|
/*关闭modal*/ |
|
|
/*关闭modal*/ |
|
|
closeDialog(){ |
|
|
closeDialog(){ |
|
|
|
|
|
this.stopSplitRuleLockPolling() |
|
|
//刷新报工的页面 |
|
|
//刷新报工的页面 |
|
|
this.$emit('refreshPageData'); |
|
|
this.$emit('refreshPageData'); |
|
|
//关闭当前的页面 |
|
|
//关闭当前的页面 |
|
|
this.$emit('update:visible', false); |
|
|
this.$emit('update:visible', false); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onDialogClosed () { |
|
|
|
|
|
this.stopSplitRuleLockPolling() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
buildSplitRuleStatusPayload () { |
|
|
|
|
|
return { |
|
|
|
|
|
site: this.scheduleData.site, |
|
|
|
|
|
buNo: this.scheduleData.buNo, |
|
|
|
|
|
orderNo: this.scheduleData.orderNo, |
|
|
|
|
|
seqNo: this.scheduleData.seqNo |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async refreshSplitRuleLockStatus (showUnlockHint) { |
|
|
|
|
|
const payload = this.buildSplitRuleStatusPayload() |
|
|
|
|
|
if (!payload.site || !payload.buNo || !payload.orderNo || !payload.seqNo) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const wasLocked = this.exceptionRuleLocked |
|
|
|
|
|
const { data } = await getSplitRuleLockStatus(payload) |
|
|
|
|
|
if (!data || data.code === 500) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const resultMap = data.resultMap || {} |
|
|
|
|
|
const locked = !!resultMap.locked |
|
|
|
|
|
this.exceptionRuleLocked = locked |
|
|
|
|
|
if (locked) { |
|
|
|
|
|
this.exceptionRuleLockMessage = resultMap.message || '当前异常代办尚未审核,已锁定创建分卷操作。' |
|
|
|
|
|
if (!wasLocked) { |
|
|
|
|
|
this.$emit('lockPageByExceptionRule', resultMap) |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.lockStatusTimer) { |
|
|
|
|
|
this.startSplitRuleLockPolling() |
|
|
|
|
|
} |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.stopSplitRuleLockPolling() |
|
|
|
|
|
this.exceptionRuleLockMessage = '' |
|
|
|
|
|
this.$emit('unlockPageByExceptionRule', resultMap) |
|
|
|
|
|
if (wasLocked && showUnlockHint && resultMap.bypassByAudit) { |
|
|
|
|
|
this.$message.success('QC已审核,已解除锁定,可继续操作。') |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
startSplitRuleLockPolling () { |
|
|
|
|
|
this.stopSplitRuleLockPolling() |
|
|
|
|
|
this.lockStatusTimer = setInterval(() => { |
|
|
|
|
|
this.refreshSplitRuleLockStatus(true).catch(err => { |
|
|
|
|
|
console.error('轮询锁定状态失败:', err) |
|
|
|
|
|
}) |
|
|
|
|
|
}, 10000) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
stopSplitRuleLockPolling () { |
|
|
|
|
|
if (this.lockStatusTimer) { |
|
|
|
|
|
clearInterval(this.lockStatusTimer) |
|
|
|
|
|
this.lockStatusTimer = null |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async completeSplitRuleTodoOperationIfNeeded () { |
|
|
|
|
|
const payload = this.buildSplitRuleStatusPayload() |
|
|
|
|
|
if (!payload.site || !payload.buNo || !payload.orderNo || !payload.seqNo) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
payload.operatorId = this.pageData.operatorId |
|
|
|
|
|
payload.functionName = this.scheduleData.functionName || '' |
|
|
|
|
|
const { data } = await completeSplitRuleTodoOperation(payload) |
|
|
|
|
|
if (data && data.code === 500) { |
|
|
|
|
|
throw new Error(data.msg || '回写代办操作状态失败') |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
buildSplitRuleCheckPayload (actionName) { |
|
|
buildSplitRuleCheckPayload (actionName) { |
|
|
return { |
|
|
return { |
|
|
site: this.scheduleData.site, |
|
|
site: this.scheduleData.site, |
|
|
@ -1694,6 +1797,12 @@ export default { |
|
|
throw new Error((data && data.msg) || '异常规则校验失败') |
|
|
throw new Error((data && data.msg) || '异常规则校验失败') |
|
|
} |
|
|
} |
|
|
const resultMap = data.resultMap || {} |
|
|
const resultMap = data.resultMap || {} |
|
|
|
|
|
if (resultMap.bypassByAudit) { |
|
|
|
|
|
this.exceptionRuleLocked = false |
|
|
|
|
|
this.exceptionRuleLockMessage = '' |
|
|
|
|
|
this.stopSplitRuleLockPolling() |
|
|
|
|
|
this.$emit('unlockPageByExceptionRule', resultMap) |
|
|
|
|
|
} |
|
|
if (!resultMap.matched) { |
|
|
if (!resultMap.matched) { |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
@ -1717,6 +1826,7 @@ export default { |
|
|
this.exceptionRuleLockMessage = message |
|
|
this.exceptionRuleLockMessage = message |
|
|
this.$message.error(message) |
|
|
this.$message.error(message) |
|
|
this.$emit('lockPageByExceptionRule', resultMap) |
|
|
this.$emit('lockPageByExceptionRule', resultMap) |
|
|
|
|
|
this.startSplitRuleLockPolling() |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
return true |
|
|
return true |
|
|
@ -1783,48 +1893,9 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// //获取当前是的数量 |
|
|
|
|
|
// let rollQty = parseFloat(this.pageData.rollQty); |
|
|
|
|
|
// //判断是否可以修改 |
|
|
|
|
|
// if (rollQty <= 0 || !Number.isInteger(rollQty)){ |
|
|
|
|
|
// this.$message.error(this.labels.approvedQtyMustMoreTanZeroAndBeInteger); |
|
|
|
|
|
// return false; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// //获取当前是的数量 |
|
|
|
|
|
// let rollNums = parseFloat(this.pageData.rollNums); |
|
|
|
|
|
// //判断是否是正整数 |
|
|
|
|
|
// if (rollNums <= 0 || !Number.isInteger(rollNums)){ |
|
|
|
|
|
// this.$message.error(this.labels.rollQtyMustMoreTanZeroAndBeInteger); |
|
|
|
|
|
// return false; |
|
|
|
|
|
// } |
|
|
|
|
|
// 开启loading |
|
|
// 开启loading |
|
|
this.yieldReportLoading = true; |
|
|
this.yieldReportLoading = true; |
|
|
// //校验是否继续 |
|
|
|
|
|
// checkCreateSplitSfdcRoll(this.pageData) |
|
|
|
|
|
// .then(({data}) => { |
|
|
|
|
|
// //判断是否成功 |
|
|
|
|
|
// if (data.code == 500) { |
|
|
|
|
|
// this.$message.error(data.msg); |
|
|
|
|
|
// this.yieldReportLoading = false; |
|
|
|
|
|
// } else if (data.resultMap.resultCode == '201') { |
|
|
|
|
|
// //打开异常原因录入的界面 |
|
|
|
|
|
// this.$confirm(data.resultMap.resultMsg, '提示', { |
|
|
|
|
|
// confirmButtonText: this.labels.confirmLabel, |
|
|
|
|
|
// celButtonText: this.labels.cancelLabel, |
|
|
|
|
|
// type: 'warning' |
|
|
|
|
|
// }).then(() => { |
|
|
|
|
|
// //执行切换卷的操作 |
|
|
|
|
|
// this.createSeparateRolllOperation(); |
|
|
|
|
|
// }).catch(() => { |
|
|
|
|
|
// this.yieldReportLoading = false; |
|
|
|
|
|
// }); |
|
|
|
|
|
// } else { //执行切换卷的操作 |
|
|
|
|
|
// this.createSeparateRolllOperation(); |
|
|
|
|
|
// } |
|
|
|
|
|
// }).catch(() => { |
|
|
|
|
|
// this.yieldReportLoading = false; |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
this.createSeparateRolllOperation(); |
|
|
this.createSeparateRolllOperation(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -1849,7 +1920,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const passRuleCheck = await this.checkSplitRuleBeforeAction('参量报告') |
|
|
|
|
|
|
|
|
const passRuleCheck = await this.checkSplitRuleBeforeAction('产量报告') |
|
|
if (!passRuleCheck) { |
|
|
if (!passRuleCheck) { |
|
|
this.yieldReportLoading = false |
|
|
this.yieldReportLoading = false |
|
|
return false |
|
|
return false |
|
|
@ -1908,6 +1979,7 @@ export default { |
|
|
// 构建请求数据(每次调用rollNums固定为1) |
|
|
// 构建请求数据(每次调用rollNums固定为1) |
|
|
const requestData = { |
|
|
const requestData = { |
|
|
...this.pageData, |
|
|
...this.pageData, |
|
|
|
|
|
buNo: this.scheduleData.buNo, |
|
|
rollQty: totalGoodQty, // 该卷的良品总数 |
|
|
rollQty: totalGoodQty, // 该卷的良品总数 |
|
|
rollNums: 1, // 固定为1 |
|
|
rollNums: 1, // 固定为1 |
|
|
defectQty: totalDefectQty, // 该卷的不良总数 |
|
|
defectQty: totalDefectQty, // 该卷的不良总数 |
|
|
@ -1960,6 +2032,15 @@ export default { |
|
|
await this.printLabelsWithTemplate(allPrintList) |
|
|
await this.printLabelsWithTemplate(allPrintList) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 放行执行完成后:回写operate_flag=Y并清理对应缓存 |
|
|
|
|
|
try { |
|
|
|
|
|
await this.completeSplitRuleTodoOperationIfNeeded() |
|
|
|
|
|
await this.refreshSplitRuleLockStatus(false) |
|
|
|
|
|
} catch (completeError) { |
|
|
|
|
|
console.error('回写代办操作状态失败:', completeError) |
|
|
|
|
|
this.$message.warning(completeError.message || '回写代办操作状态失败,请联系管理员检查') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 延时关闭弹窗 |
|
|
// 延时关闭弹窗 |
|
|
setTimeout(() =>{ |
|
|
setTimeout(() =>{ |
|
|
//关闭当前的页面 |
|
|
//关闭当前的页面 |
|
|
@ -2146,6 +2227,9 @@ export default { |
|
|
created() { |
|
|
created() { |
|
|
// this.factoryList() |
|
|
// this.factoryList() |
|
|
// this.getLanguageList() |
|
|
// this.getLanguageList() |
|
|
|
|
|
}, |
|
|
|
|
|
beforeDestroy() { |
|
|
|
|
|
this.stopSplitRuleLockPolling() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -2296,13 +2380,51 @@ export default { |
|
|
overflow-y: auto !important; |
|
|
overflow-y: auto !important; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.exception-rule-lock-tip { |
|
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
padding: 8px 12px; |
|
|
|
|
|
border-radius: 4px; |
|
|
|
|
|
background: #fde2e2; |
|
|
|
|
|
|
|
|
.customer-dialog /deep/ .el-dialog { |
|
|
|
|
|
position: relative; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exception-rule-mask { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
top: 0; |
|
|
|
|
|
left: 0; |
|
|
|
|
|
right: 0; |
|
|
|
|
|
bottom: 0; |
|
|
|
|
|
z-index: 30; |
|
|
|
|
|
background: rgba(255, 255, 255, 0.75); |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
backdrop-filter: blur(1px); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exception-rule-mask-content { |
|
|
|
|
|
width: 75%; |
|
|
|
|
|
max-width: 560px; |
|
|
|
|
|
padding: 22px 26px; |
|
|
|
|
|
border-radius: 8px; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
background: #ffffff; |
|
|
|
|
|
border: 1px solid #f5c2c7; |
|
|
|
|
|
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); |
|
|
color: #c45656; |
|
|
color: #c45656; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exception-rule-mask-content .el-icon-lock { |
|
|
|
|
|
font-size: 26px; |
|
|
|
|
|
margin-bottom: 8px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exception-rule-mask-message { |
|
|
|
|
|
font-size: 15px; |
|
|
|
|
|
font-weight: 600; |
|
|
|
|
|
line-height: 1.6; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exception-rule-mask-sub { |
|
|
|
|
|
margin-top: 8px; |
|
|
font-size: 13px; |
|
|
font-size: 13px; |
|
|
|
|
|
color: #909399; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* 分卷不良原因对话框 */ |
|
|
/* 分卷不良原因对话框 */ |
|
|
|