From bbb7ed59311d04ce1b07c25886cc12a6111bd140 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Thu, 28 Dec 2023 11:53:06 +0800
Subject: [PATCH] 装备添加字段,离职可上传图片

---
 src/views/securityGuard/securityGuard.vue |   99 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 95 insertions(+), 4 deletions(-)

diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index d18dcf6..b47d61e 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -100,8 +100,11 @@
                 </el-button>
                 <br v-if="permission.securityGuard_delete && row.status != 2" />
 
+<!--                <el-button icon="el-icon-circle-close" :size="size" :type="type"-->
+<!--                  v-if="permission.securityGuard_delete && row.status != 2" @click.stop="rowStatus(row)">离职-->
+<!--                </el-button>-->
                 <el-button icon="el-icon-circle-close" :size="size" :type="type"
-                  v-if="permission.securityGuard_delete && row.status != 2" @click.stop="rowStatus(row)">离职
+                           v-if="permission.securityGuard_delete && row.status != 2" @click.stop="rowLeaveStatus(row)">离职
                 </el-button>
                 <br v-if="permission.securityGuard_delete && row.status != 2" />
 
@@ -286,6 +289,18 @@
             </avue-form>
           </div>
         </el-dialog>
+
+
+        <el-dialog title="离职信息填写" :visible.sync="leaveInfoVisible" width="width" :modal="true"
+                   :modal-append-to-body="true" :append-to-body="true" :close-on-click-modal="false" :close-on-press-escape="false"
+                   :before-close="dialogBeforeClose">
+          <div>
+            <avue-form ref="formLeaveInfo" :option="optionLeaveInfo" v-model="formLeaveInfo"
+                        @submit="leaveInfoSubmit">
+            </avue-form>
+          </div>
+        </el-dialog>
+
         <div style="position: fixed; top: 9999px; width: 100%; height: 100%">
           <div class="certificate_box" id="certificateDom">
             <div class="security_main" ref="certificateBox">
@@ -359,7 +374,7 @@
   getUserPractitionersInfo,
   updatePaperTime,
   getzhiwen, //指纹
-  checkAccountByUser, batchAudit
+  checkAccountByUser, batchAudit, userLeave
 } from "@/api/system/user";
 import { securityApply } from "@/api/accreditationRecords/accreditationRecords";
 import { add } from "@/api/securityapplyRecord/securityapplyRecord";
@@ -1174,7 +1189,7 @@
                 hide: true,
               },
               {
-                label: "受理公安机关",
+                label: "受理机关",
                 prop: "acceptancePoliceUnit",
                 hide: true,
               },
@@ -1360,7 +1375,56 @@
         ]
       },
       tablevisible: true,
-      onceTableChange: 1
+      onceTableChange: 1,
+
+      leaveInfoVisible:false,
+      formLeaveInfo:{},
+      optionLeaveInfo: {
+        height: "auto",
+        calcHeight: 30,
+        dialogWidth: 1000,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        dialogClickModal: false,
+        menuPosition:"center",
+        emptyBtn:false,
+        column: [
+          {
+            label: "离职原因",
+            labelWidth: 110,
+            span: 24,
+            type: "textarea",
+            prop: "reasonForLeav"
+          },
+          {
+            label: "离职单图片",
+            prop: "imgForLeav",
+            labelWidth: 110,
+            type: "upload",
+            span: 24,
+            listType: "picture-img",
+            tip: "上传jpg/png文件,图片不超过1M",
+            propsHttp: {
+              res: "data",
+              url: "url"
+            },
+            canvasOption: {
+              text: " ",
+              ratio: 1.0
+            },
+            action: "/api/blade-resource/oss/endpoint/put-files",
+            rules: [
+              {
+                required: false,
+                message: "请上传离职单图片",
+                trigger: "blur"
+              }
+            ]
+          },
+        ]
+      },
     };
   },
   watch: {
@@ -2364,6 +2428,33 @@
         }
       );
     },
+
+
+    leaveInfoSubmit(row, done, loading){
+
+      console.log(this.formLeaveInfo)
+      this.formLeaveInfo.status = "2"
+      var that = this;
+      userLeave(this.formLeaveInfo).then(() => {
+        that.$refs.formLeaveInfo.resetFields();
+        this.$message({
+          type: "success",
+          message: `操作成功`
+        });
+        this.leaveInfoVisible = false;
+        this.onLoad(this.page);
+        done();
+      });
+      error => {
+        window.console.log(error);
+      };
+
+    },
+    rowLeaveStatus(row){
+      this.formLeaveInfo = row
+      this.leaveInfoVisible = true;
+    },
+
     rowStatus(row) {
       this.$prompt("离职原因", "提示", {
         confirmButtonText: "确定离职",

--
Gitblit v1.9.3