shanyunduo.cheng

航班名查询

...@@ -11,7 +11,7 @@ export function findFlightNo(query) { ...@@ -11,7 +11,7 @@ export function findFlightNo(query) {
11 }) 11 })
12 } 12 }
13 13
14 -// id查询目的航班列表 14 +// id查询目的航班
15 export function findByFlightId(id) { 15 export function findByFlightId(id) {
16 const data = { 16 const data = {
17 id 17 id
...@@ -23,6 +23,19 @@ export function findByFlightId(id) { ...@@ -23,6 +23,19 @@ export function findByFlightId(id) {
23 }) 23 })
24 } 24 }
25 25
26 +//航班号查航班
27 +export function findDestinationFltRuleByActualFlight(actualFlight){
28 + const data = {
29 + actualFlight
30 + }
31 + return request({
32 + url:'/sourceFlight/findDestinationFltRuleByActualFlight',
33 + method:'post',
34 + data:data
35 + })
36 +}
37 +
38 +
26 export function updateOrAddFlight(form){ 39 export function updateOrAddFlight(form){
27 //处理数据 40 //处理数据
28 form.typeOfGoods = form.typeOfGoods.join(';'); 41 form.typeOfGoods = form.typeOfGoods.join(';');
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
13 @keyup.enter.native="getList" 13 @keyup.enter.native="getList"
14 ></el-input> 14 ></el-input>
15 </el-form-item> 15 </el-form-item>
16 + <el-form-item label="状态">
17 + <el-select v-model="queryParams.status" placeholder="状态" clearable >
18 + <el-option label="有效" value="1"></el-option>
19 + <el-option label="停用" value="3"></el-option>
20 + </el-select>
21 + </el-form-item>
16 <el-form-item> 22 <el-form-item>
17 <el-button 23 <el-button
18 type="primary" 24 type="primary"
...@@ -128,6 +134,7 @@ export default { ...@@ -128,6 +134,7 @@ export default {
128 return { 134 return {
129 queryParams: { 135 queryParams: {
130 purposeOfFlightNo: "", 136 purposeOfFlightNo: "",
137 + status:"1",
131 start: 0, 138 start: 0,
132 limit: 10, 139 limit: 10,
133 }, 140 },
...@@ -172,15 +179,15 @@ export default { ...@@ -172,15 +179,15 @@ export default {
172 del(id, status) { 179 del(id, status) {
173 if (status == "1") { 180 if (status == "1") {
174 this.$confirm("航班规则生效中,无法删除,请停用后再操作", "警告", { 181 this.$confirm("航班规则生效中,无法删除,请停用后再操作", "警告", {
175 - confirmButtonText: '确定', 182 + confirmButtonText: "确定",
176 - showCancelButton:false, 183 + showCancelButton: false,
177 type: "warning", 184 type: "warning",
178 }); 185 });
179 } else { 186 } else {
180 this.$confirm("是否确认删除此航班规则?", "警告", { 187 this.$confirm("是否确认删除此航班规则?", "警告", {
181 confirmButtonText: "确定", 188 confirmButtonText: "确定",
182 cancelButtonText: "取消", 189 cancelButtonText: "取消",
183 - showCancelButton:true, 190 + showCancelButton: true,
184 type: "warning", 191 type: "warning",
185 }) 192 })
186 .then(function () { 193 .then(function () {
......
...@@ -221,6 +221,7 @@ import { ...@@ -221,6 +221,7 @@ import {
221 findByFlightId, 221 findByFlightId,
222 updateOrAddFlight, 222 updateOrAddFlight,
223 allDictData, 223 allDictData,
224 + findDestinationFltRuleByActualFlight,
224 } from "@/api/destinationFlight"; 225 } from "@/api/destinationFlight";
225 226
226 export default { 227 export default {
...@@ -307,10 +308,6 @@ export default { ...@@ -307,10 +308,6 @@ export default {
307 }, 308 },
308 }, 309 },
309 created() { 310 created() {
310 - let matched = this.$route.matched.filter(
311 - (item) => item.meta && item.meta.title
312 - );
313 - let routers = this.$router.options.routes;
314 let handle = this.$route.params.handle; 311 let handle = this.$route.params.handle;
315 312
316 allDictData().then((response) => { 313 allDictData().then((response) => {
...@@ -335,6 +332,33 @@ export default { ...@@ -335,6 +332,33 @@ export default {
335 if (handle != "add") { 332 if (handle != "add") {
336 let id = this.$route.params.id; 333 let id = this.$route.params.id;
337 334
335 + if (isNaN(Number(id))) {
336 + findDestinationFltRuleByActualFlight(id).then((response) => {
337 + if (response.code != 200) {
338 + this.$message({
339 + showClose: true,
340 + message: response.msg,
341 + type: "error",
342 + });
343 + reuturn;
344 + }
345 + let info = response.data;
346 + info.typeOfGoods = info.typeOfGoods
347 + ? info.typeOfGoods.split(";")
348 + : [];
349 + info.declarationCategory = info.declarationCategory
350 + ? info.declarationCategory.split(";")
351 + : [];
352 + info.serviceCode = info.serviceCode
353 + ? info.serviceCode.split(";")
354 + : [];
355 + info.subCategory = info.subCategory
356 + ? info.subCategory.split(";")
357 + : [];
358 + this.form = info;
359 + this.loading = false;
360 + });
361 + } else {
338 //货物信息 362 //货物信息
339 findByFlightId(id).then((response) => { 363 findByFlightId(id).then((response) => {
340 if (response.code != 200) { 364 if (response.code != 200) {
...@@ -346,15 +370,22 @@ export default { ...@@ -346,15 +370,22 @@ export default {
346 reuturn; 370 reuturn;
347 } 371 }
348 let info = response.data.list; 372 let info = response.data.list;
349 - info.typeOfGoods = info.typeOfGoods ? info.typeOfGoods.split(";") : []; 373 + info.typeOfGoods = info.typeOfGoods
374 + ? info.typeOfGoods.split(";")
375 + : [];
350 info.declarationCategory = info.declarationCategory 376 info.declarationCategory = info.declarationCategory
351 ? info.declarationCategory.split(";") 377 ? info.declarationCategory.split(";")
352 : []; 378 : [];
353 - info.serviceCode = info.serviceCode ? info.serviceCode.split(";") : []; 379 + info.serviceCode = info.serviceCode
354 - info.subCategory = info.subCategory ? info.subCategory.split(";") : []; 380 + ? info.serviceCode.split(";")
381 + : [];
382 + info.subCategory = info.subCategory
383 + ? info.subCategory.split(";")
384 + : [];
355 this.form = info; 385 this.form = info;
356 this.loading = false; 386 this.loading = false;
357 }); 387 });
388 + }
358 } else { 389 } else {
359 this.loading = false; 390 this.loading = false;
360 } 391 }
......