Showing
5 changed files
with
68 additions
and
38 deletions
| ... | @@ -307,7 +307,7 @@ | ... | @@ -307,7 +307,7 @@ |
| 307 | <el-card v-else shadow="always" v-for="( val, idx ) in infoForm.list " :key="idx" style="min-height:350px"> | 307 | <el-card v-else shadow="always" v-for="( val, idx ) in infoForm.list " :key="idx" style="min-height:350px"> |
| 308 | <div> | 308 | <div> |
| 309 | <el-empty description="未设置规则!" v-if="!val.isLocation"> | 309 | <el-empty description="未设置规则!" v-if="!val.isLocation"> |
| 310 | - <el-button type="primary" size="small" @click="newRoute(idx, routeList[idx].route)">新增规则 | 310 | + <el-button type="primary" size="small" @click="newRoute(idx, infoForm.route)">新增规则 |
| 311 | </el-button> | 311 | </el-button> |
| 312 | </el-empty> | 312 | </el-empty> |
| 313 | <el-row class="rowPadding" v-else> | 313 | <el-row class="rowPadding" v-else> |
| ... | @@ -708,6 +708,10 @@ export default { | ... | @@ -708,6 +708,10 @@ export default { |
| 708 | this.msgWarning('未查询到航线信息!') | 708 | this.msgWarning('未查询到航线信息!') |
| 709 | } else { | 709 | } else { |
| 710 | this.routeList = res.data.routeList | 710 | this.routeList = res.data.routeList |
| 711 | + let routes = [] | ||
| 712 | + this.routeList.forEach(item => { | ||
| 713 | + routes.push(item.route) | ||
| 714 | + }) | ||
| 711 | if (res.data.list.length > 0) { | 715 | if (res.data.list.length > 0) { |
| 712 | //请求到数据 | 716 | //请求到数据 |
| 713 | if (this.infoForm.route != null && this.infoForm.route != '' && this.infoForm.route != ' ') { | 717 | if (this.infoForm.route != null && this.infoForm.route != '' && this.infoForm.route != ' ') { |
| ... | @@ -728,6 +732,11 @@ export default { | ... | @@ -728,6 +732,11 @@ export default { |
| 728 | status: this.$route.params.status | 732 | status: this.$route.params.status |
| 729 | } | 733 | } |
| 730 | findDestinationFltRuleByFlightNo(params).then(response => { | 734 | findDestinationFltRuleByFlightNo(params).then(response => { |
| 735 | + response.data.routeList.forEach(item => { | ||
| 736 | + if (!routes.includes(item.route)) { | ||
| 737 | + this.routeList.push(item) | ||
| 738 | + } | ||
| 739 | + }) | ||
| 731 | let infoRouteList = [] | 740 | let infoRouteList = [] |
| 732 | response.data.list.forEach(item => { | 741 | response.data.list.forEach(item => { |
| 733 | //航线对应插入数据 | 742 | //航线对应插入数据 |
| ... | @@ -815,6 +824,11 @@ export default { | ... | @@ -815,6 +824,11 @@ export default { |
| 815 | flightRouteListStr: this.$route.params.route, | 824 | flightRouteListStr: this.$route.params.route, |
| 816 | status: this.$route.params.status | 825 | status: this.$route.params.status |
| 817 | }).then(resData => { | 826 | }).then(resData => { |
| 827 | + resData.data.routeList.forEach(item => { | ||
| 828 | + if (!routes.includes(item.route)) { | ||
| 829 | + this.routeList.push(item) | ||
| 830 | + } | ||
| 831 | + }) | ||
| 818 | if (resData.data.list.length > 0) { | 832 | if (resData.data.list.length > 0) { |
| 819 | this.routeList.forEach((route, sub) => { | 833 | this.routeList.forEach((route, sub) => { |
| 820 | if (!infoRouteList.includes(route.route)) { | 834 | if (!infoRouteList.includes(route.route)) { |
| ... | @@ -927,6 +941,11 @@ export default { | ... | @@ -927,6 +941,11 @@ export default { |
| 927 | status: this.$route.params.status | 941 | status: this.$route.params.status |
| 928 | } | 942 | } |
| 929 | findDestinationFltRuleByFlightNo(params).then(response => { | 943 | findDestinationFltRuleByFlightNo(params).then(response => { |
| 944 | + response.data.routeList.forEach(item => { | ||
| 945 | + if (!routes.includes(item.route)) { | ||
| 946 | + this.routeList.push(item) | ||
| 947 | + } | ||
| 948 | + }) | ||
| 930 | if (response.data.list.length > 0) { | 949 | if (response.data.list.length > 0) { |
| 931 | let infoRouteList = [] | 950 | let infoRouteList = [] |
| 932 | res.data.list.forEach(item => { | 951 | res.data.list.forEach(item => { | ... | ... |
| ... | @@ -133,9 +133,11 @@ | ... | @@ -133,9 +133,11 @@ |
| 133 | </el-row> | 133 | </el-row> |
| 134 | <el-row style="margin-bottom:5px"> | 134 | <el-row style="margin-bottom:5px"> |
| 135 | <el-col :span="12"> | 135 | <el-col :span="12"> |
| 136 | - <el-form-item prop="route"> | 136 | + <el-form-item> |
| 137 | <template slot="label"> | 137 | <template slot="label"> |
| 138 | - <div style="display:inline-block">航班路线 | 138 | + <div style="display:inline-block"> |
| 139 | + <span class="error-route">*</span> | ||
| 140 | + 航班路线 | ||
| 139 | <el-tooltip class="item" effect="dark" content="输入航班号后获取航线信息。航班种类为Purple Tail时可以进行多选,切换航班种类后需重新选择航线" | 141 | <el-tooltip class="item" effect="dark" content="输入航班号后获取航线信息。航班种类为Purple Tail时可以进行多选,切换航班种类后需重新选择航线" |
| 140 | placement="top-start"> | 142 | placement="top-start"> |
| 141 | <span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span> | 143 | <span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span> |
| ... | @@ -143,17 +145,18 @@ | ... | @@ -143,17 +145,18 @@ |
| 143 | </div> | 145 | </div> |
| 144 | </template> | 146 | </template> |
| 145 | <el-select v-if="routeMultiple" ref="routeSelect" class="wid80" v-model="form.route" | 147 | <el-select v-if="routeMultiple" ref="routeSelect" class="wid80" v-model="form.route" |
| 146 | - :disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" | 148 | + :disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" @blur="blurRoute" |
| 147 | :loading="routeLoading" :multiple='true' :key="routeMultiple"> | 149 | :loading="routeLoading" :multiple='true' :key="routeMultiple"> |
| 148 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> | 150 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> |
| 149 | </el-option> | 151 | </el-option> |
| 150 | </el-select> | 152 | </el-select> |
| 151 | <el-select v-if="routeMultiple == false" ref="routeSelect" class="wid80" v-model="form.route" | 153 | <el-select v-if="routeMultiple == false" ref="routeSelect" class="wid80" v-model="form.route" |
| 152 | - :disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" | 154 | + :disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" @blur="blurRoute" |
| 153 | :loading="routeLoading" :multiple='false' :key="routeMultiple"> | 155 | :loading="routeLoading" :multiple='false' :key="routeMultiple"> |
| 154 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> | 156 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> |
| 155 | </el-option> | 157 | </el-option> |
| 156 | </el-select> | 158 | </el-select> |
| 159 | + <span ref="errorRoute" class="el-form-item__error" v-show="routeError">航班路线不能为空</span> | ||
| 157 | </el-form-item> | 160 | </el-form-item> |
| 158 | <div class="formTips" v-if="title == '修改航班信息'">注意!:移除航线,相对应日期级别航线维度会同时删除</div> | 161 | <div class="formTips" v-if="title == '修改航班信息'">注意!:移除航线,相对应日期级别航线维度会同时删除</div> |
| 159 | </el-col> | 162 | </el-col> |
| ... | @@ -322,7 +325,7 @@ export default { | ... | @@ -322,7 +325,7 @@ export default { |
| 322 | }, | 325 | }, |
| 323 | //表单参数 | 326 | //表单参数 |
| 324 | form: { | 327 | form: { |
| 325 | - isNeedRequired: 2 | 328 | + isNeedRequired: 2, |
| 326 | }, | 329 | }, |
| 327 | routeList: [], | 330 | routeList: [], |
| 328 | //表单校验 | 331 | //表单校验 |
| ... | @@ -352,20 +355,9 @@ export default { | ... | @@ -352,20 +355,9 @@ export default { |
| 352 | { | 355 | { |
| 353 | required: true, | 356 | required: true, |
| 354 | message: "原始重量(KG)不能为空", | 357 | message: "原始重量(KG)不能为空", |
| 355 | - trigger: "blur", | ||
| 356 | - }, | ||
| 357 | - ], | ||
| 358 | - route: [ | ||
| 359 | - { | ||
| 360 | - required: true, | ||
| 361 | - message: "航班路线不能为空", | ||
| 362 | trigger: "change", | 358 | trigger: "change", |
| 363 | }, | 359 | }, |
| 364 | - // { | 360 | + ], |
| 365 | - // pattern: /^(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)(;{1,1}(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)){0,}$/, | ||
| 366 | - // message: "请输入正确得航班线路" | ||
| 367 | - // } | ||
| 368 | - ] | ||
| 369 | }, | 361 | }, |
| 370 | //原航班规则数据 | 362 | //原航班规则数据 |
| 371 | findAllFltDatList: [], | 363 | findAllFltDatList: [], |
| ... | @@ -479,6 +471,7 @@ export default { | ... | @@ -479,6 +471,7 @@ export default { |
| 479 | openFlightDate: false, | 471 | openFlightDate: false, |
| 480 | //shift键状态 | 472 | //shift键状态 |
| 481 | shiftKey: false, | 473 | shiftKey: false, |
| 474 | + routeError: false, // 请选择航线错误显示 | ||
| 482 | }; | 475 | }; |
| 483 | }, | 476 | }, |
| 484 | directives: { | 477 | directives: { |
| ... | @@ -643,7 +636,7 @@ export default { | ... | @@ -643,7 +636,7 @@ export default { |
| 643 | this.routeMultiple = true | 636 | this.routeMultiple = true |
| 644 | this.form.route = [] | 637 | this.form.route = [] |
| 645 | } | 638 | } |
| 646 | - this.validateFieldForm() | 639 | + this.routeError = true |
| 647 | } | 640 | } |
| 648 | }) | 641 | }) |
| 649 | // this.$refs.routeSelect.$forceUpdate() | 642 | // this.$refs.routeSelect.$forceUpdate() |
| ... | @@ -726,6 +719,7 @@ export default { | ... | @@ -726,6 +719,7 @@ export default { |
| 726 | this.formdisabled.typeId = false; | 719 | this.formdisabled.typeId = false; |
| 727 | //原始重量 | 720 | //原始重量 |
| 728 | this.formdisabled.originalWeight = false; | 721 | this.formdisabled.originalWeight = false; |
| 722 | + this.routeError = false; | ||
| 729 | this.$nextTick(() => { | 723 | this.$nextTick(() => { |
| 730 | this.$refs.form.clearValidate() | 724 | this.$refs.form.clearValidate() |
| 731 | }) | 725 | }) |
| ... | @@ -942,8 +936,19 @@ export default { | ... | @@ -942,8 +936,19 @@ export default { |
| 942 | }, | 936 | }, |
| 943 | /** 提交按钮 */ | 937 | /** 提交按钮 */ |
| 944 | submitForm: function () { | 938 | submitForm: function () { |
| 945 | - this.validateFieldForm() | ||
| 946 | this.$refs["form"].validate((valid) => { | 939 | this.$refs["form"].validate((valid) => { |
| 940 | + if(this.form.route == undefined){ | ||
| 941 | + this.routeError = true; | ||
| 942 | + console.log(this.form.route) | ||
| 943 | + } | ||
| 944 | + if(this.form.route.length || this.form.route !== undefined){ | ||
| 945 | + this.routeError = false; | ||
| 946 | + } | ||
| 947 | + | ||
| 948 | + if(this.form.route.length == 0 || this.form.route == undefined){ | ||
| 949 | + this.routeError = true; | ||
| 950 | + return | ||
| 951 | + } | ||
| 947 | if (valid) { | 952 | if (valid) { |
| 948 | let formdata = JSON.parse(JSON.stringify(this.form)); | 953 | let formdata = JSON.parse(JSON.stringify(this.form)); |
| 949 | //高价百分比和低价百分比和不可以大于100 | 954 | //高价百分比和低价百分比和不可以大于100 |
| ... | @@ -1131,25 +1136,22 @@ export default { | ... | @@ -1131,25 +1136,22 @@ export default { |
| 1131 | console.log(err) | 1136 | console.log(err) |
| 1132 | }) | 1137 | }) |
| 1133 | }, | 1138 | }, |
| 1134 | - // 对部分表单字段进行校验的方法 | ||
| 1135 | - validateFieldForm(){ | ||
| 1136 | - this.$refs.form.validateField(['route'], (flag) => {}) | ||
| 1137 | - if(this.form.route.length){ | ||
| 1138 | - this.$nextTick(()=>{ | ||
| 1139 | - this.$refs.form.clearValidate() | ||
| 1140 | - }) | ||
| 1141 | - } | ||
| 1142 | - }, | ||
| 1143 | //航线修改 | 1139 | //航线修改 |
| 1144 | routeChange(val) { | 1140 | routeChange(val) { |
| 1145 | - this.validateFieldForm() | 1141 | + if(this.form.route.length){ |
| 1146 | - if(val.length){ | 1142 | + this.routeError = false; |
| 1147 | - this.$nextTick(()=>{ | 1143 | + }else{ |
| 1148 | - this.$refs.form.clearValidate() | 1144 | + this.routeError = true; |
| 1149 | - }) | ||
| 1150 | } | 1145 | } |
| 1151 | this.$forceUpdate() | 1146 | this.$forceUpdate() |
| 1152 | }, | 1147 | }, |
| 1148 | + blurRoute(){ | ||
| 1149 | + if(this.form.route.length){ | ||
| 1150 | + this.routeError = false; | ||
| 1151 | + }else{ | ||
| 1152 | + this.routeError = true; | ||
| 1153 | + } | ||
| 1154 | + }, | ||
| 1153 | //多选框选中数据 | 1155 | //多选框选中数据 |
| 1154 | tableSelect(val) { | 1156 | tableSelect(val) { |
| 1155 | this.ids = val.selection; | 1157 | this.ids = val.selection; |
| ... | @@ -1206,4 +1208,7 @@ export default { | ... | @@ -1206,4 +1208,7 @@ export default { |
| 1206 | color: #ff4949; | 1208 | color: #ff4949; |
| 1207 | text-align: right; | 1209 | text-align: right; |
| 1208 | } | 1210 | } |
| 1211 | +.error-route{ | ||
| 1212 | + color: #ff4949; | ||
| 1213 | +} | ||
| 1209 | </style> | 1214 | </style> | ... | ... |
| ... | @@ -181,7 +181,7 @@ | ... | @@ -181,7 +181,7 @@ |
| 181 | v-hasPermi="['log:cargo:flightTransfer']">航班迁转</el-button> | 181 | v-hasPermi="['log:cargo:flightTransfer']">航班迁转</el-button> |
| 182 | <el-button type="primary" size="small" :disabled="cargoPlaneTime == null || cargoPlaneTime.length <= 0" | 182 | <el-button type="primary" size="small" :disabled="cargoPlaneTime == null || cargoPlaneTime.length <= 0" |
| 183 | @click="historyFlie" v-hasPermi="['log:cargo:archiveData']"> | 183 | @click="historyFlie" v-hasPermi="['log:cargo:archiveData']"> |
| 184 | - <el-tooltip class="item" effect="dark" content="请先选择配置航班日期" placement="top"> | 184 | + <el-tooltip class="item" effect="dark" content="请先选择配舱航班日期" placement="top"> |
| 185 | <span class="el-icon-warning-outline">生成归档数据</span> | 185 | <span class="el-icon-warning-outline">生成归档数据</span> |
| 186 | </el-tooltip> | 186 | </el-tooltip> |
| 187 | </el-button> | 187 | </el-button> |
| ... | @@ -367,7 +367,10 @@ export default { | ... | @@ -367,7 +367,10 @@ export default { |
| 367 | } else { | 367 | } else { |
| 368 | this.tableHeader = this.tableHeaders['cargo'] | 368 | this.tableHeader = this.tableHeaders['cargo'] |
| 369 | } | 369 | } |
| 370 | + if(this.$route.params.hasOwnProperty('hander') == false){ | ||
| 370 | this.select(0,'create') | 371 | this.select(0,'create') |
| 372 | + } | ||
| 373 | + | ||
| 371 | // this.$nextTick(()=>{ | 374 | // this.$nextTick(()=>{ |
| 372 | // let height = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 50; | 375 | // let height = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 50; |
| 373 | // if(height < 300){ | 376 | // if(height < 300){ | ... | ... |
| ... | @@ -43,7 +43,7 @@ | ... | @@ -43,7 +43,7 @@ |
| 43 | </el-form> | 43 | </el-form> |
| 44 | <el-row class="card2"> | 44 | <el-row class="card2"> |
| 45 | <el-col :span="1" v-for="item in fltBox" :key="item.fltNo"> | 45 | <el-col :span="1" v-for="item in fltBox" :key="item.fltNo"> |
| 46 | - <div class="fltBox" @click="rowClick({ fltNo: item.fltNo, fltDate: item.fltDate, route: '' })" | 46 | + <div class="fltBox" @click="rowClick({ fltNo: item.fltNo, fltDate: item.fltDate ? item.fltDate : selectData.fltDate, route: '' })" |
| 47 | :style="{ backgroundColor: (item.percentage * 100).toFixed(2) >= 90 ? '#13ce66' : (item.percentage * 100).toFixed(2) >= 75 ? '#ffba00' : '#ff4949' }"> | 47 | :style="{ backgroundColor: (item.percentage * 100).toFixed(2) >= 90 ? '#13ce66' : (item.percentage * 100).toFixed(2) >= 75 ? '#ffba00' : '#ff4949' }"> |
| 48 | <div class="fltName">{{ item.fltNo }}</div> | 48 | <div class="fltName">{{ item.fltNo }}</div> |
| 49 | <div class="fltWeight">{{ (item.percentage == 0 ? 0 : ((item.percentage) * 100).toFixed(2)) + '%' }} | 49 | <div class="fltWeight">{{ (item.percentage == 0 ? 0 : ((item.percentage) * 100).toFixed(2)) + '%' }} |
| ... | @@ -173,6 +173,7 @@ export default { | ... | @@ -173,6 +173,7 @@ export default { |
| 173 | let obj = {} | 173 | let obj = {} |
| 174 | obj.fltNo = val.fltNo | 174 | obj.fltNo = val.fltNo |
| 175 | obj.fltDate = val.fltDate | 175 | obj.fltDate = val.fltDate |
| 176 | + obj.hander = 'handle' | ||
| 176 | if (val.flightKindName == 'Purple Tail') { | 177 | if (val.flightKindName == 'Purple Tail') { |
| 177 | obj.route = '' | 178 | obj.route = '' |
| 178 | } else { | 179 | } else { | ... | ... |
| ... | @@ -147,7 +147,7 @@ export default { | ... | @@ -147,7 +147,7 @@ export default { |
| 147 | watch: { | 147 | watch: { |
| 148 | open(val, oldVal) { | 148 | open(val, oldVal) { |
| 149 | if (val) { | 149 | if (val) { |
| 150 | - this.newDictionary = { flightNo: undefined, chineseName: undefined } | 150 | + this.newDictionary = { flightNo: undefined, chineseName: undefined, isEtesRoute: false } |
| 151 | if (this.status == 'add') { | 151 | if (this.status == 'add') { |
| 152 | this.title = '新增' | 152 | this.title = '新增' |
| 153 | } else if (this.status == 'allAdd') { | 153 | } else if (this.status == 'allAdd') { |
| ... | @@ -205,6 +205,7 @@ export default { | ... | @@ -205,6 +205,7 @@ export default { |
| 205 | } | 205 | } |
| 206 | addRoute(obj).then(res => { | 206 | addRoute(obj).then(res => { |
| 207 | this.loading = false | 207 | this.loading = false |
| 208 | + this.newDictionary.isEtesRoute = false | ||
| 208 | if (res.code === 200) { | 209 | if (res.code === 200) { |
| 209 | this.msgSuccess(res.msg) | 210 | this.msgSuccess(res.msg) |
| 210 | this.close() | 211 | this.close() |
| ... | @@ -213,6 +214,7 @@ export default { | ... | @@ -213,6 +214,7 @@ export default { |
| 213 | } | 214 | } |
| 214 | }).catch(err => { | 215 | }).catch(err => { |
| 215 | this.loading = false | 216 | this.loading = false |
| 217 | + this.newDictionary.isEtesRoute = false | ||
| 216 | console.log(err) | 218 | console.log(err) |
| 217 | }) | 219 | }) |
| 218 | } else { | 220 | } else { |
| ... | @@ -325,7 +327,7 @@ export default { | ... | @@ -325,7 +327,7 @@ export default { |
| 325 | }, | 327 | }, |
| 326 | //关闭 | 328 | //关闭 |
| 327 | close() { | 329 | close() { |
| 328 | - this.newDictionary = { chineseName: null, code: null, remark: null } | 330 | + this.newDictionary = { chineseName: null, code: null, remark: null, isEtesRoute: false } |
| 329 | this.routeList = [] | 331 | this.routeList = [] |
| 330 | this.clearValidate('add') | 332 | this.clearValidate('add') |
| 331 | this.$emit('close', false) | 333 | this.$emit('close', false) | ... | ... |
-
Please register or login to post a comment