jinhui.wang

ver:1.6.0,增加货站品名航班、首页,增加航线字典,配舱设置重构,样式修改,bug修复

......@@ -42,11 +42,11 @@ export function findCargoAllocationData(data) {
}
//手动配舱
export function allocationFlight(data){
export function allocationFlight(data) {
return request({
url:'/cargo/allocationFlight',
method:'post',
data:data
url: '/cargo/allocationFlight',
method: 'post',
data: data
})
}
......@@ -67,4 +67,42 @@ export function releaseCargo(data) {
method: 'post',
data: data,
})
}
\ No newline at end of file
}
//航班号+日期查询航线(手动配舱)
/**
* @param fltDate * 航班日期
* @param fltNo * 航班号
*/
export function findFlightRoute(data) {
return request({
url: '/cargo/findFlightRoute',
method: 'post',
data: data
})
}
//航班号+日期查询ACCS航线(手动配舱查询项)
/**
* @param fltDateAccs 航班日期
* @param fltNoAccs 航班号
*/
export function getAccsRoute(data) {
return request({
url: '/dmDataLog/getAccsRoute',
method: 'post',
data: data
})
}
//航班号+日期查询ACCS航线(货物查询查询项)
/**
* @param fltNoAccs 航班号 list
*/
export function getFlightsRoutes(data) {
return request({
url: '/dictionary/getFlightsRoutes',
method: 'post',
data: data
})
}
......
import request from '@/utils/request'
//目的航班规则接口
//查询航班航线
//查询航线
/**
* @param fltNo 航班号
*/
export function queryRouteByFltNo(data) {
return request({
url: '/dictionary/queryRouteByFltNo',
method: 'post',
data: data
})
}
// 查询航班列表
export function findFlightNo(query) {
/**
* @param purposeOfFlightNo 航班号
* @param flightDate 航班日期
* @param status 状态
* @param start 开始位置 *
* @param limit 每页长度 *
*/
export function findFlightDimRuleByFlightNo(query) {
return request({
url: '/destinationFlight/findFlightNo',
url: '/destinationFlight/findFlightDimRuleByFlightNo',
method: 'post',
data: query
})
}
// id查询目的航班
export function findByFlightId(id) {
const data = {
id
}
// 获取航班下航线维度(维度修改)
/**
* @param purposeOfFlightNo 航班号
* @param flightDate 航班日期
* @param flightRoute 航线
*/
export function findDestinationFltRuleByFlightNo(query) {
return request({
url: '/destinationFlight/findByFlightId',
url: '/destinationFlight/findDestinationFltRuleByFlightNo',
method: 'post',
data: data
data: query
})
}
//航班号查航班
export function findDestinationFltRuleByActualFlight(actualFlight){
const data = {
actualFlight
}
//航班优先级修改
export function batchUpdateOrAddFlight(data) {
return request({
url:'/sourceFlight/findDestinationFltRuleByActualFlight',
method:'post',
data:data
url: '/destinationFlight/batchUpdateOrAddFlight',
method: 'post',
data: data
})
}
export function updateOrAddFlight(form){
//处理数据
form.typeOfGoods = form.typeOfGoods.join(';');
form.declarationCategory = form.declarationCategory.join(';');
form.serviceCode = form.serviceCode.join(';');
form.subCategory = form.subCategory.join(';');
form.handlingCode = form.handlingCode.join(';');
//新增修改规则设置
export function updateOrAddFlight(form) {
return request({
url:'/destinationFlight/updateOrAddFlight',
url: '/destinationFlight/updateOrAddFlight',
method: 'post',
data:form
data: form
})
}
//删除规则
export function delFlightId(id){
export function delFlightId(id) {
const data = {
id
}
......@@ -65,7 +74,7 @@ export function delFlightId(id){
}
//启用/停止规则
export function enableOrDisable(id, status){
export function enableOrDisable(id, status) {
//statsu 1-有效 3-停用
const data = {
id,
......@@ -78,43 +87,59 @@ export function enableOrDisable(id, status){
})
}
//申报类别
export function cargoTypeData(){
//获取全部字典
export function allDictData() {
return request({
url: '/destinationFlight/cargoTypeData',
url: '/destinationFlight/allDictData',
method: 'post'
})
}
//货物类型
export function cargoStatusData(){
//维度航线优先级查询
/**
* @param fltNo 航班号
* @param routeDate 航班日期
*/
export function allRouteQuery(data) {
return request({
url: '/destinationFlight/cargoStatusData',
method: 'post'
url: '/specifyDateRoute/query',
method: 'post',
data: data
})
}
//ServiceCode
export function serviceCodeData(){
//维度航线优先级修改
/**
* @param list 航线排序集合
*/
export function saveOrUpdateSpecifyDateRoute(data) {
return request({
url: '/destinationFlight/serviceCodeData',
method: 'post'
url: '/specifyDateRoute/saveOrUpdateSpecifyDateRoute',
method: 'post',
data: data
})
}
//SubCategory
export function subCategoryData(){
// id查询目的航班
export function findByFlightId(id) {
const data = {
id
}
return request({
url: '/destinationFlight/subCategoryData',
method: 'post'
url: '/destinationFlight/findByFlightId',
method: 'post',
data: data
})
}
//获取全部字典
export function allDictData(){
return request({
url: '/destinationFlight/allDictData',
method: 'post'
})
//航班号查航班
export function findDestinationFltRuleByActualFlight(actualFlight) {
// const data = {
// actualFlight
// }
// return request({
// url: '/sourceFlight/findDestinationFltRuleByActualFlight',
// method: 'post',
// data: data
// })
}
\ No newline at end of file
......
import request from '@/utils/request'
//批量导入
export function importGoods(file, type) {
let formData = new FormData();
formData.append("file", file);
formData.append("type", type);
return request({
url: '/goods/importGoods',
method: 'post',
data: formData
})
}
//批量添加品名货站
/**
* @param goodsStation * 货站名
* @param goodsList * 货品名list
*/
export function batchAddGoods(data) {
return request({
url: '/goods/batchAddGoods',
method: 'post',
data: data
})
}
//批量删除品名货站
/**
* @param idList * id集合
*/
export function batchDeleteGoods(data) {
return request({
url: '/goods/batchDeleteGoods',
method: 'post',
data: data
})
}
//查询品名
/**
* @param page * 页数
* @param size * 页长
* @param goodsStation 货站名
*/
export function searchGoods(data) {
return request({
url: '/goods/searchGoods',
method: 'post',
data: data
})
}
\ No newline at end of file
import request from '@/utils/request'
//查询货站航班
/**
* @param page * 页数
* @param size * 页长
* @param goodsStation 货站名称
*/
export function searchStationFlight(data) {
return request({
url: '/stationFlight/searchStationFlight',
method: 'post',
data: data
})
}
//批量添加货站航班
/**
* @param goodsStation * 货站名称
* @param flightList * 航班号集合
*/
export function batchAddStationFlight(data) {
return request({
url: '/stationFlight/batchAddStationFlight',
method: 'post',
data: data
})
}
//批量删除货站航班
/**
* @param id * id集合
*/
export function batchDeleteGoods(data) {
return request({
url: '/stationFlight/batchDeleteGoods',
method: 'post',
data: data
})
}
\ No newline at end of file
import request from '@/utils/request'
// 首页数据获取
/**
* @param fltDate * 航班日期
* @param kindId 航班类型
*/
export function getOneDayFlight(data) {
return request({
url: '/index/getOneDayFlight',
method: 'post',
data: data
})
}
......@@ -129,7 +129,7 @@ export function addFlight(data) {
})
}
//虚拟航班新增
//虚拟航班删除
/**
* @param flightNo 航班名称 list *
*/
......@@ -139,4 +139,68 @@ export function delFlight(data) {
method: 'post',
data: data
})
}
//查询航线
/**
* @param fltNo 航班号
* @param page 页数
* @param size 页长
*/
export function queryRoute(data) {
return request({
url: '/dictionary/queryRoute',
method: 'post',
data: data
})
}
//新增航线
/**
* @param fltNo 航班号 *
* @param route 航线 *
*/
export function addRoute(data) {
return request({
url: '/dictionary/addRoute',
method: 'post',
data: data
})
}
//删除航线
/**
* @param id *
*/
export function delRoute(data) {
return request({
url: '/dictionary/delRoute',
method: 'post',
data: data
})
}
//航线排序
/**
* @param id *
*/
export function orderRoute(data) {
return request({
url: '/dictionary/orderRoute',
method: 'post',
data: data
})
}
//航线删除确认
/**
* @param fltNo 航班号
* @param route 航线
*/
export function checkFlightRoute(data) {
return request({
url: '/FlightPreserveController/checkFlightRoute',
method: 'post',
data: data
})
}
\ No newline at end of file
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1660113358419" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2396" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M393.846154 78.769231c43.323077 0 78.769231 35.446154 78.769231 78.769231s-35.446154 78.769231-78.769231 78.76923-78.769231-35.446154-78.769231-78.76923 35.446154-78.769231 78.769231-78.769231z m236.307692 0c43.323077 0 78.769231 35.446154 78.769231 78.769231s-35.446154 78.769231-78.769231 78.76923-78.769231-35.446154-78.769231-78.76923 35.446154-78.769231 78.769231-78.769231zM393.846154 315.076923c43.323077 0 78.769231 35.446154 78.769231 78.769231s-35.446154 78.769231-78.769231 78.769231-78.769231-35.446154-78.769231-78.769231 35.446154-78.769231 78.769231-78.769231z m236.307692 0c43.323077 0 78.769231 35.446154 78.769231 78.769231s-35.446154 78.769231-78.769231 78.769231-78.769231-35.446154-78.769231-78.769231 35.446154-78.769231 78.769231-78.769231zM393.846154 551.384615c43.323077 0 78.769231 35.446154 78.769231 78.769231s-35.446154 78.769231-78.769231 78.769231-78.769231-35.446154-78.769231-78.769231 35.446154-78.769231 78.769231-78.769231z m236.307692 0c43.323077 0 78.769231 35.446154 78.769231 78.769231s-35.446154 78.769231-78.769231 78.769231-78.769231-35.446154-78.769231-78.769231 35.446154-78.769231 78.769231-78.769231zM393.846154 787.692308c43.323077 0 78.769231 35.446154 78.769231 78.76923s-35.446154 78.769231-78.769231 78.769231-78.769231-35.446154-78.769231-78.769231 35.446154-78.769231 78.769231-78.76923z m236.307692 0c43.323077 0 78.769231 35.446154 78.769231 78.76923s-35.446154 78.769231-78.769231 78.769231-78.769231-35.446154-78.769231-78.769231 35.446154-78.769231 78.769231-78.76923z" p-id="2397"></path></svg>
\ No newline at end of file
......@@ -86,7 +86,7 @@ let ductLabels = {
"2_2": "已处理(数据丢弃)",
"2_3": "已处理(数据丢弃)",
"2_4": "已处理(数据丢弃)",
"3_1": "已处理(异常处理)",
// "3_1": "已处理(异常处理)",
"3_2": "处理失败(系统异常)",
"3_3": "处理失败(系统异常)",
"3_4": "处理失败(系统异常)",
......
......@@ -13,26 +13,26 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "总重量(KG)",
columnName: "totalWeight",
columnChineseName: "航线",
columnName: "route",
columnWidth: "",
status: 1
},
{
columnChineseName: "已配重量(KG)",
columnName: "allocationWeight",
columnChineseName: "重量(KG)",
columnName: "totalWeight",
columnWidth: "",
status: 1
},
{
columnChineseName: "总体积(cm³)",
columnName: "totalVolumn",
columnChineseName: "已配重量(KG)",
columnName: "allocationWeight",
columnWidth: "",
status: 1
},
{
columnChineseName: "已配体积(cm³)",
columnName: "allocationVolumn",
columnChineseName: "已配体积(m³)",
columnName: "allocatedVolume",
columnWidth: "",
status: 1
},
......@@ -173,6 +173,13 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "体积",
columnName: "volume",
columnWidth: "100",
ext1: "sorTable",
status: 1
},
{
columnChineseName: "收件人国家代码",
columnName: "consigneeCountry",
columnWidth: "150",
......@@ -227,6 +234,13 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "终配航线",
columnName: "finalFlightRoute",
columnWidth: "140",
ext1: "sorTable",
status: 1,
},
{
columnChineseName: "二配航班号",
columnName: "twoMatchFlightNo",
columnWidth: "120",
......@@ -241,6 +255,13 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "二配航线",
columnName: "twoFlightRoute",
columnWidth: "140",
ext1: "sorTable",
status: 1,
},
{
columnChineseName: "预配航班号",
columnName: "preplanFlightNo",
columnWidth: "120",
......@@ -406,6 +427,12 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "航线",
columnName: "flightRoute",
columnWidth: "140",
status: 1
},
{
columnChineseName: "ACCS原航班日期",
columnName: "accsFlightDate",
columnWidth: "140",
......@@ -420,7 +447,7 @@ let tableHeaders = {
{
columnChineseName: "货物状态",
columnName: "cargoStatus",
columnWidth: "80",
columnWidth: "100",
status: 1
},
{
......@@ -458,18 +485,6 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "航班起飞时间",
columnName: "takeOffTime",
columnWidth: "120",
status: 1
},
{
columnChineseName: "Pre-MDE CutOff时间",
columnName: "cutOffTime",
columnWidth: "150",
status: 1
},
{
columnChineseName: "航班号",
columnName: "fltNo",
columnWidth: "100",
......@@ -524,13 +539,7 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "总体积(cm³)",
columnName: "totalVolume",
columnWidth: "100",
status: 1
},
{
columnChineseName: "已配体积(cm³)",
columnChineseName: "已配体积(m³)",
columnName: "alloctedVolume",
columnWidth: "120",
status: 1
......@@ -974,25 +983,38 @@ let tableHeaders = {
{
columnChineseName: "航班号",
columnName: "purposeOfFlightNo",
columnWidth: "100",
status: 1
},
{
columnChineseName: "航班日期",
columnName: "ruleDate",
columnWidth: "150",
ext1: 'slot',
status: 1
},
{
columnChineseName: "航线配舱设置",
columnName: "flightRoute",
columnWidth: "",
status: 1
},
{
columnChineseName: "状态",
columnName: "status",
columnWidth: "",
columnWidth: "100",
status: 1
},
{
columnChineseName: "操作人",
columnName: "createUserName",
columnWidth: "",
columnName: "updateUserName",
columnWidth: "100",
status: 1
},
{
columnChineseName: "更新时间",
columnName: "createTime",
columnWidth: "",
columnName: "updateTime",
columnWidth: "150",
status: 1
},
],
......@@ -1127,6 +1149,12 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "当前配载航线",
columnName: "currentFlightRoute",
columnWidth: "130",
status: 1
},
{
columnChineseName: "ACCS原航班号",
columnName: "dmFlightNbr",
columnWidth: "120",
......@@ -1247,9 +1275,15 @@ let tableHeaders = {
status: 1
},
{
columnChineseName: "航线",
columnName: "flightRoute",
columnWidth: "",
status: 1
},
{
columnChineseName: "申报类别",
columnName: "declarationCategory",
columnWidth: "100",
columnWidth: "80",
status: 1
},
{
......@@ -1261,13 +1295,13 @@ let tableHeaders = {
{
columnChineseName: "增加重量",
columnName: "increaseWeight",
columnWidth: "100",
columnWidth: "90",
status: 1
},
{
columnChineseName: "减轻重量",
columnName: "reduceWeight",
columnWidth: "100",
columnWidth: "90",
status: 1
},
{
......@@ -1350,6 +1384,200 @@ let tableHeaders = {
columnWidth: "",
status: 1
},
],
"fltRoute": [
{
columnChineseName: "航班名称",
columnName: "fltNo",
columnWidth: "",
ext1: "slot",
status: 1
},
{
columnChineseName: "航线",
columnName: "route",
columnWidth: "",
status: 1
},
],
//货站-品名
"goodsStation": [
{
columnChineseName: "口岸",
columnName: "portName",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "货站名称",
columnName: "goodsStation",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "品名",
columnName: "goodsName",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "操作人",
columnName: "updateUserName",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "操作时间",
columnName: "updateTime",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "创建日期",
columnName: "createTime",
columnWidth: "",
ext1: "",
status: 1
},
],
//货站-航班
"goodsStationFlight": [
{
columnChineseName: "口岸",
columnName: "portName",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "货站名称",
columnName: "goodsStation",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "航班号",
columnName: "fltNo",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "操作人",
columnName: "updateUserName",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "操作时间",
columnName: "updateTime",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "创建日期",
columnName: "createTime",
columnWidth: "",
ext1: "",
status: 1
},
],
//特殊配舱规则
"superAllocation": [
{
columnChineseName: "ShipperAccount",
columnName: "shipperAccount",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "原航班",
columnName: "accsFlightNo",
columnWidth: "150",
ext1: "",
status: 1
},
{
columnChineseName: "操作人",
columnName: "updateUserName",
columnWidth: "100",
ext1: "",
status: 1
},
{
columnChineseName: "操作时间",
columnName: "updateTime",
columnWidth: "200",
ext1: "",
status: 1
},
],
"newSuperAllocation": [
{
columnChineseName: "航班日期",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "航班号",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "航线",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "URSA",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "申报类型",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "服务类型",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "预留仓位",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
{
columnChineseName: "已配仓位",
columnName: "",
columnWidth: "",
ext1: "",
status: 1
},
]
}
......
<template>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
<el-breadcrumb-item v-for="(item, index) in levelList" :key="item.path">
<span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta.title
}}</span>
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
</el-breadcrumb-item>
</transition-group>
......@@ -35,9 +36,9 @@ export default {
const first = matched[0]
if (!this.isDashboard(first)) {
matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched)
matched = [{ path: '/index', meta: { title: '首页' } }].concat(matched)
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
},
......@@ -46,7 +47,7 @@ export default {
if (!name) {
return false
}
return name.trim() === '首页'
return name.trim() === 'Index'
},
handleLink(item) {
const { redirect, path } = item
......
<template>
<!-- 拖拽交换位置效果 -->
<transition-group tag="div" class="container">
<div class="item" v-for="(item, index) in list" :key="index" draggable="true"
@dragstart="handleDragStart($event, item)" @dragover.prevent="handleDragOver($event, item)"
@dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)">
<svg-icon v-if="!disabled" icon-class="drag-text" class="el-input__icon input-icon" style="color:#bfbfbf" />
<span style="margin-right:20px">{{index}}</span>
<span>{{ item.route }}</span>
</div>
</transition-group>
</template>
<script>
// draggable 属性规定元素是否可拖动
// dragstart 事件在用户开始拖动元素或选择的文本时触发
// dragover 当某被拖动的对象在另一对象容器范围内拖动时触发此事件
// dragenter - 当被鼠标拖动的对象进入其容器范围内时触发此事件
// dragend - 用户完成元素拖动后触发
export default {
name: 'Toolbar',
props: {
routes: {
type: Array,
default: null
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
list: [],
dragging: null
}
},
created() {
this.list = this.routes
},
watch: {
routes(val) {
if (val) {
this.list = val
}
}
},
methods: {
handleDragStart(e, item) {
this.disabled ? '' : this.dragging = item;
},
handleDragEnd(e, item) {
this.disabled ? '' : this.dragging = null
},
//首先把div变成可以放置的元素,即重写dragenter/dragover
// DataTransfer 对象用来保存,通过拖放动作,拖动到浏览器的数据。
// 如果dropEffect 属性设定为none,则不允许被拖放到目标元素中。
handleDragOver(e) {
this.disabled ? '' : e.dataTransfer.dropEffect = 'move'// e.dataTransfer.dropEffect="move";//在dragenter中针对放置目标来设置!
},
handleDragEnter(e, item) {
if (!this.disabled) {
e.dataTransfer.effectAllowed = "move"//为需要移动的元素设置dragstart事件
if (item === this.dragging) {
return
}
const newItems = [...this.list]
const src = newItems.indexOf(this.dragging)
const dst = newItems.indexOf(item)
// 替换
newItems.splice(dst, 0, ...newItems.splice(src, 1))
// 让item的颜色等于新交换的颜色
this.list = newItems
this.$emit('drag', newItems)
}
}
}
}
</script>
<style lang="scss" scoped>
.container {
max-width: 350px;
min-height: 32px;
max-height: 150px;
overflow-y: scroll;
padding: 0;
border: 1px solid #ccc;
&::-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;
}
}
.item {
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
/* border-bottom: 1px solid #ccc; */
cursor: move;
transition: all linear .3s
}
.item:hover {
background-color: #c6e2ff;
}
</style>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<i slot="suffix" class="el-icon-search el-input__icon" />
</el-input>
<div class="icon-list">
<div v-for="(item, index) in iconList" :key="index" @click="selectedIcon(item)">
<div :class="name == item?'selectIcon':''" v-for="(item, index) in iconList" :key="index" @click="selectedIcon(item)">
<svg-icon :icon-class="item" style="height: 30px;width: 16px;" />
<span>{{ item }}</span>
</div>
......@@ -31,6 +31,7 @@ export default {
}
},
selectedIcon(name) {
this.name = name
this.$emit('selected', name)
document.body.click()
},
......@@ -65,4 +66,7 @@ export default {
}
}
}
.selectIcon{
border:1px solid #ccc;
}
</style>
......
<template>
<div class="top-right-btn">
<el-row>
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
<el-tooltip
class="item"
effect="dark"
:content="showSearch ? '隐藏搜索' : '显示搜索'"
placement="top"
>
<el-button
:size="size"
circle
icon="el-icon-search"
@click="toggleSearch()"
/>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
<el-button
:size="size"
circle
icon="el-icon-refresh"
@click="refresh()"
/>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns">
<el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" />
<el-tooltip
class="item"
effect="dark"
content="显隐列"
placement="top"
v-if="columns"
>
<el-button
:size="size"
circle
icon="el-icon-menu"
@click="showColumn()"
/>
</el-tooltip>
</el-row>
<el-dialog :title="title" :visible.sync="open" append-to-body>
......@@ -42,6 +68,10 @@ export default {
columns: {
type: Array,
},
size: {
type: String,
default: "mini",
},
},
created() {
// 显隐列初始默认隐藏列
......
......@@ -14,7 +14,7 @@ import permission from './directive/permission'
import './assets/icons' // icon
import './permission' // permission control
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree, upCase, nowDate } from "@/utils/FedEx";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree, upCase, nowDate, getRoute } from "@/utils/FedEx";
import { isArray } from "@/utils/validate";
import Pagination from "@/components/Pagination";
// 自定义表格工具扩展
......@@ -22,8 +22,9 @@ import RightToolbar from "@/components/RightToolbar"
import Table from "@/components/Table"
import Tooltip from "@/components/Tooltip"
import HeaderSetting from "@/components/HeaderSetting"
import Drag from "@/components/Drag"
import tableHeaders from '@/assets/languages/tableHeaders'
import dictLabels from "@/assets/languages/dictLabels.js";
import dictLabels from "@/assets/languages/dictLabels.js"
import settings from './settings.js'
// 全局方法挂载
......@@ -36,6 +37,7 @@ Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.upCase = upCase
Vue.prototype.nowDate = nowDate
Vue.prototype.getRoute = getRoute
Vue.prototype.isArray = isArray
Vue.prototype.tableHeaders = tableHeaders
Vue.prototype.dictLabels = dictLabels
......@@ -63,6 +65,7 @@ Vue.component('RightToolbar', RightToolbar)
Vue.component('Tables', Table)
Vue.component('Tooltips', Tooltip)
Vue.component('HeaderSetting', HeaderSetting)
Vue.component('Drag', Drag)
Vue.use(permission)
/**
......
......@@ -74,19 +74,13 @@ export const constantRoutes = [
redirect: 'noredirect',
children: [
{
path: '/flightAllocConfig/:handle/:id',
path: '/info/:handle/:fltNo-:fltDate',
component: (resolve) => require(['@/views/allocationConfig/flightAllocConfig/info'], resolve),
name: 'FlightAllocConfigInfo',
meta: { title: '航班配舱', icon: 'user', breadcrumb: true }
meta: { title: '航班配舱', icon: 'user' }
},
{
path: '/flightAllocConfig/:handle',
component: (resolve) => require(['@/views/allocationConfig/flightAllocConfig/info'], resolve),
name: 'FlightAllocConfigAdd',
meta: { title: '添加航班配舱', icon: 'user', breadcrumb: false }
},
{
path: '/weatherTable',
path: '/weatherTable/:awbNbr',
component: (resolve) => require(['@/views/systemLog/dmLog/weatherTable'], resolve),
name: 'weatherTable',
meta: { title: '流水表', icon: 'user' }
......
......@@ -58,5 +58,5 @@ module.exports = {
/**
* 版本号
*/
version: 'version:1.5.0'
version: 'version:1.6.0'
}
......
<template>
<div class="cargoAllocation">
<el-form ref="form" v-model="formData" class="form-header" label-position="right" label-width="auto" size="small">
<el-form ref="form" v-model="formData" class="form-header" label-position="right" label-width="auto" size="small"
@submit.native.prevent>
<el-row type="flex" style="flexWrap: wrap !important">
<el-col :span="6">
<el-form-item label="ACCS原航班日期">
......@@ -11,7 +12,8 @@
</el-col>
<el-col :span="6">
<el-form-item label="ACCS原航班号">
<el-input v-model="fltNo" placeholder="请输入ACCS原航班号" class="formItem" clearable></el-input>
<el-input v-model="fltNo" placeholder="请输入ACCS原航班号" class="formItem" clearable @change="fltNoChange">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
......@@ -116,6 +118,23 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<template slot="label">
<div style="display:inline-block">ACCS航线
<el-tooltip class="item" effect="dark" content="选择航线需要先输入航班号,才能选择对应得航线" placement="top-start">
<span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span>
</el-tooltip>
</div>
</template>
<el-select class="formItem" v-model="formData.route" placeholder="不限" :disabled="routeList.length == 0"
clearable>
<el-option v-for="item in routeList" :label="item" :value="item" :key="item">
<Tooltips :content="item" :refName="item"></Tooltips>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运单号">
<el-input class="formItem" type="textarea" :rows="4" placeholder="请输入运单号(回车分割)" :maxlength="12000"
v-model="formData.waybillNo" clearable></el-input>
......@@ -159,12 +178,12 @@
<el-button :type="downLoadingTip.downloading ? 'warning' : 'primary'" size="mini"
v-hasPermi="['allocation:cargo:export']" @click="xlsx(0)" :loading="downLoadingTip.downloading"
:disabled="tableData.length <= 0">{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出本页查询结果"
downLoadingTip.downloading ? downLoadingTip.tip : "导出本页查询结果"
}}</el-button>
<el-button :type="downLoadingTip.downloading ? 'warning' : 'primary'" size="mini"
v-hasPermi="['allocation:cargo:export']" @click="xlsx(1)" :loading="downLoadingTip.downloading"
:disabled="tableData.length <= 0">{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出全部查询结果"
downLoadingTip.downloading ? downLoadingTip.tip : "导出全部查询结果"
}}</el-button>
<el-button type="primary" size="mini" v-hasPermi="['allocation:cargo:allocation']" @click="addFit"
:disabled="tableSelection.length <= 0">添加到航班</el-button>
......@@ -187,7 +206,7 @@
<script>
import Dialog from "./info.vue";
import { findConditionData, findCargoAllocationData } from "@/api/cargoSelect";
import { findConditionData, findCargoAllocationData, getAccsRoute } from "@/api/cargoSelect";
import { allDictData } from "@/api/destinationFlight";
import { downLoadXlsx } from "@/utils/zipdownload";
......@@ -203,6 +222,7 @@ export default {
fltDateEnd: null,
typeId: null,
portName: null,
rtoue: null,
statusId: null,
kindToAllocFlightId: null,
serviceTypeId: null,
......@@ -230,6 +250,7 @@ export default {
SubCategory: [],
}, //查询条件
fltDate: [],
routeList: [],
ursaList: "",
siteNameList: "",
handingCodes: [],
......@@ -263,6 +284,8 @@ export default {
}
},
activated() {
this.tableSelection = []
this.cargoTotal()
this.seleData();
this.select();
},
......@@ -485,6 +508,19 @@ export default {
this.tableHeader = this.$store.getters.tableHeader['allocationCargo']
})
}
},
//获取航班号航线
fltNoChange(val) {
this.routeList = []
getAccsRoute({ fltNoAccs: val }).then(res => {
if (res.code === 200) {
this.routeList = res.data
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
}
},
computed: {
......@@ -524,7 +560,7 @@ export default {
};
</script>
<style lang="scss">
<style lang="scss" scoped>
.tips {
display: inline-block;
color: #606266;
......
......@@ -11,16 +11,31 @@
:label="item.name" :key="index" :show-overflow-tooltip="true" :formatter="formatter">
</el-table-column>
</el-table>
<el-form ref="form" label-position="right" label-width="auto" style="width: 400px; margin: 30px auto"
:model="formData" :rules="rules">
<el-form ref="form" class="form-header" label-position="right" label-width="auto"
style="width: 400px; margin: 30px auto" :model="formData" :rules="rules">
<el-form-item label="航班号" prop="fltNo">
<el-input v-model="fltNo" size="medium" placeholder="请输入航班号" maxlength="10" style="width: 350px"></el-input>
<el-input class="formItem" v-model="fltNo" size="medium" placeholder="请输入航班号" maxlength="10"
style="width: 350px" @change="dateChange"></el-input>
</el-form-item>
<el-form-item label="航班日期:" prop="fltDate">
<el-date-picker v-model="formData.fltDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"
size="medium" style="width: 350px">
<el-date-picker class="formItem" v-model="formData.fltDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd" size="medium" style="width: 350px" @change="dateChange">
</el-date-picker>
</el-form-item>
<el-form-item prop="route">
<template slot="label">
<div style="display:inline-block">航线:
<el-tooltip class="item" effect="dark" content="选择航线需要先输入航班号和航班日期,才能选择对应得航线" placement="top-start">
<span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span>
</el-tooltip>
</div>
</template>
<el-select class="formItem" v-model="formData.route" placeholder="不限" :disabled="routeList.length == 0">
<el-option v-for="(item, index) in routeList" :label="item.route" :value="item.route" :key="index">
<Tooltips :content="item.route" :refName="item.route"></Tooltips>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogBeforeClose">取 消</el-button>
......@@ -31,7 +46,7 @@
</template>
<script>
import { allocationFlight } from "@/api/cargoSelect";
import { allocationFlight, findFlightRoute } from "@/api/cargoSelect";
export default {
props: {
......@@ -50,6 +65,7 @@ export default {
ids: [],
fltNo: undefined,
fltDate: undefined,
route: undefined,
overweight: false,
},
cargoHeader: [
......@@ -68,6 +84,7 @@ export default {
{ name: "创建人", value: "createUserName" },
{ name: "创建时间", value: "createTime" },
],
routeList: [],
rules: {
fltNo: [
{
......@@ -83,6 +100,13 @@ export default {
trigger: "blur",
},
],
route: [
{
required: true,
message: "航线不能为空",
trigger: "blur",
},
],
},
loading: false,
};
......@@ -93,8 +117,11 @@ export default {
ids: [],
fltNo: undefined,
fltDate: undefined,
route: undefined,
flightId: undefined,
overweight: false,
};
this.routeList = []
},
//确定配舱
submit() {
......@@ -104,6 +131,11 @@ export default {
arr.push(item.id);
});
this.formData.ids = arr;
this.routeList.forEach(item => {
if (item.route === this.formData.route) {
this.formData.flightId = item.id
}
})
if (this.formData.fltNo && this.formData.fltDate) {
allocationFlight(this.formData).then((res) => {
this.loading = false;
......@@ -165,6 +197,35 @@ export default {
}
}
return cellValue
},
//日期选择变化
dateChange(val) {
this.routeList = []
if (this.formData.fltNo && this.formData.fltNo != null && this.formData.fltNo != '') {
if (this.formData.fltDate && this.formData.fltDate != null && this.formData.fltDate != '') {
let obj = {
fltNo: this.formData.fltNo,
fltDate: this.formData.fltDate,
}
findFlightRoute(obj).then(res => {
if (res.code === 200) {
res.data[0].route.indexOf(';') <= 0 ?
this.routeList = res.data :
res.data[0].route.split(';').forEach(item => {
this.routeList.push({ id: res.data[0].id, route: item })
})
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
} else {
this.msgWarning('航班日期不能为空')
}
} else {
this.msgWarning('航班号不能为空')
}
}
},
computed: {
......@@ -181,4 +242,5 @@ export default {
</script>
<style>
</style>
\ No newline at end of file
......
<template>
<div>
<el-dialog title="航线优先级排序" :visible.sync="open" width="25%" :close-on-click-modal="false" :show-close="false"
append-to-body center>
<el-form ref="routeOrder" label-width="auto" label-position="left" size="small" @submit.native.prevent>
<el-form-item label="航班号:" prop="fltNo">
<span>{{ fltNo }}</span>
</el-form-item>
<el-form-item label="航班日期:" prop="fltDate">
<span>{{ fltDate }}</span>
</el-form-item>
<el-form-item label="航线优先级" prop="route">
<Drag :routes="routeList" @drag="drag"></Drag>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="loading" @click="submit">确 定</el-button>
<el-button @click="close">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { allRouteQuery, saveOrUpdateSpecifyDateRoute } from "@/api/destinationFlight";
export default {
name: "",
props: {
open: {
type: Boolean,
default: false
},
fltData: {
type: Object,
default: null
}
},
data() {
return {
fltNo: '',
fltDate: '',
routeList: [],
submitData: [],
loading: false
}
},
watch: {
open(val) {
if (val) {
this.fltNo = this.fltData.fltNo
this.fltDate = this.fltData.fltDate
allRouteQuery({
fltNo: this.fltNo,
routeDate: this.fltDate
}).then(res => {
if (res.code === 200) {
this.routeList = res.data.list
this.submitData = res.data.list
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
}
}
},
methods: {
submit() {
saveOrUpdateSpecifyDateRoute(this.submitData).then(res => {
if (res.code === 200) {
this.msgSuccess('保存成功')
this.close()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
close() {
this.$emit('close')
},
drag(val) {
val.forEach((item, index) => {
item.ordinal = index + 1
})
this.submitData = val
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-form ref="flightAllocForm" :inline="true" :model="queryParams" class="form-header" size="medium"
label-position="right" label-width="auto">
label-position="right" label-width="auto" @submit.native.prevent>
<el-form-item label="航班号">
<el-input v-model.trim="purposeOfFlightNo" placeholder="航班号" @keyup.enter.native="getList"></el-input>
</el-form-item>
<el-form-item label="航班日期">
<el-date-picker class="formItem" v-model="queryParams.flightDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd" clearable>
</el-date-picker>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="queryParams.status" placeholder="状态">
<el-option label="有效" value="1"></el-option>
......@@ -18,8 +23,8 @@
<el-button class="mb20" type="primary" icon="el-icon-plus" size="mini" v-hasPermi="['allocation:alloc:add']"
@click="
$router.push({
name: 'FlightAllocConfigAdd',
params: { handle: 'add' },
name: 'FlightAllocConfigInfo',
params: { handle: 'add', fltNo: 'new', fltDate: ' ',status:null },
})
">添加</el-button>
</div>
......@@ -28,47 +33,61 @@
: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>
</template>
<template slot="optionColumn">
<el-table-column label="操作" prop="id" align="center">
<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.id, 'detail')">查看
<el-button type="text" size="mini" icon="el-icon-view"
@click="handleClick(scope.row.purposeOfFlightNo, 'detail', scope.row.ruleDate, scope.row.status)">查看
</el-button>
<el-button type="text" size="mini" icon="el-icon-edit" v-hasPermi="['allocation:alloc:update']"
@click="handleClick(scope.row.id, 'update')">修改</el-button>
<el-button type="text" size="mini" icon="el-icon-delete" style="color:#ff4949"
@click="handleClick(scope.row.purposeOfFlightNo, 'update', scope.row.ruleDate, scope.row.status)">修改
</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>
<el-button type="text" size="mini" icon="el-icon-video-pause" v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 3)" v-if="scope.row.status == '1'">停用</el-button>
<el-button type="text" size="mini" icon="el-icon-video-play" v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 1)" v-else>启用</el-button>
@click="changeStatus(scope.row.id, 1)" v-else>启用</el-button> -->
</template>
</el-table-column>
</template>
</Tables>
<Dialog :fltData="colData" :open="open" @close="close"></Dialog>
</div>
</template>
<script>
import {
findFlightNo,
delFlightId,
enableOrDisable,
findFlightDimRuleByFlightNo
} from "@/api/destinationFlight";
import Dialog from './dialog.vue'
export default {
name: "FlightAllocConfig",
components: {
Dialog
},
data() {
return {
queryParams: {
purposeOfFlightNo: "",
purposeOfFlightNo: null,
flightDate: undefined,
status: "1",
start: 0,
limit: 20,
},
flyList: [],
colData: {},
curPage: 1,
total: 0,
tableHeight: null,
open: false,
loading: false,
};
},
......@@ -94,66 +113,36 @@ export default {
this.queryParams.start = 0;
}
this.loading = true;
findFlightNo(this.queryParams).then((response) => {
if (response.code != 200) {
this.msgWarning(response.msg)
return;
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)
}
this.flyList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
});
}).catch(err => {
this.loading = false
console.log(err)
})
},
//跳转到查看,修改页面
handleClick(flightiId, handle) {
handleClick(fltNo, handle, fltDate, status) {
this.$router.push({
name: "FlightAllocConfigInfo",
params: { handle: handle, id: flightiId },
params: { handle: handle, fltNo: fltNo, fltDate: fltDate ? fltDate : null, status: status },
});
},
//删除规则
del(id, status) {
if (status == "1") {
this.$confirm("航班规则生效中,无法删除,请停用后再操作", "警告", {
confirmButtonText: "确定",
showCancelButton: false,
type: "warning",
});
} else {
this.$confirm("是否确认删除此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
showCancelButton: true,
type: "warning",
}).then(() => {
delFlightId(id)
.then((res) => {
res.code === 200 ? this.msgSuccess(res.msg) : this.msgWarning(res.msg)
this.getList()
})
.catch(() => { });
});
//航班优先级修改
toRouteOrder(val) {
this.colData = {
fltNo: val.purposeOfFlightNo,
fltDate: val.ruleDate
}
this.open = true
},
//启用,停用
changeStatus(id, status) {
let tip = status === 1 ? "启用" : "停用";
this.$confirm("是否确认" + tip + "此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
enableOrDisable(id, status)
.then((res) => {
if (res.code != 200) {
this.msgError(res.msg);
} else {
this.getList();
this.msgSuccess(tip + "成功");
}
})
.catch(() => { });
});
close() {
this.open = false
},
//翻页
currentChange(val) {
......
<template>
<div style="margin: 40px" v-loading="loading">
<div v-if="isEmpty">
<el-empty description="找不到这条数据!"></el-empty>
<el-button size="small" @click="close">返回</el-button>
</div>
<template v-else>
<el-form ref="form" :model="form" label-width="200px" size="small" :disabled="disable" :rules="rules">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="航班号" prop="purposeOfFlightNo">
<el-input v-model.trim="form.purposeOfFlightNo" maxlength="10" style="width: 60%"
:disabled="nameDisabled"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-row :gutter="20">
<el-col :span="6">
<el-radio v-model="isLocation" label="1" size="mini">站点包含</el-radio>
<el-radio v-model="isLocation" label="2" size="mini">站点不包含</el-radio>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="站点包含" v-show="isLocation == 1">
<el-input type="textarea" v-model="form.location" :rows="6" resize="none" style="width: 600px"
placeholder="站点之间用回车符分隔"></el-input>
</el-form-item>
<el-form-item label="站点不包含" v-show="isLocation == 2">
<el-input type="textarea" v-model="form.notLocation" :rows="6" resize="none" style="width: 600px"
placeholder="站点之间用回车符分隔"></el-input>
</el-form-item>
<el-row :gutter="20">
<el-col :span="10">
<el-form-item label="URSA包含" prop="includeUrsa">
<el-input type="textarea" v-model="form.includeUrsa" :rows="6" resize="none"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="URSA不包含" prop="notIncludeUrsa">
<el-input type="textarea" v-model="form.notIncludeUrsa" :rows="6" resize="none"
placeholder="URSA之间用分号分隔,例:F2;F3;P_"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="件数">
<el-col :span="3">
<el-input class="numberInput" v-model.trim="minNumOfPieces"></el-input>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="3">
<el-input class="numberInput" v-model.trim="maxNumOfPieces"></el-input>
</el-col>
</el-form-item>
<el-form-item label="重量">
<el-col :span="3">
<el-input class="numberInput" v-model.trim="minWeight"></el-input>
</el-col>
<el-col :span="1" style="text-align: center"><span>Kg</span></el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="3">
<el-input class="numberInput" v-model.trim="maxWeight"></el-input>
</el-col>
<el-col :span="1" style="text-align: center"><span>Kg</span></el-col>
</el-form-item>
<el-form-item label="申报类别">
<el-card shadow="never" style="width: 80%">
<el-checkbox-group v-model="form.typeOfGoods">
<el-row>
<el-col :span="2" v-for="item in cargoType" :key="item.id">
<el-checkbox v-if="item.status === 1" :label="item.chineseName" :name="item.chineseName">
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
<el-form-item label="货物类型">
<el-card shadow="never" style="width: 80%">
<el-checkbox-group v-model="form.declarationCategory">
<el-row>
<el-col :span="3" v-for="item in cargoStatus" :key="item.id">
<el-checkbox v-if="item.status === 1" :label="item.chineseName" :name="item.chineseName" disabled>
</el-checkbox>
<div style="padding:20px;min-height: 300px;">
<el-button class="ml20 mb20" size="small" icon="el-icon-back" @click="close">返 回</el-button>
<!-- 空状态 -->
<div v-if="isEmpty">
<el-empty description="未查询到数据!"></el-empty>
</div>
<el-form v-else ref="infoForm" :model="infoForm" label-position="right" label-width="120px" size="small"
:disabled="disabled" :rules="rules" @submit.native.prevent>
<!-- 表头设置 -->
<el-row class="mb20">
<el-col :span="6">
<el-form-item label="航班号" prop="fltNo">
<el-input v-model.tirm="infoForm.fltNo" @change="getRoutes" :disabled="fltNoDisabled">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
<el-form-item label="Service Code">
<el-card shadow="never" style="width: 80%">
<el-checkbox-group v-model="form.serviceCode">
<el-row>
<el-col :span="2" v-for="item in serviceCode" :key="item.id">
<el-checkbox v-if="item.status === 1 || form.serviceCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="form.serviceCode.includes(item.chineseName) && item.status === 0">
<Tooltips :content="item.chineseName" :refName="item.code"></Tooltips>
</el-checkbox>
<el-col :span="6" v-if="infoForm.fltDate != null">
<el-form-item label="航班日期" prop="fltDate">
<el-date-picker class="wid80" v-model="infoForm.fltDate" size="small" type="date"
value-format="yyyy-MM-dd" placeholder="选择航班日期" clearable :disabled="fltNoDisabled">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
<el-form-item label="Handling Code">
<el-card shadow="never" style="width: 80%">
<el-checkbox-group v-model="form.handlingCode">
<el-row>
<el-col :span="3" v-for="item in handlingCode" :key="item.id">
<el-checkbox v-if="item.status === 1 || form.handlingCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="form.handlingCode.includes(item.chineseName) && item.status === 0">
<Tooltips :content="item.chineseName" :refName="item.code"></Tooltips>
</el-checkbox>
<el-col :span="6" v-if="infoForm.route != null">
<el-form-item label="航线">
<el-input v-model.tirm="infoForm.route" @change="getRoutes" disabled>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
<el-form-item label="Sub Category">
<el-card shadow="never" style="width: 80%">
<el-checkbox-group v-model="form.subCategory">
<el-row>
<el-col :span="3" v-for="item in subCategory" :key="item.id">
<el-checkbox v-if="item.status === 1 || form.subCategory.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="form.subCategory.includes(item.chineseName) && item.status === 0">
<Tooltips :content="item.chineseName" :refName="item.code"></Tooltips>
</el-checkbox>
<el-col :span="7">
<el-form-item prop="route" label="航线优先级">
<Drag :routes="routeList" :disabled="true" @drag="drag">
</Drag>
</el-form-item>
</el-col>
</el-row>
</el-checkbox-group>
</el-card>
</el-form-item>
</el-form>
<div style="marginLeft: 200px">
<el-button type="primary" size="small"
v-if="$route.params.handle != 'detail' && $route.params.handle != 'DMdetail'" @click="submit('form')"
:loading="btnLoading">
<span v-if="$route.params.handle === 'add'">添加</span>
<span v-else>保存</span>
</el-button>
<el-button size="small" @click="close">取消</el-button>
</div>
</template>
</div>
<!-- <el-button v-if="status == 'update' && infoForm.fltDate != null" type="primary" size="small"
@click="setRoutes" :disabled="allSubmitDisabled">航线优先级保存</el-button> -->
</el-row>
<!-- <div class="routeTip">
<span class="el-icon-warning-outline" style="color:#ff4949"></span>
航班优先级只有在设置日期的维度下才可修改,若修改没有日期的维度请到数据字典航线表修改对应航班的优先级
</div> -->
<!-- 航线维度设置 -->
<el-divider content-position="left">航线维度设置</el-divider>
<!-- <div class="routeTip"> -->
<!-- <span class="el-icon-warning-outline" style="color:#ff4949"></span> -->
<!-- 新增航线维度时,不添加维度的航线,等同于没有限制规则,配舱时以航线优先级顺序配舱! -->
<!-- </div> -->
<el-collapse ref="routeCollapse"
v-if="routeSatus != 'flightInformationMaintenanceWhite Tail' && routeSatus != 'dmLog'"
class="backgroundCollapse" :value="infoForm.list.length > 0 ? routeList[0].route : ''"
style="min-height:500px;width:95%;margin:0 auto 50px" accordion v-loading="loading">
<el-collapse-item v-for="(routeItem, index) in routeList" :key="index" :name="routeItem.route">
<template slot="title">
<span class="fontWeight">{{ routeItem.route }}</span>
</template>
<el-card shadow="always" v-for="(val, idx) in infoForm.list" :key="idx"
v-if="val.flightRoute === routeItem.route" style="min-height:350px">
<div>
<el-empty description="未设置规则!" v-if="!val.isLocation">
<el-button type="primary" size="small" @click="newRoute(idx)">新增规则
</el-button>
</el-empty>
<el-row class="rowPadding" v-else>
<el-button type="primary" size="mini" @click="submit(idx)">保 存</el-button>
<el-button type="primary" v-if="val.status === '1'" size="mini"
icon="el-icon-video-pause" @click="changeStatus(idx)">
停 用</el-button>
<el-button type="primary" v-if="val.status === '3'" size="mini"
icon="el-icon-video-pause" @click="changeStatus(idx)">
启 用</el-button>
<el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete"
@click="del(idx)">删 除
</el-button>
<el-divider></el-divider>
<el-col :span="24">
<el-form-item label="站点">
<el-col :span="4">
<el-radio-group v-model="val.isLocation" @change="change">
<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="val.isLocation == '1'" v-model="val.location"
type="textarea" :rows="4" resize="none" style="width: 500px"
placeholder="站点之间用回车符分隔" @change="change" @input="change($event)">
</el-input>
<el-input v-else v-model="val.notLocation" type="textarea" :rows="4"
resize="none" style="width: 500px" placeholder="站点之间用回车符分隔"
@change="change" @input="change($event)">
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="URSA包含">
<el-input v-model="val.includeUrsa" type="textarea" :rows="4" resize="none"
style="width:500px" placeholder="URSA之间用分号分隔,例:F2;F3;P_"
@change="change" @input="change($event)">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="URSA不包含">
<el-input v-model="val.notIncludeUrsa" type="textarea" :rows="4"
resize="none" style="width:500px" placeholder="URSA之间用分号分隔,例:F2;F3;P_"
@change="change" @input="change($event)">
</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 class="numberInput" v-model.trim="val.minNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</el-input>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="重量(KG)">
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.minWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</el-input>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</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 v-model="val.typeOfGoods" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.cargoType" :span="2"
:key="item.id">
<el-checkbox v-if="item.status === 1" :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 v-model="val.declarationCategory" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.cargoStatus" :span="3"
:key="item.id">
<el-checkbox v-if="item.status === 1" :label="item.chineseName"
:name="item.chineseName" disabled :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 v-model="val.puporpuxCode" @change="change">
<el-row>
<el-col :span="2" v-for="item in checkBoxItem.puporpux">
<el-checkbox
v-if="item.status === 1 || val.puporpuxCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.puporpuxCode.includes(item.chineseName) && item.status == 0"
: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 v-model="val.serviceCode" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.serviceCode" :span="2"
:key="item.id">
<el-checkbox
v-if="item.status === 1 || val.serviceCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.serviceCode.includes(item.chineseName) && item.status == 0"
: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 v-model="val.handlingCode" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.handlingCode" :span="2"
:key="item.id">
<el-checkbox
v-if="item.status === 1 || val.handlingCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.handlingCode.includes(item.chineseName) && item.status == 0"
: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 v-model="val.subCategory" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.subCategory" :span="2"
:key="item.id">
<el-checkbox
v-if="item.status === 1 || val.subCategory.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.subCategory.includes(item.chineseName) && item.status == 0"
: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-row>
</div>
</el-card>
</el-collapse-item>
</el-collapse>
<el-card v-else shadow="always" v-for="(val, idx) in infoForm.list" :key="idx" style="min-height:350px">
<div>
<el-empty description="未设置规则!" v-if="!val.isLocation">
<el-button type="primary" size="small" @click="newRoute(idx)">新增规则
</el-button>
</el-empty>
<el-row class="rowPadding" v-else>
<el-button type="primary" size="mini" @click="submit(idx)">保 存</el-button>
<el-button type="primary" v-if="val.status === '1'" size="mini" icon="el-icon-video-pause"
@click="changeStatus(idx)">
停 用</el-button>
<el-button type="primary" v-if="val.status === '3'" size="mini" icon="el-icon-video-pause"
@click="changeStatus(idx)">
启 用</el-button>
<el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" @click="del(idx)">删 除
</el-button>
<el-divider></el-divider>
<el-col :span="24">
<el-form-item label="站点">
<el-col :span="4">
<el-radio-group v-model="val.isLocation" @change="change">
<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="val.isLocation == '1'" v-model="val.location" type="textarea"
:rows="4" resize="none" style="width: 500px" placeholder="站点之间用回车符分隔"
@change="change" @input="change($event)">
</el-input>
<el-input v-else v-model="val.notLocation" type="textarea" :rows="4" resize="none"
style="width: 500px" placeholder="站点之间用回车符分隔" @change="change"
@input="change($event)">
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="URSA包含">
<el-input v-model="val.includeUrsa" type="textarea" :rows="4" resize="none"
style="width:500px" placeholder="URSA之间用分号分隔,例:F2;F3;P_" @change="change"
@input="change($event)">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="URSA不包含">
<el-input v-model="val.notIncludeUrsa" type="textarea" :rows="4" resize="none"
style="width:500px" placeholder="URSA之间用分号分隔,例:F2;F3;P_" @change="change"
@input="change($event)">
</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 class="numberInput" v-model.trim="val.minNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</el-input>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxNumOfPieces"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="重量(KG)">
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.minWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</el-input>
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="10">
<el-input class="numberInput" v-model.trim="val.maxWeight"
oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
@input="change($event)">
</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 v-model="val.typeOfGoods" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.cargoType" :span="2" :key="item.id">
<el-checkbox v-if="item.status === 1" :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 v-model="val.declarationCategory" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.cargoStatus" :span="3" :key="item.id">
<el-checkbox v-if="item.status === 1" :label="item.chineseName"
:name="item.chineseName" disabled :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 v-model="val.puporpuxCode" @change="change">
<el-row>
<el-col :span="2" v-for="item in checkBoxItem.puporpux">
<el-checkbox
v-if="item.status === 1 || val.puporpuxCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.puporpuxCode.includes(item.chineseName) && item.status == 0"
: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 v-model="val.serviceCode" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.serviceCode" :span="2" :key="item.id">
<el-checkbox
v-if="item.status === 1 || val.serviceCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.serviceCode.includes(item.chineseName) && item.status == 0"
: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 v-model="val.handlingCode" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.handlingCode" :span="2" :key="item.id">
<el-checkbox
v-if="item.status === 1 || val.handlingCode.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.handlingCode.includes(item.chineseName) && item.status == 0"
: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 v-model="val.subCategory" @change="change">
<el-row>
<el-col v-for="item in checkBoxItem.subCategory" :span="2" :key="item.id">
<el-checkbox
v-if="item.status === 1 || val.subCategory.includes(item.chineseName)"
:label="item.chineseName" :name="item.chineseName"
:disabled="val.subCategory.includes(item.chineseName) && item.status == 0"
: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-row>
</div>
</el-card>
</el-form>
</div>
</template>
<script>
import {
findByFlightId,
updateOrAddFlight,
allDictData,
findDestinationFltRuleByActualFlight,
findDestinationFltRuleByFlightNo,
updateOrAddFlight,
allDictData,
delFlightId,
enableOrDisable,
batchUpdateOrAddFlight,
findByFlightId,
queryRouteByFltNo
} from "@/api/destinationFlight";
export default {
name: "",
data() {
return {
form: {
minNumOfPieces: undefined,
maxNumOfPieces: undefined,
minWeight: undefined,
maxWeight: undefined,
typeOfGoods: [],
declarationCategory: [],
serviceCode: [],
subCategory: [],
handlingCode: [],
},
rules: {
purposeOfFlightNo: [
{
required: true,
message: "请输入航班号",
trigger: "blur",
},
],
},
typeOfGoods: [],
declarationCategory: [],
formServiceCode: [],
formHandlingCode: [],
formSubCategory: [],
cargoType: [],
cargoStatus: [],
serviceCode: [],
handlingCode: [],
subCategory: [],
isLocation: "1",
disable: false,
nameDisabled: false,
btnLoading: false,
loading: true,
isEmpty: false,
routeName: "",
dataId: "",
handleName: "",
};
},
created() {
this.routeName = this.$route.name;
this.dataId = this.$route.params.id;
this.handleName = this.$route.params.handle;
this.dictData();
if (this.handleName === "detail" || this.handleName === 'DMdetail') {
this.disable = true;
}
if (this.handleName != "add") {
this.nameDisabled = true;
let id = this.$route.params.id;
if (
sessionStorage.getItem("flightInfo" + id) &&
this.$route.name == "FlightAllocConfigInfo" &&
this.handleName != "detail" &&
this.handleName != "DMdetail"
) {
this.loading = false;
this.form = JSON.parse(
sessionStorage.getItem("flightInfo" + this.$route.params.id)
);
if (this.form.notLocation != null || this.form.notLocation == "") {
this.isLocation = "2";
} else {
this.isLocation = "1";
name: 'FlightAllocConfigInfo',
data() {
return {
infoForm: {
fltNo: '',
fltDate: null,
route: null,
list: [],
},
routeList: [],
checkBoxItem: {
cargoType: [],
cargoStatus: [],
puporpux: [],
serviceCode: [],
handlingCode: [],
subCategory: []
},
rules: {
"fltNo": [
{
required: true,
message: "航班号不能为空",
trigger: "blur",
},
]
},
status: '',
routeSatus: '',
isEmpty: false,
disabled: false,
allSubmitDisabled: false,
fltNoDisabled: false,
loading: true,
}
} else {
if (isNaN(Number(this.dataId))) {
findDestinationFltRuleByActualFlight(this.dataId).then((response) => {
if (response.code != 200) {
this.msgWarning(response.msg)
this.isEmpty = true;
} else if (response.data == null) {
this.isEmpty = true;
} else {
let info = response.data;
info.typeOfGoods = info.typeOfGoods
? info.typeOfGoods.split(";")
: [];
info.declarationCategory = info.declarationCategory
? info.declarationCategory.split(";")
: [];
info.serviceCode = info.serviceCode
? info.serviceCode.split(";")
: [];
info.handlingCode = info.handlingCode
? info.handlingCode.split(";")
: [];
info.subCategory = info.subCategory
? info.subCategory.split(";")
: [];
this.form = info;
if (info.notLocation != null || info.notLocation == "") {
this.isLocation = "2";
} else {
this.isLocation = "1";
}
}
this.loading = false;
}).catch(() => {
this.loading = false;
})
} else {
//货物信息
findByFlightId(this.dataId).then((response) => {
if (response.code != 200) {
this.msgWarning(response.msg)
this.isEmpty = true;
},
created() {
this.dictData()
this.status = this.$route.params.handle
this.$route.params.handle === 'detail' ? this.disabled = true : this.disabled = false
this.$route.params.routeStatus ? this.routeSatus = this.$route.params.routeStatus : ''
if (this.$route.params.handle != 'add') {
this.fltNoDisabled = true
this.infoForm.fltNo = this.$route.params.fltNo
this.infoForm.fltDate = this.$route.params.fltDate
this.infoForm.route = this.$route.params.route
if (this.routeSatus == 'dmLog') {
this.getIdDimension(this.$route.params.id)
} else {
let info = response.data.list;
info.typeOfGoods = info.typeOfGoods
? info.typeOfGoods.split(";")
: [];
info.declarationCategory = info.declarationCategory
? info.declarationCategory.split(";")
: [];
info.serviceCode = info.serviceCode
? info.serviceCode.split(";")
: [];
info.handlingCode = info.handlingCode
? info.handlingCode.split(";")
: [];
info.subCategory = info.subCategory
? info.subCategory.split(";")
: [];
this.form = info;
if (info.notLocation != null || info.notLocation == "") {
this.isLocation = "2";
} else {
this.isLocation = "1";
}
this.getRouteDimension({ fltNo: this.$route.params.fltNo, fltDate: this.$route.params.fltDate, route: this.$route.params.route ? this.$route.params.route : '', status: this.$route.params.status })
}
this.loading = false;
}).catch(() => {
this.loading = false;
})
}
}
} else {
this.loading = false;
}
if (this.$route.name == "FlightAllocConfigAdd") {
if (sessionStorage.getItem("flightAdd")) {
this.form = JSON.parse(sessionStorage.getItem("flightAdd"));
if (this.form.notLocation != null || this.form.notLocation == "") {
this.isLocation = "2";
} else {
this.isLocation = "1";
this.infoForm.fltNo = ''
this.infoForm.fltDate = null
this.infoForm.route = null
}
}
}
},
methods: {
//排序
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;
},
submit(form) {
this.$refs[form].validate((valid) => {
if (!valid) {
return false;
}
});
this.btnLoading = true;
if (this.handleName === "update") {
//修改,获取id
this.form.id = this.$route.params.id;
}
//调用接口
this.typeOfGoods = this.form.typeOfGoods;
this.declarationCategory = this.form.declarationCategory;
this.formServiceCode = this.form.serviceCode;
this.formHandlingCode = this.form.handlingCode;
this.formSubCategory = this.form.subCategory;
if (this.form.purposeOfFlightNo) {
this.form.purposeOfFlightNo = this.form.purposeOfFlightNo.toUpperCase();
}
if (this.isLocation == 1) {
this.form.notLocation = "";
} else {
this.form.location = "";
}
if (
this.form.includeUrsa &&
this.form.includeUrsa.length != 0 &&
this.form.notIncludeUrsa &&
this.form.notIncludeUrsa.length != 0
) {
let include = this.form.includeUrsa.split(";");
let notInclude = this.form.notIncludeUrsa.split(";");
let errorList = [];
notInclude.forEach((element) => {
if (element.indexOf("_") > 0) {
errorList.push(element);
} else {
let flag = 0;
for (let i = 0; i < include.length; i++) {
if (
element == "" ||
(include[i].indexOf("_") > 0 &&
include[i].substring(0, 1) == element.substring(0, 1))
) {
flag = 1;
break;
}
mounted() {
this.loading = false
},
watch: {
$route: {
handler(to, from) {
let route = ''
if (from.name == 'FlightInformationMaintenance') {
this.routeSatus = 'flightInformationMaintenance'
route = this.infoForm.list[0].flightRoute
} else if (from.name == 'DmLog') {
this.routeSatus = 'dmLog'
route = this.infoForm.list[0].flightRoute
this.getIdDimension(this.infoForm.list[0].id)
} else {
this.routeSatus = null
}
if (to.name == 'FlightAllocConfigInfo' && from.name != 'DmLog') {
this.getRouteDimension({ fltNo: this.infoForm.fltNo, fltDate: this.infoForm.fltDate, route: route ? route : '', status: this.$route.params.status })
}
if (this.$route.params.handle == 'add') {
this.getRoutes(this.infoForm.fltNo)
}
},
deep: true
},
},
methods: {
//页面选项
dictData() {
allDictData().then((res) => {
if (res.code != 200) {
this.msgError(res.msg)
return;
}
this.checkBoxItem.cargoType = res.data.cargoType;
this.checkBoxItem.cargoStatus = res.data.cargoStatus;
this.checkBoxItem.puporpux = res.data.puporpux;
this.checkBoxItem.serviceCode = this.dicSort(res.data.serviceCode.sort((a, b) =>
a.chineseName.localeCompare(b.chineseName)
));
this.checkBoxItem.handlingCode = this.dicSort(this.sorttodo(res.data.handlingCode, "BLANK"));
this.checkBoxItem.subCategory = this.dicSort(this.sorttodo(res.data.subCategory, "Blank"));
});
},
//id查询维度信息
getIdDimension(val) {
this.routeList = []
this.infoForm.list = []
findByFlightId(val).then(res => {
if (res.code === 200) {
if (res.data.list) {
this.routeList.push(
{
fltNo: res.data.list.purposeOfFlightNo,
route: res.data.list.flightRoute,
routePriority: '1'
}
)
this.infoForm.fltNo = res.data.list.purposeOfFlightNo
this.infoForm.fltDate = res.data.list.ruleDate
this.infoForm.route = res.data.list.flightRoute
this.infoForm.list.push(this.dataHandle(res.data.list))
} else {
this.isEmpty = true
}
} else {
this.msgWarning("为查询到数据!")
this.isEmpty = true
}
}).catch(err => {
console.log(err)
this.isEmpty = true
})
},
//获取航班航线维度
getRouteDimension(val) {
this.routeList = []
this.infoForm.list = []
let obj = {
purposeOfFlightNo: val.fltNo,
flightDate: val.fltDate,
flightRoute: val.route,
status: val.status ? val.status : ''
}
if (flag == 0) {
errorList.push(element);
if (this.$route.params.handle != 'add') {
findDestinationFltRuleByFlightNo(obj).then(res => {
if (res.code === 200) {
this.routeList = res.data.routeList
if (res.data.list.length > 0) {
//请求到数据
if (this.infoForm.route != null && this.infoForm.route != null) {
//航线不为空,对应到这条航线下的这条维度(直接处理插入数据)
if (this.routeSatus == 'flightInformationMaintenanceWhite Tail') {
//如果是从航班维护界面跳转且航班类型为White Tail则直接显示当前航线维度
res.data.list.forEach(item => {
this.infoForm.list.push(this.dataHandle(item))
})
} else {
//航班类型为Purple Tail则显示所有航线维度
this.routeList.forEach(route => {
let routeStatus = 1
res.data.list.forEach(item => {
if (route.route === item.flightRoute) {
//航线对应插入数据
routeStatus = 2
this.infoForm.list.push(this.dataHandle(item))
}
})
if (routeStatus == 1) {
//否则插入占位基础数据
this.infoForm.list.push({
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: route.route,
routePriority: route.routePriority,
})
}
})
}
} else {
//航线为空,对应航班或航班+日期下的全部维度(需补全未创建维度)
this.routeList.forEach(route => {
let routeStatus = 1
res.data.list.forEach(item => {
if (route.route === item.flightRoute) {
//航线对应插入数据
routeStatus = 2
this.infoForm.list.push(this.dataHandle(item))
}
})
if (routeStatus == 1) {
//否则插入占位基础数据
this.infoForm.list.push({
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: route.route,
routePriority: route.routePriority,
})
}
})
}
} else {
//未请求到数据
if (this.infoForm.route != null && this.infoForm.route != '') {
//航线不为空,获取该航线下无日期通用维度设置
findDestinationFltRuleByFlightNo({
purposeOfFlightNo: this.infoForm.fltNo,
flightRoute: this.infoForm.route,
status: this.$route.params.status
}).then(response => {
if (response.data.list.length > 0) {
//查询到通用维度,去除id status,航线赋值,航线优先级赋值
if (this.routeSatus == 'flightInformationMaintenanceWhite Tail') {
//航班类型White Tail只展示当前航线维度
response.data.list.forEach(item => {
item.id = undefined
item.status = undefined
item.flightRoute = this.infoForm.route
this.routeList.forEach(route => {
if (route.route === this.infoForm.route) {
item.routePriority = route.routePriority
}
})
this.infoForm.list.push(this.dataHandle(item))
})
} else {
//航班类型Purple Tail展示全部航线维度
let routesStatus = 1
this.routeList.forEach(route => {
response.data.list.forEach(item => {
if (route.route === item.flightRoute) {
routesStatus = 2
item.id = undefined
item.status = undefined
item.flightRoute = this.infoForm.route
item.routePriority = route.routePriority
this.infoForm.list.push(this.dataHandle(item))
}
})
if (routesStatus == 1) {
this.infoForm.list.push({
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: route.route,
routePriority: route.routePriority,
})
}
})
}
} else {
//未查询到,插入占位基础数据使用户新建
if (this.routeSatus == 'flightInformationMaintenanceWhite Tail') {
//航班类型White Tail只展示当前航线维度
this.routeList.forEach((item) => {
if (item.route === this.infoForm.route) {
this.infoForm.list.push({
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: this.infoForm.route,
routePriority: item.routePriority,
})
}
})
} else {
//航班类型Purple Tail展示全部航线维度
this.isEmpty = true
// this.routeList.forEach((route) => {
// this.infoForm.list.push({
// purposeOfFlightNo: this.infoForm.fltNo,
// ruleDate: this.infoForm.fltDate,
// flightRoute: route.route,
// routePriority: route.routePriority,
// })
// })
}
}
}).catch(err => {
this.isEmpty = true
console.log(err)
})
} else {
//航线为空,提示未找到维度数据
if (this.routeSatus == 'flightInformationMaintenancePurple Tail') {
findDestinationFltRuleByFlightNo({
purposeOfFlightNo: this.infoForm.fltNo,
flightRoute: this.infoForm.route,
status: this.$route.params.status
}).then(response => {
if (response.data.list.length > 0) {
this.routeList.forEach(route => {
let routeStatus = 1
response.data.list.forEach(item => {
if (item.flightRoute == route.route) {
routeStatus = 2
item.id = undefined
item.status = undefined
item.routePriority = route.routePriority
this.infoForm.list.push(
this.dataHandle(item)
)
}
})
if (routeStatus == 1) {
this.infoForm.list.push({
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: route.route,
routePriority: route.routePriority,
})
}
})
} else {
this.isEmpty = true
}
}).catch(err => {
this.isEmpty = true
console.log(err)
})
}
}
}
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
}
}
});
if (errorList.length != 0) {
this.msgWarning("URSA不包含中[" + errorList + "]错误,URSA不包含必须属于URSA包含中的类型")
this.btnLoading = false;
return;
}
}
let service = []
this.serviceCode.forEach(item => {
if (item.status === 1 && this.form.serviceCode.includes(item.chineseName)) {
service.push(item.chineseName)
}
})
this.form.serviceCode = service
let hand = []
this.handlingCode.forEach(item => {
if (item.status === 1 && this.form.handlingCode.includes(item.chineseName)) {
hand.push(item.chineseName)
}
})
this.form.handlingCode = hand
let sub = []
this.subCategory.forEach(item => {
if (item.status === 1 && this.form.subCategory.includes(item.chineseName)) {
sub.push(item.chineseName)
}
})
},
//新增获取航线
getRoutes(val) {
this.routeList = []
this.infoForm.list = []
if (this.status == 'add') {
if (val != '' || val != null) {
this.infoForm.fltNo = this.upCase(val)
queryRouteByFltNo({ fltNo: this.infoForm.fltNo }).then(res => {
if (res.code === 200) {
if (res.data.list.length > 0) {
this.routeList = res.data.list
res.data.list.forEach(item => {
this.infoForm.list.push({
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: item.route,
routePriority: item.ordinal
})
})
} else {
this.routeList = []
this.infoForm.list = []
}
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
}
}
},
//保存
submit(val) {
this.loading = true
let routeArr = []
let data = this.setDataHandle(this.infoForm.list[val])
this.routeList.forEach((item, idx) => {
routeArr.push(item.route)
})
data.routeSpecifyDateSeq = routeArr.join(';')
data.ruleDate = this.infoForm.fltDate
this.infoForm.list[val].routePriority = this.routeList[val].routePriority
if (this.infoForm.route != null && this.infoForm.route != '') {
this.routeList.forEach(item => {
if (item.route == this.infoForm.route) {
data.routePriority = item.routePriority
}
})
data.flightRoute = this.infoForm.route
} else {
data.flightRoute = this.routeList[val].route
data.routePriority = this.routeList[val].routePriority
}
updateOrAddFlight(data).then(res => {
this.loading = false
if (res.code === 200) {
this.fltNoDisabled = true
this.$forceUpdate()
this.msgSuccess('保存成功!')
this.infoForm.list[val] = this.dataHandle(res.data)
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
//删除
del(val) {
if (this.infoForm.list[val].id) {
if (this.infoForm.list[val].status == "1") {
this.$confirm("航班规则生效中,无法删除,请停用后再操作", "警告", {
confirmButtonText: "确定",
showCancelButton: false,
type: "warning",
});
} else {
this.loading = true
this.$confirm("是否确认删除此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
showCancelButton: true,
type: "warning",
}).then(() => {
delFlightId(this.infoForm.list[val].id)
.then((res) => {
this.loading = false
res.code === 200 ? this.msgSuccess(res.msg) : this.msgWarning(res.msg)
let obj = {
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: this.infoForm.list[val].flightRoute,
routePriority: this.infoForm.list[val].routePriority,
}
this.infoForm.list[val] = obj
this.$forceUpdate()
}).catch(() => {
this.loading = false
});
});
}
} else {
this.infoForm.list[val] = {
purposeOfFlightNo: this.infoForm.fltNo,
ruleDate: this.infoForm.fltDate,
flightRoute: this.routeList[val].route,
routePriority: this.routeList[val].routePriority,
}
}
},
//新增
newRoute(val) {
this.infoForm.list[val].purposeOfFlightNo = this.infoForm.fltNo
this.infoForm.list[val].ruleDate = this.infoForm.fltDate
this.infoForm.list[val].flightRoute = this.routeList[val].route
this.infoForm.list[val].routePriority = this.routeList[val].routePriority
this.infoForm.list[val].isLocation = '1'
this.infoForm.list[val].typeOfGoods = []
this.infoForm.list[val].declarationCategory = []
this.infoForm.list[val].puporpuxCode = []
this.infoForm.list[val].serviceCode = []
this.infoForm.list[val].handlingCode = []
this.infoForm.list[val].subCategory = []
console.log(this.infoForm)
this.$forceUpdate()
},
//启用,停用
changeStatus(idx) {
this.loading = true
let status = this.infoForm.list[idx].status
let tip = status === '1' ? "停用" : "启用";
this.$confirm("是否确认" + tip + "此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
status == '1' ? status = '3' : status = '1'
enableOrDisable(this.infoForm.list[idx].id, status)
.then((res) => {
this.loading = false
if (res.code != 200) {
this.msgError(res.msg);
} else {
this.msgSuccess(tip + "成功");
this.infoForm.list[idx] = this.dataHandle(res.data)
this.$forceUpdate()
}
})
.catch(() => {
this.loading = false
});
}).catch(() => {
this.loading = false
})
},
//保存航班优先级
setRoutes() {
this.loading = true
let routeArr = []
let arr = []
let infoForm = this.infoForm.list
this.routeList.forEach((item, idx) => {
routeArr.push(item.route)
this.infoForm.list[idx].routePriority = item.routePriority
})
infoForm.forEach((val, index) => {
val.routeSpecifyDateSeq = routeArr.join(';')
val.routePriority = this.routeList[index].routePriority
this.setDataHandle(val) ? arr.push(this.setDataHandle(val)) : ''
})
this.$confirm("是否要保存,如果保存下方的维度会一同进行保存!", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
batchUpdateOrAddFlight(arr).then(res => {
this.loading = false
if (res.code === 200) {
res.data.forEach((item, idx) => {
this.infoForm.list[idx] = this.dataHandle(item)
})
this.$forceUpdate()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
}).catch(() => {
this.infoForm.list.map((item, idx) => {
if (item.isLocation) {
this.infoForm.list[idx] = this.dataHandle(item)
}
})
this.$forceUpdate()
this.loading = false
})
},
//航线优先级修改
drag(val) {
this.routeList = val
// this.routeList.map((item, index) => {
// item.routePriority = val[index].routePriority
// })
},
//刷新控件
change(e) {
this.$forceUpdate()
},
//数据处理
dataHandle(val) {
val.isLocation = '1'
val.location ? val.isLocation = '1' : ''
val.notLocation ? val.isLocation = '2' : ''
val.maxNumOfPieces == null ? val.maxNumOfPieces = undefined : val.maxNumOfPieces = val.maxNumOfPieces//最大件数
val.maxWeight == null ? val.maxWeight = undefined : val.maxWeight = val.maxWeight//最大重量
val.minNumOfPieces == null ? val.minNumOfPieces = undefined : val.minNumOfPieces = val.minNumOfPieces//最小件数
val.minWeight == null ? val.minWeight = undefined : val.minWeight = val.minWeight//最小件数
val.typeOfGoods != null ? val.typeOfGoods = val.typeOfGoods.split(';') : val.typeOfGoods = []//申报类型
val.declarationCategory != null ? val.declarationCategory = val.declarationCategory.split(';') : val.declarationCategory = []//货物类型
val.puporpuxCode != null ? val.puporpuxCode = val.puporpuxCode.split(';') : val.puporpuxCode = []//取件扫描码
val.serviceCode != null ? val.serviceCode = val.serviceCode.split(';') : val.serviceCode = []//serviceCode
val.handlingCode != null ? val.handlingCode = val.handlingCode.split(';') : val.handlingCode = []//handlingCode
val.subCategory != null ? val.subCategory = val.subCategory.split(';') : val.subCategory = []//subCategory
return val
},
//提交数据处理
setDataHandle(val) {
let obj = {}
if (val.isLocation) {
obj = val
obj.isLocation == '1' ? obj.notLocation = '' : obj.location = ''
if (this.form.includeUrsa && this.form.includeUrsa.length != 0) {
this.form.includeUrsa = this.upCase(this.form.includeUrsa)
}
if (obj.notLocation && obj.notLocation.length != 0) {
obj.notLocation = obj.notLocation.toUpperCase()
}
if (this.form.notIncludeUrsa && this.form.notIncludeUrsa.length != 0) {
this.form.notIncludeUrsa = this.upCase(this.form.notIncludeUrsa)
}
if (obj.location && obj.location.length != 0) {
obj.location = obj.location.toUpperCase()
}
this.form.subCategory = sub
updateOrAddFlight(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess('成功')
this.close();
} else {
this.msgWarning(response.msg)
this.btnLoading = false;
}
});
this.form.typeOfGoods = this.typeOfGoods;
this.form.declarationCategory = this.declarationCategory;
this.form.serviceCode = this.formServiceCode;
this.form.handlingCode = this.formHandlingCode;
this.form.subCategory = this.formSubCategory;
},
if (obj.includeUrsa && obj.includeUrsa.length != 0) {
obj.includeUrsa = obj.includeUrsa.toUpperCase()
}
close() {
this.removes();
this.$store.state.tagsView.visitedViews.splice(
this.$store.state.tagsView.visitedViews.findIndex(
(item) => item.path === this.$route.path
),
);
if (this.handleName === 'DMdetail') {
this.$router.push({ name: "DmLog" })
} else {
this.$router.push({ name: "FlightAllocConfig" })
}
},
if (obj.notIncludeUrsa && obj.notIncludeUrsa.length != 0) {
obj.notIncludeUrsa = obj.notIncludeUrsa.toUpperCase()
}
removes() {
if (this.routeName == "FlightAllocConfigAdd") {
sessionStorage.setItem("flightAdd", "remove");
} else {
sessionStorage.setItem("flightInfo" + this.dataId, "remove");
}
},
let puporpux = []
this.checkBoxItem.puporpux.forEach(item => {
if (item.status === 1 && obj.puporpuxCode.includes(item.chineseName)) {
puporpux.push(item.chineseName)
}
})
dictData() {
allDictData().then((response) => {
if (response.code != 200) {
this.msgError(response.msg)
return;
}
let dict = response.data;
this.cargoType = dict.cargoType;
this.cargoStatus = dict.cargoStatus;
this.serviceCode = this.dicSort(dict.serviceCode.sort((a, b) =>
a.chineseName.localeCompare(b.chineseName)
));
this.handlingCode = this.dicSort(this.sorttodo(dict.handlingCode, "BLANK"));
this.subCategory = this.dicSort(this.sorttodo(dict.subCategory, "Blank"));
});
},
let service = []
this.checkBoxItem.serviceCode.forEach(item => {
if (item.status === 1 && obj.serviceCode.includes(item.chineseName)) {
service.push(item.chineseName)
}
})
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
}
},
let hand = []
this.checkBoxItem.handlingCode.forEach(item => {
if (item.status === 1 && obj.handlingCode.includes(item.chineseName)) {
hand.push(item.chineseName)
}
})
beforeDestroy() {
if (this.routeName == "FlightAllocConfigAdd") {
if (sessionStorage.getItem("flightAdd") == "remove") {
sessionStorage.removeItem("flightAdd");
} else {
sessionStorage.setItem("flightAdd", JSON.stringify(this.form));
}
} else {
if (sessionStorage.getItem("flightInfo" + this.dataId) == "remove") {
sessionStorage.removeItem("flightInfo" + this.dataId);
} else {
if (this.handleName != "detail" && this.handleName != "DMdetail") {
sessionStorage.setItem(
"flightInfo" + this.dataId,
JSON.stringify(this.form)
);
}
}
}
},
let sub = []
this.checkBoxItem.subCategory.forEach(item => {
if (item.status === 1 && obj.subCategory.includes(item.chineseName)) {
sub.push(item.chineseName)
}
})
obj.typeOfGoods = obj.typeOfGoods.toString().replace(/,/g, ';')
obj.declarationCategory = obj.declarationCategory.toString(';').replace(/,/g, ';')
obj.puporpuxCode = puporpux.toString().replace(/,/g, ';')
obj.serviceCode = service.toString().replace(/,/g, ';')
obj.handlingCode = hand.toString().replace(/,/g, ';')
obj.subCategory = sub.toString().replace(/,/g, ';')
computed: {
includeUrsa: {
get: function () {
return this.form.includeUrsa;
},
set: function (val) {
this.form.includeUrsa = this.upCase(val);
},
},
notIncludeUrsa: {
get: function () {
return this.form.notIncludeUrsa;
},
set: function (val) {
this.form.notIncludeUrsa = this.upCase(val);
},
},
minNumOfPieces: {
get: function () {
return this.form.minNumOfPieces;
},
set: function (val) {
const reg = /^[1-9]{0,}$/
if (reg.test(val)) {
this.form.minNumOfPieces = val
}
if (val == 0 || val == null || val == "-") {
this.form.minNumOfPieces = undefined;
}
},
},
maxNumOfPieces: {
get: function () {
return this.form.maxNumOfPieces;
},
set: function (val) {
const reg = /^[1-9]{0,}$/
if (reg.test(val)) {
this.form.maxNumOfPieces = val
}
if (val == 0 || val == null || val == "-") {
this.form.maxNumOfPieces = undefined;
}
},
},
minWeight: {
get: function () {
return this.form.minWeight;
},
set: function (val) {
const reg = /^\d{1,1}\d*\.{0,1}\d{0,}$/
console.log(reg.test(val))
if (val == null || val == "-") {
this.form.minWeight = undefined;
} else if (!isNaN(val)) {
this.form.minWeight = val;
}
},
},
maxWeight: {
get: function () {
return this.form.maxWeight;
},
set: function (val) {
if (val == null || val == "-") {
this.form.maxWeight = undefined;
} else if (!isNaN(val)) {
this.form.maxWeight = val;
}
},
return obj
}
},
//排序
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
},
//返回
close() {
this.$store.state.tagsView.visitedViews.splice(
this.$store.state.tagsView.visitedViews.findIndex(
(item) => item.path === this.$route.path
),
);
this.$router.push({ name: 'FlightAllocConfig' })
},
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.el-textarea.is-disabled .el-textarea__inner {
background-color: rgba(255, 255, 255, 0.5);
color: #303133;
}
.el-input.is-disabled .el-input__inner {
background-color: rgba(255, 255, 255, 0.5);
color: #303133;
}
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
background-color: rgba(255, 255, 255, 0.5);
computed: {}
}
</script>
.el-checkbox__input.is-disabled+span.el-checkbox__label {
color: #303133;
<style lang="scss" scoped>
.fontWeight {
font-size: 16px;
font-weight: 700;
text-indent: 2em;
}
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
border-color: #303133;
.rowPadding {
padding: 10px 50px;
font-size: 12px;
}
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
border-color: #606266;
.routeTip {
margin-left: 35px;
margin-bottom: 20px;
font-size: 16px;
color: #ff4949;
}
.numberInput {
input {
text-align: center;
}
input {
text-align: center;
}
}
</style>
</style>
\ No newline at end of file
......
......@@ -55,14 +55,15 @@
</el-form>
<el-table max-height="500" highlight-current-row border stripe v-loading="loading" :data="tableData">
<el-table-column label="运单号" align="center" prop="waybillNo" />
<el-table-column label="申报类别" align="center" prop="typeName" />
<el-table-column label="件数" align="center" prop="qty" width="70" />
<el-table-column label="实际重量" align="center" prop="actualWeight" width="100" />
<el-table-column :show-overflow-tooltip="true" label="品牌描述" align="center" prop="nameDescription" />
<el-table-column label="航班日期" align="center" prop="fltDate" />
<el-table-column label="航班号" align="center" prop="fltNo" width="100" />
<el-table-column label="航班路线" align="center" prop="route" />
<el-table-column label="配置航班类型" align="center" prop="kindName" width="130" />
<el-table-column label="尺寸" align="center" prop="sizeStr" width="70" />
<el-table-column label="件数" align="center" prop="qty" width="70" />
<el-table-column label="实际重量" align="center" prop="actualWeight" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
</el-table>
<pagination v-show="total > 0" :total="total" layout=" prev, pager, next, jumper, sizes,total"
......
......@@ -71,10 +71,12 @@
@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">
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>
</template>
</el-table-column>
</template>
......@@ -91,35 +93,46 @@
</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>
</el-form-item>
</el-col>
</el-row>
<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>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="Pre-MDE CutOff时间" prop="cutOffTime">
<el-select class="wid80" v-model="form.cutOffTime" clearable placeholder="选择时间(输入查找选项)" type="string"
filterable>
<el-option v-for="item in selectOption.cutOffTime" :key="item" :label="item" :value="item">
<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-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="航班路线" prop="route">
<el-input class="wid80" v-model="form.route" placeholder="请输入航班路线(XXX-XXX字母大写,多组用;分割)" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="航班种类" prop="kindId">
<el-select class="wid80" v-model="form.kindId" placeholder="请选择航班种类">
<el-option v-for="item in selectOption.flightKindlist" :key="item.id" :label="item.chineseName"
:value="item.id">
<el-form-item prop="route">
<template slot="label">
<div style="display:inline-block">航班路线
<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 ref="routeSelect" class="wid80" v-model="form.route" :disabled="formdisabled.route"
placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" :multiple='routeMultiple'
:key="routeMultiple">
<el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route">
</el-option>
</el-select>
</el-form-item>
......@@ -158,19 +171,13 @@
v-model="form.extraWeightPercent"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<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>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="该航班预审状态:">
<el-tag v-if="preAudit" :type="preAudit == '开启' ? 'success' : 'info'" effect="dark">{{ preAudit }}
</el-tag>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
......@@ -241,7 +248,7 @@
</div>
</el-dialog>
<el-dialog title="未删除成功航班" width="40%" center :visible.sync="dialogTableVisible" :close-on-click-modal="false"
:append-to-body="true" :show-close="false">
:append-to-body="true">
<el-table :data="gridData">
<el-table-column property="fltNo" label="航班号"></el-table-column>
<el-table-column property="fltDate" label="航班日期"></el-table-column>
......@@ -314,17 +321,17 @@ export default {
trigger: "blur",
},
],
// route: [
// {
// required: true,
// message: "航班线路不能为空",
// trigger: "blur",
// },
// {
// pattern: /^(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)(;{1,1}(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)){0,}$/,
// message: "请输入正确得航班线路"
// }
// ]
route: [
{
required: true,
message: "航班线路不能为空",
trigger: "blur",
},
// {
// pattern: /^(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)(;{1,1}(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)){0,}$/,
// message: "请输入正确得航班线路"
// }
]
},
//原航班规则数据
findAllFltDatList: [],
......@@ -338,12 +345,12 @@ export default {
fltNo: false,
//航班日期
fltDate: false,
//航班路线
route: false,
//航班种类
kindId: false,
//航班类型
typeId: false,
//航线
route: false,
//原始重量
originalWeight: false,
},
......@@ -411,6 +418,10 @@ export default {
ids: [],
//目的航班数据
sourceFlightAndFlightDate: [],
//航线数据
routeList: [],
//航线多选状态
routeMultiple: false,
//航班预审状态
preAudit: null,
//高价百分比是否打开
......@@ -444,6 +455,7 @@ export default {
}
},
activated() {
this.ids = []
this.findFltConditionData();
this.findAllFltData();
},
......@@ -467,6 +479,7 @@ export default {
methods: {
//输入航班号后
blurfltNo() {
this.routeList = []
if (
this.form.fltNo != null &&
this.form.fltNo != undefined &&
......@@ -493,17 +506,16 @@ export default {
//this.form.extraWeightPercent=response.data.extraWeightPercent=0;
}
//是否开启高低价:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否开启高低价’ 为是,不可编辑
if (
response.data != null &&
response.data.highLowPriceFlg != null &&
response.data.highLowPriceFlg != undefined
) {
this.form.highLowPriceFlg = response.data.highLowPriceFlg;
} else {
this.$set(this.form, "highLowPriceFlg", 1);
//this.form.highLowPriceFlg = true;
}
//是否预审:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否预审’ 为否,不可编辑;
// if (
// response.data != null &&
// response.data.highLowPriceFlg != null &&
// response.data.highLowPriceFlg != undefined
// ) {
// this.form.highLowPriceFlg = response.data.highLowPriceFlg;
// } else {
this.$set(this.form, "highLowPriceFlg", 0);
// //this.form.highLowPriceFlg = true;
// }
//高/低价百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘高价百分比’60%,‘低价百分比’40%,不可编辑
if (
response.data != null &&
......@@ -530,7 +542,24 @@ export default {
this.msgError(response.msg);
}
});
//获取航线
this.getRoute(this.form.fltNo).then(res => {
this.routeList = res.list
}).catch(err => {
console.log(err)
})
}
},
//航班种类修改
kindChange(val) {
if (val === 94076) {
this.form.route = []
this.routeMultiple = true
} else {
this.form.route = ''
this.routeMultiple = false
}
this.$refs.routeSelect.$forceUpdate()
},
//查询条件数据源
findFltConditionData() {
......@@ -590,7 +619,7 @@ export default {
handleAdd() {
this.reset();
this.findFltConditionData();
this.preAudit = null;
this.preAudit = null
this.open = true;
this.title = "添加航班信息";
this.form.id = null;
......@@ -602,10 +631,10 @@ export default {
this.formdisabled.fltNo = false;
//航班日期
this.formdisabled.fltDate = false;
//航班路线
this.formdisabled.route = false;
//航班种类
this.formdisabled.kindId = false;
//航线
this.formdisabled.route = false;
//航班类型
this.formdisabled.typeId = false;
//原始重量
......@@ -714,10 +743,15 @@ export default {
this.formdisabled.fltNo = true;
//航班日期
this.formdisabled.fltDate = true;
//航班种类
this.formdisabled.kindId = true;
//航线
this.formdisabled.route = true
//根据ID查item
findFltById(row).then((response) => {
if (response.code == 200) {
this.form = response.data;
this.form.route.split(';')
//是否开启高低价
// this.form.highLowPriceFlg = this.form.highLowPriceFlg === 1 ? true : false;
//是否预审
......@@ -729,6 +763,21 @@ export default {
}
});
},
//查看航班维度
goFlightAllocConfig(val) {
let obj = {
handle: 'update',
fltNo: val.fltNo,
fltDate: val.fltDate ? val.fltDate : null,
route: val.flightKindName != 'Purple Tail' ? val.route : '',
routeStatus: 'flightInformationMaintenance' + val.flightKindName,
status: '1'
}
this.$router.push({
name: 'FlightAllocConfigInfo',
params: obj
})
},
/** 删除按钮操作 */
handleDelete(row) {
let fIds = [];
......@@ -797,10 +846,12 @@ export default {
// formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
//总重量更新
// formdata.totalWeight = this.Weightall()
formdata.route = this.form.route.toString().replace(/,/g, ';')
//处理数据
saveOrUpdate(formdata).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.routeList = []
this.open = false;
this.findAllFltData();
} else {
......@@ -817,6 +868,7 @@ export default {
},
//取消按钮
cancel() {
this.routeList = []
this.open = false;
this.findAllFltData();
this.findFltConditionData();
......@@ -899,6 +951,10 @@ export default {
this.findAllFltData();
}
},
//航线修改
routeChange(val) {
this.$forceUpdate()
},
//多选框选中数据
tableSelect(val) {
this.ids = val.selection;
......
<template>
<div>
<el-dialog title="新 增" :visible.sync="open" width="25%" :close-on-click-modal="false" :show-close="false"
append-to-body center>
<el-form class="form-header" :model="formData" size="small" ref="addForm" label-width="auto"
label-position="left" style="margin-bottom:10px" :rules="rules" @submit.native.prevent>
<el-form-item label="货站名称" prop="goodsStation">
<el-input type="text" v-model="formData.goodsStation" maxlength="25" placeholder="请输入货站名称">
</el-input>
</el-form-item>
<el-form-item label="品名" prop="goodsList">
<el-input type="textarea" v-model="formData.goodsList" rows="4" maxlength="125"
placeholder="请输入品名,多个用“;”隔开">
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="loading" @click="submit">确 定</el-button>
<el-button @click="close">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { batchAddGoods } from "@/api/goodsStation"
export default {
name: '',
props: {
open: {
type: Boolean,
default: false
},
},
data() {
return {
formData: {
goodsStation: null,
goodsList: null
},
rules: {
goodsStation: [
{
required: true,
message: "货站名称不能为空",
trigger: "blur",
},
],
goodsList: [
{
required: true,
message: "品名不能为空",
trigger: "blur",
},
],
},
loading: false,
}
},
watch: {
},
methods: {
//提交
submit() {
let obj = {}
obj.goodsStation = this.formData.goodsStation
this.formData.goodsList = this.formData.goodsList.replace(/;/g, ";")
if (this.formData.goodsList != null && this.formData.goodsList != '') {
obj.goodsList = this.formData.goodsList.split(';')
}
this.$refs['addForm'].validate(val => {
if (val) {
this.loading = true
batchAddGoods(obj).then(res => {
this.loading = false
if (res.code === 200) {
this.msgSuccess('添加成功')
this.close()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
}
})
},
//取消
close() {
this.formData = {
goodsStation: null,
goodsList: null
}
this.$refs["addForm"].clearValidate();
this.$emit('close')
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-form class="form-header" ref="selectForm" label-width="auto" label-position="left"
style="margin-bottom:10px" @submit.native.prevent size="small">
<el-row>
<el-col :span="6">
<el-form-item label="货站名称">
<el-input v-model="selectionData.goodsStation" placeholder="请输入货站名称" maxlength="50" clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display:flex;padding:10px 20px">
<el-button icon="el-icon-search" type="primary" :loading="loading" size="small" @click="selection(1)">查 询
</el-button>
<el-button icon="el-icon-plus" type="primary" size="small" v-hasPermi="['base:goodsStation:add']"
@click="add">新 增
</el-button>
<el-button icon="el-icon-delete" type="danger" size="small" v-hasPermi="['base:goodsStation:delete']"
style="margin-left:10px" :disabled="checkData.length==0" @click="batchDel">
删 除
</el-button>
<el-button type="primary" icon="el-icon-download" size="small" style="margin-right:10px"
@click="downloadTempleate">下载模板
</el-button>
<el-upload action="/caPreReviewImport/importFlight" name="file" :http-request="uploadExcel"
:on-remove="handleRemove" :limit="1" :on-exceed="handleExceed" :file-list="fileList" accept=".xlsx"
class="upload-demo" v-hasPermi="['base:goodsStation:add']">
<el-button type="primary" icon="el-icon-upload2" size="small">导入Excel</el-button>
</el-upload>
</div>
<Tables ref="goodsStation" ductName="goodsStation" :data="tableData" :headerData="tableHeader" :selection="true"
:order="true" :selectFixed="false" :totalCount="totalCount" :loading="loading"
:limitSize="selectionData.size" :page="selectionData.page" layout="total,prev, pager, next, jumper, ->"
:pageSizes="[100]" :height="tableHeight" @tableSelect="tableSelect" @tableSelectAll="tableSelectAll"
@currentChange="currentChange">
<template slot="optionColumn">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" style="color:#ff4949"
v-hasPermi="['base:goodsStation:delete']" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</template>
</Tables>
<Dialog :open="open" @close="close" />
<UpDateResult :dialogVisible="resultOpen" :resultData="errorData" @close="resultClose" />
</div>
</template>
<script>
import { downLoadTemplate } from "@/api/flightInfoImport";
import { importGoods, batchDeleteGoods, searchGoods } from "@/api/goodsStation"
import Dialog from './dialog.vue'
import UpDateResult from './upDateResult.vue'
export default {
name: 'GoodsStation',
components: {
Dialog,
UpDateResult
},
data() {
return {
selectionData: {
goodsStation: '',
size: 20,
page: 1
},
tableData: [],
tableHeader: this.tableHeaders['goodsStation'],
checkData: [],
fileList: [],
errorData: [],
tableHeight: null,
totalCount: 0,
loading: false,
open: false,
resultOpen: false,
}
},
created() {
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.goodsStation.$el.offsetHeight - 200
this.selection(1)
},
watch: {
$route(to, from) {
if (to.name == 'GoodsStation') {
this.selection()
}
}
},
methods: {
//查询
selection(val) {
this.tableData = []
this.checkData = []
this.loading = true
if (val === 1) {
this.selectionData.page = 1
}
searchGoods(this.selectionData).then(res => {
this.loading = false
if (res.code === 200) {
this.tableData = res.data.list
this.totalCount = res.data.total
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
},
//新增
add() {
this.open = true
},
//删除
del(val) {
this.$confirm("是否要删除这条记录!", "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
type: "warning",
}).then(() => {
this.deleteGoods([val.id])
}).catch(() => {
})
},
//批量删除
batchDel() {
let arr = []
this.checkData.forEach(item => {
arr.push(item.id)
})
this.$confirm("是否要删除这些记录!", "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
type: "warning",
}).then(() => {
this.deleteGoods(arr)
}).catch(() => {
})
},
//删除请求
deleteGoods(val) {
batchDeleteGoods(val).then(res => {
if (res.code === 200) {
this.msgSuccess('删除成功!')
this.selection(1)
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
//复选
tableSelect(val) {
this.checkData = val.selection
},
//全选
tableSelectAll(val) {
this.checkData = val
},
//分页
currentChange(val) {
this.selectionData.page = val.page
this.selection()
},
//上传excel
uploadExcel(option) {
const file = option.file;
this.loading = true;
importGoods(file, '').then((res) => {
this.loading = false;
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
} else {
this.$message.warning(res.msg);
this.errorData = res.data;
if (this.errorData.length > 0) {
this.resultOpen = true
}
}
} else {
this.$message.success(res.msg);
this.errorData = res.data;
this.selection(1)
}
});
},
//下载模板
downloadTempleate() {
downLoadTemplate('goodsStation').then((res) => {
if (res) {
const blob = new Blob([res]);
const link = document.createElement("a"); //创建a标签
link.download = '货物品名模板.xlsx'; //a标签添加属性
link.style.display = "none";
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click(); //执行下载
URL.revokeObjectURL(link.href); //释放url
document.body.removeChild(link); //释放标签
} else {
this.$message.error("下载失败");
}
})
},
handleRemove(file, fileList) {
//清掉上传的文件
this.errorData = [];
this.fileList = [];
},
handleExceed(files) {
//重复上传文件
let file = {};
file.file = files[0];
file.name = files[0].name;
this.fileList = [];
this.fileList.push(file);
this.uploadExcel(file);
},
close() {
this.open = false
this.selection(1)
},
resultClose() {
this.resultOpen = false
this.selection(1)
}
}
}
</script>
<style lang="scss" scoped>
.upload-demo {
display: flex;
.el-upload-list__item:first-child {
margin-top: 5px !important;
}
.el-upload-list {
display: inline-block;
margin-left: 10px;
}
}
</style>
\ No newline at end of file
<template>
<div>
<el-dialog title="新 增" :visible.sync="dialogVisible" width="50%" top="1vh" :close-on-click-modal="false"
:show-close="false" append-to-body center>
<el-table ref="filterTable" class="mt20" :data="resultData" size="small" border>
<el-table-column label="行号" prop="line" width="50" align="center">
</el-table-column>
<el-table-column label="错误信息" prop="errorMessage" width="200">
<template slot-scope="scope">
<div v-for="(m, key) in scope.row.errorMessage" :key="key">
{{ m }}
</div>
</template>
</el-table-column>
<el-table-column v-if="resultData.length == 0"></el-table-column>
<el-table-column v-for="(value, key) in this.resultData[0]" :key="key"
v-if="key != 'errorMessage' && key != 'line'" header-align="center" align="center" :label="key"
:prop="key"></el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="close">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'UpDateResult',
props: {
dialogVisible: {
type: Boolean,
default: false
},
resultData: {
type: Array,
default: null
}
},
data() {
return {
}
},
wactch: {
dialogVisible(val) {
if (val) {
}
}
},
methods: {
close() {
this.$emit('close')
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-dialog title="新 增" :visible.sync="open" width="25%" :close-on-click-modal="false" :show-close="false"
append-to-body center>
<el-form class="form-header" :model="formData" size="small" ref="addForm" label-width="auto"
label-position="left" style="margin-bottom:10px" :rules="rules" @submit.native.prevent>
<el-form-item label="货站名称" prop="goodsStation">
<el-input type="text" v-model="formData.goodsStation" maxlength="25" placeholder="请输入货站名称">
</el-input>
</el-form-item>
<el-form-item label="航班" prop="flightList">
<el-input type="textarea" v-model="flightList" rows="4" maxlength="125" placeholder="请输入航班,多个用“;”隔开">
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="loading" @click="submit">确 定</el-button>
<el-button @click="close">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { batchAddStationFlight } from '@/api/goodsStationFlight'
export default {
name: '',
props: {
open: {
type: Boolean,
default: false
},
},
data() {
return {
formData: {
goodsStation: null,
flightList: null
},
rules: {
goodsStation: [
{
required: true,
message: "货站名称不能为空",
trigger: "blur",
},
],
flightList: [
{
required: true,
message: "航班号不能为空",
trigger: "blur",
},
],
},
loading: false,
}
},
watch: {
},
methods: {
//提交
submit() {
let obj = {}
obj.goodsStation = this.formData.goodsStation
if (this.formData.flightList != null && this.formData.flightList != '') {
this.formData.flightList = this.formData.flightList.toUpperCase()
obj.flightList = this.formData.flightList.split(';')
}
this.$refs['addForm'].validate(val => {
if (val) {
this.loading = true
batchAddStationFlight(obj).then(res => {
this.loading = false
if (res.code === 200) {
this.msgSuccess('添加成功!')
this.close()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
}
})
},
//取消
close() {
this.formData = {
goodsStation: null,
flightList: null
}
this.$refs["addForm"].clearValidate();
this.$emit('close')
}
},
computed: {
flightList: {
get: function () {
return this.formData.flightList
},
set: function (val) {
const reg = /^([a-zA-Z0-9]{0,40}(\;[a-zA-Z0-9]{0,40})*)$/
if (reg.test(val)) {
this.formData.flightList = val
}
},
},
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-form class="form-header" ref="dictForm" label-width="auto" label-position="left" style="margin-bottom:10px"
@submit.native.prevent size="small">
<el-row>
<el-col :span="6">
<el-form-item label="货站名称">
<el-input v-model="selectionData.goodsStation" placeholder="请输入货站名称" maxlength="50" clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display:flex;padding:10px 20px">
<el-button icon="el-icon-search" :loading="loading" type="primary" size="small" @click="selection(1)">查 询
</el-button>
<el-button icon="el-icon-plus" type="primary" size="small" v-hasPermi="['base:goodsStationFlight:add']"
@click="add">新 增
</el-button>
<el-button icon="el-icon-delete" type="danger" size="small" style="margin:0 10px"
:disabled="checkData.length == 0" v-hasPermi="['base:goodsStationFlight:delete']" @click="batchDel">
删 除
</el-button>
</div>
<Tables ref="goodsStationFlight" ductName="goodsStationFlight" :data="tableData" :headerData="tableHeader"
:selection="true" :order="true" :selectFixed="false" :totalCount="totalCount" :loading="loading"
:limitSize="selectionData.size" :page="selectionData.page" layout="total,prev, pager, next, jumper, ->"
:pageSizes="[100]" :height="tableHeight" @tableSelect="tableSelect" @tableSelectAll="tableSelectAll"
@currentChange="currentChange">
<template slot="optionColumn">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" style="color:#ff4949"
v-hasPermi="['base:goodsStationFlight:delete']" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</template>
</Tables>
<Dialog :open="open" @close="close" />
</div>
</template>
<script>
import { searchStationFlight, batchDeleteGoods } from '@/api/goodsStationFlight'
import Dialog from './dialog.vue'
export default {
name: 'GoodsStationFlight',
components: {
Dialog
},
data() {
return {
selectionData: {
size: 20,
page: 1
},
tableData: [],
tableHeader: this.tableHeaders['goodsStationFlight'],
checkData: [],
tableHeight: null,
totalCount: 0,
loading: false,
open: false,
}
},
created() {
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.goodsStationFlight.$el.offsetHeight - 200
this.selection(1)
},
watch: {
$route(to, from) {
if (to.name == 'GoodsStationFlight') {
this.selection()
}
}
},
methods: {
//查询
selection(val) {
this.tableData = []
this.checkData = []
this.loading = true
if (val == 1) {
this.selectionData.page = 1
}
searchStationFlight(this.selectionData).then(res => {
this.loading = false
if (res.code === 200) {
this.tableData = res.data.list
this.totalCount = res.data.total
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
his.loading = false
console.log(err)
})
},
add() {
this.open = true
},
//删除
del(val) {
this.$confirm("是否要删除这条记录!", "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
type: "warning",
}).then(() => {
this.deleteGoods([val.id])
}).catch(() => { })
},
//批量删除
batchDel() {
let arr = []
this.checkData.forEach(item => {
arr.push(item.id)
})
this.$confirm("是否要删除这些记录!", "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
type: "warning",
}).then(() => {
this.deleteGoods(arr)
}).catch(() => {
})
},
//删除请求
deleteGoods(val) {
batchDeleteGoods(val).then(res => {
if (res.code === 200) {
this.msgSuccess('操作成功!')
this.selection(1)
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
//复选
tableSelect(val) {
this.checkData = val.selection
},
//全选
tableSelectAll(val) {
this.checkData = val
},
//分页
currentChange(val) {
this.selectionData.page = val.page
this.selection()
},
close() {
this.open = false
this.selection(1)
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -16,10 +16,10 @@
</el-col>
</el-row>
</el-form>
<Tables ref="cargoLog" ductName="cargoLog" :order="false" :data="data.tableData" :headerData="tableHeader"
tableAlign="center" :showOverflowTooltip="false" :height="tableHeight" :page="selectData.page"
:limitSize="selectData.size" :pageSizes="[100]" :pagination="false" :loading="loading"
@currentChange="currentChange">
<Tables ref="cargoLog" ductName="cargoLog" :order="false" :border='false' :data="data.tableData"
:headerData="tableHeader" tableAlign="center" :showOverflowTooltip="false" :height="tableHeight"
:page="selectData.page" :limitSize="selectData.size" :pageSizes="[100]" :pagination="false"
:loading="loading" @currentChange="currentChange">
</Tables>
<div slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
......@@ -93,4 +93,5 @@ export default {
</script>
<style scoped>
</style>
\ No newline at end of file
......
......@@ -49,7 +49,7 @@
<el-col :span="6">
<el-form-item label="配载航班号">
<el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :rows="4"
clearable></el-input>
clearable @change="planeNoChange"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
......@@ -129,6 +129,24 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<template slot="label">
<div style="display:inline-block">配载航线
<el-tooltip class="item" effect="dark" content="选择航线需要先输入配载航班号,才能选择对应得航线" placement="top-start">
<span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span>
</el-tooltip>
</div>
</template>
<el-select class="formItem" v-model="formData.cargoPlaneRoute" placeholder="不限"
:disabled="routeList.length == 0" clearable @change="routeSelectChange"
:key="formData.cargoPlaneRoute">
<el-option v-for="(item, index) in routeList" :label="item" :value="item" :key="item">
<Tooltips :content="item" :refName="item"></Tooltips>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
......@@ -137,11 +155,11 @@
</el-button>
<el-button v-hasPermi="['base:cargo:export']" :type="downLoadingTip.downloading ? 'warning' : 'primary'"
size="small" @click="xlse(0)" :disabled="tableData.length == 0" :loading="downLoadingTip.downloading">{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出本页查询结果"
downLoadingTip.downloading ? downLoadingTip.tip : "导出本页查询结果"
}}</el-button>
<el-button v-hasPermi="['base:cargo:export']" :type="downLoadingTip.downloading ? 'warning' : 'primary'"
size="small" @click="xlse(1)" :disabled="tableData.length == 0" :loading="downLoadingTip.downloading">{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出全部查询结果"
downLoadingTip.downloading ? downLoadingTip.tip : "导出全部查询结果"
}}</el-button>
<el-button type="primary" size="small" :disabled="selectTable.length == 0" v-hasPermi="['base:cargo:release']"
@click="release">释放舱位</el-button>
......@@ -170,7 +188,7 @@
<template v-slot:waybillNo="scope">
<el-link type="primary" @click="logView(scope.row)">
{{
scope.row.waybillNo
scope.row.waybillNo
}}<i class="el-icon-link"></i> </el-link>
</template>
</Tables>
......@@ -192,7 +210,7 @@
</template>
<script>
import { findConditionData, findCargoData, releaseCargo } from "@/api/cargoSelect";
import { findConditionData, findCargoData, releaseCargo, getFlightsRoutes } from "@/api/cargoSelect";
import { downLoadXlsx } from "@/utils/zipdownload";
import Dialog from "./dialog.vue";
......@@ -229,6 +247,7 @@ export default {
cargoPlaneNo: null,
cargoPlaneStart: null,
cargoPlaneEnd: null,
cargoPlaneRoute: null,
limitStart: 1,
limitSize: 100,
}, //表单数据
......@@ -286,8 +305,9 @@ export default {
findConditionData: {}, //货物查询条件
tableData: [], //表格数据
cargoLog: {},
allWeight: 0,
allQty: 0,
routeList: [],
allWeight: 0,//总重量
allQty: 0,//总件数
shiftKey: false,
valueFormat: "yyyy-MM-dd",
tableLoading: false,
......@@ -323,14 +343,54 @@ export default {
activated() {
this.selectTable = []
this.cargoTotal()
//否则请求原页面缓存状态
if (this.$store.state.tagsView.cachedViews.length > 0) {
this.$store.state.tagsView.cachedViews.forEach(item => {
if (item === 'QueryCargo') {
this.findCondition()
this.totalCount > 0 ? this.select() : ''
}
})
if (this.$route.params.fltNo) {
//判断进入页面是否带参,确定是否是index跳转
this.formData = {
fltDateStart: "",
fltDateEnd: "",
prematchFltDateStart: "",
prematchFltDateEnd: "",
createTimeStart: null,
createTimeEnd: null,
pickUpDate: null,
hasFlight: null,
waybillNo: "",
siteName: "",
fltNo: "",
mawbCode: "",
ursa: "",
typeId: null,
statusId: null,
serviceTypeId: null,
allocationTypeId: null,
kindToAllocFlightId: null,
historyAllocaCargoTypeId: null,
dataSources: "",
customsReceiptStatusId: null,
big: null,
cargoPlaneNo: null,
cargoPlaneStart: null,
cargoPlaneEnd: null,
limitStart: 1,
limitSize: 100,
}
this.cargoPlaneTime = [this.$route.params.fltDate, this.$route.params.fltDate]
this.formData.cargoPlaneStart = this.$route.params.fltDate
this.formData.cargoPlaneEnd = this.$route.params.fltDate
this.formData.cargoPlaneNo = this.$route.params.fltNo
this.formData.cargoPlaneRoute = this.$route.params.route
this.planeNoChange(this.formData.cargoPlaneNo)
this.select(0)
} else {
//否则请求原页面缓存状态
if (this.$store.state.tagsView.cachedViews.length > 0) {
this.$store.state.tagsView.cachedViews.forEach(item => {
if (item === 'QueryCargo') {
this.findCondition()
this.totalCount > 0 ? this.select() : ''
}
})
}
}
},
......@@ -352,6 +412,48 @@ export default {
this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 50
},
watch: {
$route: {
handler(to, from) {
if (to.name === 'Index') {
this.formData = {
fltDateStart: "",
fltDateEnd: "",
prematchFltDateStart: "",
prematchFltDateEnd: "",
createTimeStart: null,
createTimeEnd: null,
pickUpDate: null,
hasFlight: null,
waybillNo: "",
siteName: "",
fltNo: "",
mawbCode: "",
ursa: "",
typeId: null,
statusId: null,
serviceTypeId: null,
allocationTypeId: null,
kindToAllocFlightId: null,
historyAllocaCargoTypeId: null,
dataSources: "",
customsReceiptStatusId: null,
big: null,
cargoPlaneNo: null,
cargoPlaneStart: null,
cargoPlaneEnd: null,
limitStart: 1,
limitSize: 100,
}
this.cargoPlaneTime = [from.params.fltDate, from.params.fltDate]
this.formData.cargoPlaneStart = from.params.fltDate
this.formData.cargoPlaneEnd = from.params.fltDate
this.formData.cargoPlaneNo = from.params.fltNo
this.formData.cargoPlaneRoute = from.params.route
this.planeNoChange(this.formData.cargoPlaneNo)
this.select(0)
}
}
},
formShow(val, oldVal) {
this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight - 120
},
......@@ -384,20 +486,22 @@ export default {
}
findCargoData(this.formData)
.then((res) => {
if (res.code == 200) {
this.tableData = res.data.list;
this.totalCount = res.data.totalCount;
if (res.data.list.length > 0) {
for (let i = 0; i < this.tableData.length; i++) {
this.tableData[i].index = i;
setTimeout(() => {
if (res.code == 200) {
this.tableData = res.data.list;
this.totalCount = res.data.totalCount;
if (res.data.list.length > 0) {
for (let i = 0; i < this.tableData.length; i++) {
this.tableData[i].index = i;
}
} else {
this.msgWarning('未查询到数据')
}
} else {
this.msgWarning('未查询到数据')
this.msgWarning(res.msg)
}
} else {
this.msgWarning(res.msg)
}
this.tableLoading = false;
this.tableLoading = false;
})
})
.catch(() => {
this.tableLoading = false;
......@@ -526,6 +630,22 @@ export default {
this.page = val.page;
this.select();
},
//配载航班号获取航线
planeNoChange(val) {
getFlightsRoutes(val.split(';')).then(res => {
if (res.code === 200) {
this.routeList = res.data
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
routeSelectChange(val) {
this.$forceUpdate()
// this.formData.cargoPlaneRoute = val
},
//排序
sortChange(val) {
let data = [];
......
<template>
<div></div>
<div style="padding:10px" v-loading="loading">
<!-- 配舱汇总信息 -->
<el-card class="mb10" ref="card1">
<el-divider content-position="left">今日配舱汇总</el-divider>
<el-row :gutter="10">
<el-col :span="6">
<div class="allInformation">
<div class="informationItem">航班总重量(KG)</div>
<div class="informationNum">{{ totalWeight }}</div>
</div>
</el-col>
<el-col :span="6">
<div class="allInformation">
<div class="informationItem">已配重量(KG)</div>
<div class="informationNum">{{ allocationWeight }}</div>
</div>
</el-col>
<el-col :span="6">
<div class="allInformation">
<div class="informationItem">配舱比例(百分比)</div>
<div class="informationNum">{{ (percentage == 0 ? 0 : ((percentage) * 100).toFixed(2)) + '%' }}</div>
</div>
</el-col>
</el-row>
</el-card>
<!-- 今日航班box -->
<el-card class="mb10" ref="card2">
<el-form ref="indexForm" size="mini" inline @submit.native.prevent>
<el-form-item label="配载航班日期">
<el-date-picker v-model="selectData.fltDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"
:clearable="false" @change="getFlight">
</el-date-picker>
</el-form-item>
<el-form-item label="航班种类">
<el-select v-model="selectData.kindId" placeholder="不限" @change="getFlight" clearable>
<el-option v-for="item in fltKindIdList" :label="item.englishName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" :loading="loading" @click="getFlight"></el-button>
</el-form-item>
</el-form>
<el-row class="card2">
<el-col :span="1" v-for="item in fltBox">
<div class="fltBox" @click="rowClick({ fltNo: item.fltNo, fltDate: item.fltDate, route: '' })"
:style="{ backgroundColor: (item.percentage * 100).toFixed(2) >= 100 ? '#13ce66' : (item.percentage * 100).toFixed(2) >= 75 ? '#ffba00' : '#ff4949' }">
<div class="fltName">{{ item.fltNo }}</div>
<div class="fltWeight">{{ (item.percentage == 0 ? 0 : ((item.percentage) * 100).toFixed(2)) + '%' }}
</div>
</div>
</el-col>
</el-row>
<!-- 各航班配舱进度详情 -->
<el-divider content-position="left">各航班配舱进度</el-divider>
<Tables ref="indexTable" ductName="indexTable" :order="true" :data="tableData" :headerData="tableHeader"
tableAlign="center" :showOverflowTooltip="false" :height="tableHeight" :totalCount="total"
:page="selectData.page" :limitSize="selectData.size" :pageSizes="[100]" :pagination="false"
@currentChange="currentChange" @rowClick="rowClick">
<template v-slot:percentage="scope">
<el-progress stroke-width="100"
:color="(scope.row.percentage * 100).toFixed(2) >= 100 ? '#13ce66' : (scope.row.percentage * 100).toFixed(2) >= 75 ? '#ffba00' : '#ff4949'"
:stroke-width="18"
:percentage="scope.row.percentage == 0 ? 0 : Number((scope.row.percentage * 100).toFixed(2))">
</el-progress>
</template>
</Tables>
</el-card>
</div>
</template>
<script>
import { filghtKindData } from "@/api/flightInfoImport";
import { getOneDayFlight } from '@/api/home.js'
export default {
name: 'Index',
props: {
user: {
type: Object,
},
type: Object
}
},
data() {
return {
selectData: {
fltDate: null,
kindId: null,
page: 1,
size: 1
},//查询条件
fltBox: [],
tableData: [],//table数据
tableHeader: this.tableHeaders['index'],//表头
fltKindIdList: [],//航班类型
percentage: 0,//配舱比例
totalWeight: 0,//航班总重量
allocationWeight: 0,//航班已配重量
type: "",
tableHeight: null,
total: 0,
loading: false,
};
},
created() {
this.selectData.fltDate = this.nowDate();
this.getFltKindId()
},
// activated() {
// this.getFlight()
// },
mounted() {
this.tableHeight = window.innerHeight - this.$refs.card1.$el.offsetHeight - this.$refs.indexForm.$el.offsetHeight - 350
this.getFlight()
},
methods: {
//获取航班类型
async getFltKindId() {
filghtKindData().then(res => {
if (res.code === 200) {
this.fltKindIdList = res.data
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
//获取首页信息(日期查询)
async getFlight() {
this.fltBox = []
this.loading = true
getOneDayFlight(this.selectData).then(res => {
this.loading = false
if (res.code === 200) {
this.getfltBox(JSON.parse(JSON.stringify(res.data.list)))
this.tableData = res.data.list
this.percentage = res.data.percentage
this.totalWeight = res.data.totalWeight
this.allocationWeight = res.data.allocationWeight
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
},
getfltBox(val) {
val.forEach(flt => {
let status = 1
this.fltBox.forEach(item => {
if (item.fltNo == flt.fltNo) {
item.percentage = flt.percentage + item.percentage
status = 2
}
})
if (status == 1) {
this.fltBox.push(flt)
}
})
},
//某行被点击
rowClick(val) {
let obj = {}
obj.fltNo = val.fltNo
obj.fltDate = val.fltDate
if (val.flightKindName == 'Purple Tail') {
obj.route = ''
} else {
obj.route = val.route
}
this.$router.push({ name: 'QueryCargo', params: obj })
},
//翻页
currentChange(val) { },
},
};
</script>
<style lang="scss" scoped>
.cardTop {
height: 400px;
margin: 10px;
padding: 10px;
overflow: auto;
&::-webkit-scrollbar {
height: 5px;
width: 5px;
}
&::-webkit-scrollbar-track {
background-color: #fff;
}
&::-webkit-scrollbar-thumb {
background-color: #ccc;
}
&::-webkit-scrollbar-thumb:hover {
background-color: #409eff;
}
.label {
font-weight: 700;
}
.totalWeight {
font-size: 12px;
}
}
.progressTab {
height: 100%;
}
.allInformation {
width: 100%;
height: 100px;
padding: 10px 20px;
color: #fff;
background-color: #409eff;
.allInformation {
font-size: 12px;
}
.informationNum {
font-size: 24px;
margin-top: 25px;
}
}
.card2 {
.fltBox {
width: 90%;
height: 60px;
font-size: 12px;
font-weight: 700;
color: #fff;
text-align: center;
position: relative;
border-radius: 10px;
padding: 5px;
line-height: 25px;
margin-bottom: 10px;
overflow: hidden;
.fltWeight {
font-size: 14px;
}
}
}
</style>
......
......@@ -4,8 +4,47 @@
append-to-body center>
<el-form ref="add" :model="newDictionary" label-width="auto" label-position="left" size="small"
:rules="rules" @submit.native.prevent>
<!-- 新增虚拟航班 -->
<div v-if="dictName == '虚拟航班'">
<el-form-item label="所属口岸" prop="portName">
<el-select v-model="newDictionary.portName" placeholder="选择口岸" disabled>
<el-option v-for="item in $store.state.user.portNames" :label="item" :value="item"
:key="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="航班名称" v-if="status == 'allAdd'" prop="flightNo">
<el-input type="textarea" v-model="flightNo" :rows="7" maxlength="255" show-word-limit
placeholder="用;分隔,单条航班名长度25">
</el-input>
</el-form-item>
<el-form-item label="航班名称" prop="flightNo" v-else>
<el-input type="text" v-model="flightNo" placeholder="请输入数据名称" maxlength="25"></el-input>
</el-form-item>
</div>
<!-- 新增航线 -->
<div v-else-if="dictName == '航线'">
<div v-if="status == 'add'">
<el-form-item label="航班号" prop="fltNo">
<el-input type="text" v-model="newDictionary.fltNo" placeholder="请输入航班号" maxlength="50">
</el-input>
</el-form-item>
<el-form-item label="航线" prop="route">
<el-input type="text" v-model="newDictionary.route" placeholder="请输入航线" maxlength="40">
</el-input>
</el-form-item>
</div>
<div v-else-if="status == 'sort'">
<el-form-item label="航班号" prop="fltNo">
<el-input type="text" v-model="newDictionary.fltNo" disabled></el-input>
</el-form-item>
<el-form-item label="航线">
<Drag :routes="routeList" @drag="drag"></Drag>
</el-form-item>
</div>
</div>
<!-- 新增数据字典 -->
<div v-if="dictName != '虚拟航班'">
<div v-else>
<el-form-item label="所属父级" v-if="newDictionary.serviceCodeKey">
<el-input type="text" v-model="newDictionary.serviceCodeKey" placeholder="用回车分隔" disabled>
</el-input>
......@@ -32,24 +71,6 @@
</el-form-item>
</div>
</div>
<!-- 新增虚拟航班 -->
<div v-else>
<el-form-item label="所属口岸" prop="portName">
<el-select v-model="newDictionary.portName" placeholder="选择口岸" disabled>
<el-option v-for="item in $store.state.user.portNames" :label="item" :value="item"
:key="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="航班名称" v-if="status == 'allAdd'" prop="flightNo">
<el-input type="textarea" v-model="flightNo" :rows="7" maxlength="255" show-word-limit
placeholder="用;分隔,单条航班名长度25">
</el-input>
</el-form-item>
<el-form-item label="航班名称" prop="flightNo" v-else>
<el-input type="text" v-model="flightNo" placeholder="请输入数据名称" maxlength="25"></el-input>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="loading" @click="submit">确 定</el-button>
......@@ -60,7 +81,7 @@
</template>
<script>
import { addDict, addDictBatch, addServiceCodeBatch, addFlight } from '@/api/system/dictionary.js'
import { addDict, addDictBatch, addServiceCodeBatch, addFlight, addRoute, queryRoute, orderRoute } from '@/api/system/dictionary.js'
export default {
props: {
......@@ -83,7 +104,7 @@ export default {
},
data() {
return {
newDictionary: { flightNo: undefined, chineseName: undefined },
newDictionary: { flightNo: undefined, chineseName: undefined, route: undefined },
rules: {
chineseName: [
{
......@@ -98,8 +119,23 @@ export default {
message: "航班名称不能为空",
trigger: "blur",
},
]
],
fltNo: [
{
required: true,
message: "航班号不能为空",
trigger: "blur",
}
],
route: [
{
required: true,
message: "航线不能为空",
trigger: "blur",
}
],
},
routeList: [],
title: '',
loading: false,
}
......@@ -115,6 +151,18 @@ export default {
} else if (this.status == 'childrenAdd') {
this.newDictionary = this.addDictionary
this.title = '新增子集'
} else if (this.status == 'sort') {
this.newDictionary = this.addDictionary.serviceCodeKey
this.title = '航线排序'
queryRoute({ fltNo: this.newDictionary.fltNo }).then(res => {
if (res.code === 200) {
this.routeList = res.data.list
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
}
// else if (this.status == 'update') {
// if (this.addDictionary.serviceCodeValue) {
......@@ -145,6 +193,23 @@ export default {
if (this.status == 'add') {
if (this.dictName === '虚拟航班') {
this.flightAdd()
} else if (this.dictName === '航线') {
let obj = {
fltNo: this.upCase(this.newDictionary.fltNo),
route: this.upCase(this.newDictionary.route)
}
addRoute(obj).then(res => {
this.loading = false
if (res.code === 200) {
this.msgSuccess(res.msg)
this.close()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
} else {
addDict(this.newDictionary).then(res => {
this.loading = false
......@@ -210,6 +275,25 @@ export default {
console.log(err)
})
}
//航线排序
else if (this.status == 'sort') {
let arr = []
this.routeList.forEach(item => {
arr.push(item.id)
})
orderRoute(arr).then(res => {
this.loading = false
if (res.code === 200) {
this.msgSuccess(res.msg)
this.close()
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
}
}
})
},
......@@ -230,9 +314,14 @@ export default {
console.log(err)
})
},
//航线排序
drag(val) {
this.routeList = val
},
//关闭
close() {
this.newDictionary = { chineseName: null, code: null, remark: null }
this.routeList = []
this.clearValidate('add')
this.$emit('close', false)
},
......@@ -263,6 +352,25 @@ export default {
this.newDictionary.flightNo = val
}
},
},
fltNo: {
get: function () {
return this.newDictionary.fltNo
},
set: function (val) {
this.newDictionary.fltNo = this.upCase(val)
},
},
route: {
get: function () {
return this.newDictionary.route
},
set: function (val) {
const reg = /^([0-9a-zA-Z!@#$%^&*()`]{0,100})$/
if (reg.test(val)) {
this.newDictionary.route = val
}
},
}
}
}
......
......@@ -3,8 +3,9 @@
<el-card style="margin-bottom:10px">
<!-- cardHeader -->
<div slot="header" class="clearfix">
<span style="font-size:16px;font-weight:700">{{ (tableName == 'Site' ? '站点' : tableName ==
'虚拟航班' ? '虚拟航班' : tableName.replace(/( |^)[a-z]/g, L => L.toUpperCase())) + "表"
<span style="font-size:16px;font-weight:700">{{ (tableName == '航线' ? '航线' : tableName == 'Site' ? '站点' :
tableName ==
'虚拟航班' ? '虚拟航班' : tableName.replace(/( |^)[a-z]/g, L => L.toUpperCase())) + "表"
}}</span>
<div style="float: right; padding: 3px 0">
<span class="selectLabel mr10">切换字典表</span>
......@@ -13,6 +14,7 @@
:key="item.id">
</el-option>
<el-option label="虚拟航班" value="虚拟航班"></el-option>
<el-option label="航线" value="航线"></el-option>
</el-select>
</div>
</div>
......@@ -21,7 +23,7 @@
@submit.native.prevent>
<el-row :gutter="10" v-if="tableName != 'serviceCode'">
<el-col :span="6">
<el-form-item label="航班名称" v-if="tableName === '虚拟航班'">
<el-form-item label="航班名称" v-if="tableName === '虚拟航班' || tableName === '航线'">
<el-input v-model="selectDict.flightNo" size="small" style="width:80%"
placeholder="请输入航班名称"></el-input>
</el-form-item>
......@@ -38,8 +40,8 @@
v-hasPermi="['system:dictionary:add']">
{{ tableName === 'serviceCode' ? '新增父级' : '新增' }}
</el-button>
<el-button type="primary" icon="el-icon-plus" size="small" @click="addDic({ status: 'allAdd' })"
v-hasPermi="['system:dictionary:add']">
<el-button v-if="tableName != '航线'" type="primary" icon="el-icon-plus" size="small"
@click="addDic({ status: 'allAdd' })" v-hasPermi="['system:dictionary:add']">
{{ tableName === 'serviceCode' ? '批量新增父级' : '批量新增' }}
</el-button>
<el-button type="danger" icon="el-icon-delete" size="small" :disabled="nowSelect.length == 0"
......@@ -48,10 +50,10 @@
</div>
</el-form>
<!-- 表格 -->
<Tables v-if="tableName != 'serviceCode' && tableName != '虚拟航班'" ductName="dictionary" :selection="true"
:selectFixed="false" :order='true' :height="tableHeight" :data="tableData" :headerData="tableHeader"
:page="selectDict.page" :pageSizes="[20]" :totalCount="total" :loading="loading"
@currentChange="currentChange" layout="total,prev, pager, next, jumper, ->"
<Tables v-if="tableName != 'serviceCode' && tableName != '虚拟航班' && tableName != '航线'" ductName="dictionary"
:selection="true" :selectFixed="false" :order='true' :height="tableHeight" :data="tableData"
:headerData="tableHeader" :page="selectDict.page" :pageSizes="[20]" :totalCount="total"
:loading="loading" @currentChange="currentChange" layout="total,prev, pager, next, jumper, ->"
@tableSelect="tableSelection" @tableSelectAll="tableSelectAll">
<template slot="optionColumn">
<el-table-column label="操作" align="center">
......@@ -85,6 +87,28 @@
</el-table-column>
</template>
</Tables>
<!-- 航线表 -->
<Tables v-else-if="tableName === '航线'" ductName="dictionary" :selection="true" :selectFixed="false"
:order='true' :height="tableHeight" :data="tableData" :headerData="routeTable" :page="selectDict.page"
:pageSizes="[20]" :totalCount="total" :loading="loading" @currentChange="currentChange"
layout="total,prev, pager, next, jumper, ->" @tableSelect="tableSelection"
@tableSelectAll="tableSelectAll">
<template v-slot:fltNo="scope">
<el-link type="primary" @click="addDic({ data: scope.row, status: 'sort' })">
{{
scope.row.fltNo
}}<i class="el-icon-link"></i> </el-link>
</template>
<template slot="optionColumn">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" style="color:#ff4949" icon="el-icon-delete"
@click="delDict(scope.row)" v-hasPermi="['system:dictionary:delete']">删除
</el-button>
</template>
</el-table-column>
</template>
</Tables>
<!-- serviceCode表格(树形结构) -->
<Tables v-show="tableName === 'serviceCode'" ductName="dictionary" :order='false' :height="tableHeight"
:data="tableData" :headerData="serviceCodeHeader" :pageSize="selectDict.page" :pageSizes="[20]"
......@@ -142,7 +166,7 @@
<script>
import Dialog from './dialog.vue'
import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight } from '@/api/system/dictionary.js'
import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight, queryRoute, delRoute, checkFlightRoute } from '@/api/system/dictionary.js'
export default {
name: 'DictionaryConfig',
......@@ -159,6 +183,9 @@ export default {
},//字典查询条件
tableData: [],
tableHeader: this.tableHeaders['dict'],//表头
serviceCodeHeader: this.tableHeaders['dictServiceCode'],//serviceCode主表头
childrenTableHeader: this.tableHeaders['dictServiceCodeChildren'],//serviceCode子表头
routeTable: this.tableHeaders['fltRoute'],//航线表头
flightHeader: [
{
columnChineseName: "航班号",
......@@ -168,8 +195,6 @@ export default {
status: 1
}
],//虚拟航班表头
serviceCodeHeader: this.tableHeaders['dictServiceCode'],//serviceCode主表头
childrenTableHeader: this.tableHeaders['dictServiceCodeChildren'],//serviceCode子表头
dictNameList: [],//主表数据
addDictionary: {},//选择数据
nowSelect: [],
......@@ -248,6 +273,22 @@ export default {
}).catch(err => {
console.log(err)
})
} else if (this.tableName === '航线') {
let obj = {
fltNo: this.selectDict.flightNo,
page: this.selectDict.page,
size: this.selectDict.size
}
queryRoute(obj).then(res => {
if (res.code === 200) {
this.tableData = res.data.list
this.total = res.data.total
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
} else {
getDictionaryList(this.selectDict).then(res => {
if (res.code === 200) {
......@@ -284,6 +325,8 @@ export default {
this.serviceCodeCihildDel([val.id])
} else if (this.tableName === '虚拟航班') {
this.flightDel([val.id])
} else if (this.tableName === '航线') {
this.routeDel({ data: [val], id: [val.id] })
} else {
this.dicDel([val.id])
}
......@@ -298,6 +341,8 @@ export default {
this.serviceCodeCihildDel(arr)
} else if (this.tableName === '虚拟航班') {
this.flightDel(arr)
} else if (this.tableName === '航线') {
this.routeDel({ data: this.nowSelect, id: arr })
} else {
this.dicDel(arr)
}
......@@ -354,7 +399,7 @@ export default {
if (res.code === 200) {
this.msgSuccess(res.msg)
} else {
this.msgSuccess(res.msg)
this.msgWarning(res.msg)
}
this.tableSelect(1)
}).catch(err => {
......@@ -362,6 +407,59 @@ export default {
})
}).catch(() => { })
},
//航线删除
routeDel(val) {
this.$confirm("是否要删除记录?", "注意!", {
closeOnClickModal: false,
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let arr = []
val.data.forEach(item => {
arr.push({
fltNo: item.fltNo,
route: item.route
})
})
checkFlightRoute(arr).then(res => {
if (res.code === 202) {
this.$confirm(res.msg, "注意!", {
closeOnClickModal: false,
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
delRoute(val.id).then(res => {
if (res.code === 200) {
this.msgSuccess(res.msg)
} else {
this.msgWarning(res.msg)
}
this.tableSelect(1)
}).catch(err => {
console.log(err)
})
}).catch()
} else if (res.code === 200) {
delRoute(val.id).then(res => {
if (res.code === 200) {
this.msgSuccess(res.msg)
} else {
this.msgWarning(res.msg)
}
this.tableSelect(1)
}).catch(err => {
console.log(err)
})
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
}).catch(() => { })
},
//切换字典表
selectChange(val) {
this.tableName = val
......
......@@ -64,14 +64,14 @@
<template v-slot:awbNbr="scope">
<el-link type="primary" @click="gotoWeatherTable(scope.row)">
{{
scope.row.awbNbr
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: { handle: 'DMdetail', id: scope.row.allocDimId } })">
@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.flightFltNo
scope.row.flightFltNo
}}<i class="el-icon-link"></i> </el-link>
<span v-else>{{ scope.row.flightFltNo }}</span>
</template>
......@@ -153,7 +153,7 @@ export default {
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 } })
this.$router.push({ name: 'weatherTable', params: { data: res.data.list, awbNbr: val.awbNbr } })
} else {
this.msgWarning('未查询到该条数据的流水')
}
......
<template>
<div style="padding:10px">
<el-button class="ml20 mb20" size="small" icon="el-icon-back" @click="close">返 回</el-button>
<el-card header="流水信息">
<Tables ref="weatherTable" ductName="weatherTable" :order="true" :data="data" :headerData="tableHeader"
:showOverflowTooltip="false" :height="tableHeight" :page="selectData.page" :limitSize="selectData.size"
:pageSizes="[100]" :pagination="false" :loading="loading" @currentChange="currentChange">
<Tables ref="weatherTable" ductName="weatherTable" :order="true" :border="false" :data="data"
:headerData="tableHeader" :showOverflowTooltip="false" :height="tableHeight" :page="selectData.page"
:limitSize="selectData.size" :pageSizes="[100]" :pagination="false" :loading="loading"
@currentChange="currentChange">
</Tables>
<div class="ml20 mt20">
<el-button size="small" @click="close">返 回</el-button>
</div>
</el-card>
</div>
</template>
......@@ -70,7 +69,6 @@ export default {
(item) => item.path === this.$route.path
),
);
sessionStorage.removeItem('accsid')
this.$router.push({ name: 'DmLog' })
},
//翻页
......@@ -80,4 +78,5 @@ export default {
</script>
<style>
</style>
\ No newline at end of file
......