chartList.vue 16 KB

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