|
|
|
|
@ -86,7 +86,11 @@
|
|
|
|
|
<el-table-column label="规则名称" align="center" prop="ruleName" v-if="columns[1].visible"/>
|
|
|
|
|
<el-table-column label="呼叫类型编码" align="center" prop="callTypeCode" v-if="columns[2].visible"/>
|
|
|
|
|
<el-table-column label="适用产线编码" align="center" prop="productLineCode" v-if="columns[3].visible"/>
|
|
|
|
|
<el-table-column label="适用工位/工序编码" align="center" prop="stationCode" v-if="columns[4].visible"/>
|
|
|
|
|
<el-table-column label="绑定工位" align="center" prop="stationCode" v-if="columns[4].visible">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ formatStationLabel(scope.row.stationCode) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="适用班组编码" align="center" prop="teamCode" v-if="columns[5].visible"/>
|
|
|
|
|
<el-table-column label="限定触发源类型" align="center" prop="sourceType" v-if="columns[6].visible"/>
|
|
|
|
|
<el-table-column label="确认时限" align="center" prop="ackTimeoutMin" v-if="columns[7].visible"/>
|
|
|
|
|
@ -155,9 +159,9 @@
|
|
|
|
|
<el-select v-model="form.stationCode" placeholder="请选择绑定的工位(必填)" filterable style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in processStationList"
|
|
|
|
|
:key="item.stationCode"
|
|
|
|
|
:label="item.stationName + ' (' + item.stationCode + ')'"
|
|
|
|
|
:value="item.stationCode"
|
|
|
|
|
:key="item.productLineCode"
|
|
|
|
|
:label="formatStationOptionLabel(item)"
|
|
|
|
|
:value="item.productLineCode"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
@ -210,7 +214,6 @@
|
|
|
|
|
import { listAndonRule, getAndonRule, delAndonRule, addAndonRule, updateAndonRule } from "@/api/production/andonRule";
|
|
|
|
|
import { selectUserList } from "@/api/system/user";
|
|
|
|
|
import { findProductLineList } from "@/api/base/productLine";
|
|
|
|
|
import { listProcessStation } from "@/api/base/processStation";
|
|
|
|
|
import { getTeamMemberList } from "@/api/base/teamMembers";
|
|
|
|
|
import { getDeviceLedgerList } from "@/api/base/deviceLedger";
|
|
|
|
|
|
|
|
|
|
@ -241,7 +244,7 @@ export default {
|
|
|
|
|
defaultUserId: null,
|
|
|
|
|
// 产线下拉选项
|
|
|
|
|
productLineList: [],
|
|
|
|
|
// 工位/工序下拉选项
|
|
|
|
|
// 工位下拉选项
|
|
|
|
|
processStationList: [],
|
|
|
|
|
// 班组下拉选项
|
|
|
|
|
teamMembersList: [],
|
|
|
|
|
@ -443,8 +446,25 @@ export default {
|
|
|
|
|
const nameMap = new Map(this.userOptions.map(u => [String(u.userId), (u.nickName || u.userName || String(u.userId))]));
|
|
|
|
|
return ids.map(id => nameMap.get(String(id)) || id).join(', ');
|
|
|
|
|
},
|
|
|
|
|
// 安灯规则按工位编码落库,这里统一将编码映射为“工位名称(编码)”,避免列表和下拉展示口径不一致。
|
|
|
|
|
formatStationLabel(stationCode) {
|
|
|
|
|
if (!stationCode) return '';
|
|
|
|
|
const station = this.processStationList.find(item => String(item.productLineCode) === String(stationCode));
|
|
|
|
|
if (!station) return stationCode;
|
|
|
|
|
return this.formatStationOptionLabel(station);
|
|
|
|
|
},
|
|
|
|
|
// 这里复用工位主数据页面的字段定义,工位实际走 productLine 接口,编码/名称字段分别是 productLineCode/productLineName。
|
|
|
|
|
formatStationOptionLabel(station) {
|
|
|
|
|
if (!station) return '';
|
|
|
|
|
const stationName = station.productLineName || station.stationName || '';
|
|
|
|
|
const stationCode = station.productLineCode || station.stationCode || '';
|
|
|
|
|
if (stationName && stationCode) {
|
|
|
|
|
return `${stationName} (${stationCode})`;
|
|
|
|
|
}
|
|
|
|
|
return stationName || stationCode;
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {listProcessStation
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ruleIds = row.ruleId || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除安灯规则配置编号为"' + ruleIds + '"的数据项?').then(function() {
|
|
|
|
|
return delAndonRule(ruleIds);
|
|
|
|
|
@ -467,8 +487,9 @@ export default {
|
|
|
|
|
this.productLineList = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 加载工位/工序下拉选项 */
|
|
|
|
|
/** 加载工位下拉选项 */
|
|
|
|
|
loadProcessStations() {
|
|
|
|
|
// 业务上安灯规则绑定的是“工位”,而项目中的工位主数据挂在 productLine 体系下,productLineType=2 代表工位。
|
|
|
|
|
findProductLineList({ productLineType: 2 }).then(res => {
|
|
|
|
|
this.processStationList = res.data || res.rows || [];
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|