Browse Source

Merge branch 'master' of http://120.26.64.82:3000/BFFE/SZHY2.0

chenjun 2 years ago
parent
commit
8dcf5bf5c7

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

@@ -4,7 +4,7 @@ import request from '@/utils/request'
 export function correlation(query) {
   return request({
     url: '/risk/report/securityCheck',
-    method: 'get',
+    method: 'POST',
     params: query
   })
 }

+ 14 - 16
src/views/securityCheck/components/securityCheckHeader.vue

@@ -21,9 +21,9 @@
         </a-form-item>
       </template>
       <template v-if="withDatePicker">
-        <a-form-item prop="startDate" style="margin-right: 8px">
+        <a-form-item prop="beginDate" style="margin-right: 8px">
           <a-date-picker
-            v-model="formData.startDate"
+            v-model="formData.beginDate"
             type="date"
             size="small"
             format="YYYY-MM-DD"
@@ -42,11 +42,7 @@
           class="radio-wrapper"
           style="margin-right: 36px"
         >
-          <a-radio-group
-            v-model="formData.dateRangeRadio"
-            size="small"
-            @change="changes(formData.dateRangeRadio)"
-          >
+          <a-radio-group v-model="formData.dateRangeRadio" size="small">
             <a-radio-button
               value="当日"
               :class="formData.dateRangeRadio == '当日' ? 'btn-mo' : 'btn-mos'"
@@ -69,7 +65,7 @@
       </template>
       <template v-if="withSelect">
         <a-form-item prop="selection" style="margin-right: 16px">
-          <a-select :default-value="optionLists[0]">
+          <a-select :default-value="optionLists[0]" @change="handleChange">
             <a-select-option v-for="province in optionLists" :key="province">
               {{ province }}
             </a-select-option>
@@ -176,14 +172,14 @@ export default {
   data() {
     return {
       changeButtonLoading: false,
+      optionLists: ["低风险", "优先", "普通", "高风险", "严控"],
       formData: {
-        startDate: "",
+        beginDate: "",
         endDate: "",
         dateRangeRadio: "",
         selection: "",
         searchText: "",
       },
-      optionLists: ["全部代理人等级"],
       optionList: [],
       inputList: [
         {
@@ -222,24 +218,25 @@ export default {
         const date = now.getDate();
         switch (val) {
           case "当日":
-            this.formData.startDate =
+            this.formData.beginDate =
               this.formData.endDate = `${year}-${formatNumber(
                 month
               )}-${formatNumber(date)}`;
             break;
           case "当月":
-            this.formData.startDate = `${year}-${formatNumber(month)}-01`;
+            this.formData.beginDate = `${year}-${formatNumber(month)}-01`;
             this.formData.endDate = `${year}-${formatNumber(
               month
             )}-${getLastDayOfMonth(year, month)}`;
             break;
           case "当年":
-            this.formData.startDate = `${year}-01-01`;
+            this.formData.beginDate = `${year}-01-01`;
             this.formData.endDate = `${year}-12-31`;
             break;
           default:
             break;
         }
+        this.search();
       },
     },
     selectOptions: {
@@ -262,11 +259,12 @@ export default {
     },
   },
   mounted() {
+    this.formData.selection = this.optionLists[0];
     this.formData.dateRangeRadio = "当日";
   },
   methods: {
-    changes(data) {
-      console.log(data);
+    handleChange(data) {
+      this.formData.selection = data;
     },
     change() {
       this.changeButtonLoading = true;
@@ -287,7 +285,7 @@ export default {
     search() {
       const searchArray = [];
       this.withDatePicker &&
-        searchArray.push([this.formData.startDate, this.formData.endDate]);
+        searchArray.push([this.formData.beginDate, this.formData.endDate]);
       this.withSelect && searchArray.push(this.formData.selection);
       this.withInput && searchArray.push(this.formData.searchText);
       this.$emit("search", searchArray);

+ 25 - 0
src/views/securityCheck/views/cargoCharts.vue

@@ -5,6 +5,7 @@
         title="航空货物关联统计"
         @change="change"
         :withExportButton="false"
+        @search="search"
       />
     </div>
     <div class="content_top">
@@ -167,6 +168,30 @@ export default {
     this.init();
   },
   methods: {
+    //默认查询条件
+    search(data) {
+      this.relationDate(data);
+    },
+    //货物关联统计接口
+    async relationDate(data) {
+      try {
+        let params = {
+          beginDate: data[0][0],
+          endDate: data[0][1],
+          levelId: data[1],
+          proxyId: data[2],
+        };
+        console.log(params);
+        const result = await correlation(params);
+        if (result.status == 200) {
+          this.dataall.data = result.data;
+          this.datarisk.data = result.data;
+        }
+        console.log(result);
+      } catch (error) {
+        console.log(error);
+      }
+    },
     change() {
       this.$router.push("./cargoRelevanceTable");
     },