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

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