From 4522ab3fe8bd45ee753ef187448c1e884bbc601f Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 18 Apr 2024 11:09:27 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_web

---
 src/views/property/propertyCompanyDistrict.vue |   82 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/src/views/property/propertyCompanyDistrict.vue b/src/views/property/propertyCompanyDistrict.vue
index 39c6166..8f23fb4 100644
--- a/src/views/property/propertyCompanyDistrict.vue
+++ b/src/views/property/propertyCompanyDistrict.vue
@@ -10,6 +10,11 @@
           @click="handleDelete">删 除
         </el-button>
       </template>
+      <template slot-scope="{row, size}" slot="principalPhone">
+        <el-button :size="size" type="text" @click="showStringDispose(row, 'principalPhoneflag')"
+          v-text="textDispose(row, 'principalPhoneflag', 'principalPhone')">
+        </el-button>
+      </template>
     </avue-crud>
   </basic-container>
 </template>
@@ -20,7 +25,8 @@
     remove,
     update,
     add,
-    getPropertyCompanyDistrict
+    getPropertyCompanyDistrict,
+    getPropertyCompanyList
   } from "@/api/property/propertyCompanyDistrict"
   import {
     mapGetters
@@ -58,7 +64,7 @@
           searchShow: true,
           searchMenuSpan: 3,
           menuWidth: 210,
-
+          dialogMenuPosition: 'center',
           height: "auto",
           calcHeight: 54,
           dialogWidth: 1150,
@@ -78,6 +84,7 @@
               prop: "districtName",
               search: true,
               searchSpan: 4,
+              searchLabelWidth: 76,
               rules: [{
                 required: true,
                 message: "请输入小区名称",
@@ -92,7 +99,7 @@
               prop: "districtId",
               search: false,
               type: 'tree',
-              dicUrl: `/api/blade-district/district/getDistrictTree`,
+              dicUrl: `/api/blade-district/district/getDistrictTree?filterFlag=0`,
               props: {
                 label: "name",
                 value: "id"
@@ -124,12 +131,13 @@
             },
 
             {
+              disabled: true,
               hide: true,
               label: '物业公司',
               prop: 'propertyCompanyId',
               type: 'tree',
               span: 12,
-              dicUrl: `/api/blade-propertyCompany/propertyCompany/getPropertyCompanyList`,
+              dicData: [],
               cascader: ['userId', 'principal'],
               nodeClick: (data, node, nodeComp) => {
                 // this.$message.success(JSON.stringify(data))
@@ -147,7 +155,7 @@
             {
               width: 110,
               label: '项目经理',
-              prop: 'principal',
+              prop: 'principalName',
               span: 12,
               type: "tree",
               // multiple: true,
@@ -157,8 +165,20 @@
                 value: 'id'
               },
               // dicData: [],
-              hide: true,
-              dicUrl: `/api/blade-system/user/getUserInfoByPropertyCompanyId?propertyCompanyId={{propertyCompanyId}}`,
+              // hide: true,
+              // dicUrl: `/api/blade-system/user/getUserInfoByPropertyCompanyId?propertyCompanyId={{propertyCompanyId}}&roleId=1747504028253229058`,
+              change: ({
+                value,
+                column,
+                item,
+                dic
+              }) => {
+                this.form.principalPhone = ''
+
+                if (value) {
+                  this.form.principalPhone = item.phone
+                }
+              },
               rules: [{
                 required: true,
                 message: "请输入项目经理",
@@ -180,6 +200,7 @@
                   trigger: 'blur'
                 }
               ],
+              slot: true
             },
             {
               label: "物业成员",
@@ -194,7 +215,7 @@
               },
               hide: true,
               // dicData: [],
-              dicUrl: `/api/blade-system/user/getUserInfoByPropertyCompanyId?propertyCompanyId={{propertyCompanyId}}`,
+              dicUrl: `/api/blade-system/user/getUserInfoByPropertyCompanyId?propertyCompanyId={{propertyCompanyId}}&roleId=1750763073214984194`,
             },
             {
               width: 100,
@@ -260,9 +281,10 @@
           ],
         },
         data: [],
+        curRoleDetails: {}
       }
     },
-    watch: {},
+
     computed: {
       ...mapGetters(["permission", "userInfo"]),
       permissionList() {
@@ -280,8 +302,35 @@
         })
         return ids.join(",")
       },
+
+      textDispose() {
+        return (row, flag, type) => {
+          if (row[flag] || row[type] == null) {
+            return row[type]
+          } else {
+            if (type == 'principalIdCard') {
+              return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+            } else {
+              return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+            }
+          }
+        }
+      }
     },
     methods: {
+      showStringDispose(row, type) {
+        row[type] = !row[type]
+      },
+
+      initData() {
+        getPropertyCompanyList().then(res => {
+          const column = this.findObject(this.option.column, "propertyCompanyId")
+          column.dicData = res.data.data
+
+          this.form.propertyCompanyId = res.data.data[0].id
+        })
+      },
+
       rowSave(row, done, loading) {
         row.userId = func.join(row.userId)
         add(row).then(
@@ -299,6 +348,7 @@
           }
         )
       },
+
       rowUpdate(row, index, done, loading) {
         row.userId = func.join(row.userId)
         update(row).then(
@@ -373,6 +423,10 @@
           })
       },
       beforeOpen(done, type) {
+        if (["add", "edit"].includes(type)) {
+          this.initData()
+        }
+
         if (["edit", "view"].includes(type)) {
           getPropertyCompanyDistrict(this.form.id).then((res) => {
             this.form = res.data.data
@@ -408,7 +462,15 @@
         }
         this.loading = true
         getList(page.currentPage, page.pageSize, values).then((res) => {
-          const data = res.data.data
+          const data = {
+            ...res.data.data,
+            records: res.data.data.records.map(item => {
+              return {
+                ...item,
+                'principalPhoneflag': false
+              }
+            })
+          }
           this.page.total = data.total
           this.data = data.records
           this.loading = false

--
Gitblit v1.9.3