list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. <template>
  2. <view class="list_s">
  3. <view class="header_s">
  4. <u-popup v-model="show" mode="top">
  5. <scroll-view scroll-y="true" style="height: 100vh; text-align: center" class="popup">
  6. <view>
  7. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('district')">
  8. {{districtName ? districtName :'选择行政区'}}
  9. </view>
  10. </view>
  11. <view>
  12. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('xiaoqu')">
  13. {{house ? house : '选择小区'}}
  14. </view>
  15. </view>
  16. <view>
  17. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('louyu')">
  18. {{bulid ? bulid : '选择楼宇'}}
  19. </view>
  20. </view>
  21. <view>
  22. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('danyuan')">
  23. {{unit ? unit : '选择单元'}}
  24. </view>
  25. </view>
  26. <view>
  27. <view class="font-fifty-six SourceHanSansCN choose" @click="openHouse('menpai')">
  28. {{houseNumber ? houseNumber : '选择门牌'}}
  29. </view>
  30. </view>
  31. <view>
  32. <view class="font-fifty-six SourceHanSansCN choose" @click="showStart = true">
  33. {{form.starTime ? form.starTime : '开始时间'}}
  34. <u-picker v-model="showStart" mode="time" @confirm="confirmStart"></u-picker>
  35. </view>
  36. </view>
  37. <view>
  38. <view class="font-fifty-six SourceHanSansCN choose" @click="showEnd = true">
  39. {{form.endTime ? form.endTime : '结束时间'}}
  40. <u-picker v-model="showEnd" mode="time" @confirm="confirmEnd"></u-picker>
  41. </view>
  42. </view>
  43. <view>
  44. <!-- <view class="font-fifty-six SourceHanSansCN choose" @click="openType('shows')">
  45. 上门类型 <text class="font-fifty-six SourceHanSansCN" style="color: #232146;">
  46. {{type ? '----' + type : ''}}</text>
  47. <u-select v-model="shows" :list="mounicipalList" @confirm="confirm"></u-select>
  48. </view> -->
  49. <view style="display: flex;">
  50. <view style="height: 100rpx; font-size: 64rpx; width: 180rpx; font-weight: 600;">工号
  51. </view>
  52. <u-input style="font-size: 64rpx!important; font-weight: 600; width: 400rpx!important;"
  53. placeholder="请输入工号" placeholder-style="font-size: 64rpx;" v-model="form.jobNum"
  54. maxlength='4' :type='numberType' :border="border" />
  55. </view>
  56. <view class="font-fifty-six SourceHanSansCN total background-color1" @click="submit()">
  57. 提交数据
  58. </view>
  59. </view>
  60. </scroll-view>
  61. </u-popup>
  62. <view style="display: flex;">
  63. <view class="btn_s" @click="show = true">查询</view>
  64. <view class="btn_s" @click="kong">重置</view>
  65. </view>
  66. </view>
  67. <view class="footer_s" v-if="list.length > 0">
  68. <view class="footer-item" v-for="(item, index) in list">
  69. <view class="item-title">地址: {{item.house}}</view>
  70. <view class="item-title">职工: {{item.userName}}</view>
  71. <view class="item-title">时间: {{item.time}}</view>
  72. <view class="item-title">备注:
  73. <text class="" v-if="item.remark != null">
  74. {{item.remark}}
  75. </text>
  76. <text class="" v-else>
  77. </text>
  78. </view>
  79. <view class="item-img">
  80. <view class="img-view" v-for="img in item.picUrl">
  81. <image :src="img" mode="" @tap="preAvatar(img)"
  82. v-if="img.substring(img.length - 3) == 'png' || img.substring(img.length - 3) == 'jpg' ">
  83. </image>
  84. <video :src="img" controls v-else></video>
  85. </view>
  86. <!-- <image v-for="img in item.picUrl" :src="img" @tap="preAvatar(img)"></image> -->
  87. </view>
  88. <view class="main-list-icon"></view>
  89. </view>
  90. </view>
  91. <view class="footer_s" style="padding-top: 100rpx;" v-else>
  92. <u-empty text="暂无数据" mode="list"></u-empty>
  93. </view>
  94. <u-popup v-model="pop" mode="top">
  95. <view style="margin: 20rpx;">
  96. <u-search v-show="inputShow" placeholder="请输入搜索内容" v-model="keyword"
  97. :action-style="{'font-size':'40rpx'}" @custom="searchinfo(selectType)">
  98. </u-search>
  99. </view>
  100. <view>
  101. <scroll-view scroll-y="true" style="height: 600rpx; text-align: center;">
  102. <view v-for="(item,index) in chooseHouseList" :key="item.value">
  103. <view :class="current === index ? 'active' : '' "
  104. style="color: #000000;font-size: 56rpx;" @click="active(item,index)">
  105. {{item.label}}
  106. </view>
  107. </view>
  108. </scroll-view>
  109. <view class="">
  110. <button type="default" class="font-fifty-six"
  111. @click="search(selectType)">确定</button>
  112. </view>
  113. <view class="">
  114. <button type="default" @click="pop = false;"
  115. class="font-fifty-six">取消</button>
  116. </view>
  117. </view>
  118. </u-popup>
  119. </view>
  120. </template>
  121. <script>
  122. import service from '@/api/index.js'
  123. export default {
  124. data() {
  125. return {
  126. id: 0,
  127. numberType: 'number',
  128. name: '',
  129. address: '',
  130. keyword: '',
  131. selectType: '',
  132. inputShow: false,
  133. pop: false,
  134. show: false,
  135. border: false,
  136. typeValue: '',
  137. current: -1,
  138. labelPosition: 'left',
  139. errorType: ['message'],
  140. list: [],
  141. chooseHouseList: [],
  142. typeList: [],
  143. showStart: false,
  144. showEnd: false,
  145. form: {
  146. starTime: '',
  147. endTime: '',
  148. jobNum: '',
  149. },
  150. params: {
  151. pageNum: 1,
  152. pageSize: 10,
  153. },
  154. listTypeShow: false,
  155. tubeTypeShow: false,
  156. tubeLongShow: false,
  157. districtId: 0,
  158. districtName: '选择行政区',
  159. house: '选择小区',
  160. bulid: '选择楼宇',
  161. unit: '选择单元',
  162. houseNumber: '选择门牌',
  163. shows: false,
  164. // mounicipalList: [],
  165. tubeTypeLongList: [],
  166. tubeTypeList: [],
  167. houseid: '',
  168. type: '',
  169. buildid: '',
  170. unitid: '',
  171. numberid: '',
  172. }
  173. },
  174. onLoad(e) {
  175. this.id = e.id;
  176. this.name = e.name;
  177. this.address = e.address
  178. this.getListFn();
  179. // this.getArea();
  180. // this.select();
  181. this.getProjectType();
  182. this.getTubeType();
  183. this.getTubeLong();
  184. },
  185. onReachBottom() {
  186. this.getNextListFn()
  187. },
  188. onPullDownRefresh() {
  189. this.getListFn();
  190. setTimeout(function() {
  191. uni.stopPullDownRefresh();
  192. }, 1000);
  193. },
  194. methods: {
  195. kong() {
  196. this.houseid = '';
  197. this.buildid = '';
  198. this.unitid = '';
  199. this.numberid = '';
  200. this.form.starTime = '';
  201. this.form.endTime = '';
  202. this.form.jobNum = '';
  203. this.getListFn();
  204. },
  205. confirmStart(e) {
  206. console.log(e)
  207. this.form.starTime = `${e.year}-${e.month}-${e.day}`
  208. },
  209. confirmEnd(e) {
  210. console.log(e)
  211. this.form.endTime = `${e.year}-${e.month}-${e.day}`
  212. },
  213. openUnit() {
  214. this.unitShow = !this.unitShow
  215. },
  216. //选择门牌
  217. open() {
  218. this.houseNumberShow = !this.houseNumberShow
  219. },
  220. //选择上门类型
  221. confirm(e) {
  222. this.type = e[0].label
  223. this.typeValue = e[0].value
  224. this.imgArr = [];
  225. this.tubeType = null;
  226. this.tubeLong = null;
  227. this.valueType = null;
  228. },
  229. //选择类型
  230. // select() {
  231. // service.getDic({
  232. // dicType: 'service_type'
  233. // }).then(res => {
  234. // res.forEach(item => {
  235. // this.mounicipalList.push({
  236. // value: item.value,
  237. // label: item.name
  238. // })
  239. // })
  240. // })
  241. // },
  242. openType(type) {
  243. if (type === 'shows') {
  244. this.shows = !this.shows
  245. } else if (type === 'tubeType') {
  246. this.tubeTypeShow = !this.tubeTypeShow
  247. } else {
  248. this.tubeLongShow = !this.tubeLongShow
  249. }
  250. },
  251. tubeTypeConfirm(e) {
  252. this.tubeType = e[0].label
  253. },
  254. listType(e) {
  255. this.valueType = e[0].label
  256. },
  257. tubeLongConfirm(e) {
  258. this.tubeLong = e[0].label
  259. },
  260. getTubeType() {
  261. service.getPipeType().then(res => {
  262. res.forEach(item => {
  263. this.tubeTypeList.push({
  264. value: item.id,
  265. label: item.pipeType
  266. })
  267. })
  268. })
  269. },
  270. getTubeLong() {
  271. service.getPipeLength().then(res => {
  272. res.forEach(item => {
  273. this.tubeTypeLongList.push({
  274. value: item.id,
  275. label: item.pipeLength
  276. })
  277. })
  278. })
  279. },
  280. getProjectType() {
  281. service.getProject().then(res => {
  282. console.log('getProjectType', res)
  283. this.typeList = [];
  284. res.forEach(item => {
  285. this.typeList.push({
  286. value: item.id,
  287. label: item.valveType
  288. })
  289. })
  290. })
  291. },
  292. projectType() {
  293. this.listTypeShow = !this.listTypeShow
  294. },
  295. search(selectType) {
  296. // console.log('this.housename', this.housename)
  297. // console.log('this.selectType', this.selectType)
  298. if (selectType == 'district') {
  299. this.districtName = this.housename;
  300. service.getArea({
  301. district: this.districtId
  302. }).then(res => {
  303. this.chooseHouseList = [];
  304. res.forEach(item => {
  305. this.chooseHouseList.push({
  306. value: item.dictValue,
  307. label: item.dictLabel,
  308. selectType: 'xiaoqu'
  309. })
  310. })
  311. })
  312. this.current = -1;
  313. this.house = null;
  314. this.bulid = null;
  315. this.unit = null;
  316. this.houseNumber = null;
  317. this.houseid = 0;
  318. this.buildid = 0;
  319. this.unitid = 0;
  320. this.housedata = 0;
  321. } else if (selectType == 'xiaoqu') {
  322. this.house = this.housename;
  323. service.getBuilding({
  324. areaId: this.houseid
  325. }).then(res => {
  326. this.chooseHouseList = [];
  327. res.forEach(item => {
  328. this.chooseHouseList.push({
  329. value: item.id,
  330. label: item.name,
  331. selectType: 'louyu'
  332. })
  333. })
  334. })
  335. this.current = -1;
  336. this.bulid = null;
  337. this.unit = null;
  338. this.houseNumber = null;
  339. this.buildid = 0;
  340. this.unitid = 0;
  341. this.housedata = 0;
  342. } else if (selectType == 'louyu') {
  343. this.bulid = this.housename;
  344. service.getUnit({
  345. buildingId: this.buildid
  346. }).then(res => {
  347. this.chooseHouseList = [];
  348. res.forEach(item => {
  349. this.chooseHouseList.push({
  350. value: item.id,
  351. label: item.name,
  352. selectType: 'danyuan'
  353. })
  354. })
  355. })
  356. this.unit = null;
  357. this.houseNumber = null;
  358. this.current = -1;
  359. this.unitid = 0;
  360. this.housedata = 0;
  361. } else if (selectType == 'danyuan') {
  362. this.unit = this.housename;
  363. service.getAllHouse({
  364. unitId: this.unitid
  365. }).then(res => {
  366. this.chooseHouseList = [];
  367. res.forEach(item => {
  368. this.chooseHouseList.push({
  369. value: item.id,
  370. label: item.name,
  371. selectType: 'menpai'
  372. })
  373. })
  374. })
  375. this.houseNumber = null;
  376. this.current = -1;
  377. this.housedata = 0;
  378. } else if (selectType == 'menpai') {
  379. this.houseNumber = this.housename;
  380. this.housedata = this.numberid;
  381. this.current = -1;
  382. }
  383. this.pop = false;
  384. },
  385. openHouse(selectType) {
  386. if (selectType === 'district') {
  387. this.inputShow = false
  388. //选择行政区
  389. this.housename = null;
  390. this.selectType = 'district'
  391. service.getDistrict().then(res => {
  392. // console.log(res);
  393. this.chooseHouseList = [];
  394. res.forEach((item, index) => {
  395. this.chooseHouseList.push({
  396. value: item.dictValue,
  397. label: item.dictLabel,
  398. selectType: 'district'
  399. })
  400. })
  401. })
  402. } else if (selectType === 'xiaoqu') {
  403. this.inputShow = false
  404. //选择小区
  405. this.selectType = 'xiaoqu';
  406. service.getArea({
  407. district: this.districtId
  408. }).then(res => {
  409. this.chooseHouseList = [];
  410. res.forEach((item, index) => {
  411. this.chooseHouseList.push({
  412. value: item.id,
  413. label: item.name,
  414. selectType: 'xiaoqu'
  415. })
  416. })
  417. })
  418. } else if (selectType === 'louyu') {
  419. this.inputShow = false
  420. //选择楼宇
  421. this.selectType = 'louyu'
  422. service.getBuilding({
  423. areaId: this.houseid
  424. }).then(res => {
  425. this.chooseHouseList = [];
  426. res.forEach(item => {
  427. this.chooseHouseList.push({
  428. value: item.id,
  429. label: item.name,
  430. selectType: 'louyu'
  431. })
  432. })
  433. })
  434. } else if (selectType === 'danyuan') {
  435. this.inputShow = false
  436. //选择单元
  437. this.selectType = 'danyuan'
  438. service.getUnit({
  439. buildingId: this.buildid
  440. }).then(res => {
  441. this.chooseHouseList = [];
  442. res.forEach(item => {
  443. this.chooseHouseList.push({
  444. value: item.id,
  445. label: item.name,
  446. selectType: 'danyuan'
  447. })
  448. })
  449. })
  450. } else if (selectType === 'menpai') {
  451. this.inputShow = false
  452. //选择门牌
  453. this.selectType = 'menpai'
  454. service.getAllHouse({
  455. unitId: this.unitid
  456. }).then(res => {
  457. this.chooseHouseList = [];
  458. res.forEach(item => {
  459. this.chooseHouseList.push({
  460. value: item.id,
  461. label: item.name,
  462. selectType: 'menpai'
  463. })
  464. })
  465. })
  466. }
  467. this.pop = !this.pop;
  468. },
  469. searchinfo(selectType) {
  470. if (selectType == 'xiaoqu') {
  471. console.log('ssss', this.selectType)
  472. service.getArea({
  473. name: this.keyword
  474. }).then(res => {
  475. this.chooseHouseList = [];
  476. res.forEach((item, index) => {
  477. this.chooseHouseList.push({
  478. value: item.id,
  479. label: item.name,
  480. selectType: 'xiaoqu'
  481. })
  482. })
  483. })
  484. this.keyword = '';
  485. } else if (selectType == 'louyu') {
  486. console.log('ssss', this.selectType)
  487. service.getBuilding({
  488. areaId: this.houseid,
  489. name: this.keyword
  490. }).then(res => {
  491. this.chooseHouseList = [];
  492. res.forEach((item, index) => {
  493. this.chooseHouseList.push({
  494. value: item.id,
  495. label: item.name,
  496. selectType: 'louyu'
  497. })
  498. })
  499. })
  500. this.keyword = '';
  501. } else if (selectType == 'danyuan') {
  502. console.log('ssss', this.selectType)
  503. service.getUnit({
  504. buildingId: this.buildid,
  505. name: this.keyword
  506. }).then(res => {
  507. this.chooseHouseList = [];
  508. res.forEach((item, index) => {
  509. this.chooseHouseList.push({
  510. value: item.id,
  511. label: item.name,
  512. selectType: 'danyuan'
  513. })
  514. })
  515. })
  516. this.keyword = '';
  517. } else if (selectType == 'menpai') {
  518. console.log('ssss', this.selectType)
  519. service.getAllHouse({
  520. unitId: this.unitid,
  521. name: this.keyword
  522. }).then(res => {
  523. this.chooseHouseList = [];
  524. res.forEach((item, index) => {
  525. this.chooseHouseList.push({
  526. value: item.id,
  527. label: item.name,
  528. selectType: 'menpai'
  529. })
  530. })
  531. })
  532. this.keyword = '';
  533. }
  534. },
  535. active(item, index) {
  536. this.current = index;
  537. this.housename = item.label;
  538. if (item.selectType == 'district') { //行政区
  539. this.districtId = item.value;
  540. } else if (item.selectType == 'xiaoqu') {
  541. this.houseid = item.value;
  542. } else if (item.selectType == 'louyu') {
  543. this.buildid = item.value;
  544. } else if (item.selectType == 'danyuan') {
  545. this.unitid = item.value;
  546. } else if (item.selectType == 'menpai') {
  547. this.numberid = item.value
  548. }
  549. this.selectType = item.selectType;
  550. },
  551. // //获取小区
  552. // getArea() {
  553. // service.getArea().then(res => {
  554. // this.chooseHouseList = [];
  555. // res.forEach((item, index) => {
  556. // this.chooseHouseList.push({
  557. // value: item.id,
  558. // label: item.name,
  559. // selectType:'xiaoqu'
  560. // })
  561. // })
  562. // })
  563. // },
  564. getListFn() {
  565. let that = this;
  566. let params = {
  567. areaId: this.houseid,
  568. buildingId: this.buildid,
  569. unitId: this.unitid,
  570. houseId: this.numberid,
  571. starTime: this.form.starTime,
  572. endTime: this.form.endTime,
  573. jobNum: this.form.jobNum,
  574. pageSize: 10,
  575. pageNum: 1,
  576. serviceType: this.id
  577. }
  578. console.log('params', params)
  579. service.getOtherList(params).then(res => {
  580. console.log("999", res)
  581. that.list = res.records;
  582. that.total = res.total || 0;
  583. that.params.pageNum = res.current + 1;
  584. })
  585. },
  586. getNextListFn() {
  587. let that = this;
  588. let params = {
  589. areaId: this.houseid,
  590. buildingId: this.buildid,
  591. unitId: this.unitid,
  592. houseId: this.numberid,
  593. starTime: this.form.starTime,
  594. endTime: this.form.endTime,
  595. jobNum: this.form.jobNum,
  596. pageSize: this.params.pageSize,
  597. pageNum: this.params.pageNum,
  598. serviceType: this.id
  599. }
  600. if (this.list.length < this.total) {
  601. service.getOtherList(params).then(response => {
  602. that.params.pageNum = response.current + 1
  603. response.records.forEach(item => {
  604. that.list.push(item)
  605. })
  606. })
  607. }
  608. },
  609. // 预览图片
  610. preAvatar(url) {
  611. console.log('url', url)
  612. wx.previewImage({
  613. current: url, // 当前显示图片的 http 链接
  614. urls: [url], // 需要预览的图片 http 链接列表
  615. })
  616. },
  617. submit() {
  618. console.log('submit', this.houseid, this.buildid, this.unitid, this.numberid);
  619. this.show = false;
  620. this.getListFn()
  621. }
  622. }
  623. }
  624. </script>
  625. <style lang="scss" scoped>
  626. /deep/ .u-input__input {
  627. font-size: 64rpx !important;
  628. color: #303133;
  629. width: calc(100% - 200rpx) !important;
  630. }
  631. /deep/ .u-column-item {
  632. display: flex;
  633. flex-direction: row;
  634. align-items: center;
  635. justify-content: center;
  636. font-size: 64rpx !important;
  637. color: #303133;
  638. padding: 8rpx;
  639. }
  640. /deep/ .u-btn-picker.data-v-70102400 {
  641. padding: 16rpx;
  642. box-sizing: border-box;
  643. text-align: center;
  644. text-decoration: none;
  645. font-size: 64rpx !important;
  646. }
  647. .list_s {
  648. min-height: 100vh;
  649. background-color: #F9F9F9;
  650. }
  651. .header_s {
  652. padding: 30rpx 30rpx 0rpx 30rpx;
  653. .popup {
  654. // padding: 0rpx 30rpx;
  655. }
  656. .btn_s {
  657. margin: 0 15rpx;
  658. width: calc(50% - 15px);
  659. height: 100rpx;
  660. line-height: 100rpx;
  661. text-align: center;
  662. background-color: #3857F3;
  663. color: #fff;
  664. font-size: 64rpx;
  665. border-radius: 16rpx;
  666. }
  667. }
  668. .footer_s {
  669. padding: 30rpx;
  670. .footer-item {
  671. background: #FFFFFF;
  672. height: auto;
  673. border-radius: 8rpx;
  674. margin-bottom: 30rpx;
  675. padding: 20rpx 0rpx 20rpx 66rpx;
  676. position: relative;
  677. .item-title {
  678. font-size: 48rpx;
  679. font-family: PingFangSC-Medium, PingFang SC;
  680. font-weight: 500;
  681. color: #333333;
  682. padding-bottom: 20rpx;
  683. }
  684. .main-list-icon {
  685. position: absolute;
  686. top: 43rpx;
  687. left: 30rpx;
  688. width: 16rpx;
  689. height: 16rpx;
  690. background: #3857F3;
  691. border-radius: 2rpx;
  692. }
  693. .item-img {
  694. display: flex;
  695. justify-content: flex-start;
  696. flex-wrap: wrap;
  697. .img-view {
  698. width: calc(50% - 20rpx);
  699. height: 200rpx;
  700. padding-bottom: 20rpx;
  701. padding-right: 20rpx;
  702. image {
  703. width: 100%;
  704. height: 100%;
  705. }
  706. video {
  707. width: 100%;
  708. height: 100%;
  709. }
  710. }
  711. }
  712. }
  713. }
  714. .choose {
  715. text-align: center;
  716. padding: 20rpx;
  717. margin: 30rpx;
  718. color: #FFFFFF;
  719. background: #43CEB1;
  720. border-radius: 64rpx;
  721. }
  722. .active {
  723. background-color: #1890FF;
  724. }
  725. .select-type {
  726. border: 2rpx solid #3857F3;
  727. text-align: center;
  728. padding: 20rpx;
  729. margin: 30rpx;
  730. color: #3857F3;
  731. border-radius: 64rpx;
  732. }
  733. .total {
  734. width: 100%;
  735. padding: 40rpx 30rpx;
  736. text-align: center;
  737. color: #FFFFFF;
  738. }
  739. </style>