Showing
6 changed files
with
103 additions
and
60 deletions
| ... | @@ -62,15 +62,12 @@ export function updateOrAddFlight(form) { | ... | @@ -62,15 +62,12 @@ export function updateOrAddFlight(form) { |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | //删除规则 | 64 | //删除规则 |
| 65 | -export function delFlightId(id) { | 65 | +export function delFlightId(data) { |
| 66 | - const data = { | ||
| 67 | - id | ||
| 68 | - } | ||
| 69 | return request({ | 66 | return request({ |
| 70 | - url: '/destinationFlight/delFlightId', | 67 | + url: "/destinationFlight/delFlightId", |
| 71 | - method: 'post', | 68 | + method: "post", |
| 72 | - data: data | 69 | + data: data, |
| 73 | - }) | 70 | + }); |
| 74 | } | 71 | } |
| 75 | 72 | ||
| 76 | //启用/停止规则 | 73 | //启用/停止规则 | ... | ... |
| ... | @@ -10,18 +10,18 @@ | ... | @@ -10,18 +10,18 @@ |
| 10 | <div | 10 | <div |
| 11 | class="collapse-item-header" | 11 | class="collapse-item-header" |
| 12 | v-for="(item, index) in routesInfo" | 12 | v-for="(item, index) in routesInfo" |
| 13 | - :key="item.route" | 13 | + :key="item.route || item.flightRoute" |
| 14 | > | 14 | > |
| 15 | <el-collapse-item :name="index" v-if="showFlightRoute(item)"> | 15 | <el-collapse-item :name="index" v-if="showFlightRoute(item)"> |
| 16 | <!-- 航线名 --> | 16 | <!-- 航线名 --> |
| 17 | <template slot="title"> | 17 | <template slot="title"> |
| 18 | - <strong>{{ item.route }}</strong> | 18 | + <strong>{{ item.route || item.flightRoute }}</strong> |
| 19 | </template> | 19 | </template> |
| 20 | <!-- 航线设置信息 --> | 20 | <!-- 航线设置信息 --> |
| 21 | <div class="route-info info-item"> | 21 | <div class="route-info info-item"> |
| 22 | <el-card class="route-info-card"> | 22 | <el-card class="route-info-card"> |
| 23 | <!-- 有数据时 --> | 23 | <!-- 有数据时 --> |
| 24 | - <section v-if="item.config"> | 24 | + <section v-if="item.config || item.flightRoute"> |
| 25 | <div slot="header" class="route-config-header"> | 25 | <div slot="header" class="route-config-header"> |
| 26 | <el-button | 26 | <el-button |
| 27 | type="primary" | 27 | type="primary" | ... | ... |
| ... | @@ -278,7 +278,8 @@ export default { | ... | @@ -278,7 +278,8 @@ export default { |
| 278 | this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据 | 278 | this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据 |
| 279 | }, | 279 | }, |
| 280 | // 保存 | 280 | // 保存 |
| 281 | - saveSubmit(item) { | 281 | + saveSubmit(item, index) { |
| 282 | + item.flightRoute = item.route; | ||
| 282 | let parmas = JSON.parse(JSON.stringify(item)); | 283 | let parmas = JSON.parse(JSON.stringify(item)); |
| 283 | this.returnString(parmas, "cargoType"); | 284 | this.returnString(parmas, "cargoType"); |
| 284 | this.returnString(parmas, "typeOfGoods"); | 285 | this.returnString(parmas, "typeOfGoods"); |
| ... | @@ -339,7 +340,16 @@ export default { | ... | @@ -339,7 +340,16 @@ export default { |
| 339 | .then((res) => { | 340 | .then((res) => { |
| 340 | const { code, msg, data } = res; | 341 | const { code, msg, data } = res; |
| 341 | if (code == 200) { | 342 | if (code == 200) { |
| 342 | - this.$forceUpdate(); | 343 | + this.hasOwnProperty(data, "typeOfGoods"); |
| 344 | + this.hasOwnProperty(data, "puporpuxCode"); | ||
| 345 | + this.hasOwnProperty(data, "serviceCode"); | ||
| 346 | + this.hasOwnProperty(data, "handlingCode"); | ||
| 347 | + this.hasOwnProperty(data, "subCategory"); | ||
| 348 | + this.setattrVal(data); // 设置属性值 | ||
| 349 | + this.$set(this.routesInfo, index, { | ||
| 350 | + config: true, | ||
| 351 | + ...data, | ||
| 352 | + }); | ||
| 343 | this.msgSuccess("保存成功!"); | 353 | this.msgSuccess("保存成功!"); |
| 344 | } else { | 354 | } else { |
| 345 | this.msgWarning(msg); | 355 | this.msgWarning(msg); |
| ... | @@ -365,53 +375,70 @@ export default { | ... | @@ -365,53 +375,70 @@ export default { |
| 365 | confirmButtonText: "确定", | 375 | confirmButtonText: "确定", |
| 366 | cancelButtonText: "取消", | 376 | cancelButtonText: "取消", |
| 367 | type: "warning", | 377 | type: "warning", |
| 368 | - }).then(() => { | 378 | + }) |
| 369 | - enableOrDisable(parmas) | 379 | + .then(() => { |
| 370 | - .then((res) => { | 380 | + enableOrDisable(parmas) |
| 371 | - const { code, msg, data } = res; | 381 | + .then((res) => { |
| 372 | - console.log(this.routesInfo); | 382 | + const { code, msg, data } = res; |
| 373 | - console.log(index); | 383 | + if (code == 200) { |
| 374 | - console.log(data); | 384 | + this.hasOwnProperty(data, "typeOfGoods"); |
| 375 | - if (code == 200) { | 385 | + this.hasOwnProperty(data, "puporpuxCode"); |
| 376 | - this.$forceUpdate(); | 386 | + this.hasOwnProperty(data, "serviceCode"); |
| 377 | - this.msgSuccess(tip + "成功"); | 387 | + this.hasOwnProperty(data, "handlingCode"); |
| 378 | - } else { | 388 | + this.hasOwnProperty(data, "subCategory"); |
| 379 | - this.msgWarning(msg); | 389 | + this.setattrVal(data); // 设置属性值 |
| 380 | - } | 390 | + this.$set(this.routesInfo, index, { |
| 381 | - this.loading = false; | 391 | + config: true, |
| 382 | - }) | 392 | + ...data, |
| 383 | - .catch(() => { | 393 | + }); |
| 384 | - this.loading = false; | 394 | + this.msgSuccess(tip + "成功"); |
| 385 | - }); | 395 | + } else { |
| 386 | - }); | 396 | + this.msgWarning(msg); |
| 397 | + } | ||
| 398 | + this.loading = false; | ||
| 399 | + }) | ||
| 400 | + .catch(() => { | ||
| 401 | + this.loading = false; | ||
| 402 | + }); | ||
| 403 | + }) | ||
| 404 | + .catch(() => { | ||
| 405 | + this.loading = false; | ||
| 406 | + }); | ||
| 387 | }, | 407 | }, |
| 388 | // 删除 | 408 | // 删除 |
| 389 | - deleteSubmit(item) { | 409 | + deleteSubmit(item, index) { |
| 390 | this.loading = true; | 410 | this.loading = true; |
| 411 | + let parmas = { | ||
| 412 | + id: item.id, | ||
| 413 | + }; | ||
| 391 | this.$confirm("是否确认删除此航班规则?", "警告", { | 414 | this.$confirm("是否确认删除此航班规则?", "警告", { |
| 392 | confirmButtonText: "确定", | 415 | confirmButtonText: "确定", |
| 393 | cancelButtonText: "取消", | 416 | cancelButtonText: "取消", |
| 394 | showCancelButton: true, | 417 | showCancelButton: true, |
| 395 | type: "warning", | 418 | type: "warning", |
| 396 | - }).then(() => { | 419 | + }) |
| 397 | - delFlightId({ id: item.id }) | 420 | + .then(() => { |
| 398 | - .then((res) => { | 421 | + delFlightId(parmas) |
| 399 | - const { code, msg, data } = res; | 422 | + .then((res) => { |
| 400 | - if (code == 200) { | 423 | + const { code, msg, data } = res; |
| 401 | - console.log(this.routesInfo); | 424 | + if (code == 200) { |
| 402 | - console.log(index); | 425 | + this.$set(this.routesInfo, index, { |
| 403 | - console.log(data); | 426 | + route: item.flightRoute, |
| 404 | - this.$forceUpdate(); | 427 | + config: false, |
| 405 | - this.msgSuccess(msg); | 428 | + }); |
| 406 | - } else { | 429 | + this.msgSuccess(msg); |
| 407 | - this.msgWarning(msg); | 430 | + } else { |
| 408 | - } | 431 | + this.msgWarning(msg); |
| 409 | - this.loading = false; | 432 | + } |
| 410 | - }) | 433 | + this.loading = false; |
| 411 | - .catch(() => { | 434 | + }) |
| 412 | - this.loading = false; | 435 | + .catch(() => { |
| 413 | - }); | 436 | + this.loading = false; |
| 414 | - }); | 437 | + }); |
| 438 | + }) | ||
| 439 | + .catch(() => { | ||
| 440 | + this.loading = false; | ||
| 441 | + }); | ||
| 415 | }, | 442 | }, |
| 416 | }, | 443 | }, |
| 417 | }; | 444 | }; | ... | ... |
| ... | @@ -3,9 +3,17 @@ import { | ... | @@ -3,9 +3,17 @@ import { |
| 3 | findDestinationFltRuleByFlightNo, // 航线维度设置详情 | 3 | findDestinationFltRuleByFlightNo, // 航线维度设置详情 |
| 4 | findByFlightId, // 通过id查询目的航班维度配置详情 | 4 | findByFlightId, // 通过id查询目的航班维度配置详情 |
| 5 | } from "@/api/destinationFlight"; | 5 | } from "@/api/destinationFlight"; |
| 6 | -import { routeRuleForm } from "../flightRouteInfo/formConfig"; | 6 | +import { formConfig, routeRuleForm } from "../flightRouteInfo/formConfig"; |
| 7 | import { removeDuplicates } from "@/utils"; | 7 | import { removeDuplicates } from "@/utils"; |
| 8 | export default { | 8 | export default { |
| 9 | + data() { | ||
| 10 | + return { | ||
| 11 | + formConfig: formConfig, // 表单配置项 | ||
| 12 | + queryForm: { | ||
| 13 | + // 表单参数 | ||
| 14 | + }, | ||
| 15 | + }; | ||
| 16 | + }, | ||
| 9 | computed: { | 17 | computed: { |
| 10 | // 获取路由参数 | 18 | // 获取路由参数 |
| 11 | getRouter() { | 19 | getRouter() { |
| ... | @@ -219,7 +227,7 @@ export default { | ... | @@ -219,7 +227,7 @@ export default { |
| 219 | this.setattrVal(item); // 设置属性值 | 227 | this.setattrVal(item); // 设置属性值 |
| 220 | } | 228 | } |
| 221 | }); | 229 | }); |
| 222 | - this.routeList = dateDataLists; // 航班航线列表 | 230 | + this.routeList = dateRouteList; // 航班航线列表 |
| 223 | this.routesInfo = mergeDateRouteInfo; // 航班航线配置信息列表 | 231 | this.routesInfo = mergeDateRouteInfo; // 航班航线配置信息列表 |
| 224 | } | 232 | } |
| 225 | if (dateConfigFlag == false) { | 233 | if (dateConfigFlag == false) { |
| ... | @@ -269,7 +277,7 @@ export default { | ... | @@ -269,7 +277,7 @@ export default { |
| 269 | // White Tail只展示当前查询的一条 | 277 | // White Tail只展示当前查询的一条 |
| 270 | const route = this.$route.query.flightRouteListStr; | 278 | const route = this.$route.query.flightRouteListStr; |
| 271 | let noDateRouteInfo, result; | 279 | let noDateRouteInfo, result; |
| 272 | - this.routeList = noDateRouteLists; | 280 | + this.routeList = dateRouteList; |
| 273 | // 从日期取 | 281 | // 从日期取 |
| 274 | if (dateListHas.length) { | 282 | if (dateListHas.length) { |
| 275 | const dateRouteInfo = dateListHas.filter( | 283 | const dateRouteInfo = dateListHas.filter( |
| ... | @@ -325,8 +333,19 @@ export default { | ... | @@ -325,8 +333,19 @@ export default { |
| 325 | this.setattrVal(item); // 设置属性值 | 333 | this.setattrVal(item); // 设置属性值 |
| 326 | } | 334 | } |
| 327 | }); | 335 | }); |
| 328 | - this.routeList = dateDataLists; | 336 | + this.routeList = dateRouteList; |
| 329 | this.routesInfo = dateList; | 337 | this.routesInfo = dateList; |
| 338 | + if (this.$route.query.flightKindName == "Purple Tail") { | ||
| 339 | + let flightRouteListStr = []; | ||
| 340 | + dateDataLists.map((item, i, arr) => { | ||
| 341 | + if (arr[i].etesRule == "Y") { | ||
| 342 | + flightRouteListStr.push(`${arr[i].route}(ET86)`); | ||
| 343 | + } else { | ||
| 344 | + flightRouteListStr.push(arr[i].route); | ||
| 345 | + } | ||
| 346 | + }); | ||
| 347 | + this.queryForm.flightRouteListStr = flightRouteListStr.join(";"); | ||
| 348 | + } | ||
| 330 | } | 349 | } |
| 331 | }, | 350 | }, |
| 332 | // 整合飞行航线配置信息 | 351 | // 整合飞行航线配置信息 | ... | ... |
| ... | @@ -379,7 +379,7 @@ | ... | @@ -379,7 +379,7 @@ |
| 379 | > | 379 | > |
| 380 | <span style="float: left">{{ item.route }}</span> | 380 | <span style="float: left">{{ item.route }}</span> |
| 381 | <span style="float: right; color: #8492a6; font-size: 13px">{{ | 381 | <span style="float: right; color: #8492a6; font-size: 13px">{{ |
| 382 | - item.isEtesRoute == 'Y' ? '【ET86】航线' : '' | 382 | + item.isEtesRoute == 'Y' ? '(ET86)' : '' |
| 383 | }}</span> | 383 | }}</span> |
| 384 | </el-option> | 384 | </el-option> |
| 385 | </el-select> | 385 | </el-select> |
| ... | @@ -405,7 +405,7 @@ | ... | @@ -405,7 +405,7 @@ |
| 405 | > | 405 | > |
| 406 | <span style="float: left">{{ item.route }}</span> | 406 | <span style="float: left">{{ item.route }}</span> |
| 407 | <span style="float: right; color: #8492a6; font-size: 13px">{{ | 407 | <span style="float: right; color: #8492a6; font-size: 13px">{{ |
| 408 | - item.isEtesRoute == 'Y' ? '【ET86】航线' : '' | 408 | + item.isEtesRoute == 'Y' ? '(ET86)' : '' |
| 409 | }}</span> | 409 | }}</span> |
| 410 | </el-option> | 410 | </el-option> |
| 411 | </el-select> | 411 | </el-select> |
| ... | @@ -1316,7 +1316,7 @@ export default { | ... | @@ -1316,7 +1316,7 @@ export default { |
| 1316 | if (routeInfo.isEtesRoute) { | 1316 | if (routeInfo.isEtesRoute) { |
| 1317 | let msg = routeInfo.fltNo + ": " + routeInfo.fltRoute.join(";"); | 1317 | let msg = routeInfo.fltNo + ": " + routeInfo.fltRoute.join(";"); |
| 1318 | this.$alert( | 1318 | this.$alert( |
| 1319 | - `当前${msg}为ET86航线,可在ET86规则设置查看`, | 1319 | + `当前${msg}为ET86航线,不可操作该按钮。可在ET86规则界面维护。`, |
| 1320 | "提示", | 1320 | "提示", |
| 1321 | { | 1321 | { |
| 1322 | confirmButtonText: "关闭", | 1322 | confirmButtonText: "关闭", | ... | ... |
| ... | @@ -4,7 +4,7 @@ export const formConfig = [ | ... | @@ -4,7 +4,7 @@ export const formConfig = [ |
| 4 | type: "Input", | 4 | type: "Input", |
| 5 | name: "searchValue", | 5 | name: "searchValue", |
| 6 | prop: "searchValue", | 6 | prop: "searchValue", |
| 7 | - placeholder: "根据Hscode查询", | 7 | + placeholder: "根据HSCODE查询", |
| 8 | span: 6, | 8 | span: 6, |
| 9 | trigger: "blur", // 事件名 | 9 | trigger: "blur", // 事件名 |
| 10 | }, | 10 | }, | ... | ... |
-
Please register or login to post a comment