Showing
5 changed files
with
184 additions
and
107 deletions
| ... | @@ -147,6 +147,7 @@ export default { | ... | @@ -147,6 +147,7 @@ export default { |
| 147 | }, | 147 | }, |
| 148 | closeSelectedTag(view) { | 148 | closeSelectedTag(view) { |
| 149 | this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { | 149 | this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { |
| 150 | + console.log(view) | ||
| 150 | if (this.isActive(view)) { | 151 | if (this.isActive(view)) { |
| 151 | this.toLastView(visitedViews, view) | 152 | this.toLastView(visitedViews, view) |
| 152 | } | 153 | } | ... | ... |
| ... | @@ -498,11 +498,10 @@ export default { | ... | @@ -498,11 +498,10 @@ export default { |
| 498 | */ | 498 | */ |
| 499 | if (item.status == "3" || (item.status == "1" && item.ruleDate)) { | 499 | if (item.status == "3" || (item.status == "1" && item.ruleDate)) { |
| 500 | return true; | 500 | return true; |
| 501 | - } else if (item.status == "1" && item.remark) { | 501 | + } else if (item.status == "1" && this.$route.query.querySpecifyData) { |
| 502 | // 航班配舱设置非日期级别情况下 | 502 | // 航班配舱设置非日期级别情况下 |
| 503 | return true; | 503 | return true; |
| 504 | } else if (item.status == "2") { | 504 | } else if (item.status == "2") { |
| 505 | - // 航班配舱设置非日期级别情况下 | ||
| 506 | return true; | 505 | return true; |
| 507 | } else { | 506 | } else { |
| 508 | return false; | 507 | return false; | ... | ... |
| ... | @@ -102,31 +102,112 @@ export default { | ... | @@ -102,31 +102,112 @@ export default { |
| 102 | */ | 102 | */ |
| 103 | created() { | 103 | created() { |
| 104 | this.getAllDictData(); // 获取全部字典 | 104 | this.getAllDictData(); // 获取全部字典 |
| 105 | + let _this = this; | ||
| 105 | // 航班配舱维度规则设置查询条件 | 106 | // 航班配舱维度规则设置查询条件 |
| 106 | let queryCondition = { | 107 | let queryCondition = { |
| 107 | // 航班配舱设置 | 108 | // 航班配舱设置 |
| 108 | flightAllocConfig: { | 109 | flightAllocConfig: { |
| 109 | - queryParmas: () => { | 110 | + querySpecifyData: this.$route.query.querySpecifyData, |
| 111 | + noDateParmas: { | ||
| 112 | + flightDate: "", | ||
| 113 | + flightRoute: "", | ||
| 114 | + purposeOfFlightNo: this.$route.query.purposeOfFlightNo, | ||
| 115 | + status: "", | ||
| 116 | + }, | ||
| 117 | + dateParmas: { | ||
| 118 | + flightDate: this.$route.query.flightDate, | ||
| 119 | + flightRoute: "", | ||
| 120 | + flightRouteListStr: "", | ||
| 121 | + purposeOfFlightNo: this.$route.query.purposeOfFlightNo, | ||
| 122 | + status: "", | ||
| 123 | + }, | ||
| 124 | + queryParmas: function () { | ||
| 110 | // 非日期级别 | 125 | // 非日期级别 |
| 111 | - if (this.$route.query.querySpecifyData == "2") { | 126 | + if (this.querySpecifyData == "2") { |
| 112 | - let noDateParmas = { | 127 | + _this |
| 113 | - flightDate: "", | 128 | + .noDateLevelRoute(this.noDateParmas) |
| 114 | - flightRoute: "", | 129 | + .then(({ routeList, dataList }) => { |
| 115 | - purposeOfFlightNo: this.$route.query.purposeOfFlightNo, | 130 | + const result = routeList.map((item1) => { |
| 116 | - status: "", | 131 | + const item2 = dataList.find((item2) => { |
| 117 | - }; | 132 | + if (item1.route === item2.flightRoute) { |
| 118 | - this.noDateLevelRoute(noDateParmas); | 133 | + item2.config = true; |
| 134 | + return item2; | ||
| 135 | + } | ||
| 136 | + }); | ||
| 137 | + if (item2) { | ||
| 138 | + // 有数据的合并对象, | ||
| 139 | + return { ...item1, ...item2 }; | ||
| 140 | + } else { | ||
| 141 | + item1.config = false; | ||
| 142 | + return item1; // 没有的返回当前的 | ||
| 143 | + } | ||
| 144 | + }); | ||
| 145 | + // 处理属性 | ||
| 146 | + result.map((item) => { | ||
| 147 | + if (item.config) { | ||
| 148 | + _this.hasOwnProperty(item, "typeOfGoods"); | ||
| 149 | + _this.hasOwnProperty(item, "puporpuxCode"); | ||
| 150 | + _this.hasOwnProperty(item, "serviceCode"); | ||
| 151 | + _this.hasOwnProperty(item, "handlingCode"); | ||
| 152 | + _this.hasOwnProperty(item, "subCategory"); | ||
| 153 | + _this.setattrVal(item); // 设置属性值 | ||
| 154 | + } | ||
| 155 | + }); | ||
| 156 | + _this.routesInfo = result; | ||
| 157 | + console.log("非日期级别:", result); | ||
| 158 | + }); | ||
| 119 | } | 159 | } |
| 120 | // 日期级别 | 160 | // 日期级别 |
| 121 | - if (this.$route.query.querySpecifyData == "1") { | 161 | + if (this.querySpecifyData == "1") { |
| 122 | - let dateParmas = { | 162 | + _this.dateLevelRoute(this.dateParmas).then((res) => { |
| 123 | - flightDate: this.$route.query.flightDate, | 163 | + const { configFlag, dateFlightRoute } = res; |
| 124 | - flightRoute: "", | 164 | + if (configFlag == false) { |
| 125 | - flightRouteListStr: "", | 165 | + // 航班航线有规则配置的 |
| 126 | - purposeOfFlightNo: this.$route.query.purposeOfFlightNo, | 166 | + const dateListHas = dateFlightRoute.filter( |
| 127 | - status: "", | 167 | + (item) => item.config == true |
| 128 | - }; | 168 | + ); |
| 129 | - this.dateLevelRoute(dateParmas); | 169 | + // 航班航线没有规则配置的 |
| 170 | + const dateListNo = dateFlightRoute.filter( | ||
| 171 | + (item) => item.config == false | ||
| 172 | + ); | ||
| 173 | + _this | ||
| 174 | + .noDateLevelRoute(this.noDateParmas) | ||
| 175 | + .then(({ dataList }) => { | ||
| 176 | + console.log(dateListNo); | ||
| 177 | + console.log(dataList); | ||
| 178 | + | ||
| 179 | + const result = dateListNo.map((item1) => { | ||
| 180 | + const item2 = dataList.find((item2) => { | ||
| 181 | + if (item1.route === item2.flightRoute) { | ||
| 182 | + item2.config = true; | ||
| 183 | + return item2; | ||
| 184 | + } | ||
| 185 | + }); | ||
| 186 | + if (item2) { | ||
| 187 | + // 有数据的合并对象, | ||
| 188 | + return { ...item1, ...item2 }; | ||
| 189 | + } else { | ||
| 190 | + item1.config = false; | ||
| 191 | + return item1; // 没有的返回当前的 | ||
| 192 | + } | ||
| 193 | + }); | ||
| 194 | + let dateList = dateListHas.concat(result); | ||
| 195 | + // 处理属性 | ||
| 196 | + dateList.map((item) => { | ||
| 197 | + if (item.config) { | ||
| 198 | + _this.hasOwnProperty(item, "typeOfGoods"); | ||
| 199 | + _this.hasOwnProperty(item, "puporpuxCode"); | ||
| 200 | + _this.hasOwnProperty(item, "serviceCode"); | ||
| 201 | + _this.hasOwnProperty(item, "handlingCode"); | ||
| 202 | + _this.hasOwnProperty(item, "subCategory"); | ||
| 203 | + _this.setattrVal(item); // 设置属性值 | ||
| 204 | + } | ||
| 205 | + }); | ||
| 206 | + _this.routesInfo = dateList; | ||
| 207 | + console.log(dateList); | ||
| 208 | + }); | ||
| 209 | + } | ||
| 210 | + }); | ||
| 130 | } | 211 | } |
| 131 | }, | 212 | }, |
| 132 | }, | 213 | }, |
| ... | @@ -178,7 +259,6 @@ export default { | ... | @@ -178,7 +259,6 @@ export default { |
| 178 | }, | 259 | }, |
| 179 | }, | 260 | }, |
| 180 | }; | 261 | }; |
| 181 | - | ||
| 182 | // 航班配舱设置 | 262 | // 航班配舱设置 |
| 183 | queryCondition.flightAllocConfig.queryParmas(); | 263 | queryCondition.flightAllocConfig.queryParmas(); |
| 184 | // 航班信息维护 | 264 | // 航班信息维护 |
| ... | @@ -190,112 +270,68 @@ export default { | ... | @@ -190,112 +270,68 @@ export default { |
| 190 | methods: { | 270 | methods: { |
| 191 | // 普通级别的 | 271 | // 普通级别的 |
| 192 | noDateLevelRoute(parmas) { | 272 | noDateLevelRoute(parmas) { |
| 193 | - findDestinationFltRuleByFlightNo(parmas) | 273 | + return new Promise((resolve, reject) => { |
| 194 | - .then((res) => { | 274 | + findDestinationFltRuleByFlightNo(parmas) |
| 275 | + .then((res) => { | ||
| 276 | + const { code, data, msg } = res; | ||
| 277 | + if (code != 200) { | ||
| 278 | + this.msgError(msg); | ||
| 279 | + return; | ||
| 280 | + } | ||
| 281 | + let routeList = data.routeList; // 航班航线基本信息 | ||
| 282 | + // 普通级别航班航线维度规则详情 | ||
| 283 | + const dataList = removeDuplicates(data.list, { | ||
| 284 | + duplicate: "flightRoute", // 去重字段 | ||
| 285 | + sort: false, // 是否要排序 | ||
| 286 | + sortType: "Number", // 排序类型 | ||
| 287 | + sortAttr: "routePriority", // 排序字段 | ||
| 288 | + }); | ||
| 289 | + resolve({ routeList: routeList, dataList: dataList.unique }); | ||
| 290 | + }) | ||
| 291 | + .catch(() => {}); | ||
| 292 | + }); | ||
| 293 | + }, | ||
| 294 | + // 日期级别的 | ||
| 295 | + dateLevelRoute(parmas) { | ||
| 296 | + return new Promise((resolve, reject) => { | ||
| 297 | + findDestinationFltRuleByFlightNo(parmas).then((res) => { | ||
| 195 | const { code, data, msg } = res; | 298 | const { code, data, msg } = res; |
| 196 | if (code != 200) { | 299 | if (code != 200) { |
| 197 | this.msgError(msg); | 300 | this.msgError(msg); |
| 198 | return; | 301 | return; |
| 199 | } | 302 | } |
| 200 | - let routeList = data.routeList; // 航班航线基本信息 | 303 | + this.routeList = data.routeList; // 航班航线基本信息 |
| 201 | - // 普通级别航班航线维度规则详情 | 304 | + // 日期级别航班航线维度规则详情 |
| 202 | const dataList = removeDuplicates(data.list, { | 305 | const dataList = removeDuplicates(data.list, { |
| 203 | duplicate: "flightRoute", // 去重字段 | 306 | duplicate: "flightRoute", // 去重字段 |
| 204 | sort: false, // 是否要排序 | 307 | sort: false, // 是否要排序 |
| 205 | sortType: "Number", // 排序类型 | 308 | sortType: "Number", // 排序类型 |
| 206 | sortAttr: "routePriority", // 排序字段 | 309 | sortAttr: "routePriority", // 排序字段 |
| 207 | }); | 310 | }); |
| 208 | - // 【日期规则】 | 311 | + let config = false; // 有缺省的航线配置 |
| 209 | - const dateFlightRoute = routeList.map((item1) => { | 312 | + const result = this.routeList.map((item1) => { |
| 210 | const item2 = dataList.unique.find((item2) => { | 313 | const item2 = dataList.unique.find((item2) => { |
| 211 | if (item2.flightRoute === item1.route) { | 314 | if (item2.flightRoute === item1.route) { |
| 212 | - item2.config = true; | 315 | + config = item2.config = true; |
| 316 | + if (this.$route.query.pageName == "flightAllocConfig") { | ||
| 317 | + item2.remark = true; | ||
| 318 | + } else { | ||
| 319 | + item2.remark = false; | ||
| 320 | + } | ||
| 213 | return item2; | 321 | return item2; |
| 214 | } | 322 | } |
| 215 | }); // 返回当前相等的一条数据 | 323 | }); // 返回当前相等的一条数据 |
| 216 | if (item2) { | 324 | if (item2) { |
| 217 | - // 有数据的合并对象, | ||
| 218 | return { ...item1, ...item2 }; | 325 | return { ...item1, ...item2 }; |
| 219 | } else { | 326 | } else { |
| 220 | - // 没有数据的去普通航线里查找 | 327 | + config = item1.config = false; |
| 221 | - const item = dataList.unique.find((item) => { | 328 | + return item1; // 没有的返回当前的 |
| 222 | - if (item.flightRoute === item1.route) { | ||
| 223 | - item.config = true; | ||
| 224 | - return item; | ||
| 225 | - } | ||
| 226 | - }); | ||
| 227 | - if (item) { | ||
| 228 | - return { ...item1, ...item }; // 有数据的合并对象, | ||
| 229 | - } else { | ||
| 230 | - item1.config = false; | ||
| 231 | - return item1; // 没有的返回当前的 | ||
| 232 | - } | ||
| 233 | - } | ||
| 234 | - }); | ||
| 235 | - // 处理属性 | ||
| 236 | - dateFlightRoute.map((item) => { | ||
| 237 | - if (item.config) { | ||
| 238 | - this.hasOwnProperty(item, "typeOfGoods"); | ||
| 239 | - this.hasOwnProperty(item, "puporpuxCode"); | ||
| 240 | - this.hasOwnProperty(item, "serviceCode"); | ||
| 241 | - this.hasOwnProperty(item, "handlingCode"); | ||
| 242 | - this.hasOwnProperty(item, "subCategory"); | ||
| 243 | - this.setattrVal(item); // 设置属性值 | ||
| 244 | } | 329 | } |
| 245 | }); | 330 | }); |
| 246 | - this.routesInfo = dateFlightRoute; | 331 | + let configFlag = result.every((item) => item.config == true); |
| 247 | - }) | 332 | + // 返回日期级别查询结果 |
| 248 | - .catch(() => {}); | 333 | + resolve({ configFlag: configFlag, dateFlightRoute: result }); |
| 249 | - }, | ||
| 250 | - // 日期级别的 | ||
| 251 | - dateLevelRoute(parmas) { | ||
| 252 | - findDestinationFltRuleByFlightNo(parmas).then((res) => { | ||
| 253 | - const { code, data, msg } = res; | ||
| 254 | - if (code != 200) { | ||
| 255 | - this.msgError(msg); | ||
| 256 | - return; | ||
| 257 | - } | ||
| 258 | - let routeList = data.routeList; // 航班航线基本信息 | ||
| 259 | - this.routeList = data.routeList; | ||
| 260 | - // 日期级别航班航线维度规则详情 | ||
| 261 | - const dataList = removeDuplicates(data.list, { | ||
| 262 | - duplicate: "flightRoute", // 去重字段 | ||
| 263 | - sort: false, // 是否要排序 | ||
| 264 | - sortType: "Number", // 排序类型 | ||
| 265 | - sortAttr: "routePriority", // 排序字段 | ||
| 266 | - }); | ||
| 267 | - let config = false; // 有缺省的航线配置 | ||
| 268 | - const dateFlightRoute = routeList.map((item1) => { | ||
| 269 | - const item2 = dataList.unique.find((item2) => { | ||
| 270 | - if (item2.flightRoute === item1.route) { | ||
| 271 | - config = item2.config = true; | ||
| 272 | - if (this.$route.query.pageName == "flightAllocConfig") { | ||
| 273 | - item2.remark = true; | ||
| 274 | - } else { | ||
| 275 | - item2.remark = false; | ||
| 276 | - } | ||
| 277 | - return item2; | ||
| 278 | - } | ||
| 279 | - }); // 返回当前相等的一条数据 | ||
| 280 | - if (item2) { | ||
| 281 | - return { ...item1, ...item2 }; | ||
| 282 | - } else { | ||
| 283 | - config = item1.config = false; | ||
| 284 | - return item1; // 没有的返回当前的 | ||
| 285 | - } | ||
| 286 | - }); | ||
| 287 | - // 处理属性 | ||
| 288 | - dateFlightRoute.map((item) => { | ||
| 289 | - if (item.config) { | ||
| 290 | - this.hasOwnProperty(item, "typeOfGoods"); | ||
| 291 | - this.hasOwnProperty(item, "puporpuxCode"); | ||
| 292 | - this.hasOwnProperty(item, "serviceCode"); | ||
| 293 | - this.hasOwnProperty(item, "handlingCode"); | ||
| 294 | - this.hasOwnProperty(item, "subCategory"); | ||
| 295 | - this.setattrVal(item); // 设置属性值 | ||
| 296 | - } | ||
| 297 | }); | 334 | }); |
| 298 | - this.routesInfo = dateFlightRoute; | ||
| 299 | }); | 335 | }); |
| 300 | }, | 336 | }, |
| 301 | // 新增规则 | 337 | // 新增规则 | ... | ... |
| ... | @@ -506,7 +506,7 @@ export default { | ... | @@ -506,7 +506,7 @@ export default { |
| 506 | const { code, msg } = res; | 506 | const { code, msg } = res; |
| 507 | if (code == 200) { | 507 | if (code == 200) { |
| 508 | this.msgSuccess(msg || "创建成功!"); | 508 | this.msgSuccess(msg || "创建成功!"); |
| 509 | - this.$router.push("/et86RuleConfig"); | 509 | + this.closeTagMenu(this.$route) |
| 510 | } else { | 510 | } else { |
| 511 | this.msgError(msg || "创建失败!"); | 511 | this.msgError(msg || "创建失败!"); |
| 512 | } | 512 | } |
| ... | @@ -556,6 +556,16 @@ export default { | ... | @@ -556,6 +556,16 @@ export default { |
| 556 | } else { | 556 | } else { |
| 557 | this.checkboxClassType = []; | 557 | this.checkboxClassType = []; |
| 558 | } | 558 | } |
| 559 | + // 人民币 | ||
| 560 | + if (data.list.fltRuleDto.currencyCd == "CNY") { | ||
| 561 | + this.minCNYCustomVal = data.list.fltRuleDto.minCustomVal; | ||
| 562 | + this.maxCNYCustomVal = data.list.fltRuleDto.maxCustomVal; | ||
| 563 | + } | ||
| 564 | + // 美元 | ||
| 565 | + if (data.list.fltRuleDto.currencyCd == "USD") { | ||
| 566 | + this.minSUDCustomVal = data.list.fltRuleDto.minCustomVal; | ||
| 567 | + this.maxSUDCustomVal = data.list.fltRuleDto.maxCustomVal; | ||
| 568 | + } | ||
| 559 | this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度 | 569 | this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度 |
| 560 | } else { | 570 | } else { |
| 561 | this.msgError(msg || "获取查看失败"); | 571 | this.msgError(msg || "获取查看失败"); |
| ... | @@ -570,7 +580,7 @@ export default { | ... | @@ -570,7 +580,7 @@ export default { |
| 570 | const { code, msg } = res; | 580 | const { code, msg } = res; |
| 571 | if (code == 200) { | 581 | if (code == 200) { |
| 572 | this.msgSuccess(msg || "修改成功!"); | 582 | this.msgSuccess(msg || "修改成功!"); |
| 573 | - this.$router.push("/et86RuleConfig"); | 583 | + this.closeTagMenu(this.$route) |
| 574 | } else { | 584 | } else { |
| 575 | this.msgError(msg || "修改失败!"); | 585 | this.msgError(msg || "修改失败!"); |
| 576 | } | 586 | } |
| ... | @@ -785,6 +795,34 @@ export default { | ... | @@ -785,6 +795,34 @@ export default { |
| 785 | }); | 795 | }); |
| 786 | this.$emit("handleSearch"); | 796 | this.$emit("handleSearch"); |
| 787 | }, | 797 | }, |
| 798 | + isActive(route) { | ||
| 799 | + return route.path === this.$route.path; | ||
| 800 | + }, | ||
| 801 | + toLastView(visitedViews, view) { | ||
| 802 | + const latestView = visitedViews.slice(-1)[0]; | ||
| 803 | + if (latestView) { | ||
| 804 | + this.$router.push(latestView.fullPath); | ||
| 805 | + } else { | ||
| 806 | + // now the default is to redirect to the home page if there is no tags-view, | ||
| 807 | + // you can adjust it according to your needs. | ||
| 808 | + if (view.name === "Dashboard") { | ||
| 809 | + // to reload home page | ||
| 810 | + this.$router.replace({ path: "/redirect" + view.fullPath }); | ||
| 811 | + } else { | ||
| 812 | + this.$router.push("/"); | ||
| 813 | + } | ||
| 814 | + } | ||
| 815 | + }, | ||
| 816 | + // 关闭当前标签菜单 | ||
| 817 | + closeTagMenu(view) { | ||
| 818 | + this.$store | ||
| 819 | + .dispatch("tagsView/delView", view) | ||
| 820 | + .then(({ visitedViews }) => { | ||
| 821 | + if (this.isActive(view)) { | ||
| 822 | + this.toLastView(visitedViews, view); | ||
| 823 | + } | ||
| 824 | + }); | ||
| 825 | + }, | ||
| 788 | }, | 826 | }, |
| 789 | }; | 827 | }; |
| 790 | </script> | 828 | </script> | ... | ... |
-
Please register or login to post a comment