xa3_头码车识别号校验修改
This commit is contained in:
parent
42d0fefa71
commit
67fe7b6774
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@ src/utils/baseUrl.js*
|
||||
*.njsproj
|
||||
*.sln
|
||||
debug.log
|
||||
.prettierrc
|
||||
|
@ -1,102 +1,133 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :class="popClass + ' train-control'" :title="title" :visible.sync="show" width="370px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-form ref="form" size="small" label-width="120px" :model="formModel" :rules="rules">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="groupNumber">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.groupNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:class="popClass + ' train-control'"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="370px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
size="small"
|
||||
label-width="120px"
|
||||
:model="formModel"
|
||||
:rules="rulesComputed"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.type"
|
||||
style="margin-left: 45px;"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'PLAN'">{{ $t('menu.planTrain') }}</el-radio>
|
||||
<el-radio :label="'HEAD'">{{ $t('menu.headCodeTrain') }}</el-radio>
|
||||
<el-radio :label="'MANUAL'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="this.$t('menu.groupNumber') + this.$t('global.colon')"
|
||||
prop="groupNumber"
|
||||
>
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.groupNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.type"
|
||||
style="margin-left: 45px;"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'PLAN'">{{ $t("menu.planTrain") }}</el-radio>
|
||||
<el-radio :label="'HEAD'">{{ $t("menu.headCodeTrain") }}</el-radio>
|
||||
<el-radio :label="'MANUAL'" style="margin-top:5px;">{{
|
||||
$t("menu.artificialTrain")
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 表号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN'" prop="serviceNumber">
|
||||
<span slot="label">{{ $t('menu.serviceNumber') + ':' }}</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 表号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN'" prop="serviceNumber">
|
||||
<span slot="label">{{ $t("menu.serviceNumber") + ":" }}</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 车次号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN'|| formModel.type == 'HEAD'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
|
||||
<el-input
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.tripNumber"
|
||||
maxlength="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 车次号 -->
|
||||
<el-form-item
|
||||
v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'"
|
||||
:label="this.$t('menu.tripNumber') + this.$t('global.colon')"
|
||||
prop="tripNumber"
|
||||
>
|
||||
<el-input :id="domIdTrainNo" v-model="formModel.tripNumber" maxlength="4" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 目的地号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'" :label="this.$t('menu.targetCode')+this.$t('global.colon')" prop="destinationCode">
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.destinationCode"
|
||||
:disabled="formModel.type !== 'HEAD'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 目的地号 -->
|
||||
<el-form-item
|
||||
v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'"
|
||||
:label="this.$t('menu.targetCode') + this.$t('global.colon')"
|
||||
prop="destinationCode"
|
||||
>
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.destinationCode"
|
||||
:disabled="formModel.type !== 'HEAD'"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 类别 -->
|
||||
<el-form-item v-if="formModel.type == 'MANUAL'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.category"
|
||||
filterable
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
</el-dialog>
|
||||
<!-- 类别 -->
|
||||
<el-form-item
|
||||
v-if="formModel.type == 'MANUAL'"
|
||||
:label="this.$t('menu.category') + this.$t('global.colon')"
|
||||
prop="category"
|
||||
>
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.category"
|
||||
filterable
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{
|
||||
$t("global.confirm")
|
||||
}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t("global.cancel") }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import Handler from '@/scripts/cmdPlugin/Handler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {getTrainDetailBytripNumber, getTrainDetailByStNumber} from '@/api/simulation';
|
||||
import NoticeInfo from '../childDialog/noticeInfo';
|
||||
import { mapGetters } from "vuex";
|
||||
import { OperationEvent } from "@/scripts/cmdPlugin/OperationHandler";
|
||||
import Handler from "@/scripts/cmdPlugin/Handler";
|
||||
import { menuOperate, commitOperate } from "@/jmapNew/theme/components/utils/menuOperate";
|
||||
import { getTrainDetailBytripNumber, getTrainDetailByStNumber } from "@/api/simulation";
|
||||
import NoticeInfo from "../childDialog/noticeInfo";
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
name: "TrainControl",
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
@ -104,48 +135,23 @@ export default {
|
||||
popClass: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
var validateTripNum = (rule, value, callback) => {
|
||||
const trip = Number.parseInt(value.substring(1));
|
||||
if (this.formModel.type === 'HEAD' && this.popClass === 'xian-01__systerm' && (trip < 701 || trip > 749)) {
|
||||
callback(new Error('头码车车次编号为701至749'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
trainList: [],
|
||||
serviceNumber:'',
|
||||
serviceNumber: "",
|
||||
formModel: {
|
||||
tripNumber: '',
|
||||
groupNumber: '',
|
||||
type: 'PLAN',
|
||||
serviceNumber: '',
|
||||
destinationCode: '',
|
||||
category: 'MM'
|
||||
},
|
||||
categoryList: [
|
||||
{ name: 'MM', value: '01' }
|
||||
],
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请选择车组号', trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择列车类型', trigger: 'change' }
|
||||
],
|
||||
tripNumber: [
|
||||
{ required: true, message: '请输入车次号', trigger: 'blur' },
|
||||
{ validator: validateTripNum, trigger: 'blur' }
|
||||
],
|
||||
destinationCode: [
|
||||
{ required: true, message: '请输入目的地号', trigger: 'blur' }
|
||||
]
|
||||
tripNumber: "",
|
||||
groupNumber: "",
|
||||
type: "PLAN",
|
||||
serviceNumber: "",
|
||||
destinationCode: "",
|
||||
category: "MM"
|
||||
},
|
||||
categoryList: [{ name: "MM", value: "01" }],
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
@ -154,11 +160,36 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
...mapGetters("map", ["map"]),
|
||||
rulesComputed() {
|
||||
const validateTripNum = (rule, value, callback) => {
|
||||
const trip = Number.parseInt(value.substring(1));
|
||||
if (
|
||||
this.formModel.type === "HEAD" &&
|
||||
this.popClass === "xian-01__systerm" &&
|
||||
(trip < 701 || trip > 749)
|
||||
) {
|
||||
callback(new Error("头码车车次编号为701至749"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
groupNumber: [{ required: true, message: "请选择车组号", trigger: "change" }],
|
||||
type: [{ required: true, message: "请选择列车类型", trigger: "change" }],
|
||||
tripNumber: [
|
||||
{
|
||||
required: !(this.formModel.type === "HEAD" && this.popClass === "xian-01__systerm"),
|
||||
message: "请输入车次号",
|
||||
trigger: "blur"
|
||||
},
|
||||
{ validator: validateTripNum, trigger: "blur" }
|
||||
],
|
||||
destinationCode: [{ required: true, message: "请输入目的地号", trigger: "blur" }]
|
||||
};
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
if (this.popClass === 'foshan-01__systerm' && this.formModel.type === 'PLAN') {
|
||||
if (this.popClass === "foshan-01__systerm" && this.formModel.type === "PLAN") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
@ -168,7 +199,7 @@ export default {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
@ -183,7 +214,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -195,7 +226,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
@ -207,7 +238,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -219,7 +250,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
@ -231,7 +262,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
@ -243,36 +274,45 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : "";
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return '添加列车识别号';
|
||||
return "添加列车识别号";
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
return "修改列车识别号";
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'formModel.tripNumber': function(val) {
|
||||
if (this.popClass !== 'foshan-01__systerm' && val.length === 4 && this.formModel.type !== 'HEAD') {
|
||||
"formModel.tripNumber": function(val) {
|
||||
if (
|
||||
this.popClass !== "foshan-01__systerm" &&
|
||||
val.length === 4 &&
|
||||
this.formModel.type !== "HEAD"
|
||||
) {
|
||||
this.trainNoChange(val);
|
||||
} else if (this.popClass !== 'foshan-01__systerm' && this.formModel.type !== 'HEAD') {
|
||||
} else if (this.popClass !== "foshan-01__systerm" && this.formModel.type !== "HEAD") {
|
||||
this.formModel = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
tripNumber: val,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
serviceNumber: "",
|
||||
targetCode: "",
|
||||
category: "MM"
|
||||
};
|
||||
} else if (this.popClass === 'foshan-01__systerm' && val.length === 2 && this.formModel.serviceNumber.length === 3 && this.formModel.type !== 'HEAD') {
|
||||
} else if (
|
||||
this.popClass === "foshan-01__systerm" &&
|
||||
val.length === 2 &&
|
||||
this.formModel.serviceNumber.length === 3 &&
|
||||
this.formModel.type !== "HEAD"
|
||||
) {
|
||||
this.trainNoChange(val, this.formModel.serviceNumber);
|
||||
} else if (this.popClass === 'foshan-01__systerm' && this.formModel.type !== 'HEAD') {
|
||||
} else if (this.popClass === "foshan-01__systerm" && this.formModel.type !== "HEAD") {
|
||||
const serviceNumber = this.formModel.serviceNumber;
|
||||
const destinationCode = this.formModel.destinationCode;
|
||||
this.formModel = {
|
||||
@ -281,15 +321,19 @@ export default {
|
||||
tripNumber: val,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: serviceNumber,
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
targetCode: "",
|
||||
category: "MM"
|
||||
};
|
||||
}
|
||||
},
|
||||
'formModel.serviceNumber': function(val) {
|
||||
if (this.popClass === 'foshan-01__systerm' && val.length === 3 && this.formModel.tripNumber.length === 2) {
|
||||
"formModel.serviceNumber": function(val) {
|
||||
if (
|
||||
this.popClass === "foshan-01__systerm" &&
|
||||
val.length === 3 &&
|
||||
this.formModel.tripNumber.length === 2
|
||||
) {
|
||||
this.trainNoChange(this.formModel.tripNumber, val);
|
||||
} else if (this.popClass === 'foshan-01__systerm') {
|
||||
} else if (this.popClass === "foshan-01__systerm") {
|
||||
const tripNumber = this.formModel.tripNumber;
|
||||
const destinationCode = this.formModel.destinationCode;
|
||||
this.formModel = {
|
||||
@ -298,8 +342,8 @@ export default {
|
||||
destinationCode: destinationCode,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: val,
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
targetCode: "",
|
||||
category: "MM"
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -307,40 +351,40 @@ export default {
|
||||
methods: {
|
||||
loadInitData(map) {},
|
||||
doShow(operate, selected) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.$root.$emit("dialogOpen", selected);
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
const model = this.$store.getters["map/getDeviceByCode"](selected.code);
|
||||
this.serviceNumber = model.serviceNumber;
|
||||
this.formModel = {
|
||||
groupNumber: model.groupNumber,
|
||||
tripNumber: model.tripNumber,
|
||||
type: model.type ? model.type : 'PLAN',
|
||||
type: model.type ? model.type : "PLAN",
|
||||
serviceNumber: model.serviceNumber,
|
||||
destinationCode: model.destinationCode,
|
||||
category: 'MM'
|
||||
category: "MM"
|
||||
};
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$root.$emit("dialogClose", this.selected);
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
this.$store.dispatch("map/setTrainWindowShow", false);
|
||||
},
|
||||
trainNumberChange(groupNumber) {
|
||||
const operate = {
|
||||
groupNumber: groupNumber,
|
||||
operation: ''
|
||||
operation: ""
|
||||
};
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
@ -348,37 +392,37 @@ export default {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch("training/nextNew", operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
if (trainType === 'HEAD') {
|
||||
this.formModel.serviceNumber = '';
|
||||
} else if (trainType === 'PLAN' && this.serviceNumber) {
|
||||
if (trainType === "HEAD") {
|
||||
this.formModel.serviceNumber = "";
|
||||
} else if (trainType === "PLAN" && this.serviceNumber) {
|
||||
this.formModel.serviceNumber = this.serviceNumber;
|
||||
}
|
||||
const operate = {
|
||||
type: trainType,
|
||||
operation: ''
|
||||
operation: ""
|
||||
};
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch("training/nextNew", operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainNoChange(tripNumber, serviceNumber) {
|
||||
const operate = {
|
||||
tripNumber: tripNumber,
|
||||
operation: ''
|
||||
operation: ""
|
||||
};
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
@ -387,30 +431,35 @@ export default {
|
||||
}
|
||||
Handler.undo(1);
|
||||
try {
|
||||
if (this.popClass === 'foshan-01__systerm') {
|
||||
getTrainDetailByStNumber(this.$route.query.group, {tripNumber: tripNumber, serviceNumber: serviceNumber}).then(resp => {
|
||||
if (this.popClass === "foshan-01__systerm") {
|
||||
getTrainDetailByStNumber(this.$route.query.group, {
|
||||
tripNumber: tripNumber,
|
||||
serviceNumber: serviceNumber
|
||||
}).then(resp => {
|
||||
if (resp.data) {
|
||||
this.formModel.destinationCode = resp.data.destinationCode;
|
||||
} else {
|
||||
this.$message.error('未找到输入列车信息!');
|
||||
this.$message.error("未找到输入列车信息!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getTrainDetailBytripNumber(this.$route.query.group, {tripNumber:tripNumber}).then(resp => {
|
||||
getTrainDetailBytripNumber(this.$route.query.group, {
|
||||
tripNumber: tripNumber
|
||||
}).then(resp => {
|
||||
if (resp.data) {
|
||||
this.formModel.serviceNumber = resp.data.serviceNumber;
|
||||
this.formModel.destinationCode = resp.data.destinationCode;
|
||||
} else {
|
||||
this.$message.error('未找到输入列车信息!');
|
||||
this.$message.error("未找到输入列车信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.$message.error('获取列车信息失败!');
|
||||
this.$message.error("获取列车信息失败!");
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch("training/nextNew", operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -425,33 +474,35 @@ export default {
|
||||
},
|
||||
// 增加列车识别号
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
destinationCode: ''
|
||||
serviceNumber: "",
|
||||
tripNumber: "",
|
||||
destinationCode: ""
|
||||
};
|
||||
if (this.formModel.type === 'PLAN') {
|
||||
if (this.formModel.type === "PLAN") {
|
||||
params.serviceNumber = this.formModel.serviceNumber;
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
} else if (this.formModel.type === 'HEAD') {
|
||||
} else if (this.formModel.type === "HEAD") {
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
}
|
||||
commitOperate(menuOperate.TrainWindow.addTrainId, params, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
commitOperate(menuOperate.TrainWindow.addTrainId, params, 2)
|
||||
.then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -459,33 +510,35 @@ export default {
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
destinationCode: ''
|
||||
serviceNumber: "",
|
||||
tripNumber: "",
|
||||
destinationCode: ""
|
||||
};
|
||||
if (this.formModel.type === 'PLAN') {
|
||||
if (this.formModel.type === "PLAN") {
|
||||
params.serviceNumber = this.formModel.serviceNumber;
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
} else if (this.formModel.type === 'HEAD') {
|
||||
} else if (this.formModel.type === "HEAD") {
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
}
|
||||
commitOperate(menuOperate.TrainWindow.editTrainId, params, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
commitOperate(menuOperate.TrainWindow.editTrainId, params, 2)
|
||||
.then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -495,13 +548,16 @@ export default {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store
|
||||
.dispatch("training/nextNew", operate)
|
||||
.then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user