index.vue 17 KB

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