Bug:【大铁标准站】综合演练时,路票无法给与别的车站

This commit is contained in:
fan 2023-01-13 10:11:13 +08:00
parent 48cdf34b32
commit 164d34ad09

View File

@ -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();