|
|
|
@ -157,7 +157,11 @@ |
|
|
|
<el-table-column prop="warningLevel" label="预警等级" header-align="center" align="center" min-width="100"></el-table-column> |
|
|
|
<el-table-column prop="animationEffect" label="动画效果" header-align="center" align="center" min-width="100"></el-table-column> |
|
|
|
<el-table-column prop="responsibilityDept" label="责任部门" header-align="center" align="center" min-width="120"></el-table-column> |
|
|
|
<el-table-column prop="triggerEvent" label="触发异常事件" header-align="center" align="center" min-width="110"></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 : '' }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" header-align="center" align="center" min-width="80"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link style="cursor: pointer" @click="openConditionEdit(scope.row)">编辑</el-link> |
|
|
|
@ -210,7 +214,7 @@ |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item label="是否强制"> |
|
|
|
<el-select v-model="conditionForm.forceType" style="width: 100px"> |
|
|
|
<el-select v-model="conditionForm.forceType" :disabled="isForceTypeLocked" style="width: 100px"> |
|
|
|
<el-option v-for="item in forceTypeOptions" :key="item" :label="item" :value="item"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
@ -234,8 +238,8 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="触发异常事件"> |
|
|
|
<el-select v-model="conditionForm.triggerEvent" style="width: 120px"> |
|
|
|
<el-form-item v-if="isChildCondition" label="触发异常事件"> |
|
|
|
<el-select v-model="conditionForm.triggerEvent" style="width: 120px" @change="onTriggerEventChange"> |
|
|
|
<el-option v-for="item in triggerEventOptions" :key="item" :label="item" :value="item"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
@ -314,7 +318,7 @@ export default { |
|
|
|
warningLevel: '一般', |
|
|
|
animationEffect: '系统默认', |
|
|
|
responsibilityDept: '', |
|
|
|
triggerEvent: '异常代码' |
|
|
|
triggerEvent: '' |
|
|
|
}, |
|
|
|
relationFieldOptions: ['排数', '分切卷数', '良品数', '面损', '性能不良', '不良数', '良率', '不良率', '总数'], |
|
|
|
compareSymbolOptions: ['>', '=', '<', '>=', '<='], |
|
|
|
@ -329,6 +333,12 @@ export default { |
|
|
|
computed: { |
|
|
|
rootConditionList () { |
|
|
|
return this.conditionList || [] |
|
|
|
}, |
|
|
|
isChildCondition () { |
|
|
|
return !!this.conditionForm.parentConditionNo |
|
|
|
}, |
|
|
|
isForceTypeLocked () { |
|
|
|
return this.isChildCondition && this.conditionForm.triggerEvent === '异常代码' |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
@ -546,12 +556,13 @@ export default { |
|
|
|
relationField: '', |
|
|
|
compareSymbol: '>', |
|
|
|
conditionParam: null, |
|
|
|
forceType: '强制', |
|
|
|
forceType: parentConditionNo ? '提示' : '强制', |
|
|
|
warningLevel: '一般', |
|
|
|
animationEffect: '系统默认', |
|
|
|
responsibilityDept: '', |
|
|
|
triggerEvent: '异常代码' |
|
|
|
triggerEvent: parentConditionNo ? '异常代码' : '' |
|
|
|
} |
|
|
|
this.applyConditionRule() |
|
|
|
this.conditionEditVisible = true |
|
|
|
}, |
|
|
|
onParentConditionChange (parentConditionNo) { |
|
|
|
@ -559,6 +570,22 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
this.conditionForm.conditionNo = this.generateConditionNo(parentConditionNo || '') |
|
|
|
this.applyConditionRule() |
|
|
|
}, |
|
|
|
onTriggerEventChange () { |
|
|
|
this.applyConditionRule() |
|
|
|
}, |
|
|
|
applyConditionRule () { |
|
|
|
if (!this.conditionForm.parentConditionNo) { |
|
|
|
this.conditionForm.triggerEvent = '' |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.conditionForm.triggerEvent) { |
|
|
|
this.conditionForm.triggerEvent = '异常代码' |
|
|
|
} |
|
|
|
if (this.conditionForm.triggerEvent === '异常代码') { |
|
|
|
this.conditionForm.forceType = '提示' |
|
|
|
} |
|
|
|
}, |
|
|
|
openConditionEdit (row) { |
|
|
|
this.conditionEditTitle = '编辑触发条件' |
|
|
|
@ -576,8 +603,9 @@ export default { |
|
|
|
warningLevel: row.warningLevel, |
|
|
|
animationEffect: row.animationEffect, |
|
|
|
responsibilityDept: row.responsibilityDept, |
|
|
|
triggerEvent: row.triggerEvent |
|
|
|
triggerEvent: row.parentConditionNo ? row.triggerEvent : '' |
|
|
|
} |
|
|
|
this.applyConditionRule() |
|
|
|
this.conditionEditVisible = true |
|
|
|
}, |
|
|
|
saveCondition () { |
|
|
|
@ -605,10 +633,15 @@ export default { |
|
|
|
this.$message.warning('请选择是否强制') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.conditionForm.triggerEvent) { |
|
|
|
if (this.isChildCondition && !this.conditionForm.triggerEvent) { |
|
|
|
this.$message.warning('请选择触发异常事件') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.isChildCondition) { |
|
|
|
this.conditionForm.triggerEvent = '' |
|
|
|
} else if (this.conditionForm.triggerEvent === '异常代码') { |
|
|
|
this.conditionForm.forceType = '提示' |
|
|
|
} |
|
|
|
if (this.conditionForm.mode === 'add') { |
|
|
|
saveSceneExceptionRuleCondition(this.conditionForm).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
|