宁波一号线 新建列车代码调整

This commit is contained in:
joylink_cuiweidong 2020-02-13 14:14:21 +08:00
parent 9115155865
commit 42668b6086

View File

@ -13,14 +13,30 @@
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-input v-model="addModel.trainCode" />
<!-- <el-input v-model="addModel.trainCode" /> -->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<!-- <el-input v-model="addModel.tripNumber" /> -->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serverNumber">
<el-input v-model="addModel.serverNumber" />
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-input v-model="addModel.tripNumber" />
</el-form-item>
</div>
</el-form>
<el-row justify="center" class="button-group">
@ -37,6 +53,7 @@
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -49,21 +66,22 @@ export default {
return {
trainNoList: [],
selected: null,
tripNumberList: [],
addModel: {
trainCode: '', //
serverNumber: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serverNumber: [
{ required: true, message: '请输入服务号', trigger: 'change' }
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
{ required: true, message: '请输入车次号', trigger: 'change' }
]
},
dialogShow: false,
@ -72,7 +90,9 @@ export default {
},
computed: {
...mapGetters('map', [
'stationStandList'
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -93,12 +113,30 @@ export default {
});
},
methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumber = resp.data;
});
},
doShow(operate, selected) {
this.selected = selected;
//
// if (!this.dialogShow) {
// }
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
@ -109,7 +147,7 @@ export default {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
// this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {