Showing
4 changed files
with
28 additions
and
121 deletions
| 1 | -export const formConfig = [ | ||
| 2 | - { | ||
| 3 | - label: "重量(KG)", | ||
| 4 | - type: "Input", | ||
| 5 | - name: "minWeight", | ||
| 6 | - prop: "minWeight", | ||
| 7 | - placeholder: "0", | ||
| 8 | - rules: { | ||
| 9 | - required: true, | ||
| 10 | - message: "最小重量不得小于0KG", | ||
| 11 | - trigger: ["change", "blur"], | ||
| 12 | - }, | ||
| 13 | - trigger: "blur", // 事件名 | ||
| 14 | - }, | ||
| 15 | - { | ||
| 16 | - label: "", | ||
| 17 | - type: "Input", | ||
| 18 | - name: "maxWeight", | ||
| 19 | - prop: "maxWeight", | ||
| 20 | - placeholder: "34", | ||
| 21 | - rules: { | ||
| 22 | - required: true, | ||
| 23 | - message: "最大重量不得大于34KG", | ||
| 24 | - trigger: ["change", "blur"], | ||
| 25 | - }, | ||
| 26 | - trigger: "blur", // 事件名 | ||
| 27 | - }, | ||
| 28 | - { | ||
| 29 | - label: "件数", | ||
| 30 | - type: "Input", | ||
| 31 | - name: "minNumOfPieces", | ||
| 32 | - prop: "minNumOfPieces", | ||
| 33 | - placeholder: "0", | ||
| 34 | - rules: { | ||
| 35 | - required: true, | ||
| 36 | - message: "最小件数不得小于0", | ||
| 37 | - trigger: ["change", "blur"], | ||
| 38 | - }, | ||
| 39 | - trigger: "blur", // 事件名 | ||
| 40 | - }, | ||
| 41 | - { | ||
| 42 | - label: "", | ||
| 43 | - type: "Input", | ||
| 44 | - name: "maxNumOfPieces", | ||
| 45 | - prop: "maxNumOfPieces", | ||
| 46 | - placeholder: "34", | ||
| 47 | - rules: { | ||
| 48 | - required: true, | ||
| 49 | - message: "最大件数不得小于最小件数", | ||
| 50 | - trigger: ["change", "blur"], | ||
| 51 | - }, | ||
| 52 | - trigger: "blur", // 事件名 | ||
| 53 | - }, | ||
| 54 | -]; |
| ... | @@ -97,7 +97,7 @@ | ... | @@ -97,7 +97,7 @@ |
| 97 | v-model="scope.row.flightRoute" | 97 | v-model="scope.row.flightRoute" |
| 98 | size="small" | 98 | size="small" |
| 99 | :disabled="scope.row.edit" | 99 | :disabled="scope.row.edit" |
| 100 | - @focus="inputFlightRoute(scope)" | 100 | + @visible-change="visibleChangeRoute($event, scope)" |
| 101 | > | 101 | > |
| 102 | <el-option | 102 | <el-option |
| 103 | v-for="item in scope.row.routeList" | 103 | v-for="item in scope.row.routeList" |
| ... | @@ -431,7 +431,6 @@ | ... | @@ -431,7 +431,6 @@ |
| 431 | <script> | 431 | <script> |
| 432 | import YlForm from "@/components/YlForm"; | 432 | import YlForm from "@/components/YlForm"; |
| 433 | import YlTable from "@/components/YlTable"; | 433 | import YlTable from "@/components/YlTable"; |
| 434 | -import { formConfig } from "./formConfig"; | ||
| 435 | import { inputBlurValidate } from "@/utils/mixins"; | 434 | import { inputBlurValidate } from "@/utils/mixins"; |
| 436 | import { tableAttr } from "./tableConfig"; | 435 | import { tableAttr } from "./tableConfig"; |
| 437 | import { | 436 | import { |
| ... | @@ -453,7 +452,6 @@ export default { | ... | @@ -453,7 +452,6 @@ export default { |
| 453 | mixins: [indexMixins, inputBlurValidate], | 452 | mixins: [indexMixins, inputBlurValidate], |
| 454 | data() { | 453 | data() { |
| 455 | return { | 454 | return { |
| 456 | - formConfig: formConfig, // 表单配置项 | ||
| 457 | queryForm: { | 455 | queryForm: { |
| 458 | // ET86配舱航班顺位维度 | 456 | // ET86配舱航班顺位维度 |
| 459 | // 表单参数 | 457 | // 表单参数 |
| ... | @@ -640,22 +638,15 @@ export default { | ... | @@ -640,22 +638,15 @@ export default { |
| 640 | this.tableAttr.loadingTable = false; | 638 | this.tableAttr.loadingTable = false; |
| 641 | if (res.code == 200) { | 639 | if (res.code == 200) { |
| 642 | const list = res.data.list; | 640 | const list = res.data.list; |
| 643 | - let routeList = []; | ||
| 644 | if (list.length) { | 641 | if (list.length) { |
| 645 | - list.map((item) => { | ||
| 646 | - routeList.push(item); | ||
| 647 | - }); | ||
| 648 | let isEtesRoute = list.filter((item) => item.isEtesRoute == "Y"); // 过滤普通航线 | 642 | let isEtesRoute = list.filter((item) => item.isEtesRoute == "Y"); // 过滤普通航线 |
| 649 | if (isEtesRoute.length == 0) { | 643 | if (isEtesRoute.length == 0) { |
| 650 | this.msgError("该航班下的航线均为普通航线"); | 644 | this.msgError("该航班下的航线均为普通航线"); |
| 651 | } | 645 | } |
| 652 | - // console.log(this.currentIndex) | ||
| 653 | - // console.log(this.tableData) | ||
| 654 | - // console.log(this.tableData[this.currentIndex]) | ||
| 655 | - // console.log(isEtesRoute) | ||
| 656 | - this.tableData[this.currentIndex].flightRoute = ""; | ||
| 657 | this.tableData[this.currentIndex].routeList = isEtesRoute; | 646 | this.tableData[this.currentIndex].routeList = isEtesRoute; |
| 658 | - // this.$set(this.tableData[this.currentIndex].routeList, index, isEtesRoute); | 647 | + this.$set(this.tableData, this.currentIndex, { |
| 648 | + ...this.tableData[this.currentIndex], | ||
| 649 | + }); | ||
| 659 | } else { | 650 | } else { |
| 660 | this.msgError("暂无航线"); | 651 | this.msgError("暂无航线"); |
| 661 | this.tableData[this.currentIndex].routeList = []; | 652 | this.tableData[this.currentIndex].routeList = []; |
| ... | @@ -705,14 +696,17 @@ export default { | ... | @@ -705,14 +696,17 @@ export default { |
| 705 | this.msgError("请输入航班号"); | 696 | this.msgError("请输入航班号"); |
| 706 | } | 697 | } |
| 707 | }, | 698 | }, |
| 708 | - // 航线聚焦事件 | 699 | + // 航线Select下拉框出现/隐藏时触发事件 |
| 709 | - inputFlightRoute({ $index, row }){ | 700 | + visibleChangeRoute(e, { $index, row }) { |
| 710 | this.currentIndex = $index; | 701 | this.currentIndex = $index; |
| 711 | let params = { | 702 | let params = { |
| 712 | - fltNo: row.flightNo | 703 | + fltNo: row.flightNo, |
| 713 | - } | 704 | + }; |
| 705 | + // 出现下拉框时触发 | ||
| 706 | + if (e) { | ||
| 714 | // 航线查询 | 707 | // 航线查询 |
| 715 | - // this.getQueryRouteByFltNo(params); | 708 | + this.getQueryRouteByFltNo(params); |
| 709 | + } | ||
| 716 | }, | 710 | }, |
| 717 | // 添加ET86配舱航班顺位 | 711 | // 添加ET86配舱航班顺位 |
| 718 | addBtn(item) { | 712 | addBtn(item) { |
| ... | @@ -738,7 +732,7 @@ export default { | ... | @@ -738,7 +732,7 @@ export default { |
| 738 | }, | 732 | }, |
| 739 | // 删除 | 733 | // 删除 |
| 740 | deleBtn(item, $index) { | 734 | deleBtn(item, $index) { |
| 741 | - console.log("删除:",item, $index); | 735 | + console.log("删除:", item, $index); |
| 742 | this.tableData.splice($index, 1); | 736 | this.tableData.splice($index, 1); |
| 743 | }, | 737 | }, |
| 744 | // 类别 | 738 | // 类别 |
| ... | @@ -819,6 +813,11 @@ export default { | ... | @@ -819,6 +813,11 @@ export default { |
| 819 | this.postAdd(parmas); // 新增 | 813 | this.postAdd(parmas); // 新增 |
| 820 | } else { | 814 | } else { |
| 821 | if (this.validateForm) { | 815 | if (this.validateForm) { |
| 816 | + parmas.flightRankDtoList.map((item) => { | ||
| 817 | + if (item.hasOwnProperty("routeList")) { | ||
| 818 | + delete item.routeList; | ||
| 819 | + } | ||
| 820 | + }); | ||
| 822 | this.postUpdate(parmas); // 修改 | 821 | this.postUpdate(parmas); // 修改 |
| 823 | } | 822 | } |
| 824 | } | 823 | } |
| ... | @@ -835,7 +834,7 @@ export default { | ... | @@ -835,7 +834,7 @@ export default { |
| 835 | toLastView(visitedViews, view) { | 834 | toLastView(visitedViews, view) { |
| 836 | const latestView = visitedViews.slice(-1)[0]; | 835 | const latestView = visitedViews.slice(-1)[0]; |
| 837 | if (latestView) { | 836 | if (latestView) { |
| 838 | - this.$router.push(latestView.fullPath); | 837 | + this.$router.replace(latestView.fullPath); |
| 839 | } else { | 838 | } else { |
| 840 | if (view.name === "Dashboard") { | 839 | if (view.name === "Dashboard") { |
| 841 | this.$router.replace({ path: "/redirect" + view.fullPath }); | 840 | this.$router.replace({ path: "/redirect" + view.fullPath }); | ... | ... |
| ... | @@ -55,50 +55,3 @@ export const formConfig = [ | ... | @@ -55,50 +55,3 @@ export const formConfig = [ |
| 55 | inputWidth: "100%", | 55 | inputWidth: "100%", |
| 56 | }, | 56 | }, |
| 57 | ]; | 57 | ]; |
| 58 | - | ||
| 59 | -export const editFormConfig = [ | ||
| 60 | - { | ||
| 61 | - label: "航班号", | ||
| 62 | - type: "Search", | ||
| 63 | - name: "route", | ||
| 64 | - prop: "fltNo", | ||
| 65 | - placeholder: "请输入航班号", | ||
| 66 | - rules: { | ||
| 67 | - required: true, | ||
| 68 | - message: "请输入航班号", | ||
| 69 | - trigger: ["change", "blur"], | ||
| 70 | - }, | ||
| 71 | - http: { | ||
| 72 | - url: "/dictionary/queryRouteByFltNo", | ||
| 73 | - method: "post", | ||
| 74 | - data: { | ||
| 75 | - fltNo: "", | ||
| 76 | - }, | ||
| 77 | - }, | ||
| 78 | - }, | ||
| 79 | - { | ||
| 80 | - label: "", | ||
| 81 | - type: "inputNumber", | ||
| 82 | - name: "count", | ||
| 83 | - prop: "count", | ||
| 84 | - placeholder: "+", | ||
| 85 | - min: 0, | ||
| 86 | - max: 7, | ||
| 87 | - with: "50px", | ||
| 88 | - }, | ||
| 89 | - { | ||
| 90 | - label: "航线优先级", | ||
| 91 | - type: "Input", | ||
| 92 | - name: "route", | ||
| 93 | - prop: "fltNum", | ||
| 94 | - placeholder: "请选择航线优先级", | ||
| 95 | - trigger: "focus", | ||
| 96 | - }, | ||
| 97 | - { | ||
| 98 | - label: "爆仓是否继续配舱", | ||
| 99 | - type: "Checkbox", | ||
| 100 | - name: "checked", | ||
| 101 | - prop: "checked", | ||
| 102 | - disabled: false, | ||
| 103 | - }, | ||
| 104 | -]; | ... | ... |
| ... | @@ -37,6 +37,7 @@ import { | ... | @@ -37,6 +37,7 @@ import { |
| 37 | findAllEtesRules, // ET86查询 | 37 | findAllEtesRules, // ET86查询 |
| 38 | deleteEtesRuleById, // 删除 | 38 | deleteEtesRuleById, // 删除 |
| 39 | } from "@/api/et86"; | 39 | } from "@/api/et86"; |
| 40 | +import store from "@/store"; | ||
| 40 | export default { | 41 | export default { |
| 41 | name: "Et86RuleConfig", | 42 | name: "Et86RuleConfig", |
| 42 | components: { | 43 | components: { |
| ... | @@ -69,6 +70,14 @@ export default { | ... | @@ -69,6 +70,14 @@ export default { |
| 69 | tableData: [], // 表格数据 | 70 | tableData: [], // 表格数据 |
| 70 | }; | 71 | }; |
| 71 | }, | 72 | }, |
| 73 | + watch: { | ||
| 74 | + $route(to, from) { | ||
| 75 | + // 如果是从edit页面进入的Et86RuleConfig页面,那么删除Et86RuleConfig页面缓存 | ||
| 76 | + if (from.name == "edit" && to.name == "Et86RuleConfig") { | ||
| 77 | + store.dispatch("tagsView/delCachedView", to); | ||
| 78 | + } | ||
| 79 | + }, | ||
| 80 | + }, | ||
| 72 | created() { | 81 | created() { |
| 73 | // ET86查询 | 82 | // ET86查询 |
| 74 | this.$nextTick(() => { | 83 | this.$nextTick(() => { | ... | ... |
-
Please register or login to post a comment