From cc1c0a396698648256c350f6f0fe2cb2f0b02c7e Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Wed, 27 Mar 2024 15:44:10 +0800
Subject: [PATCH] 许可按钮放出,备案审批按钮放出

---
 src/views/statisticalQueryManagement/businessStatistics.vue |  160 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 98 insertions(+), 62 deletions(-)

diff --git a/src/views/statisticalQueryManagement/businessStatistics.vue b/src/views/statisticalQueryManagement/businessStatistics.vue
index da4a55c..ae71a1a 100644
--- a/src/views/statisticalQueryManagement/businessStatistics.vue
+++ b/src/views/statisticalQueryManagement/businessStatistics.vue
@@ -1,6 +1,12 @@
 <template>
   <div>
-    <basic-container>
+    <basic-container
+      :class="[
+        'witerFontColorInput',
+        $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
+        $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '',
+      ]"
+    >
       <avue-crud
         :option="tableOption"
         :table-loading="loading"
@@ -8,6 +14,7 @@
         :page.sync="page"
         :permission="permissionList"
         ref="crud"
+        :search.sync="search"
         @row-update="rowUpdates"
         @row-save="rowSave"
         @search-change="searchChange"
@@ -17,13 +24,24 @@
         @refresh-change="refreshChange"
         @on-load="onLoad"
         @cell-click="handleRowClick"
-        class="businessStatisticsStyle"
+        class="businessStatisticsStyle tablesss"
       >
+        <template slot="menuLeft">
+          <el-button
+            type="warning"
+            size="small"
+            plain
+            icon="el-icon-download"
+            @click="handleExportBusinessStatis"
+            >导出
+          </el-button>
+        </template>
       </avue-crud>
     </basic-container>
     <el-dialog
       class="tongji-class"
       :title="dialogTitle"
+      width="80%"
       append-to-body
       :visible.sync="dialogShow"
       v-if="dialogShow"
@@ -59,18 +77,18 @@
   </div>
 </template>
 <script>
-import FileSaver from "file-saver";
-import XLSX from "xlsx";
 import { mapGetters } from "vuex";
 import {
   selectYw,
   dictionaryList,
 } from "../../api/statisticalQueryManagement/statisticalQueryManagement";
-import { lazyTreeJu, lazyTrees } from "../../api/index/index";
+import { lazyTrees } from "../../api/index/index";
 import businessStatisticsDetail from "./businessStatisticsDetail";
 import businessStatisticsPq from "./businessStatisticsPq";
 import businessStatisticsFwdq from "./businessStatisticsFwdq";
 import securityGuardDetail from "./securityGuardDetail";
+import Qs from "qs";
+import { getToken } from "@/util/auth";
 export default {
   name: "业务情况统计",
   components: {
@@ -85,32 +103,15 @@
         pageSize: 10,
         currentPage: 1,
         total: 0,
+        ...this.$store.state.control.changePageSize,
       },
+      search: {},
       query: {},
       value1: "",
       value2: "",
-      tableData: [
-        // {
-        //   company: "江西省永安保安服务有限公司",
-        //   subOffice: "南昌市公安局",
-        //   customer: "76",
-        //   num: "1124"
-        // },
-        // {
-        //   company: "南昌市赣水保安服务有限公司",
-        //   subOffice: "东湖分局",
-        //   customer: "85",
-        //   num: "1428"
-        // },
-        // {
-        //   company: "江西中业兴达保安服务有限公司",
-        //   subOffice: "西湖分局",
-        //   customer: "46",
-        //   num: "974"
-        // }
-      ],
+      tableData: [],
       tableOption: {
-        excelBtn: true,
+        // excelBtn: true,
         delBtn: false,
         editBtn: false,
         addBtn: false,
@@ -125,34 +126,13 @@
         searchShow: true,
         searchMenuSpan: 6,
         index: true,
+        indexLabel: "序号",
         viewBtn: true,
         dialogClickModal: false,
+        ...this.$store.state.control.clearOtherBut,
         column: [
           {
-            label: "单位注册时间",
-            prop: "releaseTimeRange",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd",
-            searchRange: true,
-            searchSpan: 6,
-            searchLabelWidth: 120,
-            labelWidth:160,
-            hide: true,
-            addDisplay: false,
-            editDisplay: false,
-            viewDisplay: false,
-            search: true,
-            rules: [
-              {
-                required: true,
-                message: "请选择单位注册时间",
-                trigger: "blur",
-              },
-            ],
-          },
-          {
-            label: "公司名称",
+            label: "企业名称",
             prop: "enterpriseName",
             search: true,
             searchSpan: 4,
@@ -160,7 +140,7 @@
             display: false,
           },
           {
-            label: "单位类型",
+            label: "企业属性",
             prop: "stats",
             search: true,
             searchSpan: 4,
@@ -216,6 +196,29 @@
             prop: "dqnum",
             display: false,
           },
+          {
+            label: "单位注册时间",
+            prop: "releaseTimeRange",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd",
+            searchRange: true,
+            searchSpan: 6,
+            searchLabelWidth: 120,
+            labelWidth: 160,
+            hide: true,
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: false,
+            search: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择单位注册时间",
+                trigger: "blur",
+              },
+            ],
+          },
         ],
       },
       loading: true,
@@ -239,6 +242,36 @@
     },
   },
   methods: {
+    //业务情况统计信息导出
+    handleExportBusinessStatis() {
+      this.$confirm("是否导出业务情况统计信息数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        //获取查询条件
+        const { releaseTimeRange } = this.search;
+        if (releaseTimeRange) {
+          this.search["startTime"] = releaseTimeRange[0];
+          this.search["endTime"] = releaseTimeRange[1];
+        }
+        var data = {
+          jurisdiction: this.search.jurname,
+          stats: this.search.stats,
+          deptid: this.search.enterpriseName,
+          startTime: this.search.startTime,
+          endTime: this.search.endTime,
+        };
+        // console.log(data,123);
+        //序列号url形式,用&拼接
+        data = Qs.stringify(data);
+        window.open(
+          `/api/information/export-business-statis?${
+            this.website.tokenHeader
+          }=${getToken()}&` + data
+        );
+      });
+    },
     getSubOfficeData() {
       lazyTrees().then((res) => {
         if (res.data.code === 200) {
@@ -256,7 +289,7 @@
       dictionaryList().then((res) => {
         if (res.data.code === 200) {
           this.tableOption.column.forEach((item) => {
-            if (item.label == "单位类型") {
+            if (item.label == "企业属性") {
               item.dicData = res.data.data;
             }
           });
@@ -285,6 +318,7 @@
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
+      params = this.search;
       this.loading = true;
       let param = {};
       param["jurisdiction"] = params["jurname"] || "";
@@ -294,21 +328,22 @@
       param["size"] = page.pageSize;
       const { releaseTimeRange } = this.query;
       let values = {
+        ...param,
+      };
+      if (releaseTimeRange) {
+        values = {
           ...param,
+          startTime: releaseTimeRange[0],
+          endTime: releaseTimeRange[1],
+          ...this.query,
         };
-        if (releaseTimeRange) {
-          values = {
-            ...param,
-            startTime: releaseTimeRange[0],
-            endTime: releaseTimeRange[1],
-            ...this.query,
-          };
-          values.releaseTimeRange = null;
-        }
+        values.releaseTimeRange = null;
+      }
       selectYw(values).then((res) => {
         const data = res.data.data;
         this.page.total = data.total;
         this.tableData = data.records;
+        this.$store.commit("setWindowSizeHeightAdd");
         this.loading = false;
       });
     },
@@ -361,7 +396,7 @@
         this.dialogShow = true;
       } else if (column.label == "持证人数") {
         this.dialogTitle = "业务统计明细---持证保安人员清单";
-        this.searchitem = "dq";
+        this.searchitem = "zong";
         this.paramCz = true;
         this.fwdeptId = row.departmentid;
         this.dialogShow = true;
@@ -373,6 +408,7 @@
   mounted() {
     this.getSubOfficeData();
     this.getDictionaryList();
+    this.$store.commit("setWindowSizeHeightAdd");
   },
 };
 </script>

--
Gitblit v1.9.3