From 164d34ad094d07809b43c2928d5e0c7265ee946e Mon Sep 17 00:00:00 2001 From: fan Date: Fri, 13 Jan 2023 10:11:13 +0800 Subject: [PATCH] =?UTF-8?q?Bug:=E3=80=90=E5=A4=A7=E9=93=81=E6=A0=87?= =?UTF-8?q?=E5=87=86=E7=AB=99=E3=80=91=E7=BB=BC=E5=90=88=E6=BC=94=E7=BB=83?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=B7=AF=E7=A5=A8=E6=97=A0=E6=B3=95=E7=BB=99?= =?UTF-8?q?=E4=B8=8E=E5=88=AB=E7=9A=84=E8=BD=A6=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../display/terminals/trainTicket/index.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/views/newMap/display/terminals/trainTicket/index.vue b/src/views/newMap/display/terminals/trainTicket/index.vue index cb8d4ce94..4cc21df66 100644 --- a/src/views/newMap/display/terminals/trainTicket/index.vue +++ b/src/views/newMap/display/terminals/trainTicket/index.vue @@ -48,7 +48,6 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO import RailTicket from './trainTicket'; import GreenLicence from './greenLicence'; import RedLicence from './redLicence'; -import { EventBus } from '@/scripts/event-bus'; export default { name: 'Index', components: { @@ -133,14 +132,14 @@ export default { this.greenLicenseForm.stationSeal = station.name; this.redLicenseForm.stationSeal = station.name; } + }, + '$store.state.training.memberList': function (val) { + this.initGiveMemberList(val); } }, mounted() { - EventBus.$on('trainTicketMember', (memberList) => { - this.giveMemberList = memberList; - }); const station = this.$store.getters['map/getDeviceByCode'](this.roleDeviceCode); - + this.initGiveMemberList(this.$store.state.training.memberList); if (station) { this.ticketForm.station = station.name; this.ticketForm.stationSeal = station.name; @@ -153,6 +152,15 @@ export default { } }, methods: { + initGiveMemberList(memberList) { + this.giveMemberList = []; + const memberData = this.$store.state.training.memberData; + memberList.forEach(item => { + if (item.type === 'STATION_ASSISTANT' || item.type === 'STATION_SUPERVISOR') { + this.giveMemberList.push(memberData[item.id]); + } + }); + }, handleClick() { if (this.activeName === 'second') { this.query();