From 482327ba23a031a7755b05a811daa56aec4c8660 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 08 Dec 2021 10:46:20 +0800
Subject: [PATCH] 资格审查修改

---
 src/views/qualificationExamination/qualificationExamination.vue |  339 +++++++++-----------------------------------------------
 1 files changed, 57 insertions(+), 282 deletions(-)

diff --git a/src/views/qualificationExamination/qualificationExamination.vue b/src/views/qualificationExamination/qualificationExamination.vue
index 7000e67..8beb705 100644
--- a/src/views/qualificationExamination/qualificationExamination.vue
+++ b/src/views/qualificationExamination/qualificationExamination.vue
@@ -15,6 +15,7 @@
       :permission="permissionList"
       v-model="form"
       ref="crud"
+      :search.sync="search"
       @row-update="rowUpdates"
       @row-save="rowSave"
       @row-del="rowDel"
@@ -43,23 +44,15 @@
 </template>
 
 <script>
-// import {
-//   getList,
-//   getDetail,
-//   adddata,
-//   update,
-//   remove,
-// } from "@/api/regulatoryInformation/regulatoryInformation";
 import { mapGetters } from "vuex";
-import { datasing } from "./dataqualificationExamination";
-// import { getList } from "@/api/qualificationExamination/qualificationExamination";
 import { getListSecurity } from "@/api/system/user";
 import Qs from "qs";
-
+import { getToken } from "@/util/auth";
 export default {
   data() {
     return {
       sort: {},
+      search: {},
       form: {},
       query: {},
       loading: true,
@@ -76,9 +69,7 @@
         addBtn: false,
         selection: true,
         menu: false,
-
         searchShowBtn: false,
-
         align: "center",
         height: "auto",
         calcHeight: 30,
@@ -88,22 +79,20 @@
         index: true,
         viewBtn: true,
         dialogClickModal: false,
-
         column: [
           {
             label: "保安姓名",
             prop: "realName",
             search: true,
             searchSpan: 4,
-            //     hide: true,
-            //     editDisplay: false,
-            //     addDisplay: false
           },
           {
-            label: "保安公司",
+            label: "企业名称",
             prop: "deptName",
             minWidth: 110,
             overHidden: true,
+            search:true,
+            searchSpan:5
           },
           {
             label: "性别",
@@ -133,7 +122,6 @@
             type: "date",
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd",
-            searchValue: [this.getStartTime(), this.getEndTime()],
             searchRange: true,
             searchSpan: 6,
             searchLabelWidth: 80,
@@ -150,51 +138,16 @@
               },
             ],
           },
-          // {
-          //   label: "性别",
-          //   prop: "sexName",
-          //   width: 56,
-          //   // type: "select",
-          //   // labelWidth: 120,
-          //   // // display: false,
-          //   // dicData: dic,
-          //   // // props: {
-          //   // //   label: "label",
-          //   // //   value: "value",
-          //   // // },
-          //   // searchSpan: 5,
-          //   // search: true,
-          //   // width: 120,
-          // },
           {
             label: "身份证号",
             prop: "cardid",
             width: 139,
-            // type: "select",
-            // labelWidth: 120,
-            // // display: false,
-            // dicData: dic,
-            // // props: {
-            // //   label: "label",
-            // //   value: "value",
-            // // },
             searchSpan: 4,
             search: true,
-
-            // width: 120,
           },
-          // {
-          //   label: "保安员证",
-          //   prop: "certificate",
-          //   // labelWidth: 120,
-          //   // display: false,
-          // },
           {
             label: "年龄",
             prop: "age",
-            // display: false,
-            // labelWidth: 120,
-            // width: 200,
           },
           {
             label: "出生日期",
@@ -202,9 +155,6 @@
             type: "date",
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd",
-            // display: false,
-            // labelWidth: 120,
-            // width: 200,
           },
           {
             label: "保安员证编号",
@@ -216,26 +166,17 @@
           {
             label: "联系方式",
             prop: "phone",
-            // display: false,
-            // labelWidth: 120,
-            // width: 200,
           },
-          // {
-          //   label: "所属角色",
-          //   prop: "roleName",
-          //   // display: false,
-          //   overHidden: true,
-          //   // width: 200,
-          //   // labelWidth: 120,
-          //   // overHidden: true,
-          // },
           {
             label: "审查状态",
             prop: "examinationType",
-            // overHidden: true,
             sortable: true,
             type: "select",
             dicData: [
+              {
+                label: "全部",
+                value: "2",
+              },
               {
                 label: "正常",
                 value: "0",
@@ -245,39 +186,20 @@
                 value: "1",
               },
             ],
-            // type: "date",
-            // format: "yyyy-MM-dd",
-            // valueFormat: "yyyy-MM-dd",
-            // mock: {
-            //   type: "datetime",
-            //   labelWidth: 120,
-            //   format: "yyyy-MM-dd",
-            // },
             search: true,
             searchSpan: 4,
-            // // display: false,
-            // width: 180,
           },
 
           {
             label: "审查明细",
             prop: "examinationMx",
             sortable: true,
-            // labelWidth: 120,
-            // display: false,
+            overHidden: true,
           },
-          // {
-          //   label: "审查结果",
-          //   prop: "results",
-          //   // labelWidth: 120,
-          //   // display: false,
-          // },
           {
             label: "审查时间",
-            prop: "reviewTime",
-            // labelWidth: 120,
-            // display: false,
-            hide: true,
+            prop: "auditTime",
+            // hide: true,
           },
           // {
           //   label: "是否在职",
@@ -286,42 +208,8 @@
           //   // display: false,
           // },
         ],
-        // group: [
-        //   {
-        //     label: "详细信息",
-        //     prop: "baseInfo",
-        //     icon: "el-icon-user-solid",
-        //     column: [
-        //       {
-        //         label: "公司名称",
-        //         prop: "enterprisename",
-        //         display: false,
-        //       },
-        //     ],
-        //   },
-        //   {
-        //     label: "详细信息",
-        //     prop: "detailInfo",
-        //     icon: "el-icon-s-order",
-        //     column: [],
-        //   },
-        //   {
-        //     label: "职责信息",
-        //     prop: "dutyInfo",
-        //     icon: "el-icon-s-custom",
-        //     column: [],
-        //   },
-        // ],
       },
       data: [
-        // {
-        //   deptid: "江西众泰保安公司",
-        //   punishtype: 2,
-        //   punishreason: "非法施工",
-        //   punishresult: "没收全部非法所得财产,并罚款3W元",
-        //   punishtime: "2021-01-01",
-        //   punisnum: 110110110120,
-        // },
       ],
     };
   },
@@ -343,6 +231,9 @@
       return ids.join(",");
     },
   },
+  created() {
+    this.search["examinationType"] = "1";
+  },
   methods: {
     //导出
     handleExport() {
@@ -350,133 +241,38 @@
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-      })
-        .then(() => {
-          //获取查询条件
-          // console.log(this.userInfo, 456);
-          // console.log(this.query, 456);
-          // return;
-          var data = {
-            cardid: this.query.cardid,
-            realName: this.query.realName,
-            securitynumber: this.query.securitynumber,
-            status: this.query.status,
-            endTime: this.query.endTime,
-            startTime: this.query.startTime,
-            jurisdiction: this.userInfo.jurisdiction,
-          };
-          //导出
-          // if (
-          //   this.userInfo.role_name == "保安公司管理员" ||
-          //   this.userInfo.role_name == "保安"
-          // ) {
-          //   //如果是保安公司管理员
-          //   data["deptId"] = this.userInfo.dept_id;
-          // }
-          // if (this.userInfo.role_name == "培训公司管理员") {
-          //   //如果是培训公司管理员
-          //   data["trainUnitId"] = this.userInfo.dept_id;
-          // }
-          // data["examType"] = 2;
-          //序列号url形式,用&拼接
-          data = Qs.stringify(data);
-          window.open(`/api/blade-user/export-security?` + data);
-        })
-        .catch((action) => {
-          // this.$message({
-          //   type: 'info',
-          //   message: action === 'cancel'
-          //     ? '放弃保存并离开页面'
-          //     : '停留在当前页面'
-          // })
-        });
-    },
-    getStartTime() {
-      if (
-        this.$route.query.startTime != undefined &&
-        this.$route.query.startTime != null &&
-        this.$route.query.startTime != ""
-      ) {
-        return this.$route.query.startTime;
-      }
-      return "";
-    },
-    getEndTime() {
-      if (
-        this.$route.query.endTime != undefined &&
-        this.$route.query.endTime != null &&
-        this.$route.query.endTime != ""
-      ) {
-        return this.$route.query.endTime;
-      }
-      return "";
-    },
-
-    rowSave(row, done, loading) {
-      adddata(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          done();
-        },
-        (error) => {
-          window.console.log(error);
-          loading();
+      }).then(() => {
+        //获取查询条件
+        const { releaseTimeRange } = this.search;
+        if (releaseTimeRange) {
+          this.search["startTime"] = releaseTimeRange[0];
+          this.search["endTime"] = releaseTimeRange[1];
         }
-      );
+        var data = {
+          cardid: this.search.cardid,
+          realName: this.search.realName,
+          securitynumber: this.search.securitynumber,
+          endTime: this.search.endTime,
+          deptName:this.search.deptName,
+          startTime: this.search.startTime,
+          examinationType:this.search.examinationType,
+          jurisdiction: this.userInfo.jurisdiction,
+        };
+        data["status"] = 1;
+        //序列号url形式,用&拼接
+        data = Qs.stringify(data);
+        window.open(`/api/blade-user/export-security?${
+            this.website.tokenHeader
+          }=${getToken()}&` + data);
+      });
     },
-    rowUpdates(row, index, done, loading) {
-      // console.log(42342);
-      update(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          done();
-        },
-        (error) => {
-          window.console.log(error);
-          loading();
-        }
-      );
-    },
-    rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          return remove(row.id);
-        })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-        });
-    },
-    // beforeOpen(done, type) {
-    //   if (["edit", "view"].includes(type)) {
-    //     getDetail(this.form.id).then((res) => {
-    //       this.form = res.data.data;
-    //     });
-    //   }
-    //   done();
-    // },
     searchReset() {
       this.query = {};
       this.onLoad(this.page);
     },
     searchChange(params, done) {
-      params["startTime"] = params.releaseTimeRange[0];
-      params["endTime"] = params.releaseTimeRange[1];
+      // params["startTime"] = params.releaseTimeRange[0];
+      // params["endTime"] = params.releaseTimeRange[1];
       this.query = params;
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
@@ -511,14 +307,27 @@
       this.onLoad(this.page, this.sort);
     },
     onLoad(page, params = {}) {
-      // this.loading = false;
+      params = this.search;
       params = Object.assign(params, this.sort);
-      this.loading = true;
+      // this.loading = true;
       params["status"] = 1;
+      let values = {
+        ...params,
+      };
+      const { releaseTimeRange } = this.search;
+      if (releaseTimeRange) {
+        values = {
+          ...params,
+          startTime: releaseTimeRange[0],
+          endTime: releaseTimeRange[1],
+          ...this.query,
+        };
+        values.releaseTimeRange = null;
+      }
       getListSecurity(
         page.currentPage,
         page.pageSize,
-        Object.assign(params, this.query)
+        Object.assign(values, this.query)
       ).then((res) => {
         const data = res.data.data;
         this.page.total = data.total;
@@ -547,40 +356,6 @@
         // this.selectionClear();
       });
     },
-    // onLoad(page, params = {}) {
-    //   // this.loading = false;
-    //   this.loading = true;
-    //   //   getListJSON().then((res) => {
-    //   //   axios
-    //   //     .get(
-    //   //       "../../api/qualificationExamination/signQualificationExamination.json"
-    //   //     )
-    //   //     .then((res) => {
-    //   // page.currentPage,
-    //   // page.pageSize,
-    //   // Object.assign(params, this.query)
-    //   if (datasing) {
-    //     var res = datasing;
-    //     console.log(res, "signQualificationExamination");
-    //     const data = res.data;
-    //     // this.page.total = data.total;
-    //     var d = data.records;
-    //     for (var k in d) {
-    //       d[k].examination_mx = "正常";
-    //       d[k].examination_type = "正常";
-    //       d[k]["carid"] = "370111198807051124";
-    //       d[k]["certificate"] = "拥有";
-    //       d[k]["reviewTime"] = "2021-02-21";
-    //       d[k]["results"] = "通过";
-    //       d[k]["onjob"] = "是";
-    //     }
-    //     this.data = d;
-    //     this.loading = false;
-    //   }
-    //   // this.selectionClear();
-    //   // });
-    // },
-
     // 行单击
     handleRowClick(row) {
       // delete (row["name"]);

--
Gitblit v1.9.3