|
|
|
@ -35,6 +35,11 @@ |
|
|
|
<el-table-column prop="ruleName" label="规则名称" header-align="center" align="left" min-width="220"></el-table-column> |
|
|
|
<el-table-column prop="applyPage" label="应用页面" header-align="center" align="center" min-width="140"></el-table-column> |
|
|
|
<el-table-column prop="applyButton" label="应用按钮" header-align="center" align="center" min-width="140"></el-table-column> |
|
|
|
<el-table-column label="触发工序" header-align="center" align="left" min-width="180" show-overflow-tooltip> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ formatTriggerWorkCenter(scope.row) }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="是否启用" header-align="center" align="center" min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag v-if="scope.row.enableFlag === 'Y'" type="success">启用</el-tag> |
|
|
|
@ -121,6 +126,25 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item label="触发工序"> |
|
|
|
<el-select |
|
|
|
class="trigger-work-center-select" |
|
|
|
v-model="mainForm.triggerWorkCenterList" |
|
|
|
multiple |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
style="width: 428px" |
|
|
|
placeholder="请选择加工中心"> |
|
|
|
<el-option |
|
|
|
v-for="item in workCenterList" |
|
|
|
:key="item.workCenterNo" |
|
|
|
:label="item.workCenterDesc" |
|
|
|
:value="item.workCenterNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height: 35px; margin-top: 10px; text-align: center"> |
|
|
|
<el-button type="primary" @click="saveMain">保存</el-button> |
|
|
|
<el-button type="primary" @click="mainDialogVisible = false">关闭</el-button> |
|
|
|
@ -162,11 +186,6 @@ |
|
|
|
{{ getResponsibilityDeptLabel(scope.row) }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="触发工序" header-align="center" align="left" min-width="160" show-overflow-tooltip> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ formatTriggerWorkCenter(scope.row) }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="触发异常事件" header-align="center" align="center" min-width="110"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.parentConditionNo ? scope.row.triggerEvent : '' }} |
|
|
|
@ -254,24 +273,6 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item label="触发工序"> |
|
|
|
<el-select |
|
|
|
v-model="conditionForm.triggerWorkCenterList" |
|
|
|
multiple |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
style="width: 640px" |
|
|
|
placeholder="请选择加工中心"> |
|
|
|
<el-option |
|
|
|
v-for="item in workCenterList" |
|
|
|
:key="item.workCenterNo" |
|
|
|
:label="item.workCenterDesc" |
|
|
|
:value="item.workCenterNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height: 35px; margin-top: 10px; text-align: center"> |
|
|
|
<el-button type="primary" @click="saveCondition">保存</el-button> |
|
|
|
<el-button type="primary" @click="conditionEditVisible = false">关闭</el-button> |
|
|
|
@ -326,7 +327,9 @@ export default { |
|
|
|
ruleName: '', |
|
|
|
applyPage: '过站采集', |
|
|
|
applyButton: '创建分卷', |
|
|
|
enableFlag: 'Y' |
|
|
|
enableFlag: 'Y', |
|
|
|
triggerWorkCenter: '', |
|
|
|
triggerWorkCenterList: [] |
|
|
|
}, |
|
|
|
conditionDialogVisible: false, |
|
|
|
currentRule: {}, |
|
|
|
@ -348,9 +351,7 @@ export default { |
|
|
|
warningLevel: '一般', |
|
|
|
animationEffect: '系统默认', |
|
|
|
responsibilityDept: '', |
|
|
|
triggerEvent: '', |
|
|
|
triggerWorkCenter: '', |
|
|
|
triggerWorkCenterList: [] |
|
|
|
triggerEvent: '' |
|
|
|
}, |
|
|
|
relationFieldOptions: ['排数', '分切卷数', '总卷数', '良品数', '面损', '性能不良', '不良数', '良率', '不良率', '总数'], |
|
|
|
compareSymbolOptions: ['>', '=', '<', '>=', '<='], |
|
|
|
@ -518,7 +519,9 @@ export default { |
|
|
|
ruleName: row.ruleName, |
|
|
|
applyPage: row.applyPage || this.applyPageOptions[0], |
|
|
|
applyButton: row.applyButton || this.applyButtonOptions[0], |
|
|
|
enableFlag: row.enableFlag || 'Y' |
|
|
|
enableFlag: row.enableFlag || 'Y', |
|
|
|
triggerWorkCenter: row.triggerWorkCenter || '', |
|
|
|
triggerWorkCenterList: this.parseTriggerWorkCenterList(row.triggerWorkCenter) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.mainDialogTitle = '新增异常规则' |
|
|
|
@ -532,7 +535,9 @@ export default { |
|
|
|
ruleName: '', |
|
|
|
applyPage: this.applyPageOptions[0], |
|
|
|
applyButton: this.applyButtonOptions[0], |
|
|
|
enableFlag: 'Y' |
|
|
|
enableFlag: 'Y', |
|
|
|
triggerWorkCenter: '', |
|
|
|
triggerWorkCenterList: [] |
|
|
|
} |
|
|
|
} |
|
|
|
this.mainDialogVisible = true |
|
|
|
@ -554,8 +559,17 @@ export default { |
|
|
|
this.$message.warning('请选择应用按钮') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.mainForm.triggerWorkCenterList || this.mainForm.triggerWorkCenterList.length === 0) { |
|
|
|
this.$message.warning('请选择触发工序') |
|
|
|
return |
|
|
|
} |
|
|
|
const payload = this.buildMainPayload() |
|
|
|
if (!payload.triggerWorkCenter) { |
|
|
|
this.$message.warning('请选择触发工序') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.mainForm.mode === 'add') { |
|
|
|
saveSceneExceptionRule(this.mainForm).then(({ data }) => { |
|
|
|
saveSceneExceptionRule(payload).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.mainDialogVisible = false |
|
|
|
this.$message.success('新增成功,规则编码:' + (data.ruleCode || '')) |
|
|
|
@ -565,7 +579,7 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
updateSceneExceptionRule(this.mainForm).then(({ data }) => { |
|
|
|
updateSceneExceptionRule(payload).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.mainDialogVisible = false |
|
|
|
this.$message.success('操作成功') |
|
|
|
@ -576,6 +590,12 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
buildMainPayload () { |
|
|
|
const payload = JSON.parse(JSON.stringify(this.mainForm || {})) |
|
|
|
payload.triggerWorkCenter = this.joinTriggerWorkCenterList(payload.triggerWorkCenterList || []) |
|
|
|
delete payload.triggerWorkCenterList |
|
|
|
return payload |
|
|
|
}, |
|
|
|
deleteMain () { |
|
|
|
if (this.mainSelection.length === 0) { |
|
|
|
this.$message.warning('请勾选要删除的记录') |
|
|
|
@ -650,9 +670,7 @@ export default { |
|
|
|
warningLevel: '一般', |
|
|
|
animationEffect: '系统默认', |
|
|
|
responsibilityDept: '', |
|
|
|
triggerEvent: parentConditionNo ? '异常代码' : '', |
|
|
|
triggerWorkCenter: '', |
|
|
|
triggerWorkCenterList: [] |
|
|
|
triggerEvent: parentConditionNo ? '异常代码' : '' |
|
|
|
} |
|
|
|
this.applyConditionRule() |
|
|
|
this.conditionEditVisible = true |
|
|
|
@ -695,9 +713,7 @@ export default { |
|
|
|
warningLevel: row.warningLevel, |
|
|
|
animationEffect: row.animationEffect, |
|
|
|
responsibilityDept: row.responsibilityDept, |
|
|
|
triggerEvent: row.parentConditionNo ? row.triggerEvent : '', |
|
|
|
triggerWorkCenter: row.triggerWorkCenter || '', |
|
|
|
triggerWorkCenterList: this.parseTriggerWorkCenterList(row.triggerWorkCenter) |
|
|
|
triggerEvent: row.parentConditionNo ? row.triggerEvent : '' |
|
|
|
} |
|
|
|
this.applyConditionRule() |
|
|
|
this.conditionEditVisible = true |
|
|
|
@ -727,10 +743,6 @@ export default { |
|
|
|
this.$message.warning('请选择是否强制') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.conditionForm.triggerWorkCenterList || this.conditionForm.triggerWorkCenterList.length === 0) { |
|
|
|
this.$message.warning('请选择触发工序') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.isChildCondition && !this.conditionForm.triggerEvent) { |
|
|
|
this.$message.warning('请选择触发异常事件') |
|
|
|
return |
|
|
|
@ -741,10 +753,6 @@ export default { |
|
|
|
this.conditionForm.forceType = '提示' |
|
|
|
} |
|
|
|
const payload = this.buildConditionPayload() |
|
|
|
if (!payload.triggerWorkCenter) { |
|
|
|
this.$message.warning('请选择触发工序') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.conditionForm.mode === 'add') { |
|
|
|
saveSceneExceptionRuleCondition(payload).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -769,8 +777,6 @@ export default { |
|
|
|
}, |
|
|
|
buildConditionPayload () { |
|
|
|
const payload = JSON.parse(JSON.stringify(this.conditionForm || {})) |
|
|
|
payload.triggerWorkCenter = this.joinTriggerWorkCenterList(payload.triggerWorkCenterList || []) |
|
|
|
delete payload.triggerWorkCenterList |
|
|
|
return payload |
|
|
|
}, |
|
|
|
deleteCondition () { |
|
|
|
@ -861,4 +867,30 @@ export default { |
|
|
|
height: auto !important; |
|
|
|
line-height: 22px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.mod-config /deep/ .trigger-work-center-select .el-input__inner { |
|
|
|
min-height: 56px !important; |
|
|
|
height: 56px !important; |
|
|
|
padding-top: 4px; |
|
|
|
padding-bottom: 4px; |
|
|
|
} |
|
|
|
|
|
|
|
.mod-config /deep/ .trigger-work-center-select .el-select__tags { |
|
|
|
top: 4px !important; |
|
|
|
transform: none !important; |
|
|
|
max-width: calc(100% - 40px) !important; |
|
|
|
max-height: 48px; |
|
|
|
overflow-y: auto; |
|
|
|
} |
|
|
|
|
|
|
|
.mod-config /deep/ .trigger-work-center-select .el-select__tags > span { |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|
align-items: flex-start; |
|
|
|
} |
|
|
|
|
|
|
|
.mod-config /deep/ .trigger-work-center-select .el-select__input { |
|
|
|
margin-left: 6px; |
|
|
|
line-height: 20px; |
|
|
|
} |
|
|
|
</style> |