maintenance.vue 19 KB

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