From 8eccc9770ab63dc608c4d0bdc520f69e2f0ba065 Mon Sep 17 00:00:00 2001
From: zhengpz <1838927346@qq.com>
Date: Sun, 22 Aug 2021 20:57:27 +0800
Subject: [PATCH] 表完善

---
 src/views/statisticalQueryManagement/businessStatistics.vue      |  134 +++++++++++++-------------
 src/views/statisticalQueryManagement/companyDetails.vue          |   79 ++++++---------
 src/views/statisticalQueryManagement/securityGuardStatistics.vue |   78 +--------------
 3 files changed, 108 insertions(+), 183 deletions(-)

diff --git a/src/views/statisticalQueryManagement/businessStatistics.vue b/src/views/statisticalQueryManagement/businessStatistics.vue
index 193f143..62103cf 100644
--- a/src/views/statisticalQueryManagement/businessStatistics.vue
+++ b/src/views/statisticalQueryManagement/businessStatistics.vue
@@ -2,12 +2,19 @@
   <basic-container>
     <avue-crud
       :option="tableOption"
-      :data="tableData"
-      :page.sync="tablePage"
       :table-loading="loading"
+      :data="tableData"
+      :page.sync="page"
       :permission="permissionList"
-      :before-open="beforeOpen"
-      @date-change="dateChange"
+      ref="crud"
+      @row-update="rowUpdates"
+      @row-save="rowSave"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @on-load="onLoad"
       @cell-click="handleRowClick"
       :cell-style="cellStyle"
       class="businessStatisticsStyle"
@@ -20,10 +27,16 @@
 import XLSX from "xlsx";
 import { mapGetters } from "vuex";
 import { selectYw } from "../../api/statisticalQueryManagement/statisticalQueryManagement";
+import { lazyTreeJu } from "../../api/index/index";
 export default {
   name: "业务情况统计",
   data() {
     return {
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
       value1: "",
       value2: "",
       tableData: [
@@ -46,11 +59,6 @@
         //   num: "974"
         // }
       ],
-      tablePage: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 0
-      },
       tableOption: {
         excelBtn: true,
         delBtn: false,
@@ -84,33 +92,10 @@
             searchSpan: 4,
             type: "select",
             props: {
-              label: "label",
-              value: "value"
+              label: "title",
+              value: "id"
             },
-            // cascaderItem: ["city", "area"],
-            // dicUrl:subofficeOptions,
-            dicData: [
-              {
-                value: "0",
-                label: "南昌市公安局"
-              },
-              {
-                value: "2",
-                label: "东湖分局"
-              },
-              {
-                value: "3",
-                label: "西湖分局"
-              },
-              {
-                value: "4",
-                label: "青云谱分局"
-              },
-              {
-                value: "5",
-                label: "青山湖分局"
-              }
-            ],
+            dicData: [],
             search: true,
             rules: [
               {
@@ -132,7 +117,7 @@
           }
         ]
       },
-       loading:true,
+      loading: true
     };
   },
   computed: {
@@ -147,6 +132,53 @@
     }
   },
   methods: {
+    getSubOfficeData() {
+      lazyTreeJu().then(res => {
+        if (res.data.code === 200) {
+          this.tableOption.column.forEach(item => {
+            if (item.label == "所属辖区") {
+              item.dicData = res.data.data;
+            }
+          });
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+     searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      let param = {};
+      param["jurisdiction"] = params["jurname"] ? params["jurname"] : "";
+      param["deptid"] = "";
+      param["current"] = page.currentPage;
+      param["size"] = page.pageSize;
+      selectYw(param).then(res => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.tableData = res.data.data;
+        this.loading = false;
+      });
+    },
     handleRowClick(row, column, cell, event) {
       if (column.label == "服务对象数量" || column.label == "保安员人数") {
         this.$router.push({
@@ -158,37 +190,9 @@
       // if (columnIndex == 4 || columnIndex == 5) {
       // }
     },
-    dateChange() {},
-    getTableData() {
-      selectYw({current: 1, size: 10 }).then(res => {
-        if (res.data.code === 200) {
-          this.tableData = res.data.data;
-          this.loading = false;
-        }
-      });
-    }
-    // downExcel() {
-    //   let et = XLSX.utils.table_to_book(document.getElementById("table"));
-    //   let etout = XLSX.write(et, {
-    //     bookType: "xlsx",
-    //     bookSST: true,
-    //     type: "array"
-    //   });
-    //   try {
-    //     FileSaver.saveAs(
-    //       new Blob([etout], {
-    //         type: "application/octet-stream"
-    //       }),
-    //       `表.xlsx`
-    //     ); //导出的文件名
-    //   } catch (e) {
-    //     console.log(e, etout);
-    //   }
-    //   return etout;
-    // }
   },
   mounted() {
-    this.getTableData();
+    this.getSubOfficeData();
   }
 };
 </script>
diff --git a/src/views/statisticalQueryManagement/companyDetails.vue b/src/views/statisticalQueryManagement/companyDetails.vue
index fd526be..3387f09 100644
--- a/src/views/statisticalQueryManagement/companyDetails.vue
+++ b/src/views/statisticalQueryManagement/companyDetails.vue
@@ -7,8 +7,6 @@
       :page.sync="page"
       :permission="permissionList"
       ref="crud"
-      @row-update="rowUpdates"
-      @row-save="rowSave"
       @search-change="searchChange"
       @search-reset="searchReset"
       @current-change="currentChange"
@@ -94,7 +92,7 @@
         dialogClickModal: false,
         column: [
           {
-            label: "保安员姓名",
+            label: "保安姓名",
             searchLabelWidth: 110,
             prop: "real_name",
             search: true,
@@ -103,7 +101,7 @@
           },
 
           {
-            label: "保安员编号",
+            label: "保安证编号",
             prop: "securitynumber",
             display: false
           },
@@ -113,7 +111,7 @@
             display: false
           },
           {
-            label: "联系电话",
+            label: "联系方式",
             prop: "phone",
             display: false
           },
@@ -130,12 +128,16 @@
             // dicUrl:subofficeOptions,
             dicData: [
               {
-                value: "0",
+                value: "1",
                 label: "是"
               },
               {
                 value: "2",
                 label: "否"
+              },
+              {
+                value: "3",
+                label: "吊销"
               }
             ],
             search: true,
@@ -164,7 +166,7 @@
                 label: "是"
               },
               {
-                value: "2",
+                value: "1",
                 label: "否"
               }
             ],
@@ -194,7 +196,7 @@
                 label: "是"
               },
               {
-                value: "2",
+                value: "1",
                 label: "否"
               }
             ],
@@ -220,10 +222,10 @@
             dicData: [
               {
                 value: "0",
-                label: "通过"
+                label: "正常"
               },
               {
-                value: "2",
+                value: "1",
                 label: "异常"
               }
             ],
@@ -280,7 +282,7 @@
                 label: "是"
               },
               {
-                value: "2",
+                value: "1",
                 label: "否"
               }
             ],
@@ -311,38 +313,6 @@
     }
   },
   methods: {
-    rowSave(row, done, loading) {
-      adddata(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        },
-        error => {
-          window.console.log(error);
-          loading();
-        }
-      );
-    },
-    rowUpdates(row, index, done, loading) {
-      update(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        },
-        error => {
-          window.console.log(error);
-          loading();
-        }
-      );
-    },
     searchChange(params, done) {
       this.query = params;
       this.page.currentPage = 1;
@@ -369,7 +339,13 @@
       //   params = { current: page.currentPage, size: page.pageSize };
       // }
       let param = {};
-      param["deptid"] = "1412222709480509442";
+      param["deptid"] = params["deptid"] || "";
+      param["name"] = params["real_name"] || "";
+      param["hold"] = params["hold"] || "";
+      param["photo"] = params["photo"] || "";
+      param["examinationtype"] = params["examination_type"] || "";
+      param["dispatch"] = params["dispatch"] || "";
+      param["soil"] = params["soil"] || "";
       param["current"] = page.currentPage;
       param["size"] = page.pageSize;
       selectUIn(param).then(res => {
@@ -380,7 +356,7 @@
         this.loading = false;
         // this.selectionClear();
       });
-    }
+    },
     // getTableData() {
     //   selectUIn(param).then(res => {
     //     if (res.data.code === 200) {
@@ -408,9 +384,22 @@
     //   }
     //   return etout;
     // }
+    getLocationParams() {
+      let url = window.location.href;
+      let urlArr = url.split("?")[1].split("&");
+      var object = new Object();
+      for (var i = 0; i < urlArr.length; i++) {
+        let mm = urlArr[i].split("=");
+        object[decodeURIComponent(mm[0])] = decodeURIComponent(mm[1]);
+      }
+      let deptid = object["deptid"] || "";
+      let obj = { deptid: deptid };
+      this.onLoad(this.page, obj);
+    }
   },
   mounted() {
     // this.getTableData();
+    this.getLocationParams();
   }
 };
 </script>
diff --git a/src/views/statisticalQueryManagement/securityGuardStatistics.vue b/src/views/statisticalQueryManagement/securityGuardStatistics.vue
index e11611d..ccc2722 100644
--- a/src/views/statisticalQueryManagement/securityGuardStatistics.vue
+++ b/src/views/statisticalQueryManagement/securityGuardStatistics.vue
@@ -7,8 +7,6 @@
       :page.sync="page"
       :permission="permissionList"
       ref="crud"
-      @row-update="rowUpdates"
-      @row-save="rowSave"
       @search-change="searchChange"
       @search-reset="searchReset"
       @current-change="currentChange"
@@ -217,38 +215,6 @@
         }
       });
     },
-    rowSave(row, done, loading) {
-      adddata(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        },
-        error => {
-          window.console.log(error);
-          loading();
-        }
-      );
-    },
-    rowUpdates(row, index, done, loading) {
-      update(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        },
-        error => {
-          window.console.log(error);
-          loading();
-        }
-      );
-    },
     searchChange(params, done) {
       this.query = params;
       this.page.currentPage = 1;
@@ -271,57 +237,23 @@
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      // if (!params) {
-      //   params = { current: page.currentPage, size: page.pageSize };
-      // }
       let param = {};
       param["jurisdiction"] = params["jurname"] ? params["jurname"] : "";
-      param["deptid"] =  "";
+      param["deptid"] = "";
       param["current"] = page.currentPage;
       param["size"] = page.pageSize;
       selectLi(param).then(res => {
         const data = res.data.data;
         this.page.total = data.total;
         this.tableData = res.data.data;
-        // this.data = data.records;
-        console.log(this.data);
         this.loading = false;
-        // this.selectionClear();
       });
     },
-    // toCompanyDetails() {
-    //   this.$router.push({ path: "/statisticalQueryManagement/companyDetails" });
-    // },
     handleRowClick(row, event, column) {
-      this.$router.push({ path: "/statisticalQueryManagement/companyDetails" });
-    },
-    // getTableData() {
-    //   selectLi({ current: 1, size: 10 }).then(res => {
-    //     if (res.data.code === 200) {
-    //       this.tableData = res.data.data;
-    //       this.loading = false;
-    //     }
-    //   });
-    // }
-    // downExcel() {
-    //   let et = XLSX.utils.table_to_book(document.getElementById("table"));
-    //   let etout = XLSX.write(et, {
-    //     bookType: "xlsx",
-    //     bookSST: true,
-    //     type: "array"
-    //   });
-    //   try {
-    //     FileSaver.saveAs(
-    //       new Blob([etout], {
-    //         type: "application/octet-stream"
-    //       }),
-    //       `表.xlsx`
-    //     ); //导出的文件名
-    //   } catch (e) {
-    //     console.log(e, etout);
-    //   }
-    //   return etout;
-    // }
+      this.$router.push({
+        path: "/statisticalQueryManagement/companyDetails?deptid=" + row.dept_id
+      });
+    }
   },
   mounted() {
     this.getSubOfficeData();

--
Gitblit v1.9.3