新版北京一号线 新建计划车指令代码修改
This commit is contained in:
parent
e5f78fd3e3
commit
9115155865
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user