Elements-SY

modify

...@@ -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;
......
1 +import {
2 + allDictData, // 获取全部字典
3 +} from "@/api/destinationFlight";
1 export default { 4 export default {
2 computed: { 5 computed: {
3 // 获取路由参数 6 // 获取路由参数
......
...@@ -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,
110 - // 非日期级别 111 + noDateParmas: {
111 - if (this.$route.query.querySpecifyData == "2") {
112 - let noDateParmas = {
113 flightDate: "", 112 flightDate: "",
114 flightRoute: "", 113 flightRoute: "",
115 purposeOfFlightNo: this.$route.query.purposeOfFlightNo, 114 purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
116 status: "", 115 status: "",
117 - }; 116 + },
118 - this.noDateLevelRoute(noDateParmas); 117 + dateParmas: {
119 - }
120 - // 日期级别
121 - if (this.$route.query.querySpecifyData == "1") {
122 - let dateParmas = {
123 flightDate: this.$route.query.flightDate, 118 flightDate: this.$route.query.flightDate,
124 flightRoute: "", 119 flightRoute: "",
125 flightRouteListStr: "", 120 flightRouteListStr: "",
126 purposeOfFlightNo: this.$route.query.purposeOfFlightNo, 121 purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
127 status: "", 122 status: "",
128 - }; 123 + },
129 - this.dateLevelRoute(dateParmas); 124 + queryParmas: function () {
125 + // 非日期级别
126 + if (this.querySpecifyData == "2") {
127 + _this
128 + .noDateLevelRoute(this.noDateParmas)
129 + .then(({ routeList, dataList }) => {
130 + const result = routeList.map((item1) => {
131 + const item2 = dataList.find((item2) => {
132 + if (item1.route === item2.flightRoute) {
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 + });
159 + }
160 + // 日期级别
161 + if (this.querySpecifyData == "1") {
162 + _this.dateLevelRoute(this.dateParmas).then((res) => {
163 + const { configFlag, dateFlightRoute } = res;
164 + if (configFlag == false) {
165 + // 航班航线有规则配置的
166 + const dateListHas = dateFlightRoute.filter(
167 + (item) => item.config == true
168 + );
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,6 +270,7 @@ export default { ...@@ -190,6 +270,7 @@ export default {
190 methods: { 270 methods: {
191 // 普通级别的 271 // 普通级别的
192 noDateLevelRoute(parmas) { 272 noDateLevelRoute(parmas) {
273 + return new Promise((resolve, reject) => {
193 findDestinationFltRuleByFlightNo(parmas) 274 findDestinationFltRuleByFlightNo(parmas)
194 .then((res) => { 275 .then((res) => {
195 const { code, data, msg } = res; 276 const { code, data, msg } = res;
...@@ -205,58 +286,21 @@ export default { ...@@ -205,58 +286,21 @@ export default {
205 sortType: "Number", // 排序类型 286 sortType: "Number", // 排序类型
206 sortAttr: "routePriority", // 排序字段 287 sortAttr: "routePriority", // 排序字段
207 }); 288 });
208 - // 【日期规则】 289 + resolve({ routeList: routeList, dataList: dataList.unique });
209 - const dateFlightRoute = routeList.map((item1) => {
210 - const item2 = dataList.unique.find((item2) => {
211 - if (item2.flightRoute === item1.route) {
212 - item2.config = true;
213 - return item2;
214 - }
215 - }); // 返回当前相等的一条数据
216 - if (item2) {
217 - // 有数据的合并对象,
218 - return { ...item1, ...item2 };
219 - } else {
220 - // 没有数据的去普通航线里查找
221 - const item = dataList.unique.find((item) => {
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 - }
245 - });
246 - this.routesInfo = dateFlightRoute;
247 }) 290 })
248 .catch(() => {}); 291 .catch(() => {});
292 + });
249 }, 293 },
250 // 日期级别的 294 // 日期级别的
251 dateLevelRoute(parmas) { 295 dateLevelRoute(parmas) {
296 + return new Promise((resolve, reject) => {
252 findDestinationFltRuleByFlightNo(parmas).then((res) => { 297 findDestinationFltRuleByFlightNo(parmas).then((res) => {
253 const { code, data, msg } = res; 298 const { code, data, msg } = res;
254 if (code != 200) { 299 if (code != 200) {
255 this.msgError(msg); 300 this.msgError(msg);
256 return; 301 return;
257 } 302 }
258 - let routeList = data.routeList; // 航班航线基本信息 303 + this.routeList = data.routeList; // 航班航线基本信息
259 - this.routeList = data.routeList;
260 // 日期级别航班航线维度规则详情 304 // 日期级别航班航线维度规则详情
261 const dataList = removeDuplicates(data.list, { 305 const dataList = removeDuplicates(data.list, {
262 duplicate: "flightRoute", // 去重字段 306 duplicate: "flightRoute", // 去重字段
...@@ -265,7 +309,7 @@ export default { ...@@ -265,7 +309,7 @@ export default {
265 sortAttr: "routePriority", // 排序字段 309 sortAttr: "routePriority", // 排序字段
266 }); 310 });
267 let config = false; // 有缺省的航线配置 311 let config = false; // 有缺省的航线配置
268 - const dateFlightRoute = routeList.map((item1) => { 312 + const result = this.routeList.map((item1) => {
269 const item2 = dataList.unique.find((item2) => { 313 const item2 = dataList.unique.find((item2) => {
270 if (item2.flightRoute === item1.route) { 314 if (item2.flightRoute === item1.route) {
271 config = item2.config = true; 315 config = item2.config = true;
...@@ -284,18 +328,10 @@ export default { ...@@ -284,18 +328,10 @@ export default {
284 return item1; // 没有的返回当前的 328 return item1; // 没有的返回当前的
285 } 329 }
286 }); 330 });
287 - // 处理属性 331 + let configFlag = result.every((item) => item.config == true);
288 - dateFlightRoute.map((item) => { 332 + // 返回日期级别查询结果
289 - if (item.config) { 333 + resolve({ configFlag: configFlag, dateFlightRoute: result });
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>
......