index.vue 16 KB

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