houseList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <template>
  2. <div class="houseList">
  3. <div class="selectBody" :style="{ height: height + 'rpx' }">
  4. <div class="selectRow">
  5. <span class="rowTitle">园区</span>
  6. <div class="selectItemBox">
  7. <span class="unSelectItem" v-for="item in yuanqu_loacldata"
  8. :class="item.select?'selectItem':''"
  9. @click="clickGroupItem(item)"
  10. >{{ item.name }}</span>
  11. </div>
  12. </div>
  13. <van-icon name="arrow-down" class="arrowDown" style="font-size: 40rpx;margin-top: 40rpx;font-weight: 600"
  14. @tap="closeSelectBody" v-if="height<200"/>
  15. <div class="selectRow" v-if="form.groupIds != null">
  16. <span class="rowTitle">楼盘</span>
  17. <div class="selectItemBox loupanBox">
  18. <span class="unSelectItem"
  19. v-for="item in loupan_loacldata"
  20. :class="item.select?'selectItem':''"
  21. @click="clickItem(item)">{{ item.name }}
  22. </span>
  23. </div>
  24. </div>
  25. <div class="selectRow">
  26. <span class="rowTitle">状态</span>
  27. <div class="selectItemBox">
  28. <van-checkbox-group :value="avaStatus" @change="avaChange">
  29. <van-checkbox name="1" shape="square">空置</van-checkbox>
  30. <van-checkbox name="4" shape="square">合同临期</van-checkbox>
  31. </van-checkbox-group>
  32. </div>
  33. </div>
  34. <div class="selectRow">
  35. <span class="rowTitle">装修情况</span>
  36. <div class="selectItemBox selectItemBoxMoreItem">
  37. <van-checkbox-group :value="rentalStatus" @change="rentalChange">
  38. <van-checkbox name="3" shape="square">毛坯</van-checkbox>
  39. <van-checkbox name="2" shape="square">简装</van-checkbox>
  40. <van-checkbox name="1" shape="square">精装</van-checkbox>
  41. </van-checkbox-group>
  42. </div>
  43. </div>
  44. <div class="selectRow">
  45. <span class="rowTitle">用途</span>
  46. <div class="selectItemBox">
  47. <van-checkbox-group :value="useTo" @change="useToChange">
  48. <van-checkbox name="1" shape="square">研发办公</van-checkbox>
  49. <van-checkbox name="2" shape="square">生活配套</van-checkbox>
  50. <van-checkbox name="3" shape="square">生产用房</van-checkbox>
  51. </van-checkbox-group>
  52. </div>
  53. </div>
  54. <div class="selectRow">
  55. <span class="rowTitle">朝向</span>
  56. <div class="selectItemBox">
  57. <van-checkbox-group :value="toward" @change="onChange">
  58. <van-checkbox name="东" shape="square">东</van-checkbox>
  59. <van-checkbox name="南" shape="square">南</van-checkbox>
  60. <van-checkbox name="西" shape="square">西</van-checkbox>
  61. <van-checkbox name="北" shape="square">北</van-checkbox>
  62. </van-checkbox-group>
  63. </div>
  64. </div>
  65. <div class="selectRow">
  66. <span class="rowTitle">指导价</span>
  67. <div class="selectItemBox">
  68. <input placeholder="元/㎡/月" class="myIpt" v-model="form.guidePrice1"/>
  69. <span style="margin: 0 18rpx">—</span>
  70. <input placeholder="元/㎡/月" class="myIpt" v-model="form.guidePrice2"/>
  71. </div>
  72. </div>
  73. <div class="selectRow">
  74. <span class="rowTitle">面积</span>
  75. <div class="selectItemBox">
  76. <input placeholder="㎡" class="myIpt" v-model="form.roomSize1"/>
  77. <span style="margin: 0 18rpx">—</span>
  78. <input placeholder="㎡" class="myIpt" v-model="form.roomSize2"/>
  79. </div>
  80. </div>
  81. <div class="btnBox">
  82. <button class="czBtn" @tap="reset()">重置</button>
  83. <button class="ssBtn" @tap="search()">搜索</button>
  84. </div>
  85. <van-icon name="arrow-up" style="font-size: 40rpx;margin-top: 40rpx;font-weight: 600" @tap="closeSelectBody"/>
  86. </div>
  87. <div class="bottomBody" v-if="vamTabStatus">
  88. <van-tabs :active="form.mnpBuildingIds" @change="buildChange">
  89. <van-tab
  90. v-for="(item, index) in loudongList"
  91. :title="item.ldmc"
  92. :name="item.id"
  93. :key="index"
  94. >
  95. </van-tab>
  96. </van-tabs>
  97. <div class="sumBox">
  98. 共 <span style="color: rgba(3, 101, 249, 1);margin: 0 5rpx">{{ form.total }}</span> 间
  99. </div>
  100. <div class="listBody">
  101. <div class="listItem" v-for="item in roomList" @tap="toDetail(item)">
  102. <div class="firstRow">
  103. <span class="itemTitle">
  104. {{
  105. item.yuanquName + item.quyuName + item.loudongName + item.roomNo
  106. }}</span>
  107. <span class="tag">{{getDicType("currentState", item.currentState)}}</span>
  108. </div>
  109. <div class="midRow">
  110. <span style="width: 300rpx">用途:{{
  111. getDicType("roomUse", item.roomUse) == undefined
  112. ? "未知"
  113. : getDicType("roomUse", item.roomUse)
  114. }}</span>
  115. <span>装修情况:{{
  116. !item.decorationSituation ? "未知" : item.decorationSituation
  117. }}</span>
  118. </div>
  119. <div class="midRow">
  120. <span style="width: 300rpx">面积(㎡):{{ item.roomSize }}㎡</span>
  121. <span>朝向:{{ item.roomDirection ? item.roomDirection : "未知" }}</span>
  122. </div>
  123. <div class="bottomRow">
  124. <span>出租指导价(元/㎡/月):</span>
  125. <span class="money">{{
  126. !item.guidePrice ? "未知" : item.guidePrice
  127. }}</span>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </template>
  134. <script>
  135. import {
  136. findYuanQuList,
  137. findLongPanList,
  138. findLouDongList,
  139. findRoomByCondition,
  140. findRoomByConditionExcel,
  141. getByCodes,
  142. } from "@/js_sdk/http";
  143. import handle from "../../modifyHandle/handle.vue";
  144. export default {
  145. name: "maintenance",
  146. computed: {
  147. handle() {
  148. return handle
  149. }
  150. },
  151. created() {
  152. this.findYuanQuList();
  153. this.getByCodes();
  154. },
  155. data() {
  156. return {
  157. dic_key: ["PROPERTY_NATURE", "HOUSE_USAGE", "INVESTMENT_STATUS"],
  158. dic_SelectList: {},
  159. toward: [],
  160. avaStatus: [],
  161. rentalStatus: [],
  162. useTo: [],
  163. propertyNature: [],
  164. height: 890,
  165. active: 0,
  166. groupIds: [],
  167. discIds: [],
  168. buildId: '',
  169. yuanqu_loacldata: [],
  170. loupan_loacldata: [],
  171. loudongList: [],
  172. roomList: [],
  173. form: {
  174. // currentState: this.avaStatus.join(','),
  175. // roomDirection: this.toward.join(',')
  176. },
  177. vamTabStatus: false,
  178. }
  179. },
  180. methods: {
  181. clickGroupItem(item) {
  182. item.select = !item.select
  183. if (this.groupIds.includes(item.value)) {
  184. // includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效
  185. // filter()方法用于把Array的某些元素过滤掉,filter()把传入的函数依次作用于每个元素,然后根据返回值是true还是false决定保留还是丢弃该元素:生成新的数组
  186. this.groupIds = this.groupIds.filter(function (ele) {
  187. return ele !== item.value
  188. })
  189. } else {
  190. this.groupIds.push(item.value)
  191. }
  192. this.form.groupIds = this.groupIds.join(',')
  193. if (this.form.groupIds) {
  194. this.yuanQuChange()
  195. }
  196. },
  197. clickItem(item) {
  198. item.select = !item.select
  199. if (this.discIds.includes(item.value)) {
  200. // includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效
  201. // filter()方法用于把Array的某些元素过滤掉,filter()把传入的函数依次作用于每个元素,然后根据返回值是true还是false决定保留还是丢弃该元素:生成新的数组
  202. this.discIds = this.discIds.filter(function (ele) {
  203. return ele !== item.value
  204. })
  205. } else {
  206. this.discIds.push(item.value)
  207. }
  208. this.form.discIds = this.discIds.join(',')
  209. if (this.form.discIds) {
  210. this.louPanChange()
  211. }
  212. },
  213. onChange(e) {
  214. this.toward = e.detail
  215. this.form.roomDirection = this.toward.join(',')
  216. },
  217. avaChange(e) {
  218. this.avaStatus = e.detail
  219. this.form.currentState = this.avaStatus.join(',')
  220. },
  221. rentalChange(e) {
  222. this.rentalStatus = e.detail
  223. this.form.decorationSituation = this.rentalStatus.join(',')
  224. },
  225. useToChange(e) {
  226. this.useTo = e.detail
  227. this.form.roomUse = this.useTo.join(',')
  228. },
  229. natureChange(e) {
  230. this.propertyNature = e.detail
  231. },
  232. async buildChange(e) {
  233. this.form.mnpBuildingIds = e.detail.name
  234. let data = await findRoomByConditionExcel(this.form);
  235. this.roomList = data;
  236. this.form.total = data.length;
  237. },
  238. closeSelectBody() {
  239. if (this.height > 800) {
  240. this.height = 130
  241. } else {
  242. this.height = 890
  243. }
  244. },
  245. findYuanQuList() {
  246. findYuanQuList().then((data) => {
  247. let yuanqu_list = [...data];
  248. let yuanqu_loacldata = yuanqu_list.map((e) => {
  249. return {
  250. value: e.id,
  251. name: e.groupName,
  252. select: false
  253. };
  254. });
  255. this.yuanqu_loacldata = yuanqu_loacldata;
  256. });
  257. },
  258. async yuanQuChange() {
  259. let data = await findLongPanList(this.form.groupIds);
  260. this.roomList = [];
  261. this.loudongList = [];
  262. if (data.length > 0) {
  263. this.loupan_loacldata = data.map((e) => {
  264. return {
  265. value: e.id,
  266. name: e.name,
  267. select: false
  268. };
  269. });
  270. } else {
  271. this.loupan_loacldata = [{value: null, name: "暂无", select: false}];
  272. }
  273. },
  274. async louPanChange() {
  275. try {
  276. let data = await findLouDongList(this.form.discIds);
  277. if (data.length == 0) {
  278. this.loudongList = [];
  279. this.roomList = [];
  280. return;
  281. } else {
  282. this.loudongList = [...data];
  283. this.form.mnpBuildingIds = data[0].id;
  284. this.roomList = [];
  285. }
  286. let row = await findRoomByConditionExcel(this.form);
  287. this.roomList = row;
  288. this.form.total = row.length;
  289. this.vamTabStatus = true;
  290. } catch (e) {
  291. }
  292. },
  293. async search() {
  294. console.log('this.form', this.form)
  295. if (!this.form.groupIds && !this.form.discIds) {
  296. return this.$showToast("请选择园区和楼盘后重试");
  297. }
  298. if (!this.form.groupIds) {
  299. return this.$showToast("请选择园区后重试");
  300. }
  301. if (!this.form.discIds) {
  302. return this.$showToast("请选择楼盘后重试");
  303. }
  304. let data = await findRoomByConditionExcel(this.form);
  305. this.roomList = data;
  306. this.form.total = data.length;
  307. },
  308. reset() {
  309. this.groupIds = []
  310. this.discIds = []
  311. this.toward = []
  312. this.avaStatus = []
  313. this.rentalStatus = []
  314. this.useTo = []
  315. this.loudongList = [];
  316. this.roomList = [];
  317. this.form = {};
  318. this.findYuanQuList();
  319. this.getByCodes();
  320. },
  321. getDicType(type, value) {
  322. if (!value) return;
  323. if (type == "zaiti") {
  324. let PROPERTY_NATURE = this.dic_SelectList.PROPERTY_NATURE;
  325. let index = PROPERTY_NATURE.findIndex((e) => e.value == value);
  326. return PROPERTY_NATURE[index].label;
  327. }
  328. if (type == "roomUse") {
  329. let HOUSE_USAGE = this.dic_SelectList.HOUSE_USAGE;
  330. let index = HOUSE_USAGE.findIndex((e) => e.value == value);
  331. return HOUSE_USAGE[index].label;
  332. }
  333. if (type == "currentState") {
  334. let INVESTMENT_STATUS = this.dic_SelectList.INVESTMENT_STATUS;
  335. let index = INVESTMENT_STATUS.findIndex((e) => e.value == value);
  336. return INVESTMENT_STATUS[index].label;
  337. }
  338. },
  339. async getByCodes() {
  340. let data = await getByCodes(JSON.stringify(this.dic_key));
  341. this.dic_SelectList = this.$common.handleDicList(data);
  342. },
  343. toDetail(item) {
  344. uni.navigateTo({
  345. url: '/pages/subPackages/housingResources/detail?id=' + item.id
  346. })
  347. }
  348. }
  349. }
  350. </script>
  351. <style lang="scss">
  352. .houseList {
  353. padding-bottom: 150rpx;
  354. .topformBox {
  355. background: white;
  356. padding: 16rpx 32rpx;
  357. .van-cell {
  358. background: rgba(245, 247, 250, 1);
  359. width: 686rpx;
  360. border: 1px solid rgba(234, 237, 242, 1);
  361. border-radius: 8rpx;
  362. box-sizing: border-box;
  363. padding: 12rpx 32rpx;
  364. }
  365. .van-icon {
  366. color: rgba(3, 101, 249, 1);
  367. font-size: 40rpx;
  368. }
  369. }
  370. .selectBody {
  371. background: white;
  372. display: flex;
  373. flex-direction: column;
  374. margin: 24rpx 0;
  375. padding: 12rpx 32rpx 36rpx 32rpx;
  376. box-sizing: border-box;
  377. overflow: hidden;
  378. position: relative;
  379. .selectRow {
  380. display: flex;
  381. align-items: center;
  382. margin-top: 38rpx;
  383. .rowTitle {
  384. min-width: 120rpx;
  385. color: rgba(51, 51, 51, 1);
  386. font-size: 30rpx;
  387. text-align: right;
  388. }
  389. .selectItemBox {
  390. display: flex;
  391. align-items: center;
  392. margin-left: 24rpx;
  393. white-space: nowrap;
  394. .unSelectItem {
  395. display: flex;
  396. align-items: center;
  397. justify-content: center;
  398. font-size: 28rpx;
  399. color: rgba(102, 102, 102, 1);
  400. padding: 8rpx 18rpx;
  401. background: rgba(245, 247, 250, 1);
  402. border-radius: 8rpx;
  403. margin-right: 24rpx;
  404. }
  405. .selectItem {
  406. display: flex;
  407. align-items: center;
  408. justify-content: center;
  409. font-size: 28rpx;
  410. color: rgba(3, 101, 249, 1);
  411. padding: 8rpx 18rpx;
  412. background: rgba(3, 101, 249, 0.10);
  413. border-radius: 8rpx;
  414. margin-right: 24rpx;
  415. }
  416. .myIpt {
  417. width: 240rpx;
  418. height: 64rpx;
  419. text-align: center;
  420. background: rgba(245, 247, 250, 1);
  421. box-sizing: border-box;
  422. font-size: 26rpx;
  423. }
  424. }
  425. .loupanBox{
  426. overflow-x: scroll;
  427. }
  428. .selectItemBoxMoreItem {
  429. .van-checkbox {
  430. margin: 0 24rpx 24rpx 0;
  431. }
  432. }
  433. }
  434. .btnBox {
  435. display: flex;
  436. align-items: center;
  437. justify-content: center;
  438. margin-top: 48rpx;
  439. .czBtn {
  440. background: rgba(3, 101, 249, 0.10);
  441. border-radius: 8rpx;
  442. width: 240rpx;
  443. height: 80rpx;
  444. display: flex;
  445. align-items: center;
  446. justify-content: center;
  447. color: rgba(3, 101, 249, 1);
  448. font-size: 34rpx;
  449. letter-spacing: 2rpx;
  450. }
  451. .ssBtn {
  452. background: rgba(3, 101, 249, 1);
  453. border-radius: 8rpx;
  454. width: 300rpx;
  455. height: 80rpx;
  456. display: flex;
  457. align-items: center;
  458. justify-content: center;
  459. color: white;
  460. font-size: 34rpx;
  461. letter-spacing: 2rpx;
  462. margin-left: 32rpx;
  463. }
  464. }
  465. .arrowDown {
  466. position: absolute;
  467. left: 50%;
  468. margin-left: -20rpx;
  469. top: 50rpx;
  470. }
  471. }
  472. .bottomBody {
  473. padding: 32rpx;
  474. background: white;
  475. width: 100%;
  476. box-sizing: border-box;
  477. .sumBox {
  478. color: rgba(51, 51, 51, 1);
  479. font-size: 28rpx;
  480. margin: 24rpx 0;
  481. }
  482. .listBody {
  483. display: flex;
  484. flex-direction: column;
  485. :last-child {
  486. border-bottom: none !important;
  487. }
  488. .listItem {
  489. padding: 24rpx 0;
  490. border-bottom: 1px solid rgba(230, 230, 230, 1);
  491. .firstRow {
  492. display: flex;
  493. align-items: center;
  494. justify-content: space-between;
  495. .itemTitle {
  496. font-size: 32rpx;
  497. color: rgba(51, 51, 51, 1);
  498. font-weight: 600;
  499. }
  500. .tag {
  501. padding: 12rpx 24rpx;
  502. display: flex;
  503. align-items: center;
  504. justify-content: center;
  505. font-size: 26rpx;
  506. color: rgba(3, 101, 249, 1);
  507. background: linear-gradient(316deg, #d1e4ff 0%, #adceff 100%);
  508. border-radius: 8rpx;
  509. }
  510. }
  511. .midRow {
  512. display: flex;
  513. align-items: center;
  514. color: rgba(136, 136, 136, 1);
  515. font-size: 28rpx;
  516. margin: 12rpx 0;
  517. }
  518. .bottomRow {
  519. display: flex;
  520. align-items: center;
  521. color: rgba(51, 51, 51, 1);
  522. font-size: 28rpx;
  523. margin-top: 8rpx;
  524. .money {
  525. color: rgba(226, 81, 0, 1);
  526. font-size: 40rpx;
  527. }
  528. }
  529. }
  530. }
  531. }
  532. }
  533. </style>