大铁项目 行车日志 修改车次号(大铁CTC) 代码调整

This commit is contained in:
joylink_cuiweidong 2022-06-20 11:24:22 +08:00
parent 4f855c3836
commit 5973a3c1ee

View File

@ -4,7 +4,7 @@
class="chengdou-03__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="460px"
width="560px"
:before-close="doClose"
:z-index="2000"
:modal="false"
@ -15,7 +15,7 @@
<div class="modifyTripNumberT">
<div style="display:inline-block;margin-right:10px">请选择车站</div>
<el-select
v-model="model.stationCode"
v-model="stationCode"
placeholder=""
size="mini"
style="width:100px"
@ -34,23 +34,31 @@
<div class="modifyTripNumberTip">原列车信息</div>
<div class="modifyTripNumberS">
<div class="modifyTripNumberName">到达车次</div>
<el-input v-model="oldArriveTripNumber" type="text" class="" size="mini" style="width: 95px;" disabled />
<el-input v-model="oldArriveTripNumber" type="text" class="" size="mini" style="width: 140px;" disabled />
</div>
<div class="modifyTripNumberE">
<div class="modifyTripNumberName">出发车次</div>
<el-input v-model="oldDepartTripNumber" type="text" class="" size="mini" style="width: 95px;" disabled />
<el-input v-model="oldDepartTripNumber" type="text" class="" size="mini" style="width: 140px;" disabled />
</div>
</div>
<div class="modifyTripNumberBR">
<div class="modifyTripNumberTip">新列车信息</div>
<div class="modifyTripNumberS">
<div class="modifyTripNumberName">到达车次</div>
<div>
<el-form ref="form" :model="model" label-width="85px" :rules="rules">
<el-form-item label="到达车次:" prop="arriveTripNumber">
<el-input v-model="model.arriveTripNumber" style="width:140px" />
</el-form-item>
<el-form-item label="出发车次:" prop="departTripNumber">
<el-input v-model="model.departTripNumber" style="width:140px" />
</el-form-item>
</el-form>
<!-- <div class="modifyTripNumberName">到达车次</div>
<el-input v-model="model.arriveTripNumber" type="text" class="" size="mini" style="width: 95px;" />
</div>
<div class="modifyTripNumberE">
<div class="modifyTripNumberName">出发车次</div>
<el-input v-model="model.departTripNumber" type="text" class="" size="mini" style="width: 95px;" />
</div>
</div> -->
</div>
</div>
<el-checkbox-group v-model="trainTypeList" style="text-align:center;margin-top:10px">
@ -66,15 +74,31 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</div></el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
// import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'ModifyTripNumber',
data() {
var validateTripNumber = (rule, value, callback) => {
if (value) {
const judge = /^[a-zA-Z0-9]*[\d]$/.test(value);
if (judge) {
if (value.toString().length > 6 || value.toString().length < 2) {
callback('车次长度2-6位');
} else {
callback();
}
} else {
callback('字母+数字,最后一位数字');
}
} else {
callback('请输入车次');
}
};
return {
dialogShow: false,
loading: false,
@ -82,11 +106,20 @@ export default {
oldDepartTripNumber:'',
trainTypeList:[],
stationList:[],
model:{
stationCode:'', //
runPlanCode:'', //
model:{
arriveTripNumber:'', //
departTripNumber:'' //
},
rules: {
arriveTripNumber:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
// message: ''
],
departTripNumber:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
]
}
};
},
@ -109,8 +142,8 @@ export default {
},
methods: {
doShow(row) {
this.model.stationCode = row.stationCode;
this.model.runPlanCode = row.code;
this.stationCode = row.stationCode;
this.runPlanCode = row.code;
this.oldArriveTripNumber = (row.arriveRunPlan && row.arriveRunPlan.tripNumber) || '';
this.oldDepartTripNumber = (row.departRunPlan && row.departRunPlan.tripNumber) || '';
this.dialogShow = true;
@ -122,8 +155,6 @@ export default {
this.loading = false;
this.dialogShow = false;
this.model = {
stationCode:'', //
runPlanCode:'', //
arriveTripNumber:'', //
departTripNumber:'' //
};
@ -131,7 +162,8 @@ export default {
},
commit() {
this.loading = true;
commitOperate(menuOperate.CTC.modifyTripNumber, this.model, 2).then(({valid})=>{
const params = Object.assign({stationCode:this.stationCode, runPlanCode:this.runPlanCode}, this.model);
commitOperate(menuOperate.CTC.modifyTripNumber, params, 2).then(({valid})=>{
this.loading = false;
this.$emit('clearRpRow');
if (valid) {
@ -176,9 +208,9 @@ export default {
background: #ece9d8;
padding: 0px 5px;
}
.modifyTripNumberS{}
.modifyTripNumberName{display: inline-block;}
.modifyTripNumberE{margin-top:10px;}
.modifyTripNumberS{margin-bottom:20px;height: 24px;font-size:0;}
.modifyTripNumberName{display: inline-block;width:85px;text-align: right;font-size: 15px;}
.modifyTripNumberE{margin-bottom: 20px;height: 24px;font-size:0;}
</style>
<style lang="scss">
.chengdou-03__systerm .el-dialog .modifyTripNumber .el-checkbox-group .el-checkbox .el-checkbox__label{font-size: 15px !important;line-height: 16px;}
@ -186,4 +218,7 @@ export default {
.stationSelect{
z-index:2014 !important;
}
.modifyTripNumberBR .el-form-item .el-form-item__label{font-size:15px;padding-right:0px;line-height:24px;vertical-align:top;}
.modifyTripNumberBR .el-form-item{margin-bottom:20px;}
.modifyTripNumberBR .el-form-item .el-form-item__content{line-height:24px;vertical-align: top;height:24px;}
</style>