jinhui.wang

Merge branch 'master' into dev

import service from "../utils/request";
import request from '@/utils/request'
export function downLoadTemplate(template) {
......
import service from "../utils/request";
import request from '@/utils/request'
// 查询航班种类
......
let ductLabels = {
let ductLabels = {
"cargoRulesStatus":{
"1":"手动",
"2":"自动"
......
......@@ -85,6 +85,7 @@
.formItem {
width: 100%;
max-width: 310px;
// max-width: 310px;
}
}
......
......@@ -207,7 +207,6 @@ export default {
this.pageNum = this.page;
}
},
mounted() {},
methods: {
nextClick() {
this.$emit("currentChange", {
......@@ -226,7 +225,7 @@ export default {
currentChange(val) {
this.$emit("currentChange", {
page: val,
start: val > 1 ? (val-1) * this.limitSize + 1 : val,
start: val > 1 ? (val-1) * this.limitSize + 1 : val,
});
scrollTo(0, 800);
},
......@@ -245,15 +244,15 @@ export default {
} else if (selection.includes(this.data[row.index])) {
if (!selection.includes(this.data[this.start])) {
this.$refs.tables.toggleRowSelection(this.data[this.start], true);
if(this.selectTable.includes(this.data[this.start])){
if (this.selectTable.includes(this.data[this.start])) {
this.selectTable.push(this.data[this.start]);
}
}
for (i = min; i <= sum + min; i++) {
this.$refs.tables.toggleRowSelection(this.data[i], true);
if(!this.selectTable.includes(this.data[i])){
if (!this.selectTable.includes(this.data[i])) {
this.selectTable.push(this.data[i]);
}
}
}
} else if (!selection.includes(this.data[row.index])) {
this.selectTable.splice(min > 1 ? min - 2 : min, sum + 1);
......@@ -274,7 +273,7 @@ export default {
}
}
}
selection = this.selectTable.sort(this.compare('index','ascending'));
selection = this.selectTable.sort(this.compare("index", "ascending"));
this.$emit("tableSelect", { selection, row });
},
tableSelectAll(selection) {
......
......@@ -22,11 +22,12 @@
trigger="click"
>
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar" />
<img :src="avatar" class="user-avatar">
</div>
<el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item @click.native.stop="drawer = true">个人中心</el-dropdown-item> -->
<el-dropdown-item @click.native="logout">
<router-link to="/user/profile">
</router-link>
<el-dropdown-item @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
......
import router from './router'
import store from './store'
import { Message } from 'element-ui'
//import NProgress from 'nprogress'
//import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
import { getToken,setToken } from '@/utils/auth'
//NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
router.beforeEach((to, from, next) => {
//NProgress.start()
if (getToken()) {
/* has token*/
if (to.path === '/login') {
next({ path: '/' })
//NProgress.done()
} else {
if (store.getters.roles.length === 0) {
// 判断当前用户是否已拉取完user_info信息
......@@ -26,9 +21,10 @@ router.beforeEach((to, from, next) => {
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
})
}).catch(err => {
Message.error(err)
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
// next({ path: '/' })
window.location.href = "https://testsso.ute.apac.fedex.com/logout";//wsso系统跳转
})
})
} else {
......@@ -37,16 +33,22 @@ router.beforeEach((to, from, next) => {
}
} else {
// 没有token
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next()
} else {
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
//NProgress.done()
//wsso登录时对后端重定向带来的token进行记录
let token = location.search.split("token=")[1]
if(token != undefined && token != '' && token != null){
setToken(token)
next({ path: '/' })
}else{
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next()
} else {
window.location.href = "https://testsso.ute.apac.fedex.com/logout";//wsso系统跳转
}
}
}
})
router.afterEach(() => {
//NProgress.done()
})
......
......@@ -42,5 +42,5 @@ module.exports = {
/**
* 版本号
*/
version:'version:1.0.0'
version:'version:1.0.5'
}
......
......@@ -5,178 +5,178 @@
const baseURL = process.env.VUE_APP_BASE_API
// 日期格式化
export function parseTime(time, pattern) {
//debugger
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
var search = params;
search.params = {};
if (null != dateRange && '' != dateRange) {
if (typeof (propName) === "undefined") {
search.params["beginTime"] = dateRange[0];
search.params["endTime"] = dateRange[1];
} else {
search.params["begin" + propName] = dateRange[0];
search.params["end" + propName] = dateRange[1];
}
}
return search;
}
// 回显数据字典
export function selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel);
return true;
}
})
return actions.join('');
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator);
}
})
})
return actions.join('').substring(0, actions.join('').length - 1);
}
// 通用下载方法
export function download(fileName) {
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
}
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
if (typeof arg === 'undefined') {
flag = false;
return '';
}
return arg;
});
return flag ? str : '';
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
}
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
*/
export function handleTree(data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
childrenList: children || 'children'
};
var childrenListMap = {};
var nodeIds = {};
var tree = [];
for (let d of data) {
let parentId = d[config.parentId];
if (childrenListMap[parentId] == null) {
childrenListMap[parentId] = [];
}
nodeIds[d[config.id]] = d;
childrenListMap[parentId].push(d);
}
for (let d of data) {
let parentId = d[config.parentId];
if (nodeIds[parentId] == null) {
tree.push(d);
}
}
for (let t of tree) {
adaptToChildrenList(t);
}
function adaptToChildrenList(o) {
if (childrenListMap[o[config.id]] !== null) {
o[config.childrenList] = childrenListMap[o[config.id]];
}
if (o[config.childrenList]) {
for (let c of o[config.childrenList]) {
adaptToChildrenList(c);
}
}
}
return tree;
}
//字符串英文转大写,;转英文;
export function upCase(str){
let newStr = str.replace(/;/g,";").toUpperCase();
return newStr;
}
\ No newline at end of file
// 日期格式化
export function parseTime(time, pattern) {
debugger
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
var search = params;
search.params = {};
if (null != dateRange && '' != dateRange) {
if (typeof (propName) === "undefined") {
search.params["beginTime"] = dateRange[0];
search.params["endTime"] = dateRange[1];
} else {
search.params["begin" + propName] = dateRange[0];
search.params["end" + propName] = dateRange[1];
}
}
return search;
}
// 回显数据字典
export function selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel);
return true;
}
})
return actions.join('');
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator);
}
})
})
return actions.join('').substring(0, actions.join('').length - 1);
}
// 通用下载方法
export function download(fileName) {
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
}
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
if (typeof arg === 'undefined') {
flag = false;
return '';
}
return arg;
});
return flag ? str : '';
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
}
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
*/
export function handleTree(data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
childrenList: children || 'children'
};
var childrenListMap = {};
var nodeIds = {};
var tree = [];
for (let d of data) {
let parentId = d[config.parentId];
if (childrenListMap[parentId] == null) {
childrenListMap[parentId] = [];
}
nodeIds[d[config.id]] = d;
childrenListMap[parentId].push(d);
}
for (let d of data) {
let parentId = d[config.parentId];
if (nodeIds[parentId] == null) {
tree.push(d);
}
}
for (let t of tree) {
adaptToChildrenList(t);
}
function adaptToChildrenList(o) {
if (childrenListMap[o[config.id]] !== null) {
o[config.childrenList] = childrenListMap[o[config.id]];
}
if (o[config.childrenList]) {
for (let c of o[config.childrenList]) {
adaptToChildrenList(c);
}
}
}
return tree;
}
//字符串英文转大写,;转英文;
export function upCase(str){
let newStr = str.replace(/;/g,";").toUpperCase().trim();
return newStr;
}
......
import axios from 'axios'
import { Message, MessageBox } from 'element-ui'
import { Message,MessageBox } from 'element-ui'
import store from '@/store'
import { getToken, setToken } from '@/utils/auth'
import { getToken,setToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
......@@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
if(res.headers['token']){
setToken(decodeURI(res.headers['token']))
setToken(decodeURIComponent(res.headers['token']))
}
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
......@@ -81,7 +81,7 @@ service.interceptors.response.use(res => {
type: 'error'
})
return Promise.reject(new Error(msg))
} else if (code !== 200 && code !== 201 && code !== 202) {
} else if (code !== 200 && code !== 201 && code !== 202 && code !== 603) {
Message({
message: msg,
type: 'error'
......
......@@ -19,6 +19,7 @@
end-placeholder="结束日期"
v-model="fltDate"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
......@@ -79,6 +80,7 @@
placeholder="请输入运单号(回车分割)"
:autosize="true"
v-model="formData.waybillNo"
clearable
></el-input>
</el-form-item>
</el-col>
......@@ -126,6 +128,7 @@
placeholder="S_;P_;E2"
v-model="ursa"
:autosize="true"
clearable
></el-input>
</el-form-item>
</el-col>
......@@ -137,6 +140,7 @@
placeholder="PVG;PEK"
v-model="siteName"
:autosize="true"
clearable
></el-input>
</el-form-item>
</el-col>
......@@ -192,24 +196,6 @@
</el-row>
</el-form-item>
</el-col>
<!-- <el-col :span="6">
<el-form-item label="航班类型">
<el-select
placeholder="不限"
v-model="formData.kindToAllocFlightId"
class="formItem"
clearable
>
<el-option
v-for="item in selectData.fltTypes"
:label="item.chineseName"
v-model="item.id"
:key="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="6">
<el-form-item label="取件日期">
<el-date-picker
......@@ -217,6 +203,7 @@
type="date"
placeholder="选择日期"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
......@@ -338,7 +325,6 @@
import Dialog from "./info.vue";
import { findConditionData, findCargoAllocationData } from "@/api/cargoSelect";
import { allDictData } from "@/api/destinationFlight";
// import { findFltConditionDataApi } from "@/api/findAllFltData";
import { downLoadXlsx } from "@/utils/zipdownload";
import { upCase } from "@/utils/FedEx";
......@@ -379,6 +365,7 @@ export default {
align: "center",
sorTable: false,
fixed: true,
disabled:true
},
{
type: "index",
......@@ -388,96 +375,107 @@ export default {
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
name: "口岸代码",
value: "portName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "取件日期",
value: "pickUpDate",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "取件扫描号",
value: "pickUpScanNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "站点",
value: "siteName",
width: "150",
width: "80",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "运单号",
value: "waybillNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "总单号",
value: "totalWaybillNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "服务类型",
value: "serviceTypeName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "服务代码",
value: "serviceCode",
width: "150",
width: "100",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "URSA",
value: "ursa",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "申报类型",
value: "typeName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -487,33 +485,37 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "subcategory",
value: "subCategory",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "件数",
value: "qty",
width: "150",
width: "80",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "实际重量",
value: "actualWeight",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -523,78 +525,87 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "品名描述",
value: "nameDescription",
width: "150",
width: "100",
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
name: "海关回执状态",
value: "customsReceiptStatusName",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "预审状态",
value: "preQualificationStatus",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "航班预审意见",
value: "caPretrialOpinion",
width: "150",
width: "120",
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
name: "货物状态",
value: "statusName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "终配航班号",
value: "finalFlightNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "终配航班日期",
value: "finalFlightTime",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "二配航班号",
value: "twoMatchFlightNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -604,15 +615,17 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "预配航班号",
value: "preplanFlightNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -622,6 +635,7 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -631,6 +645,7 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -640,15 +655,17 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "ACCS原航线",
value: "accsFlightRoute",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -658,24 +675,27 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "是否自动",
value: "cargoRulesStatus",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "发件人账号",
value: "shipperAccount",
width: "150",
width: "120",
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -685,51 +705,57 @@ export default {
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
name: "始发地城市名称",
value: "originCity",
width: "150",
width: "130",
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
name: "收件地",
value: "destinationSiteName",
width: "150",
width: "90",
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
name: "尺寸",
value: "sizeStr",
width: "150",
width: "80",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "大货预审意见(是否可以配置航班)",
value: "bigPretrialOpinion",
width: "300",
width: "250",
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
name: "大货预审时间",
value: "bigPretrialTime",
width: "150",
width: "120",
align: "center",
sorTable: false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -739,6 +765,7 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
......@@ -748,24 +775,27 @@ export default {
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "创建人",
value: "createUserName",
width: "150",
width: "90",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
{
type: "",
name: "创建时间",
value: "createTime",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed: false,
disabled:true
},
], //表头数据
tableData: [], //表格数据
......@@ -801,10 +831,6 @@ export default {
this.seleData();
this.select();
},
// activated(){
// this.seleData();
// this.select();
// },
mounted() {
window.addEventListener("keydown", (code) => {
if (code.keyCode === 16 && code.shiftKey) {
......@@ -820,19 +846,6 @@ export default {
methods: {
//查询条件
async seleData() {
// findFltConditionDataApi()
// .then((res) => {
// if (res.code === 200) {
// this.selectData.fltTypes = res.data.flightType;
// }else{
// this.$message({
// message: "查询条件不存在",
// type: "warning",
// });
// }
// })
// .catch(() => {});
allDictData()
.then((res) => {
if (res.code === 200) {
......@@ -1012,9 +1025,9 @@ export default {
}
});
data = data.sort(this.$refs.newTables.compare(val.prop, val.order));
if (val.order == "descending") {
if (val.order != "ascending") {
this.tableData = nullData.concat(data);
} else{
} else {
this.tableData = data.concat(nullData);
}
this.tableData.forEach((item, index = 0) => {
......
......@@ -119,7 +119,7 @@ export default {
},
],
},
loading:false,
loading:false
};
},
methods: {
......@@ -133,7 +133,7 @@ export default {
},
//确定配舱
submit() {
this.loading= true;
this.loading = true;
let arr = [];
this.tableData.forEach((item) => {
arr.push(item.id);
......
......@@ -13,10 +13,11 @@
v-model.trim="purposeOfFlightNo"
placeholder="航班号"
@keyup.enter.native="getList"
clearable
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="queryParams.status" placeholder="状态">
<el-select v-model="queryParams.status" placeholder="状态" clearable>
<el-option label="有效" value="1"></el-option>
<el-option label="停用" value="3"></el-option>
</el-select>
......@@ -36,12 +37,25 @@
type="primary"
icon="el-icon-plus"
size="mini"
@click="$router.push({ name: 'FlightAllocConfigAdd', params: { handle: 'add' } })"
@click="
$router.push({
name: 'FlightAllocConfigAdd',
params: { handle: 'add' },
})
"
>添加</el-button
>
</div>
</el-form>
<el-table :data="flyList" v-loading="loading" size="small" highlight-current-row border stripe>
<el-table
:data="flyList"
v-loading="loading"
size="small"
highlight-current-row
border
stripe
>
<el-table-column
prop="purposeOfFlightNo"
label="航班号"
......@@ -128,15 +142,13 @@ import {
enableOrDisable,
} from "@/api/destinationFlight";
import { parseTime } from "@/utils/FedEx";
export default {
name:"FlightAllocConfig",
name: "FlightAllocConfig",
data() {
return {
queryParams: {
purposeOfFlightNo: "",
status:"1",
status: "1",
start: 0,
limit: 10,
},
......@@ -194,18 +206,17 @@ export default {
cancelButtonText: "取消",
showCancelButton: true,
type: "warning",
})
.then(()=> {
delFlightId(id)
}).then(() => {
delFlightId(id)
.then((res) => {
this.$message({
message: res.msg,
type: res.code === 200 ? "success" : "warning",
});
this.getList()
this.getList();
})
.catch(() => {});
})
});
}
},
//启用,停用
......@@ -215,9 +226,9 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(()=> {
enableOrDisable(id, status).then((res) => {
}).then(() => {
enableOrDisable(id, status)
.then((res) => {
if (res.code != 200) {
this.msgError(res.msg);
} else {
......@@ -225,23 +236,23 @@ export default {
this.msgSuccess(tip + "成功");
}
})
.catch(()=> {});
})
.catch(() => {});
});
},
},
created() {
this.getList();
},
computed:{
computed: {
purposeOfFlightNo: {
get: function () {
return this.queryParams.purposeOfFlightNo;
},
set: function (val) {
this.queryParams.purposeOfFlightNo = val.toUpperCase()
this.queryParams.purposeOfFlightNo = val.toUpperCase();
},
},
}
},
};
</script>
......
......@@ -503,10 +503,28 @@ export default {
created() {
let handle = this.$route.params.handle;
allDictData().then((response) => {
if (response.code != 200) {
this.$message({
showClose: true,
message: response.msg,
type: "error",
});
return;
}
let dict = response.data;
this.cargoType = dict.cargoType;
this.cargoStatus = dict.cargoStatus;
this.serviceCode = dict.serviceCode.sort((a, b) =>
a.englishName.localeCompare(b.englishName)
);
this.handlingCode = this.sorttodo(dict.handlingCode, "BLANK");
this.subCategory = dict.subCategory;
});
this.routeName = this.$route.name;
this.dataId = this.$route.params.id;
this.handleName = this.$route.params.handle;
this.dictData()
if (handle === "detail") {
this.disable = true;
}
......
<template>
<div>
<el-form class="form-header" :model="queryParams" ref="queryForm" size="medium" :inline="true" label-position="right" label-width="auto">
<el-form-item label="原航班">
<el-input type="text" v-model="upCase" placeholder="请输入原航班" clearable></el-input>
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="ACCS原航班">
<el-input
type="text"
v-model="upCase"
placeholder="请输入ACCS原航班"
clearable
class="formItem"
></el-input>
<!-- <el-input v-model="upCase" placeholder="请输入原航班" clearable size="small" /> -->
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
<el-option v-for="dict in statusList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-select
v-model="queryParams.status"
placeholder="请选择"
clearable
size="small"
>
<el-option
v-for="dict in statusList"
:key="dict.id"
:label="dict.name"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询原航班配置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>查询ACCS原航班配置</el-button
>
</el-form-item>
<br />
<el-form-item label="日期" prop="flightDate">
<el-date-picker value-format="yyyy-MM-dd" v-model="queryParams.flightDate" type="date" placeholder="选择日期">
<el-date-picker
value-format="yyyy-MM-dd"
v-model="queryParams.flightDate"
type="date"
placeholder="选择日期"
clearable
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="findSourceFlightAndFlightDate">查询实际配载航班
</el-button>&#12288;
<span style="color: #ff4949;">注:原航班+日期查询该日期的航班实际情况</span>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="findSourceFlightAndFlightDate"
>查询实际配载航班 </el-button
>&#12288;
<span style="color: #ff4949"
>注:ACCS原航班+日期查询该日期的航班实际情况</span
>
</el-form-item>
<br />
<el-form-item>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加规则</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>添加规则</el-button
>
</el-col>
&#12288;
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table v-loading="loading" height="550" :data="sourceFlightRulesList" highlight-current-row border stripe>
<el-table
v-loading="loading"
height="550"
size="small"
:data="sourceFlightRulesList"
highlight-current-row
border
stripe
>
<el-table-column type="index" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="原航班" align="center" prop="sourceFlightNo" />
<el-table-column label="配载航班排序" align="center" prop="flightRank" width="280" />
<el-table-column
label="ACCS原航班"
align="center"
prop="sourceFlightNo"
/>
<el-table-column
label="配载航班排序"
align="center"
prop="flightRank"
width="280"
/>
<!-- <el-table-column label="优先级" align="center" prop="priority" /> -->
<el-table-column label="周期" align="center" prop="dayOfWeek" width="180" />
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="开始时间" align="center" prop="startDate" width="100" />
<el-table-column label="结束时间" align="center" prop="endDate" width="100" />
<el-table-column label="最后修改人" align="center" prop="updateUserName" width="100" />
<el-table-column label="最后修改时间" align="center" prop="updateTime" width="100" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
<el-table-column
label="周期"
align="center"
prop="dayOfWeek"
width="180"
/>
<el-table-column
label="状态"
align="center"
prop="status"
:formatter="statusFormat"
/>
<el-table-column
label="开始时间"
align="center"
prop="startDate"
width="100"
/>
<el-table-column
label="结束时间"
align="center"
prop="endDate"
width="100"
/>
<el-table-column
label="最后修改人"
align="center"
prop="updateUserName"
width="100"
/>
<el-table-column
label="最后修改时间"
align="center"
prop="updateTime"
width="100"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteorPlayorpause(scope.row,0,'删除')">
删除</el-button>
<el-button size="mini" type="text" icon="el-icon-video-play" v-if="scope.row.status == '3'"
@click="handleDeleteorPlayorpause(scope.row,1,'启用')">启用</el-button>
<el-button size="mini" type="text" icon="el-icon-video-pause" v-if="scope.row.status != '3'"
@click="handleDeleteorPlayorpause(scope.row,3,'停用')">停用</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDeleteorPlayorpause(scope.row, 0, '删除')"
>
删除</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-video-play"
v-if="scope.row.status == '3'"
@click="handleDeleteorPlayorpause(scope.row, 1, '启用')"
>启用</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-video-pause"
v-if="scope.row.status != '3'"
@click="handleDeleteorPlayorpause(scope.row, 3, '停用')"
>停用</el-button
>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" layout=" prev, pager, next, jumper, sizes,total"
:page.sync="queryParams.pageNum" :limit.sync="queryParams.limit" @pagination="findSourceFlightRules" />
<pagination
v-show="total > 0"
:total="total"
layout=" prev, pager, next, jumper, sizes,total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.limit"
@pagination="findSourceFlightRules"
/>
<!-- 查看目的航班对话框 -->
<el-dialog title="实际配载航班" :visible.sync="openFlightDate" width="70%" :close-on-click-modal="false" :append-to-body="true">
<el-dialog
title="实际配载航班"
:visible.sync="openFlightDate"
width="70%"
:close-on-click-modal="false"
:append-to-body="true"
>
<el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate">
<el-table-column type="index" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="原航班" align="center" prop="sourceFlightNo"/>
<el-table-column label="实际配载航班" align="center" prop="actualFlight" width="280" />
<el-table-column
label="ACCS原航班"
align="center"
prop="sourceFlightNo"
/>
<el-table-column
label="实际配载航班"
align="center"
prop="actualFlight"
width="280"
/>
<el-table-column label="航班日期" align="center" prop="flightDate" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200"
>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
@click="handleClick(scope.row.actualFlight, 'detail')">查看配置维度</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleClick(scope.row.actualFlight, 'detail')"
>查看配置维度</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -87,50 +236,85 @@
</div>
</el-dialog>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="55%" :append-to-body="true" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto">
<el-dialog
:title="title"
:visible.sync="open"
width="55%"
:append-to-body="true"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="10">
<el-form-item label="原航班" prop="sourceFlightNo">
<el-input v-model="form.sourceFlightNo" placeholder="请输入原航班号" maxlength="10"/>
<el-form-item label="ACCS原航班" prop="sourceFlightNo">
<el-input
v-model="form.sourceFlightNo"
placeholder="请输入ACCS原航班号"
maxlength="10"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="有效开始时间" prop="startDate">
<el-date-picker clearable size="small" :picker-options="pickerOptionsStart" v-model="form.startDate"
type="date" value-format="yyyy-MM-dd" placeholder="选择开始时间">
<el-date-picker
clearable
size="small"
:picker-options="pickerOptionsStart"
v-model="form.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开始时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效结束时间" prop="endDate">
<el-date-picker clearable size="small" :picker-options="pickerOptionsEnd" v-model="form.endDate"
type="date" value-format="yyyy-MM-dd" placeholder="选择结束时间">
<el-date-picker
clearable
size="small"
:picker-options="pickerOptionsEnd"
v-model="form.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-bottom: 5%;">
<span style="color: #ff4949;margin-left: 10%;">提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span><br />
<span style="color: #ff4949;margin-left: 10%;">提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span>
<el-col :span="24" style="margin-bottom: 5%">
<span style="color:#ff4949; margin-left: 10%"
>提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span
><br />
<span style="color:#ff4949; margin-left: 10%"
>提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span
>
</el-col>
<el-col :span="24">
<el-form-item label="配载航班" prop="flightRank">
<el-input type="textarea" v-model="form.flightRank" :rows="4"></el-input>
<el-input
type="textarea"
v-model="form.flightRank"
:rows="4"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="周期段">
<el-checkbox-group v-model="dayOfWeek">
<el-checkbox v-for="item in dayOfWeekList" :key="item" :label="item" :name="item"></el-checkbox>
<el-checkbox
v-for="item in dayOfWeekList"
:key="item"
:label="item"
:name="item"
></el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -141,298 +325,301 @@
</div>
</template>
<script>
import {
findSourceFlightRulesApi,
sourceFlightRulesSaveApi,
delOrEnableORDisableApi,
findSourceFlightAndFlightDateApi
} from "@/api/sourceFlightRules";
export default {
name: "FlightRandConfig",
data() {
return {
// data 中设定
pickerOptionsStart: {
disabledDate: time => {
let endDateVal = this.form.endDate;
if (endDateVal) {
return time.getTime() > new Date(endDateVal).getTime() || time.getTime() < new Date().getTime() - 24 *
60 * 60 * 1000;
} else {
return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
}
import {
findSourceFlightRulesApi,
sourceFlightRulesSaveApi,
delOrEnableORDisableApi,
findSourceFlightAndFlightDateApi,
} from "@/api/sourceFlightRules";
export default {
name: "FlightRandConfig",
data() {
return {
// data 中设定
pickerOptionsStart: {
disabledDate: (time) => {
let endDateVal = this.form.endDate;
if (endDateVal) {
return (
time.getTime() > new Date(endDateVal).getTime() ||
time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000
);
} else {
return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
}
},
pickerOptionsEnd: {
disabledDate: time => {
let beginDateVal = this.form.startDate;
if (beginDateVal) {
return time.getTime() < new Date(beginDateVal).getTime();
} else {
return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
}
},
pickerOptionsEnd: {
disabledDate: (time) => {
let beginDateVal = this.form.startDate;
if (beginDateVal) {
return time.getTime() < new Date(beginDateVal).getTime();
} else {
return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
}
},
},
//周期段
dayOfWeekList: ['D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7'],
// 遮罩层
loading: false,
// 遮罩层
loadingFlightDate: false,
// 弹出层标题
title: "",
// 总条数
total: 0,
// 原航班规则数据
sourceFlightRulesList: [],
//目的航班数据
sourceFlightAndFlightDate: [],
statusList: [{
'id': 1,
'name': '有效'
}, {
'id': 3,
'name': '停用'
}],
// 新增修改查看规则弹出层
open: false,
// 是否显示查看目的航班弹出层
openFlightDate: false,
// 查询参数
queryParams: {
start: 0, //当前条数【代表第几条数据 +1开始】
pageNum: 1,
limit: 20, //一页显示多少条数据
sourceFlightNo: undefined, //原航班号
status: undefined, //状态
flightDate: undefined //日期
//周期段
dayOfWeekList: ["D1", "D2", "D3", "D4", "D5", "D6", "D7"],
// 遮罩层
loading: false,
// 遮罩层
loadingFlightDate: false,
// 弹出层标题
title: "",
// 总条数
total: 0,
// 原航班规则数据
sourceFlightRulesList: [],
//目的航班数据
sourceFlightAndFlightDate: [],
statusList: [
{
id: 1,
name: "有效",
},
dayOfWeek: [],
// 表单参数
form: {
dayOfWeek: []
{
id: 3,
name: "停用",
},
// 表单校验
rules: {
sourceFlightNo: [{
],
// 新增修改查看规则弹出层
open: false,
// 是否显示查看目的航班弹出层
openFlightDate: false,
// 查询参数
queryParams: {
start: 0, //当前条数【代表第几条数据 +1开始】
pageNum: 1,
limit: 20, //一页显示多少条数据
sourceFlightNo: undefined, //原航班号
status: undefined, //状态
flightDate: undefined, //日期
},
dayOfWeek: [],
// 表单参数
form: {
dayOfWeek: [],
},
// 表单校验
rules: {
sourceFlightNo: [
{
required: true,
message: "ACCS原航班号不能为空",
trigger: "blur"
}],
flightRank: [{
trigger: "blur",
},
],
flightRank: [
{
required: true,
message: "配载航班不能为空",
trigger: "blur"
}],
}
};
},
created() {
this.findSourceFlightRules();
},
methods: {
//跳转到查看,修改页面
handleClick(flightiId, handle) {
this.openFlightDate = false
this.$router.push({
name: "FlightAllocConfigInfo",
params: {
handle: handle,
id: flightiId
trigger: "blur",
},
});
],
},
/** 查询原航班顺位规则*/
findSourceFlightRules() {
this.loading = true;
if (this.queryParams.pageNum > 1) {
this.queryParams.start = (this.queryParams.pageNum - 1) * this.queryParams.limit
};
},
created() {
this.findSourceFlightRules();
},
methods: {
//跳转到查看,修改页面
handleClick(flightiId, handle) {
this.openFlightDate = false;
this.$router.push({
name: "FlightAllocConfigInfo",
params: {
handle: handle,
id: flightiId,
},
});
},
/** 查询原航班顺位规则*/
findSourceFlightRules() {
this.loading = true;
if (this.queryParams.pageNum > 1) {
this.queryParams.start =
(this.queryParams.pageNum - 1) * this.queryParams.limit;
} else {
this.queryParams.start = 0;
}
findSourceFlightRulesApi(this.queryParams).then((response) => {
if (response.code == 200) {
this.sourceFlightRulesList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
} else {
this.queryParams.start = 0;
this.msgError(response.msg);
}
findSourceFlightRulesApi(this.queryParams).then(response => {
if (response.code == 200) {
this.sourceFlightRulesList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
} else {
this.msgError(response.msg);
}
});
},
/** 新增按钮操作 */
handleAdd() {
this.form = {};
this.open = true;
this.title = "添加ACCS原航班顺位规则";
this.form.id = -1;
this.dayOfWeek = [];
},
/** 修改按钮操作 */
handleUpdate(row) {
this.form = {};
this.dayOfWeek = [];
this.open = true;
this.title = "修改ACCS原航班顺位规则";
this.form = JSON.parse(JSON.stringify(row));
this.dayOfWeek = this.form.dayOfWeek
? this.form.dayOfWeek.split(";")
: [];
//this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
},
/** 删除 启用 停用按钮操作 */
handleDeleteorPlayorpause(row, status, statusText) {
//删除前需要停用
if (status === 0 && row.status != "3") {
this.$message({
message: "请停用后删除",
type: "warning",
});
},
/** 新增按钮操作 */
handleAdd() {
this.form = {};
this.open = true;
this.title = "添加原航班顺位规则";
this.form.id = -1;
this.dayOfWeek = [];
},
/** 修改按钮操作 */
handleUpdate(row) {
this.form = {};
this.dayOfWeek = [];
this.open = true;
this.title = "修改原航班顺位规则";
this.form = JSON.parse(JSON.stringify(row));
this.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
//this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
},
/** 删除 启用 停用按钮操作 */
handleDeleteorPlayorpause(row, status, statusText) {
//删除前需要停用
if (status === 0 && row.status != '3') {
this.$message({
message: '请停用后删除',
type: 'warning'
});
return;
}
this.$confirm('是否确认' + statusText + '此数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
let disable = {
id: row.id,
status: status
};
return delOrEnableORDisableApi(disable);
}).then(response => {
if (response.code == 200) {
this.findSourceFlightRules();
this.msgSuccess(statusText + "成功");
} else {
this.msgError(response.msg);
}
}).catch(function() {});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.dayOfWeek = this.dayOfWeek.sort();
let formdata = JSON.parse(JSON.stringify(this.form));
formdata.sourceFlightNo=formdata.sourceFlightNo.trim().toUpperCase();
formdata.flightRank=formdata.flightRank.trim().toUpperCase();
if (formdata.startDate === undefined || formdata.startDate == null) {
formdata.startDate = "";
}
if (formdata.endDate === undefined || formdata.endDate == null) {
formdata.endDate = "";
return;
}
this.$confirm("是否确认" + statusText + "此数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let disable = {
id: row.id,
status: status,
};
delOrEnableORDisableApi(disable)
.then((response) => {
if (response.code == 200) {
this.findSourceFlightRules();
this.msgSuccess(statusText + "成功");
} else {
this.msgError(response.msg);
}
//处理数据
sourceFlightRulesSaveApi(formdata).then(response => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.open = false;
this.findSourceFlightRules();
} else {
this.msgError(response.msg);
}
});
})
.catch(() => {});
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.dayOfWeek = this.dayOfWeek.sort();
let formdata = JSON.parse(JSON.stringify(this.form));
formdata.sourceFlightNo = formdata.sourceFlightNo
.trim()
.toUpperCase();
formdata.flightRank = formdata.flightRank.trim().toUpperCase();
if (formdata.startDate === undefined || formdata.startDate == null) {
formdata.startDate = "";
}
});
},
// 表单重置
reset() {
this.form = {
dayOfWeek: []
};
this.resetForm("form");
},
/** 查询目的航班*/
findSourceFlightAndFlightDate() {
//校验原航班号非空
if (this.queryParams.sourceFlightNo === null || this.queryParams.sourceFlightNo === undefined || this
.queryParams.sourceFlightNo.trim() === '') {
this.$message.warning("ACCS原航班号为空");
return
}
//校验原日期非空
if (this.queryParams.flightDate === null || this.queryParams.flightDate === undefined) {
this.$message.warning("日期为空");
return
}
this.openFlightDate = true;
this.loadingFlightDate = true;
this.sourceFlightAndFlightDate = [];
findSourceFlightAndFlightDateApi(this.queryParams).then(response => {
if (response.code === 200) {
this.sourceFlightAndFlightDate = response.data;
this.loadingFlightDate = false;
} else {
this.msgError(response.msg);
if (formdata.endDate === undefined || formdata.endDate == null) {
formdata.endDate = "";
}
});
},
// 目的航班弹出框返回
cancelFlightDate() {
this.openFlightDate = false;
this.findSourceFlightRules();
},
// 取消按钮
cancel() {
this.open = false;
this.findSourceFlightRules();
//this.reset();
},
// 状态字典翻译
statusFormat(row) {
if (row.status === '1') {
return '有效'
} else if (row.status === '0') {
return '执行中'
} else if (row.status === '3') {
return '停用'
//处理数据
sourceFlightRulesSaveApi(formdata).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.open = false;
this.findSourceFlightRules();
} else {
this.msgError(response.msg);
}
});
}
return row.status;
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.sourceFlightNo = undefined
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.start = 0;
this.findSourceFlightRules();
},
});
},
computed: {
upCase: {
get: function() {
return this.queryParams.sourceFlightNo;
},
set: function(val) {
this.queryParams.sourceFlightNo = val.toUpperCase();
},
// 表单重置
reset() {
this.form = {
dayOfWeek: [],
};
this.resetForm("form");
},
/** 查询目的航班*/
findSourceFlightAndFlightDate() {
//校验原航班号非空
if (
this.queryParams.sourceFlightNo === null ||
this.queryParams.sourceFlightNo === undefined ||
this.queryParams.sourceFlightNo.trim() === ""
) {
this.$message.warning("ACCS原航班号为空");
return;
}
//校验原日期非空
if (
this.queryParams.flightDate === null ||
this.queryParams.flightDate === undefined
) {
this.$message.warning("日期为空");
return;
}
this.openFlightDate = true;
this.loadingFlightDate = true;
this.sourceFlightAndFlightDate = [];
findSourceFlightAndFlightDateApi(this.queryParams).then((response) => {
if (response.code === 200) {
this.sourceFlightAndFlightDate = response.data;
this.loadingFlightDate = false;
} else {
this.msgError(response.msg);
}
});
},
// 目的航班弹出框返回
cancelFlightDate() {
this.openFlightDate = false;
this.findSourceFlightRules();
},
// 取消按钮
cancel() {
this.open = false;
this.findSourceFlightRules();
//this.reset();
},
// 状态字典翻译
statusFormat(row) {
if (row.status === "1") {
return "有效";
} else if (row.status === "0") {
return "执行中";
} else if (row.status === "3") {
return "停用";
}
return row.status;
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.sourceFlightNo = undefined;
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.start = 0;
this.findSourceFlightRules();
},
},
computed: {
upCase: {
get: function () {
return this.queryParams.sourceFlightNo;
},
set: function (val) {
this.queryParams.sourceFlightNo = val.toUpperCase();
},
},
};
},
};
</script>
<style>
</style>
......
<template>
<div>
<el-form class="form-header" :model="queryParams" label-position="right" label-width="auto" size="medium">
<div class="app-container">
<el-form
class="form-header"
:model="queryParams"
label-position="right"
label-width="auto"
size="medium"
>
<el-row>
<el-col :span="6">
<el-form-item label="航班日期从" prop="fltDateStart">
......@@ -87,27 +93,26 @@
</el-switch>
</el-col>
</el-row>
<div style="margin-top:25px">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button
type="warning"
:disabled="tableData.length == 0"
@click="xlse()"
:loading="downLoadingTip.downloading"
icon="el-icon-download"
size="mini"
>{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出"
}}</el-button
>
<div style="margin-top: 25px">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button
type="warning"
:disabled="tableData.length == 0"
@click="xlse()"
:loading="downLoadingTip.downloading"
icon="el-icon-download"
size="mini"
>{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出"
}}</el-button
>
</div>
</el-form>
<el-table
......@@ -122,23 +127,27 @@
label="运单号"
align="center"
prop="waybillNo"
width="150"
/>
<el-table-column
:show-overflow-tooltip="true"
label="品牌描述"
align="center"
prop="nameDescription"
width="150"
/>
<el-table-column
label="航班日期"
align="center"
prop="fltDate"
width="150"
/>
<el-table-column label="航班号" align="center" prop="fltNo" width="100"/>
<el-table-column label="航班号" align="center" prop="fltNo" />
<el-table-column
label="航班路线"
align="center"
prop="route"
width="150"
/>
<el-table-column
label="配置航班类型"
......@@ -146,9 +155,9 @@
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="sizeStr" />
<el-table-column label="件数" align="center" prop="qty" />
<el-table-column label="实际重量" align="center" prop="actualWeight" />
<el-table-column
label="创建时间"
align="center"
......@@ -255,12 +264,6 @@ export default {
this.tableData = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
if(response.data.list.length == 0){
this.$message({
message: "未查询到数据",
type: "warning",
});
}
} else {
this.msgError(response.msg);
}
......
......@@ -81,7 +81,6 @@
uploadExcel(option) {
//上传excel
const file = option.file;
console.log(option);
this.loading=true;
importcaPreReview(file, this.form.type).then((res) => {
this.loading=false;
......
......@@ -72,7 +72,7 @@ import {
importFlight,
} from "@/api/flightInfoImport";
export default {
name:"FlightInformationImport",
name: "FlightInformationImport",
data() {
return {
flightType: [],
......@@ -125,15 +125,14 @@ export default {
uploadExcel(option) {
//上传excel
const file = option.file;
console.log(option);
importFlight(file, this.form.type).then((res) => {
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg , "提示", {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
}else {
} else {
this.$message.error(res.msg);
this.tableData = res.data;
}
......@@ -172,13 +171,6 @@ export default {
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.upload-demo {
float: right;
}
.el-upload-list {
display: inline-block;
margin-left: 10px;
vertical-align: top;
}
<style>
</style>
\ No newline at end of file
......
<template>
<div>
<el-form class="form-header" :model="queryParams" ref="queryForm" label-position="right" label-width="auto" size="medium">
<el-form
class="form-header"
:model="queryParams"
ref="queryForm"
label-position="right"
label-width="auto"
size="medium"
>
<el-row>
<el-col :span="6">
<el-form-item label="航班日期从" prop="fltDateStart">
<el-date-picker class="formItem" value-format="yyyy-MM-dd" v-model="queryParams.fltDateStart" type="date" placeholder="选择日期">
<el-date-picker
class="formItem"
value-format="yyyy-MM-dd"
v-model="queryParams.fltDateStart"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="到" prop="fltDateEnd">
<el-date-picker class="formItem" value-format="yyyy-MM-dd" v-model="queryParams.fltDateEnd" type="date" placeholder="选择日期">
<el-date-picker
class="formItem"
value-format="yyyy-MM-dd"
v-model="queryParams.fltDateEnd"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班号" prop="fltNo">
<el-input class="formItem" v-model="queryParams.fltNo" placeholder="请输入航班号" clearable />
<el-input
class="formItem"
v-model="queryParams.fltNo"
placeholder="请输入航班号"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班类型" prop="typeId">
<el-select class="formItem" v-model="queryParams.typeId" placeholder="请选择航班类型" clearable>
<el-option v-for="dict in flightTypelist" :key="dict.id" :label="dict.chineseName" :value="dict.id" />
<el-select
class="formItem"
v-model="queryParams.typeId"
placeholder="请选择航班类型"
clearable
>
<el-option
v-for="dict in flightTypelist"
:key="dict.id"
:label="dict.chineseName"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班状态" prop="statusId">
<el-select class="formItem" v-model="queryParams.statusId" placeholder="请选择航班状态" clearable>
<el-option v-for="dict in flightStatuslist" :key="dict.id" :label="dict.chineseName" :value="dict.id" />
<el-select
class="formItem"
v-model="queryParams.statusId"
placeholder="请选择航班状态"
clearable
>
<el-option
v-for="dict in flightStatuslist"
:key="dict.id"
:label="dict.chineseName"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班种类" prop="flightKindId">
<el-select class="formItem" v-model="queryParams.flightKindId" placeholder="请选择航班种类" clearable>
<el-option v-for="dict in flightKindlist" :key="dict.id" :label="dict.chineseName" :value="dict.id" />
<el-select
class="formItem"
v-model="queryParams.flightKindId"
placeholder="请选择航班种类"
clearable
>
<el-option
v-for="dict in flightKindlist"
:key="dict.id"
:label="dict.chineseName"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
</el-button>
<el-button type="primary" icon="el-icon-circle-check" size="mini" @click="handleFlightStatus('flightStatus10')">自动配舱开启</el-button>
<el-button type="primary" icon="el-icon-circle-close" size="mini" @click="handleFlightStatus('flightStatus80')">自动配舱关闭</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button
>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
<el-button
type="primary"
icon="el-icon-circle-check"
size="mini"
@click="handleFlightStatus('flightStatus10')"
>自动配舱开启</el-button
>
<el-button
type="primary"
icon="el-icon-circle-close"
size="mini"
@click="handleFlightStatus('flightStatus80')"
>自动配舱关闭</el-button
>
</el-form>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
......@@ -70,94 +154,254 @@
</el-button>
</el-col>
</el-row> -->
<el-table height="550" highlight-current-row border stripe v-loading="loading" :data="findAllFltDatList" size="mini"
@selection-change="handleSelectionChange">
<el-table
height="550"
highlight-current-row
border
stripe
v-loading="loading"
:data="findAllFltDatList"
size="small"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="航班日期" align="center" prop="fltDate" width="120" />
<el-table-column label="航班起飞时间" align="center" prop="takeOffTime" width="120" />
<el-table-column
label="航班日期"
align="center"
prop="fltDate"
width="120"
/>
<el-table-column
label="航班起飞时间"
align="center"
prop="takeOffTime"
width="120"
/>
<el-table-column label="航班号" align="center" prop="fltNo" width="150"/>
<el-table-column label="航班路线" align="center" prop="route" width="150" />
<el-table-column label="航班类型" align="center" prop="typeName" width="100" />
<el-table-column label="航班种类" align="center" prop="flightKindName" width="130" />
<el-table-column
label="航班类型"
align="center"
prop="typeName"
width="100"
/>
<el-table-column
label="航班种类"
align="center"
prop="flightKindName"
width="130"
/>
<el-table-column label="航班状态" align="center" prop="statusName" />
<el-table-column label="总重量" align="center" prop="totalWeight" width="130" />
<el-table-column label="原始重量(KG)" align="center" prop="originalWeight" width="130" />
<el-table-column label="总体积(cm³)" align="center" prop="totalVolume" width="130" />
<el-table-column label="是否限制一票一件" align="center" prop="ticketToPiece" width="150"
:formatter="ticketToPieceFormat" />
<el-table-column label="是否需要预审" align="center" prop="needRequired" width="150" :formatter="needRequiredFormat" />
<el-table-column label="额外增重百分比" align="center" prop="extraWeightPercent" width="150" />
<el-table-column label="高价百分比" align="center" prop="highPriceWeightPercent" width="150" />
<el-table-column label="低价百分比" align="center" prop="lowPriceWeightPercent" width="150" />
<el-table-column label="是否开启高地价" align="center" prop="highLowPriceFlg" width="150"
:formatter="highLowPriceFlgFormat" />
<el-table-column label="已配重量" align="center" prop="alloctedWeight" width="150" />
<el-table-column label="已配体积(cm³)" align="center" prop="alloctedVolume" width="150" />
<el-table-column label="航班优先级" align="center" prop="priorityName" width="150" />
<el-table-column label="配舱优先级" align="center" prop="priorityRuleName" width="150" />
<el-table-column label="创建人" align="center" prop="createUserName" width="120" />
<el-table-column label="创建时间" align="center" prop="createTime" width="155" />
<el-table-column
label="总重量"
align="center"
prop="totalWeight"
width="130"
/>
<el-table-column
label="原始重量(KG)"
align="center"
prop="originalWeight"
width="130"
/>
<el-table-column
label="总体积(cm³)"
align="center"
prop="totalVolume"
width="130"
/>
<el-table-column
label="是否限制一票一件"
align="center"
prop="ticketToPiece"
width="150"
:formatter="ticketToPieceFormat"
/>
<el-table-column
label="是否需要预审"
align="center"
prop="needRequired"
width="150"
:formatter="needRequiredFormat"
/>
<el-table-column
label="额外增重百分比"
align="center"
prop="extraWeightPercent"
width="150"
/>
<el-table-column
label="高价百分比"
align="center"
prop="highPriceWeightPercent"
width="150"
/>
<el-table-column
label="低价百分比"
align="center"
prop="lowPriceWeightPercent"
width="150"
/>
<el-table-column
label="是否开启高地价"
align="center"
prop="highLowPriceFlg"
width="150"
:formatter="highLowPriceFlgFormat"
/>
<el-table-column
label="已配重量"
align="center"
prop="alloctedWeight"
width="150"
/>
<el-table-column
label="已配体积(cm³)"
align="center"
prop="alloctedVolume"
width="150"
/>
<el-table-column
label="航班优先级"
align="center"
prop="priorityName"
width="150"
/>
<el-table-column
label="配舱优先级"
align="center"
prop="priorityRuleName"
width="150"
/>
<el-table-column
label="创建人"
align="center"
prop="createUserName"
width="120"
/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="155"
/>
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="155">
<template slot-scope="scope">
<span>{{ renderTime(scope.row.createTime) }}</span>
</template>
</el-table-column> -->
<el-table-column label="最后修改人" align="center" prop="lastModifyUserName" width="155" />
<el-table-column
label="最后修改人"
align="center"
prop="lastModifyUserName"
width="155"
/>
<!-- <el-table-column label="最后修改时间" align="center" prop="lastModifyTime" width="155">
<template slot-scope="scope">
<span>{{ renderTime(scope.row.lastModifyTime) }}</span>
</template>
</el-table-column> -->
<el-table-column label="最后修改时间" align="center" prop="lastModifyTime" width="120" />
<el-table-column v-if="findAllFltDatList.length>0" label="操作" align="center"
class-name="small-padding fixed-width" width="130" fixed="right">
<el-table-column
label="最后修改时间"
align="center"
prop="lastModifyTime"
width="120"
/>
<el-table-column
v-if="findAllFltDatList.length > 0"
label="操作"
align="center"
class-name="small-padding fixed-width"
width="130"
fixed="right"
>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row,'删除')">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button
>
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row,'删除')">
删除</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" layout=" prev, pager, next, jumper, sizes,total"
:page.sync="queryParams.pageNum" :limit.sync="queryParams.limitSize" @pagination="findAllFltData" />
<pagination
v-show="total > 0"
:total="total"
layout=" prev, pager, next, jumper, sizes,total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.limitSize"
@pagination="findAllFltData"
/>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="60%" :close-on-click-modal="false" :append-to-body="true">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto">
<el-dialog
:title="title"
:visible.sync="open"
width="60%"
:close-on-click-modal="false"
:append-to-body="true"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-position="right"
label-width="auto"
>
<el-row>
<el-col :span="12">
<el-form-item label="航班号" prop="fltNo">
<el-input @blur="blurfltNo" :disabled="formdisabled.fltNo" style="width:93%;" v-model="form.fltNo"
placeholder="请输入航班号" />
<el-input
@blur="blurfltNo"
:disabled="formdisabled.fltNo"
style="width: 93%"
v-model="form.fltNo"
placeholder="请输入航班号"
/>
</el-form-item>
</el-col>
<!-- <el-col :span="1"> &#12288;</el-col> -->
<el-col :span="12">
<el-form-item label="航班日期" prop="fltDate">
<el-date-picker :disabled="formdisabled.fltDate" clearable size="small" v-model="form.fltDate" type="date"
value-format="yyyy-MM-dd" placeholder="选择航班日期">
<el-date-picker
:disabled="formdisabled.fltDate"
clearable
size="small"
v-model="form.fltDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择航班日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="航班路线" prop="route">
<el-input style="width:93%" v-model="form.route" placeholder="请输入航班路线" />
<el-input
style="width: 93%"
v-model="form.route"
placeholder="请输入航班路线"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="航班种类" prop="kindId">
<el-select v-model="form.kindId" placeholder="请选择航班种类">
<el-option v-for="item in flightKindlist" :key="item.id" :label="item.chineseName" :value="item.id">
<el-option
v-for="item in flightKindlist"
:key="item.id"
:label="item.chineseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
......@@ -165,36 +409,62 @@
<el-col :span="12">
<el-form-item label="航班类型" prop="typeId">
<el-select v-model="form.typeId" placeholder="请选择航班类型">
<el-option v-for="item in flightTypelist" :key="item.id" :label="item.chineseName" :value="item.id">
<el-option
v-for="item in flightTypelist"
: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="statusId">
<el-select :disabled="true" v-model="form.statusId" placeholder="请选择航班状态">
<el-option v-for="item in flightStatuslist" :key="item.id" :label="item.chineseName" :value="item.id">
<el-select
:disabled="true"
v-model="form.statusId"
placeholder="请选择航班状态"
>
<el-option
v-for="item in flightStatuslist"
:key="item.id"
:label="item.chineseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原始重量(KG)" prop="originalWeight">
<el-input-number @change="LowHighAvailable" placeholder="请输入原始重量(KG)" style="width:93%"
v-model="form.originalWeight"></el-input-number>
<el-input-number
@change="LowHighAvailable"
placeholder="请输入原始重量(KG)"
style="width: 93%"
v-model="form.originalWeight"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="额外增重百分比" prop="extraWeightPercent">
<el-input-number @change="LowHighAvailable" placeholder="请输入额外增重百分比" style="width:93%"
v-model="form.extraWeightPercent"></el-input-number>
<el-input-number
@change="LowHighAvailable"
placeholder="请输入额外增重百分比"
style="width: 93%"
v-model="form.extraWeightPercent"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否开启高低价" prop="highLowPriceFlg">
<el-switch @change='LowHighAvailable' v-model="form.highLowPriceFlg" active-color="#13ce66">
<el-switch
@change="LowHighAvailable"
v-model="form.highLowPriceFlg"
active-color="#13ce66"
>
</el-switch>
</el-form-item>
</el-col>
......@@ -202,65 +472,95 @@
<!-- 是否需要预审,1:预审,0:取消预审 -->
<el-col :span="12">
<el-form-item label="是否预审" prop="isNeedRequired">
<el-switch :disabled="true" v-model="form.isNeedRequired" active-color="#13ce66">
<el-switch
:disabled="true"
v-model="form.isNeedRequired"
active-color="#13ce66"
>
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高价百分比" prop="highPriceWeightPercent">
<el-input-number :disabled="ishighPriceWeightPercent" @change="LowHighAvailable" placeholder="请输入高价百分比" style="width:93%"
v-model="form.highPriceWeightPercent"></el-input-number>
<el-input-number
:disabled="ishighPriceWeightPercent"
@change="LowHighAvailable"
placeholder="请输入高价百分比"
style="width: 93%"
v-model="form.highPriceWeightPercent"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低价百分比" prop="lowPriceWeightPercent">
<el-input-number :disabled="true" placeholder="请输入低价百分比" style="width:93%"
v-model="form.lowPriceWeightPercent"></el-input-number>
<el-input-number
:disabled="true"
placeholder="请输入低价百分比"
style="width: 93%"
v-model="form.lowPriceWeightPercent"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高价可配重量" prop="highAvailableWeight">
<el-input-number :disabled="true" placeholder="请输入高价可配重量" style="width:93%"
v-model="form.highAvailableWeight" :precision="2"></el-input-number>
<el-input-number
:disabled="true"
placeholder="请输入高价可配重量"
style="width: 93%"
v-model="form.highAvailableWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低价可配重量" prop="lowAvailableWeight">
<el-input-number :disabled="true" placeholder="请输入低价可配重量" style="width:93%"
v-model="form.lowAvailableWeight" :precision="2"></el-input-number>
<el-input-number
:disabled="true"
placeholder="请输入低价可配重量"
style="width: 93%"
v-model="form.lowAvailableWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高价已配重量" prop="highAllocatedWeight">
<el-input-number :disabled="true" placeholder="请输入高价已配重量" style="width:93%"
v-model="form.highAllocatedWeight" :precision="2"></el-input-number>
<el-input-number
:disabled="true"
placeholder="请输入高价已配重量"
style="width: 93%"
v-model="form.highAllocatedWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低价已配重量" prop="lowAllocatedWeight">
<el-input-number :disabled="true" placeholder="请输入低价已配重量" style="width:93%"
v-model="form.lowAllocatedWeight" :precision="2"></el-input-number>
<el-input-number
:disabled="true"
placeholder="请输入低价已配重量"
style="width: 93%"
v-model="form.lowAllocatedWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="已配总重量" prop="alloctedWeight">
<el-input-number :disabled="true" placeholder="请输入已配总重量" style="width:93%" v-model="form.alloctedWeight"
:precision="2"></el-input-number>
<el-input-number
:disabled="true"
placeholder="请输入已配总重量"
style="width: 93%"
v-model="form.alloctedWeight"
:precision="2"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -268,502 +568,601 @@
</div>
</el-dialog>
<el-dialog title="未删除成功航班" width="40%" center :visible.sync="dialogTableVisible" :close-on-click-modal="false" :append-to-body="true">
<el-dialog
title="未删除成功航班"
width="40%"
center
:visible.sync="dialogTableVisible"
:close-on-click-modal="false" :append-to-body="true"
>
<el-table :data="gridData">
<el-table-column property="fltNo" label="航班号" width="150"></el-table-column>
<el-table-column property="fltDate" label="航班日期" width="200"></el-table-column>
<el-table-column property="alloctedWeight" label="已配重量" width="200"></el-table-column>
<el-table-column
property="fltNo"
label="航班号"
width="150"
></el-table-column>
<el-table-column
property="fltDate"
label="航班日期"
width="200"
></el-table-column>
<el-table-column
property="alloctedWeight"
label="已配重量"
width="200"
></el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import {
delFlight,
findFltConditionDataApi,
findAllFltDataApi,
findFltById,
saveOrUpdate,
findFltCommonConf,
updateStatusBatch
} from "@/api/findAllFltData";
export default {
name: "FlightInformationMaintenance",
data() {
return {
gridData:[],
dialogTableVisible: false,
//高价百分比是否打开
ishighPriceWeightPercent:true,
//form属性禁用状态
formdisabled: {
//航班号
fltNo: false,
//航班日期
fltDate: false,
//航班路线
route: false,
//航班种类
kindId: false,
//航班类型
typeId: false,
//原始重量
originalWeight: false
},
<script>
import {
delFlight,
findFltConditionDataApi,
findAllFltDataApi,
findFltById,
saveOrUpdate,
findFltCommonConf,
updateStatusBatch,
} from "@/api/findAllFltData";
export default {
name: "FlightInformationMaintenance",
data() {
return {
gridData: [],
dialogTableVisible: false,
//高价百分比是否打开
ishighPriceWeightPercent: true,
//form属性禁用状态
formdisabled: {
//航班号
fltNo: false,
//航班日期
fltDate: false,
//航班路线
route: false,
//航班种类
flightKindlist: [],
//航班状态
flightStatuslist: [],
kindId: false,
//航班类型
flightTypelist: [],
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 遮罩层
loading: false,
// 遮罩层
loadingFlightDate: false,
// 弹出层标题
title: "",
// 总条数
total: 0,
// 原航班规则数据
findAllFltDatList: [],
//目的航班数据
sourceFlightAndFlightDate: [],
statusList: [{
'id': 1,
'name': '有效'
}, {
'id': 3,
'name': '停用'
}],
// 新增修改查看规则弹出层
open: false,
// 是否显示查看目的航班弹出层
openFlightDate: false,
// 查询参数
queryParams: {
limitStart: 0, //当前条数【代表第几条数据 +1开始】
pageNum: 1,
limitSize: 20, //一页显示多少条数据
fltDateStart: undefined, //航班日期开始
fltDateEnd: undefined, //航班日期结束
typeId: undefined, //航班类型
statusId: undefined, //航班状态
flightKindId: undefined, //航班种类
fltNo: undefined //航班号,要大写
},
// 表单参数
form: {
typeId: false,
//原始重量
originalWeight: false,
},
//航班种类
flightKindlist: [],
//航班状态
flightStatuslist: [],
//航班类型
flightTypelist: [],
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 遮罩层
loading: false,
// 遮罩层
loadingFlightDate: false,
// 弹出层标题
title: "",
// 总条数
total: 0,
// 原航班规则数据
findAllFltDatList: [],
//目的航班数据
sourceFlightAndFlightDate: [],
statusList: [
{
id: 1,
name: "有效",
},
// 表单校验
rules: {
fltNo: [{
{
id: 3,
name: "停用",
},
],
// 新增修改查看规则弹出层
open: false,
// 是否显示查看目的航班弹出层
openFlightDate: false,
// 查询参数
queryParams: {
limitStart: 0, //当前条数【代表第几条数据 +1开始】
pageNum: 1,
limitSize: 20, //一页显示多少条数据
fltDateStart: undefined, //航班日期开始
fltDateEnd: undefined, //航班日期结束
typeId: undefined, //航班类型
statusId: undefined, //航班状态
flightKindId: undefined, //航班种类
fltNo: undefined, //航班号,要大写
},
// 表单参数
form: {},
// 表单校验
rules: {
fltNo: [
{
required: true,
message: "ACCS原航班号不能为空",
trigger: "blur"
}],
fltDate: [{
trigger: "blur",
},
],
fltDate: [
{
required: true,
message: "航班日期不能为空",
trigger: "blur"
}],
kindId: [{
trigger: "blur",
},
],
kindId: [
{
required: true,
message: "航班种类不能为空",
trigger: "change"
}],
originalWeight: [{
trigger: "change",
},
],
originalWeight: [
{
required: true,
message: "原始重量(KG)不能为空",
trigger: "blur"
}],
}
};
},
created() {
//查询条件数据源
this.findFltConditionData();
this.findAllFltData();
},
methods: {
//输入航班号后
blurfltNo() {
if (this.form.fltNo != null && this.form.fltNo != undefined && this.form.fltNo != "") {
this.form.fltNo = this.form.fltNo.toUpperCase();
findFltCommonConf(this.form).then(response => {
if (response.code == 200) {
//额外增重百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置为0,不可编辑
if (response.data!=null && response.data.extraWeightPercent != null && response.data.extraWeightPercent != undefined) {
this.$set(this.form, "extraWeightPercent", response.data.extraWeightPercent);
// this.form.extraWeightPercent=response.data.extraWeightPercent;
} else {
this.$set(this.form, "extraWeightPercent", 0);
//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 === 1 ? true : false;
} else {
this.$set(this.form, "highLowPriceFlg", true);
//this.form.highLowPriceFlg = true;
}
//是否预审:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否预审’ 为否,不可编辑;
if (response.data!=null &&response.data.isNeedRequired != null && response.data.isNeedRequired != undefined) {
this.form.isNeedRequired = response.data.isNeedRequired === 1 ? true : false;
} else {
this.form.isNeedRequired = false;
}
//高/低价百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘高价百分比’60%,‘低价百分比’40%,不可编辑
if (response.data!=null &&response.data.highPriceWeightPercent != null && response.data.highPriceWeightPercent !=
undefined) {
this.form.highPriceWeightPercent = response.data.highPriceWeightPercent;
} else {
this.form.highPriceWeightPercent = 60;
}
if (response.data!=null &&response.data.lowPriceWeightPercent != null && response.data.lowPriceWeightPercent != undefined) {
this.form.lowPriceWeightPercent = response.data.lowPriceWeightPercent;
} else {
this.form.lowPriceWeightPercent = 40;
}
this.LowHighAvailable();
} else {
this.msgError(response.msg);
}
});
}
},
// 是否一票一件
ticketToPieceFormat(row) {
if (row.ticketToPiece === 1) {
return '是'
} else {
return '否'
}
return row.ticketToPiece;
},
// 是否需要预审 1 预审 0 取消预审
needRequiredFormat(row) {
if (row.needRequired === 1) {
return '是'
} else {
return '否'
}
return row.ticketToPiece;
},
//是否开启高低价
highLowPriceFlgFormat(row) {
if (row.highLowPriceFlg === 1) {
return '开启'
} else {
return '未开启'
}
return row.ticketToPiece;
},
//时间格式化
renderTime(date) {
var dateee = new Date(date).toJSON();
return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
trigger: "blur",
},
],
},
//查询条件数据源
findFltConditionData() {
findFltConditionDataApi().then(response => {
};
},
created() {
//查询条件数据源
this.findFltConditionData();
this.findAllFltData();
},
methods: {
//输入航班号后
blurfltNo() {
if (
this.form.fltNo != null &&
this.form.fltNo != undefined &&
this.form.fltNo != ""
) {
this.form.fltNo = this.form.fltNo.toUpperCase();
findFltCommonConf(this.form).then((response) => {
if (response.code == 200) {
//航班种类
this.flightKindlist = response.data.flightKind;
//航班类型
this.flightTypelist = response.data.flightType;
//航班状态
this.flightStatuslist = response.data.flightStatus;
//额外增重百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置为0,不可编辑
if (
response.data != null &&
response.data.extraWeightPercent != null &&
response.data.extraWeightPercent != undefined
) {
this.$set(
this.form,
"extraWeightPercent",
response.data.extraWeightPercent
);
// this.form.extraWeightPercent=response.data.extraWeightPercent;
} else {
this.$set(this.form, "extraWeightPercent", 0);
//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 === 1 ? true : false;
} else {
this.$set(this.form, "highLowPriceFlg", true);
//this.form.highLowPriceFlg = true;
}
//是否预审:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否预审’ 为否,不可编辑;
if (
response.data != null &&
response.data.isNeedRequired != null &&
response.data.isNeedRequired != undefined
) {
this.form.isNeedRequired =
response.data.isNeedRequired === 1 ? true : false;
} else {
this.form.isNeedRequired = false;
}
//高/低价百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘高价百分比’60%,‘低价百分比’40%,不可编辑
if (
response.data != null &&
response.data.highPriceWeightPercent != null &&
response.data.highPriceWeightPercent != undefined
) {
this.form.highPriceWeightPercent =
response.data.highPriceWeightPercent;
} else {
this.form.highPriceWeightPercent = 60;
}
if (
response.data != null &&
response.data.lowPriceWeightPercent != null &&
response.data.lowPriceWeightPercent != undefined
) {
this.form.lowPriceWeightPercent =
response.data.lowPriceWeightPercent;
} else {
this.form.lowPriceWeightPercent = 40;
}
this.LowHighAvailable();
} else {
this.msgError(response.msg);
}
});
},
}
},
// 是否一票一件
ticketToPieceFormat(row) {
if (row.ticketToPiece === 1) {
return "是";
} else {
return "否";
}
return row.ticketToPiece;
},
// 是否需要预审 1 预审 0 取消预审
needRequiredFormat(row) {
if (row.needRequired === 1) {
return "是";
} else {
return "否";
}
return row.ticketToPiece;
},
//是否开启高低价
highLowPriceFlgFormat(row) {
if (row.highLowPriceFlg === 1) {
return "开启";
} else {
return "未开启";
}
return row.ticketToPiece;
},
//时间格式化
renderTime(date) {
var dateee = new Date(date).toJSON();
return new Date(+new Date(dateee) + 8 * 3600 * 1000)
.toISOString()
.replace(/T/g, " ")
.replace(/\.[\d]{3}Z/, "");
},
//查询条件数据源
findFltConditionData() {
findFltConditionDataApi().then((response) => {
if (response.code == 200) {
//航班种类
this.flightKindlist = response.data.flightKind;
//航班类型
this.flightTypelist = response.data.flightType;
//航班状态
this.flightStatuslist = response.data.flightStatus;
} else {
this.msgError(response.msg);
}
});
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length != 1
this.multiple = !selection.length
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 航班信息维护查询*/
findAllFltData() {
this.loading = true;
if (this.queryParams.pageNum > 1) {
this.queryParams.limitStart =
(this.queryParams.pageNum - 1) * this.queryParams.limitSize;
} else {
this.queryParams.limitStart = 0;
}
if (
this.queryParams.fltNo != null &&
this.queryParams.fltNo != undefined &&
this.queryParams.fltNo != ""
) {
this.queryParams.fltNo = this.queryParams.fltNo.toUpperCase();
}
/** 航班信息维护查询*/
findAllFltData() {
this.loading = true;
if (this.queryParams.pageNum > 1) {
this.queryParams.limitStart = (this.queryParams.pageNum - 1) * this.queryParams.limitSize
findAllFltDataApi(this.queryParams).then((response) => {
if (response.code == 200) {
this.findAllFltDatList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
} else {
this.queryParams.limitStart = 0;
this.msgError(response.msg);
}
if (this.queryParams.fltNo != null && this.queryParams.fltNo != undefined && this.queryParams.fltNo != '') {
this.queryParams.fltNo = this.queryParams.fltNo.toUpperCase();
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加航班信息";
this.form.id = null;
this.form.statusId = this.flightStatuslist[0].id;
this.form.alloctedWeight = 0; //已配重量
this.form.lowAllocatedWeight = 0; //低价已配重量
this.form.highAllocatedWeight = 0; //高价已配重量
//航班号
this.formdisabled.fltNo = false;
//航班日期
this.formdisabled.fltDate = false;
//航班路线
this.formdisabled.route = false;
//航班种类
this.formdisabled.kindId = false;
//航班类型
this.formdisabled.typeId = false;
//原始重量
this.formdisabled.originalWeight = false;
},
//计算高地价可配
LowHighAvailable() {
//判断是否开启高地价
if (this.form.highLowPriceFlg) {
this.ishighPriceWeightPercent = false;
let Weight = 0;
//计算实际重量
if (
this.form.highPriceWeightPercent > 0 ||
this.form.lowPriceWeightPercent > 0
) {
Weight = this.Weightall();
}
findAllFltDataApi(this.queryParams).then(response => {
if (response.code == 200) {
this.findAllFltDatList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
//高价可配
if (this.form.highPriceWeightPercent >= 0) {
this.$set(
this.form,
"lowPriceWeightPercent",
100 - this.form.highPriceWeightPercent
);
this.$set(
this.form,
"highAvailableWeight",
(Weight - this.form.alloctedWeight) *
(this.form.highPriceWeightPercent / 100)
);
// this.form.HighAvailableWeight = Weightall * (this.form.highPriceWeightPercent / 100)
} else if (
this.title == "修改航班信息" &&
this.form.highPriceWeightPercent > 0
) {
if (this.form.highAvailableWeight) {
this.$set(
this.form,
"highAvailableWeight",
this.form.highAvailableWeight
);
} else {
this.msgError(response.msg);
this.$set(
this.form,
"highAvailableWeight",
(Weight - this.form.alloctedWeight) *
(this.form.highPriceWeightPercent / 100)
);
}
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加航班信息";
this.form.id = null;
this.form.statusId = this.flightStatuslist[0].id;
this.form.alloctedWeight = 0; //已配重量
this.form.lowAllocatedWeight = 0; //低价已配重量
this.form.highAllocatedWeight = 0; //高价已配重量
//航班号
this.formdisabled.fltNo = false;
//航班日期
this.formdisabled.fltDate = false;
//航班路线
this.formdisabled.route = false;
//航班种类
this.formdisabled.kindId = false;
//航班类型
this.formdisabled.typeId = false;
//原始重量
this.formdisabled.originalWeight = false;
},
//计算高地价可配
LowHighAvailable() {
//判断是否开启高地价
if (this.form.highLowPriceFlg) {
this.ishighPriceWeightPercent=false;
let Weight = 0;
//计算实际重量
if (this.form.highPriceWeightPercent > 0 || this.form.lowPriceWeightPercent > 0) {
Weight = this.Weightall();
}
//高价可配
if (this.form.highPriceWeightPercent >= 0) {
this.$set(this.form, "lowPriceWeightPercent", 100-this.form.highPriceWeightPercent);
this.$set(this.form, "highAvailableWeight", (Weight - this.form.alloctedWeight) * (this.form
.highPriceWeightPercent / 100));
// this.form.HighAvailableWeight = Weightall * (this.form.highPriceWeightPercent / 100)
}else if(this.title == "修改航班信息" && this.form.highPriceWeightPercent > 0){
if(this.form.highAvailableWeight){
this.$set(this.form, 'highAvailableWeight', this.form.highAvailableWeight)
}else{
this.$set(this.form, "highAvailableWeight", (Weight - this.form.alloctedWeight) * (this.form
.highPriceWeightPercent / 100));
}
}else {
this.$set(this.form, "highAvailableWeight", 0);
// this.form.HighAvailableWeight = 0;
}
//低价可配
if (this.form.lowPriceWeightPercent > 0) {
this.$set(this.form, "lowAvailableWeight", (Weight - this.form.alloctedWeight) - this.form
.highAvailableWeight);
//this.form.lowAvailableWeight = Weightall - this.form.HighAvailableWeight;
}else if(this.title == "修改航班信息" && this.form.lowPriceWeightPercent > 0){
if(this.form.lowAvailableWeight){
this.$set(this.form, 'lowAvailableWeight', this.form.lowAvailableWeight)
}else{
this.$set(this.form, "lowAvailableWeight", (Weight - this.form.alloctedWeight) - this.form
.highAvailableWeight);
}
}else {
this.$set(this.form, "lowAvailableWeight", 0);
// this.form.lowAvailableWeight = 0;
} else {
this.$set(this.form, "highAvailableWeight", 0);
// this.form.HighAvailableWeight = 0;
}
//低价可配
if (this.form.lowPriceWeightPercent > 0) {
this.$set(
this.form,
"lowAvailableWeight",
Weight - this.form.alloctedWeight - this.form.highAvailableWeight
);
//this.form.lowAvailableWeight = Weightall - this.form.HighAvailableWeight;
} else if (
this.title == "修改航班信息" &&
this.form.lowPriceWeightPercent > 0
) {
if (this.form.lowAvailableWeight) {
this.$set(
this.form,
"lowAvailableWeight",
this.form.lowAvailableWeight
);
} else {
this.$set(
this.form,
"lowAvailableWeight",
Weight - this.form.alloctedWeight - this.form.highAvailableWeight
);
}
}else{
this.ishighPriceWeightPercent=true;
} else {
this.$set(this.form, "lowAvailableWeight", 0);
// this.form.lowAvailableWeight = 0;
}
} else {
this.ishighPriceWeightPercent = true;
}
},
//计算实际重量
Weightall() {
let Weight = 0;
if (this.form.extraWeightPercent > 0) {
Weight =
this.form.originalWeight +
this.form.originalWeight * (this.form.extraWeightPercent / 100);
} else {
Weight = this.form.originalWeight;
}
return Weight;
},
},
//计算实际重量
Weightall() {
let Weight = 0;
if (this.form.extraWeightPercent > 0) {
Weight = this.form.originalWeight + this.form.originalWeight * (this.form.extraWeightPercent / 100)
}else {
Weight = this.form.originalWeight;
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.title = "修改航班信息";
//航班号
this.formdisabled.fltNo = true;
//航班日期
this.formdisabled.fltDate = true;
//根据ID查item
findFltById(row).then((response) => {
if (response.code == 200) {
this.form = response.data;
//是否开启高地价
this.form.highLowPriceFlg =
this.form.highLowPriceFlg === 1 ? true : false;
//是否预审
this.form.isNeedRequired =
this.form.isNeedRequired === 1 ? true : false;
// 计算高地价可配
this.LowHighAvailable();
} else {
this.msgError(response.msg);
}
return Weight;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.title = "修改航班信息";
//航班号
this.formdisabled.fltNo = true;
//航班日期
this.formdisabled.fltDate = true;
//根据ID查item
findFltById(row).then(response => {
if (response.code == 200) {
this.form = response.data;
//是否开启高地价
this.form.highLowPriceFlg = this.form.highLowPriceFlg === 1 ? true : false;
//是否预审
this.form.isNeedRequired = this.form.isNeedRequired === 1 ? true : false;
// 计算高地价可配
this.LowHighAvailable();
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fIds = this.ids;
this.$confirm("是否确认删除所选数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return delFlight(fIds);
})
.then((response) => {
this.findAllFltData();
if (response.data.length > 0) {
this.gridData = response.data;
this.$confirm(response.msg, "提示", {
confirmButtonText: "查看删除失败航班信息",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.dialogTableVisible = true;
})
.catch(() => {});
} else {
this.msgError(response.msg);
this.msgSuccess(response.msg);
}
})
.catch(() => {});
},
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fIds =this.ids;
this.$confirm('是否确认删除所选数据?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delFlight(fIds);
}).then(response => {
this.findAllFltData();
if(response.data.length>0){
this.gridData=response.data;
this.$confirm(response.msg, '提示', {
confirmButtonText: '查看删除失败航班信息',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(() => {
this.dialogTableVisible=true;
}).catch(function() { });
}else{
this.msgSuccess(response.msg);
}
}).catch(function() {});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
let formdata = JSON.parse(JSON.stringify(this.form));
//高价百分比和低价百分比和不可以大于100
if (this.form.highLowPriceFlg && (formdata.highPriceWeightPercent>100||formdata.highPriceWeightPercent<0) ) {
this.$message.warning("请正确填写高低价百分比");
return;
}
//已删除的无法修改
//拿到已删除的id
let statusId=0;
this.flightStatuslist.map((item) => {
// this.unitList 是你 select option遍历的集合 e 是选中的id
if (item.chineseName === "已删除") {
statusId=item.id;
return;
}
})
if (statusId === formdata.statusId) {
this.$message.warning("已删除的航班无法修改");
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
let formdata = JSON.parse(JSON.stringify(this.form));
//高价百分比和低价百分比和不可以大于100
if (
this.form.highLowPriceFlg &&
(formdata.highPriceWeightPercent > 100 ||
formdata.highPriceWeightPercent < 0)
) {
this.$message.warning("请正确填写高低价百分比");
return;
}
//已删除的无法修改
//拿到已删除的id
let statusId = 0;
this.flightStatuslist.map((item) => {
// this.unitList 是你 select option遍历的集合 e 是选中的id
if (item.chineseName === "已删除") {
statusId = item.id;
return;
}
//是否开启高地价
formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0;
//是否预审
formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
//处理数据
saveOrUpdate(formdata).then(response => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.open = false;
this.findAllFltData();
} else {
this.msgError(response.msg);
}
});
});
if (statusId === formdata.statusId) {
this.$message.warning("已删除的航班无法修改");
return;
}
});
},
// 表单重置
reset() {
this.form = {};
this.resetForm("form");
},
// 取消按钮
cancel() {
this.open = false;
this.findAllFltData();
this.reset();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.start = 0;
this.findAllFltData();
},
//批量开启/关闭航班
handleFlightStatus(status){
let handle = status == 'flightStatus80' ? '关闭' : '开启'
if (this.ids.length == 0){
this.msgError('请选择批量' + handle + '的航班')
return;
//是否开启高地价
formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0;
//是否预审
formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
//处理数据
saveOrUpdate(formdata).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.open = false;
this.findAllFltData();
} else {
this.msgError(response.msg);
}
});
}
let data = {};
data.status = status;
data.updateIds = this.ids;
updateStatusBatch(data).then(response => {
if (response.code === 200) {
this.msgSuccess( handle + "成功");
this.findAllFltData();
} else {
this.msgError(response.msg);
}
});
}
});
},
// 表单重置
reset() {
this.form = {};
this.resetForm("form");
},
// 取消按钮
cancel() {
this.open = false;
this.findAllFltData();
this.reset();
},
}
};
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.start = 0;
this.findAllFltData();
},
//批量开启/关闭航班
handleFlightStatus(status) {
let handle = status == "flightStatus80" ? "关闭" : "开启";
if (this.ids.length == 0) {
this.msgError("请选择批量" + handle + "的航班");
return;
}
let data = {};
data.status = status;
data.updateIds = this.ids;
updateStatusBatch(data).then((response) => {
if (response.code === 200) {
this.msgSuccess(handle + "成功");
this.findAllFltData();
} else {
this.msgError(response.msg);
}
});
},
},
};
</script>
<style>
.el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
.el-table__body tr.current-row>td {
background-color: #a0cfff;
}
.el-table--striped .el-table__body tr.hover-row.el-table__row--striped>td,
.el-table__body tr.hover-row>td {
background-color: #d9ecff !important;
}
.el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
.el-table__body tr.current-row > td {
background-color: #a0cfff;
}
.el-table--striped .el-table__body tr.hover-row.el-table__row--striped > td,
.el-table__body tr.hover-row > td {
background-color: #d9ecff !important;
}
</style>
......
......@@ -19,13 +19,14 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="配载航班号">
<el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :autosize="true"></el-input>
<el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :autosize="true" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
......@@ -55,6 +56,7 @@
class="formItem"
placeholder="请输入运单号(回车间隔)"
:autosize="true"
clearable
></el-input>
</el-form-item>
</el-col>
......@@ -103,6 +105,7 @@
class="formItem"
placeholder="S_;P_;E2"
:autosize="true"
clearable
></el-input>
</el-form-item>
</el-col>
......@@ -114,6 +117,7 @@
class="formItem"
placeholder="PVG;PEK"
:autosize="true"
clearable
></el-input>
</el-form-item>
</el-col>
......@@ -129,13 +133,14 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="ACCS原航班号">
<el-input type="text" v-model="fltNo" class="formItem" placeholder="请输入ACCS航班号"></el-input>
<el-input type="text" v-model="fltNo" class="formItem" placeholder="请输入ACCS航班号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
......@@ -146,6 +151,7 @@
type="date"
placeholder="选择日期"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
......@@ -160,6 +166,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
:value-format="valueFormat"
clearable
>
</el-date-picker>
</el-form-item>
......@@ -295,7 +302,8 @@ export default {
width: "50",
align: "center",
sorTable: false,
fixed:true,
fixed: true,
disabled:true
},
{
type: "index",
......@@ -304,97 +312,108 @@ export default {
width: "50",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "口岸代码",
value: "portName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "取件日期",
value: "pickUpDate",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "取件扫描号",
value: "pickUpScanNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "站点",
value: "siteName",
width: "150",
width: "80",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "运单号",
value: "waybillNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "总单号",
value: "totalWaybillNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "服务类型",
value: "serviceTypeName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "服务代码",
value: "serviceCode",
width: "150",
width: "100",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "URSA",
value: "ursa",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "申报类型",
value: "typeName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -403,34 +422,38 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "subcategory",
value: "subCategory",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "件数",
value: "qty",
width: "150",
width: "80",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "实际重量",
value: "actualWeight",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -439,79 +462,88 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "品名描述",
value: "nameDescription",
width: "150",
width: "100",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "海关回执状态",
value: "customsReceiptStatusName",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "预审状态",
value: "preQualificationStatus",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "航班预审意见",
value: "caPretrialOpinion",
width: "150",
width: "120",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "货物状态",
value: "statusName",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "终配航班号",
value: "finalFlightNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "终配航班日期",
value: "finalFlightTime",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "二配航班号",
value: "twoMatchFlightNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -520,16 +552,18 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "预配航班号",
value: "preplanFlightNo",
width: "150",
width: "120",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -538,7 +572,8 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -547,7 +582,8 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -556,16 +592,18 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "ACCS原航线",
value: "accsFlightRoute",
width: "150",
width: "140",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -574,25 +612,28 @@ export default {
width: "170",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "是否自动",
value: "cargoRulesStatus",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "发件人账号",
value: "shipperAccount",
width: "150",
width: "120",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -601,52 +642,58 @@ export default {
width: "150",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "始发地城市名称",
value: "originCity",
width: "150",
width: "130",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "收件地",
value: "destinationSiteName",
width: "150",
width: "90",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "尺寸",
value: "sizeStr",
width: "150",
width: "80",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "大货预审意见(是否可以配置航班)",
value: "bigPretrialOpinion",
width: "300",
width: "250",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "大货预审时间",
value: "bigPretrialTime",
width: "150",
width: "120",
align: "center",
sorTable: false,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -655,7 +702,8 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
......@@ -664,25 +712,28 @@ export default {
width: "150",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "创建人",
value: "createUserName",
width: "150",
width: "90",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
{
type: "",
name: "创建时间",
value: "createTime",
width: "150",
width: "100",
align: "center",
sorTable: true,
fixed:false,
fixed: false,
disabled:true
},
], //表头数据
findConditionData: {}, //货物查询条件
......@@ -706,7 +757,7 @@ export default {
limitSize: 100, //无限制-1
page:1,
progress:0,
formShow:false,
formShow:true,
};
},
created() {
......@@ -723,19 +774,6 @@ export default {
});
},
// activated(){
// findConditionData().then((res) => {
// if (res.code == 200) {
// this.findConditionData = res.data;
// } else {
// this.$message({
// message: "查询条件不存在",
// type: "warning",
// });
// }
// });
// },
mounted() {
window.addEventListener("keydown", (code) => {
if (code.keyCode === 16 && code.shiftKey) {
......
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<h3 class="title">IMAC后台管理系统</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="password">
......@@ -15,17 +29,20 @@
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> -->
<el-form-item style="width:100%;marginTop:44px">
<el-form-item style="width: 100%; marginTop: 44px">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading">登 录</span>
......@@ -43,7 +60,7 @@
<script>
import { getCodeImg } from "@/api/login";
//import Cookies from "js-cookie";
import { encrypt, } from '@/utils/jsencrypt'
import { encrypt } from "@/utils/jsencrypt";
export default {
name: "Login",
......@@ -54,18 +71,18 @@ export default {
loginForm: {
username: "root",
password: "123",
rememberMe: false
rememberMe: false,
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "用户名不能为空" }
{ required: true, trigger: "blur", message: "用户名不能为空" },
],
password: [
{ required: true, trigger: "blur", message: "密码不能为空" }
]
{ required: true, trigger: "blur", message: "密码不能为空" },
],
},
loading: false,
redirect: undefined
redirect: undefined,
};
},
watch: {
......@@ -75,46 +92,53 @@ export default {
},
immediate: true
}
},
},
created() {
this.getCookie();
},
methods: {
getCookie() {
const username = localStorage.getItem("username");
const password = localStorage.getItem("password");
const rememberMe = localStorage.getItem('rememberMe')
const rememberMe = localStorage.getItem("rememberMe");
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : password,
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
localStorage.setItem("username", this.loginForm.username, { expires: 30 });
localStorage.setItem("password", this.loginForm.password, { expires: 30 });
localStorage.setItem('rememberMe', this.loginForm.rememberMe, { expires: 30 });
localStorage.setItem("username", this.loginForm.username, {
expires: 30,
});
localStorage.setItem("password", this.loginForm.password, {
expires: 30,
});
localStorage.setItem("rememberMe", this.loginForm.rememberMe, {
expires: 30,
});
} else {
localStorage.removeItem("username");
localStorage.removeItem("password");
localStorage.removeItem('rememberMe');
localStorage.removeItem("rememberMe");
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
//this.getCode();
});
this.$store
.dispatch("Login", this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
})
.catch(() => {
this.loading = false;
//this.getCode();
});
}
});
}
}
},
},
};
</script>
......
<template>
<div></div>
</template>
<script>
export default {
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div></div>
</template>
<script>
export default {
}
</script>
<style>
</style>
\ No newline at end of file