소스 검색

房间管理

LAPTOP-FO2T5SIU\35838 9 달 전
부모
커밋
66e80cee5c
1개의 변경된 파일83개의 추가작업 그리고 167개의 파일을 삭제
  1. 83 167
      src/views/parkAssets/parkRoom/index.vue

+ 83 - 167
src/views/parkAssets/parkRoom/index.vue

@@ -145,15 +145,15 @@
               <el-table-column label="户室号" prop="roomNo" />
               <el-table-column label="套内面积(㎡)" prop="actualInternalArea" />
               <el-table-column label="建筑面积(㎡)" prop="actualBuildArea" />
-              <el-table-column label="用途" prop="roomUse" />
+              <el-table-column label="用途" prop="roomUseStr" />
               <el-table-column label="装修情况" prop="decorationSituationStr" />
               <el-table-column label="可售状态" prop="saleStatusStr" />
-              <el-table-column label="已售状态" prop="soleStatusStr" />
-              <el-table-column label="操作" header-align="center">
+              <el-table-column label="已售状态" prop="soldStatusStr" />
+              <el-table-column label="操作" header-align="center" width="250">
                 <template scope="scope">
                   <el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
                   <el-button size="mini" type="text" @click="handleDel(scope.row)">删除</el-button>
-                  <el-button size="mini" type="text" @click="handleView(scope.row)">编辑</el-button>
+                  <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -178,13 +178,12 @@
       :title="dialogTitle"
       :visible.sync="dialogVisible"
       :before-close="dialogChose"
-      :model="houseForm"
       width="75%"
       top="50px"
       append-to-body
       @open="dlgOpen"
     >
-      <el-form ref="commitForm" :model="houseForm" style="width: 100%;padding: 5px" :rules="commitRules">
+      <el-form ref="houseForm" :model="houseForm" style="width: 100%;padding: 5px" :rules="commitRules">
         <el-row>
           <el-col style="padding-bottom: 10px">
             <!--            <span class="card_title">基本信息</span>-->
@@ -193,7 +192,7 @@
                 <el-col :span="2" class="col-txt"><span>*父级</span></el-col>
                 <el-col :span="22" class="col-input">
                   <el-form-item prop="findids">
-                    <el-cascader v-model="houseForm.findids" :disabled="isView" style="width: 100%;" :options="options" @change="" />
+                    <el-cascader v-model="houseForm.findids" :disabled="isView" style="width: 100%;" :options="options" @change="buildChange" />
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -257,8 +256,8 @@
               <el-row>
                 <el-col :span="3" class="col-txt"><span>*实测建筑面积(㎡)</span></el-col>
                 <el-col :span="9" class="col-input">
-                  <el-form-item prop="actualBuildlArea">
-                    <el-input v-model="houseForm.actualBuildlArea" :disabled="isView" />
+                  <el-form-item prop="actualBuildArea">
+                    <el-input v-model="houseForm.actualBuildArea" :disabled="isView" />
                   </el-form-item>
                 </el-col>
                 <el-col :span="3" class="col-txt"><span>*实测土地面积(㎡)</span></el-col>
@@ -314,9 +313,9 @@
                 <el-col :span="2" class="col-txt"><span>户型</span></el-col>
                 <el-col :span="10" class="col-input">
                   <el-form-item :disabled="isView">
-                    <el-select v-model="houseForm.decorationSituation" placeholder="" filterable :disabled="isView">
+                    <el-select v-model="houseForm.houseTypeId" placeholder="" filterable :disabled="isView">
                       <el-option
-                        v-for="item in dc_data.DECORATION_SITUATION"
+                        v-for="item in houseTypeOption"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"
@@ -410,38 +409,19 @@ export default {
             dc_key: ['HOUSE_USAGE', 'DECORATION_SITUATION', 'SALE_STATUS', 'SOLD_STATUS'],
             // 查询参数
             queryParam: {
-                groupName: '',
-                floorDiscName: '',
-                guidePrice: '',
                 nodeId: '',
                 level: ''
             },
             options: [],
-            formLP: {},
             houseForm: {
-                isEnable: [],
-                state: [],
-                roomUse: [],
-                region: [],
-                floor: [],
-                decorationSituation: ''
             },
-            groupList: [],
             DeptTree: [],
             urlStr: 'add',
-            // 字典项
-            dc_gender: [],
-            dc_map: {},
-
             AllData: [],
             loading: false,
             dialogVisible: false,
-            dialogVisibleLP: false,
             dialogTitle: '',
             isAdd: true,
-            selectDepartment: [],
-            form: this.getBaseForm(),
-            LeaderData: [],
             commitRules: {
                 findids: [{ required: true, trigger: 'blur', message: '请选择父级' }],
                 roomNo: [{ required: true, trigger: 'blur', message: '请输入户室号' }],
@@ -455,7 +435,7 @@ export default {
                 actualBuildArea: [{ required: true, trigger: 'blur', message: '请输入实测建筑面积' }],
                 actualLandArea: [{ required: true, trigger: 'blur', message: '请输入实测土地面积' }],
                 roomUse: [{ required: true, trigger: 'blur', message: '请输入用途' }],
-                roomNumber: [{ required: true, trigger: 'blur', message: '请输入户编号' }],
+                roomNumber: [{ required: true, trigger: 'blur', message: '请输入户编号' }]
             },
 
             roomId: '',
@@ -465,9 +445,10 @@ export default {
             decorationSituation: [],
             isView: false,
             fileList: [],
+            houseTypeOption: [],
             // 图片预览及其他
             dialogImageUrl: '',
-            dialogImageVisible: false,
+            dialogImageVisible: false
         }
     },
     mounted() {
@@ -475,9 +456,7 @@ export default {
             this.getData()
         })
         this.getTreeData()
-        this.getGroupList()
         this.getTreeSelectData()
-        this.getHandleUserList()
     },
     methods: {
         handleSearch: function() {
@@ -486,20 +465,17 @@ export default {
 
         // 导出
         handleExcel: function() {
-            // this.baseRequest('excellist', {}).then((res) => {
-            //     console.log(res)
-            //     window.location.href = constant.BASE_URI + '/' + res.data.msg
-            // }).catch(() => {
-            // })
             const _this = this
-            this.OutData = []
-            _this.queryParam.direction = _this.direction.join(',')
-            _this.queryParam.states = _this.houseStatus.join(',')
-            _this.queryParam.isEnable = _this.isEnable.join(',')
+            _this.AllData = []
+            _this.queryParam.pageNum = _this.currentPage
+            _this.queryParam.pageSize = _this.pageSize
             _this.queryParam.roomUse = _this.roomUse.join(',')
-            _this.queryParam.currentState = _this.currentState.join(',')
-            const title = ['楼栋号|地号', '区域', '楼层', '房号', '面积', '朝向', '用途',
-                '出租指导价', '当前状态', '租赁状态', '最后更新时间', '可用状态', '可用状态变更时间', '创建时间', '承重', '层高', '用电', '装修情况']
+            _this.queryParam.saleStatus = _this.saleStatus.join(',')
+            _this.queryParam.soldStatus = _this.soldStatus.join(',')
+            _this.queryParam.decorationSituation = _this.decorationSituation.join(',')
+            this.OutData = []
+            const title = ['单元/楼栋号', '所在层', '户室号', '套内面积', '建筑面积', '用途', '装修情况',
+                '可售状态', '已售状态']
             this.OutData.push(title)
             const temp = []
             this.baseRequest('excelList', _this.queryParam).then(res => {
@@ -511,27 +487,18 @@ export default {
                 temp.forEach(function(item) {
                     const jsonArray = []
                     jsonArray.push(item.buildName)
-                    jsonArray.push(item.region)
                     jsonArray.push(item.floor)
                     jsonArray.push(item.roomNo)
-                    jsonArray.push(Number(item.size))
-                    jsonArray.push(item.direction)
+                    jsonArray.push(item.actualInternalArea)
+                    jsonArray.push(item.actualBuildArea)
                     jsonArray.push(item.roomUse)
-                    jsonArray.push(item.guidePrice)
-                    jsonArray.push(item.currentState)
-                    jsonArray.push(item.state)
-                    jsonArray.push(item.stateUpdatedAt)
-                    jsonArray.push(item.isEnable)
-                    jsonArray.push(item.isEnableUpdatedAt)
-                    jsonArray.push(item.createdAt)
-                    jsonArray.push(item.bearing)
-                    jsonArray.push(item.floorHeight)
-                    jsonArray.push(item.electricity)
-                    jsonArray.push(item.decorationSituation)
+                    jsonArray.push(item.decorationSituationStr)
+                    jsonArray.push(item.saleStatusStr)
+                    jsonArray.push(item.soldStatusStr)
                     _this.OutData.push(jsonArray)
                 })
                 const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
-                    { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }]
+                    { wch: 15 }, { wch: 15 }]
                 const fileName = '房间导出 ' + new Date().Format('yyyyMMddhhmm')
                 this.$outputXlsxFile(this.OutData, OutSize, fileName)
             })
@@ -539,25 +506,13 @@ export default {
 
         handleReset: function() {
             this.queryParam = {}
-            this.direction = []
-            this.houseStatus = []
             this.roomUse = []
-            this.currentState = []
-            this.isEnable = []
+            this.saleStatus = []
+            this.soldStatus = []
+            this.decorationSituation = []
             this.getData()
         },
 
-        getGroupList: function() {
-            const _this = this
-            this.baseRequest('listAll', {}).then((res) => {
-                if (res.data) {
-                    this.groupList = res.data
-                }
-                _this.loading = false
-            }).catch(() => {
-            })
-        },
-
         getTreeData: function() {
             this.baseInfoRequest('getTreeData1', {}).then((res) => {
                 this.DeptTree = res.data.data
@@ -578,11 +533,11 @@ export default {
             _this.AllData = []
             _this.queryParam.pageNum = _this.currentPage
             _this.queryParam.pageSize = _this.pageSize
-            _this.queryParam.direction = _this.direction.join(',')
-            _this.queryParam.states = _this.houseStatus.join(',')
-            _this.queryParam.isEnable = _this.isEnable.join(',')
             _this.queryParam.roomUse = _this.roomUse.join(',')
-            _this.queryParam.currentState = _this.currentState.join(',')
+            _this.queryParam.saleStatus = _this.saleStatus.join(',')
+            _this.queryParam.soldStatus = _this.soldStatus.join(',')
+            _this.queryParam.decorationSituation = _this.decorationSituation.join(',')
+
             _this.baseRequest('listByModel', _this.queryParam).then((res) => {
                 if (res.data.rows) {
                     res.data.rows.forEach(function(item) {
@@ -597,9 +552,7 @@ export default {
         },
 
         handleAdd: function() {
-            // 新增时当前可用状态默认为可用 当前状态默认为空置
-            this.houseForm.isEnable = '1'
-            this.houseForm.state = '1'
+            this.isView = false
             this.urlStr = 'add'
             this.dialogVisible = true
             this.dialogTitle = '新增房间'
@@ -613,7 +566,7 @@ export default {
         },
         handleView: function(val) {
             this.isView = true
-            this.houseForm = val
+            this.houseForm.id = val.id
             this.dialogVisible = true
             this.dialogTitle = '查看房间'
         },
@@ -632,7 +585,7 @@ export default {
         },
 
         confirmSubmit: function() {
-            this.$refs.commitForm.validate(valid => {
+            this.$refs.houseForm.validate(valid => {
                 if (valid) {
                     const ids = this.houseForm.findids
                     if (ids != null && ids != [] && ids != '') {
@@ -643,51 +596,30 @@ export default {
                     const extraData = {}
                     const postData = Object.assign({}, this.houseForm, extraData)
 
-                    let planPicture = ''
-                    this.fileList.forEach(v => {
-                        planPicture += v.id + ','
-                    })
-                    postData.planPicture = planPicture
-
-                    let environmentPicture = ''
-                    this.fileList1.forEach(v => {
-                        environmentPicture += v.id + ','
-                    })
-                    postData.environmentPicture = environmentPicture
                     this.baseRequest(this.urlStr, postData).then((res) => {
-                        // if(res.data.code == 200){
                         this.houseForm = {}
                         this.dialogVisible = false
                         this.getData()
                         this.getTreeData()
-                        // alert("提交成功")
                         this.$message({
                             message: '提交成功',
                             type: 'success'
                         })
-                        // }
                     }).catch(() => {
                     })
                 }
             })
         },
 
-        handleChange(data) {
-            console.log(data)
-        },
         getItemJson: function(item) {
-            // 朝向
-            item.direction = this.dc_map.MNP_BUILDING_CX[item.direction]
             // 用途
-            item.roomUse = this.dc_map.HOUSE_USAGE[item.roomUse]
-            // 是否可用
-            item.isEnable = this.dc_map.HOUSE_ENABLE[item.isEnable]
-            // 租赁状态
-            item.state = this.dc_map.HOUSE_STATUS[item.state]
-            // 当前状态
-            item.currentState = this.dc_map.INVESTMENT_STATUS[item.currentState]
+            item.roomUseStr = this.dc_map.HOUSE_USAGE[item.roomUse]
             // 装修情况
-            item.decorationSituation = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
+            item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
+            // 可售状态
+            item.saleStatusStr = this.dc_map.SALE_STATUS[item.saleStatus]
+            // 可售状态
+            item.soldStatusStr = this.dc_map.SOLD_STATUS[item.soldStatus]
             return item
         },
 
@@ -701,31 +633,6 @@ export default {
                 }
             }
         },
-
-        getBaseForm: function() {
-            const baseForm = {
-                id: '',
-                groupId: '',
-                username: '',
-                password: null,
-                truename: '',
-                leader: '',
-                department: [],
-                posts: [],
-                gender: '',
-                phone: '',
-                sequenceNo: '',
-                secretKey: '',
-                comment: ''
-            }
-
-            if (this.$common.currUser().groupId) {
-                baseForm.groupId = this.$common.currUser().groupId
-            }
-
-            return baseForm
-        },
-
         dlgOpen: function() {
             // 填充父级
             this.houseForm.findids = []
@@ -750,28 +657,23 @@ export default {
                     .then(res => {
                         if (res.data) {
                             _this.houseForm = Object.assign({}, _this.houseForm, res.data)
-                            if (res.data.planPicture) {
-                                res.data.planPicture.split(',').forEach(v => {
-                                    if (v) {
-                                        this.fileList.push({
-                                            url:
-                                                Constant.BASE_URI + '/FileController/download/' + v,
-                                            id: v
-                                        })
-                                    }
-                                })
-                            }
-                            if (res.data.environmentPicture) {
-                                res.data.environmentPicture.split(',').forEach(v => {
-                                    if (v) {
-                                        this.fileList1.push({
-                                            url:
-                                                Constant.BASE_URI + '/FileController/download/' + v,
-                                            id: v
-                                        })
-                                    }
-                                })
-                            }
+                            _this.houseForm.roomUse = res.data.roomUse + ''
+                            _this.houseForm.decorationSituation = res.data.decorationSituation + ''
+                            // 回显户型
+                            _this.getHouseTypeList({ discId: _this.houseForm.discId })
+                            _this.houseForm.houseTypeId = res.data.houseTypeId + ''
+
+                            // if (res.data.planPicture) {
+                            //     res.data.planPicture.split(',').forEach(v => {
+                            //         if (v) {
+                            //             this.fileList.push({
+                            //                 url:
+                            //                     Constant.BASE_URI + '/FileController/download/' + v,
+                            //                 id: v
+                            //             })
+                            //         }
+                            //     })
+                            // }
                         }
                     })
                     .catch(() => {})
@@ -791,6 +693,26 @@ export default {
                 this.fileList.push(res)
             })
         },
+        buildChange(val) {
+            const postData = {
+                discId: val[1]
+            }
+            this.getHouseTypeList(postData)
+        },
+        getHouseTypeList(val) {
+            const _this = this
+            _this.houseTypeOption = []
+            _this.baseHouseTypeRequest('listAll', val).then(res => {
+                if (res.data) {
+                    res.data.forEach(item => {
+                        _this.houseTypeOption.push({
+                            label: item.name,
+                            value: item.id
+                        })
+                    })
+                }
+            })
+        },
         // 请求封装,继承类中调用,必须存在
         baseRequest: function(opUrl, postData) {
             return this.$channel.baseRequest('ParkRoomController', opUrl, postData, 'User')
@@ -798,14 +720,8 @@ export default {
         baseInfoRequest: function(opUrl, postData) {
             return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
         },
-        postRequest: function(opUrl, postData) {
-            return this.$channel.baseRequest('PostController', opUrl, postData, 'Post')
-        },
-        baseFloorDiscRequest: function(opUrl, postData) {
-            return this.$channel.baseRequest('ParkFloorDiscController', opUrl, postData, 'User')
-        },
-        baseMnpBuildRequest: function(opUrl, postData) {
-            return this.$channel.baseRequest('MnpBuildingController', opUrl, postData, 'Post')
+        baseHouseTypeRequest: function(opUrl, postData) {
+            return this.$channel.baseRequest('HouseTypeController', opUrl, postData, 'Post')
         }
 
     }