From 21c7375b7b38ebf2c8a2ca8fbf6fe9fb4f28250f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 12 Jan 2022 10:59:40 +0800
Subject: [PATCH] 新增公司注册机公司注册审核

---
 src/views/securityUnitChild/social.vue |  241 ++++++++++++++++++++++++++++++------------------
 1 files changed, 150 insertions(+), 91 deletions(-)

diff --git a/src/views/securityUnitChild/social.vue b/src/views/securityUnitChild/social.vue
index 5a05171..223c8a0 100644
--- a/src/views/securityUnitChild/social.vue
+++ b/src/views/securityUnitChild/social.vue
@@ -1,6 +1,9 @@
 <template>
-  <basic-container>
+  <basic-container
+    :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
+  >
     <avue-crud
+      v-if="visible"
       :option="option"
       :table-loading="loading"
       :data="data"
@@ -62,15 +65,29 @@
 </template>
 
 <script>
-import { getList, getDetail, add, update, remove } from "@/api/social/social";
+import {
+  getuseList,
+  getList,
+  getDetail,
+  add,
+  update,
+  remove,
+} from "@/api/social/social";
 import { mapGetters } from "vuex";
 import { getToken } from "@/util/auth";
-
 export default {
-  props: ["deptid"],
+  props: ["deptid", "socialRE"],
   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 {
-      form: {},
+      visible: true,
+      form: { cardid: "" },
+
       query: {},
       loading: true,
       excelBox: false,
@@ -78,11 +95,12 @@
         pageSize: 10,
         currentPage: 1,
         total: 0,
+        ...this.$store.state.control.changePageSize,
       },
       selectionList: [],
       option: {
         height: "auto",
-        calcHeight: 30,
+        // calcHeight: 30,
         tip: false,
         searchShow: true,
         align: "center",
@@ -93,6 +111,7 @@
         menu: false,
         selection: true,
         dialogClickModal: false,
+        ...this.$store.state.control.clearOtherBut,
         column: [
           {
             label: "姓名",
@@ -100,11 +119,18 @@
 
             width: 65,
             labelWidth: 110,
-
+            change: (res) => {
+              this.changes(res);
+            },
+            dicUrl: "/api/blade-user/page-security-unit?deptId=" + deptid,
+            props: {
+              label: "realName",
+              value: "id",
+            },
             search: true,
             searchLabelWidth: 45,
             searchSpan: 4,
-
+            type: "select",
             rules: [
               {
                 required: true,
@@ -117,7 +143,20 @@
             label: "性别",
             prop: "sex",
             width: 55,
+            type: "select",
+            dicData: [
+              {
+                label: "男",
+                value: 1,
+              },
+              {
+                label: "女",
+                value: 2,
+              },
+            ],
             labelWidth: 110,
+            addDisabled: true,
+            editDisabled: true,
             rules: [
               {
                 required: true,
@@ -126,39 +165,45 @@
               },
             ],
           },
-          {
-            label: "民族",
-            prop: "nation",
-            width: 55,
-            labelWidth: 110,
-            rules: [
-              {
-                required: true,
-                message: "请输入民族",
-                trigger: "blur",
-              },
-            ],
-          },
-          {
-            label: "出生日期",
-            labelWidth: 110,
-            width: 90,
-            prop: "birthday",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd",
-            rules: [
-              {
-                required: true,
-                message: "请输入出生日期",
-                trigger: "blur",
-              },
-            ],
-          },
+          // {
+          //   label: "民族",
+          //   prop: "nation",
+          //   addDisabled: true,
+          //   editDisabled: true,
+          //   width: 55,
+          //   labelWidth: 110,
+          //   rules: [
+          //     {
+          //       required: true,
+          //       message: "请输入民族",
+          //       trigger: "blur",
+          //     },
+          //   ],
+          // },
+          // {
+          //   label: "出生日期",
+          //   labelWidth: 110,
+          //   width: 90,
+          //   // addDisabled: true,
+          //   // editDisabled: true,
+          //   prop: "birthday",
+          //   type: "date",
+          //   format: "yyyy-MM-dd",
+          //   valueFormat: "yyyy-MM-dd",
+          //   rules: [
+          //     {
+          //       required: true,
+          //       message: "请输入出生日期",
+          //       trigger: "blur",
+          //     },
+          //   ],
+          // },
           {
             label: "联系电话",
             prop: "telephone",
             labelWidth: 110,
+            addDisabled: true,
+            editDisabled: true,
             width: 98,
             rules: [
               {
@@ -172,6 +217,8 @@
             label: "身份证号",
             prop: "cardid",
             labelWidth: 110,
+            addDisabled: true,
+            editDisabled: true,
             width: 150,
             rules: [
               {
@@ -186,6 +233,8 @@
             prop: "residence",
             labelWidth: 110,
             overHidden: true,
+            addDisabled: false,
+            editDisabled: false,
             rules: [
               {
                 required: true,
@@ -194,31 +243,35 @@
               },
             ],
           },
-          {
-            label: "居住地址  ",
-            prop: "address",
-            overHidden: true,
-            labelWidth: 110,
-            rules: [
-              {
-                required: true,
-                message: "请输入居住地址  ",
-                trigger: "blur",
-              },
-            ],
-          },
-          {
-            label: "户籍性质",
-            prop: "nature",
-            labelWidth: 110,
-            rules: [
-              {
-                required: true,
-                message: "请输入户籍性质",
-                trigger: "blur",
-              },
-            ],
-          },
+          // {
+          //   label: "居住地址  ",
+          //   prop: "address",
+          //   overHidden: true,
+          //   addDisabled: true,
+          //   editDisabled: true,
+          //   labelWidth: 110,
+          //   rules: [
+          //     {
+          //       required: true,
+          //       message: "请输入居住地址  ",
+          //       trigger: "blur",
+          //     },
+          //   ],
+          // },
+          // {
+          //   label: "户籍性质",
+          //   prop: "nature",
+          //   // addDisabled: true,
+          //   // editDisabled: true,
+          //   labelWidth: 110,
+          //   rules: [
+          //     {
+          //       required: true,
+          //       message: "请输入户籍性质",
+          //       trigger: "blur",
+          //     },
+          //   ],
+          // },
           {
             label: "个人缴费额",
             prop: "amount",
@@ -278,35 +331,8 @@
               res: "data",
             },
             tip: "请上传 .xls,.xlsx 标准格式文件",
-            action: "/api/social/import-user",
+            action: "/api/social/import-user?deptid=" + deptid,
           },
-          // {
-          //   label: "数据覆盖",
-          //   prop: "isCovered",
-          //   type: "switch",
-          //   align: "center",
-          //   hide: true,
-          //   width: 80,
-          //   dicData: [
-          //     {
-          //       label: "否",
-          //       value: 0,
-          //     },
-          //     {
-          //       label: "是",
-          //       value: 1,
-          //     },
-          //   ],
-          //   value: 0,
-          //   slot: true,
-          //   rules: [
-          //     {
-          //       required: true,
-          //       message: "请选择是否覆盖",
-          //       trigger: "blur",
-          //     },
-          //   ],
-          // },
           {
             label: "模板下载",
             prop: "excelTemplate",
@@ -329,9 +355,25 @@
           this.deptid;
       }
     },
+    socialRE() {
+      this.$refs.crud.refreshTable();
+      this.$refs.crud.doLayout();
+    },
+    windowHeight() {
+      console.log(this.windowHeight);
+      this.option.height = this.windowHeight - 320;
+      this.visible = false;
+      this.$nextTick(() => {
+        this.visible = true;
+        this.refreshChange();
+      });
+    },
+  },
+  created() {
+    this.option.height = this.windowHeight - 320;
   },
   computed: {
-    ...mapGetters(["permission", "userInfo"]),
+    ...mapGetters(["permission", "userInfo", "windowHeight"]),
     permissionList() {
       return {
         addBtn: this.vaildData(this.permission.social_add, true),
@@ -349,6 +391,21 @@
     },
   },
   methods: {
+    changes(val) {
+      if (val.value != "") {
+        getuseList(val.value).then((res) => {
+          // console.log(res);
+          var d = res.data.data;
+          this.form.cardid = d.cardid;
+          this.form.telephone = d.phone;
+          this.form.residence = d.registered;
+          this.form.address = d.address;
+          this.form.sex = d.sex;
+          this.form.nation = d.nation;
+          this.form.birthday = d.birthday;
+        });
+      }
+    },
     rowSave(row, done, loading) {
       console.log(row);
       row.deptid = this.deptid;
@@ -486,6 +543,8 @@
         this.page.total = data.total;
         this.data = data.records;
         this.loading = false;
+        this.$refs.crud.refreshTable();
+        this.$refs.crud.doLayout();
         this.selectionClear();
       });
     },

--
Gitblit v1.9.3