housemanger.vue 18 KB

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