chenrui  2 years ago
parent
commit
08ad49d795

+ 19 - 1
src/api/statistics/statistics.js

@@ -36,7 +36,7 @@ export function waybill(query) {
   })
 }
 
-// 航线货物关联统计接口
+// // 航线货物关联统计接口
 export function agent(query) {
   return request({
     url: '/risk/report/airlineCargo',
@@ -45,6 +45,15 @@ export function agent(query) {
   })
 }
 
+// 航线货物关联统计接口
+// export function agent(query) {
+//   return request({
+//     url: 'system/syncEmergencyFlight/list',
+//     method: 'POST',
+//     data: query
+//   })
+// }
+
 // 代理人信用等级视角安检综合效率统计接口
 export function emergency(query) {
   return request({
@@ -61,4 +70,13 @@ export function emergencys(query) {
     method: 'get',
     data: query
   })
+}
+
+// 代理人
+export function routeall(query) {
+  return request({
+    url: '/risk/report/queryAirline',
+    method: 'get',
+    data: query
+  })
 }

+ 4 - 4
src/views/securityCheck/components/graphicHome.vue

@@ -38,10 +38,10 @@ export default {
       pillar.title.text = this.texter.name;
       pillar.title.subtext = this.texter.kaer
         ? this.texter.cont + "%"
-        : this.texter.cont;
-      pillar.tooltip.formatter = this.texter.formatter
-        ? this.texter.formatter
-        : "";
+        : this.texter.cont.toString();
+      // pillar.tooltip.formatter = this.texter.formatter
+      //   ? this.texter.formatter
+      //   : "{c}";
       pillar.title.top = this.texter.top;
       pillar.series[0].color = this.texter.color;
       pillar.series[0].name = this.texter.name2;

+ 49 - 7
src/views/securityCheck/components/securityCheckHeader.vue

@@ -175,11 +175,9 @@ export default {
       type: Boolean,
       default: true,
     },
-  },
-  data() {
-    return {
-      changeButtonLoading: false,
-      optionLists: [
+    optionLists: {
+      type: Array,
+      default: () => [
         {
           name: "全部",
           lable: "",
@@ -201,6 +199,33 @@ export default {
           lable: "D",
         },
       ],
+    },
+  },
+  data() {
+    return {
+      changeButtonLoading: false,
+      // optionLists: [
+      //   {
+      //     name: "全部",
+      //     lable: "",
+      //   },
+      //   {
+      //     name: "A",
+      //     lable: "A",
+      //   },
+      //   {
+      //     name: "B",
+      //     lable: "B",
+      //   },
+      //   {
+      //     name: "C",
+      //     lable: "C",
+      //   },
+      //   {
+      //     name: "D",
+      //     lable: "D",
+      //   },
+      // ],
       // optionLists: ["", "A", "B", "C", "D"],
       formData: {
         beginDate: null,
@@ -223,6 +248,15 @@ export default {
     };
   },
   watch: {
+    // "$router": {
+    //   // handler(val) {
+    //   //   debugger;
+    //   //   if (val) {
+    //   //     this.formData = this.$route.query;
+    //   //     this.formData.beginDate = this.$route.query.startTime;
+    //   //   }
+    //   // },
+    // },
     "formData.dateRangeRadio": {
       handler(val) {
         function formatNumber(num) {
@@ -302,8 +336,16 @@ export default {
     },
   },
   mounted() {
-    this.formData.selection = this.optionLists[0].lable;
-    this.formData.dateRangeRadio = "当日";
+    if (Object.keys(this.$route.query).length == 0) {
+      this.formData.dateRangeRadio = "当日";
+    } else {
+      this.formData.beginDate = this.$route.query.startTime;
+      this.formData.endDate = this.$route.query.endTime;
+      this.formData.selection = this.$route.query.levelId;
+      this.formData.searchText = this.$route.query.proxyId;
+      this.formData.agentLevel = this.$route.query.agentLevel;
+      this.formData.agentCode = this.$route.query.agentCode;
+    }
   },
   methods: {
     handleChange(data) {

+ 13 - 7
src/views/securityCheck/views/agentHome.vue

@@ -5,6 +5,7 @@
       <SecurityCheckHeader
         title="代理人信息统计"
         @change="change"
+        @search="search"
         :withExportButton="false"
       />
     </div>
@@ -207,7 +208,7 @@ export default {
       },
       dataLowpt: {
         id: 21,
-        name: "总件数",
+        name: "开包数",
         cont: "500",
         data: [
           { value: 335, name: "1" },
@@ -228,7 +229,7 @@ export default {
       },
       dataLow: {
         id: 22,
-        name: "总件数",
+        name: "开包数",
         cont: "500",
         data: [
           { value: 335, name: "1" },
@@ -249,7 +250,7 @@ export default {
       },
       dataLowgf: {
         id: 23,
-        name: "总件数",
+        name: "开包数",
         cont: "500",
         data: [
           { value: 335, name: "1" },
@@ -270,7 +271,10 @@ export default {
       },
     };
   },
-  created() {
+  // created() {
+  //   this.getData();
+  // },
+  mounted() {
     this.getData();
   },
   methods: {
@@ -278,12 +282,11 @@ export default {
       this.queryData = {
         startTime: data[0][0],
         endTime: data[0][1],
-        riskRating: data[1],
+        agentLevel: data[1],
         agentCode: data[2],
       };
       this.getData();
     },
-
     //点击跳转
     echar() {
       this.$router.push({
@@ -292,7 +295,10 @@ export default {
       });
     },
     change() {
-      this.$router.push("/agentTable");
+      this.$router.push({
+        path: "/agentTable",
+        query: this.queryData,
+      });
     },
     async getData() {
       try {

+ 24 - 15
src/views/securityCheck/views/agentTable.vue

@@ -47,19 +47,19 @@ export default {
           key: "num",
           title: "货物件数",
           clickHandler: (row, rowIndex) => {
-                this.$router.push({
-                  path: "/waybillTable",
-                  query: {
-                    startTime: this.FormData.startTime,
-                    endTime: this.FormData.endTime,
-                    destination: this.FormData.destination,
-                    agentCode: this.FormData.agentCode,
-                    agentLevel: this.FormData.agentLevel,
-                    riskRating: row.risk,
-                    openResult: this.FormData.openResult,
-                  },
-                });
+            this.$router.push({
+              path: "/waybillTable",
+              query: {
+                startTime: this.FormData.startTime,
+                endTime: this.FormData.endTime,
+                destination: this.FormData.destination,
+                agentCode: this.FormData.agentCode,
+                agentLevel: this.FormData.agentLevel,
+                riskRating: row.risk,
+                openResult: this.FormData.openResult,
               },
+            });
+          },
         },
         {
           dataIndex: "kxsNum",
@@ -85,7 +85,7 @@ export default {
                     agentCode: this.FormData.agentCode,
                     agentLevel: this.FormData.agentLevel,
                     riskRating: row.risk,
-                    openResult: '放行',
+                    openResult: "放行",
                   },
                 });
               },
@@ -104,7 +104,7 @@ export default {
                     agentCode: this.FormData.agentCode,
                     agentLevel: this.FormData.agentLevel,
                     riskRating: row.risk,
-                    openResult: '拒运',
+                    openResult: "拒运",
                   },
                 });
               },
@@ -123,7 +123,7 @@ export default {
                     agentCode: this.FormData.agentCode,
                     agentLevel: this.FormData.agentLevel,
                     riskRating: row.risk,
-                    openResult: '移交',
+                    openResult: "移交",
                   },
                 });
               },
@@ -168,6 +168,14 @@ export default {
     async getData() {
       try {
         this.loading = true;
+        if (Object.keys(this.$route.query).length !== 0) {
+          const { startTime, endTime, agentLevel, agentCode } =
+            this.$route.query;
+          this.FormData.startTime = startTime;
+          this.FormData.endTime = endTime;
+          this.FormData.agentLevel = agentLevel;
+          this.FormData.agentCode = agentCode;
+        }
         const result = await comprehensiveTable(this.FormData);
         if (result.code === 200) {
           this.tableData = result.data;
@@ -180,6 +188,7 @@ export default {
     changeHandler() {
       this.$router.push({
         path: "./agent",
+        query: this.FormData,
       });
     },
     searchHandler(arr) {

+ 42 - 22
src/views/securityCheck/views/cargoCharts.vue

@@ -6,6 +6,8 @@
         @change="change"
         :withExportButton="false"
         @search="search"
+        selectPlaceholder="目的地"
+        :optionLists="destination"
       />
     </div>
     <div class="content_top">
@@ -46,12 +48,13 @@
 import { eleCake } from "@/utils/app-ecahrts";
 import GraphicEchart from "../components/graphicHome.vue";
 import SecurityCheckHeader from "../components/securityCheckHeader.vue";
-import { agent } from "@/api/statistics/statistics.js";
+import { agent, routeall } from "@/api/statistics/statistics.js";
 export default {
   data() {
     return {
       queryData: {},
       queryDatacopy: {},
+      destination: [],
       dataall: {
         id: 7,
         name: "总件数",
@@ -189,7 +192,8 @@ export default {
     SecurityCheckHeader,
   },
   mounted() {
-    // this.init();
+    this.routdata();
+    this.relationDate();
   },
   methods: {
     search(data) {
@@ -199,7 +203,7 @@ export default {
         riskRating: data[1],
         agentCode: data[2],
       };
-      this.relationDate(data);
+      this.relationDate();
     },
     //点击跳转
     echar() {
@@ -209,24 +213,15 @@ export default {
       });
     },
     //货物关联统计接口
-    async relationDate(data) {
+    async relationDate() {
       try {
         let params = {};
-        console.log(this.$route.query, "11111111");
-        if (this.$route.query) {
+        if (Object.keys(this.$route.query).length !== 0) {
           params = this.$route.query;
-          this.queryDatacopy = params;
-        } else {
-          let params = {
-            startTime: data[0][0],
-            endDate: data[0][1],
-            levelId: data[1],
-            proxyId: data[2],
-          };
-          this.queryDatacopy = params;
+          this.queryData = params;
         }
         // console.log(params);
-        const result = await agent(params);
+        const result = await agent(this.queryData);
         if (result.status == 200) {
           let arr = []; //高风险
           let Low = []; //低风险
@@ -237,15 +232,15 @@ export default {
           result.data.forEach((element) => {
             arrx.push(element.flightLine);
             element.datas.forEach((res) => {
-              if (res.level === "高风险") {
+              if (res.level === "高风险") {
                 arr.push(res.count);
-              } else if (res.level == "低风险") {
+              } else if (res.level == "低风险") {
                 Low.push(res.count);
-              } else if (res.level == "优先") {
+              } else if (res.level == "优先") {
                 firs.push(res.count);
-              } else if (res.level == "普通") {
+              } else if (res.level == "普通") {
                 pt.push(res.count);
-              } else if (res.level == "严控") {
+              } else if (res.level == "严控") {
                 strictly.push(res.count);
               }
             });
@@ -257,6 +252,13 @@ export default {
           let ptall = eval(pt.join("+")); //普通级总和
           let strictlyall = eval(strictly.join("+")); //严控级总和
           let alldata = arrall + Lowall + firsall + ptall + strictlyall; // 总数
+          // arrx.forEach((element) => {
+          //   let obj = {
+          //     name: element,
+          //     lable: element,
+          //   };
+          //   this.destination.push(obj);
+          // });
           this.init(arr, arrx, Low, firs, pt, strictly);
           this.dataall.cont = alldata;
           this.dataall.data = [
@@ -337,10 +339,28 @@ export default {
         console.log(error);
       }
     },
+    async routdata() {
+      try {
+        const result = await routeall({});
+        if (result.status == 200) {
+          this.destination = [];
+          result.data.forEach((element) => {
+            let obj = {
+              name: element,
+              lable: element,
+            };
+            this.destination.push(obj);
+          });
+          console.log(this.destination);
+        }
+      } catch (error) {
+        console.log(error);
+      }
+    },
     change() {
       this.$router.push({
         path: "./cargoRelevanceTable",
-        query: this.queryDatacopy,
+        query: this.queryData,
       });
     },
     init(arr, arrx, Low, firs, pt, strictly) {

+ 30 - 8
src/views/securityCheck/views/cargoRelevanceTable.vue

@@ -5,6 +5,8 @@
         title="航空货物关联统计"
         @change="changeHandler"
         @search="searchHandler"
+        selectPlaceholder="目的地"
+        :optionLists="destination"
       />
     </header>
     <main>
@@ -24,11 +26,12 @@
 <script>
 import SecurityCheckHeader from "../components/securityCheckHeader.vue";
 import SecurityCheckTable from "../components/securityCheckTable.vue";
-import { agent } from "@/api/statistics/statistics.js";
+import { agent, routeall } from "@/api/statistics/statistics.js";
 export default {
   components: { SecurityCheckHeader, SecurityCheckTable },
   data() {
     return {
+      destination: [],
       loading: false,
       tableHeight: "550",
       tableCols: [
@@ -238,6 +241,7 @@ export default {
   mounted() {
     this.setTableHeight();
     window.addEventListener("resize", this.setTableHeight);
+    this.routdata();
     this.getData();
   },
   beforeDestroy() {
@@ -254,18 +258,36 @@ export default {
       this.FormData.startTime = `${myyear}-${mymonth}-${myweekday}`;
       this.FormData.endTime = `${myyear}-${mymonth}-${myweekday}`;
     },
+    async routdata() {
+      try {
+        const result = await routeall({});
+        if (result.status == 200) {
+          this.destination = [];
+          result.data.forEach((element) => {
+            let obj = {
+              name: element,
+              lable: element,
+            };
+            this.destination.push(obj);
+          });
+          console.log(this.destination);
+        }
+      } catch (error) {
+        console.log(error);
+      }
+    },
     //接口数据
     async getData() {
       try {
         this.loading = true;
         // console.log(this.$route.query);
-        // if (this.$route.query) {
-        //   const { startTime, endDate, levelId, proxyId } = this.$route.query;
-        //   this.FormData[startTime] = startTime;
-        //   this.FormData[startTime] = endDate;
-        //   this.FormData[startTime] = levelId;
-        //   this.FormData[startTime] = proxyId;
-        // }
+        if (Object.keys(this.$route.query).length !== 0) {
+          const { startTime, endTime, levelId, proxyId } = this.$route.query;
+          this.FormData.startTime = startTime;
+          this.FormData.endTime = endTime;
+          this.FormData.levelId = levelId;
+          this.FormData.proxyId = proxyId;
+        }
         const result = await agent(this.FormData);
         if (result.status === 200) {
           this.tableData = result.data;

+ 19 - 7
src/views/securityCheck/views/cargoStatisticsHome.vue

@@ -333,7 +333,7 @@ export default {
       },
       dataLow: {
         id: 2,
-        name: "总件数",
+        name: "开包数",
         name2: "低风险货物级",
         cont: "500",
         data: [],
@@ -351,7 +351,7 @@ export default {
       },
       dataLowcp: {
         id: 3,
-        name: "总件数",
+        name: "开包数",
         name2: "优先级",
         cont: "500",
         data: [],
@@ -369,7 +369,7 @@ export default {
       },
       dataLowpt: {
         id: 4,
-        name: "总件数",
+        name: "开包数",
         name2: "普通级",
         cont: "500",
         data: [],
@@ -387,7 +387,7 @@ export default {
       },
       dataLowyk: {
         id: 5,
-        name: "总件数",
+        name: "开包数",
         name2: "严控级",
         cont: "500",
         data: [],
@@ -405,7 +405,7 @@ export default {
       },
       dataLowgf: {
         id: 6,
-        name: "总件数",
+        name: "开包数",
         name2: "高风险货物级",
         cont: "500",
         data: [],
@@ -431,12 +431,15 @@ export default {
   created() {
     // this.getData();
   },
+  mounted() {
+    this.getData();
+  },
   methods: {
     search(data) {
       this.queryData = {
         startTime: data[0][0],
         endTime: data[0][1],
-        riskRating: data[1],
+        agentLevel: data[1],
         agentCode: data[2],
       };
       this.getData();
@@ -449,10 +452,19 @@ export default {
       });
     },
     change() {
-      this.$router.push("./cargoTable");
+      this.$router.push({
+        path: "./cargoTable",
+        query: this.queryData,
+      });
     },
     async getData() {
       try {
+        if (Object.keys(this.$route.query).length !== 0) {
+          this.queryData.startTime = this.$route.query.startTime;
+          this.queryData.endTime = this.$route.query.endTime;
+          this.queryData.agentLevel = this.$route.query.agentLevel;
+          this.queryData.agentCode = this.$route.query.agentCode;
+        }
         const result = await comprehensive(this.queryData);
         let count = 0;
         let counts = 0;

+ 50 - 41
src/views/securityCheck/views/cargoTable.vue

@@ -29,7 +29,7 @@ export default {
   components: { SecurityCheckHeader, SecurityCheckTable },
   data() {
     return {
-      loading:false,
+      loading: false,
       tableHeight: "50vh",
       tableCols: [
         {
@@ -47,19 +47,19 @@ export default {
           key: "num",
           title: "货物件数",
           clickHandler: (row, rowIndex) => {
-                this.$router.push({
-                  path: "/waybillTable",
-                  query: {
-                    startTime: this.FormData.startTime,
-                    endTime: this.FormData.endTime,
-                    destination: this.FormData.destination,
-                    agentCode: this.FormData.agentCode,
-                    agentLevel: this.FormData.agentLevel,
-                    riskRating: row.risk,
-                    openResult: this.FormData.openResult,
-                  },
-                });
+            this.$router.push({
+              path: "/waybillTable",
+              query: {
+                startTime: this.FormData.startTime,
+                endTime: this.FormData.endTime,
+                destination: this.FormData.destination,
+                agentCode: this.FormData.agentCode,
+                agentLevel: this.FormData.agentLevel,
+                riskRating: row.risk,
+                openResult: this.FormData.openResult,
               },
+            });
+          },
         },
         {
           dataIndex: "kxsNum",
@@ -85,7 +85,7 @@ export default {
                     agentCode: this.FormData.agentCode,
                     agentLevel: this.FormData.agentLevel,
                     riskRating: row.risk,
-                    openResult: '放行',
+                    openResult: "放行",
                   },
                 });
               },
@@ -104,7 +104,7 @@ export default {
                     agentCode: this.FormData.agentCode,
                     agentLevel: this.FormData.agentLevel,
                     riskRating: row.risk,
-                    openResult: '拒运',
+                    openResult: "拒运",
                   },
                 });
               },
@@ -123,7 +123,7 @@ export default {
                     agentCode: this.FormData.agentCode,
                     agentLevel: this.FormData.agentLevel,
                     riskRating: row.risk,
-                    openResult: '移交',
+                    openResult: "移交",
                   },
                 });
               },
@@ -132,42 +132,50 @@ export default {
         },
       ],
       tableData: [],
-      FormData:{
-        destination:'',// 目的站
-        agentCode:'',//代理人ID
-        agentLevel:'',//代理人信用等级 A\B\C\D
-        riskRating:'',//综合风险等级评估 低风险\优先\普通\高风险\严控
-        startTime:'',//开始时间
-        endTime:'',//结束时间
-      }
+      FormData: {
+        destination: "", // 目的站
+        agentCode: "", //代理人ID
+        agentLevel: "", //代理人信用等级 A\B\C\D
+        riskRating: "", //综合风险等级评估 低风险\优先\普通\高风险\严控
+        startTime: "", //开始时间
+        endTime: "", //结束时间
+      },
     };
   },
-  created(){
-    this.formatDate()
+  created() {
+    this.formatDate();
   },
   mounted() {
     this.setTableHeight();
     window.addEventListener("resize", this.setTableHeight);
-    this.getData()
+    this.getData();
   },
   beforeDestroy() {
     window.removeEventListener("resize", this.setTableHeight);
   },
   methods: {
     formatDate() {
-        let date = new Date();
-        let myyear = date.getFullYear();
-        let mymonth = date.getMonth() +1;
-        let myweekday = date.getDate();
-        mymonth < 10 ? mymonth = "0" + mymonth : mymonth;
-        myweekday < 10 ? myweekday = "0" + myweekday :myweekday;
-        this.FormData.startTime =  `${myyear}-${mymonth}-${myweekday}`;
-        this.FormData.endTime =  `${myyear}-${mymonth}-${myweekday}`;
-      },
+      let date = new Date();
+      let myyear = date.getFullYear();
+      let mymonth = date.getMonth() + 1;
+      let myweekday = date.getDate();
+      mymonth < 10 ? (mymonth = "0" + mymonth) : mymonth;
+      myweekday < 10 ? (myweekday = "0" + myweekday) : myweekday;
+      this.FormData.startTime = `${myyear}-${mymonth}-${myweekday}`;
+      this.FormData.endTime = `${myyear}-${mymonth}-${myweekday}`;
+    },
     //接口数据
     async getData() {
       try {
         this.loading = true;
+        if (Object.keys(this.$route.query).length !== 0) {
+          const { startTime, endTime, agentLevel, agentCode } =
+            this.$route.query;
+          this.FormData.startTime = startTime;
+          this.FormData.endTime = endTime;
+          this.FormData.agentLevel = agentLevel;
+          this.FormData.agentCode = agentCode;
+        }
         const result = await comprehensive(this.FormData);
         if (result.code === 200) {
           this.tableData = result.data;
@@ -180,14 +188,15 @@ export default {
     changeHandler() {
       this.$router.push({
         path: "./cargoStatistics",
+        query: this.FormData,
       });
     },
     searchHandler(arr) {
-      this.FormData.startTime=arr[0][0];
-      this.FormData.endTime=arr[0][1];
-      this.FormData.agentLevel=arr[1];
-      this.FormData.agentCode=arr[2];
-      this.getData()
+      this.FormData.startTime = arr[0][0];
+      this.FormData.endTime = arr[0][1];
+      this.FormData.agentLevel = arr[1];
+      this.FormData.agentCode = arr[2];
+      this.getData();
     },
     setTableHeight() {
       const topBarHeight = 80;

+ 1 - 0
src/views/securityCheck/views/comprehensiveHome.vue

@@ -4,6 +4,7 @@
       <SecurityCheckHeader
         title="安检通道综合效率"
         :withExportButton="false"
+        :withChangeButton="false"
         @search="search"
       />
     </div>

+ 3 - 2
src/views/securityCheck/views/securityChannelHome.vue

@@ -5,6 +5,7 @@
       <SecurityCheckHeader
         title="安检通道综合效率"
         :withExportButton="false"
+        :withChangeButton="false"
         @search="search"
       />
     </div>
@@ -40,8 +41,8 @@ export default {
       this.queryData = {
         startTime: data[0][0],
         endTime: data[0][1],
-        riskRating: data[1],
-        agentCode: data[2],
+        proxyId: data[1],
+        proxyLevel: data[2],
       };
       this.relationDate(data);
     },