Elements-SY

ET86联调

...@@ -35,7 +35,16 @@ export function findEtesRuleById(data) { ...@@ -35,7 +35,16 @@ export function findEtesRuleById(data) {
35 // ET86编辑 35 // ET86编辑
36 export function update(data) { 36 export function update(data) {
37 return request({ 37 return request({
38 - url: "/etes/udpate", 38 + url: "/etes/update",
39 + method: "post",
40 + data: data,
41 + });
42 +}
43 +
44 +// ET86删除
45 +export function deleteEtesRuleById(data) {
46 + return request({
47 + url: "/etes/deleteEtesRuleById",
39 method: "post", 48 method: "post",
40 data: data, 49 data: data,
41 }); 50 });
......
...@@ -81,25 +81,11 @@ export const constantRoutes = [ ...@@ -81,25 +81,11 @@ export const constantRoutes = [
81 children: [], 81 children: [],
82 }, 82 },
83 { 83 {
84 - path: "/et86/:name", 84 + path: "/edit",
85 component: (resolve) => 85 component: (resolve) =>
86 require(["@/views/allocationConfig/et86/edit"], resolve), 86 require(["@/views/allocationConfig/et86/edit"], resolve),
87 name: "edit", 87 name: "edit",
88 - meta: { title: "编辑", icon: "user" }, 88 + meta: { title: "编辑", icon: "user", noCache: false },
89 - beforeEnter: (to, from, next) => {
90 - const { params } = to;
91 - if (params.title == "edit") {
92 - to.params.title = "编辑"
93 - to.params.icon = "user";
94 - }else if (params.title == "detail") {
95 - to.params.title = "详情";
96 - to.params.icon = "user";
97 - }else{
98 - to.params.title = "新增";
99 - to.params.icon = "user";
100 - }
101 - next();
102 - },
103 }, 89 },
104 { 90 {
105 path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status", 91 path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status",
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
202 <el-form-item label="申报类别"> 202 <el-form-item label="申报类别">
203 <el-card shadow="never"> 203 <el-card shadow="never">
204 <el-checkbox-group 204 <el-checkbox-group
205 - v-model="checkboxClsssType" 205 + v-model="checkboxClassType"
206 @change="changeCheckboxCargoType" 206 @change="changeCheckboxCargoType"
207 style="display: flex" 207 style="display: flex"
208 v-if="cargoType.length" 208 v-if="cargoType.length"
...@@ -331,11 +331,11 @@ ...@@ -331,11 +331,11 @@
331 </el-form-item> 331 </el-form-item>
332 </el-col> 332 </el-col>
333 </el-col> 333 </el-col>
334 - <el-col :span="24"> 334 + <el-col :span="24" v-if="getRouter">
335 <el-form-item label=""> 335 <el-form-item label="">
336 - <el-button type="primary" @click="submitForm('ruleForm')" 336 + <el-button type="primary" @click="submitForm('ruleForm')">{{
337 - >保存</el-button 337 + getRouter
338 - > 338 + }}</el-button>
339 </el-form-item> 339 </el-form-item>
340 </el-col> 340 </el-col>
341 </el-row> 341 </el-row>
...@@ -371,10 +371,11 @@ export default { ...@@ -371,10 +371,11 @@ export default {
371 data() { 371 data() {
372 return { 372 return {
373 formConfig: formConfig, // 表单配置项 373 formConfig: formConfig, // 表单配置项
374 - queryForm: { // ET86配舱航班顺位维度 374 + queryForm: {
375 + // ET86配舱航班顺位维度
375 // 表单参数 376 // 表单参数
376 id: "", // 维度ID 377 id: "", // 维度ID
377 - originOfFlightNo: "", // 原航班号 378 + originOfFlightNo: "A380", // 原航班号
378 includeServiceType: "", // 服务种类包含 379 includeServiceType: "", // 服务种类包含
379 notIncludeServiceType: "", // 服务种类不包含 380 notIncludeServiceType: "", // 服务种类不包含
380 includeUrsa: "", // URSA包含 381 includeUrsa: "", // URSA包含
...@@ -397,7 +398,7 @@ export default { ...@@ -397,7 +398,7 @@ export default {
397 serviceCode: "", // 服务种类内容 398 serviceCode: "", // 服务种类内容
398 cargoType: [], // 申报类别调用接口获取所有的申报类别 399 cargoType: [], // 申报类别调用接口获取所有的申报类别
399 checkboxCargoType: [], // 已勾选申报类别的数据 400 checkboxCargoType: [], // 已勾选申报类别的数据
400 - checkboxClsssType: [], // 申报类别 401 + checkboxClassType: [], // 申报类别
401 serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode 402 serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode
402 minCNYCustomVal: "", // 403 minCNYCustomVal: "", //
403 maxCNYCustomVal: "", // 404 maxCNYCustomVal: "", //
...@@ -405,23 +406,35 @@ export default { ...@@ -405,23 +406,35 @@ export default {
405 maxSUDCustomVal: "", // 406 maxSUDCustomVal: "", //
406 }; 407 };
407 }, 408 },
408 - computed: {}, 409 + computed: {
410 + // 获取路由参数
411 + getRouter() {
412 + if (this.$route.query.name == "add") {
413 + return "保存";
414 + } else if (this.$route.query.name == "edit") {
415 + return "修改";
416 + } else {
417 + return false;
418 + }
419 + },
420 + },
409 created() { 421 created() {
410 - this.tableData = [
411 - {
412 - id: this.id,
413 - flightNo: "", // 航班号
414 - calculateDay: "", // 航班日期//+1 -1
415 - flightRoute: "", // 航线
416 - routeList: [], // 航线列表
417 - permitOverweight: "N" ? false : true, // 爆仓是否继续配舱 Y-是,N-否
418 - priority: this.id, // 优先等级
419 - ruleId: "", // 维度ID
420 - },
421 - ];
422 this.getAllDictData(); // 获取全部字典 422 this.getAllDictData(); // 获取全部字典
423 - if(this.$route.params.name == "view" || this.$route.params.name == "edit"){ 423 + if (this.$route.query.name == "view" || this.$route.query.name == "edit") {
424 - this.queryFindEtesRuleById(this.$route.params); // ET86详情 424 + this.queryFindEtesRuleById(this.$route.query); // ET86详情
425 + } else {
426 + this.tableData = [
427 + {
428 + id: this.id,
429 + flightNo: "", // 航班号
430 + calculateDay: "", // 航班日期//+1 -1
431 + flightRoute: "", // 航线
432 + routeList: [], // 航线列表
433 + permitOverweight: "N" ? false : true, // 爆仓是否继续配舱 Y-是,N-否
434 + priority: this.id, // 优先等级
435 + ruleId: "", // 维度ID
436 + },
437 + ];
425 } 438 }
426 }, 439 },
427 mounted() {}, 440 mounted() {},
...@@ -480,37 +493,58 @@ export default { ...@@ -480,37 +493,58 @@ export default {
480 // ET86新增 493 // ET86新增
481 postAdd(params) { 494 postAdd(params) {
482 add(params).then((res) => { 495 add(params).then((res) => {
483 - const { code, msg } = res 496 + const { code, msg } = res;
484 - if(code == 200){ 497 + if (code == 200) {
485 - this.msgSuccess(msg || "创建成功!") 498 + this.msgSuccess(msg || "创建成功!");
486 - }else{ 499 + this.$router.push("/et86");
487 - this.msgError(msg || "创建失败!"); 500 + } else {
501 + this.msgError(msg || "创建失败!");
488 } 502 }
489 }); 503 });
490 }, 504 },
491 // ET86详情 505 // ET86详情
492 - queryFindEtesRuleById({ id, status }){ 506 + queryFindEtesRuleById({ id, status }) {
493 - findEtesRuleById({ id: id.toString(), status: status }).then(res=>{ 507 + findEtesRuleById({ id: id, status: status }).then((res) => {
494 - const { code, data, msg } = res 508 + const { code, data, msg } = res;
495 - if(code == 200){ 509 + if (code == 200) {
496 - data.list.flightRankDtoList.map(item=>{ 510 + data.list.flightRankDtoList.map((item) => {
497 - if(item.permitOverweight == "N"){ 511 + if (item.permitOverweight == "N") {
498 - item.permitOverweight = false 512 + item.permitOverweight = false;
499 - }else{ 513 + } else {
500 - item.permitOverweight = true 514 + item.permitOverweight = true;
501 } 515 }
502 - }) 516 + });
503 - data.list.flightRankDtoList; // ET86配舱航班顺位 517 + this.tableData = data.list.flightRankDtoList; // ET86配舱航班顺位
504 - data.list.fltRuleDto; // ET86配舱航班顺位维度 518 + Object.keys(data.list.fltRuleDto).map((key) => {
505 - this.tableData = data.list.flightRankDtoList 519 + if (key == "multiHs") {
506 - }else{ 520 + if (data.list.fltRuleDto[key] == "N") {
507 - this.msgError(msg || "获取查看失败"); 521 + data.list.fltRuleDto[key] = false;
508 - } 522 + } else {
509 - console.log(res) 523 + data.list.fltRuleDto[key] = true;
510 - }) 524 + }
525 + }
526 + if (data.list.fltRuleDto[key] == null) {
527 + data.list.fltRuleDto[key] = "";
528 + }
529 + });
530 + this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度
531 + } else {
532 + this.msgError(msg || "获取查看失败");
533 + }
534 + });
511 }, 535 },
512 // ET86编辑 536 // ET86编辑
513 - postUpdate() {}, 537 + postUpdate(parmas) {
538 + update(parmas).then((res) => {
539 + const { code, msg } = res;
540 + if (code == 200) {
541 + this.msgSuccess(msg || "修改成功!");
542 + this.$router.push("/et86");
543 + } else {
544 + this.msgError(msg || "修改失败!");
545 + }
546 + });
547 + },
514 // 获取所有数据字典 548 // 获取所有数据字典
515 getAllDictData() { 549 getAllDictData() {
516 allDictData().then((res) => { 550 allDictData().then((res) => {
...@@ -518,7 +552,7 @@ export default { ...@@ -518,7 +552,7 @@ export default {
518 this.msgError(res.msg); 552 this.msgError(res.msg);
519 return; 553 return;
520 } 554 }
521 - this.queryForm.cargoType = res.data.cargoType; // 申报类别 555 + this.cargoType = res.data.cargoType; // 申报类别
522 if (res.data.serviceCode.length) { 556 if (res.data.serviceCode.length) {
523 this.getObj(res.data); 557 this.getObj(res.data);
524 } 558 }
...@@ -593,7 +627,7 @@ export default { ...@@ -593,7 +627,7 @@ export default {
593 changeCheck({ $index, row }) { 627 changeCheck({ $index, row }) {
594 this.tableData.map((item, i) => { 628 this.tableData.map((item, i) => {
595 if ($index !== i) { 629 if ($index !== i) {
596 - item.isOn = false; 630 + item.permitOverweight = false;
597 } 631 }
598 }); 632 });
599 }, 633 },
...@@ -613,25 +647,33 @@ export default { ...@@ -613,25 +647,33 @@ export default {
613 submitForm(formName) { 647 submitForm(formName) {
614 this.$refs[formName].validate((valid) => { 648 this.$refs[formName].validate((valid) => {
615 if (valid) { 649 if (valid) {
616 - if (this.minCNYCustomVal.length != "" || this.maxCNYCustomVal.length != "") { 650 + // 爆仓是否继续配舱
651 + const newtTableData = JSON.parse(JSON.stringify(this.tableData));
652 + const tableData = newtTableData;
653 + tableData.filter((item) => {
654 + if (item.permitOverweight == false) {
655 + item.permitOverweight = "N";
656 + } else {
657 + item.permitOverweight = "Y";
658 + }
659 + });
660 + if (
661 + this.minCNYCustomVal.length != "" ||
662 + this.maxCNYCustomVal.length != ""
663 + ) {
617 this.queryForm.currencyCd = "CNY"; 664 this.queryForm.currencyCd = "CNY";
618 this.queryForm.minCustomVal = this.minCNYCustomVal; 665 this.queryForm.minCustomVal = this.minCNYCustomVal;
619 this.queryForm.maxCustomVal = this.maxCNYCustomVal; 666 this.queryForm.maxCustomVal = this.maxCNYCustomVal;
620 - } else if (this.minSUDCustomVal.length != "" || this.maxSUDCustomVal.length != "") { 667 + } else if (
668 + this.minSUDCustomVal.length != "" ||
669 + this.maxSUDCustomVal.length != ""
670 + ) {
621 this.queryForm.currencyCd = "USD"; 671 this.queryForm.currencyCd = "USD";
622 this.queryForm.minCustomVal = this.minSUDCustomVal; 672 this.queryForm.minCustomVal = this.minSUDCustomVal;
623 this.queryForm.maxCustomVal = this.maxSUDCustomVal; 673 this.queryForm.maxCustomVal = this.maxSUDCustomVal;
624 } else { 674 } else {
625 this.queryForm.currencyCd = "CNY"; 675 this.queryForm.currencyCd = "CNY";
626 } 676 }
627 - // 爆仓是否继续配舱
628 - this.tableData.map((item) => {
629 - if (item.permitOverweight == false) {
630 - item.permitOverweight = "Y";
631 - } else {
632 - item.permitOverweight = "N";
633 - }
634 - });
635 let fltNo = this.tableData.some((item) => item.flightNo == ""); 677 let fltNo = this.tableData.some((item) => item.flightNo == "");
636 let fltNoRoute = this.tableData.some( 678 let fltNoRoute = this.tableData.some(
637 (item) => item.flightRoute == "" 679 (item) => item.flightRoute == ""
...@@ -648,14 +690,24 @@ export default { ...@@ -648,14 +690,24 @@ export default {
648 this.msgError("原航班号不可为空"); 690 this.msgError("原航班号不可为空");
649 return; 691 return;
650 } 692 }
651 - this.queryForm.includeServiceType = this.isServiceCode == "1" && this.serviceCode.length >0 ? this.serviceCode : ""; // 包含服务种类 693 + this.queryForm.includeServiceType =
652 - this.queryForm.notIncludeServiceType = this.isServiceCode == "2" && this.serviceCode.length >0 ? this.serviceCode : ""; // 不包含服务种类 694 + this.isServiceCode == "1" && this.serviceCode.length > 0
695 + ? this.serviceCode
696 + : ""; // 包含服务种类
697 + this.queryForm.notIncludeServiceType =
698 + this.isServiceCode == "2" && this.serviceCode.length > 0
699 + ? this.serviceCode
700 + : ""; // 不包含服务种类
653 let parmas = { 701 let parmas = {
654 - flightRankDtoList: this.tableData, // ET86配舱航班顺位 702 + flightRankDtoList: tableData, // ET86配舱航班顺位
655 - fltRuleDto: this.queryForm 703 + fltRuleDto: this.queryForm,
656 }; 704 };
657 - parmas.fltRuleDto.multiHs = multiHs ? "Y" : "N"; // N为单品名,Y为多品名 705 + parmas.fltRuleDto.multiHs = this.queryForm.multiHs ? "Y" : "N"; // N为单品名,Y为多品名
658 - this.postAdd(parmas); 706 + if (this.$route.query.name == "add") {
707 + this.postAdd(parmas); // 新增
708 + } else {
709 + this.postUpdate(parmas); // 修改
710 + }
659 } else { 711 } else {
660 console.log("error submit!!"); 712 console.log("error submit!!");
661 return false; 713 return false;
......
...@@ -47,12 +47,12 @@ export default { ...@@ -47,12 +47,12 @@ export default {
47 if (this.isServiceCode == "1") { 47 if (this.isServiceCode == "1") {
48 if (this.serviceCodeCofig().noInclude.length) { 48 if (this.serviceCodeCofig().noInclude.length) {
49 let tip = this.serviceCodeCofig().noInclude.toString(); 49 let tip = this.serviceCodeCofig().noInclude.toString();
50 - this.msgError(`${tip} 不包含`); 50 + // this.msgError(`${tip} 不包含`);
51 } 51 }
52 } else { 52 } else {
53 if (this.serviceCodeCofig().include.length) { 53 if (this.serviceCodeCofig().include.length) {
54 let tip = this.serviceCodeCofig().include.toString(); 54 let tip = this.serviceCodeCofig().include.toString();
55 - this.msgError(`${tip} 已包含`); 55 + // this.msgError(`${tip} 已包含`);
56 } 56 }
57 } 57 }
58 }, 58 },
......
...@@ -31,6 +31,7 @@ import { formConfig } from "./formConfig"; ...@@ -31,6 +31,7 @@ import { formConfig } from "./formConfig";
31 import { tableAttr, columnHeader } from "./tableConfig"; 31 import { tableAttr, columnHeader } from "./tableConfig";
32 import { 32 import {
33 findAllEtesRules, // ET86查询 33 findAllEtesRules, // ET86查询
34 + deleteEtesRuleById, // 删除
34 } from "@/api/et86"; 35 } from "@/api/et86";
35 export default { 36 export default {
36 components: { 37 components: {
...@@ -120,8 +121,8 @@ export default { ...@@ -120,8 +121,8 @@ export default {
120 addBtn(item) { 121 addBtn(item) {
121 console.log("add:", item); 122 console.log("add:", item);
122 this.$router.push({ 123 this.$router.push({
123 - name: "edit", 124 + path: "/edit",
124 - params: { 125 + query: {
125 name: "add", 126 name: "add",
126 }, 127 },
127 }); 128 });
...@@ -129,8 +130,8 @@ export default { ...@@ -129,8 +130,8 @@ export default {
129 // 查看 130 // 查看
130 viewRow({ row }) { 131 viewRow({ row }) {
131 this.$router.push({ 132 this.$router.push({
132 - name: "edit", 133 + path: "/edit",
133 - params: { 134 + query: {
134 name: "view", 135 name: "view",
135 id: row.id, 136 id: row.id,
136 status: row.status 137 status: row.status
...@@ -141,10 +142,11 @@ export default { ...@@ -141,10 +142,11 @@ export default {
141 // 编辑 142 // 编辑
142 editRow({ row }) { 143 editRow({ row }) {
143 this.$router.push({ 144 this.$router.push({
144 - name: "edit", 145 + path: "/edit",
145 - params: { 146 + query: {
146 name: "edit", 147 name: "edit",
147 id: row.id, 148 id: row.id,
149 + status: row.status
148 }, 150 },
149 }); 151 });
150 }, 152 },
...@@ -156,9 +158,15 @@ export default { ...@@ -156,9 +158,15 @@ export default {
156 type: "warning", 158 type: "warning",
157 center: true, 159 center: true,
158 }).then(() => { 160 }).then(() => {
159 - console.log("删除:", row); 161 + deleteEtesRuleById({ id: row.id }).then(res=>{
160 - this.msgSuccess("删除成功!"); 162 + const { code, msg } = res;
161 - }).catch(() => {}); 163 + if (code == 200) {
164 + this.msgSuccess("删除成功!");
165 + }else{
166 + this.msgError(msg || "删除失败");
167 + }
168 + })
169 + }).catch(() => {});
162 }, 170 },
163 }, 171 },
164 }; 172 };
......