|
@@ -44,7 +44,7 @@ export default {
|
|
|
},
|
|
|
loading: false,
|
|
|
formData: {
|
|
|
- flighttype: "",
|
|
|
+ flighttype: "全部",
|
|
|
dateTime: "",
|
|
|
},
|
|
|
titleTop: "运单部门维度统计",
|
|
@@ -129,8 +129,17 @@ export default {
|
|
|
tableSortMsg: []
|
|
|
};
|
|
|
},
|
|
|
- mounted () {
|
|
|
- // this.getQuery([]);
|
|
|
+ created () {
|
|
|
+ const catchMap = sessionStorage.getItem(this.$route.name)
|
|
|
+ if (catchMap) {
|
|
|
+ const { k1, k2, k3, k4 } = JSON.parse(catchMap)
|
|
|
+ this.formData = k1
|
|
|
+ this.formData.dateTime = [k1.fd1, k1.fd2]
|
|
|
+ this.tableList = k2
|
|
|
+ this.tableListcop = k2
|
|
|
+ this.tableSortMsg = setSortMsg(k3)
|
|
|
+ this.searchParams = k4
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
// 监听数据变化,重绘折线图
|
|
@@ -153,7 +162,6 @@ export default {
|
|
|
fd2: data.dateTime[1]
|
|
|
},
|
|
|
];
|
|
|
- this.getQuery(data.fttp, option, null);
|
|
|
let typeName = null
|
|
|
switch (data.fttp) {
|
|
|
case 52229:
|
|
@@ -178,16 +186,11 @@ export default {
|
|
|
flighttype: data.flighttype,
|
|
|
fd1: data.dateTime[0],
|
|
|
fd2: data.dateTime[1]
|
|
|
- },
|
|
|
- this.listname =
|
|
|
- "运单部门维度统计" + '-' +
|
|
|
- typeName + '-' +
|
|
|
- data.flighttype + '-' +
|
|
|
- data.dateTime;
|
|
|
- this.listHeader = ["序号", "时间", "航班(班)", "环比(%)"];
|
|
|
+ }
|
|
|
+ this.getQuery(data.fttp, option, typeName, this.searchParams);
|
|
|
},
|
|
|
//获取表格数据
|
|
|
- async getQuery (id, data, dat) {
|
|
|
+ async getQuery (id, data, dat, params) {
|
|
|
this.loading = true
|
|
|
try {
|
|
|
const { code, returnData } = await Query({
|
|
@@ -223,32 +226,13 @@ export default {
|
|
|
this.tableList = copyDatas;
|
|
|
this.tableListcop = copyDatas;
|
|
|
this.loading = false
|
|
|
- // returnData.listValues.forEach((element) => {
|
|
|
- // this.tableData.data2.push(
|
|
|
- // element.flightNum ? element.flightNum : 0
|
|
|
- // );
|
|
|
- // this.tableData.time.push(element.dat);
|
|
|
- // this.tableData.kg = "单位:班";
|
|
|
- // this.tableData.data1 = [];
|
|
|
- // });
|
|
|
- // this.tableData.data1.push(0);
|
|
|
- // for (let index = 0; index < this.tableData.data2.length; index++) {
|
|
|
- // if (index > 0) {
|
|
|
- // const element =
|
|
|
- // (this.tableData.data2[index] -
|
|
|
- // this.tableData.data2[index - 1]) /
|
|
|
- // this.tableData.data2[index - 1];
|
|
|
- // this.tableData.data1.push(
|
|
|
- // element.toFixed(2) ? element.toFixed(2) : 0
|
|
|
- // );
|
|
|
- // this.tableData.data1.forEach((element) => {
|
|
|
- // element = Number(element);
|
|
|
- // if (typeof element !== "number") {
|
|
|
- // element = 0;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
+ const catchMap = {
|
|
|
+ k1: _.assign(data[0], { fttp: id }),
|
|
|
+ k2: copyDatas,
|
|
|
+ k3: dat,
|
|
|
+ k4: params
|
|
|
+ }
|
|
|
+ sessionStorage.setItem(this.$route.name, JSON.stringify(catchMap))
|
|
|
} else {
|
|
|
this.loading = false
|
|
|
console.log(code)
|