index.vue 16 KB

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