新版北京一号线 新建计划车指令代码修改

This commit is contained in:
joylink_cuiweidong 2020-02-13 12:33:54 +08:00
parent e5f78fd3e3
commit 9115155865

View File

@ -4,13 +4,29 @@
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules"> <el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;"> <div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode"> <el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-input v-model="addModel.trainCode" /> <!-- <el-input v-model="addModel.trainCode" /> -->
</el-form-item> <el-select v-model="addModel.trainCode" filterable>
<el-form-item label="服 务 号:" label-width="95px" prop="serverNumber"> <el-option
<el-input v-model="addModel.serverNumber" /> v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber"> <el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-input v-model="addModel.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="serviceNumber">
<el-input v-model="addModel.serviceNumber" />
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
@ -26,138 +42,158 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
export default { export default {
// name: 'TrainMove', // name: 'TrainMove',
name: 'TrainAddPlan', name: 'TrainAddPlan',
components: { components: {
}, },
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
selected: null, selected: null,
tripNumberList: [],
addModel: { addModel: {
trainCode: '', // trainCode: '', //
serverNumber: '', // serviceNumber: '', //
tripNumber: '' // tripNumber: '' //
}, },
rules: { rules: {
trainCode: [ trainCode: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'change' }
], ],
serverNumber: [ serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'change' } { required: true, message: '请输入服务号', trigger: 'blur' }
], ],
tripNumber: [ tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' } { required: true, message: '请输入车次号', trigger: 'change' }
] ]
}, },
dialogShow: false, dialogShow: false,
loading: false loading: false
} }
},
computed: {
...mapGetters('map', [
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
computed: { domIdCancel() {
...mapGetters('map', [ return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '创建计划车'
}
}, },
mounted() { domIdConfirm() {
this.$nextTick(() => { return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
this.$store.dispatch('training/tipReload');
})
}, },
methods: { title() {
doShow(operate, selected) { return '创建计划车'
this.selected = selected; }
// },
if (!this.dialogShow) { mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
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.dialogShow = true; this.addModel = {
this.$nextTick(function () { trainCode:'',
this.$store.dispatch('training/emitTipFresh'); tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
}); });
}, });
doClose() { this.dialogShow = true;
this.loading = false; this.$nextTick(function () {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); });
mouseCancelState(this.selected); },
}, doClose() {
commit() { this.loading = false;
this.$refs['form'].validate((valid) => { this.dialogShow = false;
if (valid) { this.$store.dispatch('training/emitTipFresh');
let operate = { this.$store.dispatch('map/setTrainWindowShow', false);
over: true, // mouseCancelState(this.selected);
operation: OperationEvent.Train.createPlanTrain.menu.operation, },
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, commit() {
param: { this.$refs['form'].validate((valid) => {
trainCode: this.addModel.trainCode, // if (valid) {
serverNumber: this.addModel.serverNumber, // let operate = {
tripNumber: this.addModel.tripNumber // over: true,
} operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
param: {
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
} }
}
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose(); this.doClose();
// this.$refs.noticeInfo.doShow(operate); }
}) }).catch(error => {
} else { this.loading = false;
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose(); this.doClose();
} // this.$refs.noticeInfo.doShow(operate);
}).catch(error => { this.doClose(); }); })
}, } else {
handerTrainSource() { return false;
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.trainSource.menu.operation,
val: this.addModel.trainSource
} }
});
this.$store.dispatch('training/next', operate).then(({ valid }) => { },
if (valid) { cancel() {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); let operate = {
} operation: OperationEvent.Command.cancel.menu.operation,
});
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
},
handerTrainSource() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.trainSource.menu.operation,
val: this.addModel.trainSource
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} }
} }
}
</script> </script>
<style scoped> <style scoped>
.beijing-01__systerm .el-dialog .base-label { .beijing-01__systerm .el-dialog .base-label {