From fb591d893e7cdeb3efea4678cf99bf14baf6733e Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 03 Sep 2021 17:30:57 +0800
Subject: [PATCH] 营业执照 许可证  可删除  解决单位信息  社保信息的bug

---
 src/views/securityUnitChild/licence.vue         |   27 ++++++++++++-
 src/views/securityUnitChild/social.vue          |   10 +++--
 src/views/securityUnitChild/businessLicense.vue |   27 ++++++++++++-
 3 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/src/views/securityUnitChild/businessLicense.vue b/src/views/securityUnitChild/businessLicense.vue
index 8637e5a..4c79944 100644
--- a/src/views/securityUnitChild/businessLicense.vue
+++ b/src/views/securityUnitChild/businessLicense.vue
@@ -2,7 +2,12 @@
   <div class="businessLicense">
     <el-container>
       <el-main>
-        <avue-form :option="option" v-model="form" :upload-after="uploadAfter">
+        <avue-form
+          :option="option"
+          v-model="form"
+          :upload-after="uploadAfter"
+          :upload-delete="uploadDelete"
+        >
         </avue-form
       ></el-main>
     </el-container>
@@ -57,6 +62,24 @@
         this.form.imgUrl = this.row.businessLicense;
       }
     },
+    uploadDelete(column, file) {
+      this.row.businessLicense = "";
+      return update(this.row)
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "删除成功!",
+          });
+          // done();
+        })
+        .catch((error) => {
+          this.$message({
+            type: "warning",
+            message: "删除照片失败,再重试!",
+          });
+          // done();
+        });
+    },
     uploadAfter(res, done, loading, column) {
       // this.row.businessLicense = "";
       this.row.businessLicense = res.url;
@@ -64,7 +87,7 @@
         () => {
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "添加成功!",
           });
           done();
         },
diff --git a/src/views/securityUnitChild/licence.vue b/src/views/securityUnitChild/licence.vue
index 7fc6d85..efa47c1 100644
--- a/src/views/securityUnitChild/licence.vue
+++ b/src/views/securityUnitChild/licence.vue
@@ -2,7 +2,12 @@
   <div class="License">
     <el-container>
       <el-main>
-        <avue-form :option="option" v-model="form" :upload-after="uploadAfter">
+        <avue-form
+          :option="option"
+          v-model="form"
+          :upload-after="uploadAfter"
+          :upload-delete="uploadDelete"
+        >
         </avue-form
       ></el-main>
     </el-container>
@@ -57,13 +62,31 @@
         this.form.imgUrl = this.row.licence;
       }
     },
+    uploadDelete(column, file) {
+      this.row.licence = "";
+      return update(this.row)
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "删除成功!",
+          });
+          // done();
+        })
+        .catch((error) => {
+          this.$message({
+            type: "warning",
+            message: "删除照片失败,再重试!",
+          });
+          // done();
+        });
+    },
     uploadAfter(res, done, loading, column) {
       this.row.licence = res.url;
       update(this.row).then(
         () => {
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "添加成功!",
           });
           done();
         },
diff --git a/src/views/securityUnitChild/social.vue b/src/views/securityUnitChild/social.vue
index 6448fab..d13c4a8 100644
--- a/src/views/securityUnitChild/social.vue
+++ b/src/views/securityUnitChild/social.vue
@@ -76,9 +76,12 @@
   props: ["deptid"],
   data() {
     var deptid = this.deptid;
-
+    if (this.deptid == undefined) {
+      // deptid = this.userInfo
+      // console.log(this.$store.getters.userInfo.dept_id);
+      deptid = this.$store.getters.userInfo.dept_id;
+    }
     return {
-      do: 0,
       form: { cardid: "" },
 
       query: {},
@@ -398,8 +401,7 @@
   },
   methods: {
     changes(val) {
-      this.do++;
-      if (this.do >= 2) {
+      if (val.value != "") {
         getuseList(val.value).then((res) => {
           // console.log(res);
           var d = res.data.data;

--
Gitblit v1.9.3