housemanger.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. <template>
  2. <div class="housemange">
  3. <div class="form">
  4. <van-row>
  5. <van-col :span="4">
  6. <div class="yuanqu_label">园区</div>
  7. </van-col>
  8. <van-col :span="20" class="labelcolmt26">
  9. <uni-data-checkbox
  10. v-model="form.groupIds"
  11. mode="tag"
  12. :localdata="yuanqu_loacldata"
  13. selectedTextColor="#1D18BC"
  14. selectedColor="rgba(29,24,188,0.05);"
  15. @change="getSelectedYuanqu"
  16. >
  17. </uni-data-checkbox>
  18. </van-col>
  19. </van-row>
  20. <van-row v-if="form.groupIds != null">
  21. <van-col :span="4">
  22. <div class="yuanqu_label">楼盘</div>
  23. </van-col>
  24. <van-col class="labelcolmt26" :span="20">
  25. <uni-data-checkbox
  26. v-model="form.loupan_value"
  27. mode="tag"
  28. :localdata="loupan_loacldata"
  29. selectedTextColor="#1D18BC"
  30. selectedColor="rgba(29,24,188,0.05);"
  31. @change="getSelectedLoupan"
  32. >
  33. </uni-data-checkbox>
  34. </van-col>
  35. </van-row>
  36. <van-row>
  37. <van-col class="labelcolmt26" :span="4">
  38. <div class="yuanqu_label" style="height: 37rpx; line-height: 37rpx">
  39. 状态
  40. </div>
  41. </van-col>
  42. <van-col class="labelcolmt26 status" :span="20">
  43. <uni-data-checkbox
  44. v-model="form.statusArray"
  45. :localdata="statusList"
  46. :multiple="true"
  47. selectedTextColor="#1D18BC"
  48. selectedColor="#1D18BC"
  49. @change="getSelectedStatus"
  50. >
  51. </uni-data-checkbox>
  52. </van-col>
  53. </van-row>
  54. <van-row>
  55. <van-col class="labelcolmt26" :span="4">
  56. <div class="yuanqu_label" style="height: 37rpx; line-height: 37rpx">
  57. 朝向
  58. </div>
  59. </van-col>
  60. <van-col class="labelcolmt26 status" :span="20">
  61. <uni-data-checkbox
  62. v-model="form.chaoxiangArray"
  63. :localdata="fangxiangList"
  64. :multiple="true"
  65. selectedTextColor="#1D18BC"
  66. selectedColor="#1D18BC"
  67. @change="getChaoxiang"
  68. >
  69. </uni-data-checkbox>
  70. </van-col>
  71. </van-row>
  72. <van-row>
  73. <van-col class="labelcolmt26" :span="6">
  74. <div class="yuanqu_label">载体性质</div>
  75. </van-col>
  76. <van-col class="labelcolmt26" :span="16">
  77. <uni-data-checkbox
  78. v-model="form.zaitiTypeArray"
  79. mode="tag"
  80. :localdata="xinzhiList"
  81. selectedTextColor="#1D18BC"
  82. selectedColor="rgba(29,24,188,0.05);"
  83. @change="getSelectedXingZhi"
  84. >
  85. </uni-data-checkbox>
  86. </van-col>
  87. </van-row>
  88. <van-row>
  89. <van-col class="labelcolmt26" :span="5">
  90. <div class="yuanqu_label">指导价</div>
  91. </van-col>
  92. <van-col class="labelcolmt26" :span="9">
  93. <input
  94. v-model="form.guidePrice1"
  95. type="number"
  96. placeholder="最低价"
  97. />
  98. </van-col>
  99. <van-col :span="1">
  100. <div class="width100 txt_center">-</div>
  101. </van-col>
  102. <van-col class="labelcolmt26" :span="9">
  103. <input
  104. v-model="form.guidePrice2"
  105. type="number"
  106. placeholder="最高价"
  107. />
  108. </van-col>
  109. </van-row>
  110. <van-row>
  111. <van-col class="labelcolmt26" :span="5">
  112. <div class="yuanqu_label">面积</div>
  113. </van-col>
  114. <van-col class="labelcolmt26" :span="9">
  115. <input
  116. v-model="form.roomSize1"
  117. type="number"
  118. placeholder="最小面积"
  119. />
  120. </van-col>
  121. <van-col :span="1">
  122. <div class="width100 txt_center">-</div>
  123. </van-col>
  124. <van-col class="labelcolmt26" :span="9">
  125. <input
  126. v-model="form.roomSize2"
  127. type="number"
  128. placeholder="最大面积"
  129. />
  130. </van-col>
  131. </van-row>
  132. <div style="margin-top: 16rpx">
  133. <van-row>
  134. <van-col class="labelcolmt26" :span="6">
  135. <van-button
  136. color="#F1F2F9"
  137. custom-class="reset_btn"
  138. @click="reast()"
  139. >重置</van-button
  140. >
  141. </van-col>
  142. <van-col class="labelcolmt26" :span="18">
  143. <van-button
  144. style="margin-top: 16rpx"
  145. color="#2527AA"
  146. custom-class="search_btn"
  147. @click="search()"
  148. >
  149. <van-icon name="search" />
  150. 搜索
  151. </van-button>
  152. </van-col>
  153. </van-row>
  154. </div>
  155. </div>
  156. <div class="list">
  157. <div v-if="vamTabStatus">
  158. <van-tabs
  159. id="resizeID"
  160. ref="vantTabs"
  161. :ellipsis="false"
  162. :active="form.mnpBuildingIds"
  163. @change="getSelectedLoudong"
  164. line-width="80rpx"
  165. title-active-color="#1D18BC"
  166. >
  167. <van-tab
  168. v-for="(item, index) in loudongList"
  169. :title="item.ldmc"
  170. :name="item.id"
  171. :key="index"
  172. >
  173. </van-tab>
  174. </van-tabs>
  175. </div>
  176. <div class="total" v-if="roomList.length != 0">
  177. <span style="color: #1d18bc">{{ form.total }}</span>
  178. </div>
  179. <div
  180. class="list-row"
  181. v-if="roomList.length != 0"
  182. v-for="(item, index) in roomList"
  183. :key="index"
  184. @click="jumpPage(item.id, item.currentState)"
  185. >
  186. <div class="cell_1">
  187. <div class="width100 mb8rpx">
  188. <div class="first_title" style="height: auto">
  189. {{
  190. item.yuanquName + item.quyuName + item.loudongName + item.roomNo
  191. }}
  192. </div>
  193. </div>
  194. <div class="width100 height40rpx mb8rpx">
  195. <div class="second_title">
  196. 用途:{{
  197. getDicType("roomUse", item.roomUse) == undefined
  198. ? "未知"
  199. : getDicType("roomUse", item.roomUse)
  200. }}
  201. </div>
  202. <div class="second_title_1 width50 chaochuyincang">
  203. 装修情况:{{
  204. !item.decorationSituation ? "未知" : item.decorationSituation
  205. }}
  206. </div>
  207. </div>
  208. <div class="width100 height36rpx mb14rpx">
  209. <div class="third_title" v-if="item.roomSize">
  210. 面积(㎡):{{ item.roomSize }}平米
  211. </div>
  212. <div class="third_title" v-if="!item.roomSize">面积(㎡):未知</div>
  213. <div class="third_title_1">
  214. 朝向:{{ item.roomDirection ? item.roomDirection : "未知" }}
  215. </div>
  216. </div>
  217. <div class="width100 height50rpx mb14rpx">
  218. <div class="roomstatus" v-if="getDicType('zaiti', item.zaitiType)">
  219. {{ getDicType("zaiti", item.zaitiType) }}
  220. </div>
  221. <div class="roomstatus" v-if="item.currentState == 1">空置</div>
  222. <div class="roomstatus" v-if="item.currentState == 2">锁定</div>
  223. <div class="roomstatus" v-if="item.currentState == 3">预约</div>
  224. <div class="roomstatus" v-if="item.currentState == 4">临期</div>
  225. <div class="roomstatus" v-if="item.currentState == 5">已租</div>
  226. <div class="roomstatus" v-if="item.currentState == 6">到期</div>
  227. </div>
  228. <div class="width100 height36rpx">
  229. <div class="float_left chuzu_label">出租指导价(元/㎡/月):</div>
  230. <span class="float_left chuzu_vlaue">{{
  231. !item.guidePrice ? "未知" : item.guidePrice
  232. }}</span>
  233. </div>
  234. </div>
  235. <div class="cell_2" findDeptList>
  236. <img src="../../../../static/mine/youjiantou.png" alt="" />
  237. </div>
  238. </div>
  239. <div class="list-row" v-if="roomList.length == 0">
  240. <van-empty
  241. class="disblock marginauto"
  242. style="background: white"
  243. description="暂无数据"
  244. />
  245. </div>
  246. </div>
  247. </div>
  248. </template>
  249. <script>
  250. import vanTab from "../../../../wxcomponents/weapp/dist/tab/index";
  251. import vanTabs from "../../../../wxcomponents/weapp/dist/tabs/index";
  252. import vanEmpty from "../../../../wxcomponents/weapp/dist/empty/index";
  253. import {
  254. findYuanQuList,
  255. findLongPanList,
  256. findLouDongList,
  257. findRoomByCondition,
  258. getByCodes,
  259. } from "@/js_sdk/http.js";
  260. const form = {
  261. status: [],
  262. chaoxiang: [],
  263. statusArray: [],
  264. chaoxiangArray: [],
  265. zaitiTypeArray: [],
  266. zaitiType: "",
  267. roomSize1: "",
  268. roomSize2: "",
  269. guidePrice1: "",
  270. guidePrice2: "",
  271. loupan_value: null,
  272. groupIds: null,
  273. pageNum: 1,
  274. pageSize: 10,
  275. total: 0,
  276. mnpBuildingIds: "",
  277. };
  278. export default {
  279. components: {
  280. vanTab,
  281. vanTabs,
  282. vanEmpty,
  283. },
  284. name: "housemanger.vue",
  285. data() {
  286. return {
  287. tabsStatus: true,
  288. dic_key: ["PROPERTY_NATURE", "HOUSE_USAGE"],
  289. dic_SelectList: {},
  290. loudongList: [],
  291. activezhaoshang: "0",
  292. form: {
  293. ...form,
  294. },
  295. active: 0,
  296. formData: {},
  297. value: 0,
  298. vamTabStatus: false,
  299. yuanqu_loacldata: [],
  300. loupan_loacldata: [],
  301. range: [
  302. {
  303. value: 0,
  304. text: "科教产业园",
  305. },
  306. {
  307. value: 1,
  308. text: "红沙湾",
  309. },
  310. {
  311. value: 2,
  312. text: "胡埭",
  313. },
  314. ],
  315. loupanList: [
  316. {
  317. value: 0,
  318. text: "一期",
  319. },
  320. {
  321. value: 1,
  322. text: "二期",
  323. },
  324. {
  325. value: 2,
  326. text: "三期",
  327. },
  328. {
  329. value: 3,
  330. text: "四期",
  331. },
  332. {
  333. value: 4,
  334. text: "五期",
  335. },
  336. {
  337. value: 5,
  338. text: "六期",
  339. },
  340. {
  341. value: 6,
  342. text: "七期",
  343. },
  344. {
  345. value: 7,
  346. text: "八期",
  347. },
  348. {
  349. value: 8,
  350. text: "九期",
  351. },
  352. ],
  353. statusList: [
  354. {
  355. value: 1,
  356. text: "空置",
  357. },
  358. {
  359. value: 2,
  360. text: "锁定",
  361. },
  362. {
  363. value: 3,
  364. text: "预约",
  365. },
  366. {
  367. value: 4,
  368. text: "临期",
  369. },
  370. {
  371. value: 5,
  372. text: "已租",
  373. },
  374. {
  375. value: 6,
  376. text: "到期",
  377. },
  378. ],
  379. roomList: [],
  380. fangxiangList: [
  381. {
  382. value: "朝东",
  383. text: "东",
  384. },
  385. {
  386. value: "朝南",
  387. text: "南",
  388. },
  389. {
  390. value: "朝西",
  391. text: "西",
  392. },
  393. {
  394. value: "朝北",
  395. text: "北",
  396. },
  397. ],
  398. xinzhiList: [
  399. {
  400. value: 1,
  401. text: "自有物业",
  402. },
  403. {
  404. value: 2,
  405. text: "社会物业",
  406. },
  407. ],
  408. };
  409. },
  410. mounted() {
  411. this.findYuanQuList();
  412. this.getByCodes();
  413. },
  414. methods: {
  415. async searcMore() {
  416. this.form.pageNum += 1;
  417. let data = await findRoomByCondition(this.form);
  418. this.roomList.push(...data.rows);
  419. },
  420. reast() {
  421. this.loudongList = [];
  422. this.roomList = [];
  423. this.form = { ...form };
  424. this.findYuanQuList();
  425. this.getByCodes();
  426. },
  427. async search() {
  428. if (!this.form.groupIds && !this.form.loupan_value) {
  429. return this.$showToast("请选择园区和楼盘后重试");
  430. }
  431. if (!this.form.groupIds) {
  432. return this.$showToast("请选择园区后重试");
  433. }
  434. if (!this.form.loupan_value) {
  435. return this.$showToast("请选择楼盘后重试");
  436. }
  437. this.form.pageNum = 1;
  438. this.form.pageSize = 10;
  439. this.form.total = 0;
  440. let data = await findRoomByCondition(this.form);
  441. this.roomList = data.rows;
  442. this.form.total = data.total;
  443. },
  444. onReachBottom() {
  445. console.log("滑动到距离底部100px的时候触发,可以放 。。业务逻辑");
  446. }, //下拉执行的时候触发 (下拉刷新)
  447. getDicType(type, value) {
  448. if (!value) return;
  449. if (type == "zaiti") {
  450. let PROPERTY_NATURE = this.dic_SelectList.PROPERTY_NATURE;
  451. let index = PROPERTY_NATURE.findIndex((e) => e.value == value);
  452. return PROPERTY_NATURE[index].label;
  453. }
  454. if (type == "roomUse") {
  455. let HOUSE_USAGE = this.dic_SelectList.HOUSE_USAGE;
  456. let index = HOUSE_USAGE.findIndex((e) => e.value == value);
  457. return HOUSE_USAGE[index].label;
  458. }
  459. },
  460. async getByCodes() {
  461. let data = await getByCodes(JSON.stringify(this.dic_key));
  462. this.dic_SelectList = this.$common.handleDicList(data);
  463. },
  464. async getSelectedLoudong(event) {
  465. console.log(event);
  466. this.form.mnpBuildingIds =
  467. event.detail.title == "全部" ? "" : event.detail.name;
  468. let data = await findRoomByCondition(this.form);
  469. console.log(data);
  470. this.roomList = data.rows;
  471. this.form.total = data.total;
  472. },
  473. async getSelectedYuanqu() {
  474. let data = await findLongPanList(this.form.groupIds);
  475. this.roomList = [];
  476. this.loudongList = [];
  477. if (data.length > 0) {
  478. this.loupan_loacldata = data.map((e) => {
  479. return {
  480. value: e.id,
  481. text: e.name,
  482. };
  483. });
  484. } else {
  485. this.loupan_loacldata = [{ value: null, text: "暂无" }];
  486. }
  487. console.log(this.loupan_loacldata);
  488. },
  489. async getSelectedLoupan() {
  490. try {
  491. let data = await findLouDongList(this.form.loupan_value);
  492. this.vamTabStatus = false;
  493. console.log(data);
  494. if (data.length == 0) {
  495. this.loudongList = [];
  496. this.roomList = [];
  497. this.tabsStatus = !this.tabsStatus;
  498. return;
  499. } else {
  500. console.log("我tm有数据的", data);
  501. this.loudongList = [...data];
  502. this.form.mnpBuildingIds = data[0].id;
  503. this.roomList = [];
  504. }
  505. let row = await findRoomByCondition(this.form);
  506. console.log("我是row", row);
  507. this.roomList = row.rows;
  508. this.form.total = row.total;
  509. this.vamTabStatus = true;
  510. console.log(row);
  511. } catch (e) {
  512. console.log("e这天真热", e);
  513. }
  514. },
  515. findYuanQuList() {
  516. findYuanQuList().then((data) => {
  517. let yuanqu_list = [...data];
  518. let yuanqu_loacldata = yuanqu_list.map((e) => {
  519. return {
  520. value: e.id,
  521. text: e.groupName,
  522. };
  523. });
  524. this.yuanqu_loacldata = yuanqu_loacldata;
  525. });
  526. // console.log(yuanqu_loacldata)
  527. },
  528. jumpPage(id, currentState) {
  529. console.log(id);
  530. uni.navigateTo({
  531. url:
  532. "/pages/subPackages/housedetails/housedetails?id=" +
  533. id +
  534. "&currentState=" +
  535. currentState,
  536. });
  537. },
  538. onLoadMore() {},
  539. getChaoxiang() {
  540. this.form.roomDirection = this.form.chaoxiangArray.join(",");
  541. },
  542. getSelectedStatus(e) {
  543. console.log(this.form.statusArray.join(","));
  544. this.form.currentState = this.form.statusArray.join(",");
  545. },
  546. getSelectedXingZhi() {
  547. console.log(this.form.zaitiTypeArray);
  548. this.form.zaitiType = this.form.zaitiTypeArray;
  549. },
  550. onChange() {},
  551. },
  552. onPullDownRefresh: function () {
  553. // 加载数据
  554. },
  555. onReachBottom() {
  556. console.log("滑动到距离底部100px的时候触发,可以放 。。业务逻辑");
  557. }, //下拉执行的时候触发 (下拉刷新)
  558. };
  559. </script>
  560. <style lang="scss">
  561. .chaochuyincang {
  562. white-space: nowrap;
  563. overflow: hidden;
  564. text-overflow: ellipsis;
  565. }
  566. /deep/.van-cell {
  567. padding: 0 0 0 28rpx !important;
  568. }
  569. .inputClass {
  570. padding: 0 0 0 28rpx !important;
  571. }
  572. .yuanqu_label {
  573. font-size: 31rpx;
  574. height: 55rpx;
  575. line-height: 55rpx;
  576. }
  577. .loupan_label {
  578. padding: 0rpx 10rpx;
  579. }
  580. .housemange {
  581. .van-ellipsis {
  582. flex-basis: auto !important;
  583. }
  584. /deep/.checklist-box {
  585. margin: 0 !important;
  586. margin-right: 16rpx !important;
  587. }
  588. .search_btn {
  589. margin-left: 18rpx;
  590. width: calc(100% - 18rpx);
  591. height: 60rpx;
  592. }
  593. .reset_btn {
  594. color: #2628a9 !important;
  595. width: 100%;
  596. height: 60rpx;
  597. }
  598. .list-row {
  599. width: calc(100% - 64rpx);
  600. padding: 16rpx 32rpx 18rpx 32rpx;
  601. background: #ffffff;
  602. margin-bottom: 16rpx;
  603. display: flex;
  604. //height: 278rpx;
  605. border-radius: 8rpx 8rpx 8rpx 8rpx;
  606. }
  607. .second_title {
  608. float: left;
  609. width: 50%;
  610. font-size: 28rpx;
  611. font-family: PingFang SC-Medium, PingFang SC;
  612. font-weight: 500;
  613. color: #777777;
  614. }
  615. .cell_1 {
  616. float: left;
  617. width: 90%;
  618. }
  619. .cell_2 {
  620. float: left;
  621. width: 10%;
  622. img {
  623. height: 60rpx;
  624. width: 60rpx;
  625. float: right;
  626. margin: 96rpx 0rpx 94rpx 0;
  627. }
  628. }
  629. .list {
  630. width: calc(100% - 64rpx);
  631. margin: 32rpx;
  632. }
  633. .form {
  634. width: calc(100% - 128rpx);
  635. margin: 32rpx;
  636. background: #ffffff;
  637. padding: 32rpx;
  638. .label {
  639. height: 53rpx;
  640. line-height: 53rpx;
  641. }
  642. }
  643. .labelcolmt26 {
  644. input {
  645. font-size: 24rpx;
  646. border-radius: 8rpx 8rpx 8rpx 8rpx;
  647. border: 2rpx solid #cccccc;
  648. text-align: center;
  649. }
  650. .van-col {
  651. margin-top: 26rpx !important;
  652. }
  653. label {
  654. color: #333333;
  655. font-size: 30rpx;
  656. margin: 0;
  657. margin-top: 0 !important;
  658. }
  659. .uni-data-checklist {
  660. margin-top: -10rpx !important;
  661. }
  662. }
  663. .status {
  664. .uni-data-checklist {
  665. margin-top: 0rpx !important;
  666. }
  667. label {
  668. color: #333333;
  669. font-size: 30rpx;
  670. padding-right: 0rpx !important;
  671. }
  672. }
  673. }
  674. </style>