Elements-SY

modify

......@@ -3,7 +3,7 @@ import request from '@/utils/request'
//查询航班航线
//查询航线
/**
* @param fltNo 航班号
* @param fltNo 航班号
*/
export function queryRouteByFltNo(data) {
return request({
......@@ -17,7 +17,7 @@ export function queryRouteByFltNo(data) {
/**
* @param purposeOfFlightNo 航班号
* @param flightDate 航班日期
* @param status 状态
* @param status 状态
* @param start 开始位置 *
* @param limit 每页长度 *
*/
......@@ -121,15 +121,12 @@ export function saveOrUpdateSpecifyDateRoute(data) {
}
// id查询目的航班
export function findByFlightId(id) {
const data = {
id
}
export function findByFlightId(data) {
return request({
url: '/destinationFlight/findByFlightId',
method: 'post',
data: data
})
url: "/destinationFlight/findByFlightId",
method: "post",
data: data,
});
}
//航班号查航班
......@@ -142,4 +139,4 @@ export function findDestinationFltRuleByActualFlight(actualFlight) {
// method: 'post',
// data: data
// })
}
\ No newline at end of file
}
......
......@@ -2,12 +2,35 @@
<el-card>
<div class="row">
<div class="col-6">
<draggable class="list-group" tag="ul" v-model="routeList" v-bind="dragOptions" @start="dragStart" @end="dragEnd">
<draggable
class="list-group"
tag="ul"
v-model="routeList"
v-bind="dragOptions"
@start="dragStart"
@end="dragEnd"
>
<transition-group type="transition" name="flip-list">
<li class="list-group-item" v-for="item in routeList" :key="item.routePriority">
<i :class="item.fixed ? 'fa fa-anchor' : 'glyphicon glyphicon-pushpin'
" @click="item.fixed = !item.fixed" aria-hidden="true"></i>
{{ item.route }}
<li
class="list-group-item"
v-for="(item, i) in routeList"
:key="item.route"
>
<i
:class="
item.fixed ? 'fa fa-anchor' : 'glyphicon glyphicon-pushpin'
"
@click="item.fixed = !item.fixed"
aria-hidden="true"
></i>
<span v-if="item.isEtesRoute == 'Y' || item.etesRule == 'Y'"
><i class="route-count">{{ ++i }}</i
>{{ item.route }}ET86航线】</span
>
<span v-else
><i class="route-count">{{ ++i }}</i
>{{ item.route }}</span
>
</li>
</transition-group>
</draggable>
......@@ -34,13 +57,13 @@ export default {
animation: 200,
group: "description",
disabled: false,
ghostClass: "ghost"
}
ghostClass: "ghost",
};
},
},
},
components: {
draggable
draggable,
},
data() {
return {};
......@@ -49,12 +72,12 @@ export default {
methods: {
// 排序
sort() {
this.routeList = this.routeList.sort((a, b) => a.routePriority - b.routePriority);
this.routeList = this.routeList.sort(
(a, b) => a.routePriority - b.routePriority
);
},
// 开始拖拽
dragStart() {
},
dragStart() {},
// 结束拖拽
dragEnd() {
this.$emit("dragEnd", this.routeList);
......@@ -62,48 +85,44 @@ export default {
},
};
</script>
<style lang="scss">
.el-card__body {
padding: 15px 10px 0px 10px !important;
}
.list-group {
min-height: 20px;
max-height: 150px;
overflow: auto;
margin-top: 0;
padding: 0;
&::-webkit-scrollbar {
width: 7px;
height: 7px;
}
&::-webkit-scrollbar-track {
background-color: #fff;
}
&::-webkit-scrollbar-thumb {
background-color: #ccc;
border-radius: 20px;
}
&::-webkit-scrollbar-thumb:hover {
background-color: #409eff;
}
&::-webkit-scrollbar-track-piece {
background: #F2F6FC;
background: #f2f6fc;
}
}
.list-group-item {
cursor: move;
padding: 5px 0px;
}
.list-group-item i {
cursor: pointer;
}
.route-count {
font-family: initial;
font-style: inherit;
margin-right: 15px;
}
</style>
......
......@@ -20,221 +20,228 @@
:align="rowAlign"
:tag="rowTag"
>
<el-col
v-for="item in tempFormConfig"
:span="item.span"
:offset="item.offset"
:tag="item.tag"
:push="item.push"
:pull="item.pull"
:xs="item.xs"
:sm="item.sm"
:md="item.md"
:lg="item.lg"
:xl="item.xl"
:style="{ width: item.colWidth }"
:key="item.prop"
>
<el-form-item
:label="item.label"
:prop="item.prop"
:rules="item.rules"
:label-width="item.labelWidth"
<span v-for="item in tempFormConfig" :key="item.name">
<el-col
v-if="!item.hidden"
:span="item.span"
:offset="item.offset"
:tag="item.tag"
:push="item.push"
:pull="item.pull"
:xs="item.xs"
:sm="item.sm"
:md="item.md"
:lg="item.lg"
:xl="item.xl"
:style="{ width: item.colWidth }"
>
<slot v-if="item.type === 'slot'"></slot>
<!-- 输入框 -->
<el-input
v-if="item.type === 'Input'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
"
v-on:[item.trigger]="
(e) => {
inputEvent(e, item);
}
"
@keyup.enter.native="toEnterSearch"
clearable
<el-form-item
:label="item.label"
:prop="item.prop"
:rules="item.rules"
:label-width="item.labelWidth"
>
</el-input>
<template v-if="view">
<span v-text="tempQueryForm[item.prop]"></span>
</template>
<!-- 数字输入框 -->
<el-input
v-if="item.type === 'inputNumber'"
type="number"
:min="item.min"
:max="item.max"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
"
v-on:keyup.enter="value = value.replace(/^-?[0-9]\d*$/, '')"
clearable
>
</el-input>
<!-- InputNumber 计数器 -->
<el-input-number
v-if="item.type === 'Number'"
v-model.trim="tempQueryForm[item.prop]"
:min="0"
:max="10"
:size="item.size"
:style="{ width: item.inputWidth }"
label="描述文字"
></el-input-number>
<template v-if="view">
<span v-text="tempQueryForm[item.prop]"></span>
</template>
<!-- 下拉选择 -->
<el-select
v-if="item.type === 'Select'"
:multiple="item.multiple"
:filterable="item.filterable"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:loading="searchLoading"
:placeholder="
item.placeholder ? item.placeholder : '请选择' + item.label
"
clearable
>
<el-option
v-for="op in item.options.data"
:label="op[item.options.label] || op.label"
:value="op[item.options.value] || op.value"
:key="op[item.options.value] || op.value"
<slot v-if="item.type === 'slot'"></slot>
<!-- 输入框 -->
<el-input
v-if="item.type === 'Input'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
"
v-on:[item.trigger]="
(e) => {
inputEvent(e, item);
}
"
@keyup.enter.native="toEnterSearch"
clearable
>
</el-input>
<template v-if="view">
<span v-text="tempQueryForm[item.prop]"></span>
</template>
<!-- 数字输入框 -->
<el-input
v-if="item.type === 'inputNumber'"
type="number"
:min="item.min"
:max="item.max"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
"
v-on:keyup.enter="value = value.replace(/^-?[0-9]\d*$/, '')"
clearable
>
</el-option>
</el-select>
</el-input>
<!-- InputNumber 计数器 -->
<el-input-number
v-if="item.type === 'Number'"
v-model.trim="tempQueryForm[item.prop]"
:min="0"
:max="10"
:size="item.size"
:style="{ width: item.inputWidth }"
label="描述文字"
></el-input-number>
<!-- 远程搜索 -->
<template v-if="item.type === 'Search'">
<el-autocomplete
<template v-if="view">
<span v-text="tempQueryForm[item.prop]"></span>
</template>
<!-- 下拉选择 -->
<el-select
v-if="item.type === 'Select'"
:multiple="item.multiple"
:filterable="item.filterable"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:debounce="1500"
:fetch-suggestions="querySearchAsync"
:disabled="item.disable"
:loading="searchLoading"
:placeholder="
item.placeholder ? item.placeholder : '请选择' + item.label
"
@focus="focusKey(item)"
@select="selectSearch"
clearable
></el-autocomplete>
</template>
>
<el-option
v-for="op in item.options.data"
:label="op[item.options.label] || op.label"
:value="op[item.options.value] || op.value"
:key="op[item.options.value] || op.value"
>
</el-option>
</el-select>
<!-- 日期 -->
<el-date-picker
v-if="item.type === 'Date'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="item.placeholder ? item.placeholder : '请选择日期'"
:value-format="item.format"
clearable
>
</el-date-picker>
<!-- 远程搜索 -->
<template v-if="item.type === 'Search'">
<el-autocomplete
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:debounce="1500"
:fetch-suggestions="querySearchAsync"
:placeholder="
item.placeholder ? item.placeholder : '请选择' + item.label
"
@focus="focusKey(item)"
@select="selectSearch"
clearable
></el-autocomplete>
</template>
<!-- 时间 -->
<el-time-select
v-if="item.type === 'Time'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="item.placeholder ? item.placeholder : '请选择时间'"
clearable
>
</el-time-select>
<!-- 日期 -->
<el-date-picker
v-if="item.type === 'Date'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请选择日期'
"
:value-format="item.format"
clearable
>
</el-date-picker>
<!-- 日期时间 -->
<el-date-picker
v-if="item.type === 'DateTime'"
type="datetime"
v-model.trim="tempQueryForm[item.prop]"
:disabled="item.disable"
:placeholder="item.placeholder ? item.placeholder : '请选择日期'"
clearable
>
</el-date-picker>
<!-- 时间 -->
<el-time-select
v-if="item.type === 'Time'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请选择时间'
"
clearable
>
</el-time-select>
<!-- 日期范围 -->
<el-date-picker
v-if="item.type === 'datetimerange'"
type="datetimerange"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
>
</el-date-picker>
<!-- 日期时间 -->
<el-date-picker
v-if="item.type === 'DateTime'"
type="datetime"
v-model.trim="tempQueryForm[item.prop]"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请选择日期'
"
clearable
>
</el-date-picker>
<!-- 单选框 普通的样式 Radio 的尺寸,仅在 border 为真时有效-->
<template v-if="item.type === 'radio'">
<el-radio
<!-- 日期范围 -->
<el-date-picker
v-if="item.type === 'datetimerange'"
type="datetimerange"
v-model.trim="tempQueryForm[item.prop]"
v-for="op in item.options.data"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:border="tempQueryForm[item.border]"
:size="tempQueryForm[item.size]"
:label="op[item.options.label] || op.label"
:value="op[item.options.value] || op.value"
:key="op[item.options.value] || op.value"
></el-radio>
</template>
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
>
</el-date-picker>
<!-- 单选框 按钮样式 -->
<el-radio-group
v-if="item.type === 'radioButtom'"
v-model.trim="tempQueryForm[item.prop]"
:size="tempQueryForm[item.size]"
:disabled="item.disable"
>
<el-radio-button
v-for="op in item.options.data"
:label="op[item.options.label] || op.label"
:value="op[item.options.value] || op.value"
:key="op[item.options.value] || op.value"
></el-radio-button>
</el-radio-group>
<!-- 单选框 普通的样式 Radio 的尺寸,仅在 border 为真时有效-->
<template v-if="item.type === 'radio'">
<el-radio
v-model.trim="tempQueryForm[item.prop]"
v-for="op in item.options.data"
:disabled="item.disable"
:border="tempQueryForm[item.border]"
:size="tempQueryForm[item.size]"
:label="op[item.options.label] || op.label"
:value="op[item.options.value] || op.value"
:key="op[item.options.value] || op.value"
></el-radio>
</template>
<!-- 文本框 -->
<el-input
v-if="item.type === 'textarea'"
v-model.trim="tempQueryForm[item.prop]"
type="textarea"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:rows="item.row"
:autosize="item.autosize"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
"
clearable
>
</el-input>
<!-- 单选框 按钮样式 -->
<el-radio-group
v-if="item.type === 'radioButtom'"
v-model.trim="tempQueryForm[item.prop]"
:size="tempQueryForm[item.size]"
:disabled="item.disable"
>
<el-radio-button
v-for="op in item.options.data"
:label="op[item.options.label] || op.label"
:value="op[item.options.value] || op.value"
:key="op[item.options.value] || op.value"
></el-radio-button>
</el-radio-group>
<!-- 多选框 -->
<template v-if="item.type === 'Checkbox'">
<el-checkbox
v-model="tempQueryForm[item.prop]"
:disabled="item.disabled"
></el-checkbox>
</template>
</el-form-item>
</el-col>
<!-- 文本框 -->
<el-input
v-if="item.type === 'textarea'"
v-model.trim="tempQueryForm[item.prop]"
type="textarea"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:rows="item.row"
:autosize="item.autosize"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
"
clearable
>
</el-input>
<!-- 多选框 -->
<template v-if="item.type === 'Checkbox'">
<el-checkbox
v-model="tempQueryForm[item.prop]"
:disabled="item.disabled"
></el-checkbox>
</template>
</el-form-item>
</el-col>
</span>
<!-- 查询按钮 de-->
<span v-show="inline & hiddenFormBtn">
<el-form-item v-show="show">
......@@ -458,6 +465,4 @@ export default {
},
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
......
......@@ -90,7 +90,7 @@ export const constantRoutes = [
path: "/routeInfo",
component: (resolve) =>
require([
"@/views/allocationConfig/flightAllocConfig/routeInfo",
"@/views/allocationConfig/flightAllocConfig/flightRouteInfo",
], resolve),
name: "routeInfo",
meta: { title: "航班配舱", icon: "user" },
......
......@@ -471,50 +471,45 @@ export function restTableHeight($refs) {
* })
*/
export function removeDuplicates(arr, keys) {
const dict = {};
const result = {
repeat: [],
unique: [],
};
let duplicate = keys;
let duplicate, dateTime;
if (typeof keys == "object") {
duplicate = keys.duplicate;
dateTime = keys.dateTime;
}
// 去重
result.unique = arr.reduce((res, currentValue) => {
if (!dict[currentValue[duplicate]]) {
dict[currentValue[duplicate]] = true;
res.push(currentValue);
} else {
result.repeat.push(currentValue);
let map = new Map();
for (let i = 0; i < arr.length; i++) {
let item = arr[i];
if (
!map.has(item[duplicate]) ||
new Date(map.get(item[duplicate])[dateTime]) < new Date(item[dateTime])
) {
map.set(item[duplicate], item);
}
return res;
}, []);
}
const result = Array.from(map.values());
// 返回去重结果
if (typeof keys == "string") return result;
// 排序
if (typeof keys == "object") {
if (keys.sort) {
if (keys.sortType.toLowerCase().trim() == "number") {
if (result.repeat.length) {
result.repeat = sortFn("repeat");
}
if (result.unique.length) {
result.unique = sortFn("unique");
if (result.length) {
result = sortFn();
}
// 返回排序去重结果
}
}
return result;
return result;
}
// 排序方法
function sortFn(attr) {
if (isNaN(Number(result[attr][0][keys.sortAttr]))) {
return result[attr].sort((a, b) =>
function sortFn() {
if (isNaN(Number(result[0][keys.sortAttr]))) {
return result.sort((a, b) =>
a[keys.sortAttr].localeCompare(b[keys.sortAttr])
); // 按字母排序
} else {
return result[attr].sort((a, b) => a[keys.sortAttr] - b[keys.sortAttr]); // 按数字排序
return result.sort((a, b) => a[keys.sortAttr] - b[keys.sortAttr]); // 按数字排序
}
}
}
......
......@@ -5,418 +5,436 @@
accordion
v-model="activeNames"
@change="collapseChange"
v-loading="loading"
>
<el-collapse-item
<div
class="collapse-item-header"
v-for="(item, index) in routesInfo"
:key="item.route"
:name="index"
>
<!-- 航线名 -->
<template slot="title">
<strong>{{ item.route }}</strong>
</template>
<!-- 航线设置信息 -->
<div class="route-info info-item">
<el-card class="route-info-card">
<!-- 有数据时 -->
<section v-if="item.config">
<div slot="header" class="route-config-header">
<el-button
type="primary"
size="mini"
:disabled="item.status == '3' || status"
:loading="item.loading"
>保 存</el-button
>
<el-button
v-if="showBtnRule(item)"
type="primary"
size="mini"
icon="el-icon-video-pause"
:loading="item.loading"
:disabled="status"
>{{ item.status | statusBtn }}</el-button
>
<el-button
v-if="showBtnRule(item)"
type="danger"
size="mini"
icon="el-icon-delete"
:disabled="item.status !== '3' || status"
:loading="item.loading"
>删 除</el-button
>
<span class="flight-route-title">
{{ item.ruleDate ? "日期级别规则" : "普通规则" }}</span
>
</div>
<el-divider></el-divider>
<div class="route-config-info">
<el-form label-position="right" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="始发站">
<el-col :span="2">
<el-radio-group
v-model="item.isLocation"
@change="changeLocation"
:disabled="status"
>
<el-radio label="1">包含始发站</el-radio>
<el-radio label="2">不包含始发站</el-radio>
</el-radio-group>
</el-col>
<el-col :span="10">
<el-input
v-if="item.isLocation == '1'"
:disabled="status"
type="textarea"
v-model="item.location"
:rows="4"
placeholder="始发站之间用回车符分隔"
style="width: 500px"
>
</el-input>
<el-input
v-else
:disabled="status"
type="textarea"
v-model="item.notLocation"
:rows="4"
placeholder="始发站之间用回车符分隔"
style="width: 500px"
>
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="目的站">
<el-col :span="2">
<el-radio-group
:disabled="status"
v-model="item.isDestinationSite"
@change="changeDestinationSite"
>
<el-radio label="1">包含目的站</el-radio>
<el-radio label="2">不包含目的站</el-radio>
</el-radio-group>
</el-col>
<el-col :span="10">
<el-input
v-if="item.isDestinationSite == '1'"
:disabled="status"
type="textarea"
v-model="item.destinationSite"
:rows="4"
placeholder="目的站之间用回车符分隔"
style="width: 500px"
>
</el-input>
<el-input
v-else
:disabled="status"
type="textarea"
v-model="item.notDestinationSite"
:rows="4"
placeholder="目的站之间用回车符分隔"
style="width: 500px"
>
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="10">
<el-form-item label="URSA包含">
<el-input
:disabled="status"
type="textarea"
v-model="item.includeUrsa"
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="URSA不包含">
<el-input
:disabled="status"
type="textarea"
v-model="item.notIncludeUrsa"
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
>
</el-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-col :span="9">
<el-form-item label="件数">
<el-collapse-item :name="index" v-if="showFlightRoute(item)">
<!-- 航线名 -->
<template slot="title">
<strong>{{ item.route }}</strong>
</template>
<!-- 航线设置信息 -->
<div class="route-info info-item">
<el-card class="route-info-card">
<!-- 有数据时 -->
<section v-if="item.config">
<div slot="header" class="route-config-header">
<el-button
type="primary"
size="mini"
:disabled="pageName || item.status == '3' || status"
:loading="item.loading"
@click="saveSubmit(item)"
>保 存</el-button
>
<el-button
v-if="showBtnRule(item)"
type="primary"
size="mini"
icon="el-icon-video-pause"
:loading="item.loading"
:disabled="pageName || status"
@click="onOffSubmit(item)"
>{{ item.status | statusBtn }}</el-button
>
<el-button
v-if="showBtnRule(item)"
type="danger"
size="mini"
icon="el-icon-delete"
:disabled="pageName || item.status !== '3' || status"
:loading="item.loading"
@click="deleteSubmit(item)"
>删 除</el-button
>
<span class="flight-route-title">
{{ item.ruleDate ? "日期级别规则" : "普通规则" }}</span
>
</div>
<el-divider></el-divider>
<div class="route-config-info">
<el-form label-position="right" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="始发站">
<el-col :span="2">
<el-radio-group
v-model="item.isLocation"
@change="changeLocation"
:disabled="pageName || status"
>
<el-radio label="1">包含始发站</el-radio>
<el-radio label="2">不包含始发站</el-radio>
</el-radio-group>
</el-col>
<el-col :span="10">
<el-input
:disabled="status"
class="numberInput"
v-model.trim="item.minNumOfPieces"
v-if="item.isLocation == '1'"
:disabled="pageName || status"
type="textarea"
v-model="item.location"
:rows="4"
placeholder="始发站之间用回车符分隔"
style="width: 500px"
>
</el-input>
<span
ref="minNumOfPieces"
class="el-form-item__error"
></span>
</el-col>
<el-col style="text-align: center" :span="1"
>-</el-col
>
<el-col :span="10">
<el-input
:disabled="status"
class="numberInput"
v-model.trim="item.maxNumOfPieces"
v-else
:disabled="pageName || status"
type="textarea"
v-model="item.notLocation"
:rows="4"
placeholder="始发站之间用回车符分隔"
style="width: 500px"
>
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="重量(KG)">
<el-col :span="24">
<el-form-item label="目的站">
<el-col :span="2">
<el-radio-group
:disabled="pageName || status"
v-model="item.isDestinationSite"
@change="changeDestinationSite"
>
<el-radio label="1">包含目的站</el-radio>
<el-radio label="2">不包含目的站</el-radio>
</el-radio-group>
</el-col>
<el-col :span="10">
<el-input
:disabled="status"
class="numberInput"
v-model.trim="item.minWeight"
v-if="item.isDestinationSite == '1'"
:disabled="pageName || status"
type="textarea"
v-model="item.destinationSite"
:rows="4"
placeholder="目的站之间用回车符分隔"
style="width: 500px"
>
</el-input>
<span
ref="minWeight"
class="el-form-item__error"
></span>
</el-col>
<el-col style="text-align: center" :span="1"
>-</el-col
>
<el-col :span="10">
<el-input
:disabled="status"
class="numberInput"
v-model.trim="item.maxWeight"
v-else
:disabled="pageName || status"
type="textarea"
v-model="item.notDestinationSite"
:rows="4"
placeholder="目的站之间用回车符分隔"
style="width: 500px"
>
</el-input>
</el-col>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="申报类别">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="status"
v-model="item.typeOfGoods"
@change="changeCargoType"
>
<el-row>
<el-col
v-for="item in cargoType"
:span="2"
:key="item.id"
<el-col :span="24">
<el-col :span="10">
<el-form-item label="URSA包含">
<el-input
:disabled="pageName || status"
type="textarea"
v-model="item.includeUrsa"
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="URSA不包含">
<el-input
:disabled="pageName || status"
type="textarea"
v-model="item.notIncludeUrsa"
:rows="4"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"
>
</el-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-col :span="9">
<el-form-item label="件数">
<el-col :span="10">
<el-input
:disabled="pageName || status"
class="numberInput"
v-model.trim="item.minNumOfPieces"
placeholder="最少件数"
>
</el-input>
<span
ref="minNumOfPieces"
class="el-form-item__error"
></span>
</el-col>
<el-col style="text-align: center" :span="1"
>-</el-col
>
<el-col :span="10">
<el-input
:disabled="pageName || status"
class="numberInput"
v-model.trim="item.maxNumOfPieces"
placeholder="最多件数"
>
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="重量(KG)">
<el-col :span="10">
<el-input
:disabled="pageName || status"
class="numberInput"
v-model.trim="item.minWeight"
placeholder="最小重量"
>
</el-input>
<span
ref="minWeight"
class="el-form-item__error"
></span>
</el-col>
<el-col style="text-align: center" :span="1"
>-</el-col
>
<el-col :span="10">
<el-input
:disabled="pageName || status"
class="numberInput"
v-model.trim="item.maxWeight"
placeholder="最大重量"
>
<el-checkbox
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
</el-input>
</el-col>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="申报类别">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="pageName || status"
v-model="item.typeOfGoods"
@change="changeCargoType"
>
<el-row>
<el-col
v-for="item in cargoType"
:span="2"
:key="item.id"
>
<Tooltips
:content="item.chineseName"
:refName="item.code"
<el-checkbox
v-if="item.status === 1"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="货物类型">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="status"
v-model="item.cargoType"
@change="changeCargoStatus"
>
<el-row>
<el-col
:span="3"
v-for="item in cargoStatus"
:key="item.id"
>
<el-checkbox
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
disabled
<Tooltips
:content="item.chineseName"
:refName="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="货物类型">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="pageName || status"
v-model="item.cargoType"
@change="changeCargoStatus"
>
<el-row>
<el-col
:span="3"
v-for="item in cargoStatus"
:key="item.id"
>
<Tooltips
:content="item.chineseName"
:refName="item.code"
<el-checkbox
v-if="item.status === 1"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
disabled
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="取件扫描号">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="status"
v-model="item.puporpuxCode"
@change="changePuporpux"
>
<el-row>
<el-col
:span="2"
v-for="item in puporpux"
:key="item.id"
>
<el-checkbox
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
<Tooltips
:content="item.chineseName"
:refName="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="取件扫描号">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="pageName || status"
v-model="item.puporpuxCode"
@change="changePuporpux"
>
<el-row>
<el-col
:span="2"
v-for="item in puporpux"
:key="item.id"
>
<Tooltips
:content="item.chineseName"
:refName="item.code"
<el-checkbox
v-if="item.status === 1"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="Service Code">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="status"
v-model="item.serviceCode"
@change="changeServiceCode"
>
<el-row>
<el-col
:span="2"
v-for="item in serviceCode"
:key="item.id"
>
<el-checkbox
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
<Tooltips
:content="item.chineseName"
:refName="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="Service Code">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="pageName || status"
v-model="item.serviceCode"
@change="changeServiceCode"
>
<el-row>
<el-col
:span="2"
v-for="item in serviceCode"
:key="item.id"
>
<Tooltips
:content="item.chineseName"
:refName="item.code"
<el-checkbox
v-if="item.status === 1"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="Handling Code">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="status"
v-model="item.handlingCode"
@change="changeHandlingCode"
>
<el-row>
<el-col
:span="2"
v-for="item in handlingCode"
:key="item.id"
>
<el-checkbox
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
<Tooltips
:content="item.chineseName"
:refName="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="Handling Code">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="pageName || status"
v-model="item.handlingCode"
@change="changeHandlingCode"
>
<el-row>
<el-col
:span="2"
v-for="item in handlingCode"
:key="item.id"
>
<Tooltips
:content="item.chineseName"
:refName="item.code"
<el-checkbox
v-if="item.status === 1"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="Sub Category">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="status"
v-model="item.subCategory"
@change="changeSubCategory"
>
<el-row>
<el-col
:span="2"
v-for="item in subCategory"
:key="item.id"
>
<el-checkbox
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
<Tooltips
:content="item.chineseName"
:refName="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="Sub Category">
<el-card shadow="never" style="width: 95%">
<el-checkbox-group
:disabled="pageName || status"
v-model="item.subCategory"
@change="changeSubCategory"
>
<el-row>
<el-col
:span="2"
v-for="item in subCategory"
:key="item.id"
>
<Tooltips
:content="item.chineseName"
:refName="item.code"
<el-checkbox
v-if="item.status === 1"
:label="item.chineseName"
:name="item.chineseName"
:key="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
</el-row>
</el-form>
<Tooltips
:content="item.chineseName"
:refName="item.code"
>
</Tooltips>
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</section>
<!-- 没有数据时 -->
<div class="no-data" v-else>
<el-empty description="未设置规则!">
<el-button
type="primary"
size="small"
:disabled="pageName"
@click="addRouteRule(index)"
>新增规则</el-button
>
</el-empty>
</div>
</section>
<!-- 没有数据时 -->
<div class="no-data" v-else>
<el-empty description="未设置规则!">
<el-button
type="primary"
size="small"
@click="addRouteRule(index)"
>新增规则</el-button
>
</el-empty>
</div>
</el-card>
</div>
</el-collapse-item>
</el-card>
</div>
</el-collapse-item>
</div>
</el-collapse>
</div>
</template>
<script>
// import { inputBlurValidate } from "@/utils/mixins";
export default {
name: "routeInfo",
props: {
......@@ -460,17 +478,32 @@ export default {
type: Boolean,
default: false,
},
loading: {
// 折叠面板
type: Boolean,
default: false,
},
},
// mixins: [inputBlurValidate],
data() {
return {
activeNames: [0], // 展开指定项
};
},
computed: {},
computed: {
pageName() {
if (
this.$route.query.pageName == "dmLog" ||
this.$route.query.pageName == "flightRandConfig" ||
this.$route.query.dataStatus == "view"
) {
return true;
}
},
},
filters: {
// 状态:0 无效,1 有效 2 配置中 3 停用
statusBtn(status) {
// console.log(this)
if (status == "0") {
return "无 效";
} else if (status == "1") {
......@@ -484,6 +517,15 @@ export default {
},
mounted() {},
methods: {
// 航线回显逻辑:如果航线无效并且没有数据,则不展示该航线
showFlightRoute(item) {
if (this.$route.query.status == "3" && item.config == false) {
return false;
} else {
return true;
}
},
// 航线操作按钮回显逻辑
showBtnRule(item) {
/*
展示保存按钮、开启按钮/停用按钮、删除按钮逻辑如下:
......@@ -498,7 +540,10 @@ export default {
*/
if (item.status == "3" || (item.status == "1" && item.ruleDate)) {
return true;
} else if (item.status == "1" && this.$route.query.querySpecifyData == "2") {
} else if (
item.status == "1" &&
this.$route.query.querySpecifyData == "2"
) {
// 航班配舱设置非日期级别情况下
return true;
} else if (item.status == "2") {
......@@ -547,36 +592,70 @@ export default {
addRouteRule(index) {
this.$emit("addRlue", index);
},
// 保存
saveSubmit(item) {
this.$emit("save", item);
},
// 开启/暂停
onOffSubmit(item) {
this.$emit("onOff", item);
},
// 删除
deleteSubmit(item) {
this.$emit("delete", item);
},
},
};
</script>
<style lang="scss">
.collapse-item-header {
padding-left: 40px;
}
.el-collapse {
border: 0 !important;
}
.el-collapse-item__header {
background-color: #d9ecff !important;
border-bottom: 1px solid #ccc;
padding-left: 40px;
padding: 0 10px 0 30px;
}
.el-collapse-item__wrap {
border-bottom: 0 !important;
}
.el-collapse-item {
border-bottom: 1px solid #ccc;
}
.el-collapse-item:last-child {
}
.route-container {
strong {
font-size: 14px;
}
.route-info {
.route-info-card {
section {
padding: 12px 70px;
.route-config-header {
.flight-route-title {
margin-left: 8px;
}
}
}
.route-config-info {
}
}
}
}
.el-form-item__error {
color: #ff4949;
font-size: 12px;
line-height: 1;
padding-top: 4px;
position: absolute;
top: 100%;
left: 0;
font-weight: 500;
width: 100% !important;
}
</style>
......
......@@ -8,6 +8,7 @@ export const formConfig = [
span: 5,
trigger: "blur",
labelWidth: "55px",
disable: false,
},
{
label: "航班日期",
......@@ -18,6 +19,8 @@ export const formConfig = [
format: "yyyy-MM-dd",
colWidth: "23%",
inputWidth: "100%",
disable: false,
hidden: false,
},
{
label: "航线",
......@@ -28,6 +31,8 @@ export const formConfig = [
span: 5,
labelWidth: "40px",
trigger: "blur", // 事件名
disable: false,
hidden: false,
},
{
label: "航线优先级",
......@@ -43,8 +48,10 @@ export const formConfig = [
// 航线规则表单
export const routeRuleForm = {
config: true,
remark: true,
purposeOfFlightNo: "LP001",
flightRoute: "", // 飞行航线
routeSpecifyDateSeq: "", // 航线优先级
declarationCategory: "",
location: null, // 包含始发站
notLocation: null, // 不包含始发站
destinationSite: null, // 包含目的站
......
......@@ -25,6 +25,7 @@
</el-col>
<el-col>
<route-info
ref="routeInfo"
:routesInfo="routesInfo"
:cargoType="cargoType"
:cargoStatus="cargoStatus"
......@@ -33,16 +34,13 @@
:handlingCode="handlingCode"
:subCategory="subCategory"
:status="getRouter"
@collapse="collapseChange"
:loading="loading"
@location="changeLocation"
@destinationSite="changeDestinationSite"
@cargoType="changeCargoType"
@cargoStatus="changeCargoStatus"
@puporpux="changePuporpux"
@serviceCode="changeServiceCode"
@handlingCode="changeHandlingCode"
@subCategory="changeSubCategory"
@addRlue="addRlue"
@save="saveSubmit"
@onOff="onOffSubmit"
@delete="deleteSubmit"
>
</route-info>
</el-col>
......@@ -51,22 +49,17 @@
</template>
<script>
import YlForm from "@/components/YlForm";
import RouteInfo from "./components/routeInfo";
import RouteInfo from "../components/routeInfo";
import YlDraggable from "@/components/YlDraggable";
import { formConfig, routeRuleForm } from "./formConfig";
import { removeDuplicates, filterRepeat } from "@/utils";
import {
allDictData, // 获取全部字典
findDestinationFltRuleByFlightNo, // 航线维度设置详情
findByFlightId, // 通过id查询目的航班维度配置详情
updateOrAddFlight, // 修改
delFlightId, // 删除航线规则配置
enableOrDisable, // 是否停用/开启航线规则配置
batchUpdateOrAddFlight, // 更新航线优先级
queryRouteByFltNo, // 通过航班号查询航线
} from "@/api/destinationFlight";
import indexMixins from "./mixins";
import { routeData, routeInfo } from "./routeData";
import indexMixins from "../mixins";
export default {
components: {
YlForm,
......@@ -76,11 +69,12 @@ export default {
mixins: [indexMixins],
data() {
return {
loading: false, // 折叠面板
dragOptions: {
// 航线优先级拖拽配置
animation: 200,
group: "description",
disabled: false, // 是否禁止拖拽
disabled: true, // 是否禁止拖拽
ghostClass: "ghost",
},
formConfig: formConfig, // 表单配置项
......@@ -103,112 +97,64 @@ export default {
created() {
this.getAllDictData(); // 获取全部字典
let _this = this;
const parmas = {
querySpecifyData: this.$route.query.querySpecifyData || "", // 查询特殊数据字段
purposeOfFlightNo: this.$route.query.purposeOfFlightNo || "", // 航班号
flightDate: this.$route.query.flightDate || "", // 飞行日期
flightRouteListStr: this.$route.query.flightRouteListStr || "", // 飞行航线集合
status: this.$route.query.status || "", // 状态
};
let dataStatus = this.$route.query.dataStatus || "";
if (dataStatus == "add") {
formConfig.map((item) => {
if (item.type !== "slot") {
item.disable = false;
if (item.label == "航班日期" || item.label == "航线") {
item.hidden = true;
item.hidden = true;
}
}
});
} else {
//
formConfig.map((item) => {
if (item.type !== "slot") {
item.disable = true;
if (item.label == "航班日期" || item.label == "航线") {
item.hidden = false;
item.hidden = false;
}
}
});
}
this.queryForm = this.$route.query; // 获取跳转过来的参数
// 航班配舱维度规则设置查询条件
let queryCondition = {
querySpecifyData: _this.$route.query.querySpecifyData, // 查询特殊数据字段
purposeOfFlightNo: _this.$route.query.purposeOfFlightNo, // 航班号
flightDate: _this.$route.query.flightDate, // 飞行日期
flightRouteListStr: _this.$route.query.flightRouteListStr, // 飞行航线集合
// 航班配舱设置
flightAllocConfig: {
noDateParmas: {
flightDate: "",
flightRoute: "",
purposeOfFlightNo: this.purposeOfFlightNo,
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
dateParmas: {
flightDate: this.flightDate,
flightDate: parmas.flightDate,
flightRoute: "",
flightRouteListStr: "",
purposeOfFlightNo: this.purposeOfFlightNo,
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
queryParmas: function () {
// 非日期级别
if (this.querySpecifyData == "2") {
_this
.noDateLevelRoute(this.noDateParmas)
.then(({ routeList, dataList }) => {
const result = routeList.map((item1) => {
const item2 = dataList.find((item2) => {
if (item1.route === item2.flightRoute) {
item2.config = true;
return item2;
}
});
if (item2) {
// 有数据的合并对象,
return { ...item1, ...item2 };
} else {
item1.config = false;
return item1; // 没有的返回当前的
}
});
// 处理属性
result.map((item) => {
if (item.config) {
_this.hasOwnProperty(item, "typeOfGoods");
_this.hasOwnProperty(item, "puporpuxCode");
_this.hasOwnProperty(item, "serviceCode");
_this.hasOwnProperty(item, "handlingCode");
_this.hasOwnProperty(item, "subCategory");
_this.setattrVal(item); // 设置属性值
}
});
_this.routesInfo = result;
});
if (parmas.querySpecifyData == "2") {
_this.noDateLevelData(this.noDateParmas);
}
// 日期级别
if (this.querySpecifyData == "1") {
_this.dateLevelRoute(this.dateParmas).then((res) => {
const { configFlag, dateFlightRoute } = res;
if (configFlag == false) {
// 航班航线有规则配置的
const dateListHas = dateFlightRoute.filter(
(item) => item.config == true
);
// 航班航线没有规则配置的
const dateListNo = dateFlightRoute.filter(
(item) => item.config == false
);
_this
.noDateLevelRoute(this.noDateParmas)
.then(({ dataList }) => {
console.log(dateListNo);
console.log(dataList);
const result = dateListNo.map((item1) => {
const item2 = dataList.find((item2) => {
if (item1.route === item2.flightRoute) {
item2.config = true;
return item2;
}
});
if (item2) {
// 有数据的合并对象,
return { ...item1, ...item2 };
} else {
item1.config = false;
return item1; // 没有的返回当前的
}
});
let dateList = dateListHas.concat(result);
// 处理属性
dateList.map((item) => {
if (item.config) {
_this.hasOwnProperty(item, "typeOfGoods");
_this.hasOwnProperty(item, "puporpuxCode");
_this.hasOwnProperty(item, "serviceCode");
_this.hasOwnProperty(item, "handlingCode");
_this.hasOwnProperty(item, "subCategory");
_this.setattrVal(item); // 设置属性值
}
});
_this.routesInfo = dateList;
});
}
if (parmas.querySpecifyData == "1") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
},
......@@ -216,24 +162,30 @@ export default {
// 航班信息维护
flightInformationMaintenance: {
noDateParmas: {
purposeOfFlightNo: this.purposeOfFlightNo,
flightRouteListStr: this.flightRouteListStr,
purposeOfFlightNo: parmas.purposeOfFlightNo,
flightRouteListStr: parmas.flightRouteListStr,
status: "",
},
dateParmas: {
purposeOfFlightNo: this.purposeOfFlightNo,
flightDate: this.flightDate,
flightRouteListStr: this.flightRouteListStr,
purposeOfFlightNo: parmas.purposeOfFlightNo,
flightDate: parmas.flightDate,
flightRouteListStr: parmas.flightRouteListStr,
status: "",
},
queryParmas: function () {
// White Tail
if (_this.$route.query.flightKindName == "White Tail") {
_this.noDateLevelRoute(this.noDateParmas);
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
// Purple Tail
if (_this.$route.query.flightKindName == "Purple Tail") {
_this.dateLevelRoute(this.dateParmas);
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
},
},
......@@ -242,98 +194,78 @@ export default {
noDateParmas: {
flightRoute: "",
flightRouteListStr: "",
purposeOfFlightNo: this.purposeOfFlightNo,
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
dateParmas: {
flightDate: this.flightDate,
flightDate: parmas.flightDate,
flightRoute: "",
purposeOfFlightNo: this.purposeOfFlightNo,
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
queryParmas: function () {
// 普通级别
if (_this.$route.query.pageName == "flightRandConfig") {
_this.noDateLevelRoute(this.noDateParmas);
_this.dateLevelRoute(this.dateParmas);
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
},
},
// 【系统日志】DM数据处理
dmLog: {
queryParmas: function () {
if (_this.$route.query.pageName == "dmLog") {
_this.getFindByFlightId({
id: _this.$route.query.id,
});
}
},
},
};
/*
queryCondition只负责接收参数和数据调用
*/
// 航班配舱设置
queryCondition.flightAllocConfig.queryParmas();
// 航班信息维护
queryCondition.flightInformationMaintenance.queryParmas();
// 航班顺位设置
queryCondition.flightRandConfig.queryParmas();
// 【系统日志】DM数据处理
queryCondition.dmLog.queryParmas();
},
mounted() {},
methods: {
// 普通级别的
noDateLevelRoute(parmas) {
return new Promise((resolve, reject) => {
findDestinationFltRuleByFlightNo(parmas)
.then((res) => {
const { code, data, msg } = res;
if (code != 200) {
this.msgError(msg);
return;
}
let routeList = data.routeList; // 航班航线基本信息
// 普通级别航班航线维度规则详情
const dataList = removeDuplicates(data.list, {
duplicate: "flightRoute", // 去重字段
sort: false, // 是否要排序
sortType: "Number", // 排序类型
sortAttr: "routePriority", // 排序字段
});
resolve({ routeList: routeList, dataList: dataList.unique });
})
.catch(() => {});
});
},
// 日期级别的
dateLevelRoute(parmas) {
return new Promise((resolve, reject) => {
findDestinationFltRuleByFlightNo(parmas).then((res) => {
const { code, data, msg } = res;
if (code != 200) {
this.msgError(msg);
return;
}
this.routeList = data.routeList; // 航班航线基本信息
// 日期级别航班航线维度规则详情
const dataList = removeDuplicates(data.list, {
duplicate: "flightRoute", // 去重字段
sort: false, // 是否要排序
sortType: "Number", // 排序类型
sortAttr: "routePriority", // 排序字段
});
let config = false; // 有缺省的航线配置
const result = this.routeList.map((item1) => {
const item2 = dataList.unique.find((item2) => {
if (item2.flightRoute === item1.route) {
config = item2.config = true;
if (this.$route.query.pageName == "flightAllocConfig") {
item2.remark = true;
} else {
item2.remark = false;
}
return item2;
}
}); // 返回当前相等的一条数据
if (item2) {
return { ...item1, ...item2 };
getQueryRouteByFltNo(parmas) {
queryRouteByFltNo(parmas)
.then((res) => {
const { code, data } = res;
if (code == 200) {
if (data.list.length) {
let isEtesRoute = data.list.filter(
(item) => item.isEtesRoute == "N"
); // 过滤ET86航线
const routes = [];
isEtesRoute.map((item) => {
routes.push({ config: false, route: item.route });
});
this.routeList = data.list;
this.routesInfo = routes;
} else {
config = item1.config = false;
return item1; // 没有的返回当前的
this.routeList = [];
this.msgError("暂无航线");
}
});
let configFlag = result.every((item) => item.config == true);
// 返回日期级别查询结果
resolve({ configFlag: configFlag, dateFlightRoute: result });
});
});
}
})
.catch(() => {});
},
// 航班号输入框失焦事件
blurEvent({ purposeOfFlightNo }) {
routeRuleForm.flightRoute = this.upCase(purposeOfFlightNo);
this.getQueryRouteByFltNo({ fltNo: this.upCase(purposeOfFlightNo) });
this.queryForm.purposeOfFlightNo = this.upCase(purposeOfFlightNo);
},
// 新增规则
addRlue(index) {
......@@ -344,7 +276,132 @@ export default {
...routeRuleForm,
};
this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据
console.log("新增规则:", this.routesInfo);
},
// 保存
saveSubmit(item) {
let parmas = JSON.parse(JSON.stringify(item));
this.returnString(parmas, "cargoType");
this.returnString(parmas, "typeOfGoods");
this.returnString(parmas, "puporpuxCode");
this.returnString(parmas, "serviceCode");
this.returnString(parmas, "handlingCode");
this.returnString(parmas, "subCategory");
if (parmas.minWeight || parmas.maxWeight) {
if (
!/^(0|[1-9]\d*)(.\d{1,5})?$/.test(
parmas.minWeight || parmas.maxWeight
)
) {
this.msgWarning("请输入有效重量,小数保留5位");
return;
}
}
if (parmas.minNumOfPieces || parmas.maxNumOfPieces) {
if (!/^\d+$/.test(parmas.minNumOfPieces || parmas.maxNumOfPieces)) {
this.msgWarning("请输入有效件数");
return;
}
}
if (parmas.minNumOfPieces && parmas.maxNumOfPieces) {
if (Number(parmas.minNumOfPieces) > Number(parmas.maxNumOfPieces)) {
this.msgWarning("最小件数不能大于最大件数");
return;
}
}
if (parmas.minWeight && parmas.maxWeight) {
if (Number(parmas.minWeight) > Number(parmas.maxWeight)) {
this.msgWarning("最小重量不能大于最大重量");
return;
}
}
let keys = [
"location",
"notLocation",
"destinationSite",
"notDestinationSite",
"includeUrsa",
"notIncludeUrsa",
"minNumOfPieces",
"maxNumOfPieces",
"minWeight",
"maxWeight",
"typeOfGoods",
"cargoType",
"puporpuxCode",
"serviceCode",
"handlingCode",
"subCategory",
];
let validate = keys.some((key) => parmas[key]);
if (validate) {
this.loading = true;
updateOrAddFlight(parmas)
.then((res) => {
const { code, msg } = res;
if (code == 200) {
this.$forceUpdate();
this.msgSuccess("保存成功!");
} else {
this.msgWarning(msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
}else{
this.msgWarning('未添加规则信息,请添加后再保存!')
}
},
// 开启/暂停
onOffSubmit(item) {
this.loading = true;
let tip = item.status == "1" ? "停用" : "启用";
this.$confirm("是否确认" + tip + "此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
enableOrDisable({ id: item.id, status: item.status })
.then((res) => {
const { code, msg } = res;
if (code == 200) {
this.$forceUpdate();
this.msgSuccess(tip + "成功");
} else {
this.msgWarning(msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
});
},
// 删除
deleteSubmit(item) {
this.loading = true;
this.$confirm("是否确认删除此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
showCancelButton: true,
type: "warning",
}).then(() => {
delFlightId({ id: item.id })
.then((res) => {
const { code, msg } = res;
if (code == 200) {
this.$forceUpdate();
this.msgSuccess(msg);
} else {
this.msgWarning(msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
});
},
},
};
......
<template>
<div>
<el-form ref="flightAllocForm" :model="queryParams" class="form-header" size="small" label-position="right"
label-width="auto" @submit.native.prevent>
<el-form
ref="flightAllocForm"
:model="queryParams"
class="form-header"
size="small"
label-position="right"
label-width="auto"
@submit.native.prevent
>
<el-row>
<el-col :span="6">
<el-form-item label="航班号">
<el-input class="formItem" v-model.trim="purposeOfFlightNo" placeholder="航班号" @keyup.enter.native="getList">
<el-input
class="formItem"
v-model.trim="purposeOfFlightNo"
placeholder="航班号"
@keyup.enter.native="getList"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班日期">
<el-date-picker class="formItem" v-model="queryParams.flightDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd" clearable :disabled="queryParams.querySpecifyData == '2'">
<el-date-picker
class="formItem"
v-model="queryParams.flightDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
clearable
:disabled="queryParams.querySpecifyData == '2'"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="状态">
<el-select class="formItem" v-model="queryParams.status" placeholder="状态">
<el-select
class="formItem"
v-model="queryParams.status"
placeholder="状态"
>
<el-option label="有效" value="1"></el-option>
<el-option label="停用" value="3"></el-option>
</el-select>
......@@ -26,34 +49,76 @@
</el-col>
</el-row>
<div>
<el-button type="primary" icon="el-icon-search" :loading="loading" @click="getList" size="mini">查询</el-button>
<el-button class="mb20" type="primary" icon="el-icon-plus" size="mini" v-hasPermi="['allocation:alloc:add']"
@click="
$router.push({
name: 'FlightAllocConfigInfo',
params: { handle: 'add', fltNo: 'new', fltDate: ' ', status: null, routeStatus: '' },
})
">添加</el-button>
<el-switch style="margin-left: 10px;" v-model="queryParams.querySpecifyData" inactive-text="日期查询" active-value="1"
inactive-value="2" active-color="#13ce66" inactive-color="#909399" @change="switchChange"></el-switch>
<el-button
type="primary"
icon="el-icon-search"
:loading="loading"
@click="getList"
size="mini"
>查询</el-button
>
<el-button
class="mb20"
type="primary"
icon="el-icon-plus"
size="mini"
v-hasPermi="['allocation:alloc:add']"
@click="addFlightRouteConfig"
>添加</el-button
>
<el-switch
style="margin-left: 10px"
v-model="queryParams.querySpecifyData"
inactive-text="日期查询"
active-value="1"
inactive-value="2"
active-color="#13ce66"
inactive-color="#909399"
@change="switchChange"
></el-switch>
</div>
</el-form>
<Tables ref="newTables" ductName="FlightAlloc" :data="flyList" :headerData="tableHeaders['flightAlloc']" :order="true"
:totalCount="total" :loading="loading" :limitSize="queryParams.limit" :limitStart="queryParams.start"
:page="curPage" :pageSizes="[20]" :height="tableHeight" @currentChange="currentChange">
<Tables
ref="newTables"
ductName="FlightAlloc"
:data="flyList"
:headerData="tableHeaders['flightAlloc']"
:order="true"
:totalCount="total"
:loading="loading"
:limitSize="queryParams.limit"
:limitStart="queryParams.start"
:page="curPage"
:pageSizes="[20]"
:height="tableHeight"
@currentChange="currentChange"
>
<template v-slot:ruleDate="scope">
<el-link v-if="scope.row.ruleDate" type="primary" @click="toRouteOrder(scope.row)">
{{
scope.row.ruleDate
}}<i class="el-icon-link"></i> </el-link>
<el-link
v-if="scope.row.ruleDate"
type="primary"
@click="toRouteOrder(scope.row)"
>
{{ scope.row.ruleDate }}<i class="el-icon-link"></i>
</el-link>
</template>
<template slot="optionColumn">
<el-table-column label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-view" @click="handleClick(scope.row, 'view')">查看
<el-button
type="text"
size="mini"
icon="el-icon-view"
@click="handleClick(scope.row, 'view')"
>查看
</el-button>
<el-button type="text" size="mini" icon="el-icon-edit" v-hasPermi="['allocation:alloc:update']"
@click="handleClick(scope.row, 'edit')">修改
<el-button
type="text"
size="mini"
icon="el-icon-edit"
v-hasPermi="['allocation:alloc:update']"
@click="handleClick(scope.row, 'edit')"
>修改
</el-button>
<!-- <el-button type="text" size="mini" icon="el-icon-delete" style="color:#ff4949"
v-hasPermi="['allocation:alloc:delete']" @click="del(scope.row.id, scope.row.status)">删除</el-button>
......@@ -70,22 +135,20 @@
</template>
<script>
import {
findFlightDimRuleByFlightNo
} from "@/api/destinationFlight";
import Dialog from './dialog.vue'
import { findFlightDimRuleByFlightNo } from "@/api/destinationFlight";
import Dialog from "./dialog.vue";
export default {
name: "FlightAllocConfig",
components: {
Dialog
Dialog,
},
data() {
return {
queryParams: {
purposeOfFlightNo: null,
flightDate: undefined,
querySpecifyData: '2',
querySpecifyData: "2",
status: "1",
start: 0,
limit: 20,
......@@ -113,13 +176,14 @@ export default {
// })
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.flightAllocForm.$el.offsetHeight - 200
this.tableHeight =
window.innerHeight - this.$refs.flightAllocForm.$el.offsetHeight - 200;
},
activated() {
this.getList()
this.getList();
},
deactivated() {
this.flyList = []
this.flyList = [];
},
methods: {
getList() {
......@@ -129,18 +193,35 @@ export default {
this.queryParams.start = 0;
}
this.loading = true;
findFlightDimRuleByFlightNo(this.queryParams).then(res => {
this.loading = false
if (res.code === 200) {
this.flyList = res.data.list
this.total = res.data.totalCount
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
findFlightDimRuleByFlightNo(this.queryParams)
.then((res) => {
this.loading = false;
if (res.code === 200) {
this.flyList = res.data.list;
this.total = res.data.totalCount;
} else {
this.msgWarning(res.msg);
}
})
.catch((err) => {
this.loading = false;
console.log(err);
});
},
// 添加
addFlightRouteConfig() {
this.$router.push({
path: "/routeInfo",
query: {
flightDate: '', // 跳转的时候默认当天日期
purposeOfFlightNo: '',
flightRouteListStr: '',
status: '',
pageName: "flightAllocConfig",
dataStatus: "add",
disable: '',
},
});
},
//跳转到查看,修改页面
handleClick({ purposeOfFlightNo, ruleDate, flightRoute, status }, name) {
......@@ -153,7 +234,8 @@ export default {
status: status,
pageName: "flightAllocConfig",
dataStatus: name,
querySpecifyData: this.queryParams.querySpecifyData
querySpecifyData: this.queryParams.querySpecifyData,
disable: true,
},
});
},
......@@ -161,25 +243,25 @@ export default {
toRouteOrder(val) {
this.colData = {
fltNo: val.purposeOfFlightNo,
fltDate: val.ruleDate
}
this.open = true
fltDate: val.ruleDate,
};
this.open = true;
},
//开关改变
switchChange(val) {
if (val == '2') {
this.queryParams.flightDate = undefined
if (val == "2") {
this.queryParams.flightDate = undefined;
}
},
close() {
this.open = false
this.open = false;
},
//翻页
currentChange(val) {
this.curPage = val.page
this.curPage = val.page;
this.queryParams.start = val.start;
this.getList();
}
},
},
computed: {
purposeOfFlightNo: {
......@@ -193,5 +275,3 @@ export default {
},
};
</script>
......
import {
allDictData, // 获取全部字典
findDestinationFltRuleByFlightNo, // 航线维度设置详情
findByFlightId, // 通过id查询目的航班维度配置详情
} from "@/api/destinationFlight";
import { routeRuleForm } from "../flightRouteInfo/formConfig";
import { removeDuplicates } from "@/utils";
export default {
computed: {
// 获取路由参数
getRouter() {
if (this.$route.query.dataStatus == "view") {
return true;
} else if (this.$route.query.dataStatus == "edit") {
return false;
if (this.$route.query.name == "add") {
return "保存";
} else if (this.$route.query.name == "edit") {
return "修改";
} else {
return false;
}
......@@ -28,13 +32,328 @@ export default {
this.cargoType = data.cargoType; // 申报类别
this.cargoStatus = data.cargoStatus; // 货物类型
this.puporpux = data.puporpux; // 取件扫描号
this.serviceCode = data.serviceCode; // Service Code
this.handlingCode = data.handlingCode; // Handling Code
this.subCategory = data.subCategory; // Sub Category
this.serviceCode = this.dicSort(
data.serviceCode.sort((a, b) =>
a.chineseName.localeCompare(b.chineseName)
)
); // Service Code
this.handlingCode = this.dicSort(
this.sorttodo(data.handlingCode, "BLANK")
); // Handling Code
this.subCategory = this.dicSort(
this.sorttodo(data.subCategory, "Blank")
); // Sub Category
})
.catch(() => {});
},
// 【接口调用和数据去重整合】普通级别
noDateLevelRoute(parmas) {
return new Promise((resolve, reject) => {
findDestinationFltRuleByFlightNo(parmas)
.then((res) => {
const { code, data, msg } = res;
if (code != 200) {
this.msgError(msg);
return;
}
let noDateRouteList = data.routeList.filter(
(item) => item.etesRule == "N"
); // 航班航线基本信息(过滤ET86航线的)
// 普通级别航班航线维度规则详情
const noDateDataList = removeDuplicates(data.list, {
duplicate: "flightRoute", // 去重字段
dateTime: "createTime", // 从重复的数据中根据时间取最新的一条
sort: false, // 是否要排序
sortType: "Number", // 排序类型
sortAttr: "routePriority", // 排序字段
});
// 整合飞行航线配置信息
const mergeNoDateRouteInfo = this.mergeFlightRouteConfigObj(
noDateRouteList,
noDateDataList
);
let noDateConfigFlag = mergeNoDateRouteInfo.every(
(item) => item.config == true
);
resolve({
noDateConfigFlag,
noDateRouteList,
mergeNoDateRouteInfo,
});
})
.catch(() => {});
});
},
// 【接口调用和数据去重整合】日期级别
dateLevelRoute(parmas) {
return new Promise((resolve, reject) => {
findDestinationFltRuleByFlightNo(parmas)
.then((res) => {
const { code, data, msg } = res;
if (code != 200) {
this.msgError(msg);
return;
}
let dateRouteList = data.routeList.filter(
(item) => item.etesRule == "N"
); // 航班航线基本信息(过滤ET86航线的)
// 日期级别航班航线维度规则详情
const dateDataList = removeDuplicates(data.list, {
duplicate: "flightRoute", // 去重字段
dateTime: "createTime", // 从重复的数据中根据时间取最新的一条
sort: false, // 是否要排序
sortType: "Number", // 排序类型
sortAttr: "routePriority", // 排序字段
});
// 整合飞行航线配置信息,对没有航线配置信息的也已经做了config为false的处理;
const mergeDateRouteInfo = this.mergeFlightRouteConfigObj(
dateRouteList,
dateDataList
);
/*
【dateConfigFlag】:
判断日期级别的航线有没有航线配置的数据,如果其中一条没有返回false,
然后再接着调用非日期级别的查询做数据处理;
*/
let dateConfigFlag = mergeDateRouteInfo.every(
(item) => item.config == true
);
// 返回日期级别查询结果
resolve({
dateConfigFlag,
dateRouteList,
mergeDateRouteInfo,
});
})
.catch(() => {});
});
},
// 根据航班号ID查看航班航线配置详情
getFindByFlightId(parmas) {
findByFlightId(parmas)
.then((res) => {
const { code, data, msg } = res;
if (code != 200) {
this.msgError(msg);
return;
}
const routeList = [data.list];
// 航班航线维度规则详情
const dataList = removeDuplicates(routeList, {
duplicate: "flightRoute", // 去重字段
dateTime: "createTime", // 从重复的数据中根据时间取最新的一条
sort: false, // 是否要排序
sortType: "Number", // 排序类型
sortAttr: "routePriority", // 排序字段
});
routeList.map((item) => {
if (item.flightRoute) {
item.route = item.flightRoute;
}
});
// 整合飞行航线配置信息,对没有航线配置信息的也已经做了config为false的处理;
const mergeRouteInfo = this.mergeFlightRouteConfigObj(
routeList,
dataList
);
// 处理属性
mergeRouteInfo.map((item) => {
if (item.config) {
this.hasOwnProperty(item, "typeOfGoods");
this.hasOwnProperty(item, "puporpuxCode");
this.hasOwnProperty(item, "serviceCode");
this.hasOwnProperty(item, "handlingCode");
this.hasOwnProperty(item, "subCategory");
this.setattrVal(item); // 设置属性值
}
});
this.routeList = routeList; // 航班航线列表
this.routesInfo = mergeRouteInfo; // 航班航线配置信息列表
})
.catch(() => {});
},
// 判断对象是否存在某个属性,并且把这个属性值使用分号分隔
// 拿到【接口调用和数据去重整合】的数据做数据页面显示处理:非日期级别
noDateLevelData(noDateParmas) {
this.noDateLevelRoute(noDateParmas).then(
({ noDateConfigFlag, noDateRouteList, mergeNoDateRouteInfo }) => {
// 满足非日期级别航线的配置信息
// 处理属性
mergeNoDateRouteInfo.map((item) => {
if (item.config) {
this.hasOwnProperty(item, "typeOfGoods");
this.hasOwnProperty(item, "puporpuxCode");
this.hasOwnProperty(item, "serviceCode");
this.hasOwnProperty(item, "handlingCode");
this.hasOwnProperty(item, "subCategory");
this.setattrVal(item); // 设置属性值
}
});
this.routeList = noDateRouteList; // 航班航线列表
this.routesInfo = mergeNoDateRouteInfo; // 航班航线配置信息列表
}
);
},
// 拿到【接口调用和数据去重整合】的数据做数据页面显示处理:日期级别
dateLevelData({ dateParmas, noDateParmas }) {
this.dateLevelRoute(dateParmas).then((res) => {
const { dateConfigFlag, dateRouteList, mergeDateRouteInfo } = res;
if (dateConfigFlag) {
// 日期级别当前航班航线配置没有缺省的,就不用再去查询非日期级别了
// 处理属性
mergeDateRouteInfo.map((item) => {
if (item.config) {
this.hasOwnProperty(item, "typeOfGoods");
this.hasOwnProperty(item, "puporpuxCode");
this.hasOwnProperty(item, "serviceCode");
this.hasOwnProperty(item, "handlingCode");
this.hasOwnProperty(item, "subCategory");
this.setattrVal(item); // 设置属性值
}
});
this.routeList = dateRouteList; // 航班航线列表
this.routesInfo = mergeDateRouteInfo; // 航班航线配置信息列表
}
if (dateConfigFlag == false) {
// 航班航线有规则配置的
const dateListHas = mergeDateRouteInfo.filter(
(item) => item.config == true
);
// 航班航线没有规则配置的
const dateListNo = mergeDateRouteInfo.filter(
(item) => item.config == false
);
this.noDateLevelRoute(noDateParmas).then(
({ noDateConfigFlag, noDateRouteList, mergeNoDateRouteInfo }) => {
// 航班种类
this.flightKindName({
noDateConfigFlag,
noDateRouteList,
mergeNoDateRouteInfo,
dateRouteList,
dateListHas,
dateListNo,
});
}
);
}
});
},
// 航班种类
flightKindName({
noDateConfigFlag,
noDateRouteList,
mergeNoDateRouteInfo,
dateRouteList,
dateListHas,
dateListNo,
}) {
if (this.$route.query.flightKindName == "White Tail") {
// White Tail只展示当前查询的一条
const route = this.$route.query.flightRouteListStr;
let noDateRouteInfo, result;
this.routeList = dateRouteList;
// 从日期取
if (dateListHas.length) {
const dateRouteInfo = dateListHas.filter(
(item) => item.flightRoute == route
);
result = dateRouteInfo; // 航班航线配置信息列表
} else {
// 从非日期级别取
noDateRouteInfo = mergeNoDateRouteInfo.filter(
(item) => item.flightRoute == route
);
result = noDateRouteInfo; // 航班航线配置信息列表
}
if (result.length) {
// 处理属性
result.map((item) => {
if (item.config) {
this.hasOwnProperty(item, "typeOfGoods");
this.hasOwnProperty(item, "puporpuxCode");
this.hasOwnProperty(item, "serviceCode");
this.hasOwnProperty(item, "handlingCode");
this.hasOwnProperty(item, "subCategory");
this.setattrVal(item); // 设置属性值
}
});
this.routesInfo = result;
} else {
// 日期级别和非日期级别都没有配置信息的时候,
// 从数据整合的里面取一个对应的航线数据作为回显暂无数据处理。
noDateRouteInfo = mergeNoDateRouteInfo.filter(
(item) => item.route == route
);
this.routesInfo = noDateRouteInfo;
}
} else {
// 日期级别和航班种类为Purple Tail的时候
// 日期级别的时候要注意dateListNo里没有flightRoute字段,也就是说只有航班航线没有航班航线配置信息;
// 其次是非日期级别mergeNoDateRouteInfo也可能没有对应的数据,没有flightRoute字段。
// 那么这个时候使用mergeFlightRouteConfigObj方法就会出问题。
const result = this.mergeFlightRouteConfigObj(
dateListNo,
mergeNoDateRouteInfo
);
let dateList = dateListHas.concat(result);
// 处理属性
dateList.map((item) => {
if (item.config) {
this.hasOwnProperty(item, "typeOfGoods");
this.hasOwnProperty(item, "puporpuxCode");
this.hasOwnProperty(item, "serviceCode");
this.hasOwnProperty(item, "handlingCode");
this.hasOwnProperty(item, "subCategory");
this.setattrVal(item); // 设置属性值
}
});
this.routeList = dateRouteList;
this.routesInfo = dateList;
}
},
// 整合飞行航线配置信息
mergeFlightRouteConfigObj(routeList, dataList) {
if (dataList.length) {
let flightRoute1 = routeList.some((obj) =>
obj.hasOwnProperty("flightRoute")
);
let flightRoute2 = dataList.some((obj) =>
obj.hasOwnProperty("flightRoute")
);
const result = routeList.map((item1) => {
const item2 = dataList.find((item2) => {
if (flightRoute1) {
if (item2.route === item1.flightRoute) {
item2.config = true;
return item2;
}
} else if (flightRoute2) {
if (item2.flightRoute === item1.route) {
item2.config = true;
return item2;
}
}
}); // 返回当前相等的一条数据
if (item2) {
return { ...item1, ...item2 };
} else {
item1.config = false;
return item1; // 没有的返回当前的
}
});
return result;
} else {
// 没有航班航线配置的情况下
const result = routeList.map((item) => {
item.config = false;
if (item) {
return item;
}
});
return result;
}
},
// 回显时所用:判断对象是否存在某个属性,并且把这个属性值使用分号分隔
hasOwnProperty(item, key) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
......@@ -44,6 +363,45 @@ export default {
}
}
},
// 保存提交时所用:改方法主要用于提交保存时,再把数组转换成字符串,与hasOwnProperty相反
returnString(parmas, key) {
if (parmas.hasOwnProperty(key)) {
if (parmas[key].length) {
parmas[key] = parmas[key].join(";");
} else {
parmas[key] = null;
}
}
},
//排序
sorttodo(arr, chineseName) {
var index = 1,
newArr = [],
length = arr.length;
for (var i = 0; i < length; i++) {
if (arr[i].chineseName === chineseName) {
newArr[0] = arr[i];
} else {
newArr[index++] = arr[i];
}
}
return newArr;
},
// 数据字典排序
dicSort(val) {
let status1 = [];
let status0 = [];
let arr = [];
val.forEach((item) => {
if (item.status == 1) {
status1.push(item);
} else {
status0.push(item);
}
});
arr = status1.concat(status0);
return arr;
},
// 设置属性值
setattrVal(item) {
if (item.location) {
......@@ -66,46 +424,54 @@ export default {
if (item.destinationSite == null && item.notDestinationSite == null) {
item.isDestinationSite = "1";
}
let routes = [];
if (this.routeList.length) {
this.routeList.map((item) => {
routes.push(item.route);
});
routeRuleForm.routeSpecifyDateSeq = routes.join(";");
}
},
// 失焦事件
blurEvent({ originOfFlightNo }) {
this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
},
// 当前激活面板改变时触发
collapseChange(name) {
// console.log(name);
},
// 始发站
changeLocation(val) {
console.log("始发站:", val);
// console.log("始发站:", val);
},
// 目的站
changeDestinationSite(val) {
console.log("目的站:", val);
},
// 申报类别
changeCargoType(arr) {
console.log("申报类别:", arr);
},
// 货物类型
changeCargoStatus(arr) {
console.log("货物类型:", arr);
},
// 取件扫描号
changePuporpux(arr) {
console.log("取件扫描号:", arr);
},
// Service Code
changeServiceCode(arr) {
console.log("Service Code:", arr);
},
// Handling Code
changeHandlingCode(arr) {
console.log("Handling Code:", arr);
},
// Sub Category
changeSubCategory(arr) {
console.log("Sub Category:", arr);
// console.log("目的站:", val);
},
},
};
/*
【整个航班航线维度设置的回显逻辑以及数据处理思路】如下:
1:获取航班航线列表和航班航线配置信息列表。
2:如果航班航线配置信息列表有数据,先做航线去重。
3:拿航班航线列表和航班航线配置信息列表去做遍历,判断当前航班航线在航班航线配置信息列表中有没有对应的数据。
如果有给当前航班航线设置一个属性值为true的config属性,并且把当前航班航线与航线配置信息列表中对应的对象合并,
如果当前航班航线没有在航线配置列表中找到,那么直接给航班航线列表中的这条航线数据设置一个属性值为false的config属性。
4:当把航班航线列表和航班航线配置信息列表数据整合到一块以后,那么在做数据渲染的时候就可以根据config值来显示当前航班航线有没有航线配置信息,
从而显示暂无数据用来去展示“新增规则”按钮。
此外config属性还有一个作用就是在做日期级别航线查询的时候,如果日期级别的航线没有航线配置信息会走一次非日期级别的航线配置信息查询,
那么当有了这个config属性,如果在做日期级别航线配置信息查询的时候,当前日期级别航班航线列表与航班航线配置信息列表做遍历查询时,
且航班航线列表每一个航线都有航班航线配置信息,那么就可以使用every对航班航线列表与航班配置信息列表做数据整合之后做遍历。
当返回true时,那么就不需要再走一次非日期级别的航线配置信息查询了,当返回false说明航班航线列表中存在没有航班航线的配置信息,
那么这个时候就可以根据config属性值为false走一次非日期级别的航线配置信息查询;
5:【航班配舱设置】逻辑:根据路由跳转传参过来的querySpecifyData值,如果querySpecifyData等于2的时候就是非日期级别,
那么只需要走非日期级别的查询即可,如果querySpecifyData属性值等于1的时候,说明是日期级别的,那么则走日期级别的查询,
但是当航班航线列表和航班航线配置信息列表做数据整合之后返回的数组中的JSON对象中config属性值有一个为false,
那么如同上述第4条提的,就需要再走一次非日期级别的航线配置信息查询;反之则不需要;
6:【航班信息维护】逻辑:和上述第5条查询的区别之处是根据航班种类flightKindName字段是White Tail还是Purple Tail,
但是不管是哪种航班类型都是先走日期级别的航班航线配置信息查询,当有config属性值有一个为false的时候还需要走一次非日期级别的航班航线配置信息查询。
但是有一点就是White Tail只查询一条航班航线配置信息,根据从航班信息维护White Tail类型查看维度,
做路由跳转传参带过来的航线首先在日期级别航线配置信息中遍历查询有没有该航班航线的配置信息,如果有,
那么则不需要再走一次非日期级别的航班航线配置信息查询,如果没有那么则再走一次非日期航班航线配置信息查询。
但是航线优先级显示的航线还是取日期级别航班航线列表中的航线。
7:航班航线信息列表和航班航线配置信息列表在做完航班航线配置信息列表去重之后和航班航线列表做数据整合之后,
还要对所有关于显示的数据做处理,比如页面上所有关于checkbox的勾选框radio单选框;
8: 在保存提交的时候对所有关于页面checkbox的勾选框做数据处理
*/
......
export const routeData1 = {
code: 200,
msg: "操作成功",
data: {
list: [
{
id: 3337,
createTime: "2023-09-21 09:50:01",
createUserId: "5749",
createUserName: "wjh",
updateTime: null,
updateUserName: null,
purposeOfFlightNo: "JC001",
location: null,
includeUrsa: "P_",
notIncludeUrsa: null,
minNumOfPieces: null,
maxNumOfPieces: null,
minWeight: null,
maxWeight: null,
serviceCode: null,
declarationCategory: null,
typeOfGoods: null,
subCategory: null,
status: "1",
whetherHistory: "0",
historyId: null,
updateUserId: null,
notLocation: null,
handlingCode: null,
portName: "PVG",
puporpuxCode: null,
flightRoute: "USA",
routePriority: "1",
ruleDate: "2023-09-21",
routeSpecifyDateSeq: "USA;SEYB",
destinationSite: null,
notDestinationSite: null,
},
{
id: 3338,
createTime: "2023-09-21 09:50:03",
createUserId: "5749",
createUserName: "wjh",
updateTime: null,
updateUserName: null,
purposeOfFlightNo: "JC001",
location: null,
includeUrsa: "P_",
notIncludeUrsa: null,
minNumOfPieces: null,
maxNumOfPieces: null,
minWeight: null,
maxWeight: null,
serviceCode: null,
declarationCategory: null,
typeOfGoods: null,
subCategory: null,
status: "1",
whetherHistory: "0",
historyId: null,
updateUserId: null,
notLocation: null,
handlingCode: null,
portName: "PVG",
puporpuxCode: null,
flightRoute: "SEYB",
routePriority: "2",
ruleDate: "2023-09-21",
routeSpecifyDateSeq: "USA;SEYB",
destinationSite: null,
notDestinationSite: null,
},
],
routeList: [
{
fltNo: "JC001",
route: "USA",
routePriority: "1",
},
{
fltNo: "JC001",
route: "SEYB",
routePriority: "2",
},
],
},
};
export const routeData2 = {
code: 200,
msg: "操作成功",
data: {
list: [
{
id: 3335,
createTime: "2023-09-21 09:49:40",
createUserId: "5749",
createUserName: "wjh",
updateTime: "2023-09-21 09:56:12",
updateUserName: "wjh",
purposeOfFlightNo: "JC001",
location: null,
includeUrsa: "P_",
notIncludeUrsa: null,
minNumOfPieces: null,
maxNumOfPieces: null,
minWeight: null,
maxWeight: null,
serviceCode: null,
declarationCategory: null,
typeOfGoods: null,
subCategory: null,
status: "1",
whetherHistory: "0",
historyId: null,
updateUserId: 5749,
notLocation: null,
handlingCode: null,
portName: "PVG",
puporpuxCode: null,
flightRoute: "USA",
routePriority: "1",
ruleDate: null,
routeSpecifyDateSeq: "USA;SEYB;LKE",
destinationSite: null,
notDestinationSite: null,
},
{
id: 3336,
createTime: "2023-09-21 09:49:46",
createUserId: "5749",
createUserName: "wjh",
updateTime: "2023-09-21 09:56:12",
updateUserName: "wjh",
purposeOfFlightNo: "JC001",
location: null,
includeUrsa: "P_",
notIncludeUrsa: null,
minNumOfPieces: null,
maxNumOfPieces: null,
minWeight: null,
maxWeight: null,
serviceCode: null,
declarationCategory: null,
typeOfGoods: null,
subCategory: null,
status: "1",
whetherHistory: "0",
historyId: null,
updateUserId: 5749,
notLocation: null,
handlingCode: null,
portName: "PVG",
puporpuxCode: null,
flightRoute: "SEYB",
routePriority: "2",
ruleDate: null,
routeSpecifyDateSeq: "USA;SEYB;LKE",
destinationSite: null,
notDestinationSite: null,
},
],
routeList: [
{
fltNo: "JC001",
route: "USA",
routePriority: "1",
},
{
fltNo: "JC001",
route: "SEYB",
routePriority: "2",
},
{
fltNo: "JC001",
route: "LKE",
routePriority: "3",
},
],
},
};
......@@ -285,6 +285,7 @@ export default {
flightRouteListStr: route,
status: "",
pageName: "flightRandConfig",
disable: true,
},
});
},
......
<template>
<div>
<el-form class="form-header" :model="queryParams" ref="queryForm" label-position="right" label-width="auto"
size="small">
<el-form
class="form-header"
:model="queryParams"
ref="queryForm"
label-position="right"
label-width="auto"
size="small"
>
<el-row>
<el-col :span="6">
<el-form-item label="航班日期从" prop="fltDateStart">
<el-date-picker class="formItem" value-format="yyyy-MM-dd" v-model="queryParams.fltDateStart" type="date"
placeholder="选择日期">
<el-date-picker
class="formItem"
value-format="yyyy-MM-dd"
v-model="queryParams.fltDateStart"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="到" prop="fltDateEnd">
<el-date-picker class="formItem" value-format="yyyy-MM-dd" v-model="queryParams.fltDateEnd" type="date"
placeholder="选择日期">
<el-date-picker
class="formItem"
value-format="yyyy-MM-dd"
v-model="queryParams.fltDateEnd"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班号" prop="fltNo">
<el-input class="formItem" v-model="queryParams.fltNo" placeholder="请输入航班号" clearable />
<el-input
class="formItem"
v-model="queryParams.fltNo"
placeholder="请输入航班号"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班类型" prop="typeId">
<el-select class="formItem" v-model="queryParams.typeId" placeholder="请选择航班类型" clearable>
<el-option v-for="dict in selectOption.flightTypelist" :key="dict.id" :label="dict.chineseName"
:value="dict.id" />
<el-select
class="formItem"
v-model="queryParams.typeId"
placeholder="请选择航班类型"
clearable
>
<el-option
v-for="dict in selectOption.flightTypelist"
:key="dict.id"
:label="dict.chineseName"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班状态" prop="statusId">
<el-select class="formItem" v-model="queryParams.statusId" placeholder="请选择航班状态" clearable>
<el-option v-for="dict in selectOption.flightStatuslist" :key="dict.id" :label="dict.chineseName"
:value="dict.id" />
<el-select
class="formItem"
v-model="queryParams.statusId"
placeholder="请选择航班状态"
clearable
>
<el-option
v-for="dict in selectOption.flightStatuslist"
:key="dict.id"
:label="dict.chineseName"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班种类" prop="flightKindId">
<el-select class="formItem" v-model="queryParams.flightKindId" placeholder="请选择航班种类" clearable>
<el-option v-for="dict in selectOption.flightKindlist" :key="dict.id" :label="dict.chineseName"
:value="dict.id" />
<el-select
class="formItem"
v-model="queryParams.flightKindId"
placeholder="请选择航班种类"
clearable
>
<el-option
v-for="dict in selectOption.flightKindlist"
:key="dict.id"
:label="dict.chineseName"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-button class="mt10" type="primary" icon="el-icon-search" size="mini" :loading="loading" @click="handleQuery">搜索
<el-button
class="mt10"
type="primary"
icon="el-icon-search"
size="mini"
:loading="loading"
@click="handleQuery"
>搜索
</el-button>
<el-button class="mt10" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button class="mt10" type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['base:flightInfo:add']">
新增</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-check" size="mini" :disabled="ids.length == 0"
@click="handleFlightStatus('flightStatus10')" v-hasPermi="['base:flightInfo:open']">自动配舱开启</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-close" size="mini" :disabled="ids.length == 0"
@click="handleFlightStatus('flightStatus80')" v-hasPermi="['base:flightInfo:close']">自动配舱关闭</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-check" size="mini" :disabled="ids.length == 0"
@click="autoPushBatch('open')" v-hasPermi="['base:flightInfo:autoPushOpen']">自动推送开启</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-close" size="mini" :disabled="ids.length == 0"
@click="autoPushBatch('close')" v-hasPermi="['base:flightInfo:autoPushClose']">自动推送关闭</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-check" size="mini" :disabled="ids.length == 0"
@click="whiteListSwitchStatus(1)" v-hasPermi="['base:flightInfo:whiteOpen']">白名单自动配舱开启
<el-button
class="mt10"
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
<el-button
class="mt10"
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['base:flightInfo:add']"
>
新增</el-button
>
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-check"
size="mini"
:disabled="ids.length == 0"
@click="handleFlightStatus('flightStatus10')"
v-hasPermi="['base:flightInfo:open']"
>自动配舱开启</el-button
>
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-close"
size="mini"
:disabled="ids.length == 0"
@click="handleFlightStatus('flightStatus80')"
v-hasPermi="['base:flightInfo:close']"
>自动配舱关闭</el-button
>
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-check"
size="mini"
:disabled="ids.length == 0"
@click="autoPushBatch('open')"
v-hasPermi="['base:flightInfo:autoPushOpen']"
>自动推送开启</el-button
>
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-close"
size="mini"
:disabled="ids.length == 0"
@click="autoPushBatch('close')"
v-hasPermi="['base:flightInfo:autoPushClose']"
>自动推送关闭</el-button
>
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-check"
size="mini"
:disabled="ids.length == 0"
@click="whiteListSwitchStatus(1)"
v-hasPermi="['base:flightInfo:whiteOpen']"
>白名单自动配舱开启
</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-close" size="mini" :disabled="ids.length == 0"
@click="whiteListSwitchStatus(0)" v-hasPermi="['base:flightInfo:whiteClose']">白名单自动配舱关闭
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-close"
size="mini"
:disabled="ids.length == 0"
@click="whiteListSwitchStatus(0)"
v-hasPermi="['base:flightInfo:whiteClose']"
>白名单自动配舱关闭
</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-check" size="mini" :disabled="ids.length == 0"
@click="BlackListSwitchStatus(1)">黑名单自动配舱开启
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-check"
size="mini"
:disabled="ids.length == 0"
@click="BlackListSwitchStatus(1)"
>黑名单自动配舱开启
</el-button>
<el-button class="mt10" type="primary" icon="el-icon-circle-close" size="mini" :disabled="ids.length == 0"
@click="BlackListSwitchStatus(0)">黑名单自动配舱关闭
<el-button
class="mt10"
type="primary"
icon="el-icon-circle-close"
size="mini"
:disabled="ids.length == 0"
@click="BlackListSwitchStatus(0)"
>黑名单自动配舱关闭
</el-button>
<el-button class="mt10" type="danger" icon="el-icon-delete" size="mini" :disabled="ids.length == 0"
@click="handleDelete" v-hasPermi="['base:flightInfo:delete']">删除
<el-button
class="mt10"
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="ids.length == 0"
@click="handleDelete"
v-hasPermi="['base:flightInfo:delete']"
>删除
</el-button>
</el-form>
<Tables ref="flightInfoTable" ductName="FlightInformation" :data="findAllFltDatList" :headerData="tableHeader"
:order="true" :selection="true" :totalCount="total" :loading="loading" :limitSize="queryParams.limitSize"
:page="queryParams.pageNum" :shiftKey="shiftKey" :height="tableHeight" :pageSizes="[20, 30, 40, 50, 100]"
@tableSelect="tableSelect" @tableSelectAll="tableSelectAll" @currentChange="currentChange" @sortChange="sortChange"
@sizeChange="sizeChange">
<Tables
ref="flightInfoTable"
ductName="FlightInformation"
:data="findAllFltDatList"
:headerData="tableHeader"
:order="true"
:selection="true"
:totalCount="total"
:loading="loading"
:limitSize="queryParams.limitSize"
:page="queryParams.pageNum"
:shiftKey="shiftKey"
:height="tableHeight"
:pageSizes="[20, 30, 40, 50, 100]"
@tableSelect="tableSelect"
@tableSelectAll="tableSelectAll"
@currentChange="currentChange"
@sortChange="sortChange"
@sizeChange="sizeChange"
>
<template slot="optionColumn">
<el-table-column v-if="findAllFltDatList.length > 0" label="操作" align="center"
class-name="small-padding fixed-width" :fixed="tableHeader.length > 10 ? 'right' : false" width="160">
<el-table-column
v-if="findAllFltDatList.length > 0"
label="操作"
align="center"
class-name="small-padding fixed-width"
:fixed="tableHeader.length > 10 ? 'right' : false"
width="160"
>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:flightInfo:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-link" @click="goFlightAllocConfig(scope.row)">查看维度
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['base:flightInfo:update']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-link"
@click="goFlightAllocConfig(scope.row)"
>查看维度
</el-button>
</template>
</el-table-column>
</template>
</Tables>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="60%" :close-on-click-modal="false" :append-to-body="true"
:show-close="false" @close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto" size="small">
<el-dialog
:title="title"
:visible.sync="open"
width="60%"
:close-on-click-modal="false"
:append-to-body="true"
:show-close="false"
@close="cancel"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-position="right"
label-width="auto"
size="small"
>
<el-row>
<el-col :span="12">
<el-form-item label="航班号" prop="fltNo">
<el-input class="wid80" @blur="blurfltNo" :disabled="formdisabled.fltNo" v-model="form.fltNo"
placeholder="请输入航班号" maxlength="20" />
<el-input
class="wid80"
@blur="blurfltNo"
:disabled="formdisabled.fltNo"
v-model="form.fltNo"
placeholder="请输入航班号"
maxlength="20"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="该航班预审状态:">
<el-tag v-if="preAudit" :type="preAudit == '开启' ? 'success' : 'info'" effect="dark">{{ preAudit }}
<el-tag
v-if="preAudit"
:type="preAudit == '开启' ? 'success' : 'info'"
effect="dark"
>{{ preAudit }}
</el-tag>
</el-form-item>
</el-col>
......@@ -115,56 +304,135 @@
<el-row>
<el-col :span="12">
<el-form-item label="航班日期" prop="fltDate">
<el-date-picker class="wid80" :disabled="formdisabled.fltDate" clearable size="small" v-model="form.fltDate"
type="date" value-format="yyyy-MM-dd" placeholder="选择航班日期">
<el-date-picker
class="wid80"
:disabled="formdisabled.fltDate"
clearable
size="small"
v-model="form.fltDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择航班日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="航班种类" prop="kindId">
<el-select class="wid80" v-model="form.kindId" :disabled="formdisabled.kindId" placeholder="请选择航班种类"
@change="kindChange">
<el-option v-for="item in selectOption.flightKindlist" :key="item.id" :label="item.chineseName"
:value="item.id">
<el-select
class="wid80"
v-model="form.kindId"
:disabled="formdisabled.kindId"
placeholder="请选择航班种类"
@change="kindChange"
>
<el-option
v-for="item in selectOption.flightKindlist"
:key="item.id"
:label="item.chineseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin-bottom:5px">
<el-row style="margin-bottom: 5px">
<el-col :span="12">
<el-form-item>
<template slot="label">
<div style="display:inline-block">
<span class="error-route">*</span>
航班路线
<el-tooltip class="item" effect="dark" content="输入航班号后获取航线信息。航班种类为Purple Tail时可以进行多选,切换航班种类后需重新选择航线"
placement="top-start">
<span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span>
<div style="display: inline-block">
<span class="error-route">*</span>
航班路线
<el-tooltip
class="item"
effect="dark"
content="输入航班号后获取航线信息。航班种类为Purple Tail时可以进行多选,切换航班种类后需重新选择航线"
placement="top-start"
>
<span
class="el-icon-warning"
style="color: #1890ff; font-size: 16px"
></span>
</el-tooltip>
</div>
</template>
<el-select v-if="routeMultiple" ref="routeSelect" class="wid80" v-model="form.route"
:disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" @blur="blurRoute"
:loading="routeLoading" :multiple='true' :key="routeMultiple">
<el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route">
<el-select
v-if="routeMultiple"
ref="routeSelect"
class="wid80"
v-model="form.route"
:disabled="formdisabled.route"
placeholder="请选择航线"
no-data-text="未查询到航线"
@change="routeChange"
@blur="blurRoute"
:loading="routeLoading"
:multiple="true"
:key="routeMultiple"
>
<el-option
v-for="item in routeList"
:key="item.id"
:label="item.route"
:value="item.isEtesRoute"
>
<span style="float: left">{{ item.route }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.isEtesRoute == 'Y' ? '【ET86】航线' : ''
}}</span>
</el-option>
</el-select>
<el-select v-if="routeMultiple == false" ref="routeSelect" class="wid80" v-model="form.route"
:disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" @blur="blurRoute"
:loading="routeLoading" :multiple='false' :key="routeMultiple">
<el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route">
<el-select
v-if="routeMultiple == false"
ref="routeSelect"
class="wid80"
v-model="form.route"
:disabled="formdisabled.route"
placeholder="请选择航线"
no-data-text="未查询到航线"
@change="routeChange"
@blur="blurRoute"
:loading="routeLoading"
:multiple="false"
:key="routeMultiple"
>
<el-option
v-for="item in routeList"
:key="item.id"
:label="item.route"
:value="item.isEtesRoute"
>
<span style="float: left">{{ item.route }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.isEtesRoute == 'Y' ? '【ET86】航线' : ''
}}</span>
</el-option>
</el-select>
<span ref="errorRoute" class="el-form-item__error" v-show="routeError">航班路线不能为空</span>
<span
ref="errorRoute"
class="el-form-item__error"
v-show="routeError"
>航班路线不能为空</span
>
</el-form-item>
<div class="formTips" v-if="title == '修改航班信息'">注意!:移除航线,相对应日期级别航线维度会同时删除</div>
<div class="formTips" v-if="title == '修改航班信息'">
注意!:移除航线,相对应日期级别航线维度会同时删除
</div>
</el-col>
<el-col :span="12">
<el-form-item label="航班类型" prop="typeId">
<el-select class="wid80" v-model="form.typeId" placeholder="请选择航班类型">
<el-option v-for="item in selectOption.flightTypelist" :key="item.id" :label="item.chineseName"
:value="item.id">
<el-select
class="wid80"
v-model="form.typeId"
placeholder="请选择航班类型"
>
<el-option
v-for="item in selectOption.flightTypelist"
:key="item.id"
:label="item.chineseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
......@@ -173,31 +441,60 @@
<el-row>
<el-col :span="12">
<el-form-item label="航班状态" prop="statusId">
<el-select class="wid80" :disabled="true" v-model="form.statusId" placeholder="请选择航班状态">
<el-option v-for="item in selectOption.flightStatuslist" :key="item.id" :label="item.chineseName"
:value="item.id">
<el-select
class="wid80"
:disabled="true"
v-model="form.statusId"
placeholder="请选择航班状态"
>
<el-option
v-for="item in selectOption.flightStatuslist"
:key="item.id"
:label="item.chineseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原始重量(KG)" prop="originalWeight">
<el-input-number class="wid80" @change="LowHighAvailable" :min="0" :precision="0" placeholder="请输入原始重量(KG)"
v-model="form.originalWeight" v-input-filter></el-input-number>
<el-input-number
class="wid80"
@change="LowHighAvailable"
:min="0"
:precision="0"
placeholder="请输入原始重量(KG)"
v-model="form.originalWeight"
v-input-filter
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="额外增重百分比" prop="extraWeightPercent">
<el-input-number class="wid80" @change="LowHighAvailable" :min="0" :precision="0" placeholder="请输入额外增重百分比"
v-model="form.extraWeightPercent" v-input-filter></el-input-number>
<el-input-number
class="wid80"
@change="LowHighAvailable"
:min="0"
:precision="0"
placeholder="请输入额外增重百分比"
v-model="form.extraWeightPercent"
v-input-filter
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否开启高低价" prop="highLowPriceFlg">
<el-switch class="wid80" @change="LowHighAvailable" v-model="form.highLowPriceFlg" :active-value="1"
:inactive-value="0" active-color="#13ce66">
<el-switch
class="wid80"
@change="LowHighAvailable"
v-model="form.highLowPriceFlg"
:active-value="1"
:inactive-value="0"
active-color="#13ce66"
>
</el-switch>
</el-form-item>
</el-col>
......@@ -205,72 +502,120 @@
<el-row>
<el-col :span="12">
<el-form-item label="今日航班预审状态" prop="isNeedRequired">
<el-select class="wid80" v-model="form.isNeedRequired" placeholder="">
<el-option label="未设置" :value="2">
</el-option>
<el-option label="开启" :value="1">
</el-option>
<el-option label="关闭" :value="0">
</el-option>
<el-select
class="wid80"
v-model="form.isNeedRequired"
placeholder=""
>
<el-option label="未设置" :value="2"> </el-option>
<el-option label="开启" :value="1"> </el-option>
<el-option label="关闭" :value="0"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高价百分比" prop="highPriceWeightPercent">
<el-input-number class="wid80" :disabled="ishighPriceWeightPercent" @change="LowHighAvailable"
placeholder="开启高低价后可修改" v-model="form.highPriceWeightPercent"></el-input-number>
<el-input-number
class="wid80"
:disabled="ishighPriceWeightPercent"
@change="LowHighAvailable"
placeholder="开启高低价后可修改"
v-model="form.highPriceWeightPercent"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="低价百分比" prop="lowPriceWeightPercent">
<el-input-number class="wid80" :disabled="true" placeholder="开启高低价后计算"
v-model="form.lowPriceWeightPercent"></el-input-number>
<el-input-number
class="wid80"
:disabled="true"
placeholder="开启高低价后计算"
v-model="form.lowPriceWeightPercent"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高价可配重量" prop="highAvailableWeight">
<el-input-number class="wid80" :disabled="true" placeholder="开启高低价后计算" v-model="form.highAvailableWeight"
:precision="2"></el-input-number>
<el-input-number
class="wid80"
:disabled="true"
placeholder="开启高低价后计算"
v-model="form.highAvailableWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="低价可配重量" prop="lowAvailableWeight">
<el-input-number class="wid80" :disabled="true" placeholder="开启高低价后计算" v-model="form.lowAvailableWeight"
:precision="2"></el-input-number>
<el-input-number
class="wid80"
:disabled="true"
placeholder="开启高低价后计算"
v-model="form.lowAvailableWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高价已配重量" prop="highAllocatedWeight">
<el-input-number class="wid80" :disabled="true" placeholder="请输入高价已配重量" v-model="form.highAllocatedWeight"
:precision="2"></el-input-number>
<el-input-number
class="wid80"
:disabled="true"
placeholder="请输入高价已配重量"
v-model="form.highAllocatedWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="低价已配重量" prop="lowAllocatedWeight">
<el-input-number class="wid80" :disabled="true" placeholder="请输入低价已配重量" v-model="form.lowAllocatedWeight"
:precision="2"></el-input-number>
<el-input-number
class="wid80"
:disabled="true"
placeholder="请输入低价已配重量"
v-model="form.lowAllocatedWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="已配总重量" prop="alloctedWeight">
<el-input-number class="wid80" :disabled="true" placeholder="请输入已配总重量" v-model="form.alloctedWeight"
:precision="2"></el-input-number>
<el-input-number
class="wid80"
:disabled="true"
placeholder="请输入已配总重量"
v-model="form.alloctedWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特殊规则预留总重量" prop="accountTotalWeight">
<el-input-number class="wid80" v-model="form.accountTotalWeight" disabled placeholder="配置特殊规则后计算" />
<el-input-number
class="wid80"
v-model="form.accountTotalWeight"
disabled
placeholder="配置特殊规则后计算"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特殊规则已配重量" prop="accountAllocatedWeight">
<el-input-number class="wid80" v-model="form.accountAllocatedWeight" disabled placeholder="配置特殊规则后计算" />
<el-form-item
label="特殊规则已配重量"
prop="accountAllocatedWeight"
>
<el-input-number
class="wid80"
v-model="form.accountAllocatedWeight"
disabled
placeholder="配置特殊规则后计算"
/>
</el-form-item>
</el-col>
</el-row>
......@@ -280,12 +625,22 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<el-dialog title="未删除成功航班" width="40%" center :visible.sync="dialogTableVisible" :close-on-click-modal="false"
:append-to-body="true" :close-on-press-escape="false">
<el-dialog
title="未删除成功航班"
width="40%"
center
:visible.sync="dialogTableVisible"
:close-on-click-modal="false"
:append-to-body="true"
:close-on-press-escape="false"
>
<el-table :data="gridData">
<el-table-column property="fltNo" label="航班号"></el-table-column>
<el-table-column property="fltDate" label="航班日期"></el-table-column>
<el-table-column property="alloctedWeight" label="已配重量"></el-table-column>
<el-table-column
property="alloctedWeight"
label="已配重量"
></el-table-column>
</el-table>
</el-dialog>
</div>
......@@ -302,11 +657,11 @@ import {
updateStatusBatch,
updateAutoPushBatch,
updateWhiteListSwitchBatch,
updateBlackListSwitchBatch
updateBlackListSwitchBatch,
} from "@/api/findAllFltData";
import { getpreAudit } from '@/api/system/preReview.js'
import { queryRouteByFltNo } from '@/api/destinationFlight.js'
import { getpreAudit } from "@/api/system/preReview.js";
import { queryRouteByFltNo } from "@/api/destinationFlight.js";
import { queryRoute } from "@/api/system/dictionary.js";
export default {
name: "FlightInformationMaintenance",
data() {
......@@ -355,14 +710,14 @@ export default {
{
required: true,
message: "原始重量(KG)不能为空",
trigger: ["change","blur"],
trigger: ["change", "blur"],
},
],
},
//原航班规则数据
findAllFltDatList: [],
//表头
tableHeader: this.tableHeaders['FlightInformation'],
tableHeader: this.tableHeaders["FlightInformation"],
//删除失败数据
gridData: [],
//form属性禁用状态
......@@ -499,7 +854,7 @@ export default {
},
created() {
//查询条件数据源
this.queryParams.fltDateStart = this.nowDate()
this.queryParams.fltDateStart = this.nowDate();
if (this.$store.state.tagsView.cachedViews.length == 0) {
this.findFltConditionData();
this.findAllFltData();
......@@ -514,7 +869,7 @@ export default {
// })
},
activated() {
this.ids = []
this.ids = [];
this.findFltConditionData();
this.findAllFltData();
},
......@@ -532,22 +887,22 @@ export default {
this.shiftKey = false;
}
});
this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 120;
this.tableHeight =
window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 120;
},
methods: {
//输入航班号后
blurfltNo() {
// this.routeList = []
this.form.accountTotalWeight = 0
this.form.accountAllocatedWeight = 0
this.form.accountTotalWeight = 0;
this.form.accountAllocatedWeight = 0;
if (
this.form.fltNo != null &&
this.form.fltNo != undefined &&
this.form.fltNo != ""
) {
this.form.fltNo = this.form.fltNo.toUpperCase();
this.perStatus(this.form.fltNo)
this.perStatus(this.form.fltNo);
findFltCommonConf(this.form).then((response) => {
if (response.code == 200) {
//额外增重百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置为0,不可编辑
......@@ -603,30 +958,28 @@ export default {
this.msgError(response.msg);
}
});
this.routeLoading = true
this.routeLoading = true;
//获取航线
queryRouteByFltNo({ fltNo: this.form.fltNo }).then(res => {
this.routeLoading = false
if (res.code === 200) {
if(res.data.list.length){
let isEtesRoute = res.data.list.filter((item) => item.isEtesRoute == "N"); // 过滤ET86航线
this.routeList = isEtesRoute
if (isEtesRoute.length == 0) {
this.form.route = "";
queryRouteByFltNo({ fltNo: this.form.fltNo })
.then((res) => {
this.routeLoading = false;
if (res.code === 200) {
if (res.data.list.length) {
this.routeList = res.data.list;
}
if (res.data.list.length == 0) {
this.form.route = "";
this.routeList = [];
this.msgError("该航班没有设置航线");
}
} else {
this.msgWarning(res.msg);
}
if (res.data.list.length == 0) {
this.form.route = "";
this.routeList = []
this.msgError("该航班没有设置航线");
}
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.routeLoading = false
console.log(err)
})
})
.catch((err) => {
this.routeLoading = false;
console.log(err);
});
} else {
this.form.route = "";
this.routeList = [];
......@@ -634,18 +987,18 @@ export default {
},
//航班种类修改
kindChange(val) {
this.selectOption.flightKindlist.forEach(item => {
this.selectOption.flightKindlist.forEach((item) => {
if (item.id == val) {
if (item.chineseName.indexOf('White') >= 0) {
this.routeMultiple = false
this.form.route = ''
} else if (item.chineseName.indexOf('Purple') >= 0) {
this.routeMultiple = true
this.form.route = []
if (item.chineseName.indexOf("White") >= 0) {
this.routeMultiple = false;
this.form.route = "";
} else if (item.chineseName.indexOf("Purple") >= 0) {
this.routeMultiple = true;
this.form.route = [];
}
this.routeError = true
this.routeError = true;
}
})
});
// this.$refs.routeSelect.$forceUpdate()
},
//查询条件数据源
......@@ -665,15 +1018,24 @@ export default {
},
//获取航班预审状态
perStatus(val) {
getpreAudit({ fltNo: val, page: 1, size: 20 }).then(res => {
if (res.code === 200) {
this.preAudit = res.data.list.length == 0 ? '关闭' : res.data.list[0].status == 0 ? '关闭' : res.data.list[0].status == 1 ? '开启' : ''
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
getpreAudit({ fltNo: val, page: 1, size: 20 })
.then((res) => {
if (res.code === 200) {
this.preAudit =
res.data.list.length == 0
? "关闭"
: res.data.list[0].status == 0
? "关闭"
: res.data.list[0].status == 1
? "开启"
: "";
} else {
this.msgWarning(res.msg);
}
})
.catch((err) => {
console.log(err);
});
},
/** 航班信息维护查询*/
findAllFltData() {
......@@ -706,7 +1068,7 @@ export default {
handleAdd() {
this.reset();
this.findFltConditionData();
this.preAudit = null
this.preAudit = null;
this.open = true;
this.title = "添加航班信息";
this.form.id = null;
......@@ -728,8 +1090,8 @@ export default {
this.formdisabled.originalWeight = false;
this.routeError = false;
this.$nextTick(() => {
this.$refs.form.clearValidate()
})
this.$refs.form.clearValidate();
});
},
//计算高低价可配
LowHighAvailable() {
......@@ -749,8 +1111,10 @@ export default {
this.$set(
this.form,
"highAvailableWeight",
(Weight - this.form.accountTotalWeight - (this.form.alloctedWeight - this.form.accountAllocatedWeight)) *
(this.form.highPriceWeightPercent / 100)
(Weight -
this.form.accountTotalWeight -
(this.form.alloctedWeight - this.form.accountAllocatedWeight)) *
(this.form.highPriceWeightPercent / 100)
);
this.$set(
this.form,
......@@ -773,7 +1137,7 @@ export default {
this.form,
"highAvailableWeight",
(Weight - this.form.alloctedWeight) *
(this.form.highPriceWeightPercent / 100)
(this.form.highPriceWeightPercent / 100)
);
}
} else {
......@@ -785,7 +1149,10 @@ export default {
this.$set(
this.form,
"lowAvailableWeight",
(Weight - this.form.accountTotalWeight - (this.form.alloctedWeight - this.form.accountAllocatedWeight)) - this.form.highAvailableWeight
Weight -
this.form.accountTotalWeight -
(this.form.alloctedWeight - this.form.accountAllocatedWeight) -
this.form.highAvailableWeight
);
//this.form.lowAvailableWeight = Weightall - this.form.HighAvailableWeight;
} else if (
......@@ -817,7 +1184,9 @@ export default {
Weightall() {
let Weight = 0;
if (this.form.extraWeightPercent > 0) {
Weight = this.form.originalWeight * (this.form.extraWeightPercent / 100) + this.form.originalWeight;
Weight =
this.form.originalWeight * (this.form.extraWeightPercent / 100) +
this.form.originalWeight;
} else {
Weight = this.form.originalWeight;
}
......@@ -825,13 +1194,13 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
if(row.statusName == "已删除"){
if (row.statusName == "已删除") {
this.msgError("已删除不可操作");
return
return;
}
this.reset();
this.findFltConditionData();
this.perStatus(row.fltNo)
this.perStatus(row.fltNo);
this.open = true;
this.title = "修改航班信息";
//航班号
......@@ -845,7 +1214,7 @@ export default {
findFltById(row).then((response) => {
if (response.code == 200) {
this.form = response.data;
this.form.route = this.form.route.split(';')
this.form.route = this.form.route.split(";");
//是否开启高低价
// this.form.highLowPriceFlg = this.form.highLowPriceFlg === 1 ? true : false;
//是否预审
......@@ -854,126 +1223,144 @@ export default {
// this.LowHighAvailable();
//航线
this.selectOption.flightKindlist.forEach(item => {
this.selectOption.flightKindlist.forEach((item) => {
if (item.id == this.form.kindId) {
if (item.chineseName.indexOf('White') >= 0) {
this.formdisabled.route = true
} else if (item.chineseName.indexOf('Purple') >= 0) {
this.formdisabled.route = false
this.routeMultiple = true
if (item.chineseName.indexOf("White") >= 0) {
this.formdisabled.route = true;
} else if (item.chineseName.indexOf("Purple") >= 0) {
this.formdisabled.route = false;
this.routeMultiple = true;
//获取航线
queryRouteByFltNo({ fltNo: this.form.fltNo }).then(res => {
this.routeLoading = false
if (res.code === 200) {
if(res.data.list.length){
let isEtesRoute = res.data.list.filter((item) => item.isEtesRoute == "N"); // 过滤ET86航线
this.routeList = isEtesRoute
}else{
this.routeList = []
queryRouteByFltNo({ fltNo: this.form.fltNo })
.then((res) => {
this.routeLoading = false;
if (res.code === 200) {
if (res.data.list.length) {
this.routeList = res.data.list;
} else {
this.routeList = [];
}
} else {
this.msgWarning(res.msg);
}
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.routeLoading = false
console.log(err)
})
})
.catch((err) => {
this.routeLoading = false;
console.log(err);
});
}
}
})
this.ishighPriceWeightPercent = this.form.highLowPriceFlg === 1 ? false : true
});
this.ishighPriceWeightPercent =
this.form.highLowPriceFlg === 1 ? false : true;
} else {
this.msgError(response.msg);
}
});
},
//查看航班维度
goFlightAllocConfig(val) {
if(val.statusName == "已删除"){
/*
查看航班维度
不仅分为航班种类又分当前航班航线是不是ET86,
如果航班航种类是Purple Tail,遍历航班航线查询的是不是全都是ET86航线,如果全部是ET86航线,那么不做跳转。
如果是White Tail也就是只差当前的一条航班航线,如果当前航班航线是ET86航线那么就不做跳转;
*/
goFlightAllocConfig(row) {
if (row.statusName == "已删除") {
this.msgError("已删除不可操作");
return
return;
}
/*
航班信息维护跳转过来,不管是White Tail还是Purple Tail:
Purple Tail
{
purposeOfFlightNo: "LK002",
flightDate: "2023-09-27",
flightRouteListStr: "PVG;PEK;PVG-PEK",
status: ""
}
White Tail
{
purposeOfFlightNo: "LK002",
flightRouteListStr: "PVG;PEK;PVG-PEK",
status: ""
}
航班配舱设置:
非日期级别
{
flightDate: ""
flightRoute: ""
purposeOfFlightNo: "A381"
status: ""
}
有日期级别
{
flightDate: ""
flightRoute: ""
purposeOfFlightNo: "A381"
status: ""
}
{
flightDate: "2023-09-21"
flightRoute: ""
flightRouteListStr: "",
purposeOfFlightNo: "A381"
status: ""
}
航班顺位
{
flightDate: "2023-07-01"
flightRoute: ""
purposeOfFlightNo: "LP003"
status: ""
}
{
flightRoute: ""
flightRouteListStr: "",
purposeOfFlightNo: "LP003"
status: ""
}
*/
this.$router.push({
path: "/routeInfo",
query: {
flightDate: val.fltDate,
purposeOfFlightNo: val.fltNo,
flightRouteListStr: val.route,
status: val.status,
flightKindName: val.flightKindName,
pageName: "flightInformationMaintenance",
},
});
let params = {
fltNo: row.fltNo,
page: 1,
size: 20,
};
let routeInfo = {
fltNo: "",
isEtesRoute: false,
fltRoute: "",
};
queryRoute(params)
.then((res) => {
const { code, data } = res;
const et86RouteList = [];
if (code == 200) {
if (data.list.length) {
// Purple Tail是不是全部是ET86航线
routeInfo.isEtesRoute = data.list.every(
(item) => item.isEtesRoute == "Y"
);
// 有没有ET86航线
const isEtesRoute = data.list.filter(
(item) => item.isEtesRoute == "Y"
);
// 处理alert提示语展示数据
if (isEtesRoute.length) {
isEtesRoute.map((item) => {
et86RouteList.push(item.route);
});
routeInfo.fltNo = row.fltNo;
routeInfo.fltRoute = et86RouteList;
}
// White Tail 当前航线在航班航线中是否为ET86航线
if (row.flightKindName == "White Tail") {
if (isEtesRoute.length) {
let whiteEt86 = isEtesRoute.filter(
(item) => item.route == row.route
);
routeInfo.isEtesRoute = whiteEt86.length;
}
}
} else {
this.msgError("暂无当前航班航线");
}
if (routeInfo.isEtesRoute) {
let msg = routeInfo.fltNo + ": " + routeInfo.fltRoute.join(";");
this.$alert(
`当前${msg}为ET86航线,可在ET86规则设置查看`,
"提示",
{
confirmButtonText: "关闭",
callback: (action) => {},
}
);
return;
}
this.$router.push({
path: "/routeInfo",
query: {
flightDate: row.fltDate,
purposeOfFlightNo: row.fltNo,
flightRouteListStr: row.route,
status: row.status,
flightKindName: row.flightKindName,
pageName: "flightInformationMaintenance",
disable: true,
},
});
}
})
.catch(() => {});
},
// 航班状态
flightState(multipleSelection, statusName) {
let flightState = multipleSelection.some(item => item.statusName == statusName);
let flightState = multipleSelection.some(
(item) => item.statusName == statusName
);
if (flightState) {
this.msgError(`勾选的航班,航班状态为${statusName},不可操作该按钮`);
} else {
flightState = false
flightState = false;
}
return flightState
return flightState;
},
/** 删除按钮操作 */
handleDelete(row) {
let fIds = [];
this.ids.forEach(item => {
fIds.push(item.id)
this.ids.forEach((item) => {
fIds.push(item.id);
});
// 航班状态
if (this.flightState(this.ids, "已删除")) return
if (this.flightState(this.ids, "已删除")) return;
this.$confirm("是否确认删除所选数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
......@@ -995,28 +1382,28 @@ export default {
.then(() => {
this.dialogTableVisible = true;
})
.catch(() => { });
.catch(() => {});
} else {
this.msgSuccess(response.msg);
}
})
.catch(() => { });
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if(this.form.route == undefined){
this.routeError = true;
return
}
if(this.form.route.length || this.form.route !== undefined){
this.routeError = false;
}
if (this.form.route == undefined) {
this.routeError = true;
return;
}
if (this.form.route.length || this.form.route !== undefined) {
this.routeError = false;
}
if(this.form.route.length == 0){
this.routeError = true;
return
if (this.form.route.length == 0) {
this.routeError = true;
return;
}
if (valid) {
let formdata = JSON.parse(JSON.stringify(this.form));
......@@ -1049,15 +1436,18 @@ export default {
// formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
//总重量更新
// formdata.totalWeight = this.Weightall()
formdata.route = this.form.route.toString().replace(/,/g, ';')
if(this.form.extraWeightPercent == undefined || this.form.extraWeightPercent == null){
formdata.extraWeightPercent = 0
formdata.route = this.form.route.toString().replace(/,/g, ";");
if (
this.form.extraWeightPercent == undefined ||
this.form.extraWeightPercent == null
) {
formdata.extraWeightPercent = 0;
}
//处理数据
saveOrUpdate(formdata).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.routeList = []
this.routeList = [];
this.open = false;
this.findAllFltData();
} else {
......@@ -1074,11 +1464,11 @@ export default {
},
//取消按钮
cancel() {
this.routeError = false
this.routeList = []
this.ishighPriceWeightPercent = true
this.routeMultiple = false
this.routeLoading = false
this.routeError = false;
this.routeList = [];
this.ishighPriceWeightPercent = true;
this.routeMultiple = false;
this.routeLoading = false;
this.open = false;
this.findAllFltData();
this.findFltConditionData();
......@@ -1098,28 +1488,28 @@ export default {
//批量开启/关闭航班
handleFlightStatus(status) {
// 航班状态
if (this.flightState(this.ids, "已删除")) return
if (this.flightState(this.ids, "已删除")) return;
let handle = status == "flightStatus80" ? "关闭" : "开启";
let state = this.ids.some(item => item.statusName == `已${handle}`);
if(state){
let state = this.ids.some((item) => item.statusName == `已${handle}`);
if (state) {
this.msgError(`勾选的航班,航班状态为已${handle},不可操作该按钮`);
return
return;
}
let data = {
updateIds: [],
};
this.ids.map(item => {
this.ids.map((item) => {
data.status = status;
if (status === 'flightStatus80') {
if (item.statusName === '已开启') {
data.updateIds.push(item.id)
if (status === "flightStatus80") {
if (item.statusName === "已开启") {
data.updateIds.push(item.id);
}
} else {
if (item.statusName === '已关闭') {
data.updateIds.push(item.id)
if (item.statusName === "已关闭") {
data.updateIds.push(item.id);
}
}
})
});
if (data.updateIds.length > 0) {
updateStatusBatch(data).then((response) => {
if (response.code === 200) {
......@@ -1134,7 +1524,7 @@ export default {
//自动推送开关
autoPushBatch(status) {
// 航班状态
if (this.flightState(this.ids, "已删除")) return
if (this.flightState(this.ids, "已删除")) return;
let msg = status == "open" ? "开启" : "关闭";
let data = {
updateIds: [],
......@@ -1162,7 +1552,7 @@ export default {
this.msgError(res.msg);
}
})
.catch(err => {
.catch((err) => {
this.msgError(err);
});
} else {
......@@ -1173,61 +1563,65 @@ export default {
//白名单配舱开关
whiteListSwitchStatus(val) {
// 航班状态
if (this.flightState(this.ids, "已删除")) return
if (this.flightState(this.ids, "已删除")) return;
let obj = {
updateIds: []
}
obj.status = val
this.ids.forEach(item => {
obj.updateIds.push(item.id)
})
updateWhiteListSwitchBatch(obj).then(res => {
if (res.code === 200) {
this.msgSuccess(res.msg)
this.findAllFltData()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
updateIds: [],
};
obj.status = val;
this.ids.forEach((item) => {
obj.updateIds.push(item.id);
});
updateWhiteListSwitchBatch(obj)
.then((res) => {
if (res.code === 200) {
this.msgSuccess(res.msg);
this.findAllFltData();
} else {
this.msgWarning(res.msg);
}
})
.catch((err) => {
console.log(err);
});
},
//黑名单配舱开关
BlackListSwitchStatus(val) {
// 航班状态
if (this.flightState(this.ids, "已删除")) return
if (this.flightState(this.ids, "已删除")) return;
let obj = {
updateIds: []
}
obj.status = val
this.ids.forEach(item => {
obj.updateIds.push(item.id)
})
updateBlackListSwitchBatch(obj).then(res => {
if (res.code === 200) {
this.msgSuccess(res.msg)
this.findAllFltData()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
updateIds: [],
};
obj.status = val;
this.ids.forEach((item) => {
obj.updateIds.push(item.id);
});
updateBlackListSwitchBatch(obj)
.then((res) => {
if (res.code === 200) {
this.msgSuccess(res.msg);
this.findAllFltData();
} else {
this.msgWarning(res.msg);
}
})
.catch((err) => {
console.log(err);
});
},
//航线修改
routeChange(val) {
if(this.form.route.length){
this.routeError = false;
}else{
this.routeError = true;
if (this.form.route.length) {
this.routeError = false;
} else {
this.routeError = true;
}
this.$forceUpdate()
this.$forceUpdate();
},
blurRoute(){
if(this.form.route.length){
this.routeError = false;
}else{
this.routeError = true;
blurRoute() {
if (this.form.route !== undefined && this.form.route.length) {
this.routeError = false;
} else {
this.routeError = true;
}
},
//多选框选中数据
......@@ -1250,11 +1644,11 @@ export default {
//每页长度
sizeChange(val) {
this.queryParams.limitSize = val;
this.queryParams.pageNum = 1
this.queryParams.pageNum = 1;
this.findAllFltData();
},
setClose() {
this.tableHeader = this.tableHeaders['FlightInformation']
this.tableHeader = this.tableHeaders["FlightInformation"];
},
},
computed: {
......@@ -1265,19 +1659,19 @@ export default {
set: function (val) {
this.form.route = this.upCase(val);
},
}
}
},
},
};
</script>
<style>
.el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
.el-table__body tr.current-row>td {
.el-table__body tr.current-row > td {
background-color: #a0cfff;
}
.el-table--striped .el-table__body tr.hover-row.el-table__row--striped>td,
.el-table__body tr.hover-row>td {
.el-table--striped .el-table__body tr.hover-row.el-table__row--striped > td,
.el-table__body tr.hover-row > td {
background-color: #d9ecff !important;
}
......@@ -1286,7 +1680,7 @@ export default {
color: #ff4949;
text-align: right;
}
.error-route{
.error-route {
color: #ff4949;
}
</style>
......
......@@ -803,10 +803,7 @@ export default {
if (latestView) {
this.$router.push(latestView.fullPath);
} else {
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
if (view.name === "Dashboard") {
// to reload home page
this.$router.replace({ path: "/redirect" + view.fullPath });
} else {
this.$router.push("/");
......
<template>
<div>
<el-form ref="dmLogForm" class="form-header" :model="selectForm" label-width="auto" size="small"
@submit.native.prevent>
<el-form
ref="dmLogForm"
class="form-header"
:model="selectForm"
label-width="auto"
size="small"
@submit.native.prevent
>
<el-row type="flex" style="flex-wrap: wrap !important">
<el-col :span="6">
<el-form-item label="ACCS原航班号">
<el-input v-model.trim="fltNo" class="formItem" placeholder="请输入航班号" clearable></el-input>
<el-input
v-model.trim="fltNo"
class="formItem"
placeholder="请输入航班号"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="数据接收日期" prop="createTime">
<el-date-picker v-model="selectForm.createTime" class="formItem" type="date" placeholder="选择日期"
:value-format="valueFormat" clearable>
<el-date-picker
v-model="selectForm.createTime"
class="formItem"
type="date"
placeholder="选择日期"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运单号">
<el-input v-model="selectForm.awbNbr" class="formItem" placeholder="请输入运单号" clearable></el-input>
<el-input
v-model="selectForm.awbNbr"
class="formItem"
placeholder="请输入运单号"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="处理状态级别">
<el-select v-model="selectForm.status" class="formItem" placeholder="不限" clearable>
<el-select
v-model="selectForm.status"
class="formItem"
placeholder="不限"
clearable
>
<el-option label="未处理" value="0"></el-option>
<el-option label="处理成功" value="1"></el-option>
<el-option label="无需处理" value="2"></el-option>
......@@ -34,52 +61,85 @@
</el-col>
<el-col :span="6">
<el-form-item label="ACCS原航班日期">
<el-date-picker v-model="selectForm.fltDate" class="formItem" type="date" placeholder="选择日期"
:value-format="valueFormat" clearable>
<el-date-picker
v-model="selectForm.fltDate"
class="formItem"
type="date"
placeholder="选择日期"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="回推ACCS结果">
<el-select v-model="selectForm.sendLogSendResult" class="formItem" placeholder="不限" clearable>
<el-option label="未推" value="0">
</el-option>
<el-option label="推送成功" value="1">
</el-option>
<el-option label="推送失败" value="2">
</el-option>
<el-select
v-model="selectForm.sendLogSendResult"
class="formItem"
placeholder="不限"
clearable
>
<el-option label="未推" value="0"> </el-option>
<el-option label="推送成功" value="1"> </el-option>
<el-option label="推送失败" value="2"> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div class="ml20" style="display: flex">
<el-button type="primary" size="mini" icon="el-icon-search" :loading="loading" @click="selectDMData(0)">查询
<el-button
type="primary"
size="mini"
icon="el-icon-search"
:loading="loading"
@click="selectDMData(0)"
>查询
</el-button>
</div>
</el-form>
<Tables ref="dmLogTables" ductName="logDmData" :order="true" :data="data" :headerData="tableHeader"
tableAlign="center" :showOverflowTooltip="false" :height="tableHeight" :page="selectForm.page"
:limitSize="selectForm.size" :pageSizes="[100]" :totalCount="total" :loading="loading"
@currentChange="currentChange">
<Tables
ref="dmLogTables"
ductName="logDmData"
:order="true"
:data="data"
:headerData="tableHeader"
tableAlign="center"
:showOverflowTooltip="false"
:height="tableHeight"
:page="selectForm.page"
:limitSize="selectForm.size"
:pageSizes="[100]"
:totalCount="total"
:loading="loading"
@currentChange="currentChange"
>
<template v-slot:awbNbr="scope">
<el-link type="primary" @click="gotoWeatherTable(scope.row)">
{{
scope.row.awbNbr
}}<i class="el-icon-link"></i> </el-link>
{{ scope.row.awbNbr }}<i class="el-icon-link"></i>
</el-link>
</template>
<template v-slot:flightFltNo="scope">
<el-link v-if="scope.row.allocDimId" type="primary"
@click="$router.push({ name: 'FlightAllocConfigInfo', params: { id: scope.row.allocDimId, handle: 'detail', fltNo: scope.row.flightFltNo, fltDate: scope.row.flightFltDate ? scope.row.flightFltDate : ' ', routeStatus: 'dmLog', route: scope.row.currentFlightRoute ? scope.row.currentFlightRoute : ' ', status: ' ', createStatus: 1, } })">
{{
scope.row.flightFltNo
}}<i class="el-icon-link"></i> </el-link>
<el-link
v-if="scope.row.allocDimId"
type="primary"
@click="viewRouteConfig(scope.row)"
>
{{ scope.row.flightFltNo }}<i class="el-icon-link"></i>
</el-link>
<span v-else>{{ scope.row.flightFltNo }}</span>
</template>
<template v-slot:remarksDetail="scope">
<span v-if="scope.row.remarksDetail == null || scope.row.remarksDetail == ''">{{ scope.row.remarksDetail
}}</span>
<span
v-if="
scope.row.remarksDetail == null || scope.row.remarksDetail == ''
"
>{{ scope.row.remarksDetail }}</span
>
<div v-else>
<div v-for="item in scope.row.remarksDetail.split('\\r\\n')">{{ item }}</div>
<div v-for="item in scope.row.remarksDetail.split('\\r\\n')">
{{ item }}
</div>
</div>
</template>
</Tables>
......@@ -100,7 +160,7 @@ export default {
size: 100,
},
data: [],
tableHeader: this.tableHeaders['DM'],
tableHeader: this.tableHeaders["DM"],
portList: [],
rules: {
createTime: [
......@@ -122,14 +182,14 @@ export default {
},
created() {
this.selectForm.createTime = this.nowDate();
// this.$nextTick(()=>{
// let height = window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
// if(height < 300){
// this.tableHeight = 300;
// }else{
// this.tableHeight = height;
// }
// })
// this.$nextTick(()=>{
// let height = window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
// if(height < 300){
// this.tableHeight = 300;
// }else{
// this.tableHeight = height;
// }
// })
},
activated() {
this.selectDMData();
......@@ -138,7 +198,8 @@ export default {
this.data = [];
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
this.tableHeight =
window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
},
methods: {
//数据查询
......@@ -151,32 +212,37 @@ export default {
getDmDataList(this.selectForm).then((res) => {
this.loading = false;
if (res.code === 200) {
this.total = res.data.total
this.total = res.data.total;
if (res.data.total === 0) {
this.msgWarning('未查询到数据')
this.msgWarning("未查询到数据");
} else {
this.data = res.data.list;
}
} else {
this.msgWarning(res.msg)
this.msgWarning(res.msg);
}
});
},
//跳转流水
gotoWeatherTable(val) {
getDmFlowInformation('accsId=' + val.dmAccsId).then(res => {
if (res.code === 200) {
if (res.data.list.length > 0) {
this.$router.push({ name: 'weatherTable', params: { data: res.data.list, awbNbr: val.awbNbr } })
getDmFlowInformation("accsId=" + val.dmAccsId)
.then((res) => {
if (res.code === 200) {
if (res.data.list.length > 0) {
this.$router.push({
name: "weatherTable",
params: { data: res.data.list, awbNbr: val.awbNbr },
});
} else {
this.msgWarning("未查询到该条数据的流水");
}
} else {
this.msgWarning('未查询到该条数据的流水')
this.msgWarning(res.msg);
}
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
})
.catch((err) => {
console.log(err);
});
},
//分页
currentChange(val) {
......@@ -204,6 +270,20 @@ export default {
item.index = index;
});
},
// 当前配载航班号跳转查看航线配置详情
viewRouteConfig(row) {
this.$router.push({
path: "/routeInfo",
query: {
id: row.allocDimId,
purposeOfFlightNo: row.flightFltNo,
flightDate: row.flightFltDate,
flightRouteListStr: row.currentFlightRoute,
pageName: "dmLog",
disable: true,
},
});
},
},
computed: {
fltNo: {
......