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/qualificationExamination/qualificationExamination.vue |  545 ++++++++++++++++++++++++++----------------------------
 1 files changed, 262 insertions(+), 283 deletions(-)

diff --git a/src/views/qualificationExamination/qualificationExamination.vue b/src/views/qualificationExamination/qualificationExamination.vue
index 34cce98..2f18269 100644
--- a/src/views/qualificationExamination/qualificationExamination.vue
+++ b/src/views/qualificationExamination/qualificationExamination.vue
@@ -1,13 +1,15 @@
-/*
- * @Author: Morpheus
- * @Date: 2021-07-07 17:30:05
- * @Last Modified by: Morpheus
- * @Last Modified time: 2021-07-10 16:06:14
- * menu-name 监管信息
- */
+/* * @Author: Morpheus * @Date: 2021-07-07 17:30:05 * @Last Modified by: liu *
+@Last Modified time: 2021-11-26 09:53:14 * menu-name 监管信息 */
 <template>
-  <basic-container>
+  <basic-container
+    :class="[
+      'witerFontColorInput',
+      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
+      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '',
+    ]"
+  >
     <avue-crud
+      class="tablesss"
       :option="option"
       :table-loading="loading"
       :data="data"
@@ -15,6 +17,7 @@
       :permission="permissionList"
       v-model="form"
       ref="crud"
+      :search.sync="search"
       @row-update="rowUpdates"
       @row-save="rowSave"
       @row-del="rowDel"
@@ -25,27 +28,59 @@
       @size-change="sizeChange"
       @refresh-change="refreshChange"
       @on-load="onLoad"
+      @sort-change="sortChange"
     >
+      <!-- 自定义按钮 -->
+      <template slot="menuLeft">
+        <el-button
+          type="warning"
+          size="small"
+          plain
+          icon="el-icon-download"
+          @click="handleExport"
+          >导出
+        </el-button>
+      </template>
+      <template slot-scope="{ type, size, row }" slot="menu">
+        <el-button
+          :type="type"
+          :size="size"
+          icon="el-icon-edit"
+          :disabled="row.examinationType != 1"
+          @click="handleAuditDesc(row)"
+          >审查异常备注
+        </el-button>
+      </template>
     </avue-crud>
+
+    <el-dialog
+      title="审查异常备注"
+      append-to-body
+      :visible.sync="dialogAudit"
+      width="900px"
+      @close="closeDialog"
+    >
+      <avue-form
+        ref="formAudit"
+        v-model="audit"
+        :option="optionAuditDesc"
+        @reset-change="emptytChange"
+        @submit="submitAudit"
+      ></avue-form>
+    </el-dialog>
   </basic-container>
 </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 { getListSecurity, updateUser } from "@/api/system/user";
+import Qs from "qs";
+import { getToken } from "@/util/auth";
 export default {
   data() {
     return {
+      sort: {},
+      search: {},
       form: {},
       query: {},
       loading: true,
@@ -53,6 +88,36 @@
         pageSize: 10,
         currentPage: 1,
         total: 0,
+        ...this.$store.state.control.changePageSize,
+      },
+      id: "",
+      batchAudit: {},
+      dialogAudit: false,
+      optionAuditDesc: {
+        height: "auto",
+        filterBtn: true,
+        calcHeight: 30,
+        dialogWidth: 950,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true, //liu
+        index: true,
+        stripe: true,
+        viewBtn: true,
+        selection: false,
+        excelBtn: false,
+        menuWidth: 380,
+        dialogClickModal: false,
+        ...this.$store.state.control.clearOtherBut,
+        column: [
+          {
+            label: "审核明细",
+            span: 24,
+            type: "textarea",
+            prop: "emails",
+          },
+        ],
       },
       selectionList: [],
       option: {
@@ -61,10 +126,9 @@
         editBtn: false,
         addBtn: false,
         selection: true,
-        menu: false,
-
+        menu: true,
+        menuWidth: 150,
         searchShowBtn: false,
-
         align: "center",
         height: "auto",
         calcHeight: 30,
@@ -74,113 +138,76 @@
         index: true,
         viewBtn: true,
         dialogClickModal: false,
-
+        ...this.$store.state.control.clearOtherBut,
         column: [
-          {
-            label: "保安公司",
-            prop: "deptName",
-            minWidth: 110,
-            overHidden: true,
-            // labelWidth: 120,
-            // searchLabelWidth: 120,
-            // searchSpan: 4,
-            // dicUrl:
-            //   "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
-            // props: {
-            //   label: "title",
-            //   value: "id",
-            // },
-            // search: true,
-            // overHidden: true,
-            // type: "select",
-            // rules: [
-            //   {
-            //     required: true,
-            //     message: "请输入保安公司",
-            //     trigger: "blur",
-            //   },
-            // ],
-          },
-          // {
-          //   label: "deptId",
-          //   prop: "deptId",
-          //   overHidden: true,
-          //   // labelWidth: 120,
-          //   // searchLabelWidth: 120,
-          //   searchSpan: 4,
-          //   dicUrl:
-          //     "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
-          //   props: {
-          //     label: "title",
-          //     value: "id",
-          //   },
-          //   // hide: true,
-          //   search: true,
-          //   // overHidden: true,
-          //   type: "select",
-          //   // rules: [
-          //   //   {
-          //   //     required: true,
-          //   //     message: "请输入保安公司",
-          //   //     trigger: "blur",
-          //   //   },
-          //   // ],
-          // },
           {
             label: "保安姓名",
             prop: "realName",
             search: true,
             searchSpan: 4,
-            //     hide: true,
-            //     editDisplay: false,
-            //     addDisplay: false
           },
-
+          {
+            label: "企业名称",
+            prop: "deptName",
+            minWidth: 110,
+            overHidden: true,
+            search: true,
+            searchSpan: 5,
+          },
           {
             label: "性别",
-            prop: "sexName",
-            width: 56,
-            // type: "select",
-            // labelWidth: 120,
-            // // display: false,
-            // dicData: dic,
-            // // props: {
-            // //   label: "label",
-            // //   value: "value",
-            // // },
-            // searchSpan: 5,
-            // search: true,
-            // width: 120,
+            prop: "sex",
+            width: 55,
+            slot: true,
+            type: "select",
+            dicData: [
+              {
+                label: "男",
+                value: 1,
+              },
+              {
+                label: "女",
+                value: 2,
+              },
+              {
+                label: "未知",
+                value: 3,
+              },
+            ],
+            display: false,
+          },
+          {
+            label: "审查时间",
+            prop: "releaseTimeRange",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd",
+            searchRange: true,
+            searchSpan: 6,
+            searchLabelWidth: 80,
+            hide: true,
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: false,
+            search: true,
+            rules: [
+              {
+                required: true,
+                message: "请输入时间",
+                trigger: "blur",
+              },
+            ],
           },
           {
             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: "出生日期",
@@ -188,9 +215,6 @@
             type: "date",
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd",
-            // display: false,
-            // labelWidth: 120,
-            // width: 200,
           },
           {
             label: "保安员证编号",
@@ -202,110 +226,58 @@
           {
             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,
-            // 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,
+            sortable: true,
+            type: "select",
+            dicData: [
+              {
+                label: "全部",
+                value: "2",
+              },
+              {
+                label: "正常",
+                value: "0",
+              },
+              {
+                label: "异常",
+                value: "1",
+              },
+            ],
+            search: true,
+            searchSpan: 4,
           },
 
           {
             label: "审查明细",
             prop: "examinationMx",
-            // labelWidth: 120,
-            // display: false,
+            sortable: true,
+            overHidden: true,
           },
-          // {
-          //   label: "审查结果",
-          //   prop: "results",
-          //   // labelWidth: 120,
-          //   // display: false,
-          // },
           {
             label: "审查时间",
-            prop: "reviewTime",
-            // labelWidth: 120,
-            // display: false,
-            hide: true,
+            prop: "auditTime",
+            // hide: true,
           },
-          // {
-          //   label: "是否在职",
-          //   prop: "status",
-          //   // labelWidth: 120,
-          //   // display: false,
-          // },
+          {
+            label: "审查异常备注",
+            prop: "emails",
+          },
         ],
-        // 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,
-        // },
-      ],
+      data: [],
     };
   },
   computed: {
-    ...mapGetters(["permission"]),
+    ...mapGetters(["permission", "userInfo"]),
     permissionList() {
       return {
-        addBtn: this.vaildData(this.permission.post_add, false),
-        viewBtn: this.vaildData(this.permission.post_view, false),
-        delBtn: this.vaildData(this.permission.post_delete, false),
-        editBtn: this.vaildData(this.permission.post_edit, false),
+        addBtn: this.vaildData(null, false),
+        viewBtn: this.vaildData(null, false),
+        delBtn: this.vaildData(null, false),
+        editBtn: this.vaildData(null, false),
       };
     },
     ids() {
@@ -316,14 +288,36 @@
       return ids.join(",");
     },
   },
+  created() {
+    this.search["examinationType"] = "1";
+  },
+  mounted() {
+    this.$store.commit("setWindowSizeHeightAdd");
+  },
   methods: {
-    rowSave(row, done, loading) {
-      adddata(row).then(
+    //证书批量审核
+    handleAuditDesc(row) {
+      console.log(row, 123);
+      this.id = row.id;
+
+      this.dialogAudit = true;
+    },
+    //审查异常备注提交
+    submitAudit(row, done, loading) {
+      var that = this;
+      const data = {
+        id: this.id,
+        emails: row.emails,
+      };
+      //提交申请
+      updateUser(data).then(
         () => {
           this.onLoad(this.page);
+          that.$refs.formAudit.resetFields();
+          that.dialogAudit = false;
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "操作成功",
           });
           done();
         },
@@ -333,53 +327,46 @@
         }
       );
     },
-    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("确定将选择数据删除?", {
+    //导出
+    handleExport() {
+      this.$confirm("是否导出审查信息?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-      })
-        .then(() => {
-          return remove(row.id);
-        })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-        });
+      }).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
+        );
+      });
     },
-    // 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];
       this.query = params;
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
@@ -405,72 +392,65 @@
       var d = new Date();
       return d.getFullYear();
     },
+    sortChange(val) {
+      // console.log(val);
+      this.sort = {
+        sort: val.order == "descending" ? "asc" : "desc",
+        useName: val.prop,
+      };
+      this.onLoad(this.page, this.sort);
+    },
     onLoad(page, params = {}) {
-      // this.loading = false;
-      this.loading = true;
+      params = this.search;
+      params = Object.assign(params, this.sort);
+      // 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;
         var d = data.records;
         for (var k in d) {
-          if (d[k]["examinationMx"] == "") {
-            d[k]["examinationMx"] = "正常";
-            d[k]["examinationType"] = "正常";
-          } else {
-            d[k]["examinationType"] = "异常";
-          }
+          // if (d[k]["examinationType"] == "0") {
+          //   d[k]["examinationMx"] = "正常";
+          //   d[k]["examinationType"] = "正常";
+          // } else {
+          //   // console.log(d[k]);
+          //   d[k]["examinationType"] = "异常";
+          // }
           // if (d[k]["examinationType"] == "") {
           //   d[k]["examinationType"] = "正常";
           // }
+          if (!d[k].examinationType) {
+            d[k].examinationType = "0";
+          }
           var sfz = d[k].cardid.substring(6, 10);
           d[k]["age"] = this.getyears() - sfz;
         }
         this.data = d;
+        this.$store.commit("setWindowSizeHeightAdd");
         // this.data = data.records;
-        console.log(this.data);
+        // console.log(this.data);
         this.loading = false;
         // 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"]);
@@ -485,5 +465,4 @@
 };
 </script>
 
-<style>
-</style>
+<style></style>

--
Gitblit v1.9.3