From 63ad2c3598400370dd7da5534659fd7e768a0a4a Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Mon, 16 May 2022 17:29:46 +0800
Subject: [PATCH] 地址替换

---
 src/views/system/user.vue |  172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 162 insertions(+), 10 deletions(-)

diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index 7f43053..3c4b79d 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -38,7 +38,7 @@
         >
           <template slot="menuLeft">
             <el-button
-              type="danger"
+
               size="small"
               plain
               icon="el-icon-delete"
@@ -203,6 +203,7 @@
   update,
   updatePlatform,
   add,
+  securitySave,
   grant,
   resetPassword,
 } from "@/api/system/user";
@@ -293,9 +294,10 @@
       option: {
         height: "auto",
         calcHeight: 54,
+        labelWidth:120,
         tip: false,
         searchShow: true,
-        searchMenuSpan: 6,
+        searchMenuSpan: 4,
         border: true,
         index: true,
         selection: true,
@@ -307,12 +309,14 @@
             label: "登录账号",
             prop: "account",
             search: true,
+            searchSpan: 5,
             display: false,
           },
           {
             label: "所属客户",
             prop: "tenantName",
             slot: true,
+            hide: true,
             display: false,
             width: 200,
           },
@@ -320,6 +324,41 @@
             label: "用户姓名",
             prop: "realName",
             search: true,
+            searchSpan: 5,
+            display: false,
+          },
+          {
+            label: "居住地辖区",
+            prop: "jurisdiction",
+            search: true,
+            overHidden: true,
+            parent: false,
+            type: "tree",
+            searchLabelWidth: 90,
+            searchSpan: 4,
+            dicUrl: "/api/jurisdiction/lazy-tree",
+            props: {
+              label: "title",
+              value: "id"
+            },
+            checkStrictly: true,
+            display: false,
+          },
+          {
+            label: "工作地辖区",
+            prop: "workjurisdiction",
+            search: true,
+            overHidden: true,
+            parent: false,
+            type: "tree",
+            searchLabelWidth: 90,
+            searchSpan: 4,
+            dicUrl: "/api/jurisdiction/lazy-tree",
+            props: {
+              label: "title",
+              value: "id"
+            },
+            checkStrictly: true,
             display: false,
           },
           {
@@ -328,14 +367,27 @@
             slot: true,
             display: false,
           },
+          // {
+          //   label: "所属部门",
+          //   prop: "deptName",
+          //   slot: true,
+          //   display: false,
+          //   width: 260,
+          // },
           {
-            label: "所属部门",
-            prop: "deptName",
-            slot: true,
-            display: false,
-            width: 260,
+            label: "行政区",
+            prop: "district",
+            type: "select",
+            props: {
+              label: "name",
+              value: "code",
+            },
+            dicUrl: "/api/blade-system/region/select?code=3601",
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: false,
+            hide: true,
           },
-
           {
             label: "用户平台",
             prop: "userTypeName",
@@ -359,6 +411,7 @@
           {
             label: "用户平台",
             type: "select",
+            searchSpan: 5,
             dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
             props: {
               label: "dictValue",
@@ -410,7 +463,7 @@
               },
               {
                 label: "行政区",
-                prop: "regionId",
+                prop: "district",
                 type: "select",
                 props: {
                   label: "name",
@@ -428,6 +481,46 @@
                     trigger: "blur",
                   },
                 ],
+              },
+              {
+                label: "居住地辖区",
+                prop: "jurisdiction",
+                overHidden: true,
+                parent: false,
+                type: "tree",
+                dicUrl: "/api/jurisdiction/lazy-tree",
+                props: {
+                  label: "title",
+                  value: "id"
+                },
+                checkStrictly: true,
+                rules: [
+                  {
+                    required: true,
+                    message: "请选择所属辖区",
+                    trigger: "click"
+                  }
+                ]
+              },
+              {
+                label: "工作地辖区",
+                prop: "workjurisdiction",
+                overHidden: true,
+                parent: false,
+                type: "tree",
+                dicUrl: "/api/jurisdiction/lazy-tree",
+                props: {
+                  label: "title",
+                  value: "id"
+                },
+                checkStrictly: true,
+                rules: [
+                  {
+                    required: true,
+                    message: "请选择所属辖区",
+                    trigger: "click"
+                  }
+                ]
               },
               {
                 label: "登录账号",
@@ -515,6 +608,11 @@
                 ],
               },
               {
+                label: "身份证号",
+                prop: "cardid",
+                overHidden: true,
+              },
+              {
                 label: "手机号码",
                 prop: "phone",
                 overHidden: true,
@@ -581,6 +679,7 @@
                 },
                 checkStrictly: true,
                 slot: true,
+                parent: false,
                 rules: [
                   {
                     required: true,
@@ -828,11 +927,64 @@
         this.onLoad(this.page);
       });
     },
+    // rowSave(row, done, loading) {
+    //   row.deptId = row.deptId.join(",");
+    //   row.roleId = row.roleId.join(",");
+    //   row.postId = row.postId.join(",");
+    //   add(row).then(
+    //     () => {
+    //       this.initFlag = false;
+    //       this.onLoad(this.page);
+    //       this.$message({
+    //         type: "success",
+    //         message: "操作成功!",
+    //       });
+    //       done();
+    //     },
+    //     (error) => {
+    //       window.console.log(error);
+    //       loading();
+    //     }
+    //   );
+    // },
     rowSave(row, done, loading) {
       row.deptId = row.deptId.join(",");
       row.roleId = row.roleId.join(",");
       row.postId = row.postId.join(",");
-      add(row).then(
+      const userMap = {
+        user: {
+          account: row.account,
+          avatar: row.avatar,
+          fingerprint: row.fingerprint,
+          healstats: row.healstats,
+          address: row.address,
+          birthday: row.birthday,
+          cardid: row.cardid,
+          deptId: row.deptId,
+          roleId: row.roleId,
+          education: row.education1,
+          email: row.email,
+          height: row.height,
+          hold: row.hold,
+          jurisdiction: row.jurisdiction,
+          myPicture: row.myPicture,
+          name: row.name,
+          nation: row.nation,
+          nativeplace: row.nativeplace,
+          password: row.password,
+          password2: row.password2,
+          phone: row.phone,
+          politicaloutlook: row.politicaloutlook,
+          realName: row.realName,
+          registered: row.registered,
+          rtime: row.rtime,
+          securitynumber: row.securitynumber,
+          sex: row.sex,
+          district: row.district,
+          stype: 1,
+        },
+      };
+      securitySave(userMap).then(
         () => {
           this.initFlag = false;
           this.onLoad(this.page);

--
Gitblit v1.9.3