Elements-SY

modify

...@@ -29,7 +29,7 @@ export function findFlightDimRuleByFlightNo(query) { ...@@ -29,7 +29,7 @@ export function findFlightDimRuleByFlightNo(query) {
29 }) 29 })
30 } 30 }
31 31
32 -// 获取航班下航线维度(维度修改) 32 +// 航线维度设置详情
33 /** 33 /**
34 * @param purposeOfFlightNo 航班号 34 * @param purposeOfFlightNo 航班号
35 * @param flightDate 航班日期 35 * @param flightDate 航班日期
...@@ -43,7 +43,7 @@ export function findDestinationFltRuleByFlightNo(query) { ...@@ -43,7 +43,7 @@ export function findDestinationFltRuleByFlightNo(query) {
43 }) 43 })
44 } 44 }
45 45
46 -//航班优先级修改 46 +// 航班航线优先级更新
47 export function batchUpdateOrAddFlight(data) { 47 export function batchUpdateOrAddFlight(data) {
48 return request({ 48 return request({
49 url: '/destinationFlight/batchUpdateOrAddFlight', 49 url: '/destinationFlight/batchUpdateOrAddFlight',
...@@ -52,7 +52,7 @@ export function batchUpdateOrAddFlight(data) { ...@@ -52,7 +52,7 @@ export function batchUpdateOrAddFlight(data) {
52 }) 52 })
53 } 53 }
54 54
55 -//新增修改规则设置 55 +// 新增/修改航线规则设置
56 export function updateOrAddFlight(form) { 56 export function updateOrAddFlight(form) {
57 return request({ 57 return request({
58 url: '/destinationFlight/updateOrAddFlight', 58 url: '/destinationFlight/updateOrAddFlight',
...@@ -61,7 +61,7 @@ export function updateOrAddFlight(form) { ...@@ -61,7 +61,7 @@ export function updateOrAddFlight(form) {
61 }) 61 })
62 } 62 }
63 63
64 -//删除规则 64 +// 删除航线规则设置
65 export function delFlightId(data) { 65 export function delFlightId(data) {
66 return request({ 66 return request({
67 url: "/destinationFlight/delFlightId", 67 url: "/destinationFlight/delFlightId",
...@@ -70,7 +70,7 @@ export function delFlightId(data) { ...@@ -70,7 +70,7 @@ export function delFlightId(data) {
70 }); 70 });
71 } 71 }
72 72
73 -//启用/停止规则 73 +//开启/停用航线规则设置
74 export function enableOrDisable(data) { 74 export function enableOrDisable(data) {
75 //statsu 1-有效 3-停用 75 //statsu 1-有效 3-停用
76 return request({ 76 return request({
...@@ -113,7 +113,7 @@ export function saveOrUpdateSpecifyDateRoute(data) { ...@@ -113,7 +113,7 @@ export function saveOrUpdateSpecifyDateRoute(data) {
113 }) 113 })
114 } 114 }
115 115
116 -// id查询目的航班 116 +// 通过id查询目的航班维度设置详情
117 export function findByFlightId(data) { 117 export function findByFlightId(data) {
118 return request({ 118 return request({
119 url: "/destinationFlight/findByFlightId", 119 url: "/destinationFlight/findByFlightId",
......
...@@ -70,3 +70,22 @@ export const routeRuleForm = { ...@@ -70,3 +70,22 @@ export const routeRuleForm = {
70 subCategory: [], // Sub Category 70 subCategory: [], // Sub Category
71 ruleDate: "", 71 ruleDate: "",
72 }; 72 };
73 +// 校验表单域的选项
74 +export const validateForm = [
75 + "location",
76 + "notLocation",
77 + "destinationSite",
78 + "notDestinationSite",
79 + "includeUrsa",
80 + "notIncludeUrsa",
81 + "minNumOfPieces",
82 + "maxNumOfPieces",
83 + "minWeight",
84 + "maxWeight",
85 + "typeOfGoods",
86 + "cargoType",
87 + "puporpuxCode",
88 + "serviceCode",
89 + "handlingCode",
90 + "subCategory",
91 +];
......
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
51 import YlForm from "@/components/YlForm"; 51 import YlForm from "@/components/YlForm";
52 import RouteInfo from "../components/routeInfo"; 52 import RouteInfo from "../components/routeInfo";
53 import YlDraggable from "@/components/YlDraggable"; 53 import YlDraggable from "@/components/YlDraggable";
54 -import { formConfig, routeRuleForm } from "./formConfig"; 54 +import { formConfig, routeRuleForm, validateForm } from "./formConfig";
55 import { 55 import {
56 - updateOrAddFlight, // 修改 56 + updateOrAddFlight, // 新增/修改航线规则设置
57 - delFlightId, // 删除航线规则 57 + delFlightId, // 删除航线规则
58 - enableOrDisable, // 是否停用/开启航线规则配 58 + enableOrDisable, // 开启/停用航线规则设
59 - batchUpdateOrAddFlight, // 更新航线优先级 59 + batchUpdateOrAddFlight, // 航班航线优先级更新
60 queryRouteByFltNo, // 通过航班号查询航线 60 queryRouteByFltNo, // 通过航班号查询航线
61 } from "@/api/destinationFlight"; 61 } from "@/api/destinationFlight";
62 import indexMixins from "../mixins"; 62 import indexMixins from "../mixins";
...@@ -96,161 +96,25 @@ export default { ...@@ -96,161 +96,25 @@ export default {
96 */ 96 */
97 created() { 97 created() {
98 this.getAllDictData(); // 获取全部字典 98 this.getAllDictData(); // 获取全部字典
99 - let _this = this;
100 const parmas = { 99 const parmas = {
101 querySpecifyData: this.$route.query.querySpecifyData || "", // 查询特殊数据字段 100 querySpecifyData: this.$route.query.querySpecifyData || "", // 查询特殊数据字段
102 purposeOfFlightNo: this.$route.query.purposeOfFlightNo || "", // 航班号 101 purposeOfFlightNo: this.$route.query.purposeOfFlightNo || "", // 航班号
103 flightDate: this.$route.query.flightDate || "", // 飞行日期 102 flightDate: this.$route.query.flightDate || "", // 飞行日期
104 flightRouteListStr: this.$route.query.flightRouteListStr || "", // 飞行航线集合 103 flightRouteListStr: this.$route.query.flightRouteListStr || "", // 飞行航线集合
105 status: this.$route.query.status || "", // 状态 104 status: this.$route.query.status || "", // 状态
105 + dataStatus: this.$route.query.dataStatus || "", // add 、edit、view
106 + flightKindName: this.$route.query.flightKindName || "", // 航班种类White Tail 、Purple Tail
107 + pageName: this.$route.query.pageName || "", //
108 + id: this.$route.query.id,
106 }; 109 };
107 - let dataStatus = this.$route.query.dataStatus || ""; 110 + // 指定隐藏或显示From表单域
108 - if (dataStatus == "add") { 111 + this.hiddenFormItem(parmas);
109 - formConfig.map((item) => { 112 + // queryCondition只负责接收参数和接口调用
110 - if (item.type !== "slot") { 113 + this.queryCondition(parmas);
111 - item.disable = false;
112 - if (item.label == "航班日期" || item.label == "航线") {
113 - item.hidden = true;
114 - }
115 - }
116 - });
117 - } else {
118 - //
119 - formConfig.map((item) => {
120 - if (item.type !== "slot") {
121 - item.disable = true;
122 - if (item.label == "航班日期" || item.label == "航线") {
123 - item.hidden = false;
124 - item.hidden = false;
125 - }
126 - }
127 - });
128 - }
129 - // 航班配舱维度规则设置查询条件
130 - let queryCondition = {
131 - // 航班配舱设置
132 - flightAllocConfig: {
133 - noDateParmas: {
134 - flightDate: "",
135 - flightRoute: "",
136 - purposeOfFlightNo: parmas.purposeOfFlightNo,
137 - status: "",
138 - },
139 - dateParmas: {
140 - flightDate: parmas.flightDate,
141 - flightRoute: "",
142 - flightRouteListStr: "",
143 - purposeOfFlightNo: parmas.purposeOfFlightNo,
144 - status: "",
145 - },
146 - queryParmas: function () {
147 - // 非日期级别
148 - if (parmas.querySpecifyData == "2") {
149 - _this.noDateLevelData(this.noDateParmas);
150 - formConfig.map((item) => {
151 - if (item.type !== "slot") {
152 - if (item.label == "航线") {
153 - item.hidden = true;
154 - }
155 - }
156 - });
157 - }
158 - // 日期级别
159 - if (parmas.querySpecifyData == "1") {
160 - _this.dateLevelData({
161 - dateParmas: this.dateParmas,
162 - noDateParmas: this.noDateParmas,
163 - });
164 - formConfig.map((item) => {
165 - if (item.type !== "slot") {
166 - if (item.label == "航线") {
167 - item.hidden = true;
168 - }
169 - }
170 - });
171 - }
172 - _this.queryForm = _this.$route.query; // 获取跳转过来的参数
173 - },
174 - },
175 - // 航班信息维护
176 - flightInformationMaintenance: {
177 - noDateParmas: {
178 - purposeOfFlightNo: parmas.purposeOfFlightNo,
179 - flightRouteListStr: parmas.flightRouteListStr,
180 - status: "",
181 - },
182 - dateParmas: {
183 - purposeOfFlightNo: parmas.purposeOfFlightNo,
184 - flightDate: parmas.flightDate,
185 - flightRouteListStr: parmas.flightRouteListStr,
186 - status: "",
187 - },
188 - queryParmas: function () {
189 - // White Tail
190 - if (_this.$route.query.flightKindName == "White Tail") {
191 - _this.dateLevelData({
192 - dateParmas: this.dateParmas,
193 - noDateParmas: this.noDateParmas,
194 - });
195 - }
196 - // Purple Tail
197 - if (_this.$route.query.flightKindName == "Purple Tail") {
198 - _this.dateLevelData({
199 - dateParmas: this.dateParmas,
200 - noDateParmas: this.noDateParmas,
201 - });
202 - }
203 - },
204 - },
205 - // 航班顺位设置
206 - flightRandConfig: {
207 - noDateParmas: {
208 - flightRoute: "",
209 - flightRouteListStr: "",
210 - purposeOfFlightNo: parmas.purposeOfFlightNo,
211 - status: "",
212 - },
213 - dateParmas: {
214 - flightDate: parmas.flightDate,
215 - flightRoute: "",
216 - purposeOfFlightNo: parmas.purposeOfFlightNo,
217 - status: "",
218 - },
219 - queryParmas: function () {
220 - // 普通级别
221 - if (_this.$route.query.pageName == "flightRandConfig") {
222 - _this.dateLevelData({
223 - dateParmas: this.dateParmas,
224 - noDateParmas: this.noDateParmas,
225 - });
226 - }
227 - },
228 - },
229 - // 【系统日志】DM数据处理
230 - dmLog: {
231 - queryParmas: function () {
232 - if (_this.$route.query.pageName == "dmLog") {
233 - _this.getFindByFlightId({
234 - id: _this.$route.query.id,
235 - });
236 - }
237 - },
238 - },
239 - };
240 - /*
241 - queryCondition只负责接收参数和数据调用
242 - */
243 - // 航班配舱设置
244 - queryCondition.flightAllocConfig.queryParmas();
245 - // 航班信息维护
246 - queryCondition.flightInformationMaintenance.queryParmas();
247 - // 航班顺位设置
248 - queryCondition.flightRandConfig.queryParmas();
249 - // 【系统日志】DM数据处理
250 - queryCondition.dmLog.queryParmas();
251 }, 114 },
252 mounted() {}, 115 mounted() {},
253 methods: { 116 methods: {
117 + // 【通过航班号查询航线】
254 getQueryRouteByFltNo(parmas) { 118 getQueryRouteByFltNo(parmas) {
255 queryRouteByFltNo(parmas) 119 queryRouteByFltNo(parmas)
256 .then((res) => { 120 .then((res) => {
...@@ -276,13 +140,15 @@ export default { ...@@ -276,13 +140,15 @@ export default {
276 }, 140 },
277 // 航班号输入框失焦事件 141 // 航班号输入框失焦事件
278 blurEvent({ purposeOfFlightNo }) { 142 blurEvent({ purposeOfFlightNo }) {
143 + // 航班号转大写
279 routeRuleForm.flightRoute = this.upCase(purposeOfFlightNo); 144 routeRuleForm.flightRoute = this.upCase(purposeOfFlightNo);
145 + // 通过航班号查询航线
280 this.getQueryRouteByFltNo({ fltNo: this.upCase(purposeOfFlightNo) }); 146 this.getQueryRouteByFltNo({ fltNo: this.upCase(purposeOfFlightNo) });
281 this.queryForm.purposeOfFlightNo = this.upCase(purposeOfFlightNo); 147 this.queryForm.purposeOfFlightNo = this.upCase(purposeOfFlightNo);
282 }, 148 },
283 // 新增规则 149 // 新增规则
284 addRlue(index) { 150 addRlue(index) {
285 - // 如果当前航班号的航线下没有数据 151 + // 如果当前航班号的航线下没有数据,新增规则给默认数据
286 routeRuleForm.purposeOfFlightNo = this.$route.query.purposeOfFlightNo; 152 routeRuleForm.purposeOfFlightNo = this.$route.query.purposeOfFlightNo;
287 this.setattrVal(routeRuleForm); 153 this.setattrVal(routeRuleForm);
288 const mergeObj = { 154 const mergeObj = {
...@@ -291,7 +157,7 @@ export default { ...@@ -291,7 +157,7 @@ export default {
291 }; 157 };
292 this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据 158 this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据
293 }, 159 },
294 - // 保存 160 + // 保存 【新增/修改航线规则设置】
295 saveSubmit(item, index) { 161 saveSubmit(item, index) {
296 item.flightRoute = item.route || item.flightRoute; 162 item.flightRoute = item.route || item.flightRoute;
297 item.ruleDate = item.ruleDate || this.queryForm.flightDate; 163 item.ruleDate = item.ruleDate || this.queryForm.flightDate;
...@@ -330,25 +196,8 @@ export default { ...@@ -330,25 +196,8 @@ export default {
330 return; 196 return;
331 } 197 }
332 } 198 }
333 - let keys = [ 199 + // 校验表单域的选项
334 - "location", 200 + let validate = validateForm.some((key) => parmas[key]);
335 - "notLocation",
336 - "destinationSite",
337 - "notDestinationSite",
338 - "includeUrsa",
339 - "notIncludeUrsa",
340 - "minNumOfPieces",
341 - "maxNumOfPieces",
342 - "minWeight",
343 - "maxWeight",
344 - "typeOfGoods",
345 - "cargoType",
346 - "puporpuxCode",
347 - "serviceCode",
348 - "handlingCode",
349 - "subCategory",
350 - ];
351 - let validate = keys.some((key) => parmas[key]);
352 if (validate) { 201 if (validate) {
353 this.loading = true; 202 this.loading = true;
354 updateOrAddFlight(parmas) 203 updateOrAddFlight(parmas)
...@@ -378,7 +227,7 @@ export default { ...@@ -378,7 +227,7 @@ export default {
378 this.msgWarning("未添加规则信息,请添加后再保存!"); 227 this.msgWarning("未添加规则信息,请添加后再保存!");
379 } 228 }
380 }, 229 },
381 - // 开启/暂停 230 + // 开启/停用【开启/停用航线规则设置】
382 onOffSubmit(item, index) { 231 onOffSubmit(item, index) {
383 this.loading = true; 232 this.loading = true;
384 let tip = item.status == "1" ? "停用" : "启用"; 233 let tip = item.status == "1" ? "停用" : "启用";
...@@ -420,7 +269,7 @@ export default { ...@@ -420,7 +269,7 @@ export default {
420 this.loading = false; 269 this.loading = false;
421 }); 270 });
422 }, 271 },
423 - // 删除 272 + // 删除航线规则设置
424 deleteSubmit(item, index) { 273 deleteSubmit(item, index) {
425 this.loading = true; 274 this.loading = true;
426 let parmas = { 275 let parmas = {
......
1 import { 1 import {
2 allDictData, // 获取全部字典 2 allDictData, // 获取全部字典
3 findDestinationFltRuleByFlightNo, // 航线维度设置详情 3 findDestinationFltRuleByFlightNo, // 航线维度设置详情
4 - findByFlightId, // 通过id查询目的航班维度置详情 4 + findByFlightId, // 通过id查询目的航班维度置详情
5 } from "@/api/destinationFlight"; 5 } from "@/api/destinationFlight";
6 import { formConfig, routeRuleForm } from "../flightRouteInfo/formConfig"; 6 import { formConfig, routeRuleForm } from "../flightRouteInfo/formConfig";
7 import { removeDuplicates } from "@/utils"; 7 import { removeDuplicates } from "@/utils";
...@@ -27,6 +27,159 @@ export default { ...@@ -27,6 +27,159 @@ export default {
27 }, 27 },
28 }, 28 },
29 methods: { 29 methods: {
30 + // 指定隐藏或显示From表单域
31 + hiddenFormItem({ dataStatus, querySpecifyData }) {
32 + // 指定隐藏或显示From表单域【add时】
33 + if (dataStatus == "add") {
34 + formConfig.map((item) => {
35 + if (item.type !== "slot") {
36 + item.disable = false;
37 + if (item.label == "航班日期" || item.label == "航线") {
38 + item.hidden = true;
39 + }
40 + }
41 + });
42 + } else {
43 + // 【edit和view及空值时】
44 + formConfig.map((item) => {
45 + if (item.type !== "slot") {
46 + item.disable = true;
47 + if (item.label == "航班日期" || item.label == "航线") {
48 + item.hidden = false;
49 + }
50 + }
51 + });
52 + }
53 + // 【航班配舱设置】非日期级别
54 + if (querySpecifyData == "2") {
55 + formConfig.map((item) => {
56 + if (item.type !== "slot") {
57 + if (item.label == "航线") {
58 + item.hidden = true;
59 + }
60 + }
61 + });
62 + }
63 + // 【航班配舱设置】日期级别
64 + if (querySpecifyData == "1") {
65 + formConfig.map((item) => {
66 + if (item.type !== "slot") {
67 + if (item.label == "航线") {
68 + item.hidden = true;
69 + }
70 + }
71 + });
72 + }
73 + },
74 + // 页面跳转传参
75 + queryCondition(parmas) {
76 + let _this = this;
77 + // 航班配舱维度规则设置查询条件
78 + let queryCondition = {
79 + // 航班配舱设置
80 + flightAllocConfig: {
81 + noDateParmas: {
82 + flightDate: "",
83 + flightRoute: "",
84 + purposeOfFlightNo: parmas.purposeOfFlightNo,
85 + status: "",
86 + },
87 + dateParmas: {
88 + flightDate: parmas.flightDate,
89 + flightRoute: "",
90 + flightRouteListStr: "",
91 + purposeOfFlightNo: parmas.purposeOfFlightNo,
92 + status: "",
93 + },
94 + queryParmas: function () {
95 + // 非日期级别
96 + if (parmas.querySpecifyData == "2") {
97 + _this.noDateLevelData(this.noDateParmas);
98 + }
99 + // 日期级别
100 + if (parmas.querySpecifyData == "1") {
101 + _this.dateLevelData({
102 + dateParmas: this.dateParmas,
103 + noDateParmas: this.noDateParmas,
104 + });
105 + }
106 + _this.queryForm = _this.$route.query; // 获取跳转过来的参数
107 + },
108 + },
109 + // 航班信息维护
110 + flightInformationMaintenance: {
111 + noDateParmas: {
112 + purposeOfFlightNo: parmas.purposeOfFlightNo,
113 + flightRouteListStr: parmas.flightRouteListStr,
114 + status: "",
115 + },
116 + dateParmas: {
117 + purposeOfFlightNo: parmas.purposeOfFlightNo,
118 + flightDate: parmas.flightDate,
119 + flightRouteListStr: parmas.flightRouteListStr,
120 + status: "",
121 + },
122 + queryParmas: function () {
123 + // White Tail
124 + if (parmas.flightKindName == "White Tail") {
125 + _this.dateLevelData({
126 + dateParmas: this.dateParmas,
127 + noDateParmas: this.noDateParmas,
128 + });
129 + }
130 + // Purple Tail
131 + if (parmas.flightKindName == "Purple Tail") {
132 + _this.dateLevelData({
133 + dateParmas: this.dateParmas,
134 + noDateParmas: this.noDateParmas,
135 + });
136 + }
137 + },
138 + },
139 + // 航班顺位设置
140 + flightRandConfig: {
141 + noDateParmas: {
142 + flightRoute: "",
143 + flightRouteListStr: "",
144 + purposeOfFlightNo: parmas.purposeOfFlightNo,
145 + status: "",
146 + },
147 + dateParmas: {
148 + flightDate: parmas.flightDate,
149 + flightRoute: "",
150 + purposeOfFlightNo: parmas.purposeOfFlightNo,
151 + status: "",
152 + },
153 + queryParmas: function () {
154 + // 普通级别
155 + if (parmas.pageName == "flightRandConfig") {
156 + _this.dateLevelData({
157 + dateParmas: this.dateParmas,
158 + noDateParmas: this.noDateParmas,
159 + });
160 + }
161 + },
162 + },
163 + // 【系统日志】DM数据处理
164 + dmLog: {
165 + queryParmas: function () {
166 + if (parmas.pageName == "dmLog") {
167 + _this.getFindByFlightId({
168 + id: parmas.id,
169 + });
170 + }
171 + },
172 + },
173 + };
174 + // 航班配舱设置
175 + queryCondition.flightAllocConfig.queryParmas();
176 + // 航班信息维护
177 + queryCondition.flightInformationMaintenance.queryParmas();
178 + // 航班顺位设置
179 + queryCondition.flightRandConfig.queryParmas();
180 + // 【系统日志】DM数据处理
181 + queryCondition.dmLog.queryParmas();
182 + },
30 // 获取所有数据字典 183 // 获取所有数据字典
31 getAllDictData() { 184 getAllDictData() {
32 allDictData() 185 allDictData()
......