Showing
8 changed files
with
164 additions
and
58 deletions
src/api/et86ShipmentDesc.js
0 → 100644
| ... | @@ -393,6 +393,13 @@ export function isNumberStr(str) { | ... | @@ -393,6 +393,13 @@ export function isNumberStr(str) { |
| 393 | return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str); | 393 | return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str); |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | +// Array JsonValue 排序 | ||
| 397 | +export function sortList(arr, key) { | ||
| 398 | + return arr.sort((a, b) => { | ||
| 399 | + return a[key].localeCompare(b[key]); | ||
| 400 | + }); | ||
| 401 | +} | ||
| 402 | + | ||
| 396 | // 获取计算元素的属性的margin + padding + clientHeight | 403 | // 获取计算元素的属性的margin + padding + clientHeight |
| 397 | function getPropertyValue(el) { | 404 | function getPropertyValue(el) { |
| 398 | let style, marginTop, marginBottom, paddingTop, paddingBottom; | 405 | let style, marginTop, marginBottom, paddingTop, paddingBottom; |
| ... | @@ -417,12 +424,21 @@ export function restTableHeight($refs) { | ... | @@ -417,12 +424,21 @@ export function restTableHeight($refs) { |
| 417 | if (key == "ylTable") { | 424 | if (key == "ylTable") { |
| 418 | $refs[key].$children.map((item) => { | 425 | $refs[key].$children.map((item) => { |
| 419 | if (item.$el.id == "group-btn") { | 426 | if (item.$el.id == "group-btn") { |
| 427 | + console.log("group-btn:", getPropertyValue(item.$el)); | ||
| 420 | // table表格组合按钮 | 428 | // table表格组合按钮 |
| 421 | heigth += getPropertyValue(item.$el); | 429 | heigth += getPropertyValue(item.$el); |
| 422 | heigth += item.$el.clientHeight; | 430 | heigth += item.$el.clientHeight; |
| 423 | } else if (item.$el.className == "el-pagination is-background") { | 431 | } else if (item.$el.className == "el-pagination is-background") { |
| 424 | // table表格组合分页 | 432 | // table表格组合分页 |
| 425 | if (item.$el.offsetParent.className == "pagination-container") { | 433 | if (item.$el.offsetParent.className == "pagination-container") { |
| 434 | + console.log( | ||
| 435 | + "pagination:", | ||
| 436 | + getPropertyValue(item.$el.offsetParent) | ||
| 437 | + ); | ||
| 438 | + console.log( | ||
| 439 | + "paginationClientHeight:", | ||
| 440 | + getPropertyValue(item.$el.offsetParent.clientHeight) | ||
| 441 | + ); | ||
| 426 | heigth += getPropertyValue(item.$el.offsetParent); | 442 | heigth += getPropertyValue(item.$el.offsetParent); |
| 427 | heigth += item.$el.offsetParent.clientHeight; | 443 | heigth += item.$el.offsetParent.clientHeight; |
| 428 | } | 444 | } |
| ... | @@ -431,13 +447,23 @@ export function restTableHeight($refs) { | ... | @@ -431,13 +447,23 @@ export function restTableHeight($refs) { |
| 431 | } else { | 447 | } else { |
| 432 | if ($refs[key].hasOwnProperty("$el")) { | 448 | if ($refs[key].hasOwnProperty("$el")) { |
| 433 | heigth += $refs[key].$el.clientHeight; | 449 | heigth += $refs[key].$el.clientHeight; |
| 450 | + heigth += getPropertyValue($refs[key].$el); | ||
| 451 | + console.log( | ||
| 452 | + "ruleForm:", | ||
| 453 | + $refs[key].$el.clientHeight, | ||
| 454 | + getPropertyValue($refs[key].$el) | ||
| 455 | + ); | ||
| 434 | } else { | 456 | } else { |
| 457 | + console.log("ruleForm:", $refs[key]); | ||
| 458 | + heigth += $refs[key].$el.clientHeight; | ||
| 435 | heigth += getPropertyValue($refs[key]); | 459 | heigth += getPropertyValue($refs[key]); |
| 436 | } | 460 | } |
| 437 | } | 461 | } |
| 438 | } else if (key == "formHeaderRef") { | 462 | } else if (key == "formHeaderRef") { |
| 463 | + console.log("formHeaderRef:", getPropertyValue($refs[key])); | ||
| 439 | heigth += getPropertyValue($refs[key]); | 464 | heigth += getPropertyValue($refs[key]); |
| 440 | } | 465 | } |
| 441 | }); | 466 | }); |
| 467 | + console.log("heigth:", heigth); | ||
| 442 | return heigth; | 468 | return heigth; |
| 443 | } | 469 | } | ... | ... |
| ... | @@ -13,6 +13,7 @@ | ... | @@ -13,6 +13,7 @@ |
| 13 | </el-col> | 13 | </el-col> |
| 14 | </el-row> | 14 | </el-row> |
| 15 | <yl-table | 15 | <yl-table |
| 16 | + ref="ylTable" | ||
| 16 | :attrs="tableAttr" | 17 | :attrs="tableAttr" |
| 17 | :loadingTable="tableAttr.loadingTable" | 18 | :loadingTable="tableAttr.loadingTable" |
| 18 | :columns="columns" | 19 | :columns="columns" |
| ... | @@ -89,10 +90,10 @@ import { formConfig } from "./formConfig"; | ... | @@ -89,10 +90,10 @@ import { formConfig } from "./formConfig"; |
| 89 | import { tableAttr, columnHeader } from "./tableConfig"; | 90 | import { tableAttr, columnHeader } from "./tableConfig"; |
| 90 | import { restTableHeight } from "@/utils"; | 91 | import { restTableHeight } from "@/utils"; |
| 91 | import { | 92 | import { |
| 92 | - findHsCodeList, // HScode黑名单查询 | 93 | + findHsCodeList, // ShipmentDesc查询 |
| 93 | - delBlackList, // HScode黑名单删除 | 94 | + delBlackList, // ShipmentDesc删除 |
| 94 | - downLoadTemplate, // HScode黑名单下载模板 | 95 | + downLoadTemplate, // ShipmentDesc下载模板 |
| 95 | - uploadHsCode, // HScode黑名单导入 | 96 | + uploadHsCode, // ShipmentDesc导入 |
| 96 | } from "@/api/et86HsCodeBlack"; | 97 | } from "@/api/et86HsCodeBlack"; |
| 97 | import { downLoadXlsx } from "@/utils/zipdownload"; | 98 | import { downLoadXlsx } from "@/utils/zipdownload"; |
| 98 | export default { | 99 | export default { |
| ... | @@ -140,15 +141,8 @@ export default { | ... | @@ -140,15 +141,8 @@ export default { |
| 140 | }, | 141 | }, |
| 141 | mounted() { | 142 | mounted() { |
| 142 | this.$nextTick(() => { | 143 | this.$nextTick(() => { |
| 143 | - let app = document.querySelector(".app-main"); | 144 | + console.log(this.$refs) |
| 144 | - if (this.$store.getters.appMainBlockClientHeight) { | 145 | + this.tableAttr.maxHeight = window.innerHeight - restTableHeight(this.$refs); |
| 145 | - this.tableAttr.maxHeight = | ||
| 146 | - this.$store.getters.appMainBlockClientHeight - | ||
| 147 | - restTableHeight(this.$refs); | ||
| 148 | - } else { | ||
| 149 | - this.tableAttr.maxHeight = | ||
| 150 | - app.clientHeight - restTableHeight(this.$refs); | ||
| 151 | - } | ||
| 152 | }); | 146 | }); |
| 153 | }, | 147 | }, |
| 154 | methods: { | 148 | methods: { | ... | ... |
| ... | @@ -10,7 +10,13 @@ | ... | @@ -10,7 +10,13 @@ |
| 10 | <el-col :span="18"> | 10 | <el-col :span="18"> |
| 11 | <el-row style="margin-bottom: 15px" v-if="getRouter"> | 11 | <el-row style="margin-bottom: 15px" v-if="getRouter"> |
| 12 | <el-col> | 12 | <el-col> |
| 13 | - <el-button type="primary" icon="el-icon-plus" size="mini" @click="addBtn">添加</el-button> | 13 | + <el-button |
| 14 | + type="primary" | ||
| 15 | + icon="el-icon-plus" | ||
| 16 | + size="mini" | ||
| 17 | + @click="addBtn" | ||
| 18 | + >添加</el-button | ||
| 19 | + > | ||
| 14 | </el-col> | 20 | </el-col> |
| 15 | </el-row> | 21 | </el-row> |
| 16 | <yl-table | 22 | <yl-table |
| ... | @@ -235,7 +241,10 @@ | ... | @@ -235,7 +241,10 @@ |
| 235 | <el-col :span="24"> | 241 | <el-col :span="24"> |
| 236 | <el-col :span="3"> | 242 | <el-col :span="3"> |
| 237 | <el-form-item label="单品名"> | 243 | <el-form-item label="单品名"> |
| 238 | - <el-checkbox v-model="queryForm.multiHs" :disabled="!getRouter"></el-checkbox> | 244 | + <el-checkbox |
| 245 | + v-model="queryForm.multiHs" | ||
| 246 | + :disabled="!getRouter" | ||
| 247 | + ></el-checkbox> | ||
| 239 | </el-form-item> | 248 | </el-form-item> |
| 240 | </el-col> | 249 | </el-col> |
| 241 | <el-col :span="8"> | 250 | <el-col :span="8"> |
| ... | @@ -440,7 +449,8 @@ export default { | ... | @@ -440,7 +449,8 @@ export default { |
| 440 | this.getAllDictData(); // 获取全部字典 | 449 | this.getAllDictData(); // 获取全部字典 |
| 441 | if (this.$route.query.name == "view" || this.$route.query.name == "edit") { | 450 | if (this.$route.query.name == "view" || this.$route.query.name == "edit") { |
| 442 | this.queryFindEtesRuleById(this.$route.query); // ET86详情 | 451 | this.queryFindEtesRuleById(this.$route.query); // ET86详情 |
| 443 | - } else { // 新增时默认一条数据 | 452 | + } else { |
| 453 | + // 新增时默认一条数据 | ||
| 444 | this.tableData = [ | 454 | this.tableData = [ |
| 445 | { | 455 | { |
| 446 | id: this.id, | 456 | id: this.id, |
| ... | @@ -461,7 +471,8 @@ export default { | ... | @@ -461,7 +471,8 @@ export default { |
| 461 | "input-filter": { | 471 | "input-filter": { |
| 462 | bind: function (el, binding) { | 472 | bind: function (el, binding) { |
| 463 | el.handler = function (event) { | 473 | el.handler = function (event) { |
| 464 | - if (event.data == "E" || event.data == "e") { // 无理数时 | 474 | + if (event.data == "E" || event.data == "e") { |
| 475 | + // 无理数时 | ||
| 465 | event.target.value = ""; | 476 | event.target.value = ""; |
| 466 | } | 477 | } |
| 467 | if (event.target.value) { | 478 | if (event.target.value) { |
| ... | @@ -469,7 +480,8 @@ export default { | ... | @@ -469,7 +480,8 @@ export default { |
| 469 | event.target.value = ""; | 480 | event.target.value = ""; |
| 470 | } else if (Number(event.target.value) > 7) { | 481 | } else if (Number(event.target.value) > 7) { |
| 471 | event.target.value = ""; | 482 | event.target.value = ""; |
| 472 | - } else if (/[\.]/.test(Number(event.target.value))) { // 浮点数时 | 483 | + } else if (/[\.]/.test(Number(event.target.value))) { |
| 484 | + // 浮点数时 | ||
| 473 | event.target.value = ""; | 485 | event.target.value = ""; |
| 474 | } else { | 486 | } else { |
| 475 | } | 487 | } |
| ... | @@ -487,7 +499,8 @@ export default { | ... | @@ -487,7 +499,8 @@ export default { |
| 487 | methods: { | 499 | methods: { |
| 488 | // ET86新增 | 500 | // ET86新增 |
| 489 | postAdd(params) { | 501 | postAdd(params) { |
| 490 | - add(params).then((res) => { | 502 | + add(params) |
| 503 | + .then((res) => { | ||
| 491 | const { code, msg } = res; | 504 | const { code, msg } = res; |
| 492 | if (code == 200) { | 505 | if (code == 200) { |
| 493 | this.msgSuccess(msg || "创建成功!"); | 506 | this.msgSuccess(msg || "创建成功!"); |
| ... | @@ -495,18 +508,20 @@ export default { | ... | @@ -495,18 +508,20 @@ export default { |
| 495 | } else { | 508 | } else { |
| 496 | this.msgError(msg || "创建失败!"); | 509 | this.msgError(msg || "创建失败!"); |
| 497 | } | 510 | } |
| 498 | - }).catch(() => {}); | 511 | + }) |
| 512 | + .catch(() => {}); | ||
| 499 | }, | 513 | }, |
| 500 | // ET86详情 | 514 | // ET86详情 |
| 501 | queryFindEtesRuleById({ id, status, name }) { | 515 | queryFindEtesRuleById({ id, status, name }) { |
| 502 | - findEtesRuleById({ id: id, status: status }).then((res) => { | 516 | + findEtesRuleById({ id: id, status: status }) |
| 517 | + .then((res) => { | ||
| 503 | const { code, data, msg } = res; | 518 | const { code, data, msg } = res; |
| 504 | if (code == 200) { | 519 | if (code == 200) { |
| 505 | data.list.flightRankDtoList.map((item) => { | 520 | data.list.flightRankDtoList.map((item) => { |
| 506 | - if(name == "view"){ | 521 | + if (name == "view") { |
| 507 | - item.edit = true | 522 | + item.edit = true; |
| 508 | - }else{ | 523 | + } else { |
| 509 | - item.edit = false | 524 | + item.edit = false; |
| 510 | } | 525 | } |
| 511 | // 爆仓是否继续配舱 | 526 | // 爆仓是否继续配舱 |
| 512 | if (item.permitOverweight == "N") { | 527 | if (item.permitOverweight == "N") { |
| ... | @@ -515,7 +530,11 @@ export default { | ... | @@ -515,7 +530,11 @@ export default { |
| 515 | item.permitOverweight = true; | 530 | item.permitOverweight = true; |
| 516 | } | 531 | } |
| 517 | }); | 532 | }); |
| 518 | - this.tableData = data.list.flightRankDtoList; // ET86配舱航班顺位 | 533 | + data.list.flightRankDtoList.map((item) => { |
| 534 | + item.calculateDay = Number(item.calculateDay); | ||
| 535 | + }); | ||
| 536 | + // ET86配舱航班顺位 | ||
| 537 | + this.tableData = data.list.flightRankDtoList; | ||
| 519 | Object.keys(data.list.fltRuleDto).map((key) => { | 538 | Object.keys(data.list.fltRuleDto).map((key) => { |
| 520 | if (key == "multiHs") { | 539 | if (key == "multiHs") { |
| 521 | if (data.list.fltRuleDto[key] == "N") { | 540 | if (data.list.fltRuleDto[key] == "N") { |
| ... | @@ -533,11 +552,13 @@ export default { | ... | @@ -533,11 +552,13 @@ export default { |
| 533 | } else { | 552 | } else { |
| 534 | this.msgError(msg || "获取查看失败"); | 553 | this.msgError(msg || "获取查看失败"); |
| 535 | } | 554 | } |
| 536 | - }).catch(() => {}); | 555 | + }) |
| 556 | + .catch(() => {}); | ||
| 537 | }, | 557 | }, |
| 538 | // ET86编辑 | 558 | // ET86编辑 |
| 539 | postUpdate(parmas) { | 559 | postUpdate(parmas) { |
| 540 | - update(parmas).then((res) => { | 560 | + update(parmas) |
| 561 | + .then((res) => { | ||
| 541 | const { code, msg } = res; | 562 | const { code, msg } = res; |
| 542 | if (code == 200) { | 563 | if (code == 200) { |
| 543 | this.msgSuccess(msg || "修改成功!"); | 564 | this.msgSuccess(msg || "修改成功!"); |
| ... | @@ -545,11 +566,13 @@ export default { | ... | @@ -545,11 +566,13 @@ export default { |
| 545 | } else { | 566 | } else { |
| 546 | this.msgError(msg || "修改失败!"); | 567 | this.msgError(msg || "修改失败!"); |
| 547 | } | 568 | } |
| 548 | - }).catch(() => {}); | 569 | + }) |
| 570 | + .catch(() => {}); | ||
| 549 | }, | 571 | }, |
| 550 | // 获取所有数据字典 | 572 | // 获取所有数据字典 |
| 551 | getAllDictData() { | 573 | getAllDictData() { |
| 552 | - allDictData().then((res) => { | 574 | + allDictData() |
| 575 | + .then((res) => { | ||
| 553 | if (res.code != 200) { | 576 | if (res.code != 200) { |
| 554 | this.msgError(res.msg); | 577 | this.msgError(res.msg); |
| 555 | return; | 578 | return; |
| ... | @@ -558,13 +581,15 @@ export default { | ... | @@ -558,13 +581,15 @@ export default { |
| 558 | if (res.data.serviceCode.length) { | 581 | if (res.data.serviceCode.length) { |
| 559 | this.getObj(res.data); | 582 | this.getObj(res.data); |
| 560 | } | 583 | } |
| 561 | - }).catch(() => {}); | 584 | + }) |
| 585 | + .catch(() => {}); | ||
| 562 | }, | 586 | }, |
| 563 | // 航线查询 | 587 | // 航线查询 |
| 564 | getQueryRouteByFltNo(item) { | 588 | getQueryRouteByFltNo(item) { |
| 565 | this.tableAttr.loadingTable = true; | 589 | this.tableAttr.loadingTable = true; |
| 566 | this.tableData[this.currentIndex].flightRoute; | 590 | this.tableData[this.currentIndex].flightRoute; |
| 567 | - queryRouteByFltNo(item).then((res) => { | 591 | + queryRouteByFltNo(item) |
| 592 | + .then((res) => { | ||
| 568 | this.tableAttr.loadingTable = false; | 593 | this.tableAttr.loadingTable = false; |
| 569 | if (res.code == 200) { | 594 | if (res.code == 200) { |
| 570 | const list = res.data.list; | 595 | const list = res.data.list; |
| ... | @@ -585,7 +610,8 @@ export default { | ... | @@ -585,7 +610,8 @@ export default { |
| 585 | this.tableData[this.currentIndex].flightRoute = ""; | 610 | this.tableData[this.currentIndex].flightRoute = ""; |
| 586 | } | 611 | } |
| 587 | } | 612 | } |
| 588 | - }).catch(() => {}); | 613 | + }) |
| 614 | + .catch(() => {}); | ||
| 589 | }, | 615 | }, |
| 590 | // 航班号input 聚焦事件 | 616 | // 航班号input 聚焦事件 |
| 591 | inputFocus({ $index }) { | 617 | inputFocus({ $index }) { |
| ... | @@ -593,11 +619,18 @@ export default { | ... | @@ -593,11 +619,18 @@ export default { |
| 593 | }, | 619 | }, |
| 594 | // 失焦查询 | 620 | // 失焦查询 |
| 595 | blurSearch() { | 621 | blurSearch() { |
| 596 | - this.tableData[this.currentIndex].flightNo = this.upCase(this.tableData[this.currentIndex].flightNo); // 转大写字母 | 622 | + this.tableData[this.currentIndex].flightNo = this.upCase( |
| 623 | + this.tableData[this.currentIndex].flightNo | ||
| 624 | + ); // 转大写字母 | ||
| 597 | let params = { | 625 | let params = { |
| 598 | fltNo: this.tableData[this.currentIndex].flightNo, | 626 | fltNo: this.tableData[this.currentIndex].flightNo, |
| 599 | }; | 627 | }; |
| 600 | - let repeat = this.tableData.filter((item) => item.flightNo == this.tableData[this.currentIndex].flightNo); // 筛选重复的航班 | 628 | + let repeat = this.tableData.filter( |
| 629 | + (item) => | ||
| 630 | + item.flightNo == this.tableData[this.currentIndex].flightNo && | ||
| 631 | + item.calculateDay == this.tableData[this.currentIndex].calculateDay && | ||
| 632 | + item.flightRoute == this.tableData[this.currentIndex].flightRoute | ||
| 633 | + ); // 筛选重复的航班 | ||
| 601 | if (repeat.length > 1) { | 634 | if (repeat.length > 1) { |
| 602 | this.msgError("航班顺位已重复"); | 635 | this.msgError("航班顺位已重复"); |
| 603 | return; | 636 | return; |
| ... | @@ -638,13 +671,17 @@ export default { | ... | @@ -638,13 +671,17 @@ export default { |
| 638 | }, | 671 | }, |
| 639 | // 类别 | 672 | // 类别 |
| 640 | changeCheckboxCargoType(arr) { | 673 | changeCheckboxCargoType(arr) { |
| 641 | - let include = this.cargoType.filter((item) =>arr.some((val) => val == item.chineseName)); // 查询已被勾选的类别 | 674 | + let include = this.cargoType.filter((item) => |
| 675 | + arr.some((val) => val == item.chineseName) | ||
| 676 | + ); // 查询已被勾选的类别 | ||
| 642 | this.checkboxCargoType = include; //已勾选申报类别的数据 | 677 | this.checkboxCargoType = include; //已勾选申报类别的数据 |
| 643 | this.queryForm.declarationCategory = arr.join(";"); | 678 | this.queryForm.declarationCategory = arr.join(";"); |
| 644 | }, | 679 | }, |
| 645 | // 失焦事件 | 680 | // 失焦事件 |
| 646 | blurEvent() { | 681 | blurEvent() { |
| 647 | - this.queryForm.originOfFlightNo = this.upCase(this.queryForm.originOfFlightNo); | 682 | + this.queryForm.originOfFlightNo = this.upCase( |
| 683 | + this.queryForm.originOfFlightNo | ||
| 684 | + ); | ||
| 648 | }, | 685 | }, |
| 649 | // 表单提交 | 686 | // 表单提交 |
| 650 | submitForm(formName) { | 687 | submitForm(formName) { |
| ... | @@ -661,11 +698,17 @@ export default { | ... | @@ -661,11 +698,17 @@ export default { |
| 661 | } | 698 | } |
| 662 | }); | 699 | }); |
| 663 | // 校验ET86配舱航班顺位维度 | 700 | // 校验ET86配舱航班顺位维度 |
| 664 | - if (this.minCNYCustomVal.length != "" || this.maxCNYCustomVal.length != "") { | 701 | + if ( |
| 702 | + this.minCNYCustomVal.length != "" || | ||
| 703 | + this.maxCNYCustomVal.length != "" | ||
| 704 | + ) { | ||
| 665 | this.queryForm.currencyCd = "CNY"; | 705 | this.queryForm.currencyCd = "CNY"; |
| 666 | this.queryForm.minCustomVal = this.minCNYCustomVal; | 706 | this.queryForm.minCustomVal = this.minCNYCustomVal; |
| 667 | this.queryForm.maxCustomVal = this.maxCNYCustomVal; | 707 | this.queryForm.maxCustomVal = this.maxCNYCustomVal; |
| 668 | - } else if (this.minSUDCustomVal.length != "" || this.maxSUDCustomVal.length != "") { | 708 | + } else if ( |
| 709 | + this.minSUDCustomVal.length != "" || | ||
| 710 | + this.maxSUDCustomVal.length != "" | ||
| 711 | + ) { | ||
| 669 | this.queryForm.currencyCd = "USD"; | 712 | this.queryForm.currencyCd = "USD"; |
| 670 | this.queryForm.minCustomVal = this.minSUDCustomVal; | 713 | this.queryForm.minCustomVal = this.minSUDCustomVal; |
| 671 | this.queryForm.maxCustomVal = this.maxSUDCustomVal; | 714 | this.queryForm.maxCustomVal = this.maxSUDCustomVal; |
| ... | @@ -673,7 +716,9 @@ export default { | ... | @@ -673,7 +716,9 @@ export default { |
| 673 | this.queryForm.currencyCd = "CNY"; | 716 | this.queryForm.currencyCd = "CNY"; |
| 674 | } | 717 | } |
| 675 | let fltNo = this.tableData.some((item) => item.flightNo == ""); // 通过遍历判断航班顺位列表有没有填写的航班号 | 718 | let fltNo = this.tableData.some((item) => item.flightNo == ""); // 通过遍历判断航班顺位列表有没有填写的航班号 |
| 676 | - let fltNoRoute = this.tableData.some((item) => item.flightRoute == ""); // 通过遍历判断航班顺位列表有没有填写的航线 | 719 | + let fltNoRoute = this.tableData.some( |
| 720 | + (item) => item.flightRoute == "" | ||
| 721 | + ); // 通过遍历判断航班顺位列表有没有填写的航线 | ||
| 677 | if (fltNo) { | 722 | if (fltNo) { |
| 678 | this.msgError("航班号不可为空"); | 723 | this.msgError("航班号不可为空"); |
| 679 | return; | 724 | return; |
| ... | @@ -686,8 +731,14 @@ export default { | ... | @@ -686,8 +731,14 @@ export default { |
| 686 | this.msgError("原航班号不可为空"); | 731 | this.msgError("原航班号不可为空"); |
| 687 | return; | 732 | return; |
| 688 | } | 733 | } |
| 689 | - this.queryForm.includeServiceType = this.isServiceCode == "1" && this.serviceCode.length > 0 ? this.serviceCode : ""; // 包含服务种类 | 734 | + this.queryForm.includeServiceType = |
| 690 | - this.queryForm.notIncludeServiceType = this.isServiceCode == "2" && this.serviceCode.length > 0 ? this.serviceCode : ""; // 不包含服务种类 | 735 | + this.isServiceCode == "1" && this.serviceCode.length > 0 |
| 736 | + ? this.serviceCode | ||
| 737 | + : ""; // 包含服务种类 | ||
| 738 | + this.queryForm.notIncludeServiceType = | ||
| 739 | + this.isServiceCode == "2" && this.serviceCode.length > 0 | ||
| 740 | + ? this.serviceCode | ||
| 741 | + : ""; // 不包含服务种类 | ||
| 691 | let parmas = { | 742 | let parmas = { |
| 692 | flightRankDtoList: tableData, // ET86配舱航班顺位 | 743 | flightRankDtoList: tableData, // ET86配舱航班顺位 |
| 693 | fltRuleDto: this.queryForm, | 744 | fltRuleDto: this.queryForm, | ... | ... |
| ... | @@ -32,7 +32,7 @@ import YlForm from "@/components/YlForm"; | ... | @@ -32,7 +32,7 @@ import YlForm from "@/components/YlForm"; |
| 32 | import YlTable from "@/components/YlTable"; | 32 | import YlTable from "@/components/YlTable"; |
| 33 | import { formConfig } from "./formConfig"; | 33 | import { formConfig } from "./formConfig"; |
| 34 | import { tableAttr, columnHeader } from "./tableConfig"; | 34 | import { tableAttr, columnHeader } from "./tableConfig"; |
| 35 | -import { restTableHeight } from "@/utils"; | 35 | +import { restTableHeight, sortList } from "@/utils"; |
| 36 | import { | 36 | import { |
| 37 | findAllEtesRules, // ET86查询 | 37 | findAllEtesRules, // ET86查询 |
| 38 | deleteEtesRuleById, // 删除 | 38 | deleteEtesRuleById, // 删除 |
| ... | @@ -71,16 +71,9 @@ export default { | ... | @@ -71,16 +71,9 @@ export default { |
| 71 | }, | 71 | }, |
| 72 | mounted() { | 72 | mounted() { |
| 73 | this.$nextTick(() => { | 73 | this.$nextTick(() => { |
| 74 | - let app = document.querySelector(".app-main"); | 74 | + console.log(window.innerHeight); |
| 75 | - if (this.$store.getters.appMainBlockClientHeight) { | 75 | + console.log(restTableHeight(this.$refs)); |
| 76 | - this.tableAttr.maxHeight = | 76 | + // this.tableAttr.maxHeight = window.innerHeight - restTableHeight(this.$refs); |
| 77 | - this.$store.getters.appMainBlockClientHeight - | ||
| 78 | - restTableHeight(this.$refs); | ||
| 79 | - } else { | ||
| 80 | - this.tableAttr.maxHeight = | ||
| 81 | - app.clientHeight - restTableHeight(this.$refs); | ||
| 82 | - } | ||
| 83 | - console.log(this.tableAttr.maxHeight); | ||
| 84 | }); | 77 | }); |
| 85 | }, | 78 | }, |
| 86 | methods: { | 79 | methods: { |
| ... | @@ -92,7 +85,13 @@ export default { | ... | @@ -92,7 +85,13 @@ export default { |
| 92 | this.tableAttr.loadingTable = false; | 85 | this.tableAttr.loadingTable = false; |
| 93 | const { code, data } = res; | 86 | const { code, data } = res; |
| 94 | if (code == 200) { | 87 | if (code == 200) { |
| 95 | - this.tableData = data.list; | 88 | + const valid = data.list.filter((item) => item.status == "1"); // 有效 |
| 89 | + const invalid = data.list.filter((item) => item.status == "0"); // 无效 | ||
| 90 | + valid.reverse(); // 有效航班修改时间排序 | ||
| 91 | + invalid.reverse(); // | ||
| 92 | + const newValid = sortList(valid, "originOfFlightNo"); // 有效原航班按字母排序 | ||
| 93 | + const newInvalid = sortList(invalid, "originOfFlightNo"); | ||
| 94 | + this.tableData = newValid.concat(newInvalid); | ||
| 96 | this.pageConfig.total = data.total; | 95 | this.pageConfig.total = data.total; |
| 97 | } | 96 | } |
| 98 | }) | 97 | }) | ... | ... |
| ... | @@ -7,6 +7,7 @@ export const tableAttr = { | ... | @@ -7,6 +7,7 @@ export const tableAttr = { |
| 7 | loadingTable: false, | 7 | loadingTable: false, |
| 8 | isDragSort: false, // 拖拽tableData数据一定要加id字段 | 8 | isDragSort: false, // 拖拽tableData数据一定要加id字段 |
| 9 | maxHeight: 0, | 9 | maxHeight: 0, |
| 10 | + // defaultSort: { prop: "updateTime", order: "descending" }, | ||
| 10 | btnCofig: { | 11 | btnCofig: { |
| 11 | isBtn: true, | 12 | isBtn: true, |
| 12 | btnGroup: [ | 13 | btnGroup: [ |
| ... | @@ -72,7 +73,8 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ | ... | @@ -72,7 +73,8 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ |
| 72 | prop: "updateTime", | 73 | prop: "updateTime", |
| 73 | align: "center", | 74 | align: "center", |
| 74 | minWidth: 120, | 75 | minWidth: 120, |
| 75 | - // "sort-method": (a, b) => b.createTime - a.createTime, | 76 | + // sortable: true, |
| 77 | + // "sort-method": (a, b) => a.createTime - b.createTime, | ||
| 76 | }, | 78 | }, |
| 77 | { | 79 | { |
| 78 | label: "修改人", | 80 | label: "修改人", |
| ... | @@ -87,7 +89,9 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ | ... | @@ -87,7 +89,9 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ |
| 87 | minWidth: 125, | 89 | minWidth: 125, |
| 88 | fixed: "right", | 90 | fixed: "right", |
| 89 | render: (h, params) => { | 91 | render: (h, params) => { |
| 90 | - return h("div", [ | 92 | + let operateData = [] |
| 93 | + if (params.row.status == "1") { | ||
| 94 | + operateData = [ | ||
| 91 | h( | 95 | h( |
| 92 | "el-button", | 96 | "el-button", |
| 93 | { | 97 | { |
| ... | @@ -139,7 +143,28 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ | ... | @@ -139,7 +143,28 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ |
| 139 | }, | 143 | }, |
| 140 | "删除" | 144 | "删除" |
| 141 | ), | 145 | ), |
| 142 | - ]); | 146 | + ]; |
| 147 | + }else{ | ||
| 148 | + operateData = [ | ||
| 149 | + h( | ||
| 150 | + "el-button", | ||
| 151 | + { | ||
| 152 | + props: { | ||
| 153 | + type: "text", | ||
| 154 | + size: "mini", | ||
| 155 | + icon: "el-icon-view", | ||
| 156 | + }, | ||
| 157 | + on: { | ||
| 158 | + click() { | ||
| 159 | + viewRow(params); | ||
| 160 | + }, | ||
| 161 | + }, | ||
| 162 | + }, | ||
| 163 | + "查看" | ||
| 164 | + ), | ||
| 165 | + ]; | ||
| 166 | + } | ||
| 167 | + return h("div", operateData); | ||
| 143 | }, | 168 | }, |
| 144 | }, | 169 | }, |
| 145 | ]; | 170 | ]; | ... | ... |
| ... | @@ -13,6 +13,7 @@ | ... | @@ -13,6 +13,7 @@ |
| 13 | </el-col> | 13 | </el-col> |
| 14 | </el-row> | 14 | </el-row> |
| 15 | <yl-table | 15 | <yl-table |
| 16 | + ref="ylTable" | ||
| 16 | :attrs="tableAttr" | 17 | :attrs="tableAttr" |
| 17 | :loadingTable="tableAttr.loadingTable" | 18 | :loadingTable="tableAttr.loadingTable" |
| 18 | :columns="columns" | 19 | :columns="columns" | ... | ... |
-
Please register or login to post a comment