From 2714882212ec5aebe1002684d84b17d7914b4718 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sat, 25 Nov 2023 15:10:26 +0800
Subject: [PATCH] 物业公司,物业公司小区,区域查询,用户,组织机构调整

---
 src/views/system/dept.vue                      |    6 
 src/api/property/propertyCompanyDistrict.js    |   49 ++
 src/api/district/index.js                      |   49 ++
 src/views/system/user.vue                      |   48 +-
 src/views/property/propertyCompany.vue         |  322 +++++++++++++++
 src/views/base/region.vue                      |    4 
 src/views/property/propertyCompanyDistrict.vue |  350 ++++++++++++++++
 src/api/property/propertyCompany.js            |   49 ++
 src/api/system/dept.js                         |    4 
 src/views/district/index.vue                   |  326 +++++++++++++++
 10 files changed, 1,175 insertions(+), 32 deletions(-)

diff --git a/src/api/district/index.js b/src/api/district/index.js
new file mode 100644
index 0000000..5ab8da2
--- /dev/null
+++ b/src/api/district/index.js
@@ -0,0 +1,49 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/blade-district/district/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/blade-district/district/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/blade-district/district/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/blade-district/district/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const getDistrict = (id) => {
+  return request({
+    url: '/api/blade-district/district/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
diff --git a/src/api/property/propertyCompany.js b/src/api/property/propertyCompany.js
new file mode 100644
index 0000000..295928b
--- /dev/null
+++ b/src/api/property/propertyCompany.js
@@ -0,0 +1,49 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/blade-propertyCompany/propertyCompany/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/blade-propertyCompany/propertyCompany/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/blade-propertyCompany/propertyCompany/saveOrUpdate',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/blade-propertyCompany/propertyCompany/saveOrUpdate',
+    method: 'post',
+    data: row
+  })
+}
+
+export const getPropertyCompany = (id) => {
+  return request({
+    url: '/api/blade-propertyCompany/propertyCompany/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
diff --git a/src/api/property/propertyCompanyDistrict.js b/src/api/property/propertyCompanyDistrict.js
new file mode 100644
index 0000000..7283b81
--- /dev/null
+++ b/src/api/property/propertyCompanyDistrict.js
@@ -0,0 +1,49 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate',
+    method: 'post',
+    data: row
+  })
+}
+
+export const getPropertyCompanyDistrict = (id) => {
+  return request({
+    url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
diff --git a/src/api/system/dept.js b/src/api/system/dept.js
index af5c6e7..117f6fc 100644
--- a/src/api/system/dept.js
+++ b/src/api/system/dept.js
@@ -35,7 +35,7 @@
 
 export const add = (row) => {
   return request({
-    url: '/api/blade-system/dept/submit',
+    url: '/api/blade-system/dept/saveOrUpdateDeptInfo',
     method: 'post',
     data: row
   })
@@ -43,7 +43,7 @@
 
 export const update = (row) => {
   return request({
-    url: '/api/blade-system/dept/submit',
+    url: '/api/blade-system/dept/saveOrUpdateDeptInfo',
     method: 'post',
     data: row
   })
diff --git a/src/views/base/region.vue b/src/views/base/region.vue
index 80ccf11..a5126e7 100644
--- a/src/views/base/region.vue
+++ b/src/views/base/region.vue
@@ -64,7 +64,7 @@
   export default {
     data() {
       return {
-        topCode: '00',
+        topCode: '36',
         treeCode: '',
         treeParentCode: '',
         treeData: [],
@@ -72,7 +72,7 @@
           nodeKey: 'id',
           lazy: true,
           treeLoad: function (node, resolve) {
-            const parentCode = (node.level === 0) ? "00" : node.data.id;
+            const parentCode = (node.level === 0) ? "36" : node.data.id;
             getLazyTree(parentCode).then(res => {
               resolve(res.data.data.map(item => {
                 return {
diff --git a/src/views/district/index.vue b/src/views/district/index.vue
new file mode 100644
index 0000000..3fa0822
--- /dev/null
+++ b/src/views/district/index.vue
@@ -0,0 +1,326 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button size="small" icon="el-icon-delete" plain v-if="permission.district_delete" @click="handleDelete">删 除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import { getList, remove, update, add, getDistrict } from "@/api/district/index";
+import { mapGetters } from "vuex";
+import website from '@/config/website';
+export default {
+  data() {
+    return {
+      form: {},
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      datetime: "",
+      selectionList: [],
+      option: {
+        height: "auto",
+        calcHeight: 54,
+        dialogWidth: 950,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 3,
+        menuWidth: 350,
+        border: true,
+        //stripe:true,
+        index: true,
+        viewBtn: true,
+        selection: true,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "小区名称",
+            prop: "name",
+            searchSpan: 4,
+            search: true,
+            width:260,
+            rules: [
+              {
+                required: true,
+                message: "请输入小区名称",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "所属社区",
+            prop: "communityCode",
+            search: true,
+            searchSpan: 4,
+            width:110,
+            type: "tree",
+            dicUrl:"/api/blade-system/region/tree?parentCode=361102",
+            // parent:false,
+            defaultExpandedKeys:["361102003"],
+            props: {
+              label: "name",
+              value: "id"
+            },
+            rules: [
+              {
+                required: true,
+                message: "请选择所属社区",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "小区图片",
+            prop: "picUrl",
+            width: 80,
+            type: "upload",
+            listType: "picture-img",
+            action: "/api/blade-resource/oss/endpoint/put-file",
+            propsHttp: {
+              res: "data",
+              url: "link",
+            },
+            span: 24,
+          },
+          {
+            label: "地址",
+            prop: "address",
+            span: 24,
+            rules: [
+              {
+                required: true,
+                message: "请输入地址",
+                trigger: "blur",
+              },
+            ],
+          },
+          
+          {
+            label: "小区简介",
+            prop: "remark",
+            component: "AvueUeditor",
+            options: {
+              action: "/api/blade-resource/oss/endpoint/put-file",
+              props: {
+                res: "data",
+                url: "link",
+              },
+            },
+            hide: true,
+            minRows: 6,
+            span: 24,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  watch: {
+  },
+  computed: {
+    ...mapGetters(["permission", "userInfo"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.district_add, true),
+        viewBtn: this.vaildData(this.permission.district_view, true),
+        delBtn: this.vaildData(this.permission.district_delete, true),
+        editBtn: this.vaildData(this.permission.district_edit, true),
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  methods: {
+    rowSave(row, done, loading) {
+      if (row.picUrl.length > 0) {
+        var urls = []
+        var split = row.picUrl.split(",");
+        split.forEach(url => {
+          var names = url.split("jczz/");
+          urls.push(names[1])
+        })
+        row.picUrl = urls.join(",")
+      }
+      row.userid = this.userInfo.user_id;
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      if (row.picUrl.length > 0) {
+        var urls = []
+        var split = row.picUrl.split(",");
+        split.forEach(url => {
+          var names = url.split("jczz/");
+          urls.push(names[1])
+        })
+        row.picUrl = urls.join(",")
+      }
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDistrict(this.form.id).then((res) => {
+          this.form = res.data.data;
+          if (this.form.picUrl.length > 0) {
+            var urls = []
+            var names = this.form.picUrl.split(",");
+            names.forEach(name=>{
+              urls.push(website.minioUrl + name)
+            })
+            this.form.picUrl = urls.join(",")
+          }
+        });
+      }
+      // con
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      const { dateTime } = this.query;
+      let values = {
+        ...params,
+      };
+      if (dateTime) {
+        values = {
+          ...params,
+          startTime: dateTime[0],
+          endTime: dateTime[1],
+          ...this.query,
+        };
+        values.dateTime = null;
+      }
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, values).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.data.forEach(item=>{
+          if(item.picUrl){
+            if(item.picUrl.length>0){
+              var urls = []
+              var names = item.picUrl.split(",");
+              names.forEach(name=>{
+                urls.push(website.minioUrl + name)
+              })
+              item.picUrl = urls.join(",")
+            }
+          }
+        })
+        this.loading = false;
+        this.selectionClear();
+      });
+    }
+  }
+};
+</script>
+
+<style>
+.avue-upload__icon {
+  line-height: 6;
+}
+</style>
diff --git a/src/views/property/propertyCompany.vue b/src/views/property/propertyCompany.vue
new file mode 100644
index 0000000..bfe6725
--- /dev/null
+++ b/src/views/property/propertyCompany.vue
@@ -0,0 +1,322 @@
+<!-- 物业公司管理 -->
+<template>
+  <basic-container>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
+          @click="handleDelete">删 除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import { getList, remove, update, add, getPropertyCompany } from "@/api/property/propertyCompany";
+import { mapGetters } from "vuex";
+import website from '@/config/website';
+export default {
+  data() {
+    return {
+      form: {},
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      datetime: "",
+      selectionList: [],
+      option: {
+        height: "auto",
+        calcHeight: 54,
+        dialogWidth: 1150,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 3,
+        menuWidth: 350,
+        border: true,
+        //stripe:true,
+        index: true,
+        viewBtn: true,
+        selection: true,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "物业公司名称",
+            prop: "name",
+            searchSpan: 6,
+            search: true,
+            searchLabelWidth:120,
+            span: 18,
+            row: true,
+            labelWidth: 120,
+            width: 260,
+            rules: [
+              {
+                required: true,
+                message: "请输入物业公司名称",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: '省份',
+            prop: 'province',
+            type: 'select',
+            props: {
+              label: 'name',
+              value: 'code'
+            },
+            hide:true,
+            span: 6,
+            labelWidth: 120,
+            cascader: ['city'],
+            dicUrl: `/api/blade-system/region/select`,
+            rules: [
+              {
+                required: true,
+                message: '请选择省份',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '城市',
+            prop: 'city',
+            type: 'select',
+            span: 6,
+            labelWidth: 60,
+            cascader: ['area'],
+            props: {
+              label: 'name',
+              value: 'code'
+            },
+            hide:true,
+            dicUrl: `/api/blade-system/region/select?code={{key}}`,
+            rules: [
+              {
+                required: true,
+                message: '请选择城市',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '地区',
+            prop: 'area',
+            type: 'select',
+            span: 6,
+            labelWidth: 60,
+            props: {
+              label: 'name',
+              value: 'code'
+            },
+            hide:true,
+            dicUrl: `/api/blade-system/region/select?code={{key}}`,
+            rules: [
+              {
+                required: true,
+                message: '请选择地区',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: "地址",
+            prop: "address",
+            span:18,
+            labelWidth: 120,
+            row:true,
+          },
+          {
+            label: "社会信用代码",
+            prop: "socialCreditCode",
+            labelWidth: 120,
+          },
+
+          {
+            label: "简介",
+            prop: "remark",
+            component: "AvueUeditor",
+            labelWidth: 120,
+            options: {
+              action: "/api/blade-resource/oss/endpoint/put-file",
+              props: {
+                res: "data",
+                url: "link",
+              },
+            },
+            hide: true,
+            minRows: 6,
+            span: 24,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  watch: {
+  },
+  computed: {
+    ...mapGetters(["permission", "userInfo"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.propertyCompany_add, true),
+        viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
+        delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
+        editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  methods: {
+    rowSave(row, done, loading) {
+      row.userid = this.userInfo.user_id;
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getPropertyCompany(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      // con
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      const { dateTime } = this.query;
+      let values = {
+        ...params,
+      };
+      if (dateTime) {
+        values = {
+          ...params,
+          startTime: dateTime[0],
+          endTime: dateTime[1],
+          ...this.query,
+        };
+        values.dateTime = null;
+      }
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, values).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    }
+  }
+};
+</script>
+
+<style>
+.avue-upload__icon {
+  line-height: 6;
+}
+</style>
diff --git a/src/views/property/propertyCompanyDistrict.vue b/src/views/property/propertyCompanyDistrict.vue
new file mode 100644
index 0000000..3164d7c
--- /dev/null
+++ b/src/views/property/propertyCompanyDistrict.vue
@@ -0,0 +1,350 @@
+<!-- 物业公司管理 -->
+<template>
+  <basic-container>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompanyDistrict_delete"
+          @click="handleDelete">删 除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import { getList, remove, update, add, getPropertyCompanyDistrict } from "@/api/property/propertyCompanyDistrict";
+import { mapGetters } from "vuex";
+import website from '@/config/website';
+import func from "@/util/func";
+export default {
+  data() {
+    return {
+      form: {},
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      datetime: "",
+      selectionList: [],
+      option: {
+        height: "auto",
+        calcHeight: 54,
+        dialogWidth: 1150,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 3,
+        menuWidth: 350,
+        border: true,
+        //stripe:true,
+        index: true,
+        viewBtn: true,
+        selection: true,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "小区",
+            prop: "districtId",
+            searchSpan: 5,
+            search: true,
+            type: 'tree',
+            dicUrl: `/api/blade-district/district/getDistrictTree`,
+            props: {
+              label: "name",
+              value: "id"
+            },
+            defaultExpandedKeys:["361102003"],
+            span: 12,
+            labelWidth: 120,
+            width: 260,
+            rules: [
+              {
+                required: true,
+                message: "请选择小区",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: '物业公司',
+            prop: 'propertyCompanyId',
+            type: 'tree',
+            hide:true,
+            searchSpan: 5,
+            search: true,
+            span: 12,
+            labelWidth: 120,
+            dicUrl: `/api/blade-propertyCompany/propertyCompany/getPropertyCompanyList`,
+            cascader: ['userId'],
+            props: {
+              label: "name",
+              value: "id"
+            },
+            rules: [
+              {
+                required: true,
+                message: '请选择物业公司',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '负责人',
+            prop: 'principal',
+            span: 12,
+            labelWidth: 120,
+            search:true,
+            searchSpan:4,
+            rules: [
+              {
+                required: true,
+                message: "请输入负责人",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: '联系方式',
+            prop: 'principalPhone',
+            span: 12,
+            labelWidth: 120,
+            rules: [
+              {
+                required: true,
+                message: "请输入联系方式",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "物业成员",
+            prop: "userId",
+            span: 12,
+            labelWidth: 120,
+            type:"tree",
+            multiple: true,
+            props: {
+              label: 'name',
+              value: 'id'
+            },
+            hide:true,
+            dicUrl: `/api/blade-propertyCompany/propertyCompany/getUserByPropertyCompany?id={{key}}`,
+          },
+          {
+            label: "物业阶段",
+            span: 12,
+            prop: "propertyStage",
+            labelWidth: 120,
+            type: "select",
+            search: true,
+            searchSpan: 4,
+            dataType: "number",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=propertyStage",
+            props: {
+              label: "dictValue",
+              value: "dictKey",
+            },
+          },
+          {
+            label: "合同开始时间",
+            prop: "startTime",
+            span: 12,
+            labelWidth: 120,
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd",
+            rules: [
+              {
+                required: true,
+                message: "请选择合同开始时间",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "合同结束时间",
+            prop: "endTime",
+            labelWidth: 120,
+            span:12,
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd",
+            rules: [
+              {
+                required: true,
+                message: "请选择合同结束时间",
+                trigger: "blur",
+              },
+            ],
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  watch: {
+  },
+  computed: {
+    ...mapGetters(["permission", "userInfo"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.propertyCompanyDistrict_add, true),
+        viewBtn: this.vaildData(this.permission.propertyCompanyDistrict_view, true),
+        delBtn: this.vaildData(this.permission.propertyCompanyDistrict_delete, true),
+        editBtn: this.vaildData(this.permission.propertyCompanyDistrict_edit, true),
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  methods: {
+    rowSave(row, done, loading) {
+      row.userId = func.join(row.userId);
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      row.userId = func.join(row.userId);
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getPropertyCompanyDistrict(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      // con
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      const { dateTime } = this.query;
+      let values = {
+        ...params,
+      };
+      if (dateTime) {
+        values = {
+          ...params,
+          startTime: dateTime[0],
+          endTime: dateTime[1],
+          ...this.query,
+        };
+        values.dateTime = null;
+      }
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, values).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    }
+  }
+};
+</script>
+
+<style>
+.avue-upload__icon {
+  line-height: 6;
+}
+</style>
diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue
index c62272e..993e976 100644
--- a/src/views/system/dept.vue
+++ b/src/views/system/dept.vue
@@ -102,14 +102,14 @@
               dicUrl: "/api/blade-system/tenant/select",
               addDisplay: false,
               editDisplay: false,
-              viewDisplay: website.tenantMode,
+              viewDisplay: false,
               span: 24,
               props: {
                 label: "tenantName",
                 value: "tenantId"
               },
-              hide: !website.tenantMode,
-              search: website.tenantMode,
+              hide: true,
+              search: false,
               rules: [{
                 required: true,
                 message: "请输入所属租户",
diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index d94daee..81f5034 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -505,23 +505,23 @@
                     trigger: "click"
                   }]
                 },
-                // {
-                //   label: "所属部门",
-                //   prop: "deptId",
-                //   type: "tree",
-                //   multiple: true,
-                //   dicData: [],
-                //   props: {
-                //     label: "title"
-                //   },
-                //   checkStrictly: true,
-                //   slot: true,
-                //   rules: [{
-                //     required: true,
-                //     message: "请选择所属部门",
-                //     trigger: "click"
-                //   }]
-                // },
+                {
+                  label: "所属部门",
+                  prop: "deptId",
+                  type: "tree",
+                  // multiple: true,
+                  dicData: [],
+                  props: {
+                    label: "title"
+                  },
+                  checkStrictly: true,
+                  slot: true,
+                  rules: [{
+                    required: true,
+                    message: "请选择所属部门",
+                    trigger: "click"
+                  }]
+                },
                 // {
                 //   label: "所属岗位",
                 //   prop: "postId",
@@ -727,10 +727,10 @@
           const column = this.findObject(this.option.group, "roleId");
           column.dicData = res.data.data;
         });
-        // getDeptTree(tenantId).then(res => {
-        //   const column = this.findObject(this.option.group, "deptId");
-        //   column.dicData = res.data.data;
-        // });
+        getDeptTree(tenantId).then(res => {
+          const column = this.findObject(this.option.group, "deptId");
+          column.dicData = res.data.data;
+        });
         // getPostList(tenantId).then(res => {
         //   const column = this.findObject(this.option.group, "postId");
         //   column.dicData = res.data.data;
@@ -750,8 +750,7 @@
       rowSave(row, done, loading) {
         row['tenantId'] = "000000"
         row['userType'] = 1
-        row['deptId'] = '1123598813738675201'
-        // row.deptId = func.join(row.deptId);
+        row.deptId = func.join(row.deptId);
         row.roleId = func.join(row.roleId);
         // row.postId = func.join(row.postId);
         add(row).then(() => {
@@ -769,9 +768,8 @@
       },
       rowUpdate(row, index, done, loading) {
         row['tenantId'] = "000000"
-        row['deptId'] = '1123598813738675201'
         row['userType'] = 1
-        // row.deptId = func.join(row.deptId);
+        row.deptId = func.join(row.deptId);
         row.roleId = func.join(row.roleId);
         // row.postId = func.join(row.postId);
         update(row).then(() => {

--
Gitblit v1.9.3