Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
jinhui.wang
2022-02-21 18:14:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6b95241603277aff634bb0db1de83bb76aa784f7
6b952416
1 parent
9d2f21a8
version:0.5.7,件数重量输入限制,页面缓存,数值精度修改,代码优化,bug修复
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
378 additions
and
216 deletions
src/components/Table/index.vue
src/settings.js
src/utils/FedEx.js
src/utils/request.js
src/utils/zipdownload.js
src/views/allocationConfig/cargoAllocation/index.vue
src/views/allocationConfig/flightAllocConfig/index.vue
src/views/allocationConfig/flightAllocConfig/info.vue
src/views/allocationConfig/flightRandConfig/index.vue
src/views/basicInformation/caPreReviewImport/index.vue
src/views/basicInformation/flightInformationImport/index.vue
src/views/basicInformation/flightInformationMaintenance/index.vue
src/views/basicInformation/queryCargo/index.vue
vue.config.js
src/components/Table/index.vue
View file @
6b95241
...
...
@@ -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];
}
}
...
...
src/settings.js
View file @
6b95241
...
...
@@ -42,5 +42,5 @@ module.exports = {
/**
* 版本号
*/
version
:
'version:0.5.
6
'
version
:
'version:0.5.
7
'
}
...
...
src/utils/FedEx.js
View file @
6b95241
...
...
@@ -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
...
...
src/utils/request.js
View file @
6b95241
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
;
// 获取错误信息
...
...
src/utils/zipdownload.js
View file @
6b95241
...
...
@@ -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
...
...
src/views/allocationConfig/cargoAllocation/index.vue
View file @
6b95241
...
...
@@ -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) {
...
...
src/views/allocationConfig/flightAllocConfig/index.vue
View file @
6b95241
...
...
@@ -127,6 +127,7 @@ import {
import { parseTime } from "@/utils/FedEx";
export default {
name:"FlightAllocConfig",
data() {
return {
queryParams: {
...
...
src/views/allocationConfig/flightAllocConfig/info.vue
View file @
6b95241
...
...
@@ -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>
...
...
src/views/allocationConfig/flightRandConfig/index.vue
View file @
6b95241
...
...
@@ -150,7 +150,7 @@
findSourceFlightAndFlightDateApi
} from "@/api/sourceFlightRules";
export default {
name: "
SourceFlightRules
",
name: "
FlightRandConfig
",
data() {
return {
// data 中设定
...
...
src/views/basicInformation/caPreReviewImport/index.vue
View file @
6b95241
...
...
@@ -44,6 +44,7 @@
importcaPreReview,
} from "@/api/caPreReviewImport";
export default {
name:"CAPreReviewImport",
data() {
return {
// 遮罩层
...
...
src/views/basicInformation/flightInformationImport/index.vue
View file @
6b95241
...
...
@@ -73,6 +73,7 @@ import {
importFlight,
} from "@/api/flightInfoImport";
export default {
name:"FlightInformationImport",
data() {
return {
flightType: [],
...
...
src/views/basicInformation/flightInformationMaintenance/index.vue
View file @
6b95241
...
...
@@ -277,7 +277,7 @@
} from "@/api/findAllFltData";
export default {
name: "
findAllFltData
",
name: "
FlightInformationMaintenance
",
data() {
return {
//高价百分比是否打开
...
...
src/views/basicInformation/queryCargo/index.vue
View file @
6b95241
...
...
@@ -9,7 +9,7 @@
label-width="auto"
style="margin: 10px; width: 100%"
>
<el-row type="flex" style="flexWrap: wrap!important">
<el-row type="flex" style="flexWrap: wrap
!important">
<el-col :span="6">
<el-form-item label="配舱航班日期:">
<el-date-picker
...
...
@@ -26,7 +26,13 @@
</el-col>
<el-col :span="6">
<el-form-item label="配载航班号:">
<el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" rows="1"></el-input>
<el-input
type="textarea"
v-model="cargoPlaneNo"
class="formItem"
placeholder="AC001;AC002"
rows="1"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
...
...
@@ -52,7 +58,7 @@
<el-form-item label="运单号:">
<el-input
type="textarea"
v-model="formData.waybillNo"
v-model
.trim
="formData.waybillNo"
class="formItem"
placeholder="请输入运单号(回车间隔)"
rows="1"
...
...
@@ -118,13 +124,8 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-collapse>
<el-collapse-item>
<template slot="title">
<span style="fontWeight:900;color:#409EFF;fontSize:14px"><i class="el-icon-s-tools"></i>更多查询条件</span>
</template>
<el-row type="flex" style="flexWrap: wrap!important">
<el-col :span="24" v-show="formShow">
<el-row type="flex" style="flexWrap: wrap !important">
<el-col :span="6">
<el-form-item label="ACCS原航班日期:">
<el-date-picker
...
...
@@ -141,7 +142,12 @@
</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航班号"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
...
...
@@ -196,25 +202,15 @@
class="formItem"
clearable
>
<el-option
label="手动"
value="1"
>
</el-option>
<el-option
label="自动"
value="2"
>
</el-option>
<el-option label="手动" value="1"> </el-option>
<el-option label="自动" value="2"> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-collapse-item>
</el-collapse>
</el-col>
</el-row>
<div style="paddingLeft: 10px;
marginTop:
20px">
<div style="paddingLeft: 10px;
marginTop:
20px">
<el-button
type="primary"
icon="el-icon-search"
...
...
@@ -226,31 +222,62 @@
<!-- <el-button type="primary" size="small" @click="checks(tableData)"
>全选/全否</el-button
> -->
<el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(0)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading"
>{{downLoadingTip.downloading?downLoadingTip.tip:"导出本页查询结果"}}</el-button
<el-button
:type="downLoadingTip.downloading ? 'warning' : 'primary'"
size="small"
@click="xlse(0)"
:disabled="tableData.length == 0"
:loading="downLoadingTip.downloading"
>{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出本页查询结果"
}}</el-button
>
<el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(1)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading"
>{{downLoadingTip.downloading?downLoadingTip.tip:"导出全部查询结果"}}</el-button
<el-button
:type="downLoadingTip.downloading ? 'warning' : 'primary'"
size="small"
@click="xlse(1)"
:disabled="tableData.length == 0"
:loading="downLoadingTip.downloading"
>{{
downLoadingTip.downloading ? downLoadingTip.tip : "导出全部查询结果"
}}</el-button
>
<span style="marginLeft:20px;color:#ffba00">全部导出上限80000条数据</span>
<el-progress v-if="progress!=0" class="progress" :stroke-width="12" :show-text="true" :percentage="progress" :status="progress == 100?'success':'warning'"></el-progress>
<span style="marginLeft: 20px; color: #ffba00"
>全部导出上限80000条数据</span
>
<el-progress
v-if="progress != 0"
class="progress"
:stroke-width="12"
:show-text="true"
:percentage="progress"
:status="progress == 100 ? 'success' : 'warning'"
></el-progress>
<div class="tips">
<span style="paddingRight: 50px">总重量:{{ allWeight }}</span>
<span>总件数:{{ allQty }}</span>
</div>
<div class="formShow" @click="formShow = !formShow">
<i class="el-icon-s-tools"></i
>{{ formShow ? "收起条件" : "更多条件" }}
</div>
</div>
</el-form>
<el-table
ref="cargoTable"
:data="tableData"
v-loading="tableLoading"
highlight-current-row border stripe
highlight-current-row
border
stripe
height="430"
size="mini"
@select="cheacked"
@select-all="selectAll"
@sort-change="sortChange"
>
<el-table-column type="selection" width="55" fixed align="center"> </el-table-column>
<el-table-column type="selection" width="55" fixed align="center">
</el-table-column>
<el-table-column type="index" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
...
...
@@ -262,7 +289,7 @@
header-align="center"
align="center"
:show-overflow-tooltip="true"
:width="item.value
=='bigPretrialOpinion'?'300':
'170'"
:width="item.value
== 'bigPretrialOpinion' ? '300' :
'170'"
:formatter="formatter"
sortable
>
...
...
@@ -284,10 +311,10 @@
<script>
import { findConditionData, findCargoData } from "@/api/cargoSelect";
import { downLoadXlsx } from "@/utils/zipdownload";
import { upCase } from "@/utils/FedEx"
import { upCase } from "@/utils/FedEx"
;
export default {
name:
"q
ueryCargo",
name:
"Q
ueryCargo",
data() {
return {
formData: {
...
...
@@ -312,9 +339,9 @@ export default {
dataSources: "",
customsReceiptStatusId: null,
big: null,
cargoPlaneNo:null,
cargoPlaneStart:null,
cargoPlaneEnd:null,
cargoPlaneNo:
null,
cargoPlaneStart:
null,
cargoPlaneEnd:
null,
}, //表单数据
tableHeader: [
{ name: "口岸代码", value: "portName" },
...
...
@@ -370,20 +397,20 @@ export default {
start: -1,
valueFormat: "yyyy-MM-dd",
tableLoading: false,
downLoadingTip:{
tip:"",
downloading:false,
downLoadingTip:
{
tip:
"",
downloading:
false,
},
totalCount: 0,
selectTable: [],
flightTime: [],
prepalyFlightTime: [],
cargoPlaneTime:[],
cargoPlaneTime:
[],
createDate: [],
limitStart:
0
,
limitStart:
1
,
limitSize: 100, //无限制-1
progress:0,
selecetALL:false,
progress:
0,
selecetALL:
false,
};
},
...
...
@@ -423,42 +450,46 @@ export default {
this.tableData = [];
this.allWeight = 0;
this.allQty = 0;
this.checks()
this.checks()
;
this.tableLoading = true;
if(this.formData.customsReceiptStatusId != null && this.formData.customsReceiptStatusId.length < 1){
if (
this.formData.customsReceiptStatusId != null &&
this.formData.customsReceiptStatusId.length < 1
) {
this.formData.customsReceiptStatusId = null;
}
if (this.createDate != null && this.createDate.length > 0) {
this.formData.createTimeStart = this.createDate[0];
this.formData.createTimeEnd = this.createDate[1];
}
else
{
}
else
{
this.formData.createTimeStart = null;
this.formData.createTimeEnd = null;
}
if (this.prepalyFlightTime != null && this.prepalyFlightTime.length > 0) {
this.formData.prematchFltDateStart = this.prepalyFlightTime[0];
this.formData.prematchFltDateEnd = this.prepalyFlightTime[1];
}
else
{
this.formData.prematchFltDateStart ="";
}
else
{
this.formData.prematchFltDateStart =
"";
this.formData.prematchFltDateEnd = "";
}
if (this.flightTime != null && this.flightTime.length > 0) {
this.formData.fltDateStart = this.flightTime[0];
this.formData.fltDateEnd = this.flightTime[1];
}
else
{
}
else
{
this.formData.fltDateStart = "";
this.formData.fltDateEnd = "";
}
if
(this.cargoPlaneTime != null && this.cargoPlaneTime.length > 0)
{
if
(this.cargoPlaneTime != null && this.cargoPlaneTime.length > 0)
{
this.formData.cargoPlaneStart = this.cargoPlaneTime[0];
this.formData.cargoPlaneEnd = this.cargoPlaneTime[1];
}
else
{
}
else
{
this.formData.cargoPlaneStart = null;
this.formData.cargoPlaneEnd = null;
}
this.formData.limitStart = this.limitStart;
this.formData.limitSize = this.limitSize;
findCargoData(this.formData).then((res) => {
findCargoData(this.formData)
.then((res) => {
if (res.code == 200) {
if (res.data.list.length > 0) {
this.tableData = res.data.list;
...
...
@@ -479,7 +510,8 @@ export default {
});
}
this.tableLoading = false;
}).catch(()=>{
})
.catch(() => {
this.tableLoading = false;
});
},
...
...
@@ -501,19 +533,18 @@ export default {
this.selecetALL = false;
}
},
selectAll(selection){
if
(selection.length > 0)
{
selection.forEach(
item
=> {
selectAll(selection)
{
if
(selection.length > 0)
{
selection.forEach(
(item)
=> {
this.allWeight = item.actualWeight + this.allWeight;
this.allQty = item.qty + this.allQty;
})
})
;
this.allWeight = this.allWeight.toFixed(1);
this.allQty = this.allQty.toFixed(0);
}
else
{
}
else
{
this.allWeight = 0;
this.allQty = 0;
}
},
//下一页
nextClick() {
...
...
@@ -531,35 +562,35 @@ export default {
//表单项选中操作
cheacked(sl, row) {
let end = row.index;
if
(this.shiftKey)
{
if
(this.shiftKey)
{
const sum = Math.abs(this.start - end);
const min = Math.min(this.start, end);
let i
;
if
(this.start === -1 && sl.includes(this.tableData[row.index]))
{
for
(i=0; i < sum; i++)
{
let i;
if
(this.start === -1 && sl.includes(this.tableData[row.index]))
{
for
(i = 0; i < sum; i++)
{
this.$refs.cargoTable.toggleRowSelection(this.tableData[i], true);
this.selectTable.push(this.tableData[i]);
}
}
else if(sl.includes(this.tableData[row.index]))
{
for
(i = this.start+1; i <= end; i++)
{
}
else if (sl.includes(this.tableData[row.index]))
{
for
(i = this.start + 1; i <= end; i++)
{
this.$refs.cargoTable.toggleRowSelection(this.tableData[i], true);
this.selectTable.push(this.tableData[i]);
}
}
else if(!sl.includes(this.tableData[row.index]))
{
this.selectTable.splice(end
-1,
sum + 1);
for
(i = end ; i <= this.start ; i++)
{
}
else if (!sl.includes(this.tableData[row.index]))
{
this.selectTable.splice(end
- 1,
sum + 1);
for
(i = end; i <= this.start; i++)
{
this.$refs.cargoTable.toggleRowSelection(this.tableData[i], false);
}
}
this.start = end;
}
else
{
}
else
{
this.start = end;
if
(sl.includes(this.tableData[end]))
{
if
(sl.includes(this.tableData[end]))
{
this.selectTable.push(row);
}
else
{
for
(let i =0; i <this.selectTable.length; i++)
{
if
(this.selectTable[i].index == row.index)
{
this.selectTable.splice(i,1);
}
else
{
for
(let i = 0; i < this.selectTable.length; i++)
{
if
(this.selectTable[i].index == row.index)
{
this.selectTable.splice(i,
1);
}
}
}
...
...
@@ -571,42 +602,45 @@ export default {
this.allWeight = this.allWeight + this.selectTable[i].actualWeight;
this.allQty = this.allQty + this.selectTable[i].qty;
}
this.allQty = this.allQty.toFixed(
0
);
this.allWeight = this.allWeight.toFixed(
1
);
this.allQty = this.allQty.toFixed();
this.allWeight = this.allWeight.toFixed(
2
);
},
// 导出表格
xlse(page) {
this.progress = 1;
this.downLoadingTip.downloading = true;
let cargoXlse = {title:"货物导出表",cargoConditionDto:{}};
if(this.formData.customsReceiptStatusId != null && this.formData.customsReceiptStatusId.length < 1){
let cargoXlse = { title: "货物导出表", cargoConditionDto: {} };
if (
this.formData.customsReceiptStatusId != null &&
this.formData.customsReceiptStatusId.length < 1
) {
this.formData.customsReceiptStatusId = null;
}
if (this.createDate != null && this.createDate.length > 0) {
this.formData.createTimeStart = this.createDate[0];
this.formData.createTimeEnd = this.createDate[1];
}
else
{
}
else
{
this.formData.createTimeStart = null;
this.formData.createTimeEnd = null;
}
if (this.prepalyFlightTime != null && this.prepalyFlightTime.length > 0) {
this.formData.prematchFltDateStart = this.prepalyFlightTime[0];
this.formData.prematchFltDateEnd = this.prepalyFlightTime[1];
}
else
{
this.formData.prematchFltDateStart ="";
}
else
{
this.formData.prematchFltDateStart =
"";
this.formData.prematchFltDateEnd = "";
}
if (this.flightTime != null && this.flightTime.length > 0) {
this.formData.fltDateStart = this.flightTime[0];
this.formData.fltDateEnd = this.flightTime[1];
}
else
{
}
else
{
this.formData.fltDateStart = "";
this.formData.fltDateEnd = "";
}
if
(this.cargoPlaneTime != null && this.cargoPlaneTime.length > 0)
{
if
(this.cargoPlaneTime != null && this.cargoPlaneTime.length > 0)
{
this.formData.cargoPlaneStart = this.cargoPlaneTime[0];
this.formData.cargoPlaneEnd = this.cargoPlaneTime[1];
}
else
{
}
else
{
this.formData.cargoPlaneStart = null;
this.formData.cargoPlaneEnd = null;
}
...
...
@@ -614,30 +648,34 @@ export default {
cargoXlse.cargoConditionDto.limitSize = this.limitSize;
if (page == 0) {
this.downLoadingTip.tip = "正在导出本页结果集"
this.downLoadingTip.tip = "正在导出本页结果集"
;
cargoXlse.cargoConditionDto.limitStart = this.limitStart;
downLoadXlsx("/cargo/excel",cargoXlse,"货物查询表").then(()=>{
downLoadXlsx("/cargo/excel", cargoXlse, "货物查询表")
.then(() => {
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = ""
this.downLoadingTip.tip = "";
this.progress = 100;
}).catch(()=>{
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = ""
})
.catch(() => {
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = "";
});
} else {
if
(this.totalCount < 80000)
{
this.downLoadingTip.tip = "正在导出全部结果集"
if
(this.totalCount < 80000)
{
this.downLoadingTip.tip = "正在导出全部结果集"
;
cargoXlse.cargoConditionDto.limitStart = 0;
cargoXlse.cargoConditionDto.limitSize = -1;
downLoadXlsx("/cargo/excel",cargoXlse,"货物查询表").then(()=>{
downLoadXlsx("/cargo/excel", cargoXlse, "货物查询表")
.then(() => {
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = ""
this.downLoadingTip.tip = "";
this.progress = 100;
}).catch(()=>{
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = ""
})
}else{
.catch(() => {
this.downLoadingTip.downloading = false;
this.downLoadingTip.tip = "";
});
} else {
this.downLoadingTip.downloading = false;
this.$message({
message: "数据量过大无法导出",
...
...
@@ -646,17 +684,21 @@ export default {
}
}
},
//排序
sortChange() {
this.tableData.sort();
},
//表格格式化
formatter(row,column,cellValue,index){
if(column.property=="cargoRulesStatus"){
if(cellValue == 1){
return cellValue = "手动"
}else if(cellValue == 2){
return cellValue = "自动"
}
formatter(row, column, cellValue, index) {
if (column.property == "cargoRulesStatus") {
if (cellValue == 1) {
return (cellValue = "手动");
} else if (cellValue == 2) {
return (cellValue = "自动");
}
return cellValue
}
return cellValue;
},
},
computed: {
fltNo: {
...
...
@@ -683,28 +725,39 @@ export default {
this.formData.ursa = upCase(val);
},
},
cargoPlaneNo:{
cargoPlaneNo:
{
get: function () {
return this.formData.cargoPlaneNo;
},
set: function (val) {
this.formData.cargoPlaneNo = upCase(val);
},
}
}
,
},
};
</script>
<style scoped>
.tips {
float: right
;
display: inline-block
;
color: #606266;
font-size: 14px;
margin-right: 40px;
margin-top: 10px;
margin-left: 50px;
}
.progress{
width:200px;
.progress
{
width:
200px;
display: inline-block;
margin:0 0 0 20px;
margin: 0 0 0 20px;
}
.formShow {
width: max-content;
height: 48px;
line-height: 48px;
font-weight: 900;
color: rgb(64, 158, 255);
font-size: 14px;
float: right;
margin-right: 20px;
}
</style>
\ No newline at end of file
...
...
vue.config.js
View file @
6b95241
...
...
@@ -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
:
{
...
...
Please
register
or
login
to post a comment