|
@@ -16,6 +16,7 @@ import Tableformbrs from "../../components/echart/tableforms.vue";
|
|
|
import StatisticsHeader from "../../components/echart/statisticsHeader.vue";
|
|
|
import { export_json_to_excel } from "@/utils/Export2Excel";
|
|
|
import { Query } from "@/api/webApi";
|
|
|
+import _ from 'lodash'
|
|
|
export default {
|
|
|
name: "ChartsBar",
|
|
|
data () {
|
|
@@ -41,7 +42,7 @@ export default {
|
|
|
tyol: "",
|
|
|
},
|
|
|
formData: {
|
|
|
- airport: "",
|
|
|
+ flighttype: "",
|
|
|
dateTime: "",
|
|
|
},
|
|
|
titleTop: "运单统计",
|
|
@@ -74,33 +75,25 @@ export default {
|
|
|
clearable: true,
|
|
|
options: [
|
|
|
{
|
|
|
- value: "国内离港",
|
|
|
+ value: DATACONTENT_ID.waybillGnDeparture,
|
|
|
label: "国内出港",
|
|
|
},
|
|
|
{
|
|
|
- value: "国际离港",
|
|
|
+ value: DATACONTENT_ID.waybillGjDeparture,
|
|
|
label: "国际出港",
|
|
|
},
|
|
|
{
|
|
|
- value: "国内进港",
|
|
|
+ value: DATACONTENT_ID.waybillGnArrival,
|
|
|
label: "国内进港",
|
|
|
},
|
|
|
{
|
|
|
- value: "国际进港",
|
|
|
+ value: DATACONTENT_ID.waybillGjArrival,
|
|
|
label: "国际进港",
|
|
|
},
|
|
|
- {
|
|
|
- value: "国内进港-全部",
|
|
|
- label: "国内进港-全部",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "国内离港-全部",
|
|
|
- label: "国内离港-全部",
|
|
|
- },
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- prop: "kht",
|
|
|
+ prop: "flighttype",
|
|
|
inputType: "select",
|
|
|
placeholder: "客货类型",
|
|
|
requiredWarning: "请先选择客货类型",
|
|
@@ -114,36 +107,16 @@ export default {
|
|
|
value: "货机",
|
|
|
label: "货机",
|
|
|
},
|
|
|
- {
|
|
|
- value: "其它",
|
|
|
- label: "其它",
|
|
|
- },
|
|
|
{
|
|
|
value: "全部",
|
|
|
label: "全部",
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- {
|
|
|
- prop: "td",
|
|
|
- inputType: "select",
|
|
|
- placeholder: "统计维度",
|
|
|
- requiredWarning: "请先选择统计时间维度",
|
|
|
- clearable: true,
|
|
|
- options: [
|
|
|
- {
|
|
|
- value: "月",
|
|
|
- label: "月",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "年",
|
|
|
- label: "年",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
{
|
|
|
prop: "dateTime",
|
|
|
inputType: "datePicker",
|
|
|
+ requiredWarning: "请先选择日期",
|
|
|
clearable: true,
|
|
|
width: "240px",
|
|
|
options: [],
|
|
@@ -152,56 +125,6 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted () {
|
|
|
- this.tableList = [{
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- province: '上海',
|
|
|
- city: '普陀区',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄',
|
|
|
- zip: 200333
|
|
|
- }, {
|
|
|
- date: '2016-05-02',
|
|
|
- name: '王小虎',
|
|
|
- province: '上海',
|
|
|
- city: '普陀区',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄',
|
|
|
- zip: 200333
|
|
|
- }, {
|
|
|
- date: '2016-05-04',
|
|
|
- name: '王小虎',
|
|
|
- province: '上海',
|
|
|
- city: '普陀区',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄',
|
|
|
- zip: 200333
|
|
|
- }, {
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- province: '上海',
|
|
|
- city: '普陀区',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄',
|
|
|
- zip: 200333
|
|
|
- }, {
|
|
|
- date: '2016-05-08',
|
|
|
- name: '王小虎',
|
|
|
- province: '上海',
|
|
|
- city: '普陀区',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄',
|
|
|
- zip: 200333
|
|
|
- }, {
|
|
|
- date: '2016-05-06',
|
|
|
- name: '王小虎',
|
|
|
- province: '上海',
|
|
|
- city: '普陀区',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄',
|
|
|
- zip: 200333
|
|
|
- }, {
|
|
|
- date: '2016-05-07',
|
|
|
- name: '王小虎',
|
|
|
- province: '上海',
|
|
|
- city: '普陀区',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄',
|
|
|
- zip: 200333
|
|
|
- }]
|
|
|
// this.getQuery([]);
|
|
|
},
|
|
|
watch: {
|
|
@@ -219,79 +142,59 @@ export default {
|
|
|
this.tableData.data2 = [];
|
|
|
let option = [
|
|
|
{
|
|
|
- fttp: data.fttp,
|
|
|
- kht: data.kht,
|
|
|
- td: data.td,
|
|
|
+ flighttype: data.flighttype,
|
|
|
fd1: data.dateTime[0],
|
|
|
- fd2: data.dateTime[1],
|
|
|
+ fd2: data.dateTime[1]
|
|
|
},
|
|
|
];
|
|
|
- this.getQuery(option, null);
|
|
|
+ this.getQuery(data.fttp, option, null);
|
|
|
this.listname =
|
|
|
- "航班量统计" +
|
|
|
- data.fttp +
|
|
|
- data.kht +
|
|
|
- data.td +
|
|
|
- data.dateTime[0] +
|
|
|
- "--" +
|
|
|
- data.dateTime[1];
|
|
|
+ "航班统计" +
|
|
|
+ data.flighttype +
|
|
|
+ data.fd;
|
|
|
this.listHeader = ["序号", "时间", "航班(班)", "环比(%)"];
|
|
|
},
|
|
|
//获取表格数据
|
|
|
- async getQuery (data, dat) {
|
|
|
+ async getQuery (id, data, dat) {
|
|
|
try {
|
|
|
const { code, returnData } = await Query({
|
|
|
- id: this.listqueryTemplateID,
|
|
|
+ id: Number(id),
|
|
|
dataContent: data,
|
|
|
});
|
|
|
if (code == 0) {
|
|
|
this.tableData.time = [];
|
|
|
this.tableData.data1 = [];
|
|
|
this.tableData.data2 = [];
|
|
|
- this.tableList = JSON.parse(JSON.stringify(returnData.listValues));
|
|
|
- this.tableListcop = JSON.parse(JSON.stringify(returnData.listValues));
|
|
|
- this.tableList.forEach((item, index) => {
|
|
|
- item.indexs = index + 1;
|
|
|
- });
|
|
|
- for (let i = 0; i < 10; i++) {
|
|
|
- if (!this.tableList[i]) {
|
|
|
- this.tableList.push({});
|
|
|
- }
|
|
|
- }
|
|
|
- this.tableListcop.forEach((item, index) => {
|
|
|
- item.indexs = index + 1;
|
|
|
- });
|
|
|
- let objar = {
|
|
|
- indexs: "合计",
|
|
|
- flightNum: returnData.listValues[0].totalFlightNum,
|
|
|
- };
|
|
|
- this.tableListcop.push(objar);
|
|
|
- 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;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ this.tableList = _.cloneDeep(returnData);
|
|
|
+ this.tableListcop = _.cloneDeep(returnData);
|
|
|
+ // 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;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ console.log(code)
|
|
|
}
|
|
|
} catch (error) {
|
|
|
this.page--;
|