From 4f8b32bd745801b2ae75cd7150adf25f25316946 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Mon, 04 Dec 2023 11:41:47 +0800
Subject: [PATCH] 健康证,无犯罪记录批量上传新增

---
 src/views/securityGuard/securityGuard.vue |  164 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 119 insertions(+), 45 deletions(-)

diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index ee3c5a3..947afeb 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -69,6 +69,24 @@
               >个人照片批量上传
             </el-button>
             <el-button
+              type="success"
+              size="small"
+              plain
+              icon="el-icon-upload2"
+              v-if="permission.securityGuard_import"
+              @click="handleImportHealth"
+              >健康状况图片(健康证)批量上传
+            </el-button>
+            <el-button
+              type="success"
+              size="small"
+              plain
+              icon="el-icon-upload2"
+              v-if="permission.securityGuard_import"
+              @click="handleImportNoCriminal"
+              >无犯罪记录图片批量上传
+            </el-button>
+            <el-button
               type="primary"
               style="display: none;"
               size="small"
@@ -449,6 +467,32 @@
           </avue-form>
         </el-dialog>
         <el-dialog
+          title="健康状况图片(健康证)批量上传"
+          append-to-body
+          :visible.sync="excelBoxHealth"
+          width="555px"
+        >
+          <avue-form
+            :option="excelOptionHealth"
+            v-model="excelFormHealth"
+            :upload-after="uploadAfterHealth"
+          >
+          </avue-form>
+        </el-dialog>
+        <el-dialog
+          title="无犯罪记录图片批量上传"
+          append-to-body
+          :visible.sync="excelBoxNoCriminal"
+          width="555px"
+        >
+          <avue-form
+            :option="excelOptionNoCriminal"
+            v-model="excelFormNoCriminal"
+            :upload-after="uploadAfterNoCriminal"
+          >
+          </avue-form>
+        </el-dialog>
+        <el-dialog
           title="证件核实申请"
           :visible.sync="securityCheckApplyvisible"
           width="width"
@@ -710,44 +754,6 @@
       } else {
         callback(new Error("身份证错误"));
       }
-      // console.log(oldy, oldm, oldd, year - oldy, mouth, day);
-      // var test =
-      //   /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
-      // if (!test.test(value)) {
-      //   callback(new Error("请输入正确身份证号码"));
-      // } else {
-      //   // //加入校验18岁到60岁的
-      //   // oldy = +value.slice(6, 10);
-      //   // oldm = +value.slice(10, 12);
-      //   // oldd = +value.slice(12, 14);
-      //   // ok =
-      //   //   year - oldy < 18 || year - oldy > 60
-      //   //     ? false
-      //   //     : year - oldy == 18
-      //   //     ? mouth < oldm
-      //   //       ? false
-      //   //       : mouth > oldm
-      //   //       ? true
-      //   //       : day < oldd
-      //   //       ? false
-      //   //       : true
-      //   //     : year - oldy == 60
-      //   //     ? mouth < oldm
-      //   //       ? true
-      //   //       : mouth > oldm
-      //   //       ? false
-      //   //       : day <= oldd
-      //   //       ? false
-      //   //       : true
-      //   //     : true;
-      //   // if (ok) {
-      //   callback();
-      //   // } else {
-      //   //   // callback(new Error("根据国家要求,需在18岁至60岁"));
-      //   //   callback(new Error("年龄不符"));
-      // }
-
-      // }
     };
     const validatePassPhone = (rule, value, callback) => {
       var test = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9]|19[0-9])\d{8}$/g;
@@ -757,13 +763,9 @@
         callback();
       }
     };
-    // let table = document.getElementsByClassName("tablesss");
-    // let heard = table[0].getElementsByClassName("avue-crud__search");
-    // let usNum =
-    //   this.windowWidth <= 1376 && this.windowHeight <= 778 ? 170 : 332;
-    // // that.option.height = +h - (+heard[0].clientHeight + 332);
-    // let optionHeight = +this.windowHeight - (+heard[0].clientHeight + +usNum);
     return {
+      excelBoxHealth:false,
+      excelBoxNoCriminal:false,
       startTimecc: null,
       sort: "",
       type: 2,
@@ -844,6 +846,58 @@
             span: 24,
             propsHttp: {
               res: "data"
+            },
+            data:{
+              type:1
+            },
+            tip: "请上传 zip 压缩文件,照片文件名以身份证号码命名",
+            action: "/api/blade-resource/oss/endpoint/put-file-zip"
+          }
+        ]
+      },
+      // 健康状态凭证上传
+      excelFormHHealth: {},
+      excelOptionHealth: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "文件上传",
+            prop: "file",
+            type: "upload",
+            drag: true,
+            loadText: "文件上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data"
+            },
+            data:{
+              type:2
+            },
+            tip: "请上传 zip 压缩文件,照片文件名以身份证号码命名",
+            action: "/api/blade-resource/oss/endpoint/put-file-zip"
+          }
+        ]
+      },
+      // 无犯罪记录图片
+      excelFormNoCriminal: {},
+      excelOptionNoCriminal: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "文件上传",
+            prop: "file",
+            type: "upload",
+            drag: true,
+            loadText: "文件上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data"
+            },
+            //额外的参数
+            data:{
+              type:3
             },
             tip: "请上传 zip 压缩文件,照片文件名以身份证号码命名",
             action: "/api/blade-resource/oss/endpoint/put-file-zip"
@@ -1991,6 +2045,7 @@
         }=${getToken()}`
       );
     },
+    // 头像批量上传
     handleImport2() {
       this.excelBox2 = true;
     },
@@ -2000,7 +2055,26 @@
       this.refreshChange();
       done();
     },
-
+    // 健康状况图片(健康证)
+    handleImportHealth() {
+      this.excelBoxHealth = true;
+    },
+    uploadAfterHealth(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBoxHealth = false;
+      this.refreshChange();
+      done();
+    },
+    // 无犯罪记录图片
+    handleImportNoCriminal() {
+      this.excelBoxNoCriminal = true;
+    },
+    uploadAfterNoCriminal(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBoxNoCriminal = false;
+      this.refreshChange();
+      done();
+    },
     //行点击事件
     rowClick(row) {
       this.$router.push({

--
Gitblit v1.9.3