chenjun há 2 anos atrás
pai
commit
dd5bfb380f

+ 13 - 3
src/views/securityCheck/components/securityCheckHeader.vue

@@ -68,7 +68,7 @@
       <template v-if="withSelect">
         <a-form-item prop="selection" style="margin-right: 16px">
           <a-select
-            mode="combobox"
+            :mode="mode"
             :placeholder="selectPlaceholder"
             :value="formData.selection ? formData.selection : undefined"
             @change="handleChange"
@@ -134,6 +134,10 @@
 <script>
 export default {
   props: {
+    mode:{
+      type: String,
+      default: "combobox",
+    },
     title: {
       type: String,
       default: "",
@@ -339,11 +343,17 @@ export default {
       console.log(this.$route.query);
       this.formData.beginDate = this.$route.query.startTime;
       this.formData.endDate = this.$route.query.endTime;
+      if(this.$route.query.beginDate){
+        this.formData.beginDate = this.$route.query.beginDate;
+      }
+      if(this.$route.query.endDate){
+        this.formData.endDate = this.$route.query.endDate;
+      }
       // this.formData.selection = this.$route.query.levelId
       //   ? this.$route.query.levelId
       //   : this.$route.query.agentLevel;
-      this.formData.selection = this.$route.query.place
-        ? this.$route.query.place
+      this.formData.selection = this.$route.query.places
+        ? this.$route.query.places
         : this.$route.query.levelId
         ? this.$route.query.levelId
         : this.$route.query.agentLevel;

+ 32 - 12
src/views/securityCheck/views/cargoCharts.vue

@@ -52,11 +52,12 @@ import { agent, routeall } from "@/api/statistics/statistics.js";
 export default {
   data() {
     return {
+      multiple:"multiple",
       queryData: {
-        startTime: "",
-        endTime: "",
-        agentLevel: "",
-        agentCode: "",
+        beginDate: "",
+        endDate: "",
+        places: [],
+        proxyId: "",
       },
       queryDatacopy: {},
       destination: [],
@@ -196,9 +197,24 @@ export default {
     GraphicEchart,
     SecurityCheckHeader,
   },
+  created(){
+    this.formatDate();
+  },
   mounted() {
+    if (Object.keys(this.$route.query).length !== 0) {
+      const { beginDate, endDate, places, proxyId } =
+        this.$route.query;
+      this.queryData.beginDate = beginDate;
+      this.queryData.endDate = endDate;
+      if(typeof(places)=="string"){
+        this.queryData.places = [places];
+      }
+      else{
+        this.queryData.places = places;
+      }
+      this.queryData.proxyId = proxyId;
+    }
     this.routdata();
-    this.formatDate();
     this.relationDate();
   },
   methods: {
@@ -213,10 +229,16 @@ export default {
       this.queryData.endDate = `${myyear}-${mymonth}-${myweekday}`;
     },
     search(data) {
+      if(typeof(data[1])=="string"&&data[1]==""){
+        data[1] =[]
+      }
+      if(typeof(data[1])=="string"&&data[1]!=""){
+        data[1] = [data[1]]
+      }
       this.queryData = {
         beginDate: data[0][0],
         endDate: data[0][1],
-        place: data[1],
+        places: data[1],
         proxyId: data[2],
       };
       this.relationDate();
@@ -226,7 +248,7 @@ export default {
       let params = {
         startTime: this.queryData.beginDate,
           endTime: this.queryData.endDate,
-          destination:this.queryData.place,
+          destination:this.queryData.places,
           agentCode: this.queryData.proxyId,
           openResult: "",
           riskRating: data,
@@ -242,11 +264,7 @@ export default {
     //货物关联统计接口
     async relationDate() {
       try {
-        let params = {};
-        if (Object.keys(this.$route.query).length !== 0) {
-          params = this.$route.query;
-          this.queryData = params;
-        }
+       
         // console.log(params);
         const result = await agent(this.queryData);
         if (result.status == 200) {
@@ -384,6 +402,8 @@ export default {
       }
     },
     change() {
+      let param = JSON.parse(JSON.stringify(this.queryData,))
+      param.places = param.places[0]
       this.$router.push({
         path: "./cargoRelevanceTable",
         query: this.queryData,

+ 38 - 25
src/views/securityCheck/views/cargoRelevanceTable.vue

@@ -65,8 +65,8 @@ export default {
           title: "普通",
           children: [
             {
-              dataIndex: "count",
-              key: "count",
+              dataIndex: "highRiskcount",
+              key: "highRiskcount",
               title: "件数",
               clickHandler: (row, rowIndex) => {
                 this.$router.push({
@@ -223,8 +223,8 @@ export default {
       FormData: {
         beginDate: "",
         endDate: "",
-        place: "",
-        proxyId: ""
+        places: [],
+        proxyId: "",
       },
     };
   },
@@ -232,6 +232,17 @@ export default {
     this.formatDate();
   },
   mounted() {
+    if (Object.keys(this.$route.query).length !== 0) {
+      const { beginDate, endDate, places, proxyId } = this.$route.query;
+      this.FormData.beginDate = beginDate;
+      this.FormData.endDate = endDate;
+      if (typeof places == "string") {
+        this.FormData.places = [places];
+      } else {
+        this.FormData.places = places;
+      }
+      this.FormData.proxyId = proxyId;
+    }
     this.setTableHeight();
     window.addEventListener("resize", this.setTableHeight);
     this.routdata();
@@ -273,14 +284,7 @@ export default {
       try {
         this.loading = true;
         // console.log(this.$route.query);
-        if (Object.keys(this.$route.query).length !== 0) {
-          const { beginDate, endDate, place, proxyId } =
-            this.$route.query;
-          this.FormData.beginDate = beginDate;
-          this.FormData.endDate = endDate;
-          this.FormData.place = place;
-          this.FormData.proxyId = proxyId;
-        }
+
         const result = await agent(this.FormData);
         if (result.status === 200) {
           this.tableData = result.data;
@@ -290,20 +294,20 @@ export default {
                 Math.floor((data.count / item.count).toFixed(2) * 100) + "%";
             });
           });
-          if(this.tableData.length>0){
-           for(let i=0;i<this.tableData[0].datas.length;i++){
-              this.tableCols.forEach(item =>{
-                if(item.title == this.tableData[0].datas[i].level){
-                  item.dataIndex = "datas";
-                  item.key = "datas";
+          if (this.tableData.length > 0) {
+            for (let i = 0; i < this.tableData[0].datas.length; i++) {
+              this.tableCols.forEach((item) => {
+                if (item.title == this.tableData[0].datas[i].level) {
+                  // item.dataIndex = "datas";
+                  // item.key = "datas";
                   item.prop = "datas";
-                  item.children[0].dataIndex  = "datas["+i+"].count";
-                  item.children[0].key  = "datas["+i+"].count";
-                  item.children[0].prop  = "datas["+i+"].count";
-                  item.children[1].dataIndex  = "datas["+i+"].mix";
-                  item.children[1].key  = "datas["+i+"].mix";
+                  item.children[0].dataIndex = "datas[" + i + "].count";
+                  // item.children[0].key  = "datas["+i+"].count";
+                  item.children[0].prop = "datas[" + i + "].count";
+                  item.children[1].dataIndex = "datas[" + i + "].mix";
+                  // item.children[1].key  = "datas["+i+"].mix";
                 }
-              })
+              });
             }
           }
           this.loading = false;
@@ -313,15 +317,24 @@ export default {
       }
     },
     changeHandler() {
+      let param = JSON.parse(JSON.stringify(this.FormData));
+      param.places = param.places[0];
       this.$router.push({
         path: "./cargoCharts",
         query: this.FormData,
       });
     },
     searchHandler(arr) {
+      console.log(arr);
+      if (typeof arr[1] == "string" && arr[1] == "") {
+        arr[1] = [];
+      }
+      if (typeof arr[1] == "string" && arr[1] != "") {
+        arr[1] = [arr[1]];
+      }
       this.FormData.beginDate = arr[0][0];
       this.FormData.endDate = arr[0][1];
-      this.FormData.place = arr[1];
+      this.FormData.places = arr[1];
       this.FormData.proxyId = arr[2];
       this.getData();
     },