linwe
2023-12-09 5e83cea689ade0a38aa1ae68362bd7da98958f44
出租人员信息完善
2 files modified
273 ■■■■ changed files
src/views/place/index.vue 7 ●●●●● patch | view | raw | blame | history
src/views/userHouse/hireInfoList.vue 266 ●●●● patch | view | raw | blame | history
src/views/place/index.vue
@@ -8,7 +8,14 @@
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.place_delete" @click="handleDelete">删 除
        </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="ManageTenants(scope.row)">场所维护
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
src/views/userHouse/hireInfoList.vue
@@ -2,8 +2,8 @@
  <el-row>
    <el-col :span="24">
      <basic-container>
        <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" v-model="form"
          :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
        <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
          v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
          :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
          @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
          @refresh-change="refreshChange" @on-load="onLoad">
@@ -11,12 +11,16 @@
            <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.houseRental_delete"
              @click="handleDelete">删 除
            </el-button>
            <el-button type="success" size="small" plain v-if="permission.houseRental_import" icon="el-icon-upload2"
              @click="handleImport">导入
          </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="ManageTenants(scope.row)">管理租户
            </el-button>
            <el-button type="warning" size="small" plain v-if="permission.houseRental_export" icon="el-icon-download"
              @click="handleExport">导出
          <!--  <el-button type="success" size="small" plain icon="el-icon-upload2" @click="handleImport">导入
            </el-button>
            <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
            </el-button> -->
          </template>
          <template slot-scope="{row}" slot="tenantName">
            <el-tag>{{ row.tenantName }}</el-tag>
@@ -31,17 +35,22 @@
            <el-tag>{{ row.userTypeName }}</el-tag>
          </template>
        </avue-crud>
        <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px">
          <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole"
            :default-checked-keys="roleTreeObj" :props="props">
          </el-tree>
        <el-dialog title="租户管理" append-to-body :visible.sync="roleBox">
          <avue-crud :option="houseHoldOption" :search.sync="search" :table-loading="loading" :data="houseHold"
            ref="crud" v-model="houseHoldForm" :permission="permissionList" @row-del="houseHoldRowDel"
            @row-update="houseHoldRowUpdate" @row-save="houseHoldRowSave" :page.sync="holdPage"
            @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
            @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"></avue-crud>
          <span slot="footer" class="dialog-footer">
            <el-button @click="roleBox = false">取 消</el-button>
            <el-button type="primary" @click="submitRole">确 定</el-button>
          </span>
        </el-dialog>
        <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px">
          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
            <template slot="excelTemplate">
@@ -57,6 +66,13 @@
</template>
<script>
  import {
    getList as getHouseholdList,
    remove as householdDel,
    add as householdAdd,
    update as householdUpdate,
    getDetatil as getHouseholdDetatil
  } from "@/api/userHouse/list/houseHold.js";
import {
  getList,
  getPageList,
@@ -92,6 +108,7 @@
export default {
  data() {
    return {
        roleBox: false,
      form: {},
      search: {},
      excelBox: false,
@@ -102,6 +119,92 @@
        pageSize: 10,
        currentPage: 1,
        total: 0
        },
        rowHouseHold: {},
        houseHoldForm: {
          relationship: 18,
          roleType: 2,
        },
        houseHold: [],
        holdPage: {
          pageSize: 100,
          currentPage: 1,
          total: 0
        },
        houseHoldOption: {
          height: 'auto',
          calcHeight: 80,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          // selection: true,
          viewBtn: true,
          addBtn: true,
          dialogType: 'drawer',
          dialogClickModal: false,
          column: [{
              label: "姓名",
              prop: "name",
              // search: true,
              searchSpan: 4,
            },
            {
              label: "电话",
              prop: "phoneNumber",
              // search: true,
              searchSpan: 4,
            },
            {
              label: "身份证号",
              prop: "idCard",
              // search: true,
              searchSpan: 4,
            },
            {
              label: "性别",
              prop: "gender",
              type: "select",
              dicData: [{
                  label: "男",
                  value: 1
                },
                {
                  label: "女",
                  value: 0
                },
                {
                  label: "未知",
                  value: 1
                }
              ],
            },
            {
              label: "关系",
              prop: "relationship",
              type: "select",
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=roleRelation",
              dataType: "number",
              props: {
                label: "dictValue",
                value: "dictKey",
              },
              display: false
            },
            {
              label: "小区",
              prop: "aoiName",
              // search: true,
              searchSpan: 4,
              display: false
            },
            {
              label: "地址",
              prop: "address",
              display: false
            },
          ]
      },
      option: {
        height: 'auto',
@@ -116,8 +219,8 @@
        addBtn: true,
        dialogType: 'drawer',
        dialogClickModal: false,
        column: [
          {
          menuWidth: 280,
          column: [{
            label: "房屋",
            prop: "address",
            display: false
@@ -133,19 +236,16 @@
              searchShow: true,
              searchMenuSpan: 6,
              submitText: "确定",
              column: [
                {
                column: [{
                  label: "小区",
                  prop: "districtName",
                  search: true,
                  searchSpan: 4,
                  rules: [
                    {
                    rules: [{
                      required: true,
                      message: "请选择小区",
                      trigger: "blur",
                    },
                  ],
                    }, ],
                }, {
                  label: "地址",
                  prop: "address",
@@ -155,14 +255,13 @@
                {
                  label: "手机",
                  prop: "phone",
                  rules: [
                    {
                    rules: [{
                      required: true,
                      message: "请输入绑定手机",
                      trigger: "blur",
                    }, ],
                    },
                  ],
                },],
            },
            page: {
              pageSize: 10,
@@ -174,7 +273,11 @@
              if (!row.districtName) return ''
              return row.districtName + '-' + row.unit  + row.building  + row.room 
            },
            onLoad: ({ page, value, data }, callback) => {
              onLoad: ({
                page,
                value,
                data
              }, callback) => {
              //首次加载去查询对应的值
              if (value) {
                getHouseDetail({
@@ -214,8 +317,7 @@
            searchSpan: 4,
            width: 100,
            type: "select",
            dicData: [
              {
              dicData: [{
                label: "同一户",
                value: 1
              },
@@ -224,13 +326,11 @@
                value: 2
              }
            ],
            rules: [
              {
              rules: [{
                required: true,
                message: "请选择关系",
                trigger: "blur",
              },
            ],
              }, ],
          },
          {
            label: "房屋状态",
@@ -239,8 +339,7 @@
            searchSpan: 4,
            width: 100,
            type: "select",
            dicData: [
              {
              dicData: [{
                label: "部分出租",
                value: 1
              },
@@ -249,13 +348,11 @@
                value: 2
              }
            ],
            rules: [
              {
              rules: [{
                required: true,
                message: "请选择房屋状态",
                trigger: "blur",
              },
            ],
              }, ],
          },
          {
            label: "用途",
@@ -270,13 +367,11 @@
              label: "dictValue",
              value: "dictKey",
            },
            rules: [
              {
              rules: [{
                required: true,
                message: "请选择用途",
                trigger: "blur",
              },
            ],
              }, ],
          },
          {
            label: "租房时间",
@@ -285,13 +380,11 @@
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            width: 100,
            rules: [
              {
              rules: [{
                required: true,
                message: "请选择租房时间",
                trigger: "blur",
              },
            ],
              }, ],
          },
          {
            label: "到期时间",
@@ -300,13 +393,11 @@
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            width: 100,
            rules: [
              {
              rules: [{
                required: true,
                message: "请选择到期时间",
                trigger: "blur",
              },
            ],
              }, ],
          },
          
          {
@@ -317,8 +408,7 @@
            search: true,
            searchSpan: 3,
            type: "select",
            dicData: [
              {
              dicData: [{
                label: "长期",
                value: 1
              },
@@ -340,8 +430,7 @@
            search: true,
            searchSpan: 4,
            display: false,
            dicData: [
              {
              dicData: [{
                label: "已确认",
                value: 1
              },
@@ -426,8 +515,7 @@
      }
    };
  },
  watch: {
  },
    watch: {},
  computed: {
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
@@ -439,9 +527,45 @@
      };
    }
  },
  mounted() {
  },
    mounted() {},
  methods: {
      ManageTenants(item) {
        this.roleBox = true
        this.rowHouseHold = item
        this.onLoadHouseHold()
      },
      onLoadHouseHold() {
        let params = {
          housingRentalId: this.rowHouseHold.id,
        }
        getHouseholdList(this.holdPage.currentPage, this.holdPage.pageSize, Object.assign(params)).then(res => {
          const data = res.data.data;
          this.houseHold = data.records;
          this.loading = false;
          this.selectionClear();
        });
      },
      houseHoldRowSave(row, done, loading) {
        row.aoiName = this.rowHouseHold.aoiName
        row.address = this.rowHouseHold.address
        row.housingRentalId = this.rowHouseHold.id
        row.houseCode = this.rowHouseHold.houseCode
        householdAdd(row).then(() => {
          this.initFlag = false;
          this.onLoadHouseHold();
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
    rowSave(row, done, loading) {
      if (row.fileUrls.length > 0) {
        var urls = []
@@ -486,6 +610,37 @@
      }, error => {
        window.console.log(error);
        loading();
        });
      },
      houseHoldRowUpdate(row, index, done, loading) {
        householdUpdate(row).then(() => {
          this.initFlag = false;
          this.onLoadHouseHold();
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      houseHoldRowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return householdDel(row.id);
          })
          .then(() => {
            this.onLoadHouseHold();
            this.$message({
              type: "success",
              message: "操作成功!"
            });
      });
    },
    rowDel(row) {
@@ -568,7 +723,8 @@
        }
        data = Qs.stringify(data);
        exportBlob(
          `/api/blade-houseRental/houseRental/export-houseRental?${this.website.tokenHeader}=${getToken()}&` + data
            `/api/blade-houseRental/houseRental/export-houseRental?${this.website.tokenHeader}=${getToken()}&` +
            data
        ).then(res => {
          downloadXls(res.data, `出租信息数据表${dateNow()}.xlsx`);
          NProgress.done();