jinhui.wang

version:0.5.7,件数重量输入限制,页面缓存,数值精度修改,代码优化,bug修复

......@@ -15,13 +15,18 @@
:lazy="lazy"
:downShiftKey="shiftKey"
:limitStart="limitStart"
:row-key="rowKey"
:default-expand-all="defaultExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
v-loading="loading"
@sort-change="sortChange"
@select="tableSelect"
@select-all="tableSelectAll"
@select-change="SelectChange"
>
<el-table-column
v-for="(item, index) in newHeader"
v-for="(item, index) in headerData"
:column-key="item.value"
:type="item.type"
:prop="item.value"
:label="item.name"
......@@ -32,12 +37,13 @@
:sortable="item.sorTable"
:formatter="formatter"
header-align="center"
:sort-orders="['descending', 'ascending', null]"
:slotHeader="slotHeader"
:key="index"
>
<template v-if="item.slot" slot-scope="">
<!-- <template v-if="item.slot" slot-scope="">
<Item :dom="item.slot" @change="itemChange"></Item>
</template>
</template> -->
</el-table-column>
<slot></slot>
</el-table>
......@@ -64,8 +70,8 @@
<script>
// import infoTable from "./info.vue";
import Item from "./item.vue";
import dictLabels from "../../assets/languages/dictLabels.js"
import { scrollTo } from '@/utils/scroll-to'
import dictLabels from "../../assets/languages/dictLabels.js";
import { scrollTo } from "@/utils/scroll-to";
export default {
name: "Table",
components: {
......@@ -136,9 +142,9 @@ export default {
type: Boolean,
default: true,
},
shiftKey:{
type:Boolean,
default:false,
shiftKey: {
type: Boolean,
default: false,
},
page: {
type: Number,
......@@ -148,9 +154,9 @@ export default {
type: Number,
default: 20,
},
limitStart:{
type:Number,
default:0,
limitStart: {
type: Number,
default: 0,
},
paginationBackground: {
type: Boolean,
......@@ -164,6 +170,14 @@ export default {
type: Number,
default: 0,
},
rowKey: {
type: String,
default: "",
},
defaultExpandAll: {
type: Boolean,
default: false,
},
},
inheritAttrs: false,
data() {
......@@ -171,7 +185,7 @@ export default {
newHeader: [],
selectTable: [],
pageNum: 1,
start:-1,
start: -1,
// {
// type: "selection",
// name: "",
......@@ -187,20 +201,28 @@ export default {
created() {
this.newHeader = this.headerData;
},
mounted() {
},
mounted() {},
methods: {
nextClick() {
this.$emit('currentChange',{page:this.pageNum + 1,start:this.limitStart + this.limitSize})
scrollTo(0,800);
this.$emit("currentChange", {
page: this.pageNum + 1,
start: this.limitStart + this.limitSize,
});
scrollTo(0, 800);
},
prevClick() {
this.$emit('currentChange',{page:this.pageNum - 1,start:this.limitStart - this.limitSiz})
scrollTo(0,800);
this.$emit("currentChange", {
page: this.pageNum - 1,
start: this.limitStart - this.limitSiz,
});
scrollTo(0, 800);
},
currentChange(val) {
this.$emit('currentChange',{page:val,start: val*this.limitSize+1});
scrollTo(0,800);
this.$emit("currentChange", {
page: val,
start: val * this.limitSize + 1,
});
scrollTo(0, 800);
},
tableSelect(selection, row) {
let end = row.index;
......@@ -208,20 +230,17 @@ export default {
const sum = Math.abs(this.start - end);
const min = Math.min(this.start, end);
let i;
if (
this.start === -1 &&
selection.includes(this.data[row.index])
) {
if (this.start === -1 && selection.includes(this.data[row.index])) {
for (i = 0; i < sum; i++) {
this.$refs.tables.toggleRowSelection(this.data[i], true);
this.selectTable.push(this.data[i]);
}
} else if (selection.includes(this.data[row.index])) {
if(!selection.includes(this.data[this.start])){
if (!selection.includes(this.data[this.start])) {
this.$refs.tables.toggleRowSelection(this.data[this.start], true);
this.selectTable.push(this.data[this.start]);
}
for (i = this.start+1; i <= this.start+sum; i++) {
for (i = this.start + 1; i <= this.start + sum; i++) {
this.$refs.tables.toggleRowSelection(this.data[i], true);
this.selectTable.push(this.data[i]);
}
......@@ -244,7 +263,7 @@ export default {
}
}
}
selection = this.selectTable
selection = this.selectTable;
this.$emit("tableSelect", { selection, row });
},
tableSelectAll(selection) {
......@@ -253,13 +272,13 @@ export default {
SelectChange(selection) {
this.$emit("SelectChange", selection);
},
clearTable(){
this.selectTable = []
this.$refs.tables.clearSelection()
},
itemChange(val) {
console.log(val)
clearTable() {
this.selectTable = [];
this.$refs.tables.clearSelection();
},
// itemChange(val) {
// console.log(val);
// },
// checkChange(val) {
// console.log(val);
// },
......@@ -269,9 +288,28 @@ export default {
// bottom(val) {
// console.log(val);
// },
sortChange({ column, prop, order }) {
this.$emit("sortChange",{prop:prop, order:order})
},
compare(propertyName, sort) {
return function (obj1, obj2) {
var value1 = obj1[propertyName];
var value2 = obj2[propertyName];
if (typeof value1 === "string" && typeof value2 === "string") {
const res = value1.localeCompare(value2, "zh");
return sort === "ascending" ? res : -res;
} else {
if (value1 <= value2) {
return sort === "ascending" ? -1 : 1;
} else if (value1 > value2) {
return sort === "ascending" ? 1 : -1;
}
}
};
},
formatter(row, column, cellValue, index) {
if(dictLabels[column.property]){
if(dictLabels[column.property][cellValue]){
if (dictLabels[column.property]) {
if (dictLabels[column.property][cellValue]) {
return dictLabels[column.property][cellValue];
}
}
......
......@@ -42,5 +42,5 @@ module.exports = {
/**
* 版本号
*/
version:'version:0.5.6'
version:'version:0.5.7'
}
......
......@@ -177,6 +177,6 @@ export function handleTree(data, id, parentId, children) {
//字符串英文转大写,;转英文;
export function upCase(str){
let newStr = str.replace(/;/g,";").toUpperCase();
let newStr = str.replace(/;/g,";").toUpperCase().trim();
return newStr;
}
\ No newline at end of file
......
import axios from 'axios'
import { Message,MessageBox } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
import { getToken,setToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
......@@ -9,9 +9,9 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
//baseURL: process.env.VUE_APP_BASE_API,
// baseURL: `http://47.103.140.98:7001/IMAC2`,
// baseURL: `http://47.103.140.98:7001/iMAC`,
baseURL: 'https://imacuat.zmd.apac.fedex.com/iMAC',
// baseURL: 'http://192.168.1.133:7001/IMAC2',
// baseURL: 'http://192.168.1.133:7001/iMAC',
// 超时
timeout: 30000,
......@@ -53,6 +53,9 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
if(res.headers['token']){
setToken(decodeURI(res.headers['token']))
}
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 获取错误信息
......
......@@ -6,8 +6,8 @@ const mimeMap = {
zip: 'application/zip'
}
const baseUrl = 'https://imacuat.zmd.apac.fedex.com/iMAC' //uat服务器
// const baseUrl = 'http://47.103.140.98:7001/IMAC2' //阿里云服务器
// const baseUrl = 'http://192.168.1.133:7001/IMAC2' //测试服务器
// const baseUrl = 'http://47.103.140.98:7001/iMAC' //阿里云服务器
// const baseUrl = 'http://192.168.1.133:7001/iMAC' //测试服务器
export function downLoadZip(str, filename) {
var url = baseUrl + str
......
......@@ -3,7 +3,6 @@
<el-form
ref="form"
v-model="formData"
v-show="formShow"
class="form-header"
label-position="right"
label-width="auto"
......@@ -35,6 +34,26 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="海关回执状态">
<el-select
placeholder="不限"
v-model="formData.customsReceiptStatusId"
class="formItem"
multiple
clearable
>
<el-option
v-for="item in selectData.findConditionData
.cargoCustomsReturnStatus"
:label="item.chineseName"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="货物状态">
<el-select
placeholder="不限"
......@@ -58,7 +77,7 @@
class="formItem"
type="textarea"
placeholder="请输入运单号(回车分割)"
v-model="formData.waybillNo"
v-model.trim="formData.waybillNo"
rows="1"
></el-input>
</el-form-item>
......@@ -208,26 +227,6 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="海关回执状态">
<el-select
placeholder="不限"
v-model="formData.customsReceiptStatusId"
class="formItem"
multiple
clearable
>
<el-option
v-for="item in selectData.findConditionData
.cargoCustomsReturnStatus"
:label="item.chineseName"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="Handling Code">
<el-empty
......@@ -316,6 +315,7 @@
@tableSelect="tableSelect"
@tableSelectAll="tableSelectAll"
@currentChange="currentChange"
@sortChange="sortChange"
></Tables>
<Dialog
:tableData="tableSelection"
......@@ -334,6 +334,7 @@ import { downLoadXlsx } from "@/utils/zipdownload";
import { upCase } from "@/utils/FedEx";
export default {
name:"CargoAllocation",
components: {
Dialog,
},
......@@ -815,7 +816,6 @@ export default {
shiftKey: false,
createDate: null,
loading: false,
formShow:true,
downLoadingTip: {
tip: "",
downloading: false,
......@@ -868,11 +868,6 @@ export default {
});
},
mounted() {
// this.selectData.HandlingCode.forEach((item,index)=>{
// if(item.id === 108093){
// this.selectData.HandlingCode.unshift(this.HandlingCode.splice(index,1)[0])
// }
// })
window.addEventListener("keydown", (code) => {
if (code.keyCode === 16 && code.shiftKey) {
this.shiftKey = true;
......@@ -885,6 +880,7 @@ export default {
});
},
methods: {
//查询
select() {
this.loading = true;
this.dataInfo();
......@@ -915,6 +911,7 @@ export default {
this.loading = false;
});
},
//总和
cargoTotal() {
this.allWeight = 0;
this.allQty = 0;
......@@ -923,10 +920,11 @@ export default {
this.allWeight = this.allWeight + item.actualWeight;
this.allQty = this.allQty + item.qty;
});
this.allWeight = this.allWeight.toFixed();
this.allWeight = this.allWeight.toFixed(2);
this.allQty = this.allQty.toFixed();
}
},
//数据初始化
dataInfo() {
this.formData.ursaList = null;
this.formData.siteNameList = null;
......@@ -972,6 +970,7 @@ export default {
this.formData.page = this.page;
this.formData.size = this.size;
},
//导出表格
xlsx(val) {
this.downLoadingTip.downloading = true;
this.dataInfo();
......@@ -999,19 +998,27 @@ export default {
});
}
},
//表格选择
tableSelect(val) {
this.tableSelection = val.selection;
this.cargoTotal();
},
//表格全选
tableSelectAll(val) {
this.tableSelection = val;
this.cargoTotal();
},
//分页
currentChange(val) {
this.formData.limitStart = val.start;
this.page = val.page;
this.select();
},
//排序
sortChange(val){
this.tableData.sort(this.$refs.newTables.compare(val.prop,val.order));
},
//添加到航班
addFit() {
let open = true;
this.tableSelection.forEach((item) => {
......@@ -1031,6 +1038,7 @@ export default {
this.$refs.newTables.clearTable();
}
},
//关闭弹框
dialogBeforeClose(val) {
this.dialogVisible = val.close;
if (val.reload) {
......
......@@ -127,6 +127,7 @@ import {
import { parseTime } from "@/utils/FedEx";
export default {
name:"FlightAllocConfig",
data() {
return {
queryParams: {
......
......@@ -110,23 +110,24 @@
<el-form-item label="件数">
<el-col :span="3">
<!-- <el-input v-model="form.minNumOfPieces"></el-input> -->
<el-input-number
v-model="
form.minNumOfPieces == 0
? (form.minNumOfPieces = undefined)
: form.minNumOfPieces
"
<el-input
class="numberInput"
v-model.trim="minNumOfPieces"
></el-input>
<!-- <el-input-number
v-model="minNumOfPieces"
:precision="0"
:controls="false"
style="width: 100%"
:min="1"
></el-input-number>
></el-input-number> -->
</el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="3">
<!-- <el-input v-model="form.maxNumOfPieces"></el-input> -->
<el-input-number
<el-input
class="numberInput"
v-model.trim="maxNumOfPieces"
></el-input>
<!-- <el-input-number
v-model="
form.maxNumOfPieces == 0
? (form.maxNumOfPieces = undefined)
......@@ -135,15 +136,14 @@
:precision="0"
:controls="false"
style="width: 100%"
:min="form.minNumOfPieces"
></el-input-number>
></el-input-number> -->
</el-col>
</el-form-item>
<el-form-item label="重量">
<el-col :span="3">
<!-- <el-input v-model="form.minWeight"></el-input> -->
<el-input-number
<el-input class="numberInput" v-model.trim="minWeight"></el-input>
<!-- <el-input-number
v-model="
form.minWeight == 0
? (form.minWeight = undefined)
......@@ -152,14 +152,13 @@
:precision="2"
:controls="false"
style="width: 100%"
:min="0.01"
></el-input-number>
></el-input-number> -->
</el-col>
<el-col :span="1" style="text-align: center"><span>Kg</span></el-col>
<el-col style="text-align: center" :span="1">-</el-col>
<el-col :span="3">
<!-- <el-input v-model="form.maxWeight"></el-input> -->
<el-input-number
<el-input class="numberInput" v-model.trim="maxWeight"></el-input>
<!-- <el-input-number
v-model="
form.maxWeight == 0
? (form.maxWeight = undefined)
......@@ -168,8 +167,7 @@
:precision="2"
:controls="false"
style="width: 100%"
:min="form.minWeight"
></el-input-number>
></el-input-number> -->
</el-col>
<el-col :span="1" style="text-align: center"><span>Kg</span></el-col>
</el-form-item>
......@@ -282,6 +280,10 @@ export default {
data() {
return {
form: {
minNumOfPieces: undefined,
maxNumOfPieces: undefined,
minWeight: undefined,
maxWeight: undefined,
typeOfGoods: [],
declarationCategory: [],
serviceCode: [],
......@@ -497,10 +499,10 @@ export default {
? info.subCategory.split(";")
: [];
this.form = info;
if (info.location != null || info.location == "") {
this.isLocation = "1";
} else {
if (info.notLocation != null || info.notLocation == "") {
this.isLocation = "2";
} else {
this.isLocation = "1";
}
this.isNeedRequired = info.isNeedRequired;
}
......@@ -534,10 +536,10 @@ export default {
? info.subCategory.split(";")
: [];
this.form = info;
if (info.location != null || info.location == "") {
this.isLocation = "1";
} else {
if (info.notLocation != null || info.notLocation == "") {
this.isLocation = "2";
} else {
this.isLocation = "1";
}
let isNeedRequired = response.data.isNeedRequired;
this.form.isNeedRequired = isNeedRequired;
......@@ -550,6 +552,56 @@ export default {
this.loading = false;
}
},
computed: {
minNumOfPieces: {
get: function () {
return this.form.minNumOfPieces;
},
set: function (val) {
if (val == 0 || val == null || val == "-") {
this.form.minNumOfPieces = undefined;
} else if (!isNaN(val)) {
this.form.minNumOfPieces = val;
}
},
},
maxNumOfPieces: {
get: function () {
return this.form.maxNumOfPieces;
},
set: function (val) {
if (val == 0 || val == null || val == "-") {
this.form.maxNumOfPieces = undefined;
} else if (!isNaN(val)) {
this.form.maxNumOfPieces = val;
}
},
},
minWeight: {
get: function () {
return this.form.minWeight;
},
set: function (val) {
if (val == 0 || val == null || val == "-") {
this.form.minWeight = undefined;
} else if (!isNaN(val)) {
this.form.minWeight = val;
}
},
},
maxWeight: {
get: function () {
return this.form.maxWeight;
},
set: function (val) {
if (val == 0 || val == null || val == "-") {
this.form.maxWeight = undefined;
} else if (!isNaN(val)) {
this.form.maxWeight = val;
}
},
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
......@@ -578,4 +630,9 @@ export default {
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
border-color: #606266;
}
.numberInput {
input {
text-align: center;
}
}
</style>
......
......@@ -150,7 +150,7 @@
findSourceFlightAndFlightDateApi
} from "@/api/sourceFlightRules";
export default {
name: "SourceFlightRules",
name: "FlightRandConfig",
data() {
return {
// data 中设定
......
......@@ -44,6 +44,7 @@
importcaPreReview,
} from "@/api/caPreReviewImport";
export default {
name:"CAPreReviewImport",
data() {
return {
// 遮罩层
......
......@@ -73,6 +73,7 @@ import {
importFlight,
} from "@/api/flightInfoImport";
export default {
name:"FlightInformationImport",
data() {
return {
flightType: [],
......
......@@ -277,7 +277,7 @@
} from "@/api/findAllFltData";
export default {
name: "findAllFltData",
name: "FlightInformationMaintenance",
data() {
return {
//高价百分比是否打开
......
......@@ -35,7 +35,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `https://imacuat.zmd.apac.fedex.com/iMAC`,
// target: `http://47.103.140.98:7001/IMAC2`,
// target: `http://47.103.140.98:7001/iMAC`,
// target: `http://192.168.1.134:18080`,
changeOrigin: true,
pathRewrite: {
......