|
@@ -0,0 +1,1492 @@
|
|
|
|
|
+<template v-if="visible">
|
|
|
|
|
+ <basic-container>
|
|
|
|
|
+ <el-container style="height: 700px; border: 1px solid #eee">
|
|
|
|
|
+ <div style="position: fixed;right: 120px;top: 25px;">
|
|
|
|
|
+ <el-button type="danger" v-if="permission.residential_add" icon="el-icon-plus" @click="batchVisible = true">批量新增</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
|
|
|
|
|
+ <el-tree :props="treeOption" :data="treeData" :expand-on-click-node="false" @node-click="nodeClick" default-expand-all>
|
|
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
|
|
+ <span>{{ node.label }}</span>
|
|
|
|
|
+ <!--<el-popover
|
|
|
|
|
+ placement="right"
|
|
|
|
|
+ width="200"
|
|
|
|
|
+ trigger="hover"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span slot="reference">
|
|
|
|
|
+ <i class="el-icon-arrow-down"></i>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <div style="display: grid">
|
|
|
|
|
+ <el-link :underline="false" type="primary">添加下一级</el-link>
|
|
|
|
|
+ <el-link :underline="false" type="primary">修改</el-link>
|
|
|
|
|
+ <el-link :underline="false" type="danger">删除</el-link>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-popover>-->
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-tree>
|
|
|
|
|
+ </el-aside>
|
|
|
|
|
+ <el-main>
|
|
|
|
|
+ <avue-crud
|
|
|
|
|
+ :data="data"
|
|
|
|
|
+ :option="option"
|
|
|
|
|
+ :table-loading="loading"
|
|
|
|
|
+ :permission="permissionDataList"
|
|
|
|
|
+ ref="crud"
|
|
|
|
|
+ v-model="form"
|
|
|
|
|
+ :before-open="beforeOpen"
|
|
|
|
|
+ @row-update="rowDataUpdate"
|
|
|
|
|
+ @row-save="rowDataSave"
|
|
|
|
|
+ @row-del="rowDataDel"
|
|
|
|
|
+ >
|
|
|
|
|
+ </avue-crud>
|
|
|
|
|
+ </el-main>
|
|
|
|
|
+ </el-container>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- <el-row>
|
|
|
|
|
+ <el-col style="margin-right: 5px; padding-right: 10px; width: 25%;border: 1px solid #0073EB;">
|
|
|
|
|
+ <el-tree :props="treeOption" :data="treeData" :expand-on-click-node="false" @node-click="nodeClick"></el-tree>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col style="width: 70%;">
|
|
|
|
|
+ <avue-crud
|
|
|
|
|
+ :data="data"
|
|
|
|
|
+ :option="option"
|
|
|
|
|
+ :table-loading="loading"
|
|
|
|
|
+ :permission="permissionDataList"
|
|
|
|
|
+ ref="crud"
|
|
|
|
|
+ v-model="form"
|
|
|
|
|
+ :before-open="beforeOpen"
|
|
|
|
|
+ @row-update="rowDataUpdate"
|
|
|
|
|
+ @row-save="rowDataSave"
|
|
|
|
|
+ @row-del="rowDataDel"
|
|
|
|
|
+ >
|
|
|
|
|
+ </avue-crud>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row> -->
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="批量新增" :append-to-body="true" :close-on-click-modal="false" :modal-append-to-body="false" width="90%" :visible.sync="batchVisible" center>
|
|
|
|
|
+ <el-form :inline="true" :rules="batchRules" ref="batchForm" :model="batchForm" label-width="100px">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-form-item label="楼栋区间" required>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="buildingBegin">
|
|
|
|
|
+ <el-input v-model="batchForm.buildingBegin"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="buildingEnd">
|
|
|
|
|
+ <el-input v-model="batchForm.buildingEnd"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="前后缀规则">
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date1">
|
|
|
|
|
+ <el-input placeholder="前缀" v-model="batchForm.buildingPrefix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date2">
|
|
|
|
|
+ <el-input placeholder="后缀" v-model="batchForm.buildingSuffix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-form-item label="单元区间" required>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="unitBegin">
|
|
|
|
|
+ <el-input v-model="batchForm.unitBegin"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="unitEnd">
|
|
|
|
|
+ <el-input v-model="batchForm.unitEnd"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="前后缀规则">
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date1">
|
|
|
|
|
+ <el-input placeholder="前缀" v-model="batchForm.unitPrefix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date2">
|
|
|
|
|
+ <el-input placeholder="后缀" v-model="batchForm.unitSuffix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-form-item label="楼层区间" required>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="floorBegin">
|
|
|
|
|
+ <el-input v-model="batchForm.floorBegin"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="floorEnd">
|
|
|
|
|
+ <el-input v-model="batchForm.floorEnd"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="前后缀规则">
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date1">
|
|
|
|
|
+ <el-input placeholder="前缀" v-model="batchForm.floorPrefix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date2">
|
|
|
|
|
+ <el-input placeholder="后缀" v-model="batchForm.floorSuffix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="排除楼层" :span="2">
|
|
|
|
|
+ <el-input style="width: 100%;" v-model="batchForm.floorExclude"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-form-item label="房屋区间" required>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="roomBegin">
|
|
|
|
|
+ <el-input v-model="batchForm.roomBegin"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="roomEnd">
|
|
|
|
|
+ <el-input v-model="batchForm.roomEnd"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="前后缀规则">
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date1">
|
|
|
|
|
+ <el-input placeholder="前缀" v-model="batchForm.roomPrefix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col class="line" style="width: 15px" :span="2">-</el-col>
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
|
+ <el-form-item prop="date2">
|
|
|
|
|
+ <el-input placeholder="后缀" v-model="batchForm.roomSuffix" style="width: 100%;"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="排除房屋" :span="2">
|
|
|
|
|
+ <el-input style="width: 100%;" v-model="batchForm.roomExclude"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <div style="text-align: center">
|
|
|
|
|
+ <el-button type="primary" @click="batchAdd" :disabled="batchDisabled" :icon="batchIcon">{{batchText}}</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ </basic-container>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import { getList as getBuildingListByResidentialOldId,add as buildingAdd,getDetail as buildingGetDetail,update as buildingUpdate,remove as buildingRemove } from '../../../api/community/building.js';
|
|
|
|
|
+import { getList as getUnitListByBuildingOldId, add as unitAdd, getDetail as unitGetDetail, update as unitUpdate, remove as unitRemove } from "../../../api/community/unit.js";
|
|
|
|
|
+import { getList as getFloorListByUnitOldId, add as floorAdd, getDetail as floorGetDetail, update as floorUpdate, remove as floorRemove } from "../../../api/community/floor.js";
|
|
|
|
|
+import { getList as getRoomListByFloorOldId, add as roomAdd, getDetail as roomGetDetail, update as roomUpdate, remove as roomRemove } from "../../../api/community/room.js";
|
|
|
|
|
+import { mapGetters } from 'vuex';
|
|
|
|
|
+import Log from '../../../api/tool/MyLog.js';
|
|
|
|
|
+import ArrUtil from '../../../api/tool/ArrUtil.js';
|
|
|
|
|
+
|
|
|
|
|
+import {batchAddSubmit} from "@/api/community/building";
|
|
|
|
|
+import {validatePhone, validatNum} from "../../../util/validator";
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ props:{
|
|
|
|
|
+ residentialId: "",
|
|
|
|
|
+ residentialName: "",
|
|
|
|
|
+ visible: false
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ selectBuildingId: "",
|
|
|
|
|
+ selectUnitId: "",
|
|
|
|
|
+ selectFloorId: "",
|
|
|
|
|
+ permissionDataList: [],
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ batchVisible: false,
|
|
|
|
|
+ batchIcon: 'el-icon-circle-plus-outline',
|
|
|
|
|
+ batchDisabled: false,
|
|
|
|
|
+ batchText: '提交',
|
|
|
|
|
+ typeParent: 'parent',
|
|
|
|
|
+ typeBuilding: 'building',
|
|
|
|
|
+ typeUnit: 'unit',
|
|
|
|
|
+ typeFloor: 'floor',
|
|
|
|
|
+ typeRoom: 'room',
|
|
|
|
|
+ form: {},
|
|
|
|
|
+ batchForm: {},
|
|
|
|
|
+ batchRules: {
|
|
|
|
|
+ buildingBegin: [
|
|
|
|
|
+ { required: true, message: '请输入楼栋区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ buildingEnd: [
|
|
|
|
|
+ { required: true, message: '请输入楼栋区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ unitBegin: [
|
|
|
|
|
+ { required: true, message: '请输入单元区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ unitEnd: [
|
|
|
|
|
+ { required: true, message: '请输入单元区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ floorBegin: [
|
|
|
|
|
+ { required: true, message: '请输入楼层区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ floorEnd: [
|
|
|
|
|
+ { required: true, message: '请输入楼层区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ roomBegin: [
|
|
|
|
|
+ { required: true, message: '请输入房屋区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ roomEnd: [
|
|
|
|
|
+ { required: true, message: '请输入房屋区间', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ treeData: [],
|
|
|
|
|
+ treeOption:{
|
|
|
|
|
+ label:"name",
|
|
|
|
|
+ value: "id",
|
|
|
|
|
+ children: "children"
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // treeOption: {
|
|
|
|
|
+ // nodeKey: 'id',
|
|
|
|
|
+ // addBtn: false,
|
|
|
|
|
+ // menu: false,
|
|
|
|
|
+ // props: {
|
|
|
|
|
+ // label: 'name',
|
|
|
|
|
+ // value: 'id',
|
|
|
|
|
+ // children: 'children'
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
|
|
+ optionBuilding: {
|
|
|
|
|
+ labelWidth: 100,
|
|
|
|
|
+ tip: false,
|
|
|
|
|
+ viewBtn: true,
|
|
|
|
|
+ selection: false,
|
|
|
|
|
+ border: true,
|
|
|
|
|
+ addBtn: true,
|
|
|
|
|
+ menuWidth:350,
|
|
|
|
|
+ column: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '所属区域',
|
|
|
|
|
+ prop: 'residentialName',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "所属区域",
|
|
|
|
|
+ // prop: "residentialId",
|
|
|
|
|
+ // disabled: true,
|
|
|
|
|
+ // type:'select',
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // // slot: true,
|
|
|
|
|
+ // dicUrl: "/api/cyzh-community/residential/list?size=500",
|
|
|
|
|
+ // props: {
|
|
|
|
|
+ // label: "name",
|
|
|
|
|
+ // value: "id"
|
|
|
|
|
+ // },
|
|
|
|
|
+ // dicFormatter: (res) => {
|
|
|
|
|
+ // return res.data.records;
|
|
|
|
|
+ // },
|
|
|
|
|
+ // rules: [{
|
|
|
|
|
+ // required: false,
|
|
|
|
|
+ // message: "请选择所属区域",
|
|
|
|
|
+ // trigger: "blur"
|
|
|
|
|
+ // }]
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '楼栋名称',
|
|
|
|
|
+ prop: 'name',
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入楼房名称',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "图片",
|
|
|
|
|
+ prop: "pic",
|
|
|
|
|
+ type: 'upload',
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ propsHttp: {
|
|
|
|
|
+ res: "data",
|
|
|
|
|
+ url: 'link'
|
|
|
|
|
+ },
|
|
|
|
|
+ listType: 'picture-img',
|
|
|
|
|
+ span: 24,
|
|
|
|
|
+ row: true,
|
|
|
|
|
+ action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
|
|
+ display: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入封面图片",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '单元总数',
|
|
|
|
|
+ prop: 'unitCount',
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: '请输入楼房编号',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '楼层总数',
|
|
|
|
|
+ prop: 'floorCount',
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入楼房层数',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '房间总数',
|
|
|
|
|
+ prop: 'roomCount',
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入房间数量',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '住户总数',
|
|
|
|
|
+ prop: 'userCount',
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: '请输入楼房地址',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'type',
|
|
|
|
|
+ value: 'building',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ display: false
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ optionUnit: {
|
|
|
|
|
+ labelWidth: 100,
|
|
|
|
|
+ tip: false,
|
|
|
|
|
+ // addBtn: true,
|
|
|
|
|
+ viewBtn: true,
|
|
|
|
|
+ selection: false,
|
|
|
|
|
+ border: true,
|
|
|
|
|
+ menuWidth:350,
|
|
|
|
|
+ column: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '所属区域',
|
|
|
|
|
+ prop: 'residentialName',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "所属区域",
|
|
|
|
|
+ // prop: "residentialId",
|
|
|
|
|
+ // disabled: true,
|
|
|
|
|
+ // type:'select',
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // cascaderItem: ['buildingId'],
|
|
|
|
|
+ // // slot: true,
|
|
|
|
|
+ // dicUrl: "/api/cyzh-community/residential/list?size=500",
|
|
|
|
|
+ // props: {
|
|
|
|
|
+ // label: "name",
|
|
|
|
|
+ // value: "id"
|
|
|
|
|
+ // },
|
|
|
|
|
+ // dicFormatter: (res) => {
|
|
|
|
|
+ // return res.data.records;
|
|
|
|
|
+ // },
|
|
|
|
|
+ // rules: [{
|
|
|
|
|
+ // required: false,
|
|
|
|
|
+ // message: "请选择所属区域",
|
|
|
|
|
+ // trigger: "blur"
|
|
|
|
|
+ // }]
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "所属楼栋",
|
|
|
|
|
+ prop: "buildingId",
|
|
|
|
|
+ type:'select',
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: "name",
|
|
|
|
|
+ value: "id"
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '单元名称',
|
|
|
|
|
+ prop: 'name',
|
|
|
|
|
+ maxlength: 10,
|
|
|
|
|
+ showWordLimit: true,
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入楼层名称',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "图片",
|
|
|
|
|
+ prop: "pic",
|
|
|
|
|
+ type: 'upload',
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ propsHttp: {
|
|
|
|
|
+ res: "data",
|
|
|
|
|
+ url: 'link'
|
|
|
|
|
+ },
|
|
|
|
|
+ listType: 'picture-img',
|
|
|
|
|
+ span: 24,
|
|
|
|
|
+ row: true,
|
|
|
|
|
+
|
|
|
|
|
+ action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
|
|
+ display: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入封面图片",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "负责人姓名",
|
|
|
|
|
+ prop: "personName",
|
|
|
|
|
+ labelWidth: 110,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入负责人姓名",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ }, {
|
|
|
|
|
+ label: "负责人电话",
|
|
|
|
|
+ prop: "personTel",
|
|
|
|
|
+ labelWidth: 110,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入负责人电话",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ },{
|
|
|
|
|
+ validator: validatePhone,
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ }, {
|
|
|
|
|
+ label: "建筑年代",
|
|
|
|
|
+ prop: "builtYear",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ }, {
|
|
|
|
|
+ label: "产权性质",
|
|
|
|
|
+ prop: "propertyNature",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "有无电梯",
|
|
|
|
|
+ // prop: "includingElevator",
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // type: "select",
|
|
|
|
|
+ // search: true,
|
|
|
|
|
+ // dicUrl: "/api/blade-system/dict-biz/dictionary?code=including_elevator",
|
|
|
|
|
+ // props: {
|
|
|
|
|
+ // label: "dictValue",
|
|
|
|
|
+ // value: "dictKey"
|
|
|
|
|
+ // },
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "楼层数量",
|
|
|
|
|
+ prop: "floorCount",
|
|
|
|
|
+ display: false
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "房间数量",
|
|
|
|
|
+ prop: "roomCount",
|
|
|
|
|
+ display: false
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "住户数量",
|
|
|
|
|
+ prop: "userCount",
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'type',
|
|
|
|
|
+ value: 'unit',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ optionFloor: {
|
|
|
|
|
+ labelWidth: 100,
|
|
|
|
|
+ tip: false,
|
|
|
|
|
+ viewBtn: true,
|
|
|
|
|
+ selection: false,
|
|
|
|
|
+ border: true,
|
|
|
|
|
+ menuWidth:350,
|
|
|
|
|
+ column: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '所属区域',
|
|
|
|
|
+ prop: 'residentialName',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "所属区域",
|
|
|
|
|
+ // prop: "residentialId",
|
|
|
|
|
+ // disabled: true,
|
|
|
|
|
+ // type:'select',
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // // slot: true,
|
|
|
|
|
+ // cascaderItem: ['buildingId'],
|
|
|
|
|
+ // dicUrl: "/api/cyzh-community/residential/list?size=500",
|
|
|
|
|
+ // props: {
|
|
|
|
|
+ // label: "name",
|
|
|
|
|
+ // value: "id"
|
|
|
|
|
+ // },
|
|
|
|
|
+ // dicFormatter: (res) => {
|
|
|
|
|
+ // return res.data.records;
|
|
|
|
|
+ // },
|
|
|
|
|
+ // rules: [{
|
|
|
|
|
+ // required: false,
|
|
|
|
|
+ // message: "请选择所属区域",
|
|
|
|
|
+ // trigger: "blur"
|
|
|
|
|
+ // }]
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "所属楼栋",
|
|
|
|
|
+ prop: "buildingId",
|
|
|
|
|
+ // slot: true,
|
|
|
|
|
+ type:'select',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ dicUrl: `/api/cyzh-community/building/list?size=100&residentialId=` + this.residentialId,
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: "name",
|
|
|
|
|
+ value: "id"
|
|
|
|
|
+ },
|
|
|
|
|
+ dicFormatter: (res) => {
|
|
|
|
|
+ return res.data.records;
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请选择所属楼栋",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '所属单元',
|
|
|
|
|
+ prop: 'unitId',
|
|
|
|
|
+ type: 'select',
|
|
|
|
|
+ dicData: [],
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: 'name',
|
|
|
|
|
+ value: 'id'
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: '请选择所属楼房',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '楼层名称',
|
|
|
|
|
+ prop: 'name',
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入房间名称',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "负责人姓名",
|
|
|
|
|
+ prop: "personName",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入负责人姓名",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "负责人电话",
|
|
|
|
|
+ prop: "personTel",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入负责人电话",
|
|
|
|
|
+ },{
|
|
|
|
|
+ validator: validatePhone,
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "建筑年代",
|
|
|
|
|
+ prop: "builtYear",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ dataType: "string",
|
|
|
|
|
+ type: "year",
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入建筑年代",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "产权性质",
|
|
|
|
|
+ prop: "propertyNature",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入产权性质",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "有无电梯",
|
|
|
|
|
+ prop: "includingElevator",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ type: "select",
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ dicData: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "有",
|
|
|
|
|
+ value: "1"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "无",
|
|
|
|
|
+ value: "0"
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入有无电梯",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "房间数量",
|
|
|
|
|
+ prop: "roomCount",
|
|
|
|
|
+ display: false,
|
|
|
|
|
+
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入房间数量",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "住户数量",
|
|
|
|
|
+ prop: "userCount",
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入住户数量",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'type',
|
|
|
|
|
+ value: 'buildingRoom',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ optionRoom: {
|
|
|
|
|
+ labelWidth: 100,
|
|
|
|
|
+ tip: false,
|
|
|
|
|
+ viewBtn: true,
|
|
|
|
|
+ selection: false,
|
|
|
|
|
+ border: true,
|
|
|
|
|
+ menuWidth:350,
|
|
|
|
|
+ column: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '所属区域',
|
|
|
|
|
+ prop: 'residentialName',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "所属区域",
|
|
|
|
|
+ // prop: "residentialId",
|
|
|
|
|
+ // // slot: true,
|
|
|
|
|
+ // type: "select",
|
|
|
|
|
+ // remote: true,
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // disabled: true,
|
|
|
|
|
+ // cascaderIndex:0,
|
|
|
|
|
+ // searchFilterable:true,
|
|
|
|
|
+ // // dicUrl: "/grid/estate/getResidentialList",
|
|
|
|
|
+ // dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}&size=500",
|
|
|
|
|
+ // dicFormatter: (res)=>{
|
|
|
|
|
+ // return res.data.records;
|
|
|
|
|
+ // },
|
|
|
|
|
+ // dicFlag: false,
|
|
|
|
|
+ // props: {
|
|
|
|
|
+ // label: "name",
|
|
|
|
|
+ // value: "id"
|
|
|
|
|
+ // },
|
|
|
|
|
+ // rules: [{
|
|
|
|
|
+ // required: false,
|
|
|
|
|
+ // message: "请输入所属区域名称",
|
|
|
|
|
+ // trigger: "blur"
|
|
|
|
|
+ // }]
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "所属楼栋",
|
|
|
|
|
+ prop: "buildingId",
|
|
|
|
|
+ // slot: true,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ type: "select",
|
|
|
|
|
+ dicFlag: false,
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ searchFilterable:true,
|
|
|
|
|
+ cascaderIndex:1,
|
|
|
|
|
+ dicUrl: "/api/cyzh-community/building/list?residentialId={{key}}&size=100",
|
|
|
|
|
+ dicFormatter: (res)=>{
|
|
|
|
|
+ return res.data.records;
|
|
|
|
|
+ },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: "name",
|
|
|
|
|
+ value: "id"
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入所属楼栋",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "所属单元",
|
|
|
|
|
+ prop: "unitId",
|
|
|
|
|
+ // slot: true,
|
|
|
|
|
+ type: "select",
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ dicFlag: false,
|
|
|
|
|
+ cascaderItem: ["floorId"],
|
|
|
|
|
+ // dicUrl: "/api/cyzh-community/residential/list?residentialId={{key}}",
|
|
|
|
|
+ dicUrl: "/api/cyzh-community/unit/list?residentialId={{key}&size=100",
|
|
|
|
|
+ dicFormatter: (res)=>{
|
|
|
|
|
+ return res.data.records;
|
|
|
|
|
+ },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: "name",
|
|
|
|
|
+ value: "id"
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入所属单元名称",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "所属楼层",
|
|
|
|
|
+ // width: 150,
|
|
|
|
|
+ prop: "floorId",
|
|
|
|
|
+ type: "select",
|
|
|
|
|
+ dicFlag: false,
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ cascaderIndex:1,
|
|
|
|
|
+ // dicUrl: "/grid/estate/getUnitList",
|
|
|
|
|
+ dicUrl: "/api/cyzh-community/floor/list?unitId={{key}}&size=50",
|
|
|
|
|
+ dicFormatter: (res)=>{
|
|
|
|
|
+ return res.data.records;
|
|
|
|
|
+ },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: "name",
|
|
|
|
|
+ value: "id"
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "请输入所属单元名称",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "门牌号 ",
|
|
|
|
|
+ prop: "name",
|
|
|
|
|
+ // search: true,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: "请输入门牌号-限制数字,单元楼下唯一 ",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "房屋面积(平方米)",
|
|
|
|
|
+ prop: "area",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ labelWidth: 140,
|
|
|
|
|
+ rules: [{
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ message: "房屋面积(平方米)",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ },{
|
|
|
|
|
+ validator: validatNum,
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }]
|
|
|
|
|
+ },{
|
|
|
|
|
+ label: "入住用户数量",
|
|
|
|
|
+ prop: "userCount",
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "户型",
|
|
|
|
|
+ // prop: "houseType",
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // type: "select",
|
|
|
|
|
+ // // search: true,
|
|
|
|
|
+ // dicUrl: "/api/blade-system/dict-biz/dictionary?code=house_type",
|
|
|
|
|
+ // props: {
|
|
|
|
|
+ // label: "dictValue",
|
|
|
|
|
+ // value: "dictKey"
|
|
|
|
|
+ // },
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "楼层",
|
|
|
|
|
+ // prop: "floor",
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "装饰",
|
|
|
|
|
+ prop: "ornament",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "房屋朝向",
|
|
|
|
|
+ // prop: "orientation",
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "序号",
|
|
|
|
|
+ // prop: "serial",
|
|
|
|
|
+ // value: 1,
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // display: false,
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "备注",
|
|
|
|
|
+ prop: "remark",
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: "创建时间",
|
|
|
|
|
+ // prop: "createTime",
|
|
|
|
|
+ // hide: true,
|
|
|
|
|
+ // type: "datetime",
|
|
|
|
|
+ // valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
|
|
+ // display: false,
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'type',
|
|
|
|
|
+ valueDefault: 'bed',
|
|
|
|
|
+ disabled: true,
|
|
|
|
|
+ hide: true,
|
|
|
|
|
+ display: false,
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ data: [],
|
|
|
|
|
+ option: {
|
|
|
|
|
+ tip: false,
|
|
|
|
|
+ viewBtn: true,
|
|
|
|
|
+ selection: false,
|
|
|
|
|
+ addBtn: false,
|
|
|
|
|
+ column: []
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ created() {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapGetters(['permission']),
|
|
|
|
|
+ permissionBuildingList() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addBtn: this.vaildData(this.permission.building_add, false),
|
|
|
|
|
+ viewBtn: this.vaildData(this.permission.building_view, false),
|
|
|
|
|
+ delBtn: this.vaildData(this.permission.building_delete, false),
|
|
|
|
|
+ editBtn: this.vaildData(this.permission.building_edit, false)
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ permissionBuildinglayerList() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addBtn: this.vaildData(this.permission.buildinglayer_add, false),
|
|
|
|
|
+ viewBtn: this.vaildData(this.permission.buildinglayer_view, false),
|
|
|
|
|
+ delBtn: this.vaildData(this.permission.buildinglayer_delete, false),
|
|
|
|
|
+ editBtn: this.vaildData(this.permission.buildinglayer_edit, false)
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ permissionBuildingroomList() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addBtn: this.vaildData(this.permission.buildingroom_add, false),
|
|
|
|
|
+ viewBtn: this.vaildData(this.permission.buildingroom_view, false),
|
|
|
|
|
+ delBtn: this.vaildData(this.permission.buildingroom_delete, false),
|
|
|
|
|
+ editBtn: this.vaildData(this.permission.buildingroom_edit, false)
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ permissionBedList() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addBtn: this.vaildData(this.permission.bed_add, false),
|
|
|
|
|
+ viewBtn: this.vaildData(this.permission.bed_view, false),
|
|
|
|
|
+ delBtn: this.vaildData(this.permission.bed_delete, false),
|
|
|
|
|
+ editBtn: this.vaildData(this.permission.bed_edit, false)
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ permissionTreeList() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addBtn: this.vaildData(this.permission.building_add, false),
|
|
|
|
|
+ viewBtn: this.vaildData(this.permission.building_view, false),
|
|
|
|
|
+ delBtn: this.vaildData(this.permission.building_delete, false),
|
|
|
|
|
+ editBtn: this.vaildData(this.permission.building_edit, false)
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ permissionDataList() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addBtn: this.vaildData(this.permission.building_add, false),
|
|
|
|
|
+ viewBtn: this.vaildData(this.permission.building_view, false),
|
|
|
|
|
+ delBtn: this.vaildData(this.permission.building_delete, false),
|
|
|
|
|
+ editBtn: this.vaildData(this.permission.building_edit, false)
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ ids() {
|
|
|
|
|
+ let ids = [];
|
|
|
|
|
+ this.selectionList.forEach(ele => {
|
|
|
|
|
+ ids.push(ele.id);
|
|
|
|
|
+ });
|
|
|
|
|
+ return ids.join(',');
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ init(){
|
|
|
|
|
+ const tenantType = localStorage.getItem("tenantType");
|
|
|
|
|
+ if (tenantType == 0){
|
|
|
|
|
+ let residentialNameProp = this.findObject(this.optionBuilding.column, "residentialName");
|
|
|
|
|
+ residentialNameProp.label = "所属区域"
|
|
|
|
|
+ }else if (tenantType == 1){
|
|
|
|
|
+ let residentialNameProp = this.findObject(this.optionBuilding.column, "residentialName");
|
|
|
|
|
+ residentialNameProp.label = "所属区域"
|
|
|
|
|
+ }
|
|
|
|
|
+ this.option = this.optionBuilding;
|
|
|
|
|
+ this.treeData = [{ id: this.residentialId, type: this.typeParent, name: this.residentialName, children: [] }];
|
|
|
|
|
+ this.onLoadBuilding(this.residentialId);
|
|
|
|
|
+ },
|
|
|
|
|
+ rowDataSave(row, loading, done) {
|
|
|
|
|
+ row.residentialId = this.residentialId;
|
|
|
|
|
+ row.residentialName = this.residentialName;
|
|
|
|
|
+ if (row.type == this.typeBuilding) {
|
|
|
|
|
+ buildingAdd(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadBuilding(this.residentialId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ } else if (row.type == this.typeUnit) {
|
|
|
|
|
+ unitAdd(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadUnit(row.buildingId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ } else if (row.type == this.typeFloor) {
|
|
|
|
|
+ floorAdd(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadFloor(row.buildingId, row.unitId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ } else if (row.type == this.typeRoom) {
|
|
|
|
|
+ roomAdd(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadRoom(row.buildingId, row.unitId, row.floorId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ rowDataUpdate(row, index, loading, done) {
|
|
|
|
|
+ if (row.type == this.typeBuilding) {
|
|
|
|
|
+ buildingUpdate(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadBuilding(this.residentialId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ } else if (row.type == this.typeUnit) {
|
|
|
|
|
+ unitUpdate(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadUnit(row.buildingId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ } else if (row.type == this.typeFloor) {
|
|
|
|
|
+ floorUpdate(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadFloor(row.buildingId, row.unitId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ } else if (row.type == this.typeRoom) {
|
|
|
|
|
+ roomUpdate(row).then(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ loading();
|
|
|
|
|
+ this.onLoadRoom(row.buildingId, row.unitId, row.floorId);
|
|
|
|
|
+ this.$message({ type: 'success', message: '操作成功!' });
|
|
|
|
|
+ },
|
|
|
|
|
+ error => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ Log.d(error);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ rowDataDel(row) {
|
|
|
|
|
+ this.$confirm('确定将选择数据删除?', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ Log.e(row);
|
|
|
|
|
+ if (row.type == this.typeBuilding) {
|
|
|
|
|
+ return buildingRemove(row.id);
|
|
|
|
|
+ } else if (row.type == this.typeUnit) {
|
|
|
|
|
+ return unitRemove(row.id);
|
|
|
|
|
+ } else if (row.type == this.typeFloor) {
|
|
|
|
|
+ return floorRemove(row.id);
|
|
|
|
|
+ } else if (row.type == this.typeRoom) {
|
|
|
|
|
+ return roomRemove(row.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ if (row.type == this.typeBuilding) {
|
|
|
|
|
+ this.onLoadBuilding(this.residentialId);
|
|
|
|
|
+ } else if (row.type == this.typeUnit) {
|
|
|
|
|
+ this.onLoadUnit(row.buildingId);
|
|
|
|
|
+ } else if (row.type == this.typeFloor) {
|
|
|
|
|
+ this.onLoadFloor(row.buildingId, row.unitId);
|
|
|
|
|
+ } else if (row.type == this.typeRoom) {
|
|
|
|
|
+ this.onLoadRoom(row.buildingId, row.unitId, row.floorId);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '操作成功!'
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ nodeClick(data) {
|
|
|
|
|
+ // Log.e('======data>>' + JSON.stringify(data));
|
|
|
|
|
+ if (data.type == this.typeParent) {
|
|
|
|
|
+ this.initBuildingDatas();
|
|
|
|
|
+ } else if (data.type == this.typeBuilding) {
|
|
|
|
|
+ console.log("获取单元树")
|
|
|
|
|
+ this.initUnitDatas(data);
|
|
|
|
|
+ } else if (data.type == this.typeUnit) {
|
|
|
|
|
+ console.log("获取楼层树")
|
|
|
|
|
+ console.log("所属单元名称:"+data.name)
|
|
|
|
|
+ // debugger
|
|
|
|
|
+ this.initFloorDatas(data);
|
|
|
|
|
+ } else if (data.type == this.typeFloor) {
|
|
|
|
|
+ console.log("获取房间树")
|
|
|
|
|
+ console.log("所属楼层:"+data.name)
|
|
|
|
|
+
|
|
|
|
|
+ this.initRoomDatas(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeOpen(done, type) {
|
|
|
|
|
+ this.form["residentialId"] = this.residentialId;
|
|
|
|
|
+ this.form["residentialName"] = this.residentialName;
|
|
|
|
|
+ this.form["buildingId"] = this.selectBuildingId;
|
|
|
|
|
+ this.form["unitId"] = this.selectUnitId;
|
|
|
|
|
+ this.form["floorId"] = this.selectFloorId;
|
|
|
|
|
+ if (['edit', 'view'].includes(type)) {
|
|
|
|
|
+ if (this.form.type == this.typeBuilding) {
|
|
|
|
|
+ buildingGetDetail(this.form.id).then(res => {
|
|
|
|
|
+ this.form = res.data.data;
|
|
|
|
|
+ this.form.type = this.typeBuilding;
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (this.form.type == this.typeUnit) {
|
|
|
|
|
+ unitGetDetail(this.form.id).then(res => {
|
|
|
|
|
+ this.form = res.data.data;
|
|
|
|
|
+ this.form.type = this.typeUnit;
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (this.form.type == this.typeFloor) {
|
|
|
|
|
+ floorGetDetail(this.form.id).then(res => {
|
|
|
|
|
+ this.form = res.data.data;
|
|
|
|
|
+ this.form.type = this.typeFloor;
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (this.form.type == this.typeRoom) {
|
|
|
|
|
+ roomGetDetail(this.form.id).then(res => {
|
|
|
|
|
+ this.form = res.data.data;
|
|
|
|
|
+ this.form.type = this.typeRoom;
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.form.pic = "/img/default/building.png"
|
|
|
|
|
+ }
|
|
|
|
|
+ done();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ //加载右侧数据
|
|
|
|
|
+ onLoadBuilding(id,params={}) {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ type: this.typeBuilding,
|
|
|
|
|
+ residentialId: this.residentialId,
|
|
|
|
|
+ residentialName: this.residentialName
|
|
|
|
|
+ };
|
|
|
|
|
+ params.residentialId = id;
|
|
|
|
|
+ console.log("residential")
|
|
|
|
|
+ getBuildingListByResidentialOldId(1,100,params).then(res => {
|
|
|
|
|
+ this.data = res.data.data.records;
|
|
|
|
|
+ this.initTreeDatasByBuilding(this.data);
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoadUnit(buildingId,params={}) {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ params.buildingId = buildingId;
|
|
|
|
|
+ getUnitListByBuildingOldId(1,100,params).then(res => {
|
|
|
|
|
+ this.data = res.data.data.records;
|
|
|
|
|
+ this.initTreeDatasByUnit(this.data, buildingId);
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoadFloor(buildingId, unitId,params={}) {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ params.unitId = unitId;
|
|
|
|
|
+ getFloorListByUnitOldId(1,50,params).then(res => {
|
|
|
|
|
+ this.data = res.data.data.records;
|
|
|
|
|
+ this.initTreeDatasByFloor(this.data, buildingId, unitId);
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoadRoom(buildingId, unitId, floorId,params={}) {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ params.floorId = floorId;
|
|
|
|
|
+ console.log("楼层id:"+floorId)
|
|
|
|
|
+ getRoomListByFloorOldId(1, 100, params).then(res => {
|
|
|
|
|
+ this.data = res.data.data.records;
|
|
|
|
|
+ // debugger
|
|
|
|
|
+ for (let data of this.data) data.type = this.typeRoom;
|
|
|
|
|
+ this.initTreeDatasByRoom(this.data, buildingId, unitId, floorId);
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 点击左侧树形Item后初始化右侧数据
|
|
|
|
|
+ initBuildingDatas() {
|
|
|
|
|
+ //初始化楼栋
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ type: this.typeBuilding,
|
|
|
|
|
+ residentialId: this.residentialId,
|
|
|
|
|
+ residentialName: this.residentialName,
|
|
|
|
|
+ };
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ this.$set(this, 'option', this.optionBuilding);
|
|
|
|
|
+ this.onLoadBuilding(this.residentialId);
|
|
|
|
|
+ },
|
|
|
|
|
+ initUnitDatas(data) {
|
|
|
|
|
+ //初始化单元
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ type: this.typeUnit,
|
|
|
|
|
+ residentialId: this.residentialId,
|
|
|
|
|
+ // residentialName: this.residentialName,
|
|
|
|
|
+ buildingId: data.id
|
|
|
|
|
+ };
|
|
|
|
|
+ this.selectBuildingId = data.id;
|
|
|
|
|
+ this.initUnitDicData(data.id, this.optionUnit);
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ this.$set(this, 'option', this.optionUnit);
|
|
|
|
|
+ this.onLoadUnit(data.id);
|
|
|
|
|
+ },
|
|
|
|
|
+ initFloorDatas(data) {
|
|
|
|
|
+ //初始化楼层
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ type: this.typeFloor,
|
|
|
|
|
+ residentialId: this.residentialId,
|
|
|
|
|
+ // residentialName: this.residentialName,
|
|
|
|
|
+ buildingId: data.buildingId,
|
|
|
|
|
+ unitId: data.id
|
|
|
|
|
+ };
|
|
|
|
|
+ this.selectUnitId = data.id;
|
|
|
|
|
+ this.initFloorDicDatas(data.buildingId, data.id, this.optionFloor);
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ this.$set(this, 'option', this.optionFloor);
|
|
|
|
|
+ this.onLoadFloor(data.buildingId, data.id);
|
|
|
|
|
+ },
|
|
|
|
|
+ initRoomDatas(data) {
|
|
|
|
|
+ //初始化房间
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ type: this.typeRoom,
|
|
|
|
|
+ residentialId: this.residentialId,
|
|
|
|
|
+ // residentialName: this.residentialName,
|
|
|
|
|
+ buildingId: data.buildingId,
|
|
|
|
|
+ unitId: data.unitId,
|
|
|
|
|
+ floorId: data.id
|
|
|
|
|
+ };
|
|
|
|
|
+ this.selectFloorId = data.id;
|
|
|
|
|
+ this.initRoomDicData(data.buildingId, data.unitId, data.id);
|
|
|
|
|
+ this.$set(this, 'form', this.form);
|
|
|
|
|
+ this.$set(this, 'option', this.optionRoom);
|
|
|
|
|
+
|
|
|
|
|
+ this.onLoadRoom(data.buildingId, data.unitId, data.id);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 点击左侧树形Item后初始化右侧选择项目数据
|
|
|
|
|
+ initUnitDicData(buildingOldId, option) {
|
|
|
|
|
+ if (option == null) option = this.optionUnit;
|
|
|
|
|
+ //初始化上一级下拉数据
|
|
|
|
|
+ for (let column of option.column) {
|
|
|
|
|
+ if (column.prop == 'buildingId') {
|
|
|
|
|
+ column.valueDefault = buildingOldId;
|
|
|
|
|
+ column.dicData = this.treeData[0].children;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ initFloorDicDatas(buildingId, unitId, option) {
|
|
|
|
|
+ if (option == null) option = this.optionFloor;
|
|
|
|
|
+ // this.initFloorDicData(buildingId, option);
|
|
|
|
|
+ //初始化上一级下拉数据
|
|
|
|
|
+ for (let column of option.column) {
|
|
|
|
|
+ if (column.prop == 'unitId') {
|
|
|
|
|
+ column.valueDefault = unitId;
|
|
|
|
|
+ for (let building of this.treeData[0].children) {
|
|
|
|
|
+ if (building.id == buildingId) {
|
|
|
|
|
+ column.dicData = building.children;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ initRoomDicData(buildingId, unitId, floorId) {
|
|
|
|
|
+ // this.initFloorDicData(buildingId, this.optionRoom);
|
|
|
|
|
+ this.initFloorDicDatas(buildingId, unitId, this.optionRoom);
|
|
|
|
|
+ //初始化上一级下拉数据
|
|
|
|
|
+ // for (let column of this.optionRoom.column) {
|
|
|
|
|
+ // if (column.prop == 'buildingRoomId') {
|
|
|
|
|
+ // column.valueDefault = roomId;
|
|
|
|
|
+ // for (let building of this.treeData[0].children) {
|
|
|
|
|
+ // if (building.id == buildingId) {
|
|
|
|
|
+ // for (let layer of building.children) {
|
|
|
|
|
+ // if (layer.id == layerId) {
|
|
|
|
|
+ // column.dicData = layer.children;
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 初始化右侧数据后更新左侧树形数据
|
|
|
|
|
+ initTreeDatasByBuilding(datas) {
|
|
|
|
|
+ console.log("小区tree", datas);
|
|
|
|
|
+ let treeData = [];
|
|
|
|
|
+ if (!ArrUtil.isNullOrLength(datas)) {
|
|
|
|
|
+ for (let data of datas) {
|
|
|
|
|
+ data.type = this.typeBuilding;
|
|
|
|
|
+ //初始化楼栋数据
|
|
|
|
|
+ treeData = ArrUtil.add(treeData, {
|
|
|
|
|
+ id: data.id,
|
|
|
|
|
+ type: "building",
|
|
|
|
|
+ leaf: false,
|
|
|
|
|
+ name: data.name,
|
|
|
|
|
+ children: [],
|
|
|
|
|
+ tag: data
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.treeData[0].children = treeData;
|
|
|
|
|
+ },
|
|
|
|
|
+ initTreeDatasByUnit(datas, buildingId) {
|
|
|
|
|
+ console.log("楼栋tree", datas);
|
|
|
|
|
+ // debugger
|
|
|
|
|
+ for (let children of this.treeData[0].children) {
|
|
|
|
|
+ if (children.id == buildingId) {
|
|
|
|
|
+ // this.optionUnit.addBtn = children.tag.floorNum > datas.length;
|
|
|
|
|
+ let treeData = [];
|
|
|
|
|
+ for (let data of datas) {
|
|
|
|
|
+ data.type = this.typeUnit;
|
|
|
|
|
+ treeData = ArrUtil.add(treeData, {
|
|
|
|
|
+ id: data.id,
|
|
|
|
|
+ buildingId: buildingId,
|
|
|
|
|
+ type: data.type,
|
|
|
|
|
+ name: data.name,
|
|
|
|
|
+ children: [],
|
|
|
|
|
+ tag: data
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ children.children = treeData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ initTreeDatasByFloor(datas, buildingId, unitId) {
|
|
|
|
|
+ for (let building of this.treeData[0].children) {
|
|
|
|
|
+ if (building.id == buildingId) {
|
|
|
|
|
+ for (let layer of building.children) {
|
|
|
|
|
+ if (layer.id == unitId) {
|
|
|
|
|
+ // this.optionFloor.addBtn = building.tag.roomNum > datas.length;
|
|
|
|
|
+ let treeData = [];
|
|
|
|
|
+ for (let data of datas) {
|
|
|
|
|
+ data.type = this.typeFloor;
|
|
|
|
|
+ treeData = ArrUtil.add(treeData, {
|
|
|
|
|
+ id: data.id,
|
|
|
|
|
+ buildingId: buildingId,
|
|
|
|
|
+ unitId: unitId,
|
|
|
|
|
+ type: data.type,
|
|
|
|
|
+ name: data.name,
|
|
|
|
|
+ children: [],
|
|
|
|
|
+ tag: data
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ layer.children = treeData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ initTreeDatasByRoom(datas, buildingId, unitId, floorId) {
|
|
|
|
|
+ for (let building of this.treeData[0].children) {
|
|
|
|
|
+ if (building.id == buildingId) {
|
|
|
|
|
+ for (let unit of building.children) {
|
|
|
|
|
+ if (unit.id == unitId) {
|
|
|
|
|
+ for (let floor of unit.children) {
|
|
|
|
|
+ if (floor.id == floorId) {
|
|
|
|
|
+ // this.optionRoom.addBtn = floor.tag.bedNum > datas.length;
|
|
|
|
|
+
|
|
|
|
|
+ let treeData = [];
|
|
|
|
|
+ for (let data of datas) {
|
|
|
|
|
+ data.type = this.typeRoom;
|
|
|
|
|
+ treeData = ArrUtil.add(treeData, {
|
|
|
|
|
+ id: data.id,
|
|
|
|
|
+ buildingId: buildingId,
|
|
|
|
|
+ unitId: unitId,
|
|
|
|
|
+ floorId: floorId,
|
|
|
|
|
+ type: data.type,
|
|
|
|
|
+ name: data.name,
|
|
|
|
|
+ children: [],
|
|
|
|
|
+ tag: data
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ floor.children = treeData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ batchAdd(){
|
|
|
|
|
+
|
|
|
|
|
+ this.$refs['batchForm'].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ this.batchForm.residentialId = this.residentialId;
|
|
|
|
|
+ this.batchDisabled = true;
|
|
|
|
|
+ this.batchText = '正在创建中···';
|
|
|
|
|
+ this.batchIcon = 'el-icon-loading';
|
|
|
|
|
+
|
|
|
|
|
+ batchAddSubmit(this.batchForm).then(res => {
|
|
|
|
|
+ if (res.data.code == 200){
|
|
|
|
|
+ this.batchVisible = false;
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.batchIcon = 'el-icon-circle-plus-outline';
|
|
|
|
|
+ this.batchText = '提交';
|
|
|
|
|
+ this.batchDisabled = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|