diff --git a/src/views/production/andonRule/index.vue b/src/views/production/andonRule/index.vue
index 5f2b297..1b60534 100644
--- a/src/views/production/andonRule/index.vue
+++ b/src/views/production/andonRule/index.vue
@@ -86,7 +86,11 @@
-
+
+
+ {{ formatStationLabel(scope.row.stationCode) }}
+
+
@@ -155,9 +159,9 @@
@@ -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(() => {