From 78afae3aa974b72d1f83a72ad26f242667295709 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Wed, 22 Nov 2023 19:39:33 +0800
Subject: [PATCH] 房屋,人员,租赁完善

---
 src/views/userHouse/houseList.vue |   99 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 81 insertions(+), 18 deletions(-)

diff --git a/src/views/userHouse/houseList.vue b/src/views/userHouse/houseList.vue
index 8f4a2a3..a8b706f 100644
--- a/src/views/userHouse/houseList.vue
+++ b/src/views/userHouse/houseList.vue
@@ -18,6 +18,11 @@
               icon="el-icon-download" @click="handleExport">导出
             </el-button>
           </template>
+          <template slot-scope="scope" slot="menu">
+            <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager"
+              @click="handleHouseholdManager(scope.row)">住户管理
+            </el-button>
+          </template>
           <template slot-scope="{row}" slot="tenantName">
             <el-tag>{{ row.tenantName }}</el-tag>
           </template>
@@ -51,6 +56,9 @@
             </template>
           </avue-form>
         </el-dialog>
+        <el-dialog title="住户管理" append-to-body :visible.sync="householdManagerVisible" width="70%" height="60%">
+            <householdManager ref="householdManager"/>
+        </el-dialog>
       </basic-container>
     </el-col>
   </el-row>
@@ -59,12 +67,10 @@
 <script>
 import {
   getList,
-  getPageList,
   remove,
   add,
   update,
-  getDetatil,
-  saveOrUpdateHouseLabel
+  getDetatil
 } from "@/api/userHouse/list/house.js";
 import {
   exportBlob
@@ -85,10 +91,15 @@
 import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
 import func from "@/util/func";
+import householdManager from "./components/householdManager";
 import Qs from "qs";
 export default {
+  components: {
+    householdManager
+  },
   data() {
     return {
+      householdManagerVisible:false,
       form: {},
       search: {},
       excelBox: false,
@@ -112,12 +123,13 @@
         viewBtn: true,
         dialogType: 'drawer',
         dialogClickModal: false,
+        menuWidth:280,
         column: [{
           label: "房屋编号",
           prop: "houseCode",
           width: 180,
           hide: true,
-          disabled: true,
+          display: false
         },
         {
           label: "地址",
@@ -129,26 +141,68 @@
           label: "小区",
           prop: "districtName",
           search: true,
-        },
-        {
-          label: "楼层",
-          prop: "floor",
+          rules: [
+            {
+              required: true,
+              message: "请选择小区",
+              trigger: "blur",
+            },
+          ],
         },
         {
           label: "手机",
           prop: "phone",
+          rules: [
+            {
+              required: true,
+              message: "请输入绑定手机",
+              trigger: "blur",
+            },
+          ],
         },
         {
-          label: "服务到期",
-          prop: "serviceDue",
+          label: "幢",
+          prop: "building",
+          hide: true
         },
         {
-          label: "物业费",
-          prop: "propertyPrice",
+          label: "单元",
+          prop: "unit",
+          hide: true
+        },
+        {
+          label: "室",
+          prop: "room",
+          hide: true
+        },
+        {
+          label: "楼层",
+          prop: "floor",
+          type: "number",
+          rules: [
+            {
+              required: true,
+              message: "请输入楼层",
+              trigger: "blur",
+            },
+          ],
         },
         {
           label: "面积",
           prop: "area",
+          type: "number",
+        },
+        {
+          label: "物业费",
+          prop: "propertyPrice",
+          type: "number",
+        },
+        {
+          label: "服务到期",
+          prop: "serviceDue",
+          type: "datetime",
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd",
         },
         ]
       },
@@ -209,16 +263,23 @@
     ...mapGetters(["userInfo", "permission"]),
     permissionList() {
       return {
-        addBtn: this.vaildData(this.permission.user_add, false),
-        viewBtn: this.vaildData(this.permission.user_view, true),
-        delBtn: this.vaildData(this.permission.user_delete, true),
-        editBtn: this.vaildData(this.permission.user_edit, true)
+        addBtn: this.vaildData(this.permission.house_add, true),
+        viewBtn: this.vaildData(this.permission.house_view, true),
+        delBtn: this.vaildData(this.permission.house_delete, true),
+        editBtn: this.vaildData(this.permission.house_edit, true)
       };
     }
   },
   mounted() {
   },
   methods: {
+    handleHouseholdManager(row){
+      var that = this
+      this.householdManagerVisible = true
+      this.$nextTick(() => {
+        that.$refs.householdManager.init(row)
+        })
+    },
     rowSave(row, done, loading) {
       add(row).then(() => {
         this.initFlag = false;
@@ -339,7 +400,9 @@
     },
     beforeOpen(done, type) {
       if (["edit", "view"].includes(type)) {
-        getDetatil(this.form.id).then(res => {
+        getDetatil({
+          id: this.form.id
+        }).then(res => {
           this.form = res.data.data;
         });
       }
@@ -357,7 +420,7 @@
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;

--
Gitblit v1.9.3