佛山修改列车识别好调整

This commit is contained in:
fan 2020-09-04 17:57:37 +08:00
parent dc085df977
commit 5af9956f5b

View File

@ -37,20 +37,13 @@
:disabled="serverNoIsDisabled"
/>
</el-form-item>
<el-form-item v-if="formModel.type == 'PLAN'&&popClass !== 'foshan-01__systerm'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
<el-form-item v-if="formModel.type == 'PLAN'" :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'&&popClass === 'foshan-01__systerm'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
<el-input
:id="domIdTrainNo"
v-model="formModel.stNumber"
maxlength="5"
/>
</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"
@ -115,7 +108,6 @@ export default {
tripNumber: '',
groupNumber: '',
type: 'PLAN',
stNumber: '',
serviceNumber: '',
destinationCode: '',
category: 'MM'
@ -127,9 +119,6 @@ export default {
groupNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' }
],
stNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
type: [
{ required: true, message: '请选择列车类型', trigger: 'change' }
],
@ -151,7 +140,11 @@ export default {
'map'
]),
serverNoIsDisabled() {
return true;
if (this.popClass === 'foshan-01__systerm' && this.formModel.type === 'PLAN') {
return false;
} else {
return true;
}
},
trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
@ -257,21 +250,36 @@ export default {
type: this.formModel.type,
serviceNumber: '',
targetCode: '',
stNumber: '',
category: 'MM'
};
} else if (this.popClass === 'foshan-01__systerm' && val.length === 2 && this.formModel.serviceNumber.length === 3) {
this.trainNoChange(val, this.formModel.serviceNumber);
} else if (this.popClass === 'foshan-01__systerm') {
const serviceNumber = this.formModel.serviceNumber;
const destinationCode = this.formModel.destinationCode;
this.formModel = {
groupNumber: this.formModel.groupNumber,
destinationCode: destinationCode,
tripNumber: val,
type: this.formModel.type,
serviceNumber: serviceNumber,
targetCode: '',
category: 'MM'
};
}
},
'formModel.stNumber': function(val) {
if (this.popClass === 'foshan-01__systerm' && val.length === 5) {
this.trainNoChange(val);
'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') {
const tripNumber = this.formModel.tripNumber;
const destinationCode = this.formModel.destinationCode;
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: '',
tripNumber: tripNumber,
destinationCode: destinationCode,
type: this.formModel.type,
stNumber: val,
serviceNumber: '',
serviceNumber: val,
targetCode: '',
category: 'MM'
};
@ -298,7 +306,6 @@ export default {
type: model.type ? model.type : 'PLAN',
serviceNumber: model.serviceNumber,
destinationCode: model.destinationCode,
stNumber: model.serviceNumber + '' + model.tripNumber,
category: 'MM'
};
/** 加载列车数据*/
@ -352,7 +359,7 @@ export default {
}
});
},
trainNoChange(tripNumber) {
trainNoChange(tripNumber, serviceNumber) {
const operate = {
tripNumber: tripNumber,
operation: ''
@ -365,10 +372,8 @@ export default {
Handler.undo(1);
try {
if (this.popClass === 'foshan-01__systerm') {
getTrainDetailByStNumber(this.$route.query.group, {stNumber: tripNumber}).then(resp => {
getTrainDetailByStNumber(this.$route.query.group, {tripNumber: tripNumber, serviceNumber: serviceNumber}).then(resp => {
if (resp.data) {
this.formModel.serviceNumber = resp.data.serviceNumber;
this.formModel.tripNumber = resp.data.tripNumber;
this.formModel.destinationCode = resp.data.destinationCode;
}
});
@ -381,7 +386,6 @@ export default {
});
}
} catch (e) {
console.log(e);
this.$message.error('获取列车信息失败!');
}