Pārlūkot izejas kodu

1、添加房屋管理和和商品管理

wangfen 3 gadi atpakaļ
vecāks
revīzija
9a23299051

+ 149 - 0
operationSupport/src/components/common/buildingTree.vue

@@ -0,0 +1,149 @@
+<template>
+    <div class="organ-tree">
+        <el-input v-model="filterText" placeholder="请输入关键字"><i slot="suffix" class="el-icon-search"></i></el-input>
+        <div class="tree-style-box no-scrollbar">
+            <el-tree
+                class="tree-style"
+                :data="organList"
+                ref="tree"
+                node-key="id"
+                :highlight-current="true"
+                :props="defaultProps"
+                :expand-on-click-node="false"
+                @node-click="treeClick"
+                default-expand-all
+                :filter-node-method="filterNode"
+            >
+            </el-tree>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'buildingTree',
+    data() {
+        return {
+            filterText: '',
+            organList: [],
+            defaultProps: {
+                children: 'children',
+                label: 'name'
+            }
+        };
+    },
+    watch: {
+        filterText(val) {
+            this.$refs.tree.filter(val);
+        }
+    },
+    methods: {
+        getOrgTreeList() {
+            this.$http.get('/assets/tree/community/find').then(({ status, data, msg }) => {
+                if (status === 0 && data) {
+                    this.organList = data;
+                    this.$nextTick().then(() => {
+                        const firstNode = document.querySelector('.el-tree-node');
+                        firstNode.click();
+                    });
+                }
+            });
+        },
+        filterNode(value, data) {
+            if (!value) return true;
+            return data.orgName.indexOf(value) !== -1;
+        },
+        treeClick(e) {
+            if (e.value == 0) return;
+            // for(var i=0;i<this.organList.length;i++){
+            //     this.buildingInformationNav(this.organList[i],e)
+            // }
+            // this.buildingInformationNav(this.organList,e)
+            let unitPa = {};
+            if (e.value == 0) return;
+
+            let onData='';
+            if(e.type == "building"){
+                onData={
+                    communityId:this.$refs.tree.getNode(e).parent.data.value,
+                    buildingId:e.value,
+                    unitId:'',
+                    roomId:'',
+                }
+                this.$emit('buildingInformation', onData);
+            }else if (e.type == 'unit') {
+                onData={
+                    communityId:this.$refs.tree.getNode(e).parent.parent.data.value,
+                    buildingId:this.$refs.tree.getNode(e).parent.data.value,
+                    unitId:e.value,
+                    roomId:'',
+                }
+                this.$emit('buildingInformation', onData);
+                // this.$emit('organId', unitPa);
+            }else if (e.type == "room") {
+                onData={
+                    communityId:this.$refs.tree.getNode(e).parent.parent.parent.data.value,
+                    buildingId:this.$refs.tree.getNode(e).parent.parent.data.value,
+                    unitId:this.$refs.tree.getNode(e).parent.data.value,
+                    roomId:e.value,
+                }
+                this.$emit('buildingInformation', onData);
+            } else {
+                this.$emit('buildingInformation', e);
+            }
+            // this.$emit('buildingInformation', e);
+        },
+        // buildingInformationNav(organList,e){
+        //     console.log(organList,'++++++++++++++++++++++++++++++++++++++1111')
+        //     var onData=''
+        //     for(var i=0;i<organList.length;i++){
+        //         if(organList[i].type==e.type&&organList[i].value==e.value){
+        //             console.log(organList[i],'++++++++++++++++++++++++++++++++++++++1')
+        //         }else{
+        //             // console.log(organList[i],'++++++++++++++++++++++++++++++++++++++2')
+        //             if(organList[i].children!=null){
+        //
+        //                 if(organList[i].type=="community"){}
+        //                 if(organList[i].type=="building"){}
+        //                 if(organList[i].type=="unit"){}
+        //
+        //                 onData={
+        //                     children:organList[i].children.length>0?this.buildingInformationNav(organList[i].children,e):[],
+        //                     id:organList[i].id,
+        //                     name:organList[i].name,
+        //                     order:organList[i].order,
+        //                     parentId:organList[i].parentId,
+        //                     type:organList[i].type,
+        //                     value:organList[i].value
+        //                 }
+        //                 return onData;
+        //             }
+        //         }
+        //     }
+        // },
+    },
+    created() {
+        this.getOrgTreeList();
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.organ-tree {
+    width: 260px;
+    background: #ffffff;
+    padding: 20px;
+    box-sizing: border-box;
+    float: left;
+    height: 100%;
+    overflow: auto;
+    &::before {
+        clear: both;
+    }
+    .tree-style-box {
+        margin-top: 20px;
+        max-height: calc(100vh - 200px);
+        overflow: scroll;
+    }
+}
+</style>

+ 3 - 1
operationSupport/src/components/common/index.js

@@ -18,6 +18,7 @@ import newsearchForm from './newsearch';
 import alramform from './alramform';
 import xkUpload from "./XKUpload";
 import select from "./select";
+import buildingTree from "./buildingTree";
 // 注册全局组件
 export default {
 	install() {
@@ -33,7 +34,8 @@ export default {
 			alramform,
 			organTree,
 			xkUpload,
-			select
+			select,
+			buildingTree
 	];
 		_.each(components, v => {
 			Vue.component(v.name, v);

+ 1 - 1
operationSupport/src/components/common/organTree.vue

@@ -93,4 +93,4 @@ export default {
         overflow: scroll;
     }
 }
-</style>
+</style>

+ 45 - 93
operationSupport/src/views/communityManagement/pageJump/AddOrEdit.vue

@@ -19,7 +19,7 @@
                         </el-form-item>
                         <el-form-item label="所在地区" prop="region">
                             <el-select v-model="ruleForm.regionId" placeholder="请选择地区">
-                                <el-option v-for="(item,index) in ruleForm.locationList" :label="item.label" :value="item.id"></el-option>
+                                <el-option v-for="(item,index) in locationList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
                         <el-form-item label="所属公司" required>
@@ -83,7 +83,7 @@
                         <el-form-item label="备注信息">
                             <el-input type="textarea" :rows="4" v-model="ruleForm.remarks" maxlength="300">
                             </el-input>
-                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remark.length}}/300</span>
+                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remarks.length}}/300</span>
                         </el-form-item>
                     </el-col>
                 </el-row>
@@ -104,29 +104,29 @@
 export default {
     data() {
         return {
+            locationList:[],//地区列表
             ruleForm: {
-                communityName: '',
-                locationList:[],
-                regionId:100000,//所在地区
-                companyOrgList:[],
-                companyOrgId:2,//所属公司
-                deptOrgId:1,//所属部门
-                coveredArea:'',//占地面积
-                buildingArea:'',//建筑面积
+                address: "",//详细地址
+                buildingArea: '',//建筑面积
+                cityId: 440300,//城市id
                 commercialArea:'',//商业面积
+                communityName: "",//社区名称
+                companyOrgId:'',//所属公司
+                contactPerson:'',//负责人
+                coveredArea: '',//占地面积
+                deptOrgId: '',//所属部门
                 dwellingArea:'',//住宅面积
-                greenArea:'',//绿化面积
+                greenArea: '',//绿化面积
+                id: '',
+                latitude: "",//纬度
+                longitude: "",//经度
                 parkingArea:'',//车位面积
-                contactPerson:'',//负责人
-                phone:'',//负责人手机号
-                telephone:'',//固定电话
-                address:'',//详细地址
-                region: '',
-                delivery: false,
-                type: [],
-                resource: '',
-                desc: '',
-                remark:'',//备注
+                phone: "",//负责人手机号
+                pictureUrl: "",//社区图片
+                provinceId: 440000,
+                regionId: 10000,//所在地区
+                remarks:'',//备注
+                telephone: ""
             },
             rules: {
                 communityName: [
@@ -170,76 +170,32 @@ export default {
             let submitData='';
             if(this.$route.query.newEditType=="edit"){
                 let communityInformation=JSON.parse(sessionStorage.getItem('communityInformation'))
-                submitData={
-                    "address": this.ruleForm.address,
-                    "buildingArea": this.ruleForm.buildingArea,
-                    "cityId": 440300,
-                    "commercialArea": this.ruleForm.commercialArea,
-                    "communityName": this.ruleForm.communityName,
-                    "companyOrgId": 0,
-                    "contactPerson": this.ruleForm.contactPerson,
-                    "coveredArea": this.ruleForm.coveredArea,
-                    "deptOrgId": 461,
-                    "dwellingArea": this.ruleForm.dwellingArea,
-                    "greenArea": this.ruleForm.greenArea,
-                    "id": communityInformation.id,
-                    'latitude':'1',
-                    'longitude':'2',
-                    "parkingArea": this.ruleForm.parkingArea,
-                    "phone": this.ruleForm.phone,
-                    "pictureUrl": "",
-                    "provinceId": 440000,
-                    "regionId": this.ruleForm.regionId,
-                    "remarks": "",
-                    "telephone": this.ruleForm.telephone
-                }
-                this.$http.post('/sc-community/assets/community/update', submitData).then((data) => {
+                this.ruleForm.id=communityInformation.id;
+                this.$http.post('/sc-community/assets/community/update', this.ruleForm).then((data) => {
                     // this.deviceOptions = data;
-                    let locationObj='';
-                    data.map(resData=>{
-                        locationObj={
-                            label:resData.name,
-                            id:resData.pid,
-                        }
-                        self.ruleForm.locationList.push(locationObj)
-
-                    })
+                    // let locationObj='';
+                    // data.map(resData=>{
+                    //     locationObj={
+                    //         label:resData.name,
+                    //         id:resData.pid,
+                    //     }
+                    //     self.locationList.push(locationObj)
+                    //
+                    // })
                 });
             }else{
-                submitData={
-                    "address": this.ruleForm.address,
-                    "buildingArea": this.ruleForm.buildingArea,
-                    "cityId": 440300,
-                    "commercialArea": 0,
-                    "communityName": this.ruleForm.communityName,
-                    "companyOrgId": 0,
-                    "contactPerson": this.ruleForm.contactPerson,
-                    "coveredArea": this.ruleForm.coveredArea,
-                    "deptOrgId": 461,
-                    "dwellingArea": this.ruleForm.dwellingArea,
-                    "greenArea": this.ruleForm.greenArea,
-                    "id": 0,
-                    'latitude':'1',
-                    'longitude':'2',
-                    "parkingArea": this.ruleForm.parkingArea,
-                    "phone": this.ruleForm.phone,
-                    "pictureUrl": "",
-                    "provinceId": 440000,
-                    "regionId": this.ruleForm.regionId,
-                    "remarks": "",
-                    "telephone": this.ruleForm.telephone
-                }
-                this.$http.post('/sc-community/assets/community/add', submitData).then((data) => {
+                this.ruleForm.id='';
+                this.$http.post('/sc-community/assets/community/add', this.ruleForm).then((data) => {
                     // this.deviceOptions = data;
-                    let locationObj='';
-                    data.map(resData=>{
-                        locationObj={
-                            label:resData.name,
-                            id:resData.pid,
-                        }
-                        self.ruleForm.locationList.push(locationObj)
-
-                    })
+                    // let locationObj='';
+                    // data.map(resData=>{
+                    //     locationObj={
+                    //         label:resData.name,
+                    //         id:resData.pid,
+                    //     }
+                    //     self.ruleForm.locationList.push(locationObj)
+                    //
+                    // })
                 });
             }
 
@@ -248,6 +204,7 @@ export default {
         //所属地区
         regionalQuery(){
             let self=this;
+            self.locationList=[];
             this.$http.postForm('/sc-user-center/area/selectAll', {id:123}).then(({ data }) => {
                 // this.deviceOptions = data;
                 let locationObj='';
@@ -256,7 +213,7 @@ export default {
                         label:resData.name,
                         id:resData.pid,
                     }
-                    self.ruleForm.locationList.push(locationObj)
+                    self.locationList.push(locationObj)
 
                 })
             });
@@ -318,11 +275,6 @@ export default {
        this.departmentQuery();
         if(self.$route.query.newEditType=="edit"){
             let communityInformation=JSON.parse(sessionStorage.getItem('communityInformation'))
-            // this.ruleForm={
-            //     "communityName":communityInformation.communityName,
-            //     "locationId":communityInformation.regionId,
-            //     "coveredArea":communityInformation.coveredArea,
-            // }
             this.ruleForm.address=communityInformation.address;
             this.ruleForm.communityName=communityInformation.communityName;
             this.ruleForm.regionId=communityInformation.regionId;

+ 82 - 83
operationSupport/src/views/housingManagement/index.vue

@@ -9,7 +9,7 @@
 <template>
     <div class="content">
         <div>
-            <organ-tree @organId="currentOrganId"></organ-tree>
+            <building-tree @buildingInformation="buildingInformation"></building-tree>
             <div class="content-right">
                 <div class="search">
                     <el-input
@@ -17,12 +17,12 @@
                             placeholder="房屋号"
                             class="search-input"
                             v-trim
-                            v-model.trim="mixins_query.questParams"
+                            v-model="mixins_query.roomNumber"
                     ></el-input>
                     <el-button
                             class="search-btn"
                             type="primary"
-                            @click="mixins_search()"
+                            @click="query_search()"
                             :disabled="mixins_onQuery"
                             :loading="mixins_onQuery"
                             icon="el-icon-search"
@@ -54,7 +54,7 @@
                                         <xk-upload
                                                 class="upload_class"
                                                 @callback="mixins_search"
-                                                :params="{ importType: 7 }"
+                                                :params="{ importType: 'HOUSE' }"
                                         >
                                             <span class="upload_text" slot="content">批量添加</span>
                                         </xk-upload>
@@ -74,36 +74,13 @@
                         @page-change="pageChange"
                         @selection-change="selectionChange"
                 >
-                    <template slot-scope="scope" slot="transactionsNumber">
-          <span
-                  v-if="scope.row.transactionsNumber"
-                  class="el-link"
-                  @click="toTransactionDetails(scope.row)"
-          >{{ scope.row.transactionsNumber }}</span>
-                        <span v-else>{{ scope.row.transactionsNumber }}</span>
+                    <template slot-scope="scope" slot="useStatus">
+                        <span v-if="scope.row.useStatus==0">空置</span>
+                        <span v-if="scope.row.useStatus==1">居住</span>
                     </template>
                     <template slot-scope="scope" slot="opt">
-                        <div class="opt">
-                            <el-tooltip
-                                    class="item"
-                                    effect="light"
-                                    placement="bottom"
-                                    content="编辑"
-                            >
-                                <span class="zoniot_font" @click="addOrEdit('edit', scope.index)">&#xe689;</span>
-                            </el-tooltip>
-                            <el-tooltip
-                                    class="item"
-                                    effect="light"
-                                    placement="bottom"
-                                    content="删除"
-                            >
-              <span
-                      class="zoniot_font red"
-                      @click="deleteRow(scope.row)"
-              >&#xe673;</span>
-                            </el-tooltip>
-                        </div>
+                        <i @click="addOrEdit('edit', scope)" class="iconfont" style="color:#2787F1;margin-right:30px" v-txt-tip data-txt="编辑">&#xe645;</i>
+                        <i @click="deleteRow(scope.row)"  class="iconfont" style="color:#FF7272" v-txt-tip data-txt="删除">&#xe63a;</i>
                     </template>
                 </zz-table>
             </div>
@@ -162,7 +139,8 @@
                     },
                     {
                         label: "使用状态",
-                        prop: "useStatus",
+                        // prop: "useStatus",
+                        slot:"useStatus",
                         width: 220,
                     },
                     {
@@ -172,6 +150,17 @@
                     },
                 ],
                 showaddDialog: false,
+                mixins_query:{//查询条件
+                    buildingName:'',
+                    buildingType:'',
+                    communityId: '',
+                    pageNum: 1,
+                    pageSize: 10,
+                    id: "",
+                    roomNumber:'',
+                    unitName: "",
+                    useStatus: 0
+                }
             };
         },
         components: {
@@ -179,53 +168,53 @@
             // viewDetail
         },
         methods: {
-            toTransactionDetails(row) {
-                const {id, type} = row;
-                this.$router.push({
-                    name: "main",
-                    query: {
-                        url: "/BillingManage/FinancialManage/ReconciliationManage/TransactionDetails",
-                        agentbranchId: id,
-                        payType: type,
-                        prevName: "支付管理",
-                    },
-                });
-            },
-
             addCommand(command) {
                 if (command === "add") {
-                    // this.showaddDialog=true
+                    let onEdit={
+                        todo:"add",
+                        id:'',
+                    }
+                    sessionStorage.setItem('houseAddEdit',JSON.stringify(onEdit))
                     this.$router.push('/housingManagement/pageJump/saveEdits')
                     return;
                 }
                 if (command === "template") {
-                    // this.__exportExcel("/installPlan/plan/downTemplate");
+                    this.__exportExcel("/excel/download/template",{importType:'HOUSE'});
                     return;
                 }
             },
 
-            addOrEdit(todo, index) {
-                // new Promise((resolve) => {
-                //     let row = {companyOrgId: this.mixins_query.companyId},
-                //         title = "编辑支付机构";
-                //     if ("add" == todo) {
-                //         title = "添加支付机构";
-                //     } else {
-                //         Object.assign(row, this.mixins_list[index] || {});
-                //         row = JSON.parse(JSON.stringify(row));
-                //     }
-                //     this.$router.push('/housingManagement/pageJump/saveEdits')
-                // }).then(() => {
-                //     this.mixins_search("refresh");
-                // });
+            addOrEdit(todo, scope) {
+                let self=this;
+                new Promise((resolve) => {
+                    let row,
+                        title = '编辑';
+                    if ('add' == todo) {
+                        title = '新增';
+                        this.addEditPopUps(title,row,todo)
+                    } else {
+                        let onEdit={
+                            todo,
+                            id:scope.row.id,
+                        }
+                        sessionStorage.setItem('houseAddEdit',JSON.stringify(onEdit))
+                        this.addEditPopUps(title,row,todo)
+                    }
+                }).then(() => {
+                    this.mixins_search();
+                });
             },
+            addEditPopUps(title,row,todo){
+                this.$router.push('/housingManagement/pageJump/saveEdits')
+            },
+
             deleteRow(row) {
-                const {name} = row;
-                let title = `您确定要删除支付机构“${name}”`;
+                const {communityName,buildingName,unitName,roomNumber} = row;
+                let title = `您确定要删除“${communityName}${buildingName}${unitName}${roomNumber}号房间`;
                 this.$msgBox(title)
                     .then(() => {
                         this.$http
-                            .post("/sc-community-web/assets/house/delete", {id: row.id})
+                            .post("/sc-community-web/assets/house/delete", [row.id])
                             .then(({status, msg}) => {
                                 this.$delete(row, "onDelete");
                                 if (0 === status) {
@@ -242,24 +231,29 @@
                     .catch(() => {
                     });
             },
-            currentOrganId(data) {
-                this.currentId = data || "";
+            buildingInformation(data) {
+                this.mixins_query.id='';
+                this.mixins_query.roomNumber='';
+                this.mixins_query.communityId=data.communityId;
+                this.mixins_query.buildingId=data.buildingId;
+                this.mixins_query.unitName=data.unitId;
+                this.mixins_query.id=data.roomId;
+                this.communityLists()
+                // this.currentId = data || "";
+            },
+            query_search(){
+                this.mixins_query.communityId='';
+                this.mixins_query.buildingId='';
+                this.mixins_query.unitName='';
+                this.mixins_query.id='';
+                this.mixins_search()
             },
             mixins_search(){
                 this.communityLists()
             },
             //获取列表数据
             communityLists(){
-                let submitData={
-                    "buildingName":'',
-                    "communityId": '',
-                    "pageNum": 1,
-                    "pageSize": 10,
-                    "roomNumber": "",
-                    "unitName": "",
-                    "useStatus": 0
-                }
-                this.$http.post('/sc-community-web/assets/house/page', submitData).then((res) => {
+                this.$http.post('/sc-community-web/assets/house/page', this.mixins_query).then((res) => {
                     this.mixins_list=res.data.list;
                     this.mixins_pageset = {
                         total:parseInt(res.data.total),
@@ -270,21 +264,26 @@
                 }).catch(function () {
 
                 });
-            }
+            },
+            //导出
+            exportExcel() {
+                this.mixins_query.buildingType=1
+                this.__exportExcel("/assets/house/export/excel", this.mixins_query);
+            },
         },
         watch: {
             currentId(newValue, oldValue) {
                 this.mixins_query.companyId = newValue;
-                this.mixins_search();
+                // this.mixins_search();
             },
         },
         created() {
             this.mix_path = ""; // 权限
             this.mixins_dataUrl = "/pay/getAllPayPayAgentbranch"; // 分页查询接口
-            this.mixins_query = {
-                questParams: "",
-                companyId: "",
-            };
+            // this.mixins_query = {
+            //     questParams: "",
+            //     companyId: "",
+            // };
             this.mixins_search();
         },
     };

+ 258 - 55
operationSupport/src/views/housingManagement/pageJump/saveEdits.vue

@@ -8,74 +8,87 @@
 -->
 <template>
     <div class="alert-body__main_content">
-        <div class="blockName">房屋编辑(<i>*</i>为必填)</div>
+        <div class="blockName" v-if="addEditState=='add'">房屋添加(<i>*</i>为必填)</div>
+        <div class="blockName" v-else>房屋编辑(<i>*</i>为必填)</div>
         <div>
             <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
                 <el-row>
                     <el-col :span="12">
-                        <el-form-item label="社区名称" prop="communityName">
-                            <el-input v-model="ruleForm.communityName"></el-input>
-                        </el-form-item>
-                        <el-form-item label="单元" prop="unit">
-                            <el-select v-model="ruleForm.unit" placeholder="请选择单元">
-                                <el-option label="1单元" value="shanghai"></el-option>
-                                <el-option label="2单元" value="beijing"></el-option>
+                        <el-form-item label="社区名称" prop="communityId">
+<!--                            <el-input v-model="ruleForm.communityName"></el-input>-->
+                            <el-select v-model="ruleForm.communityId" placeholder="请选择社区名称" @change="communityChoice">
+                                <el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="房屋号" prop="houseNumber">
-                            <el-select v-model="ruleForm.houseNumber" placeholder="请选择房屋号">
-                                <el-option label="101" value="shanghai"></el-option>
-                                <el-option label="102" value="beijing"></el-option>
+                        <el-form-item label="单元">
+                            <el-select v-model="ruleForm.unitName" placeholder="请选择单元" @change="unitChoice">
+                                <el-option v-for="(item,index) in unitList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
+                        <el-form-item label="房屋号" prop="roomNumber">
+                            <el-input v-model="ruleForm.roomNumber"></el-input>
+                        </el-form-item>
                         <el-form-item label="使用面积">
                             <el-input v-model="ruleForm.useArea"></el-input>
                         </el-form-item>
                         <el-form-item label="房屋朝向">
-                            <div @click="addressQueryClick">
-                                <el-input v-model="ruleForm.orientation" suffix-icon="el-icon-location-outline"></el-input>
-                            </div>
+                            <el-select v-model="ruleForm.orientationOfRoom" placeholder="请选择房屋朝向">
+                                <el-option label="东" :value="1"></el-option>
+                                <el-option label="南" :value="2"></el-option>
+                                <el-option label="西" :value="3"></el-option>
+                                <el-option label="北" :value="4"></el-option>
+                                <el-option label="东南" :value="5"></el-option>
+                                <el-option label="西南" :value="6"></el-option>
+                                <el-option label="西北" :value="7"></el-option>
+                                <el-option label="东北" :value="8"></el-option>
+                            </el-select>
                         </el-form-item>
                         <el-form-item label="房屋户型">
-                            <el-input v-model="ruleForm.houseType"></el-input>
+                            <el-input v-model="housingType.roomNumber" style="width: 80px;margin-right: 10px;"></el-input>室
+                            <el-input v-model="housingType.officeNumber" style="width: 80px;margin:0 10px;"></el-input>厅
+                            <el-input v-model="housingType.guardNumber" style="width: 80px;margin:0 10px;"></el-input>卫
                         </el-form-item>
                     </el-col>
                     <el-col :span="12">
-                        <el-form-item label="楼栋" prop="buildingName">
-                            <el-select v-model="ruleForm.buildingName" placeholder="请选择楼栋">
-                                <el-option label="1栋" value="shanghai"></el-option>
-                                <el-option label="2栋" value="beijing"></el-option>
+                        <el-form-item label="楼栋" prop="buildingId">
+                            <el-select v-model="ruleForm.buildingId" placeholder="请选择楼栋" @change="buildingChoice">
+                                <el-option v-for="(item,index) in buildingList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="楼层" prop="whatFloor">
-                            <el-select v-model="ruleForm.whatFloor" placeholder="请选择楼层">
-                                <el-option label="1F" value="shanghai"></el-option>
-                                <el-option label="2F" value="beijing"></el-option>
+                        <el-form-item label="楼层" prop="floorNumber">
+                            <el-select v-model="ruleForm.floorNumber" placeholder="请选择楼层">
+                                <el-option v-for="(item,index) in floorNumberList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="房屋类型" prop="propertyType">
-                            <el-select v-model="ruleForm.propertyType" placeholder="请选择房屋类型">
-                                <el-option label="民房" value="shanghai"></el-option>
-                                <el-option label="公寓" value="beijing"></el-option>
+                        <el-form-item label="房屋类型" prop="buildingType">
+                            <el-select v-model="ruleForm.buildingType" placeholder="请选择房屋类型">
+                                <el-option label="民房" :value="1"></el-option>
+                                <el-option label="公寓" :value="2"></el-option>
                             </el-select>
                         </el-form-item>
                         <el-form-item label="建筑面积">
-                            <el-input v-model="ruleForm.builtUpArea"></el-input>
+                            <el-input v-model="ruleForm.buildingArea"></el-input>
                         </el-form-item>
                         <el-form-item label="公摊面积">
-                            <el-input v-model="ruleForm.sharedArea"></el-input>
+                            <el-input v-model="ruleForm.publicArea"></el-input>
                         </el-form-item>
                         <el-form-item label="装修性质">
-                            <el-input v-model="ruleForm.decorationNature"></el-input>
+                            <el-select v-model="ruleForm.decorateProperties" placeholder="请选择装修性质">
+                                <el-option label="毛胚" :value="1"></el-option>
+                                <el-option label="简单装修" :value="2"></el-option>
+                                <el-option label="中等装修" :value="3"></el-option>
+                                <el-option label="精装修" :value="4"></el-option>
+                                <el-option label="豪华装修" :value="5"></el-option>
+                            </el-select>
                         </el-form-item>
                     </el-col>
                 </el-row>
                 <el-row>
                     <el-col :span="24">
                         <el-form-item label="备注信息">
-                            <el-input type="textarea" :rows="4" v-model="ruleForm.remark" maxlength="300">
+                            <el-input type="textarea" :rows="4" v-model="ruleForm.remarks" maxlength="300">
                             </el-input>
-                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remark.length}}/300</span>
+                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remarks.length}}/300</span>
                         </el-form-item>
                     </el-col>
                 </el-row>
@@ -91,31 +104,43 @@
     export default {
         data() {
             return {
+                communityList:[],//社区名称下拉列表
+                buildingList:[],//楼栋下拉选择列表
+                unitList:[],//单元下拉选择列表
+                // roomList:[],//房间号选择下拉列表
+                addEditState:'',
+                housingType:{//房屋户型,roomNumber为室,officeNumber为厅,guardNumber为卫
+                    roomNumber:'',
+                    officeNumber:'',
+                    guardNumber:''
+                },
                 ruleForm: {
-                    communityName: '',//社区名称
-                    unit:'',//单元
-                    houseNumber:'',//房屋号
+                    assetNumber: "",
+                    buildingArea:'',//建筑面积
+                    buildingId:'',//楼栋id
+                    buildingType:'',//房屋类型
+                    communityId:'',//社区id
+                    decorateProperties:'',//装修性质
+                    floorNumber:'',//单元楼层
+                    housingType:'',//房屋户型
+                    id: '',
+                    orientationOfRoom:'',//房屋朝向
+                    publicArea:'',//公摊面积
+                    remarks:'',//备注
+                    residentId:'',//业主id
+                    roomNumber:'',//房屋号
+                    unitName:'',//单元
                     useArea:'',//使用面积
-                    orientation:'',//楼栋朝向
-                    houseType:'',//房屋户型
-                    buildingName:'',//楼栋,
-                    whatFloor:'',//楼层
-                    propertyType:'',//房屋类型
-                    builtUpArea:'',//建筑面积
-                    sharedArea:'',//公摊面积
-                    decorationNature:'',//装修性质
-                    remark:'',//备注
                 },
                 rules: {
                     communityName: [
                         { required: true, message: '请输入活动名称', trigger: 'change' },
                         // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
                     ],
-                    unit:[{ required: true, message: '请输入单元', trigger: 'change' }],
-                    houseNumber:[{ required: true, message: '请输入房屋号', trigger: 'change' }],
-                    buildingName:[{ required: true, message: '请输入楼栋', trigger: 'change' }],
-                    whatFloor:[{ required: true, message: '请输入楼层', trigger: 'change' }],
-                    propertyType:[{ required: true, message: '请输入房屋类型', trigger: 'change' }],
+                    roomNumber:[{ required: true, message: '请输入房屋号', trigger: 'change' }],
+                    buildingId:[{ required: true, message: '请输入楼栋', trigger: 'change' }],
+                    floorNumber:[{ required: true, message: '请输入楼层', trigger: 'change' }],
+                    buildingType:[{ required: true, message: '请输入房屋类型', trigger: 'change' }],
                 },
             }
         },
@@ -125,9 +150,53 @@
         computed: {},
         methods: {
             submitForm(formName) {
+                let self=this;
+                let houseAddEditData=JSON.parse(sessionStorage.getItem('houseAddEdit'));
                 this.$refs[formName].validate((valid) => {
                     if (valid) {
-                        alert('submit!');
+                        if(houseAddEditData.todo=="edit"){
+                            this.ruleForm.id=houseAddEditData.id;
+                            this.ruleForm.residentId='';
+                            this.ruleForm.housingType=this.housingType.roomNumber+":"+this.housingType.officeNumber+":"+this.housingType.guardNumber;
+                            this.$http.post('/sc-community-web/assets/house/update', this.ruleForm).then((res) => {
+                                if(res.status==0){
+                                    this.$message({
+                                        message: '添加成功',
+                                        type: 'success'
+                                    });
+
+                                    setTimeout(function(){
+                                        self.$router.go(-1);//返回上一层
+                                    },5000)
+                                }else{
+
+                                }
+                            });
+                        }else{
+                            this.ruleForm.id='';
+                            this.ruleForm.residentId='';
+                            this.ruleForm.housingType=this.housingType.roomNumber+":"+this.housingType.officeNumber+":"+this.housingType.guardNumber;
+                            this.$http.post('/sc-community-web/assets/house/add', this.ruleForm).then((res) => {
+                                if(res.status==0){
+                                    if(res.status==0){
+                                        this.$message({
+                                            message: '编辑成功',
+                                            type: 'success'
+                                        });
+
+                                        setTimeout(function(){
+                                            self.$router.go(-1);//返回上一层
+                                        },5000)
+                                    }else{
+
+                                    }
+                                }else{
+
+                                }
+                            });
+                        }
+
+
                     } else {
                         console.log('error submit!!');
                         return false;
@@ -160,14 +229,148 @@
                     })
                     .catch(_ => {});
             },
-            addressQueryClick(){
-                this.mapPopUpStatus=true;
-            }
 
+            //获取社区名称下拉列表
+            communityNameList(){
+                this.communityList=[];
+                let onOption='';
+                this.$http.get('/assets/community/list', {}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.communityName,
+                            id:res.id
+                        }
+                        this.communityList.push(onOption)
+                    })
+                });
+            },
+
+            communityChoice(e){
+                this.ruleForm.communityId=e;
+                this.buildingNameList();
+            },
+            //查询楼栋下拉列表
+            buildingNameList(){
+                this.buildingList=[];
+                let onOption='';
+                this.$http.post('/sc-community-web/assets/building/list/building', {"communityId": this.ruleForm.communityId}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.buildingName,
+                            id:res.id
+                        }
+                        this.buildingList.push(onOption)
+                    })
+                });
+            },
+            buildingChoice(e){
+                this.ruleForm.buildingId=e;
+                this.unitNameList();
+            },
+            unitNameList(){
+                this.unitList=[];
+                let onOption='';
+                this.$http.get('/sc-community-web/assets/building/house/find', {"id": this.ruleForm.buildingId}).then((res) => {
+                    if(res.status==0){
+                        if(res.data.buildingUnitList.length!=0){
+                            res.data.buildingUnitList.map(resData=>{
+                                onOption={
+                                    label:resData.unitName,
+                                    id:resData.unitName,
+                                    floorNumberList:resData.unitFloorList,
+                                }
+                                this.unitList.push(onOption)
+                            })
+                        }else{
+                            this.unitList=[];
+                        }
+                    }
+                });
+            },
+
+            unitChoice(e){
+                this.floorNumberList=[];
+                let onOption='';
+                this.unitList.map(res=>{
+                   if(res.label==e){
+                       if(res.floorNumberList.length!=0){
+                           res.floorNumberList.map(resData=>{
+                               console.log(resData)
+                               onOption={
+                                   label:resData.floorNumber,
+                                   id:resData.floorNumber,
+                                   // roomList:resData.roomList,
+                               }
+                               this.floorNumberList.push(onOption)
+                           })
+                       }else{
+                           this.floorNumberList=[]
+                       }
+
+                   }
+                })
+            },
+
+            //加载房间详情展示
+            houseAddEdit(){
+                let self=this;
+                let houseAddEditData=JSON.parse(sessionStorage.getItem('houseAddEdit'));
+                this.addEditState=houseAddEditData.todo;
+                if(houseAddEditData.todo=="edit"){
+                    this.$http.get('/sc-community-web/assets/house/find/'+houseAddEditData.id, {}).then((res) => {
+                        if(res.status==0){
+                            this.ruleForm.communityId=res.data.communityId;
+                            this.buildingNameList()
+                            this.ruleForm.buildingId=res.data.buildingId;
+                            this.unitNameList();
+                            this.ruleForm.unitName=res.data.unitName;
+                            setTimeout(function(){
+                                self.unitChoice(res.data.unitName);
+                                self.ruleForm.floorNumber=res.data.floorNumber;
+                                self.floorNumberChoice(res.data.floorNumber);
+                            },500)
+                            self.ruleForm.roomNumber=res.data.roomNumber;
+                            this.ruleForm.buildingType=res.data.buildingType;
+                            this.ruleForm.useArea=res.data.useArea;
+                            this.ruleForm.housingType=res.data.housingType;
+                            var housingTypes=this.ruleForm.housingType.split(':');
+                            this.housingType.roomNumber=housingTypes[0];
+                            this.housingType.officeNumber=housingTypes[1];
+                            this.housingType.guardNumber=housingTypes[2];
+                            this.ruleForm.orientationOfRoom=res.data.orientationOfRoom;
+                            this.ruleForm.buildingArea=res.data.buildingArea;
+                            this.ruleForm.publicArea=res.data.publicArea;
+                            this.ruleForm.decorateProperties=res.data.decorateProperties;
+                            this.ruleForm.remarks=res.data.remarks;
+                        }else{
+                            this.ruleForm.communityId='';
+                            this.ruleForm.buildingId='';
+                            this.ruleForm.unitName='';
+                            this.ruleForm.floorNumber='';
+                            this.ruleForm.roomNumber='';
+                            this.ruleForm.buildingType='';
+                            this.ruleForm.useArea='';
+                            this.ruleForm.housingType='';
+                            this.housingType.roomNumber='';
+                            this.housingType.officeNumber='';
+                            this.housingType.guardNumber='';
+                            this.ruleForm.orientationOfRoom='';
+                            this.ruleForm.buildingArea='';
+                            this.ruleForm.publicArea='';
+                            this.ruleForm.decorateProperties='';
+                            this.ruleForm.remarks='';
+                        }
+                    });
+                }else{
+
+                }
+            }
 
         },
         created() {
-
+            //获取社区名称下拉列表
+            this.communityNameList();
+            this.houseAddEdit();
         }
     };
 </script>

+ 240 - 201
operationSupport/src/views/shopManagement/index.vue

@@ -9,38 +9,61 @@
 <template>
   <div class="content">
     <div>
-      <organ-tree @organId="currentOrganId"></organ-tree>
+      <building-tree @buildingInformation="buildingInformation"></building-tree>
       <div class="content-right">
         <div class="search">
           <el-input
                   clearable
-                  placeholder="机构代码/机构名称"
+                  placeholder="房屋号"
                   class="search-input"
                   v-trim
-                  v-model.trim="mixins_query.questParams"
+                  v-model="mixins_query.roomNumber"
           ></el-input>
           <el-button
                   class="search-btn"
                   type="primary"
-                  @click="mixins_search()"
+                  @click="query_search()"
                   :disabled="mixins_onQuery"
                   :loading="mixins_onQuery"
                   icon="el-icon-search"
-          >搜索</el-button
-          >
-          <!-- <el-button class="el-fl-right" type="primary" @click="addOrEdit('add')"
-            >添加</el-button
-          > -->
-          <el-tooltip
-                  placement="bottom"
-                  class="item"
-                  effect="light"
-                  content="添加"
-          >
-          <span class="zoniot_font item el-fl-right" @click="addOrEdit('add')"
-          >&#xe664;</span
-          >
-          </el-tooltip>
+          >搜索
+          </el-button>
+          <template>
+            <el-tooltip
+                    class="item"
+                    effect="light"
+                    placement="bottom"
+                    content="导出"
+            >
+              <span class="zoniot_font item el-fl-right" @click="exportExcel()">&#xe66d;</span>
+            </el-tooltip>
+            <el-dropdown
+                    type="primary"
+                    @command="addCommand"
+                    class="el-fl-right"
+            >
+              <span class="zoniot_font item el-fl-right">&#xe664;</span>
+              <el-dropdown-menu
+                      slot="dropdown"
+                      hide-on-click="false"
+                      class="device-search-dropdown"
+              >
+                <el-dropdown-item command="add">单个添加</el-dropdown-item>
+                <el-dropdown-item command="batchAdd">
+                  <div class="upload_div">
+                    <xk-upload
+                            class="upload_class"
+                            @callback="mixins_search"
+                            :params="{ importType: 'HOUSE' }"
+                    >
+                      <span class="upload_text" slot="content">批量添加</span>
+                    </xk-upload>
+                  </div>
+                </el-dropdown-item>
+                <el-dropdown-item command="template">下载模板</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </template>
         </div>
         <zz-table
                 :settings="{ showIndex: true }"
@@ -51,46 +74,13 @@
                 @page-change="pageChange"
                 @selection-change="selectionChange"
         >
-          <template slot-scope="scope" slot="transactionsNumber">
-          <span
-                  v-if="scope.row.transactionsNumber"
-                  class="el-link"
-                  @click="toTransactionDetails(scope.row)"
-          >{{ scope.row.transactionsNumber }}</span
-          >
-            <span v-else>{{ scope.row.transactionsNumber }}</span>
+          <template slot-scope="scope" slot="useStatus">
+            <span v-if="scope.row.useStatus==0">空置</span>
+            <span v-if="scope.row.useStatus==1">居住</span>
           </template>
           <template slot-scope="scope" slot="opt">
-            <!-- <el-button type="primary" @click="addOrEdit('edit', scope.index)"
-              >编辑</el-button
-            >
-            <el-button @click="deleteRow(scope.row)" :loading="scope.row.onDelete"
-              >删除</el-button
-            > -->
-            <div class="opt">
-              <el-tooltip
-                      class="item"
-                      effect="light"
-                      placement="bottom"
-                      content="编辑"
-              >
-              <span class="zoniot_font" @click="addOrEdit('edit', scope.index)"
-              >&#xe689;</span
-              >
-              </el-tooltip>
-              <el-tooltip
-                      class="item"
-                      effect="light"
-                      placement="bottom"
-                      content="删除"
-              >
-              <span
-                      class="zoniot_font red"
-                      @click="deleteRow(scope.row)"
-              >&#xe673;</span
-              >
-              </el-tooltip>
-            </div>
+            <i @click="addOrEdit('edit', scope)" class="iconfont" style="color:#2787F1;margin-right:30px" v-txt-tip data-txt="编辑">&#xe645;</i>
+            <i @click="deleteRow(scope.row)"  class="iconfont" style="color:#FF7272" v-txt-tip data-txt="删除">&#xe63a;</i>
           </template>
         </zz-table>
       </div>
@@ -101,159 +91,208 @@
 </template>
 
 <script>
-import list from "@/js/list.js";
-import saveEdits from './pageJump/saveEdits.vue'
-export default {
-  mixins: [list],
-  data() {
-    return {
-      statusOptions: [],
-      currentId: "",
-      cols: [
-        {
-          label: "所属社区",
-          prop: "code",
-          width: 120,
-        },
-        {
-          label: "楼栋名称",
-          prop: "name",
-        },
-        {
-          label: "单元",
-          prop: "agentbranchType",
-        },
-        {
-          label: "房屋号",
-          prop: "mchid",
-          width: 150,
-        },
-        {
-          label: "建筑面积",
-          prop: "paykey",
-          format(val) {
-            const str = val.toString();
-            const len = str.length;
-            let result = "";
-            if (len <= 10) {
-              let lastStr = str.substr(5);
-              result = lastStr.padStart(len, "*");
-            } else {
-              let lastStr = str.substr(Math.floor(len / 2));
-              result = lastStr.padStart(Math.ceil(len / 2) + 5, "*");
-            }
-            return result;
+  import list from "@/js/list.js";
+  import saveEdits from './pageJump/saveEdits.vue'
+
+  export default {
+    mixins: [list],
+    data() {
+      return {
+        statusOptions: [],
+        currentId: "",
+        cols: [
+          {
+            label: "所属社区",
+            prop: "communityName",
+            width: 120,
+          },
+          {
+            label: "楼栋名称",
+            prop: "buildingName",
+          },
+          {
+            label: "单元",
+            prop: "unitName",
           },
-          width: 220,
-        },
-        {
-          label: "使用状态",
-          prop: "appid",
-          width: 220,
-        },
-        {
-          label: "操作",
-          slot: "opt",
-          width: 150,
-        },
-      ],
-      showaddDialog:false,
-    };
-  },
-  components: {
-    saveEdits
-    // viewDetail
-  },
-  methods: {
-    toTransactionDetails(row) {
-      const { id, type } = row;
-      this.$router.push({
-        name: "main",
-        query: {
-          url: "/BillingManage/FinancialManage/ReconciliationManage/TransactionDetails",
-          agentbranchId: id,
-          payType: type,
-          prevName: "支付管理",
-        },
-      });
+          {
+            label: "房屋号",
+            prop: "roomNumber",
+            width: 150,
+          },
+          {
+            label: "建筑面积",
+            prop: "buildingArea",
+            // format(val) {
+            //     const str = val.toString();
+            //     const len = str.length;
+            //     let result = "";
+            //     if (len <= 10) {
+            //         let lastStr = str.substr(5);
+            //         result = lastStr.padStart(len, "*");
+            //     } else {
+            //         let lastStr = str.substr(Math.floor(len / 2));
+            //         result = lastStr.padStart(Math.ceil(len / 2) + 5, "*");
+            //     }
+            //     return result;
+            // },
+            width: 220,
+          },
+          {
+            label: "使用状态",
+            // prop: "useStatus",
+            slot:"useStatus",
+            width: 220,
+          },
+          {
+            label: "操作",
+            slot: "opt",
+            width: 150,
+          },
+        ],
+        showaddDialog: false,
+        mixins_query:{//查询条件
+          buildingName:'',
+          buildingType:'',
+          communityId: '',
+          pageNum: 1,
+          pageSize: 10,
+          id: "",
+          roomNumber:'',
+          unitName: "",
+          useStatus: 0
+        }
+      };
+    },
+    components: {
+      saveEdits
+      // viewDetail
     },
-    addOrEdit(todo, index) {
-      new Promise((resolve) => {
-        let row = { companyOrgId: this.mixins_query.companyId },
-          title = "编辑支付机构";
-        if ("add" == todo) {
-          title = "添加支付机构";
-        } else {
-          Object.assign(row, this.mixins_list[index] || {});
-          row = JSON.parse(JSON.stringify(row));
+    methods: {
+      addCommand(command) {
+        if (command === "add") {
+          let onEdit={
+            todo:"add",
+            id:'',
+          }
+          sessionStorage.setItem('houseAddEdit',JSON.stringify(onEdit))
+          this.$router.push('/housingManagement/pageJump/saveEdits')
+          return;
+        }
+        if (command === "template") {
+          this.__exportExcel("/excel/download/template",{importType:'HOUSE'});
+          return;
         }
-        // this.$store.dispatch("openModal", {
-        //   url: "/BillingManage/ChargeManage/PaymentManage/AddOrEdit",
-        //   title: title,
-        //   width: "520px",
-        //   height: "650px",
-        //   // showCancelButton: true,
-        //   // showResetButton: true,
-        //   showFooter: false,
-        //   props: {
-        //     data: row,
-        //     todo: todo,
-        //     callback: resolve,
-        //   },
-        // });
+      },
+
+      addOrEdit(todo, scope) {
+        let self=this;
+        new Promise((resolve) => {
+          let row,
+                  title = '编辑';
+          if ('add' == todo) {
+            title = '新增';
+            this.addEditPopUps(title,row,todo)
+          } else {
+            let onEdit={
+              todo,
+              id:scope.row.id,
+            }
+            sessionStorage.setItem('houseAddEdit',JSON.stringify(onEdit))
+            this.addEditPopUps(title,row,todo)
+          }
+        }).then(() => {
+          this.mixins_search();
+        });
+      },
+      addEditPopUps(title,row,todo){
         this.$router.push('/housingManagement/pageJump/saveEdits')
-      }).then(() => {
-        this.mixins_search("refresh");
-      });
-    },
-    deleteRow(row) {
-      const { name } = row;
-      let title = `您确定要删除支付机构“${name}”`;
-      this.$msgBox(title)
-        .then(() => {
-          this.$http
-            .putForm("/pay/deletePayPayAgentbranch", { id: row.id })
-            .then(({ status, msg }) => {
-              this.$delete(row, "onDelete");
-              if (0 === status) {
-                this.$message.success(msg);
-                this.mixins_search("del");
-              } else {
-                this.$message.error(msg);
-              }
-            })
-            .catch(() => {
-              this.$delete(row, "onDelete");
-            });
-        })
-        .catch(() => {});
+      },
+
+      deleteRow(row) {
+        const {communityName,buildingName,unitName,roomNumber} = row;
+        let title = `您确定要删除“${communityName}${buildingName}${unitName}${roomNumber}”号房间`;
+        this.$msgBox(title)
+                .then(() => {
+                  this.$http
+                          .post("/sc-community-web/assets/house/delete", [row.id])
+                          .then(({status, msg}) => {
+                            this.$delete(row, "onDelete");
+                            if (0 === status) {
+                              this.$message.success(msg);
+                              this.mixins_search();
+                            } else {
+                              this.$message.error(msg);
+                            }
+                          })
+                          .catch(() => {
+                            this.$delete(row, "onDelete");
+                          });
+                })
+                .catch(() => {
+                });
+      },
+      buildingInformation(data) {
+        this.mixins_query.id='';
+        this.mixins_query.roomNumber='';
+        this.mixins_query.communityId=data.communityId;
+        this.mixins_query.buildingId=data.buildingId;
+        this.mixins_query.unitName=data.unitId;
+        this.mixins_query.id=data.roomId;
+        this.communityLists()
+        // this.currentId = data || "";
+      },
+      query_search(){
+        this.mixins_query.communityId='';
+        this.mixins_query.buildingId='';
+        this.mixins_query.unitName='';
+        this.mixins_query.id='';
+        this.mixins_search()
+      },
+      mixins_search(){
+        this.communityLists()
+      },
+      //获取列表数据
+      communityLists(){
+        this.$http.post('/sc-community-web/assets/house/page', this.mixins_query).then((res) => {
+          this.mixins_list=res.data.list;
+          this.mixins_pageset = {
+            total:parseInt(res.data.total),
+            // pageNum: this.mixins_pageset.pageNum,
+            // pageSize: this.mixins_pageset.pageSize
+          };
+          this.mixins_onQuery=false;
+        }).catch(function () {
+
+        });
+      },
+      //导出
+      exportExcel() {
+        this.mixins_query.buildingType=1
+        this.__exportExcel("/assets/house/export/excel", this.mixins_query);
+      },
     },
-    currentOrganId(data) {
-      this.currentId = data || "";
+    watch: {
+      currentId(newValue, oldValue) {
+        this.mixins_query.companyId = newValue;
+        // this.mixins_search();
+      },
     },
-  },
-  watch: {
-    currentId(newValue, oldValue) {
-      this.mixins_query.companyId = newValue;
+    created() {
+      this.mix_path = ""; // 权限
+      this.mixins_dataUrl = "/pay/getAllPayPayAgentbranch"; // 分页查询接口
+      // this.mixins_query = {
+      //     questParams: "",
+      //     companyId: "",
+      // };
       this.mixins_search();
     },
-  },
-  created() {
-    this.mix_path = ""; // 权限
-    this.mixins_dataUrl = "/pay/getAllPayPayAgentbranch"; // 分页查询接口
-    this.mixins_query = {
-      questParams: "",
-      companyId: "",
-    };
-    this.mixins_search("search");
-  },
-};
+  };
 </script>
 <style lang="scss" scoped>
-  .content{
-    .content-right {
-      width: calc(100% - 280px);
-      float: right;
-    }
+  .content {
+  .content-right {
+    width: calc(100% - 280px);
+    float: right;
+  }
   }
 </style>

+ 264 - 61
operationSupport/src/views/shopManagement/pageJump/saveEdits.vue

@@ -8,74 +8,87 @@
 -->
 <template>
     <div class="alert-body__main_content">
-        <div class="blockName">房屋编辑(<i>*</i>为必填)</div>
+        <div class="blockName" v-if="addEditState=='add'">房屋添加(<i>*</i>为必填)</div>
+        <div class="blockName" v-else>房屋编辑(<i>*</i>为必填)</div>
         <div>
             <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
                 <el-row>
                     <el-col :span="12">
-                        <el-form-item label="社区名称" prop="communityName">
-                            <el-input v-model="ruleForm.communityName"></el-input>
-                        </el-form-item>
-                        <el-form-item label="单元" prop="unit">
-                            <el-select v-model="ruleForm.unit" placeholder="请选择单元">
-                                <el-option label="1单元" value="shanghai"></el-option>
-                                <el-option label="2单元" value="beijing"></el-option>
+                        <el-form-item label="社区名称" prop="communityId">
+                            <!--                            <el-input v-model="ruleForm.communityName"></el-input>-->
+                            <el-select v-model="ruleForm.communityId" placeholder="请选择社区名称" @change="communityChoice">
+                                <el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="房屋号" prop="houseNumber">
-                            <el-select v-model="ruleForm.houseNumber" placeholder="请选择房屋号">
-                                <el-option label="101" value="shanghai"></el-option>
-                                <el-option label="102" value="beijing"></el-option>
+                        <el-form-item label="单元">
+                            <el-select v-model="ruleForm.unitName" placeholder="请选择单元" @change="unitChoice">
+                                <el-option v-for="(item,index) in unitList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
+                        <el-form-item label="房屋号" prop="roomNumber">
+                            <el-input v-model="ruleForm.roomNumber"></el-input>
+                        </el-form-item>
                         <el-form-item label="使用面积">
                             <el-input v-model="ruleForm.useArea"></el-input>
                         </el-form-item>
                         <el-form-item label="房屋朝向">
-                            <div @click="addressQueryClick">
-                                <el-input v-model="ruleForm.orientation" suffix-icon="el-icon-location-outline"></el-input>
-                            </div>
+                            <el-select v-model="ruleForm.orientationOfRoom" placeholder="请选择房屋朝向">
+                                <el-option label="东" :value="1"></el-option>
+                                <el-option label="南" :value="2"></el-option>
+                                <el-option label="西" :value="3"></el-option>
+                                <el-option label="北" :value="4"></el-option>
+                                <el-option label="东南" :value="5"></el-option>
+                                <el-option label="西南" :value="6"></el-option>
+                                <el-option label="西北" :value="7"></el-option>
+                                <el-option label="东北" :value="8"></el-option>
+                            </el-select>
                         </el-form-item>
                         <el-form-item label="房屋户型">
-                            <el-input v-model="ruleForm.houseType"></el-input>
+                            <el-input v-model="housingType.roomNumber" style="width: 80px;margin-right: 10px;"></el-input>室
+                            <el-input v-model="housingType.officeNumber" style="width: 80px;margin:0 10px;"></el-input>厅
+                            <el-input v-model="housingType.guardNumber" style="width: 80px;margin:0 10px;"></el-input>卫
                         </el-form-item>
                     </el-col>
                     <el-col :span="12">
-                        <el-form-item label="楼栋" prop="buildingName">
-                            <el-select v-model="ruleForm.buildingName" placeholder="请选择楼栋">
-                                <el-option label="1栋" value="shanghai"></el-option>
-                                <el-option label="2栋" value="beijing"></el-option>
+                        <el-form-item label="楼栋" prop="buildingId">
+                            <el-select v-model="ruleForm.buildingId" placeholder="请选择楼栋" @change="buildingChoice">
+                                <el-option v-for="(item,index) in buildingList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="楼层" prop="whatFloor">
-                            <el-select v-model="ruleForm.whatFloor" placeholder="请选择楼层">
-                                <el-option label="1F" value="shanghai"></el-option>
-                                <el-option label="2F" value="beijing"></el-option>
+                        <el-form-item label="楼层" prop="floorNumber">
+                            <el-select v-model="ruleForm.floorNumber" placeholder="请选择楼层">
+                                <el-option v-for="(item,index) in floorNumberList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="房屋类型" prop="propertyType">
-                            <el-select v-model="ruleForm.propertyType" placeholder="请选择房屋类型">
-                                <el-option label="民房" value="shanghai"></el-option>
-                                <el-option label="公寓" value="beijing"></el-option>
+                        <el-form-item label="房屋类型" prop="buildingType">
+                            <el-select v-model="ruleForm.buildingType" placeholder="请选择房屋类型">
+                                <el-option label="民房" :value="1"></el-option>
+                                <el-option label="公寓" :value="2"></el-option>
                             </el-select>
                         </el-form-item>
                         <el-form-item label="建筑面积">
-                            <el-input v-model="ruleForm.builtUpArea"></el-input>
+                            <el-input v-model="ruleForm.buildingArea"></el-input>
                         </el-form-item>
                         <el-form-item label="公摊面积">
-                            <el-input v-model="ruleForm.sharedArea"></el-input>
+                            <el-input v-model="ruleForm.publicArea"></el-input>
                         </el-form-item>
                         <el-form-item label="装修性质">
-                            <el-input v-model="ruleForm.decorationNature"></el-input>
+                            <el-select v-model="ruleForm.decorateProperties" placeholder="请选择装修性质">
+                                <el-option label="毛胚" :value="1"></el-option>
+                                <el-option label="简单装修" :value="2"></el-option>
+                                <el-option label="中等装修" :value="3"></el-option>
+                                <el-option label="精装修" :value="4"></el-option>
+                                <el-option label="豪华装修" :value="5"></el-option>
+                            </el-select>
                         </el-form-item>
                     </el-col>
                 </el-row>
                 <el-row>
                     <el-col :span="24">
                         <el-form-item label="备注信息">
-                            <el-input type="textarea" :rows="4" v-model="ruleForm.remark" maxlength="300">
+                            <el-input type="textarea" :rows="4" v-model="ruleForm.remarks" maxlength="300">
                             </el-input>
-                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remark.length}}/300</span>
+                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remarks.length}}/300</span>
                         </el-form-item>
                     </el-col>
                 </el-row>
@@ -91,31 +104,43 @@
     export default {
         data() {
             return {
+                communityList:[],//社区名称下拉列表
+                buildingList:[],//楼栋下拉选择列表
+                unitList:[],//单元下拉选择列表
+                // roomList:[],//房间号选择下拉列表
+                addEditState:'',
+                housingType:{//房屋户型,roomNumber为室,officeNumber为厅,guardNumber为卫
+                    roomNumber:'',
+                    officeNumber:'',
+                    guardNumber:''
+                },
                 ruleForm: {
-                    communityName: '',//社区名称
-                    unit:'',//单元
-                    houseNumber:'',//房屋号
+                    assetNumber: "",
+                    buildingArea:'',//建筑面积
+                    buildingId:'',//楼栋id
+                    buildingType:'',//房屋类型
+                    communityId:'',//社区id
+                    decorateProperties:'',//装修性质
+                    floorNumber:'',//单元楼层
+                    housingType:'',//房屋户型
+                    id: '',
+                    orientationOfRoom:'',//房屋朝向
+                    publicArea:'',//公摊面积
+                    remarks:'',//备注
+                    residentId:'',//业主id
+                    roomNumber:'',//房屋号
+                    unitName:'',//单元
                     useArea:'',//使用面积
-                    orientation:'',//楼栋朝向
-                    houseType:'',//房屋户型
-                    buildingName:'',//楼栋,
-                    whatFloor:'',//楼层
-                    propertyType:'',//房屋类型
-                    builtUpArea:'',//建筑面积
-                    sharedArea:'',//公摊面积
-                    decorationNature:'',//装修性质
-                    remark:'',//备注
                 },
                 rules: {
                     communityName: [
                         { required: true, message: '请输入活动名称', trigger: 'change' },
                         // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
                     ],
-                    unit:[{ required: true, message: '请输入单元', trigger: 'change' }],
-                    houseNumber:[{ required: true, message: '请输入房屋号', trigger: 'change' }],
-                    buildingName:[{ required: true, message: '请输入楼栋', trigger: 'change' }],
-                    whatFloor:[{ required: true, message: '请输入楼层', trigger: 'change' }],
-                    propertyType:[{ required: true, message: '请输入房屋类型', trigger: 'change' }],
+                    roomNumber:[{ required: true, message: '请输入房屋号', trigger: 'change' }],
+                    buildingId:[{ required: true, message: '请输入楼栋', trigger: 'change' }],
+                    floorNumber:[{ required: true, message: '请输入楼层', trigger: 'change' }],
+                    buildingType:[{ required: true, message: '请输入房屋类型', trigger: 'change' }],
                 },
             }
         },
@@ -125,9 +150,53 @@
         computed: {},
         methods: {
             submitForm(formName) {
+                let self=this;
+                let houseAddEditData=JSON.parse(sessionStorage.getItem('houseAddEdit'));
                 this.$refs[formName].validate((valid) => {
                     if (valid) {
-                        alert('submit!');
+                        if(houseAddEditData.todo=="edit"){
+                            this.ruleForm.id=houseAddEditData.id;
+                            this.ruleForm.residentId='';
+                            this.ruleForm.housingType=this.housingType.roomNumber+":"+this.housingType.officeNumber+":"+this.housingType.guardNumber;
+                            this.$http.post('/sc-community-web/assets/house/update', this.ruleForm).then((res) => {
+                                if(res.status==0){
+                                    this.$message({
+                                        message: '添加成功',
+                                        type: 'success'
+                                    });
+
+                                    setTimeout(function(){
+                                        self.$router.go(-1);//返回上一层
+                                    },5000)
+                                }else{
+
+                                }
+                            });
+                        }else{
+                            this.ruleForm.id='';
+                            this.ruleForm.residentId='';
+                            this.ruleForm.housingType=this.housingType.roomNumber+":"+this.housingType.officeNumber+":"+this.housingType.guardNumber;
+                            this.$http.post('/sc-community-web/assets/house/add', this.ruleForm).then((res) => {
+                                if(res.status==0){
+                                    if(res.status==0){
+                                        this.$message({
+                                            message: '编辑成功',
+                                            type: 'success'
+                                        });
+
+                                        setTimeout(function(){
+                                            self.$router.go(-1);//返回上一层
+                                        },5000)
+                                    }else{
+
+                                    }
+                                }else{
+
+                                }
+                            });
+                        }
+
+
                     } else {
                         console.log('error submit!!');
                         return false;
@@ -160,25 +229,159 @@
                     })
                     .catch(_ => {});
             },
-            addressQueryClick(){
-                this.mapPopUpStatus=true;
-            }
 
+            //获取社区名称下拉列表
+            communityNameList(){
+                this.communityList=[];
+                let onOption='';
+                this.$http.get('/assets/community/list', {}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.communityName,
+                            id:res.id
+                        }
+                        this.communityList.push(onOption)
+                    })
+                });
+            },
+
+            communityChoice(e){
+                this.ruleForm.communityId=e;
+                this.buildingNameList();
+            },
+            //查询楼栋下拉列表
+            buildingNameList(){
+                this.buildingList=[];
+                let onOption='';
+                this.$http.post('/sc-community-web/assets/building/list/building', {"communityId": this.ruleForm.communityId}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.buildingName,
+                            id:res.id
+                        }
+                        this.buildingList.push(onOption)
+                    })
+                });
+            },
+            buildingChoice(e){
+                this.ruleForm.buildingId=e;
+                this.unitNameList();
+            },
+            unitNameList(){
+                this.unitList=[];
+                let onOption='';
+                this.$http.get('/sc-community-web/assets/building/house/find', {"id": this.ruleForm.buildingId}).then((res) => {
+                    if(res.status==0){
+                        if(res.data.buildingUnitList.length!=0){
+                            res.data.buildingUnitList.map(resData=>{
+                                onOption={
+                                    label:resData.unitName,
+                                    id:resData.unitName,
+                                    floorNumberList:resData.unitFloorList,
+                                }
+                                this.unitList.push(onOption)
+                            })
+                        }else{
+                            this.unitList=[];
+                        }
+                    }
+                });
+            },
+
+            unitChoice(e){
+                this.floorNumberList=[];
+                let onOption='';
+                this.unitList.map(res=>{
+                    if(res.label==e){
+                        if(res.floorNumberList.length!=0){
+                            res.floorNumberList.map(resData=>{
+                                console.log(resData)
+                                onOption={
+                                    label:resData.floorNumber,
+                                    id:resData.floorNumber,
+                                    // roomList:resData.roomList,
+                                }
+                                this.floorNumberList.push(onOption)
+                            })
+                        }else{
+                            this.floorNumberList=[]
+                        }
+
+                    }
+                })
+            },
+
+            //加载房间详情展示
+            houseAddEdit(){
+                let self=this;
+                let houseAddEditData=JSON.parse(sessionStorage.getItem('houseAddEdit'));
+                this.addEditState=houseAddEditData.todo;
+                if(houseAddEditData.todo=="edit"){
+                    this.$http.get('/sc-community-web/assets/house/find/'+houseAddEditData.id, {}).then((res) => {
+                        if(res.status==0){
+                            this.ruleForm.communityId=res.data.communityId;
+                            this.buildingNameList()
+                            this.ruleForm.buildingId=res.data.buildingId;
+                            this.unitNameList();
+                            this.ruleForm.unitName=res.data.unitName;
+                            setTimeout(function(){
+                                self.unitChoice(res.data.unitName);
+                                self.ruleForm.floorNumber=res.data.floorNumber;
+                                self.floorNumberChoice(res.data.floorNumber);
+                            },500)
+                            self.ruleForm.roomNumber=res.data.roomNumber;
+                            this.ruleForm.buildingType=res.data.buildingType;
+                            this.ruleForm.useArea=res.data.useArea;
+                            this.ruleForm.housingType=res.data.housingType;
+                            var housingTypes=this.ruleForm.housingType.split(':');
+                            this.housingType.roomNumber=housingTypes[0];
+                            this.housingType.officeNumber=housingTypes[1];
+                            this.housingType.guardNumber=housingTypes[2];
+                            this.ruleForm.orientationOfRoom=res.data.orientationOfRoom;
+                            this.ruleForm.buildingArea=res.data.buildingArea;
+                            this.ruleForm.publicArea=res.data.publicArea;
+                            this.ruleForm.decorateProperties=res.data.decorateProperties;
+                            this.ruleForm.remarks=res.data.remarks;
+                        }else{
+                            this.ruleForm.communityId='';
+                            this.ruleForm.buildingId='';
+                            this.ruleForm.unitName='';
+                            this.ruleForm.floorNumber='';
+                            this.ruleForm.roomNumber='';
+                            this.ruleForm.buildingType='';
+                            this.ruleForm.useArea='';
+                            this.ruleForm.housingType='';
+                            this.housingType.roomNumber='';
+                            this.housingType.officeNumber='';
+                            this.housingType.guardNumber='';
+                            this.ruleForm.orientationOfRoom='';
+                            this.ruleForm.buildingArea='';
+                            this.ruleForm.publicArea='';
+                            this.ruleForm.decorateProperties='';
+                            this.ruleForm.remarks='';
+                        }
+                    });
+                }else{
+
+                }
+            }
 
         },
         created() {
-
+            //获取社区名称下拉列表
+            this.communityNameList();
+            this.houseAddEdit();
         }
     };
 </script>
 <style lang='scss'>
     .alert-body__main_content{
-        .blockName{
-            padding:20px;
-            i{
-                color:red;
-            }
-        }
+    .blockName{
+        padding:20px;
+    i{
+        color:red;
+    }
+    }
 
     }
 </style>