北京线 车次窗 新建列车代码调整

This commit is contained in:
joylink_cuiweidong 2020-02-12 18:57:02 +08:00
parent fa233a7031
commit 5721f17cf9
2 changed files with 49 additions and 53 deletions

View File

@ -1,16 +1,19 @@
<template> <template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="340px" :before-close="doClose" <el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="340px" :before-close="doClose"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form"> <el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;display:flex;flex-dorection:row"> <div style="width: 96%;">
<!-- <el-form-item label="车 组 号:" label-width="95px" prop="tripNumber"> <el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-input v-model="addModel.tripNumber" disabled></el-input> <el-input v-model="addModel.trainCode" />
</el-form-item> --> </el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="trainSource"> <el-form-item label="服 务 号:" label-width="95px" prop="serverNumber">
<el-input v-model="addModel.trainSource" :id="domIdTrainSource" @change="handerTrainSource"></el-input> <el-input v-model="addModel.serverNumber" />
</el-form-item> </el-form-item>
</div> <el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
</el-form> <el-input v-model="addModel.tripNumber" />
</el-form-item>
</div>
</el-form>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
@ -24,8 +27,8 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
// name: 'TrainMove', // name: 'TrainMove',
@ -35,34 +38,26 @@
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
selected: null, selected: null,
addModel: { addModel: {
tripNumber: '', trainCode: '', //
trainSource: '', serverNumber: '', //
stationStandSource: '', tripNumber: '' //
trainGoal: '', },
stationStandGoal: '',
},
rules: { rules: {
// tripNumber: [ trainCode: [
// { required: true, message: '', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
// ], ],
trainSource: [ serverNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' } { required: true, message: '请输入服务号', trigger: 'change' }
], ],
// stationStandSource: [ tripNumber: [
// { required: true, message: '', trigger: 'change' } { required: true, message: '请输入车次号', trigger: 'blur' }
// ], ]
// trainGoal: [ },
// { required: true, message: '', trigger: 'blur' } dialogShow: false,
// ], loading: false
// stationStandGoal: [
// { required: true, message: '', trigger: 'change' }
// ],
},
dialogShow: false,
loading: false,
} }
}, },
computed: { computed: {
@ -78,12 +73,8 @@
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
}, },
domIdTrainSource() {
// return this.dialogShow ? OperationEvent.Train.trainSource.menu.domId : '';
return this.dialogShow ? OperationEvent.Train.setPlanTrainId.menu.domId : '';
},
title() { title() {
return '添加计划车' return '创建计划车'
} }
}, },
mounted() { mounted() {
@ -114,14 +105,18 @@
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { let operate = {
send: true, over: true,
type: MapDeviceType.Train.type, operation: OperationEvent.Train.createPlanTrain.menu.operation,
// operation: OperationEvent.Train.moveTrainId.menu.operation, cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
operation: OperationEvent.Train.addPlanTrainId.menu.operation, param: {
trainCode: this.addModel.trainCode, //
serverNumber: this.addModel.serverNumber, //
tripNumber: this.addModel.tripNumber //
}
} }
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();

View File

@ -21,7 +21,7 @@ import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MapDeviceType, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
import TrainDelete from './dialog/trainDelete'; import TrainDelete from './dialog/trainDelete';
import TrainDefine from './dialog/trainDefine'; import TrainDefine from './dialog/trainDefine';
@ -35,6 +35,7 @@ import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork'; import TrainSetWork from './dialog/trainSetWork';
import TrainFlag from './dialog/trainFlag'; import TrainFlag from './dialog/trainFlag';
import { mouseCancelState } from './utils/menuItemStatus'; import { mouseCancelState } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -500,13 +501,13 @@ export default {
// //
addPlanTrain() { addPlanTrain() {
const operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation, operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: { param: {
trainWindowCode: this.selected.code sectionCode: this.$store.state.map.trainWindowSectionCode
} }
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });