Elements-SY

modify

This diff is collapsed. Click to expand it.
...@@ -716,6 +716,7 @@ export default { ...@@ -716,6 +716,7 @@ export default {
716 this.id++; 716 this.id++;
717 this.tableData.unshift({ 717 this.tableData.unshift({
718 id: this.id, 718 id: this.id,
719 + statusMark: true, // 作为是否为新增
719 flightNo: "", // 航班号 720 flightNo: "", // 航班号
720 calculateDay: "", // 航班日期//+1 -1 721 calculateDay: "", // 航班日期//+1 -1
721 flightRoute: "", // 航线 722 flightRoute: "", // 航线
...@@ -735,7 +736,7 @@ export default { ...@@ -735,7 +736,7 @@ export default {
735 }, 736 },
736 // 删除 737 // 删除
737 deleBtn(item, $index) { 738 deleBtn(item, $index) {
738 - console.log("删除:", item, $index); 739 + // console.log("删除:", item, $index);
739 this.tableData.splice($index, 1); 740 this.tableData.splice($index, 1);
740 }, 741 },
741 // 类别 742 // 类别
...@@ -752,22 +753,37 @@ export default { ...@@ -752,22 +753,37 @@ export default {
752 this.queryForm.originOfFlightNo 753 this.queryForm.originOfFlightNo
753 ); 754 );
754 }, 755 },
756 + /*
757 + 如果是编辑,那么添加航班顺位时
758 + */
755 // 表单提交 759 // 表单提交
756 submitForm(formName) { 760 submitForm(formName) {
757 this.$refs[formName].validate((valid) => { 761 this.$refs[formName].validate((valid) => {
758 if (valid && this.validateForm) { 762 if (valid && this.validateForm) {
759 - this.tableData.map((item, i) => {
760 - item.priority = ++i;
761 - });
762 - // 爆仓是否继续配舱
763 const newtTableData = JSON.parse(JSON.stringify(this.tableData)); 763 const newtTableData = JSON.parse(JSON.stringify(this.tableData));
764 const tableData = newtTableData; 764 const tableData = newtTableData;
765 - tableData.filter((item) => { 765 + tableData.map((item, i) => {
766 + // 爆仓是否继续配舱
766 if (item.permitOverweight == false) { 767 if (item.permitOverweight == false) {
767 item.permitOverweight = "N"; 768 item.permitOverweight = "N";
768 } else { 769 } else {
769 item.permitOverweight = "Y"; 770 item.permitOverweight = "Y";
770 } 771 }
772 + // // 作为是否为新增
773 + // if (item.hasOwnProperty("statusMark")) {
774 + // delete item.id;
775 + // }
776 + if (item.hasOwnProperty("routeList")) {
777 + delete item.routeList;
778 + }
779 + item.priority = ++i;
780 + return item;
781 + });
782 + // 新增时没有id说明有statusMark字段,则删除statusMark属性
783 + tableData.map((item) => {
784 + if (!item.hasOwnProperty("id")) {
785 + delete item.statusMark;
786 + }
771 }); 787 });
772 // 校验ET86配舱航班顺位维度 788 // 校验ET86配舱航班顺位维度
773 let fltNo = this.tableData.some((item) => item.flightNo == ""); // 通过遍历判断航班顺位列表有没有填写的航班号 789 let fltNo = this.tableData.some((item) => item.flightNo == ""); // 通过遍历判断航班顺位列表有没有填写的航班号
...@@ -817,11 +833,6 @@ export default { ...@@ -817,11 +833,6 @@ export default {
817 this.postAdd(queryParmas); // 新增 833 this.postAdd(queryParmas); // 新增
818 } else { 834 } else {
819 if (this.validateForm) { 835 if (this.validateForm) {
820 - queryParmas.flightRankDtoList.map((item) => {
821 - if (item.hasOwnProperty("routeList")) {
822 - delete item.routeList;
823 - }
824 - });
825 this.postUpdate(queryParmas); // 修改 836 this.postUpdate(queryParmas); // 修改
826 } 837 }
827 } 838 }
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
111 } 111 }
112 } 112 }
113 }, 113 },
114 - // Ursa校验 使用JavaScript写一个匹配字母的表达式 114 + // Ursa校验
115 validateUrsa(ursaMark, ursa) { 115 validateUrsa(ursaMark, ursa) {
116 // 分隔字符串并且转数组&去除数组空字符串 116 // 分隔字符串并且转数组&去除数组空字符串
117 let ursaList = ursa.split(";").filter((str) => str !== ""); 117 let ursaList = ursa.split(";").filter((str) => str !== "");
......