Elements-SY

modify

...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 <div class="row"> 3 <div class="row">
4 <div class="col-6"> 4 <div class="col-6">
5 <draggable class="list-group" tag="ul" v-model="routeList" v-bind="dragOptions" @start="dragStart" @end="dragEnd"> 5 <draggable class="list-group" tag="ul" v-model="routeList" v-bind="dragOptions" @start="dragStart" @end="dragEnd">
6 - <transition-group type="transition" :name="!drag ? 'flip-list' : null"> 6 + <transition-group type="transition" name="flip-list">
7 <li class="list-group-item" v-for="item in routeList" :key="item.routePriority"> 7 <li class="list-group-item" v-for="item in routeList" :key="item.routePriority">
8 <i :class="item.fixed ? 'fa fa-anchor' : 'glyphicon glyphicon-pushpin' 8 <i :class="item.fixed ? 'fa fa-anchor' : 'glyphicon glyphicon-pushpin'
9 " @click="item.fixed = !item.fixed" aria-hidden="true"></i> 9 " @click="item.fixed = !item.fixed" aria-hidden="true"></i>
......
...@@ -24,30 +24,31 @@ ...@@ -24,30 +24,31 @@
24 <el-button 24 <el-button
25 type="primary" 25 type="primary"
26 size="mini" 26 size="mini"
27 - :disabled="item.status == '3'" 27 + :disabled="item.status == '3' || status"
28 :loading="item.loading" 28 :loading="item.loading"
29 - v-if="item.status == '1'"
30 >保 存</el-button 29 >保 存</el-button
31 > 30 >
32 <el-button 31 <el-button
32 + v-if="showBtnRule(item)"
33 type="primary" 33 type="primary"
34 size="mini" 34 size="mini"
35 icon="el-icon-video-pause" 35 icon="el-icon-video-pause"
36 - :disabled="item.status == '3'"
37 :loading="item.loading" 36 :loading="item.loading"
38 - v-if="item.status == '1' && item.ruleDate" 37 + :disabled="status"
39 - >{{ item.status == '1' ? '停 用' : item.status == '3' ? '启 用' : '停 用'}}</el-button 38 + >{{ item.status | statusBtn }}</el-button
40 > 39 >
41 <el-button 40 <el-button
41 + v-if="showBtnRule(item)"
42 type="danger" 42 type="danger"
43 size="mini" 43 size="mini"
44 icon="el-icon-delete" 44 icon="el-icon-delete"
45 - :disabled="item.disabled" 45 + :disabled="item.status !== '3' || status"
46 :loading="item.loading" 46 :loading="item.loading"
47 - v-if="item.status == '1' && item.ruleDate"
48 >删 除</el-button 47 >删 除</el-button
49 > 48 >
50 - <span class="flight-route-title">普通规则</span> 49 + <span class="flight-route-title">
50 + {{ item.ruleDate ? "日期级别规则" : "普通规则" }}</span
51 + >
51 </div> 52 </div>
52 <el-divider></el-divider> 53 <el-divider></el-divider>
53 <div class="route-config-info"> 54 <div class="route-config-info">
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
59 <el-radio-group 60 <el-radio-group
60 v-model="item.isLocation" 61 v-model="item.isLocation"
61 @change="changeLocation" 62 @change="changeLocation"
63 + :disabled="status"
62 > 64 >
63 <el-radio label="1">包含始发站</el-radio> 65 <el-radio label="1">包含始发站</el-radio>
64 <el-radio label="2">不包含始发站</el-radio> 66 <el-radio label="2">不包含始发站</el-radio>
...@@ -67,6 +69,7 @@ ...@@ -67,6 +69,7 @@
67 <el-col :span="10"> 69 <el-col :span="10">
68 <el-input 70 <el-input
69 v-if="item.isLocation == '1'" 71 v-if="item.isLocation == '1'"
72 + :disabled="status"
70 type="textarea" 73 type="textarea"
71 v-model="item.location" 74 v-model="item.location"
72 :rows="4" 75 :rows="4"
...@@ -76,6 +79,7 @@ ...@@ -76,6 +79,7 @@
76 </el-input> 79 </el-input>
77 <el-input 80 <el-input
78 v-else 81 v-else
82 + :disabled="status"
79 type="textarea" 83 type="textarea"
80 v-model="item.notLocation" 84 v-model="item.notLocation"
81 :rows="4" 85 :rows="4"
...@@ -90,6 +94,7 @@ ...@@ -90,6 +94,7 @@
90 <el-form-item label="目的站"> 94 <el-form-item label="目的站">
91 <el-col :span="2"> 95 <el-col :span="2">
92 <el-radio-group 96 <el-radio-group
97 + :disabled="status"
93 v-model="item.isDestinationSite" 98 v-model="item.isDestinationSite"
94 @change="changeDestinationSite" 99 @change="changeDestinationSite"
95 > 100 >
...@@ -100,6 +105,7 @@ ...@@ -100,6 +105,7 @@
100 <el-col :span="10"> 105 <el-col :span="10">
101 <el-input 106 <el-input
102 v-if="item.isDestinationSite == '1'" 107 v-if="item.isDestinationSite == '1'"
108 + :disabled="status"
103 type="textarea" 109 type="textarea"
104 v-model="item.destinationSite" 110 v-model="item.destinationSite"
105 :rows="4" 111 :rows="4"
...@@ -109,6 +115,7 @@ ...@@ -109,6 +115,7 @@
109 </el-input> 115 </el-input>
110 <el-input 116 <el-input
111 v-else 117 v-else
118 + :disabled="status"
112 type="textarea" 119 type="textarea"
113 v-model="item.notDestinationSite" 120 v-model="item.notDestinationSite"
114 :rows="4" 121 :rows="4"
...@@ -123,6 +130,7 @@ ...@@ -123,6 +130,7 @@
123 <el-col :span="10"> 130 <el-col :span="10">
124 <el-form-item label="URSA包含"> 131 <el-form-item label="URSA包含">
125 <el-input 132 <el-input
133 + :disabled="status"
126 type="textarea" 134 type="textarea"
127 v-model="item.includeUrsa" 135 v-model="item.includeUrsa"
128 :rows="4" 136 :rows="4"
...@@ -134,6 +142,7 @@ ...@@ -134,6 +142,7 @@
134 <el-col :span="10"> 142 <el-col :span="10">
135 <el-form-item label="URSA不包含"> 143 <el-form-item label="URSA不包含">
136 <el-input 144 <el-input
145 + :disabled="status"
137 type="textarea" 146 type="textarea"
138 v-model="item.notIncludeUrsa" 147 v-model="item.notIncludeUrsa"
139 :rows="4" 148 :rows="4"
...@@ -148,6 +157,7 @@ ...@@ -148,6 +157,7 @@
148 <el-form-item label="件数"> 157 <el-form-item label="件数">
149 <el-col :span="10"> 158 <el-col :span="10">
150 <el-input 159 <el-input
160 + :disabled="status"
151 class="numberInput" 161 class="numberInput"
152 v-model.trim="item.minNumOfPieces" 162 v-model.trim="item.minNumOfPieces"
153 > 163 >
...@@ -162,6 +172,7 @@ ...@@ -162,6 +172,7 @@
162 > 172 >
163 <el-col :span="10"> 173 <el-col :span="10">
164 <el-input 174 <el-input
175 + :disabled="status"
165 class="numberInput" 176 class="numberInput"
166 v-model.trim="item.maxNumOfPieces" 177 v-model.trim="item.maxNumOfPieces"
167 > 178 >
...@@ -173,6 +184,7 @@ ...@@ -173,6 +184,7 @@
173 <el-form-item label="重量(KG)"> 184 <el-form-item label="重量(KG)">
174 <el-col :span="10"> 185 <el-col :span="10">
175 <el-input 186 <el-input
187 + :disabled="status"
176 class="numberInput" 188 class="numberInput"
177 v-model.trim="item.minWeight" 189 v-model.trim="item.minWeight"
178 > 190 >
...@@ -187,6 +199,7 @@ ...@@ -187,6 +199,7 @@
187 > 199 >
188 <el-col :span="10"> 200 <el-col :span="10">
189 <el-input 201 <el-input
202 + :disabled="status"
190 class="numberInput" 203 class="numberInput"
191 v-model.trim="item.maxWeight" 204 v-model.trim="item.maxWeight"
192 > 205 >
...@@ -199,6 +212,7 @@ ...@@ -199,6 +212,7 @@
199 <el-form-item label="申报类别"> 212 <el-form-item label="申报类别">
200 <el-card shadow="never" style="width: 95%"> 213 <el-card shadow="never" style="width: 95%">
201 <el-checkbox-group 214 <el-checkbox-group
215 + :disabled="status"
202 v-model="item.typeOfGoods" 216 v-model="item.typeOfGoods"
203 @change="changeCargoType" 217 @change="changeCargoType"
204 > 218 >
...@@ -229,6 +243,7 @@ ...@@ -229,6 +243,7 @@
229 <el-form-item label="货物类型"> 243 <el-form-item label="货物类型">
230 <el-card shadow="never" style="width: 95%"> 244 <el-card shadow="never" style="width: 95%">
231 <el-checkbox-group 245 <el-checkbox-group
246 + :disabled="status"
232 v-model="item.cargoType" 247 v-model="item.cargoType"
233 @change="changeCargoStatus" 248 @change="changeCargoStatus"
234 > 249 >
...@@ -260,6 +275,7 @@ ...@@ -260,6 +275,7 @@
260 <el-form-item label="取件扫描号"> 275 <el-form-item label="取件扫描号">
261 <el-card shadow="never" style="width: 95%"> 276 <el-card shadow="never" style="width: 95%">
262 <el-checkbox-group 277 <el-checkbox-group
278 + :disabled="status"
263 v-model="item.puporpuxCode" 279 v-model="item.puporpuxCode"
264 @change="changePuporpux" 280 @change="changePuporpux"
265 > 281 >
...@@ -290,6 +306,7 @@ ...@@ -290,6 +306,7 @@
290 <el-form-item label="Service Code"> 306 <el-form-item label="Service Code">
291 <el-card shadow="never" style="width: 95%"> 307 <el-card shadow="never" style="width: 95%">
292 <el-checkbox-group 308 <el-checkbox-group
309 + :disabled="status"
293 v-model="item.serviceCode" 310 v-model="item.serviceCode"
294 @change="changeServiceCode" 311 @change="changeServiceCode"
295 > 312 >
...@@ -320,6 +337,7 @@ ...@@ -320,6 +337,7 @@
320 <el-form-item label="Handling Code"> 337 <el-form-item label="Handling Code">
321 <el-card shadow="never" style="width: 95%"> 338 <el-card shadow="never" style="width: 95%">
322 <el-checkbox-group 339 <el-checkbox-group
340 + :disabled="status"
323 v-model="item.handlingCode" 341 v-model="item.handlingCode"
324 @change="changeHandlingCode" 342 @change="changeHandlingCode"
325 > 343 >
...@@ -350,6 +368,7 @@ ...@@ -350,6 +368,7 @@
350 <el-form-item label="Sub Category"> 368 <el-form-item label="Sub Category">
351 <el-card shadow="never" style="width: 95%"> 369 <el-card shadow="never" style="width: 95%">
352 <el-checkbox-group 370 <el-checkbox-group
371 + :disabled="status"
353 v-model="item.subCategory" 372 v-model="item.subCategory"
354 @change="changeSubCategory" 373 @change="changeSubCategory"
355 > 374 >
...@@ -436,6 +455,11 @@ export default { ...@@ -436,6 +455,11 @@ export default {
436 type: Array, 455 type: Array,
437 default: () => [], 456 default: () => [],
438 }, 457 },
458 + status: {
459 + // 标识是详情还是编辑
460 + type: Boolean,
461 + default: false,
462 + },
439 }, 463 },
440 data() { 464 data() {
441 return { 465 return {
...@@ -444,12 +468,46 @@ export default { ...@@ -444,12 +468,46 @@ export default {
444 }, 468 },
445 computed: {}, 469 computed: {},
446 filters: { 470 filters: {
447 - statusBtn(status){ 471 + // 状态:0 无效,1 有效 2 配置中 3 停用
448 - 472 + statusBtn(status) {
473 + // console.log(this)
474 + if (status == "0") {
475 + return "无 效";
476 + } else if (status == "1") {
477 + return "停 用";
478 + } else if (status == "3") {
479 + return "开 启";
480 + } else {
481 + return "保 存";
482 + }
449 }, 483 },
450 }, 484 },
451 mounted() {}, 485 mounted() {},
452 methods: { 486 methods: {
487 + showBtnRule(item) {
488 + /*
489 + 展示保存按钮、开启按钮/停用按钮、删除按钮逻辑如下:
490 + 1:当status状态等于3的时候展示:保存按钮、开启按钮/停用按钮、删除按钮;
491 + 2:当status状态等于1并且ruleDate字段有值的时候展示:保存按钮、开启按钮/停用按钮、删除按钮;
492 + 3:当从航班配置设置不查询日期的时候“查看&修改”的时候,
493 + 有效的航线也就是status状态等于1的时候也要展示:保存按钮、开启按钮/停用按钮、删除按钮;
494 + 4:那么问题来了当从航班配置设置不查询日期的时候状态为1的时候也要展示:保存按钮、开启按钮/停用按钮、删除按钮;
495 + 那么要么跳转的时候传过来一个参数;
496 + 5:如果是从【航班顺位】和【DM数据处理】跳转过来,那么航班航线设置维度只作为详情查看,禁用所有的操作。
497 + 所以展示不展示保存按钮、开启按钮/停用按钮、删除按钮毫无意义
498 + */
499 + if (item.status == "3" || (item.status == "1" && item.ruleDate)) {
500 + return true;
501 + } else if (item.status == "1" && item.remark) {
502 + // 航班配舱设置非日期级别情况下
503 + return true;
504 + } else if (item.status == "2") {
505 + // 航班配舱设置非日期级别情况下
506 + return true;
507 + } else {
508 + return false;
509 + }
510 + },
453 // 当前激活面板改变时触发 511 // 当前激活面板改变时触发
454 collapseChange(name) { 512 collapseChange(name) {
455 this.$emit("collapse", name); 513 this.$emit("collapse", name);
......
...@@ -22,8 +22,8 @@ export const formConfig = [ ...@@ -22,8 +22,8 @@ export const formConfig = [
22 { 22 {
23 label: "航线", 23 label: "航线",
24 type: "Input", 24 type: "Input",
25 - name: "flightRoute", 25 + name: "flightRouteListStr",
26 - prop: "flightRoute", 26 + prop: "flightRouteListStr",
27 placeholder: "", 27 placeholder: "",
28 span: 5, 28 span: 5,
29 labelWidth: "40px", 29 labelWidth: "40px",
...@@ -43,6 +43,7 @@ export const formConfig = [ ...@@ -43,6 +43,7 @@ export const formConfig = [
43 // 航线规则表单 43 // 航线规则表单
44 export const routeRuleForm = { 44 export const routeRuleForm = {
45 config: true, 45 config: true,
46 + remark: true,
46 flightRoute: "", // 飞行航线 47 flightRoute: "", // 飞行航线
47 location: null, // 包含始发站 48 location: null, // 包含始发站
48 notLocation: null, // 不包含始发站 49 notLocation: null, // 不包含始发站
......
...@@ -147,27 +147,15 @@ export default { ...@@ -147,27 +147,15 @@ export default {
147 this.$router.push({ 147 this.$router.push({
148 path: "/routeInfo", 148 path: "/routeInfo",
149 query: { 149 query: {
150 - purposeOfFlightNo: purposeOfFlightNo,
151 flightDate: ruleDate, 150 flightDate: ruleDate,
152 - flightRoute: flightRoute, 151 + purposeOfFlightNo: purposeOfFlightNo,
152 + flightRouteListStr: flightRoute,
153 status: status, 153 status: status,
154 - name: name, 154 + pageName: "flightAllocConfig",
155 + dataStatus: name,
156 + querySpecifyData: this.queryParams.querySpecifyData
155 }, 157 },
156 }); 158 });
157 - // let obj = {
158 - // id: ' ',
159 - // handle: handle,
160 - // fltNo: fltNo,
161 - // fltDate: fltDate != null ? fltDate : ' ',
162 - // route: ' ',
163 - // routeStatus: 'FlightAllocConfig',
164 - // status: status == '3' ? '3' : ' ',
165 - // createStatus: 1
166 - // }
167 - // this.$router.push({
168 - // name: "FlightAllocConfigInfo",
169 - // params: obj,
170 - // });
171 }, 159 },
172 //航班优先级修改 160 //航班优先级修改
173 toRouteOrder(val) { 161 toRouteOrder(val) {
......
1 +export default {
2 + computed: {
3 + // 获取路由参数
4 + getRouter() {
5 + if (this.$route.query.dataStatus == "view") {
6 + return true;
7 + } else if (this.$route.query.dataStatus == "edit") {
8 + return false;
9 + } else {
10 + return false;
11 + }
12 + },
13 + },
14 + methods: {
15 + // 获取所有数据字典
16 + getAllDictData() {
17 + allDictData()
18 + .then((res) => {
19 + if (res.code != 200) {
20 + this.msgError(res.msg);
21 + return;
22 + }
23 + // 给checkBox表单赋值做展示信息
24 + const { data } = res;
25 + this.cargoType = data.cargoType; // 申报类别
26 + this.cargoStatus = data.cargoStatus; // 货物类型
27 + this.puporpux = data.puporpux; // 取件扫描号
28 + this.serviceCode = data.serviceCode; // Service Code
29 + this.handlingCode = data.handlingCode; // Handling Code
30 + this.subCategory = data.subCategory; // Sub Category
31 + })
32 + .catch(() => {});
33 + },
34 + // 判断对象是否存在某个属性,并且把这个属性值使用分号分隔
35 + hasOwnProperty(item, key) {
36 + if (item.hasOwnProperty(key)) {
37 + if (item[key]) {
38 + item[key] = item[key].split(";");
39 + } else {
40 + item[key] = [];
41 + }
42 + }
43 + },
44 + // 设置属性值
45 + setattrVal(item) {
46 + if (item.location) {
47 + // 始发站
48 + item.isLocation = "1";
49 + }
50 + if (item.notLocation) {
51 + item.isLocation = "2";
52 + }
53 + if (item.location == null && item.notLocation == null) {
54 + item.isLocation = "1";
55 + }
56 + if (item.destinationSite) {
57 + // 目的站
58 + item.isDestinationSite = "1";
59 + }
60 + if (item.notDestinationSite) {
61 + item.isDestinationSite = "2";
62 + }
63 + if (item.destinationSite == null && item.notDestinationSite == null) {
64 + item.isDestinationSite = "1";
65 + }
66 + },
67 + // 失焦事件
68 + blurEvent({ originOfFlightNo }) {
69 + this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
70 + },
71 + // 当前激活面板改变时触发
72 + collapseChange(name) {
73 + // console.log(name);
74 + },
75 + // 始发站
76 + changeLocation(val) {
77 + console.log("始发站:", val);
78 + },
79 + // 目的站
80 + changeDestinationSite(val) {
81 + console.log("目的站:", val);
82 + },
83 + // 申报类别
84 + changeCargoType(arr) {
85 + console.log("申报类别:", arr);
86 + },
87 + // 货物类型
88 + changeCargoStatus(arr) {
89 + console.log("货物类型:", arr);
90 + },
91 + // 取件扫描号
92 + changePuporpux(arr) {
93 + console.log("取件扫描号:", arr);
94 + },
95 + // Service Code
96 + changeServiceCode(arr) {
97 + console.log("Service Code:", arr);
98 + },
99 + // Handling Code
100 + changeHandlingCode(arr) {
101 + console.log("Handling Code:", arr);
102 + },
103 + // Sub Category
104 + changeSubCategory(arr) {
105 + console.log("Sub Category:", arr);
106 + },
107 + },
108 +};
...@@ -3,9 +3,18 @@ ...@@ -3,9 +3,18 @@
3 <!-- 航线设置规则信息查询条件 --> 3 <!-- 航线设置规则信息查询条件 -->
4 <el-row style="padding: 0 50px"> 4 <el-row style="padding: 0 50px">
5 <el-col> 5 <el-col>
6 - <yl-form ref="ruleForm" :formConfig="formConfig" :queryForm="queryForm" :inline="false" formWidth="auto" 6 + <yl-form
7 - @blur="blurEvent"> 7 + ref="ruleForm"
8 - <yl-draggable :routeList="routeList" :dragOptions="dragOptions"></yl-draggable> 8 + :formConfig="formConfig"
9 + :queryForm="queryForm"
10 + :inline="false"
11 + formWidth="auto"
12 + @blur="blurEvent"
13 + >
14 + <yl-draggable
15 + :routeList="routeList"
16 + :dragOptions="dragOptions"
17 + ></yl-draggable>
9 </yl-form> 18 </yl-form>
10 </el-col> 19 </el-col>
11 </el-row> 20 </el-row>
...@@ -15,11 +24,26 @@ ...@@ -15,11 +24,26 @@
15 <el-divider content-position="left">航线维度设置</el-divider> 24 <el-divider content-position="left">航线维度设置</el-divider>
16 </el-col> 25 </el-col>
17 <el-col> 26 <el-col>
18 - <route-info :routesInfo="routesInfo" :cargoType="cargoType" :cargoStatus="cargoStatus" :puporpux="puporpux" 27 + <route-info
19 - :serviceCode="serviceCode" :handlingCode="handlingCode" :subCategory="subCategory" @collapse="collapseChange" 28 + :routesInfo="routesInfo"
20 - @location="changeLocation" @destinationSite="changeDestinationSite" @cargoType="changeCargoType" 29 + :cargoType="cargoType"
21 - @cargoStatus="changeCargoStatus" @puporpux="changePuporpux" @serviceCode="changeServiceCode" 30 + :cargoStatus="cargoStatus"
22 - @handlingCode="changeHandlingCode" @subCategory="changeSubCategory" @addRlue="addRlue"> 31 + :puporpux="puporpux"
32 + :serviceCode="serviceCode"
33 + :handlingCode="handlingCode"
34 + :subCategory="subCategory"
35 + :status="getRouter"
36 + @collapse="collapseChange"
37 + @location="changeLocation"
38 + @destinationSite="changeDestinationSite"
39 + @cargoType="changeCargoType"
40 + @cargoStatus="changeCargoStatus"
41 + @puporpux="changePuporpux"
42 + @serviceCode="changeServiceCode"
43 + @handlingCode="changeHandlingCode"
44 + @subCategory="changeSubCategory"
45 + @addRlue="addRlue"
46 + >
23 </route-info> 47 </route-info>
24 </el-col> 48 </el-col>
25 </el-row> 49 </el-row>
...@@ -41,6 +65,7 @@ import { ...@@ -41,6 +65,7 @@ import {
41 batchUpdateOrAddFlight, // 更新航线优先级 65 batchUpdateOrAddFlight, // 更新航线优先级
42 queryRouteByFltNo, // 通过航班号查询航线 66 queryRouteByFltNo, // 通过航班号查询航线
43 } from "@/api/destinationFlight"; 67 } from "@/api/destinationFlight";
68 +import indexMixins from "./mixins";
44 import { routeData, routeInfo } from "./routeData"; 69 import { routeData, routeInfo } from "./routeData";
45 export default { 70 export default {
46 components: { 71 components: {
...@@ -48,13 +73,15 @@ export default { ...@@ -48,13 +73,15 @@ export default {
48 RouteInfo, 73 RouteInfo,
49 YlDraggable, 74 YlDraggable,
50 }, 75 },
76 + mixins: [indexMixins],
51 data() { 77 data() {
52 return { 78 return {
53 - dragOptions: { // 航线优先级拖拽配置 79 + dragOptions: {
80 + // 航线优先级拖拽配置
54 animation: 200, 81 animation: 200,
55 group: "description", 82 group: "description",
56 disabled: false, // 是否禁止拖拽 83 disabled: false, // 是否禁止拖拽
57 - ghostClass: "ghost" 84 + ghostClass: "ghost",
58 }, 85 },
59 formConfig: formConfig, // 表单配置项 86 formConfig: formConfig, // 表单配置项
60 queryForm: { 87 queryForm: {
...@@ -70,52 +97,99 @@ export default { ...@@ -70,52 +97,99 @@ export default {
70 subCategory: [], // Sub Category 97 subCategory: [], // Sub Category
71 }; 98 };
72 }, 99 },
73 - computed: {}, 100 + /*
101 + 判断有日期的找到了就走有日期的,如果日期级别的没有找到再去走一次普通级别的接口
102 + */
74 created() { 103 created() {
75 this.getAllDictData(); // 获取全部字典 104 this.getAllDictData(); // 获取全部字典
76 - // 查询 & 修改时 105 + // 航班配舱维度规则设置查询条件
77 - if (this.$route.query.name == "view" || this.$route.query.name == "edit") { 106 + let queryCondition = {
78 - this.queryForm = this.$route.query; 107 + // 航班配舱设置
79 - let parmas = { 108 + flightAllocConfig: {
80 - flightDate: this.$route.query.flightDate, // 航班日期 109 + queryParmas: () => {
81 - flightRoute: "", // 航线 110 + // 非日期级别
82 - flightRouteListStr: "", // 111 + if (this.$route.query.querySpecifyData == "2") {
83 - purposeOfFlightNo: this.$route.query.purposeOfFlightNo, // 原航班号 112 + let noDateParmas = {
84 - status: "", // 113 + flightDate: "",
85 - }; 114 + flightRoute: "",
86 - // 日期级别 115 + purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
87 - if (this.$route.query.flightDate) { 116 + status: "",
88 - // delete parmas.flightRouteListStr; 117 + };
89 - this.getFlightRouteConfigInfoDetail(parmas); 118 + this.noDateLevelRoute(noDateParmas);
90 - } else { 119 + }
91 - // 普通级别 120 + // 日期级别
92 - this.getFlightRouteConfigInfoDetail(parmas); 121 + if (this.$route.query.querySpecifyData == "1") {
93 - } 122 + let dateParmas = {
94 - } 123 + flightDate: this.$route.query.flightDate,
124 + flightRoute: "",
125 + flightRouteListStr: "",
126 + purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
127 + status: "",
128 + };
129 + this.dateLevelRoute(dateParmas);
130 + }
131 + },
132 + },
133 + // 航班信息维护
134 + flightInformationMaintenance: {
135 + queryParmas: () => {
136 + // White Tail
137 + if (this.$route.query.flightKindName == "White Tail") {
138 + let noDateParmas = {
139 + purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
140 + flightRouteListStr: this.$route.query.flightRouteListStr,
141 + status: "",
142 + };
143 + this.noDateLevelRoute(noDateParmas);
144 + }
145 + // Purple Tail
146 + if (this.$route.query.flightKindName == "Purple Tail") {
147 + let dateParmas = {
148 + purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
149 + flightDate: this.$route.query.flightDate,
150 + flightRouteListStr: this.$route.query.flightRouteListStr,
151 + status: "",
152 + };
153 + this.dateLevelRoute(dateParmas);
154 + }
155 + },
156 + },
157 + // 航班顺位设置
158 + flightRandConfig: {
159 + queryParmas: () => {
160 + // 普通级别
161 + if (this.$route.query.pageName == "flightRandConfig") {
162 + let noDateParmas = {
163 + flightDate: this.$route.query.flightDate,
164 + flightRoute: "",
165 + purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
166 + status: "",
167 + };
168 + // 日期级别
169 + let dateParmas = {
170 + flightRoute: "",
171 + flightRouteListStr: "",
172 + purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
173 + status: "",
174 + };
175 + this.noDateLevelRoute(noDateParmas);
176 + this.dateLevelRoute(dateParmas);
177 + }
178 + },
179 + },
180 + };
181 +
182 + // 航班配舱设置
183 + queryCondition.flightAllocConfig.queryParmas();
184 + // 航班信息维护
185 + queryCondition.flightInformationMaintenance.queryParmas();
186 + // 航班顺位设置
187 + queryCondition.flightRandConfig.queryParmas();
95 }, 188 },
96 - mounted() { }, 189 + mounted() {},
97 methods: { 190 methods: {
98 - // 获取所有数据字典 191 + // 普通级别的
99 - getAllDictData() { 192 + noDateLevelRoute(parmas) {
100 - allDictData()
101 - .then((res) => {
102 - if (res.code != 200) {
103 - this.msgError(res.msg);
104 - return;
105 - }
106 - // 给checkBox表单赋值做展示信息
107 - const { data } = res;
108 - this.cargoType = data.cargoType; // 申报类别
109 - this.cargoStatus = data.cargoStatus; // 货物类型
110 - this.puporpux = data.puporpux; // 取件扫描号
111 - this.serviceCode = data.serviceCode; // Service Code
112 - this.handlingCode = data.handlingCode; // Handling Code
113 - this.subCategory = data.subCategory; // Sub Category
114 - })
115 - .catch(() => { });
116 - },
117 - // 航线维度设置详情
118 - getFlightRouteConfigInfoDetail(parmas) {
119 findDestinationFltRuleByFlightNo(parmas) 193 findDestinationFltRuleByFlightNo(parmas)
120 .then((res) => { 194 .then((res) => {
121 const { code, data, msg } = res; 195 const { code, data, msg } = res;
...@@ -123,162 +197,116 @@ export default { ...@@ -123,162 +197,116 @@ export default {
123 this.msgError(msg); 197 this.msgError(msg);
124 return; 198 return;
125 } 199 }
126 - let routeList1 = data.routeList; // 航班航线基本信息 200 + let routeList = data.routeList; // 航班航线基本信息
127 - this.routeList = data.routeList; 201 + // 普通级别航班航线维度规则详情
128 - let { flightDate } = parmas; 202 + const dataList = removeDuplicates(data.list, {
129 - /* 203 + duplicate: "flightRoute", // 去重字段
130 - 如果是日期级别的再做一次没有日期的查询 204 + sort: false, // 是否要排序
131 - 日期级别规则:航线取自己的,但是航线数据如果有取自己的,没有则去拿普通规则的; 205 + sortType: "Number", // 排序类型
132 - */ 206 + sortAttr: "routePriority", // 排序字段
133 - if (flightDate) { 207 + });
134 - parmas.flightDate = ""; 208 + // 【日期规则】
135 - findDestinationFltRuleByFlightNo(parmas) 209 + const dateFlightRoute = routeList.map((item1) => {
136 - .then((response) => { 210 + const item2 = dataList.unique.find((item2) => {
137 - if (response.code != 200) { 211 + if (item2.flightRoute === item1.route) {
138 - this.msgError(response.msg); 212 + item2.config = true;
139 - return; 213 + return item2;
140 - } 214 + }
141 - let routeList2 = response.data.routeList; // 航班航线基本信息 215 + }); // 返回当前相等的一条数据
142 - // 日期级别航班航线维度规则详情 216 + if (item2) {
143 - const dataList1 = removeDuplicates(data.list, { 217 + // 有数据的合并对象,
144 - duplicate: "flightRoute", // 去重字段 218 + return { ...item1, ...item2 };
145 - sort: false, // 是否要排序 219 + } else {
146 - sortType: "Number", // 排序类型 220 + // 没有数据的去普通航线里查找
147 - sortAttr: "routePriority", // 排序字段 221 + const item = dataList.unique.find((item) => {
148 - }); 222 + if (item.flightRoute === item1.route) {
149 - // 普通级别航班航线维度规则详情 223 + item.config = true;
150 - const dataList2 = removeDuplicates(response.data.list, { 224 + return item;
151 - duplicate: "flightRoute", // 去重字段 225 + }
152 - sort: false, // 是否要排序 226 + });
153 - sortType: "Number", // 排序类型 227 + if (item) {
154 - sortAttr: "routePriority", // 排序字段 228 + return { ...item1, ...item }; // 有数据的合并对象,
155 - }); 229 + } else {
156 - // 【日期规则】 230 + item1.config = false;
157 - const dateFlightRoute = routeList1.map((item1) => { 231 + return item1; // 没有的返回当前的
158 - const item2 = dataList1.unique.find((item2) => { 232 + }
159 - if (item2.flightRoute === item1.route) { 233 + }
160 - item2.config = true; 234 + });
161 - return item2; 235 + // 处理属性
162 - } 236 + dateFlightRoute.map((item) => {
163 - }); // 返回当前相等的一条数据 237 + if (item.config) {
164 - if (item2) { 238 + this.hasOwnProperty(item, "typeOfGoods");
165 - // 有数据的合并对象, 239 + this.hasOwnProperty(item, "puporpuxCode");
166 - return { ...item1, ...item2 }; 240 + this.hasOwnProperty(item, "serviceCode");
167 - } else { 241 + this.hasOwnProperty(item, "handlingCode");
168 - // 没有数据的去普通航线里查找 242 + this.hasOwnProperty(item, "subCategory");
169 - const item = dataList2.unique.find((item) => { 243 + this.setattrVal(item); // 设置属性值
170 - if (item.flightRoute === item1.route) { 244 + }
171 - item.config = true; 245 + });
172 - return item; 246 + this.routesInfo = dateFlightRoute;
173 - }
174 - });
175 - if (item) {
176 - return { ...item1, ...item }; // 有数据的合并对象,
177 - } else {
178 - item1.config = false;
179 - return item1; // 没有的返回当前的
180 - }
181 - }
182 - });
183 - // 处理属性
184 - dateFlightRoute.map((item) => {
185 - if (item.config) {
186 - this.hasOwnProperty(item, "typeOfGoods");
187 - this.hasOwnProperty(item, "puporpuxCode");
188 - this.hasOwnProperty(item, "serviceCode");
189 - this.hasOwnProperty(item, "handlingCode");
190 - this.hasOwnProperty(item, "subCategory");
191 - this.setattrVal(item) // 设置属性值
192 - }
193 - });
194 - this.routesInfo = dateFlightRoute;
195 - })
196 - .catch(() => { });
197 - }
198 }) 247 })
199 - .catch(() => { }); 248 + .catch(() => {});
200 - },
201 - // 判断对象是否存在某个属性,并且把这个属性值使用分号分隔
202 - hasOwnProperty(item, key) {
203 - if (item.hasOwnProperty(key)) {
204 - item[key] = item[key].split(";");
205 - }
206 - },
207 - // 设置属性值
208 - setattrVal(item) {
209 - if (item.location) {
210 - // 始发站
211 - item.isLocation = "1";
212 - }
213 - if (item.notLocation) {
214 - item.isLocation = "2";
215 - }
216 - if (item.location == null && item.notLocation == null) {
217 - item.isLocation = "1";
218 - }
219 - if (item.destinationSite) {
220 - // 目的站
221 - item.isDestinationSite = "1";
222 - }
223 - if (item.notDestinationSite) {
224 - item.isDestinationSite = "2";
225 - }
226 - if (
227 - item.destinationSite == null &&
228 - item.notDestinationSite == null
229 - ) {
230 - item.isDestinationSite = "1";
231 - }
232 - },
233 - // 失焦事件
234 - blurEvent({ originOfFlightNo }) {
235 - this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
236 - },
237 - // 当前激活面板改变时触发
238 - collapseChange(name) {
239 - // console.log(name);
240 - },
241 - // 始发站
242 - changeLocation(val) {
243 - console.log("始发站:", val);
244 - },
245 - // 目的站
246 - changeDestinationSite(val) {
247 - console.log("目的站:", val);
248 }, 249 },
249 - // 申报类别 250 + // 日期级别的
250 - changeCargoType(arr) { 251 + dateLevelRoute(parmas) {
251 - console.log("申报类别:", arr); 252 + findDestinationFltRuleByFlightNo(parmas).then((res) => {
252 - }, 253 + const { code, data, msg } = res;
253 - // 货物类型 254 + if (code != 200) {
254 - changeCargoStatus(arr) { 255 + this.msgError(msg);
255 - console.log("货物类型:", arr); 256 + return;
256 - }, 257 + }
257 - // 取件扫描号 258 + let routeList = data.routeList; // 航班航线基本信息
258 - changePuporpux(arr) { 259 + this.routeList = data.routeList;
259 - console.log("取件扫描号:", arr); 260 + // 日期级别航班航线维度规则详情
260 - }, 261 + const dataList = removeDuplicates(data.list, {
261 - // Service Code 262 + duplicate: "flightRoute", // 去重字段
262 - changeServiceCode(arr) { 263 + sort: false, // 是否要排序
263 - console.log("Service Code:", arr); 264 + sortType: "Number", // 排序类型
264 - }, 265 + sortAttr: "routePriority", // 排序字段
265 - // Handling Code 266 + });
266 - changeHandlingCode(arr) { 267 + let config = false; // 有缺省的航线配置
267 - console.log("Handling Code:", arr); 268 + const dateFlightRoute = routeList.map((item1) => {
268 - }, 269 + const item2 = dataList.unique.find((item2) => {
269 - // Sub Category 270 + if (item2.flightRoute === item1.route) {
270 - changeSubCategory(arr) { 271 + config = item2.config = true;
271 - console.log("Sub Category:", arr); 272 + if (this.$route.query.pageName == "flightAllocConfig") {
273 + item2.remark = true;
274 + } else {
275 + item2.remark = false;
276 + }
277 + return item2;
278 + }
279 + }); // 返回当前相等的一条数据
280 + if (item2) {
281 + return { ...item1, ...item2 };
282 + } else {
283 + config = item1.config = false;
284 + return item1; // 没有的返回当前的
285 + }
286 + });
287 + // 处理属性
288 + dateFlightRoute.map((item) => {
289 + if (item.config) {
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 + });
298 + this.routesInfo = dateFlightRoute;
299 + });
272 }, 300 },
273 // 新增规则 301 // 新增规则
274 addRlue(index) { 302 addRlue(index) {
275 // 如果当前航班号的航线下没有数据给 303 // 如果当前航班号的航线下没有数据给
276 - this.setattrVal(routeRuleForm) 304 + this.setattrVal(routeRuleForm);
277 const mergeObj = { 305 const mergeObj = {
278 ...this.routesInfo[index], 306 ...this.routesInfo[index],
279 - ...routeRuleForm 307 + ...routeRuleForm,
280 }; 308 };
281 - this.$set(this.routesInfo, index, mergeObj) // 给新增规则赋上默认数据 309 + this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据
282 console.log("新增规则:", this.routesInfo); 310 console.log("新增规则:", this.routesInfo);
283 }, 311 },
284 }, 312 },
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
67 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150"> 67 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
68 <template slot-scope="scope"> 68 <template slot-scope="scope">
69 <el-button size="mini" type="text" icon="el-icon-edit" 69 <el-button size="mini" type="text" icon="el-icon-edit"
70 - @click="handleClick(scope.row.actualFlight, 'detail', scope.row.flightDate, ' ', ' ')">查看配置维度 70 + @click="handleClick(scope.row)">查看配置维度
71 </el-button> 71 </el-button>
72 </template> 72 </template>
73 </el-table-column> 73 </el-table-column>
...@@ -275,21 +275,17 @@ export default { ...@@ -275,21 +275,17 @@ export default {
275 }, 275 },
276 methods: { 276 methods: {
277 //跳转到查看,修改页面 277 //跳转到查看,修改页面
278 - handleClick(fltNo, handle, fltDate, route, status) { 278 + handleClick({ actualFlight, flightDate, route }) {
279 this.openFlightDate = false; 279 this.openFlightDate = false;
280 - let obj = {
281 - id: ' ',
282 - handle: handle,
283 - fltNo: fltNo,
284 - fltDate: fltDate != null ? fltDate : ' ',
285 - route: route,
286 - routeStatus: 'FlightRandConfig',
287 - status: status,
288 - createStatus: 1,
289 - }
290 this.$router.push({ 280 this.$router.push({
291 - name: "FlightAllocConfigInfo", 281 + path: "/routeInfo",
292 - params: obj, 282 + query: {
283 + flightDate: flightDate,
284 + purposeOfFlightNo: actualFlight,
285 + flightRouteListStr: route,
286 + status: "",
287 + pageName: "flightRandConfig",
288 + },
293 }); 289 });
294 }, 290 },
295 /** 查询原航班顺位规则*/ 291 /** 查询原航班顺位规则*/
......
...@@ -893,20 +893,68 @@ export default { ...@@ -893,20 +893,68 @@ export default {
893 this.msgError("已删除不可操作"); 893 this.msgError("已删除不可操作");
894 return 894 return
895 } 895 }
896 - let obj = { 896 + /*
897 - id: ' ', 897 + 航班信息维护跳转过来,不管是White Tail还是Purple Tail:
898 - handle: 'updated', 898 + Purple Tail
899 - fltNo: val.fltNo, 899 + {
900 - fltDate: val.fltDate ? val.fltDate : null, 900 + purposeOfFlightNo: "LK002",
901 - route: val.route, 901 + flightDate: "2023-09-27",
902 - routeStatus: 'flightInformationMaintenance' + val.flightKindName, 902 + flightRouteListStr: "PVG;PEK;PVG-PEK",
903 - status: ' ', 903 + status: ""
904 - createStatus: 1, 904 + }
905 - } 905 + White Tail
906 - this.$router.push({ 906 + {
907 - name: 'FlightAllocConfigInfo', 907 + purposeOfFlightNo: "LK002",
908 - params: obj 908 + flightRouteListStr: "PVG;PEK;PVG-PEK",
909 - }) 909 + status: ""
910 + }
911 + 航班配舱设置:
912 + 非日期级别
913 + {
914 + flightDate: ""
915 + flightRoute: ""
916 + purposeOfFlightNo: "A381"
917 + status: ""
918 + }
919 + 有日期级别
920 + {
921 + flightDate: ""
922 + flightRoute: ""
923 + purposeOfFlightNo: "A381"
924 + status: ""
925 + }
926 + {
927 + flightDate: "2023-09-21"
928 + flightRoute: ""
929 + flightRouteListStr: "",
930 + purposeOfFlightNo: "A381"
931 + status: ""
932 + }
933 + 航班顺位
934 + {
935 + flightDate: "2023-07-01"
936 + flightRoute: ""
937 + purposeOfFlightNo: "LP003"
938 + status: ""
939 + }
940 + {
941 + flightRoute: ""
942 + flightRouteListStr: "",
943 + purposeOfFlightNo: "LP003"
944 + status: ""
945 + }
946 + */
947 + this.$router.push({
948 + path: "/routeInfo",
949 + query: {
950 + flightDate: val.fltDate,
951 + purposeOfFlightNo: val.fltNo,
952 + flightRouteListStr: val.route,
953 + status: val.status,
954 + flightKindName: val.flightKindName,
955 + pageName: "flightInformationMaintenance",
956 + },
957 + });
910 }, 958 },
911 // 航班状态 959 // 航班状态
912 flightState(multipleSelection, statusName) { 960 flightState(multipleSelection, statusName) {
......