index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <template>
  2. <div class="maintenance">
  3. <div class="selectBody">
  4. <div class="selectRow">
  5. <span class="rowTitle">项目</span>
  6. <div class="selectItemBox">
  7. <span
  8. class="unSelectItem"
  9. :class="item.select ? 'selectItem' : ''"
  10. v-for="item in xiangmu"
  11. @click="clickGroupItem(item)"
  12. >
  13. {{ item.name }}
  14. </span>
  15. </div>
  16. </div>
  17. <div class="selectRow" v-if="form.groupIds != null">
  18. <span class="rowTitle">分期</span>
  19. <div class="selectItemBox fenqiBox">
  20. <span
  21. class="unSelectItem"
  22. v-for="item in fenqi_loacldata"
  23. :class="item.select ? 'selectItem' : ''"
  24. @click="clickItem(item)"
  25. >{{ item.name }}</span
  26. >
  27. </div>
  28. </div>
  29. <div class="selectRow">
  30. <span class="rowTitle">购房状态</span>
  31. <div class="selectItemBox">
  32. <van-checkbox-group
  33. :value="saleStatusStr"
  34. @change="saleStatusStrChange"
  35. >
  36. <van-checkbox
  37. :name="item.value"
  38. shape="square"
  39. v-for="item in BUYING_HOUSE_STATUS"
  40. :key="item.id"
  41. >{{ item.label }}</van-checkbox
  42. >
  43. </van-checkbox-group>
  44. </div>
  45. </div>
  46. <div class="selectRow">
  47. <span class="rowTitle">姓名</span>
  48. <div class="selectItemBox">
  49. <input
  50. placeholder="请输入房号"
  51. class="myIpt"
  52. v-model="form.buyerName"
  53. />
  54. </div>
  55. </div>
  56. <div class="btnBox">
  57. <button class="czBtn" @tap="reset">重置</button>
  58. <button class="ssBtn" @tap="newSearch()">搜索</button>
  59. </div>
  60. <!-- <van-icon
  61. name="arrow-up"
  62. style="font-size: 40rpx; margin-top: 40rpx; font-weight: 600"
  63. @tap="closeSelectBody"
  64. /> -->
  65. </div>
  66. <div class="bottomBody">
  67. <div class="listBody">
  68. <div class="listItem" v-for="item in roomList">
  69. <div class="firstRow">
  70. <span class="itemTitle">
  71. {{ item.groupDiscName }}
  72. </span>
  73. <div class="tag" style="margin-left: auto; margin-right: 20rpx">
  74. {{ BUYING_HOUSE_STATUS[item.status - 1].label }}
  75. </div>
  76. <div class="tag" style="margin-lett: auto">
  77. {{
  78. item.intentionalDepositStatus
  79. ? INTENTIONAL_DEPOSIT_STATUS[
  80. item.intentionalDepositStatus - 1
  81. ].label
  82. : "未交意向金"
  83. }}
  84. </div>
  85. </div>
  86. <div class="midRow" style="display: block">
  87. <div>买受人:{{ item.buyerName }}</div>
  88. <div style="margin-top: 12rpx">
  89. 选房日期:{{ item.roomSelectionDate }}
  90. </div>
  91. </div>
  92. <div class="midRow">
  93. <span style="width: 300rpx"
  94. >选房号:{{ item.roomSelectionNumber }}</span
  95. >
  96. <span>批次号:{{ item.batchNumber }}</span>
  97. </div>
  98. <div class="midRow" style="justify-content: flex-end">
  99. <van-button
  100. type="info"
  101. size="mini"
  102. @click="toChoose(item)"
  103. v-if="item.intentionalDepositStatus != 1"
  104. >去选房</van-button
  105. >
  106. <van-button
  107. style="margin-left: 20rpx"
  108. v-if="item.status == 1"
  109. type="info"
  110. size="mini"
  111. @click="toIntentionAdd(item)"
  112. >意向金登记</van-button
  113. >
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </template>
  120. <script>
  121. import {
  122. findXiangMuList,
  123. findFenQiList,
  124. findRoomByCondition,
  125. getCustomer,
  126. getByCodes,
  127. } from "@/js_sdk/http";
  128. export default {
  129. name: "maintenance",
  130. data() {
  131. return {
  132. dic_key: ["BUYING_HOUSE_STATUS", "INTENTIONAL_DEPOSIT_STATUS"],
  133. SOLD_STATUS: [],
  134. DECORATION_SITUATION: [],
  135. INTENTIONAL_DEPOSIT_STATUS: [],
  136. SALE_STATUS: [],
  137. BUYING_HOUSE_STATUS: [],
  138. BIZ_OA: [],
  139. mnpList: [],
  140. usageList: [],
  141. natureList: [],
  142. value1: "",
  143. parkSelect: true,
  144. properties: [
  145. // {name:'一期', select:true},
  146. // {name:'二期', select:false},
  147. // {name:'三期', select:false},
  148. // {name:'四期', select:false},
  149. ],
  150. saleStatusStr: [],
  151. toward: [],
  152. avaStatus: [],
  153. soldStatusStr: [],
  154. decorationSituation: [],
  155. roomUseStr: [],
  156. propertyNature: [],
  157. height: 1036,
  158. active: 0,
  159. groupIds: [],
  160. xiangmu: [],
  161. fenqi_loacldata: [],
  162. loudongList: [],
  163. form: {
  164. pageNum: 1,
  165. pageSize: 10,
  166. roomUseStr: "",
  167. },
  168. decorationSituationStr: [],
  169. total: 0,
  170. roomList: [],
  171. discIds: [],
  172. HOUSE_USAGE: [],
  173. timeout: null,
  174. };
  175. },
  176. onShow() {
  177. this.findXiangMuList();
  178. this.getByCodes();
  179. },
  180. onReachBottom() {
  181. this.form.pageNum += 1;
  182. this.search();
  183. },
  184. methods: {
  185. reset() {
  186. this.roomUseStr = [];
  187. this.discIds = [];
  188. this.toward = [];
  189. this.avaStatus = [];
  190. this.rentalStatus = [];
  191. this.roomUseStr = [];
  192. this.loudongList = [];
  193. this.roomList = [];
  194. this.form = {
  195. pageNum: 1,
  196. pageSize: 10,
  197. };
  198. this.findXiangMuList();
  199. this.getByCodes();
  200. },
  201. newSearch() {
  202. this.roomList = [];
  203. this.search.pageNum = 1;
  204. this.search();
  205. },
  206. clickGroupItem(item) {
  207. item.select = !item.select;
  208. if (this.groupIds.includes(item.value)) {
  209. this.groupIds = this.groupIds.filter(function (ele) {
  210. return ele !== item.value;
  211. });
  212. } else {
  213. this.groupIds.push(item.value);
  214. }
  215. this.form.groupIds = this.groupIds.join(",");
  216. if (this.form.groupIds) {
  217. this.yuanQuChange();
  218. this.roomList = [];
  219. this.search.pageNum = 1;
  220. this.search();
  221. }
  222. },
  223. async yuanQuChange() {
  224. let data = await findFenQiList(this.form.groupIds);
  225. this.roomList = [];
  226. this.loudongList = [];
  227. if (data.length > 0) {
  228. this.fenqi_loacldata = data.map((e) => {
  229. return {
  230. value: e.id,
  231. name: e.name,
  232. select: false,
  233. };
  234. });
  235. } else {
  236. this.fenqi_loacldata = [{ value: null, name: "暂无", select: false }];
  237. }
  238. },
  239. findXiangMuList() {
  240. findXiangMuList().then((data) => {
  241. let yuanqu_list = [...data];
  242. let xiangmu = yuanqu_list.map((e) => {
  243. return {
  244. value: e.groupId,
  245. name: e.name,
  246. select: false,
  247. };
  248. });
  249. this.xiangmu = [{ value: "", name: "全部", select: true }, ...xiangmu];
  250. this.form.pageNum = 1;
  251. this.discIds = [];
  252. this.roomList = [];
  253. this.search();
  254. });
  255. },
  256. clickItem(item) {
  257. item.select = !item.select;
  258. if (this.discIds.includes(item.value)) {
  259. // includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效
  260. // filter()方法用于把Array的某些元素过滤掉,filter()把传入的函数依次作用于每个元素,然后根据返回值是true还是false决定保留还是丢弃该元素:生成新的数组
  261. this.discIds = this.discIds.filter(function (ele) {
  262. return ele !== item.value;
  263. });
  264. } else {
  265. this.discIds.push(item.value);
  266. }
  267. this.form.discIds = this.discIds.join(",");
  268. this.form.pageNum = 1;
  269. this.roomList = [];
  270. this.search();
  271. },
  272. async fenQiChange() {
  273. try {
  274. let data = await findFenQiList(this.form.discIds);
  275. if (data.length == 0) {
  276. this.loudongList = [];
  277. this.roomList = [];
  278. return;
  279. } else {
  280. this.loudongList = [...data];
  281. this.form.mnpBuildingIds = data[0].id;
  282. this.roomList = [];
  283. }
  284. let row = await getCustomer(this.form);
  285. this.roomList = row;
  286. this.form.total = row.length;
  287. this.vamTabStatus = true;
  288. } catch (e) {}
  289. },
  290. async buildChange(e) {
  291. this.form.mnpBuildingIds = e.detail.name;
  292. let data = await getCustomer(this.form);
  293. this.roomList = data;
  294. this.form.total = data.length;
  295. },
  296. async search() {
  297. let data = await getCustomer(this.form);
  298. if (data.total == this.roomList.length) {
  299. return false;
  300. } else {
  301. this.roomList.push(...data.rows);
  302. }
  303. },
  304. getDicType(type, value) {
  305. if (!value) return;
  306. if (type == "zaiti") {
  307. let PROPERTY_NATURE = this.dic_SelectList.PROPERTY_NATURE;
  308. let index = PROPERTY_NATURE.findIndex((e) => e.value == value);
  309. return PROPERTY_NATURE[index].label;
  310. }
  311. },
  312. onChange(e) {
  313. // console.log(e)
  314. this.toward = e.detail;
  315. this.form.roomDirection = this.toward.join(",");
  316. },
  317. saleStatusStrChange(e) {
  318. this.saleStatusStr = e.detail;
  319. this.form.saleStatusStr = this.saleStatusStr.join(",");
  320. },
  321. soldStatusStrChange(e) {
  322. this.soldStatusStr = e.detail;
  323. this.form.soldStatusStr = this.soldStatusStr.join(",");
  324. },
  325. decorationSituationStrChange(e) {
  326. this.decorationSituationStr = e.detail;
  327. this.form.decorationSituationStr = this.decorationSituationStr.join(",");
  328. },
  329. roomUseStrChange(e) {
  330. console.log(e.detail);
  331. this.roomUseStr = e.detail;
  332. this.form.roomUseStr = this.roomUseStr.join(",");
  333. },
  334. natureChange(e) {
  335. this.propertyNature = e.detail;
  336. this.form.propertyNature = this.propertyNature.join(",");
  337. },
  338. closeSelectBody() {
  339. if (this.height > 1000) {
  340. this.height = 130;
  341. } else {
  342. this.height = 1036;
  343. }
  344. },
  345. async getByCodes() {
  346. let data = await getByCodes(JSON.stringify(this.dic_key));
  347. this.dic_SelectList = this.$common.handleDicList(data);
  348. this.BUYING_HOUSE_STATUS = this.dic_SelectList.BUYING_HOUSE_STATUS;
  349. this.INTENTIONAL_DEPOSIT_STATUS =
  350. this.dic_SelectList.INTENTIONAL_DEPOSIT_STATUS;
  351. },
  352. toIntentionAdd(item) {
  353. console.log(
  354. `/pages/subPackages/intention/edit?id=${item.id}&groupDiscName=${item.groupDiscName}&buyerName=${item.buyerName}&roomSelectionDate=${item.roomSelectionDate}&batchNumber=${item.batchNumber}&roomSelectionNumber=${item.roomSelectionNumber}`
  355. );
  356. uni.navigateTo({
  357. url: `/pages/subPackages/intention/add?id=${item.id}&groupDiscName=${item.groupDiscName}&buyerName=${item.buyerName}&roomSelectionDate=${item.roomSelectionDate}&batchNumber=${item.batchNumber}&roomSelectionNumber=${item.roomSelectionNumber}`,
  358. });
  359. },
  360. toChoose(item) {
  361. uni.navigateTo({
  362. url: `/pages/subPackages/chooseHouse/selectedHouseList?id=${item.id}&groupDiscName=${item.groupDiscName}&buyerName=${item.buyerName}&roomSelectionDate=${item.roomSelectionDate}&batchNumber=${item.batchNumber}&roomSelectionNumber=${item.roomSelectionNumber}`,
  363. });
  364. },
  365. },
  366. };
  367. </script>
  368. <style lang="scss">
  369. .maintenance {
  370. padding-bottom: 150rpx;
  371. .topSearchBox {
  372. background: white;
  373. padding: 16rpx 32rpx;
  374. .van-cell {
  375. background: rgba(245, 247, 250, 1);
  376. width: 686rpx;
  377. border: 1px solid rgba(234, 237, 242, 1);
  378. border-radius: 8rpx;
  379. box-sizing: border-box;
  380. padding: 12rpx 32rpx;
  381. }
  382. .van-icon {
  383. color: rgba(3, 101, 249, 1);
  384. font-size: 40rpx;
  385. }
  386. }
  387. .selectBody {
  388. background: white;
  389. display: flex;
  390. flex-direction: column;
  391. margin: 24rpx 0;
  392. padding: 12rpx 32rpx 36rpx 32rpx;
  393. box-sizing: border-box;
  394. overflow: hidden;
  395. position: relative;
  396. .selectRow {
  397. display: flex;
  398. align-items: center;
  399. margin-top: 18rpx;
  400. .rowTitle {
  401. min-width: 120rpx;
  402. color: rgba(51, 51, 51, 1);
  403. font-size: 30rpx;
  404. text-align: right;
  405. }
  406. .selectItemBox {
  407. display: flex;
  408. align-items: center;
  409. margin-left: 24rpx;
  410. white-space: nowrap;
  411. flex-wrap: wrap;
  412. .unSelectItem {
  413. display: flex;
  414. align-items: center;
  415. justify-content: center;
  416. font-size: 28rpx;
  417. color: rgba(102, 102, 102, 1);
  418. padding: 8rpx 18rpx;
  419. background: rgba(245, 247, 250, 1);
  420. border-radius: 8rpx;
  421. margin-right: 24rpx;
  422. margin-top: 5rpx;
  423. }
  424. .selectItem {
  425. display: flex;
  426. align-items: center;
  427. justify-content: center;
  428. font-size: 28rpx;
  429. color: rgba(3, 101, 249, 1);
  430. padding: 8rpx 18rpx;
  431. background: rgba(3, 101, 249, 0.1);
  432. border-radius: 8rpx;
  433. margin-right: 24rpx;
  434. }
  435. .van-checkbox-group {
  436. display: flex;
  437. flex-wrap: wrap;
  438. .van-checkbox {
  439. margin-right: 24rpx;
  440. }
  441. .van-checkbox__label {
  442. padding-left: 6rpx;
  443. font-size: 28rpx;
  444. color: rgba(102, 102, 102, 1);
  445. }
  446. .van-checkbox__icon {
  447. width: 30rpx;
  448. height: 30rpx;
  449. }
  450. .van-icon,
  451. .van-icon:before {
  452. font-size: 24rpx;
  453. }
  454. .van-checkbox__icon--checked {
  455. background: rgba(3, 101, 249, 1);
  456. }
  457. }
  458. .myIpt {
  459. width: 540rpx;
  460. height: 64rpx;
  461. text-align: center;
  462. background: rgba(245, 247, 250, 1);
  463. box-sizing: border-box;
  464. font-size: 26rpx;
  465. }
  466. }
  467. .fenqiBox {
  468. overflow-x: scroll;
  469. }
  470. .selectItemBoxMoreItem {
  471. .van-checkbox {
  472. margin: 0 24rpx 24rpx 0;
  473. }
  474. }
  475. }
  476. .btnBox {
  477. display: flex;
  478. align-items: center;
  479. justify-content: center;
  480. margin-top: 48rpx;
  481. .czBtn {
  482. background: rgba(3, 101, 249, 0.1);
  483. border-radius: 8rpx;
  484. width: 240rpx;
  485. height: 80rpx;
  486. display: flex;
  487. align-items: center;
  488. justify-content: center;
  489. color: rgba(3, 101, 249, 1);
  490. font-size: 34rpx;
  491. letter-spacing: 2rpx;
  492. }
  493. .ssBtn {
  494. background: rgba(3, 101, 249, 1);
  495. border-radius: 8rpx;
  496. width: 300rpx;
  497. height: 80rpx;
  498. display: flex;
  499. align-items: center;
  500. justify-content: center;
  501. color: white;
  502. font-size: 34rpx;
  503. letter-spacing: 2rpx;
  504. margin-left: 32rpx;
  505. }
  506. }
  507. .arrowDown {
  508. position: absolute;
  509. left: 50%;
  510. margin-left: -20rpx;
  511. top: 50rpx;
  512. }
  513. }
  514. .bottomBody {
  515. padding: 32rpx;
  516. background: white;
  517. width: 100%;
  518. box-sizing: border-box;
  519. .sumBox {
  520. color: rgba(51, 51, 51, 1);
  521. font-size: 28rpx;
  522. margin: 24rpx 0;
  523. }
  524. .listBody {
  525. display: flex;
  526. flex-direction: column;
  527. :last-child {
  528. border-bottom: none !important;
  529. }
  530. .listItem {
  531. padding: 24rpx 0;
  532. border-bottom: 1px solid rgba(230, 230, 230, 1);
  533. .firstRow {
  534. display: flex;
  535. align-items: center;
  536. justify-content: space-between;
  537. .itemTitle {
  538. font-size: 32rpx;
  539. color: rgba(51, 51, 51, 1);
  540. font-weight: 600;
  541. }
  542. .tag {
  543. padding: 12rpx 24rpx;
  544. display: flex;
  545. align-items: center;
  546. justify-content: center;
  547. font-size: 26rpx;
  548. color: rgba(3, 101, 249, 1);
  549. background: linear-gradient(316deg, #d1e4ff 0%, #adceff 100%);
  550. border-radius: 8rpx;
  551. }
  552. }
  553. .midRow {
  554. display: flex;
  555. align-items: center;
  556. color: rgba(136, 136, 136, 1);
  557. font-size: 28rpx;
  558. margin: 12rpx 0;
  559. }
  560. .bottomRow {
  561. display: flex;
  562. align-items: center;
  563. color: rgba(51, 51, 51, 1);
  564. font-size: 28rpx;
  565. margin-top: 8rpx;
  566. .money {
  567. color: rgba(226, 81, 0, 1);
  568. font-size: 40rpx;
  569. }
  570. }
  571. }
  572. }
  573. }
  574. }
  575. </style>