123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583 |
- <template>
- <div class="maintenance">
- <div class="topSearchBox">
- <van-field
- :value="value1"
- right-icon="search"
- class="input-item"
- placeholder="请输入房号"
- @change="changeSearchNo"
- />
- </div>
- <div class="selectBody" :style="{ height: height + 'rpx' }">
- <div class="selectRow">
- <span class="rowTitle">园区</span>
- <div class="selectItemBox">
- <span class="unSelectItem"
- :class="item.select?'selectItem':''"
- v-for="item in yuanqu_loacldata"
- @click="clickGroupItem(item)">
- {{item.name}}
- </span>
- </div>
- </div>
- <van-icon name="arrow-down" class="arrowDown" style="font-size: 40rpx;margin-top: 40rpx;font-weight: 600" @tap="closeSelectBody" v-if="height<200"/>
- <div class="selectRow" v-if="form.groupIds != null">
- <span class="rowTitle">楼盘</span>
- <div class="selectItemBox loupanBox">
- <span class="unSelectItem" v-for="item in loupan_loacldata" :class="item.select?'selectItem':''" @click="clickItem(item)">{{ item.name }}</span>
- </div>
- </div>
- <div class="selectRow">
- <span class="rowTitle">朝向</span>
- <div class="selectItemBox">
- <van-checkbox-group :value="toward" @change="onChange" >
- <van-checkbox :name="item.value" shape="square" v-for="item in mnpList" :key="item.id">{{ item.label }}</van-checkbox>
- </van-checkbox-group>
- </div>
- </div>
- <div class="selectRow">
- <span class="rowTitle">可用状态</span>
- <div class="selectItemBox">
- <van-checkbox-group :value="avaStatus" @change="avaChange" >
- <van-checkbox :name="item.value" shape="square" v-for="item in enableList" :key="item.id">{{item.label}}</van-checkbox>
- </van-checkbox-group>
- </div>
- </div>
- <div class="selectRow" style="align-items: start;">
- <span class="rowTitle">租赁状态</span>
- <div class="selectItemBox selectItemBoxMoreItem">
- <van-checkbox-group :value="rentalStatus" @change="rentalChange" >
- <van-checkbox :name="item.value" shape="square" v-for="item in zlList" :key="item.id">{{item.label}}</van-checkbox>
- </van-checkbox-group>
- </div>
- </div>
- <div class="selectRow" style="margin-top: 12rpx">
- <span class="rowTitle">用途</span>
- <div class="selectItemBox">
- <van-checkbox-group :value="useTo" @change="useToChange" >
- <van-checkbox :name="item.value" shape="square" v-for="item in usageList" :key="item.id">{{item.label}}</van-checkbox>
- </van-checkbox-group>
- </div>
- </div>
- <div class="selectRow">
- <span class="rowTitle">物业性质</span>
- <div class="selectItemBox">
- <van-checkbox-group :value="propertyNature" @change="natureChange" >
- <van-checkbox :name="item.value" shape="square" v-for="item in natureList" :key="item.id">{{item.label}}</van-checkbox>
- </van-checkbox-group>
- </div>
- </div>
- <div class="selectRow">
- <span class="rowTitle">指导价</span>
- <div class="selectItemBox">
- <input placeholder="元/㎡/月" class="myIpt" v-model="form.guidePrice1"/>
- <span style="margin: 0 18rpx">—</span>
- <input placeholder="元/㎡/月" class="myIpt" v-model="form.guidePrice2"/>
- </div>
- </div>
- <div class="selectRow">
- <span class="rowTitle">面积</span>
- <div class="selectItemBox">
- <input placeholder="㎡" class="myIpt" v-model="form.roomSize1"/>
- <span style="margin: 0 18rpx">—</span>
- <input placeholder="㎡" class="myIpt" v-model="form.roomSize2"/>
- </div>
- </div>
- <div class="btnBox">
- <button class="czBtn" @tap="reset">重置</button>
- <button class="ssBtn" @tap="search()">搜索</button>
- </div>
- <van-icon name="arrow-up" style="font-size: 40rpx;margin-top: 40rpx;font-weight: 600" @tap="closeSelectBody"/>
- </div>
- <div class="bottomBody">
- <van-tabs :active="active" @change="buildChange">
- <van-tab
- v-for="(item, index) in loudongList"
- :title="item.ldmc"
- :name="item.id"
- :key="index"
- >
- </van-tab>
- </van-tabs>
- <div class="sumBox">
- 共 <span style="color: rgba(3, 101, 249, 1);margin: 0 5rpx">{{ form.total }}</span> 间
- </div>
- <div class="listBody">
- <div class="listItem" v-for="item in roomList" @tap="toEdit(item)">
- <div class="firstRow">
- <span class="itemTitle">{{
- item.yuanquName + item.quyuName + item.loudongName + item.roomNo
- }}</span>
- <span class="tag">{{getDicType("currentState", item.currentState)}}</span>
- </div>
- <div class="midRow">
- <span style="width: 300rpx">用途:{{
- getDicType("roomUse", item.roomUse) == undefined
- ? "未知"
- : getDicType("roomUse", item.roomUse)
- }}</span>
- <span>装修情况:{{
- !item.decorationSituation ? "未知" : item.decorationSituation
- }}</span>
- </div>
- <div class="midRow">
- <span style="width: 300rpx">面积(㎡):{{ item.roomSize }}㎡</span>
- <span>朝向:{{ item.roomDirection ? item.roomDirection : "未知" }}</span>
- </div>
- <div class="bottomRow">
- <span>出租指导价(元/㎡/月):</span>
- <span class="money">{{
- !item.guidePrice ? "未知" : item.guidePrice
- }}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- findYuanQuList,
- findLongPanList,
- findLouDongList,
- findRoomByCondition,
- findRoomByConditionExcel,
- getByCodes,
- } from "@/js_sdk/http";
- export default {
- name: "maintenance",
- data(){
- return{
- dic_key: ["PROPERTY_NATURE", "HOUSE_USAGE", "INVESTMENT_STATUS", "HOUSE_ENABLE","MNP_BUILDING_CX", "HOUSE_USAGE", "PROPERTY_NATURE"],
- zlList:[],
- enableList:[],
- mnpList:[],
- usageList:[],
- natureList:[],
- value1:'',
- parkSelect:true,
- properties: [
- // {name:'一期', select:true},
- // {name:'二期', select:false},
- // {name:'三期', select:false},
- // {name:'四期', select:false},
- ],
- toward: [],
- avaStatus:[],
- rentalStatus:[],
- useTo:[],
- propertyNature:[],
- height: 1036,
- active: 0,
- groupIds: [],
- yuanqu_loacldata: [],
- loupan_loacldata: [],
- loudongList: [],
- form: {},
- roomList: [],
- discIds: [],
- timeout: null
- }
- },
- created() {
- this.findYuanQuList();
- this.getByCodes();
- },
- methods:{
- changeSearchNo(e){
- if (this.timeout) {
- clearTimeout(this.timeout)
- }
- this.timeout = setTimeout(()=>{
- this.form.roomNo = e.detail
- this.search()
- },500)
- console.log(e.detail)
- },
- reset() {
- this.groupIds = []
- this.discIds = []
- this.toward = []
- this.avaStatus = []
- this.rentalStatus = []
- this.useTo = []
- this.loudongList = [];
- this.roomList = [];
- this.form = {};
- this.findYuanQuList();
- this.getByCodes();
- },
- clickGroupItem(item) {
- item.select = !item.select
- if (this.groupIds.includes(item.value)) {
- this.groupIds = this.groupIds.filter(function (ele) {
- return ele !== item.value
- })
- } else {
- this.groupIds.push(item.value)
- }
- this.form.groupIds = this.groupIds.join(',')
- if (this.form.groupIds) {
- this.yuanQuChange()
- }
- },
- async yuanQuChange() {
- let data = await findLongPanList(this.form.groupIds);
- this.roomList = [];
- this.loudongList = [];
- if (data.length > 0) {
- this.loupan_loacldata = data.map((e) => {
- return {
- value: e.id,
- name: e.name,
- select: false
- };
- });
- } else {
- this.loupan_loacldata = [{value: null, name: "暂无", select: false}];
- }
- },
- findYuanQuList() {
- findYuanQuList().then((data) => {
- let yuanqu_list = [...data];
- let yuanqu_loacldata = yuanqu_list.map((e) => {
- return {
- value: e.id,
- name: e.groupName,
- select: false
- };
- });
- this.yuanqu_loacldata = yuanqu_loacldata;
- });
- },
- clickItem(item) {
- item.select = !item.select
- if (this.discIds.includes(item.value)) {
- // includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效
- // filter()方法用于把Array的某些元素过滤掉,filter()把传入的函数依次作用于每个元素,然后根据返回值是true还是false决定保留还是丢弃该元素:生成新的数组
- this.discIds = this.discIds.filter(function (ele) {
- return ele !== item.value
- })
- } else {
- this.discIds.push(item.value)
- }
- this.form.discIds = this.discIds.join(',')
- if (this.form.discIds) {
- this.louPanChange()
- }
- },
- async louPanChange() {
- try {
- let data = await findLouDongList(this.form.discIds);
- if (data.length == 0) {
- this.loudongList = [];
- this.roomList = [];
- return;
- } else {
- this.loudongList = [...data];
- this.form.mnpBuildingIds = data[0].id;
- this.roomList = [];
- }
- let row = await findRoomByConditionExcel(this.form);
- this.roomList = row;
- this.form.total = row.length;
- this.vamTabStatus = true;
- } catch (e) {
- }
- },
- async buildChange(e) {
- this.form.mnpBuildingIds = e.detail.name
- let data = await findRoomByConditionExcel(this.form);
- this.roomList = data;
- this.form.total = data.length;
- },
- async search() {
- console.log('this.form', this.form)
- if (!this.form.groupIds && !this.form.discIds) {
- return this.$showToast("请选择园区和楼盘后重试");
- }
- if (!this.form.groupIds) {
- return this.$showToast("请选择园区后重试");
- }
- if (!this.form.discIds) {
- return this.$showToast("请选择楼盘后重试");
- }
- let data = await findRoomByConditionExcel(this.form);
- this.roomList = data;
- this.form.total = data.length;
- },
- getDicType(type, value) {
- if (!value) return;
- if (type == "zaiti") {
- let PROPERTY_NATURE = this.dic_SelectList.PROPERTY_NATURE;
- let index = PROPERTY_NATURE.findIndex((e) => e.value == value);
- return PROPERTY_NATURE[index].label;
- }
- if (type == "roomUse") {
- let HOUSE_USAGE = this.dic_SelectList.HOUSE_USAGE;
- let index = HOUSE_USAGE.findIndex((e) => e.value == value);
- return HOUSE_USAGE[index].label;
- }
- if (type == "currentState") {
- let INVESTMENT_STATUS = this.dic_SelectList.INVESTMENT_STATUS;
- let index = INVESTMENT_STATUS.findIndex((e) => e.value == value);
- return INVESTMENT_STATUS[index].label;
- }
- },
- onChange(e){
- // console.log(e)
- this.toward = e.detail
- this.form.roomDirection = this.toward.join(',')
- },
- avaChange(e){
- this.avaStatus = e.detail
- this.form.isEnable = this.avaStatus.join(',')
- },
- rentalChange(e){
- this.rentalStatus = e.detail
- this.form.currentState = this.rentalStatus.join(',')
- },
- useToChange(e){
- this.useTo = e.detail
- this.form.roomUse = this.useTo.join(',')
- },
- natureChange(e){
- this.propertyNature = e.detail
- this.form.propertyNature = this.propertyNature.join(',')
- },
- closeSelectBody(){
- if (this.height > 1000){
- this.height = 130
- }else{
- this.height = 1036
- }
- },
- async getByCodes() {
- let data = await getByCodes(JSON.stringify(this.dic_key));
- this.dic_SelectList = this.$common.handleDicList(data);
- this.zlList = this.dic_SelectList.INVESTMENT_STATUS
- this.enableList = this.dic_SelectList.HOUSE_ENABLE
- this.mnpList = this.dic_SelectList.MNP_BUILDING_CX
- this.usageList = this.dic_SelectList.HOUSE_USAGE
- this.natureList = this.dic_SelectList.PROPERTY_NATURE
- },
- toEdit(item) {
- uni.navigateTo({
- url:'/pages/subPackages/propertyManagement/propertyEditor?id=' + item.id
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .maintenance{
- padding-bottom: 150rpx;
- .topSearchBox{
- background: white;
- padding:16rpx 32rpx;
- .van-cell{
- background: rgba(245, 247, 250, 1);
- width: 686rpx;
- border: 1px solid rgba(234, 237, 242, 1) ;
- border-radius: 8rpx;
- box-sizing: border-box;
- padding: 12rpx 32rpx;
- }
- .van-icon{
- color: rgba(3, 101, 249, 1);
- font-size: 40rpx;
- }
- }
- .selectBody{
- background: white;
- display: flex;
- flex-direction: column;
- margin: 24rpx 0;
- padding: 12rpx 32rpx 36rpx 32rpx;
- box-sizing: border-box;
- overflow: hidden;
- position: relative;
- .selectRow{
- display: flex;
- align-items: center;
- margin-top: 38rpx;
- .rowTitle{
- min-width: 120rpx;
- color: rgba(51, 51, 51, 1);
- font-size: 30rpx;
- text-align: right;
- }
- .selectItemBox{
- display: flex;
- align-items: center;
- margin-left: 24rpx;
- white-space: nowrap;
- .unSelectItem{
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- color: rgba(102, 102, 102, 1);
- padding: 8rpx 18rpx;
- background: rgba(245, 247, 250, 1);
- border-radius: 8rpx;
- margin-right: 24rpx;
- }
- .selectItem{
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- color: rgba(3, 101, 249, 1);
- padding: 8rpx 18rpx;
- background: rgba(3, 101, 249, 0.10);
- border-radius: 8rpx;
- margin-right: 24rpx;
- }
- .van-checkbox-group{
- display: flex;
- flex-wrap: wrap;
- .van-checkbox{
- margin-right: 24rpx;
- }
- .van-checkbox__label {
- padding-left: 6rpx;
- font-size: 28rpx;
- color: rgba(102, 102, 102, 1);
- }
- .van-checkbox__icon{
- width: 30rpx;
- height: 30rpx;
- }
- .van-icon, .van-icon:before {
- font-size: 24rpx;
- }
- .van-checkbox__icon--checked {
- background: rgba(3, 101, 249, 1);
- }
- }
- .myIpt{
- width: 240rpx;
- height: 64rpx;
- text-align: center;
- background: rgba(245, 247, 250, 1);
- box-sizing: border-box;
- font-size: 26rpx;
- }
- }
- .loupanBox{
- overflow-x: scroll;
- }
- .selectItemBoxMoreItem{
- .van-checkbox{
- margin:0 24rpx 24rpx 0;
- }
- }
- }
- .btnBox{
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 48rpx;
- .czBtn{
- background: rgba(3, 101, 249, 0.10);
- border-radius: 8rpx;
- width: 240rpx;
- height: 80rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- color: rgba(3, 101, 249, 1);
- font-size: 34rpx;
- letter-spacing: 2rpx;
- }
- .ssBtn{
- background: rgba(3, 101, 249, 1);
- border-radius: 8rpx;
- width: 300rpx;
- height: 80rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- color: white;
- font-size: 34rpx;
- letter-spacing: 2rpx;
- margin-left: 32rpx;
- }
- }
- .arrowDown{
- position: absolute;
- left: 50%;
- margin-left: -20rpx;
- top: 50rpx;
- }
- }
- .bottomBody{
- padding: 32rpx;
- background: white;
- width: 100%;
- box-sizing: border-box;
- .sumBox{
- color: rgba(51, 51, 51, 1);
- font-size: 28rpx;
- margin: 24rpx 0;
- }
- .listBody{
- display: flex;
- flex-direction: column;
- :last-child{
- border-bottom: none !important;
- }
- .listItem{
- padding: 24rpx 0;
- border-bottom: 1px solid rgba(230, 230, 230, 1);
- .firstRow{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .itemTitle{
- font-size: 32rpx;
- color: rgba(51, 51, 51, 1);
- font-weight: 600;
- }
- .tag{
- padding: 12rpx 24rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 26rpx;
- color: rgba(3, 101, 249, 1);
- background: linear-gradient( 316deg, #d1e4ff 0%, #adceff 100%);
- border-radius: 8rpx;
- }
- }
- .midRow{
- display: flex;
- align-items: center;
- color: rgba(136, 136, 136, 1);
- font-size: 28rpx;
- margin: 12rpx 0;
- }
- .bottomRow{
- display: flex;
- align-items: center;
- color: rgba(51, 51, 51, 1);
- font-size: 28rpx;
- margin-top: 8rpx;
- .money{
- color: rgba(226, 81, 0, 1);
- font-size: 40rpx;
- }
- }
- }
- }
- }
- }
- </style>
|