Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Elements-SY
2023-09-18 18:56:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5945cd91cfe87cd678f6933d3d8e759e68b790d0
5945cd91
1 parent
073d936f
modify
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
32 deletions
src/views/basicInformation/flightInformationMaintenance/index.vue
src/views/basicInformation/flightInformationMaintenance/index.vue
View file @
5945cd9
...
...
@@ -133,9 +133,11 @@
</el-row>
<el-row style="margin-bottom:5px">
<el-col :span="12">
<el-form-item
prop="route"
>
<el-form-item>
<template slot="label">
<div style="display:inline-block">航班路线
<div style="display:inline-block">
<span class="error-route">*</span>
航班路线
<el-tooltip class="item" effect="dark" content="输入航班号后获取航线信息。航班种类为Purple Tail时可以进行多选,切换航班种类后需重新选择航线"
placement="top-start">
<span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span>
...
...
@@ -143,17 +145,18 @@
</div>
</template>
<el-select v-if="routeMultiple" ref="routeSelect" class="wid80" v-model="form.route"
:disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange"
:disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange"
@blur="blurRoute"
:loading="routeLoading" :multiple='true' :key="routeMultiple">
<el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route">
</el-option>
</el-select>
<el-select v-if="routeMultiple == false" ref="routeSelect" class="wid80" v-model="form.route"
:disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange"
:disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange"
@blur="blurRoute"
:loading="routeLoading" :multiple='false' :key="routeMultiple">
<el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route">
</el-option>
</el-select>
<span ref="errorRoute" class="el-form-item__error" v-show="routeError">航班路线不能为空</span>
</el-form-item>
<div class="formTips" v-if="title == '修改航班信息'">注意!:移除航线,相对应日期级别航线维度会同时删除</div>
</el-col>
...
...
@@ -322,7 +325,7 @@ export default {
},
//表单参数
form: {
isNeedRequired: 2
isNeedRequired: 2
,
},
routeList: [],
//表单校验
...
...
@@ -352,20 +355,9 @@ export default {
{
required: true,
message: "原始重量(KG)不能为空",
trigger: "blur",
},
],
route: [
{
required: true,
message: "航班路线不能为空",
trigger: "change",
},
// {
// pattern: /^(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)(;{1,1}(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)){0,}$/,
// message: "请输入正确得航班线路"
// }
]
],
},
//原航班规则数据
findAllFltDatList: [],
...
...
@@ -479,6 +471,7 @@ export default {
openFlightDate: false,
//shift键状态
shiftKey: false,
routeError: false, // 请选择航线错误显示
};
},
directives: {
...
...
@@ -643,7 +636,7 @@ export default {
this.routeMultiple = true
this.form.route = []
}
this.
validateFieldForm()
this.
routeError = true
}
})
// this.$refs.routeSelect.$forceUpdate()
...
...
@@ -726,6 +719,7 @@ export default {
this.formdisabled.typeId = false;
//原始重量
this.formdisabled.originalWeight = false;
this.routeError = false;
this.$nextTick(() => {
this.$refs.form.clearValidate()
})
...
...
@@ -942,8 +936,19 @@ export default {
},
/** 提交按钮 */
submitForm: function () {
this.validateFieldForm()
this.$refs["form"].validate((valid) => {
if(this.form.route == undefined){
this.routeError = true;
console.log(this.form.route)
}
if(this.form.route.length || this.form.route !== undefined){
this.routeError = false;
}
if(this.form.route.length == 0 || this.form.route == undefined){
this.routeError = true;
return
}
if (valid) {
let formdata = JSON.parse(JSON.stringify(this.form));
//高价百分比和低价百分比和不可以大于100
...
...
@@ -1131,23 +1136,22 @@ export default {
console.log(err)
})
},
// 对部分表单字段进行校验的方法
validateFieldForm(){
this.$refs.form.validateField(['fltNo', 'fltDate', 'kindId', 'route', 'originalWeight'], (flag) => {
if(this.form.fltNo && this.form.fltDate && this.form.kindId && this.form.route && this.form.route.length && this.form.originalWeight){
if(this.form.route.length){
this.$nextTick(()=>{
this.$refs.form.clearValidate()
})
}
}
})
},
//航线修改
routeChange(val) {
this.validateFieldForm()
if(this.form.route.length){
this.routeError = false;
}else{
this.routeError = true;
}
this.$forceUpdate()
},
blurRoute(){
if(this.form.route.length){
this.routeError = false;
}else{
this.routeError = true;
}
},
//多选框选中数据
tableSelect(val) {
this.ids = val.selection;
...
...
@@ -1204,4 +1208,7 @@ export default {
color: #ff4949;
text-align: right;
}
.error-route{
color: #ff4949;
}
</style>
...
...
Please
register
or
login
to post a comment