Compare commits
	
		
			51 Commits
		
	
	
		
			721937fa5b
			...
			dev
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| fe590353df | |||
| 2535720023 | |||
| 5e2b2dcfda | |||
| 612dd4eac1 | |||
| 87bb23a9a4 | |||
| a2f92a0959 | |||
| e64318f174 | |||
| 195a6d7c48 | |||
| 76746682fa | |||
| ad4d9323ad | |||
| d4f357d624 | |||
| 9b00bb3561 | |||
| d77af4b78f | |||
| 345a362c74 | |||
| aea85af0f9 | |||
| b61f3287fb | |||
| 49aeeb05a7 | |||
| 95e6937d06 | |||
| 4308096394 | |||
| 17c992fb0b | |||
| 493be62f44 | |||
| af749eb638 | |||
| 3340f1f3af | |||
| cdbc3fa959 | |||
| b1cca8f8a5 | |||
| 70737fa2b8 | |||
| 71ad4995c8 | |||
| 3e640c3633 | |||
| a8312b89d5 | |||
| f0dee5bc77 | |||
| 7bc344e90b | |||
| 5f56f9a6a8 | |||
| 886a03cf16 | |||
| fccaee5f2b | |||
| 33d7528990 | |||
| f9aedf7d79 | |||
| ac0a4b02c7 | |||
| 7bd4da3c84 | |||
| a36faa9bcb | |||
| 7772b3de1a | |||
| 10a0fd7c19 | |||
| d27fa31ac7 | |||
| a3c4e78c22 | |||
| 5c202e99a6 | |||
| e637bbf8a8 | |||
| 4d665588ac | |||
| 028d695deb | |||
| 3e9857bdcd | |||
| 34995ef9a3 | |||
| fb9e727efd | |||
| 399ef43d07 | 
							
								
								
									
										12
									
								
								app.json
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								app.json
									
									
									
									
									
								
							| @@ -23,16 +23,26 @@ | ||||
|     "pages/encyclopedia/index", | ||||
|     "pages/encyclopediaDetail/index", | ||||
|     "pages/workBench/index", | ||||
|     "pages/workBenchNew/index", | ||||
|     "pages/webPage/index", | ||||
|     "pages/aid/finance/index", | ||||
|     "pages/aid/law/index", | ||||
|     "pages/aid/detail/index", | ||||
|     "pages/aid/consult/index", | ||||
|     "pages/writeReading/index", | ||||
|     "pages/readingHistory/index", | ||||
|     "pages/integral/index", | ||||
|     "pages/discountCoupon/index", | ||||
|     "pages/integralRecord/index", | ||||
|     "pages/meterList/index", | ||||
|     "pages/workBench/components/tenement/components/createTenement/index" | ||||
|     "pages/workBench/components/tenement/components/createTenement/index", | ||||
|     "pages/billMeterDetail/index", | ||||
|     "pages/meterBalanceRecord/index", | ||||
|     "pages/workBenchNew/components/workBenchMeter/index", | ||||
|     "pages/workBenchNew/components/workBenchTenement/index", | ||||
|     "pages/workBenchNew/components/workBenchApprove/index", | ||||
|     "pages/workBenchNew/components/workBenchWxUser/index", | ||||
|     "pages/workBenchNew/components/workBenchReading/index" | ||||
|   ], | ||||
|   "subPackages": [ | ||||
|     { | ||||
|   | ||||
| @@ -1,9 +1,12 @@ | ||||
| import { getReportDetail } from "../../../service/report"; | ||||
| import { alertInfo, alertSuccess, getPixelRatio } from "../../../utils/index"; | ||||
| import { alertInfo, alertSuccess, getPixelRatio, loadingFunc } from "../../../utils/index"; | ||||
| import request from '../../../utils/request' | ||||
| import * as echarts from '../../components/echarts/echarts'; | ||||
| import { getRoundNumber } from "../../../utils/index" | ||||
| const { OK } = request | ||||
|  | ||||
|  | ||||
|  | ||||
| // pages/billDetail/index.js | ||||
| Page({ | ||||
|  | ||||
| @@ -15,31 +18,34 @@ Page({ | ||||
|     time: "", | ||||
|     detail: {}, | ||||
|     meters: [], | ||||
|     header1: [ | ||||
|       { key: 'address', title: '电表地址' }, | ||||
|       { title: '起码',renderBody: (item) => { return item?.startNumber } }, | ||||
|       { title: '止码',renderBody: (item) => { return item?.endNumber } }, | ||||
|       { title: '倍率',renderBody: (item) => { return item?.displayRatio } }, | ||||
|     ], | ||||
|     header2: [ | ||||
|       { title: '用电量', renderBody: (item) => item?.overall?.amount }, | ||||
|       { title: '线损电量',renderBody: (item) => item?.loss?.amount }, | ||||
|       { title: '公摊电量',renderBody: (item) => item?.publicAmount }, | ||||
|       { title: '合计电量',renderBody: (item) => {  | ||||
|     // header1: [ | ||||
|     //   { key: 'address', title: '电表地址' }, | ||||
|     //   { title: '起码',renderBody: (item) => { return item?.startNumber } }, | ||||
|     //   { title: '止码',renderBody: (item) => { return item?.endNumber } }, | ||||
|     //   { title: '倍率',renderBody: (item) => { return item?.displayRatio } }, | ||||
|     // ], | ||||
|     // header2: [ | ||||
|     //   { title: '用电量', renderBody: (item) => item?.overall?.amount }, | ||||
|     //   { title: '线损电量',renderBody: (item) => item?.loss?.amount }, | ||||
|     //   { title: '公摊电量',renderBody: (item) => item?.publicAmount }, | ||||
|     //   { title: '合计电量',renderBody: (item) => {  | ||||
|          | ||||
|       } }, | ||||
|     ] | ||||
|     //   } }, | ||||
|     // ] | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|     const { id, time } = options; | ||||
|     this.init(id, time); | ||||
|     const { id, time, tenement } = options; | ||||
|     const that = this; | ||||
|     loadingFunc(async () => { | ||||
|       await that.init(id, time, tenement); | ||||
|     }) | ||||
|   }, | ||||
|   async init(id, time) { | ||||
|     const { code, message, detail, amount } = await getReportDetail(id) | ||||
|   async init(id, time, tenement) { | ||||
|     const { code, message, detail, amount } = await getReportDetail(id, tenement) | ||||
|     if (code !== OK) { | ||||
|       alertInfo(message) | ||||
|       return; | ||||
| @@ -50,45 +56,92 @@ Page({ | ||||
|       detail,  | ||||
|       amount: amount, | ||||
|       meters: detail?.meters?.map(item => { | ||||
|         const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0) | ||||
|         item.finalAmount = Number(finalAmount).toFixed(2) | ||||
|         if (item?.loss?.amount) { | ||||
|           item.loss.amount = getRoundNumber(Number(item.loss.amount)) | ||||
|         } | ||||
|         // const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0) | ||||
|         item.finalAmount = getRoundNumber(Number(item.finalAmount)) | ||||
|         return item; | ||||
|       }) | ||||
|     }) | ||||
|     const option = { | ||||
|       tooltip: { | ||||
|         trigger: 'item' | ||||
|       }, | ||||
|       legend: { | ||||
|         top: 10, | ||||
|         left: 'center' | ||||
|       }, | ||||
|       label: { | ||||
|         alignTo: 'edge', | ||||
|         formatter: '{name|{b}}\n{value|{c} }', | ||||
|         minMargin: 5, | ||||
|         edgeDistance: 10, | ||||
|         lineHeight: 15, | ||||
|         rich: { | ||||
|           time: { | ||||
|             fontSize: 10, | ||||
|             color: '#999' | ||||
|     if (detail?.park?.meter04kvType === 0) { | ||||
|       const option = { | ||||
|         tooltip: { | ||||
|           trigger: 'item' | ||||
|         }, | ||||
|         legend: { | ||||
|           top: 10, | ||||
|           left: 'center' | ||||
|         }, | ||||
|         label: { | ||||
|           alignTo: 'edge', | ||||
|           formatter: '{name|{b}}\n{value|{c} }', | ||||
|           minMargin: 5, | ||||
|           edgeDistance: 10, | ||||
|           lineHeight: 15, | ||||
|           rich: { | ||||
|             time: { | ||||
|               fontSize: 10, | ||||
|               color: '#999' | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|       }, | ||||
|       series: [ | ||||
|         { | ||||
|           type: 'pie', | ||||
|           radius: '50%', | ||||
|           data: [ | ||||
|             { value: detail.comprehensive.lossAmount, name: '本期线损电量', itemStyle: { color: 'rgb(104,187,196)' } }, | ||||
|             { value: detail.comprehensive.consumption, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } }, | ||||
|    | ||||
|           ], | ||||
|         } | ||||
|       ] | ||||
|     }; | ||||
|     this.init_pieCharts(option); | ||||
|         }, | ||||
|         series: [ | ||||
|           { | ||||
|             type: 'pie', | ||||
|             radius: '50%', | ||||
|             data: [ | ||||
|               { value: detail.comprehensive.lossAmount, name: '线损电量', itemStyle: { color: 'rgb(104,187,196)' } }, | ||||
|               { value: detail.comprehensive.consumption, name: '电度电量', itemStyle: { color: 'rgb(80,135,236)' } }, | ||||
|      | ||||
|             ], | ||||
|           } | ||||
|         ] | ||||
|       }; | ||||
|       this.init_pieCharts(option); | ||||
|     } else { | ||||
|       // const option = { | ||||
|       //   tooltip: { | ||||
|       //     trigger: 'item' | ||||
|       //   }, | ||||
|       //   legend: { | ||||
|       //     top: 10, | ||||
|       //     left: 'center' | ||||
|       //   }, | ||||
|       //   label: { | ||||
|       //     alignTo: 'edge', | ||||
|       //     formatter: '{name|{b}}\n{value|{c} }', | ||||
|       //     minMargin: 5, | ||||
|       //     edgeDistance: 10, | ||||
|       //     lineHeight: 15, | ||||
|       //     rich: { | ||||
|       //       time: { | ||||
|       //         fontSize: 10, | ||||
|       //         color: '#999' | ||||
|       //       } | ||||
|       //     } | ||||
|       //   }, | ||||
|       //   series: [ | ||||
|       //     { | ||||
|       //       type: 'pie', | ||||
|       //       radius: '50%', | ||||
|       //       data: [ | ||||
|       //         {  | ||||
|       //           value: detail.comprehensive.lossAmount,  | ||||
|       //           name: '线损电量',  | ||||
|       //         }, | ||||
|       //         {  | ||||
|       //           value: detail.comprehensive.consumption,  | ||||
|       //           name: '电度电量',  | ||||
|       //         }, | ||||
|      | ||||
|       //       ], | ||||
|       //     } | ||||
|       //   ] | ||||
|       // }; | ||||
|       // this.init_pieCharts(option); | ||||
|     } | ||||
|      | ||||
|     const that = this; | ||||
|     wx.getSystemInfo({ | ||||
|       success: function (res) { | ||||
| @@ -115,6 +168,12 @@ Page({ | ||||
|       return pieChart; | ||||
|     }); | ||||
|   }, | ||||
|   jumpToDetail(e) { | ||||
|     const { meter } = e.currentTarget.dataset; | ||||
|     wx.navigateTo({ | ||||
|       url: '/pages/billMeterDetail/index?data=' + JSON.stringify(meter), | ||||
|     }) | ||||
|   }, | ||||
|   download() { | ||||
|     const { id: tenement } = wx.getStorageSync('tenement') | ||||
|     const { id } = this.data; | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <!--pages/billDetail/index.wxml--> | ||||
| <navigator title="{{ time }}电费账单" canBack="{{true}}" /> | ||||
| <view class="title" style="top: {{statusBarHeight + 46}}px"> | ||||
|   <avatar text="{{detail.tenement.shortName}}"  /> | ||||
|   <avatar text="{{detail.tenement.shortName}}" /> | ||||
|   <view class="titleContent"> | ||||
|     <view class="park"> | ||||
|       <view class="label"> | ||||
| @@ -11,7 +11,7 @@ | ||||
|     </view> | ||||
|     <view class="address"> | ||||
|       <view class="label"> | ||||
|         用电地址: | ||||
|         商户地址: | ||||
|       </view> | ||||
|       <view class="value"> {{ detail.tenement.address }} </view> | ||||
|     </view> | ||||
| @@ -19,20 +19,20 @@ | ||||
|       <view class="label"> | ||||
|         账单周期: | ||||
|       </view> | ||||
|       <view class="value"> {{ detail.comprehensive.startDate }} 至 {{  detail.comprehensive.endDate }} </view> | ||||
|       <view class="value"> {{ detail.comprehensive.startDate }} 至 {{ detail.comprehensive.endDate }} </view> | ||||
|     </view> | ||||
|   </view> | ||||
|   <van-button type="info" size="small" class="download" bind:click="download">下载</van-button> | ||||
| </view> | ||||
|  | ||||
| <view class="wrapper"> | ||||
| <view class="wrapper" wx:if="{{detail.park.meter04kvType !== 1}}"> | ||||
|   <view class="line"></view> | ||||
|   <view class="contentTitle"> 本期账单 </view> | ||||
|   <van-row gutter="10"> | ||||
|     <van-col span="8"> | ||||
|       <view class="colContent"> | ||||
|         <view class="colContentTitle">本期用电量</view> | ||||
|         <view class="colContentValue"> {{ amount }} 千瓦时 </view> | ||||
|         <view class="colContentValue" wx:if="{{detail.park.meter04kvType === 0}}"> {{ amount }} 千瓦时 </view> | ||||
|       </view> | ||||
|     </van-col> | ||||
|     <van-col span="8"> | ||||
| @@ -50,17 +50,10 @@ | ||||
|   </van-row> | ||||
|   <view class="line"></view> | ||||
|   <view class="contentTitle"> 电费构成 </view> | ||||
|   <echarts  | ||||
|     style="width:200rpx;height:180rpx;"  | ||||
|     id="echarts"  | ||||
|     class='mychart-bar'  | ||||
|     canvas-id="mychart-bar"  | ||||
|     ec="{{ ec }}"     | ||||
|     forceUseOldCanvas="{{false}}" | ||||
|   > | ||||
|   <echarts style="width:200rpx;height:180rpx;" id="echarts" class='mychart-bar' canvas-id="mychart-bar" ec="{{ ec }}" forceUseOldCanvas="{{false}}"> | ||||
|   </echarts> | ||||
|   <view class="tooltip"> | ||||
|     (本月电量+本月线损电量)*电单价+摊薄公摊电费+摊薄调整电费 | ||||
|     (电度电量+线损电量)*电单价+摊薄公摊电费+摊薄调整电费 | ||||
|   </view> | ||||
|   <view class="line"></view> | ||||
|   <view class="contentTitle"> 电量明细 </view> | ||||
| @@ -86,7 +79,7 @@ | ||||
|       </van-row> | ||||
|       <van-row> | ||||
|         <van-col span="6"> | ||||
|           <view class="tableTitle"> 用电量 </view> | ||||
|           <view class="tableTitle"> 电度电量 </view> | ||||
|           <view class="tableContent"> {{item.overall.amount}} </view> | ||||
|  | ||||
|         </van-col> | ||||
| @@ -106,4 +99,97 @@ | ||||
|     </view> | ||||
|   </view> | ||||
| </view> | ||||
| <view class="wrapper" wx:if="{{detail.park.meter04kvType === 1}}"> | ||||
|   <view class="line"></view> | ||||
|   <view class="contentTitle"> 本期账单 </view> | ||||
|   <van-row gutter="10"> | ||||
|     <van-col span="12"> | ||||
|       <view class="colContent"> | ||||
|         <view class="colContentTitle">本期用电量</view> | ||||
|         <view class="colContentValue"> {{ detail.comprehensive.finalAmount }} 千瓦时 </view> | ||||
|       </view> | ||||
|     </van-col> | ||||
|     <van-col span="12"> | ||||
|       <view class="colContent"> | ||||
|         <view class="colContentTitle">本期电费</view> | ||||
|         <view class="colContentValue"> {{ detail.comprehensive.total }} 元 </view> | ||||
|       </view> | ||||
|     </van-col> | ||||
|   </van-row> | ||||
|   <view class="line"></view> | ||||
|   <view class="contentTitle"> 分时明细 </view> | ||||
|   <van-row gutter="10"> | ||||
|     <van-col span="12"> | ||||
|       <view class="colContent"> | ||||
|         <view class="colContentTitle"> | ||||
|           分时电量 | ||||
|           <view> (千瓦时) </view> | ||||
|         </view> | ||||
|         <view class="colContentValue2">尖: {{ detail.comprehensive.sharpAmount }} </view> | ||||
|         <view class="colContentValue2">峰: {{ detail.comprehensive.peakAmount }} </view> | ||||
|         <view class="colContentValue2">平: {{ detail.comprehensive.flatAmount }} </view> | ||||
|         <view class="colContentValue2">谷: {{ detail.comprehensive.valleyAmount }} </view> | ||||
|       </view> | ||||
|     </van-col> | ||||
|     <van-col span="12"> | ||||
|       <view class="colContent"> | ||||
|         <view class="colContentTitle"> | ||||
|           分时单价 | ||||
|           <view> (元/千瓦时) </view> | ||||
|         </view> | ||||
|         <view class="colContentValue2">尖: {{ detail.comprehensive.priceSharp }} </view> | ||||
|         <view class="colContentValue2">峰: {{ detail.comprehensive.pricePeak }} </view> | ||||
|         <view class="colContentValue2">平: {{ detail.comprehensive.priceFlat }} </view> | ||||
|         <view class="colContentValue2">谷: {{ detail.comprehensive.priceValley }} </view> | ||||
|       </view> | ||||
|     </van-col> | ||||
|   </van-row> | ||||
|   <view class="line"></view> | ||||
|   <view class="tooltip"> | ||||
|     (电度电量+线损电量)*单价+摊薄公摊电费+摊薄调整电费 | ||||
|   </view> | ||||
|   <view class="line"></view> | ||||
|   <view class="contentTitle"> 分时电量明细 </view> | ||||
|   <view class="tableWrapper"> | ||||
|     <view class="meterListItem" wx:for="{{meters}}" wx:key="id"> | ||||
|       <div class="top"> | ||||
|         <view class="address">{{item.address}}</view> | ||||
|         <view class="detail primaryTextBtn" bind:tap="jumpToDetail" data-meter="{{item}}"> 详情 </view> | ||||
|       </div> | ||||
|       <view style="margin: 20rpx 0; background-color: #fff;"> | ||||
|         <van-row custom-style="height: 100%;display: flex;flex-direction: column;overflow: hidden;"> | ||||
|           <van-col span="6"> | ||||
|             <view class="tableTitle"> 电度电量 </view> | ||||
|           </van-col> | ||||
|           <van-col span="6"> | ||||
|             <view class="tableTitle"> 线损电量 </view> | ||||
|           </van-col> | ||||
|           <van-col span="6"> | ||||
|             <view class="tableTitle"> 合计电量 </view> | ||||
|           </van-col> | ||||
|           <van-col span="6"> | ||||
|             <view class="tableTitle"> 合计电费 </view> | ||||
|           </van-col> | ||||
|         </van-row> | ||||
|         <van-row class="meterListItemContent"> | ||||
|           <van-col span="6"> | ||||
|             <view class="tableContent"> {{item.overall.amount}} </view> | ||||
|           </van-col> | ||||
|  | ||||
|           <van-col span="6"> | ||||
|             <view class="tableContent"> {{item.loss.amount}} </view> | ||||
|           </van-col> | ||||
|  | ||||
|           <van-col span="6"> | ||||
|             <view class="tableContent"> {{item.finalAmount}} </view> | ||||
|           </van-col> | ||||
|  | ||||
|           <van-col span="6"> | ||||
|             <view class="tableContent"> {{item.finalTotal}} </view> | ||||
|           </van-col> | ||||
|         </van-row> | ||||
|       </view> | ||||
|     </view> | ||||
|   </view> | ||||
| </view> | ||||
| <view style="height: 20rpx;"></view> | ||||
| @@ -59,12 +59,25 @@ page { | ||||
|   text-align: center; | ||||
|   font-weight: 500; | ||||
| } | ||||
|  | ||||
| .colContentTitle2 { | ||||
|   padding: 30rpx 0; | ||||
|   text-align: center; | ||||
|   font-weight: 500; | ||||
| } | ||||
|  | ||||
| .colContentValue { | ||||
|   padding-bottom: 30rpx; | ||||
|   text-align: center; | ||||
|   overflow: hidden; | ||||
| } | ||||
|  | ||||
| .colContentValue2 { | ||||
|   padding-bottom: 20rpx; | ||||
|   padding-left: 40rpx; | ||||
|   overflow: hidden; | ||||
| } | ||||
|  | ||||
| .tooltip { | ||||
|   font-size: 30rpx; | ||||
|   color: rgb(136, 132, 132); | ||||
| @@ -87,10 +100,37 @@ page { | ||||
|   background-color: #fff; | ||||
|   box-sizing: border-box; | ||||
|   flex: 1; | ||||
|   word-break: break-all; | ||||
| } | ||||
|  | ||||
| .download { | ||||
|   position: absolute; | ||||
|   top: 20rpx; | ||||
|   right: 20rpx; | ||||
| } | ||||
|  | ||||
| .meterListItem { | ||||
|   font-size: 32rpx; | ||||
| } | ||||
|  | ||||
| .meterListItem .top { | ||||
|   display: flex; | ||||
|   align-items: center; | ||||
| } | ||||
|  | ||||
| .meterListItem .address { | ||||
|   flex: 1; | ||||
| } | ||||
|  | ||||
|  | ||||
| /* .top .meterListItem:nth-child(even) .tableContent,  | ||||
| .bottom .meterListItem:nth-child(even) .tableContent, | ||||
| .top .meterListItem:nth-child(even), | ||||
| .bottom .meterListItem:nth-child(even) | ||||
| { | ||||
|  | ||||
| } */ | ||||
|  | ||||
| .meterListItemContent, .meterListItemContent .tableContent { | ||||
|   background-color: #fff; | ||||
| } | ||||
| @@ -1,24 +1,23 @@ | ||||
| // pages/electricQuery/components/accountingCard/index.js | ||||
| Component({ | ||||
|     /** | ||||
|      * 组件的属性列表 | ||||
|      */ | ||||
|     properties: { | ||||
|         data: Object | ||||
|     }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|     data: Object | ||||
|   }, | ||||
|     /** | ||||
|      * 组件的初始数据 | ||||
|      */ | ||||
|     data: { | ||||
|  | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     }, | ||||
|  | ||||
|   }, | ||||
|     /** | ||||
|      * 组件的方法列表 | ||||
|      */ | ||||
|     methods: { | ||||
|  | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|  | ||||
|   } | ||||
|     } | ||||
| }) | ||||
| @@ -1,33 +1,86 @@ | ||||
| <!--pages/electricQuery/components/accountingCard/index.wxml--> | ||||
| <view class="wrapper"> | ||||
|   <view class="title"> | ||||
|     {{data.meter.address}} | ||||
|   </view> | ||||
|   <van-row> | ||||
|     <van-col span="6"> | ||||
|       <view class="tableTitle"> 初始余额 </view> | ||||
|     </van-col> | ||||
|     <van-col span="7"> | ||||
|       <view class="tableTitle"> 储值累计金额 </view> | ||||
|     </van-col> | ||||
|     <van-col span="5"> | ||||
|       <view class="tableTitle"> 电费 </view> | ||||
|     </van-col> | ||||
|     <van-col span="6"> | ||||
|       <view class="tableTitle"> 账务余额 </view> | ||||
|     </van-col> | ||||
|     <van-col span="6"> | ||||
|       <view class="tableContent"> {{data.startMoney}}  </view> | ||||
|     </van-col> | ||||
|     <van-col span="7"> | ||||
|       <view class="tableContent">  {{data.rechargeMoney}} </view> | ||||
|     </van-col> | ||||
|     <van-col span="5"> | ||||
|       <view class="tableContent">  {{data.electricMoney}} </view> | ||||
|     </van-col> | ||||
|     <van-col span="6"> | ||||
|       <view class="tableContent">  {{data.currentMoney}} </view> | ||||
|     </van-col> | ||||
|   </van-row> | ||||
|     <view class="title"> | ||||
|         <span>{{data.meter.address}}</span> | ||||
|         <span style="font-size: 30rpx; margin-left: 100rpx;">电表编号:{{data.meter.sn}}</span> | ||||
|     </view> | ||||
|     <van-row> | ||||
|         <view class="table-header" style="border-bottom: 2rpx solid #000; "> | ||||
|             <view class="table-header-row"> | ||||
|                 <text class="table-header-cell">类目</text> | ||||
|                 <text class="table-header-cell">金额</text> | ||||
|                 <text class="table-header-cell">更新时间</text> | ||||
|             </view> | ||||
|         </view> | ||||
|     </van-row> | ||||
|  | ||||
|     <view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); "> | ||||
|         <van-row> | ||||
|             <van-col span="7"> | ||||
|                 <view class="tableTitle"> 初始余额 </view> | ||||
|             </van-col> | ||||
|             <van-col span="10"> | ||||
|                 <view class="tableContent"> {{data.startMoney}} </view> | ||||
|             </van-col> | ||||
|             <van-col span="7"> | ||||
|                 <view calss="tableContent"> {{data.updateStartMoneyAt || '--'}} </view> | ||||
|             </van-col> | ||||
|         </van-row> | ||||
|     </view> | ||||
|  | ||||
|     <view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); "> | ||||
|         <van-row> | ||||
|             <van-col span="7"> | ||||
|                 <view class="tableTitle"> 累计充值金额 </view> | ||||
|             </van-col> | ||||
|             <van-col span="10"> | ||||
|                 <view class="tableContent"> {{data.rechargeMoney}} </view> | ||||
|             </van-col> | ||||
|             <van-col span="7"> | ||||
|                 <view calss="tableContent"> {{data.updateRechargeMoneyAt || '--'}} </view> | ||||
|             </van-col> | ||||
|         </van-row> | ||||
|     </view> | ||||
|  | ||||
|     <view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); "> | ||||
|         <van-row> | ||||
|             <van-col span="7"> | ||||
|                 <view class="tableTitle"> 电费 </view> | ||||
|             </van-col> | ||||
|             <van-col span="10"> | ||||
|                 <view class="tableContent"> {{data.electricMoney}} </view> | ||||
|             </van-col> | ||||
|             <van-col span="7"> | ||||
|                 <view calss="tableContent"> {{data.updateElectricMoneyAt  || '--'}} </view> | ||||
|             </van-col> | ||||
|         </van-row> | ||||
|     </view> | ||||
|  | ||||
|     <view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); "> | ||||
|         <van-row> | ||||
|             <van-col span="7"> | ||||
|                 <view class="tableTitle"> 账务余额 </view> | ||||
|             </van-col> | ||||
|             <van-col span="10"> | ||||
|                 <view class="tableContent"> {{data.accountMoney}} </view> | ||||
|             </van-col> | ||||
|             <van-col span="7"> | ||||
|                 <view calss="tableContent"> {{data.updateAccountMoneyAt  || '--'}} </view> | ||||
|             </van-col> | ||||
|         </van-row> | ||||
|     </view> | ||||
|  | ||||
|     <view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); "> | ||||
|         <van-row> | ||||
|             <van-col span="7"> | ||||
|                 <view class="tableTitle"> 电表余额 </view> | ||||
|             </van-col> | ||||
|             <van-col span="10"> | ||||
|                 <view class="tableContent"> {{data.meterMoney}} </view> | ||||
|             </van-col> | ||||
|             <van-col span="7"> | ||||
|                 <view calss="tableContent"> {{data.updateMeterMoneyAt  || '--'}} </view> | ||||
|             </van-col> | ||||
|         </van-row> | ||||
|     </view> | ||||
| </view> | ||||
| @@ -17,8 +17,25 @@ | ||||
| } | ||||
|  | ||||
| .tableContent { | ||||
|   margin-top: 10rpx; | ||||
|   margin-top: 25rpx; | ||||
|   margin-bottom: 20rpx; | ||||
|   text-align: center; | ||||
|   font-size: 32rpx; | ||||
| } | ||||
| } | ||||
| .table-header { | ||||
|     display: flex; | ||||
|     width: 100%; | ||||
|     background-color: #f5f5f5; | ||||
|     border-bottom: 1rpx solid #eaeaea; | ||||
|   } | ||||
|   .table-header-row { | ||||
|     display: flex; | ||||
|     width: 100%; | ||||
|   } | ||||
|   .table-header-cell { | ||||
|     flex: 1; | ||||
|     text-align: center; | ||||
|     padding: 20rpx 0; | ||||
|     font-size: 25rpx; | ||||
|     color: #333; | ||||
|   } | ||||
| @@ -2,6 +2,7 @@ | ||||
| import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../../../service/accounting"; | ||||
| import { getTenementMeterList } from "../../../../../service/meter"; | ||||
| import dayjs from "../../../../../utils/dayjs"; | ||||
| import { getParkInfoByTime } from "../../../../../service/park"; | ||||
| import request from '../../../../../utils/request'; | ||||
| import { alertInfo, getPixelRatio, loadingFunc } from "../../../../../utils/index"; | ||||
| const { OK } = request; | ||||
| @@ -12,12 +13,16 @@ Component({ | ||||
|    */ | ||||
|   properties: { | ||||
|     meter: String, | ||||
|     parkInfo: Object, | ||||
|   }, | ||||
|   observers: { | ||||
|     'meter': function() { | ||||
|       loadingFunc(async () => { | ||||
|         await this.getReadingList(); | ||||
|       }) | ||||
|     }, | ||||
|     "parkInfo": function(newValue) { | ||||
|       this.setData({ park: newValue }) | ||||
|     } | ||||
|   }, | ||||
|   /** | ||||
| @@ -26,10 +31,11 @@ Component({ | ||||
|   data: { | ||||
|     readingDetailShow: false, | ||||
|     readingDetail: {}, | ||||
|     park: {}, | ||||
|     meterReadingHeader: [ | ||||
|       { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address }, | ||||
|       { title: '倍率', key: 'ratio' }, | ||||
|       { key: 'number', title: '抄表记录' }, | ||||
|       { key: 'number', title: '当前表字' }, | ||||
|     ], | ||||
|     meterReadingList: [], | ||||
|     yearMonthDayReading: dayjs().format("YYYY-MM-DD"), | ||||
| @@ -75,10 +81,30 @@ Component({ | ||||
|         readingPage: 1, | ||||
|       }, () => { | ||||
|         loadingFunc(async () => { | ||||
|           await this.getParkInfo(time) | ||||
|           await this.getReadingList(); | ||||
|         }) | ||||
|       }) | ||||
|           | ||||
|     }, | ||||
|     async getParkInfo(time) { | ||||
|       const park = wx.getStorageSync('park'); | ||||
|       const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id,  `${time}`, `${0}`,) | ||||
|       if (code !== OK) { | ||||
|         alertInfo(message) | ||||
|         return; | ||||
|       } | ||||
|       const that = this; | ||||
|       return new Promise((resolve) => { | ||||
|         | ||||
|         that.setData({ | ||||
|           parkInfo: parkInfo | ||||
|         }, () => { | ||||
|           resolve() | ||||
|         }) | ||||
|       }) | ||||
|    | ||||
|        | ||||
|     }, | ||||
|     showDetail(e) { | ||||
|       const { index, data = {} } = e.detail; | ||||
|   | ||||
| @@ -49,24 +49,102 @@ | ||||
|         label="地址" | ||||
|         readonly | ||||
|       /> | ||||
|       <van-field | ||||
|         value="{{ readingDetail.meter.sn }}(SN)" | ||||
|         border="{{ false }}" | ||||
|         label="编号" | ||||
|         readonly | ||||
|       /> | ||||
|  | ||||
|       <van-field | ||||
|         value="{{ readingDetail.readAt }}" | ||||
|         border="{{ false }}" | ||||
|         label="时间" | ||||
|         readonly | ||||
|       /> | ||||
|  | ||||
|       <van-field | ||||
|         value="{{ readingDetail.ratio }}" | ||||
|         border="{{ false }}" | ||||
|         label="倍率" | ||||
|         readonly | ||||
|       /> | ||||
|       | ||||
|       <van-field | ||||
|         value="{{ readingDetail.number }}" | ||||
|         border="{{ false }}" | ||||
|         label="表字" | ||||
|         label="当前表字(总)" | ||||
|         readonly | ||||
|       /> | ||||
|  | ||||
|       <van-field | ||||
|         value="{{ readingDetail.overall }}" | ||||
|         border="{{ false }}" | ||||
|         label="总用电量" | ||||
|         readonly | ||||
|       /> | ||||
|       | ||||
|       <van-field | ||||
|         value="{{ readingDetail.sharp }}" | ||||
|         border="{{ false }}" | ||||
|         label="当前表字(尖)" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}" | ||||
|       /> | ||||
|       <van-field | ||||
|         value="{{ readingDetail.sharpAmount }}" | ||||
|         border="{{ false }}" | ||||
|         label="尖用电量" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}" | ||||
|       /> | ||||
|  | ||||
|       <van-field | ||||
|         value="{{ readingDetail.peak }}" | ||||
|         border="{{ false }}" | ||||
|         label="当前表字(峰)" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1 || park.meter04kvType === 2}}" | ||||
|       /> | ||||
|       <van-field | ||||
|         value="{{ readingDetail.peakAmount }}" | ||||
|         border="{{ false }}" | ||||
|         label="峰用电量" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}" | ||||
|       /> | ||||
|  | ||||
|       <van-field | ||||
|         value="{{ readingDetail.flat }}" | ||||
|         border="{{ false }}" | ||||
|         label="当前表字(平)" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}" | ||||
|       /> | ||||
|       <van-field | ||||
|         value="{{ readingDetail.flatAmount }}" | ||||
|         border="{{ false }}" | ||||
|         label="平用电量" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}" | ||||
|       /> | ||||
|  | ||||
|       <van-field | ||||
|         value="{{ readingDetail.valley }}" | ||||
|         border="{{ false }}" | ||||
|         label="当前表字(谷)" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}" | ||||
|       /> | ||||
|       <van-field | ||||
|         value="{{ readingDetail.valleyAmount }}" | ||||
|         border="{{ false }}" | ||||
|         label="谷用电量" | ||||
|         readonly | ||||
|         wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}" | ||||
|       /> | ||||
|       <view class="text">上次抄表记录起,至现在时间内的用电量</view> | ||||
|     </van-cell-group> | ||||
|    | ||||
|   </view> | ||||
| </van-dialog> | ||||
| @@ -92,4 +92,11 @@ page { | ||||
|     content:"";    | ||||
|     display:block;  | ||||
|     clear:both | ||||
|   } | ||||
|  | ||||
|   .text{ | ||||
|     font-size: 28rpx; | ||||
|     color: #999999; | ||||
|     margin: 10rpx 0; | ||||
|     text-align: center; | ||||
|   } | ||||
| @@ -1,6 +1,7 @@ | ||||
| // pages/electricQuery/index.js | ||||
| import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../service/accounting"; | ||||
| import { getTenementMeterList } from "../../../service/meter"; | ||||
| import { getParkInfoByTime } from "../../../service/park"; | ||||
| import dayjs from "../../../utils/dayjs"; | ||||
| import request from '../../../utils/request'; | ||||
| import * as echarts from '../../components/echarts/echarts'; | ||||
| @@ -29,14 +30,20 @@ Page({ | ||||
|  | ||||
|  | ||||
|     header: [ | ||||
|       { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address }, | ||||
|       // { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address }, | ||||
|       { title: '时间',renderBody: (item) => { return item.time } }, | ||||
|       { key: 'number', title: '耗量' }, | ||||
|     ], | ||||
|  | ||||
|     valleyHeader: [ | ||||
|       // { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address }, | ||||
|       { title: '时间',renderBody: (item) => { return item.time } }, | ||||
|       { key: 'critical', title: '尖' }, | ||||
|       { key: 'peak', title: '峰' }, | ||||
|       { key: 'flat', title: '平' }, | ||||
|       { key: 'valley', title: '谷' }, | ||||
|     ], | ||||
|     list: [], | ||||
|     visible: false, | ||||
|    | ||||
|     accountingList: [], | ||||
|     electricNumber: 0, | ||||
|     meterNumber: 0, | ||||
| @@ -76,7 +83,7 @@ Page({ | ||||
|   }, | ||||
|   | ||||
|   changeTimeType(e) { | ||||
|     const { type } = e.currentTarget.dataset | ||||
|     const { type } = e.currentTarget.dataset; | ||||
|     const that = this; | ||||
|     this.setData({ timeType: type }, () => { | ||||
|       loadingFunc(async () => { | ||||
| @@ -90,11 +97,13 @@ Page({ | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|     loadingFunc(async () => { | ||||
|       await this.getMeters() | ||||
|       await this.getParkInfo() | ||||
|       await this.init() | ||||
|     }) | ||||
|   }, | ||||
|   async init() { | ||||
|     const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page } = this.data; | ||||
|     const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page, parkInfo } = this.data; | ||||
|     let time; | ||||
|     switch(timeType) { | ||||
|       case 1: | ||||
| @@ -133,14 +142,14 @@ Page({ | ||||
|       const times = [...new Set(data?.map(item => item.time))]. | ||||
|       map(item => Number(item.replace(point, ""))). | ||||
|       sort((a, b) => a - b). | ||||
|       map(ele => `${ele}${point}`.padStart(2, "0")); | ||||
|   | ||||
|       map(ele => `${ele}${point}`.padStart(3, "0")); | ||||
|  | ||||
|       const options  = { | ||||
|         tooltip: { | ||||
|           trigger: 'axis' | ||||
|         }, | ||||
|         legend: { | ||||
|           data: data?.map(item => item?.meter?.address), | ||||
|           data:  data?.map(item => item?.meter?.address), | ||||
|         }, | ||||
|         grid: { | ||||
|           left: '3%', | ||||
| @@ -162,7 +171,7 @@ Page({ | ||||
|           const newList = [...times].map(item => { | ||||
|             const exist = list.find(ele => ele.time === item) | ||||
|             if (exist) { | ||||
|               return exist.number; | ||||
|               return Number(exist.critical)+ Number(exist.peak)+Number(exist.flat)+Number(exist.valley); | ||||
|             } | ||||
|             return null | ||||
|           }) | ||||
| @@ -202,6 +211,7 @@ Page({ | ||||
|           wx.openDocument({ | ||||
|             filePath: data.tempFilePath, | ||||
|             fileType: ['xlsx'], | ||||
|             showMenu: true, | ||||
|             success() { | ||||
|             }, | ||||
|             fail(err) { | ||||
| @@ -235,15 +245,44 @@ Page({ | ||||
|       alertInfo(message) | ||||
|       return; | ||||
|     } | ||||
|      | ||||
|     const first = data?.[0] | ||||
|     this.setData({ | ||||
|       meterList: data || [], | ||||
|       meterId: first?.id, | ||||
|       meterAddress: first?.address, | ||||
|       meterCode: first?.code,  | ||||
|     }, () => { | ||||
|       const { queryType, } = this.data; | ||||
|       switch(queryType) { | ||||
|         case 1: | ||||
|           loadingFunc(async () => { | ||||
|             await this.getReadingList(); | ||||
|           }) | ||||
|           break; | ||||
|         case 2:  | ||||
|           loadingFunc(async () => { | ||||
|             await this.getAccountingBalanceList(); | ||||
|           }) | ||||
|           break; | ||||
|         default: | ||||
|           loadingFunc(async () => { | ||||
|             await this.init(); | ||||
|           }) | ||||
|           break; | ||||
|       } | ||||
|     }) | ||||
|   }, | ||||
|   clickMeter() { | ||||
|     this.setData({ | ||||
|       type: "meter", | ||||
|       columns: [{ id: "", name: "全部", code: "" }, ...this.data.meterList.map(item => ({ id: item.id, name: `${item.code}-${item.address}`, code: item.code }))], | ||||
|       columns: [ | ||||
|         // { id: "", name: "全部", code: "" }, | ||||
|         ...this.data.meterList.map(item => ({  | ||||
|           id: item.id,  | ||||
|           name: `${item.code}-${item.address}`,  | ||||
|           code: item.code, | ||||
|           address: item.address  | ||||
|         }))], | ||||
|       show: true, | ||||
|       title: "表计" | ||||
|     }) | ||||
| @@ -257,11 +296,12 @@ Page({ | ||||
|     }) | ||||
|   }, | ||||
|   onOk(e) { | ||||
|     const { id, code } = e.detail.value; | ||||
|     const { id, code, address } = e.detail.value; | ||||
|     this.setData({ | ||||
|       // year: currentYear, | ||||
|       meterId: id, | ||||
|       meterCode: code,  | ||||
|       meterAddress: address, | ||||
|       type: "", | ||||
|       show: false, | ||||
|       title: "" | ||||
| @@ -300,6 +340,7 @@ Page({ | ||||
|       case "year": | ||||
|         this.setData({ year: time,  visible: false, }, () => { | ||||
|           loadingFunc(async () => { | ||||
|             await this.getParkInfo() | ||||
|             await this.init(); | ||||
|           }) | ||||
|         }); | ||||
| @@ -308,6 +349,7 @@ Page({ | ||||
|         const [year, month] = time.split("-") | ||||
|         this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => { | ||||
|           loadingFunc(async () => { | ||||
|             await this.getParkInfo() | ||||
|             await this.init(); | ||||
|           }) | ||||
|         }); | ||||
| @@ -320,13 +362,16 @@ Page({ | ||||
|           page: 1, | ||||
|         }, () => { | ||||
|           loadingFunc(async () => { | ||||
|             await this.getParkInfo() | ||||
|             await this.init(); | ||||
|           }) | ||||
|         }) | ||||
|         break; | ||||
|     } | ||||
|   }, | ||||
|    | ||||
|   readingChangeTime(e) { | ||||
|  | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面初次渲染完成 | ||||
|    */ | ||||
| @@ -338,9 +383,39 @@ Page({ | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|     this.getMeters() | ||||
|   }, | ||||
|  | ||||
|   }, | ||||
|   async getParkInfo() { | ||||
|     const park = wx.getStorageSync('park'); | ||||
|     const { timeType, yearMonthDay, yearMonth, year } = this.data; | ||||
|     let time = '' | ||||
|     switch(timeType) { | ||||
|       case 0: | ||||
|         time = yearMonthDay; | ||||
|         break; | ||||
|       case 1: | ||||
|         time = yearMonth; | ||||
|         break; | ||||
|       case 2: | ||||
|         time = year; | ||||
|     } | ||||
|     const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id,  `${time}`, `${timeType}`,) | ||||
|     if (code !== OK) { | ||||
|       alertInfo(message) | ||||
|       return; | ||||
|     } | ||||
|     const that = this; | ||||
|     return new Promise((resolve) => { | ||||
|       | ||||
|       that.setData({ | ||||
|         parkInfo: parkInfo | ||||
|       }, () => { | ||||
|         resolve() | ||||
|       }) | ||||
|     }) | ||||
|  | ||||
|      | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面隐藏 | ||||
|    */ | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|     </view> | ||||
|     <view class="select" bind:tap="clickMeter"> | ||||
|       <view class="selectContent"> | ||||
|         {{ meterCode === "" ? '全部' : meterCode  }} | ||||
|         {{ meterAddress === "" ? '-' : meterAddress  }} | ||||
|       </view> | ||||
|       <van-icon name="arrow-down" /> | ||||
|     </view> | ||||
| @@ -30,23 +30,25 @@ | ||||
|     <view class="timeQuery" wx:if="{{queryType === 0}}"> | ||||
|       <van-row> | ||||
|         <van-col span="8"> | ||||
|           <view class="timeQueryText" style="color: {{timeType === 0 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{0}}"> 日耗量 </view> | ||||
|           <view class="timeQueryText" style="color: {{timeType === 0 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{0}}"> 日用电量 </view> | ||||
|         </van-col> | ||||
|         <van-col span="8"> | ||||
|           <view class="timeQueryText" style="color: {{timeType === 1 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{1}}"> 月耗量 </view> | ||||
|           <view class="timeQueryText" style="color: {{timeType === 1 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{1}}"> 月电用量 </view> | ||||
|         </van-col> | ||||
|         <van-col span="8"> | ||||
|           <view class="timeQueryText" style="color: {{timeType === 2 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{2}}"> 年耗量 </view> | ||||
|           <view class="timeQueryText" style="color: {{timeType === 2 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{2}}"> 年用电量 </view> | ||||
|         </van-col> | ||||
|       </van-row> | ||||
|     </view> | ||||
|   </view> | ||||
|   <view wx:if="{{queryType === 0}}"> | ||||
|     <view class="tooltip"> | ||||
|       不包括线损电量,显示为电表实际消耗电量。仅供参考,实际能耗电量以电费账单为主。如有疑问,请联系客服。 | ||||
|       不包括线损电量,显示为电表实际消用电量。仅供参考,实际能用电量以电费账单为主。如有疑问,请联系客服。 | ||||
|     </view> | ||||
|     <view class="timeChooseWrapper"> | ||||
|       <view> 选择时间 </view> | ||||
|       <view wx:if="{{timeType === 0}}"> 选择时间 </view> | ||||
|       <view  wx:elif="{{timeType === 1}}"> 选择日期 </view> | ||||
|       <view  wx:else="{{timeType === 2}}"> 选择月份 </view> | ||||
|       <view class="time" bind:tap="clickTime"> | ||||
|         <view class="timeText" wx:if="{{timeType === 0}}"> {{yearMonthDay}} </view> | ||||
|         <view class="timeText" wx:elif="{{timeType === 1}}"> {{yearMonth}} </view> | ||||
| @@ -63,7 +65,10 @@ | ||||
|   </view> | ||||
|   <view wx:elif="{{queryType === 2}}"> | ||||
|     <view class="tooltip"> | ||||
|       账务余额更新时间为:每次预存电费后,每次账单发布后,剩余的实际金额。电表余额与账务余额相差较大的用户,每半年统一处理一次。 | ||||
|         账务余额更新时间为:每次预存电费后,每次发布账单后剩余的实际金额。 | ||||
|     </view> | ||||
|     <view class="tooltip"> | ||||
|         计算公式:账务余额 = 初始余额 + 累充充值金额 - 电费 | ||||
|     </view> | ||||
|   </view> | ||||
|    | ||||
| @@ -81,14 +86,25 @@ | ||||
|       </view> | ||||
|       <empty bind:refresh="init" wx:else /> --> | ||||
|        | ||||
|       <listTable list="{{list}}" header="{{header}}" totalPage="{{totalPage}}" /> | ||||
|       <listTable  | ||||
|         list="{{list}}"  | ||||
|         header="{{header}}"  | ||||
|         totalPage="{{totalPage}}"  | ||||
|         wx:if="{{parkInfo.category !== 1}}" | ||||
|       /> | ||||
|       <listTable  | ||||
|         list="{{list}}"  | ||||
|         header="{{valleyHeader}}"  | ||||
|         totalPage="{{totalPage}}"  | ||||
|         wx:if="{{parkInfo.category === 1}}" | ||||
|       /> | ||||
|     </view> | ||||
|     <view class="sum"> | ||||
|       合计:表计数量:{{meterNumber}},耗电量:{{electricNumber}} | ||||
|       合计:表计数量:{{meterNumber}},用电量:{{electricNumber}} | ||||
|     </view> | ||||
|   </view> | ||||
|   <view wx:if="{{queryType === 1}}"> | ||||
|     <reading meter="{{meterId}}" /> | ||||
|     <reading meter="{{meterId}}" parkInfo="{{parkInfo}}" bind:changeTime="readingChangeTime" /> | ||||
|   </view> | ||||
|   <view wx:if="{{queryType === 2}}"> | ||||
|     <view style="margin: 30rpx;"> | ||||
|   | ||||
							
								
								
									
										50
									
								
								components/DateTimePicker/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								components/DateTimePicker/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | ||||
| // components/datePicker/index.js | ||||
| import dayjs from "../../utils/dayjs" | ||||
|  | ||||
| Component({ | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|     show: Boolean, | ||||
|     // time: String, | ||||
|   }, | ||||
|   // observers: { | ||||
|   //   time: function(newValue) { | ||||
|   //     if (!newValue) { | ||||
|   //       return; | ||||
|   //     } | ||||
|   //     this.setData({ | ||||
|   //       currentDate: new Date(newValue).getTime(), | ||||
|   //     }) | ||||
|   //   } | ||||
|   // }, | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     currentDate: new Date().getTime(), | ||||
|     maxDate: new Date().getTime(), | ||||
|     minDate: new Date(2024, 1, 1).getTime(), | ||||
|   }, | ||||
|   lifetimes: { | ||||
|     attached() { | ||||
|       this.setData({ | ||||
|         maxDate: new Date().getTime(), | ||||
|         currentDate: new Date().getTime(), | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|     onCancel() { | ||||
|       this.triggerEvent("cancel") | ||||
|     }, | ||||
|     onConfirm(e) { | ||||
|       this.triggerEvent("confirm", { time: dayjs(e.detail).format("YYYY-MM-DD HH:mm:ss") }) | ||||
|     } | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										7
									
								
								components/DateTimePicker/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								components/DateTimePicker/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| { | ||||
|   "component": true, | ||||
|   "usingComponents": { | ||||
|     "van-popup": "@vant/weapp/popup/index", | ||||
|     "van-datetime-picker": "@vant/weapp/datetime-picker/index" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										18
									
								
								components/DateTimePicker/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								components/DateTimePicker/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| <!--components/datePicker/index.wxml--> | ||||
|  | ||||
| <van-popup  | ||||
|   show="{{ show }}"  | ||||
|   position="bottom" | ||||
|   bind:close="onClose" | ||||
|   z-index="10000" | ||||
| > | ||||
|  | ||||
| <van-datetime-picker | ||||
|   type="datetime" | ||||
|   value="{{ currentDate }}" | ||||
|   min-date="{{ minDate }}" | ||||
|   max-date="{{ maxDate }}" | ||||
|   bind:confirm="onConfirm" | ||||
|   bind:cancel="onCancel" | ||||
| /> | ||||
| </van-popup> | ||||
							
								
								
									
										1
									
								
								components/DateTimePicker/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								components/DateTimePicker/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| /* components/datePicker/index.wxss */ | ||||
| @@ -21,7 +21,6 @@ Component({ | ||||
|    */ | ||||
|   methods: { | ||||
|     handleChange(e) { | ||||
|       console.log(e, this.data.active) | ||||
|       const { index } = e.currentTarget.dataset; | ||||
|       if (index === this.data.active) { | ||||
|         return; | ||||
|   | ||||
| @@ -18,9 +18,10 @@ Component({ | ||||
|     show: Boolean, | ||||
|     park: String, | ||||
|     isBack: Boolean, | ||||
|     filterBind: Boolean, | ||||
|   }, | ||||
|   observers: { | ||||
|     "show,type": function(newShow, newType) { | ||||
|     "show,type,filterBind": function(newShow, newType) { | ||||
|       if (newShow && newType) {  | ||||
|         this.onSearch() | ||||
|       } | ||||
| @@ -61,7 +62,6 @@ Component({ | ||||
|     onConfirm(event) { | ||||
|       const { index } = event.detail; | ||||
|       const { list = [], type } = this.data; | ||||
|       console.log("index", index) | ||||
|       const item = list[index]; | ||||
|       if (!item) { | ||||
|         alertInfo("请选择一项") | ||||
| @@ -97,7 +97,7 @@ Component({ | ||||
|       this.triggerEvent("confirm", { data: item, way: index, type } ); | ||||
|     }, | ||||
|     onSearch() { | ||||
|       const { type } = this.data; | ||||
|       const { type, bind, filterBind } = this.data; | ||||
|       switch(type) { | ||||
|         case "park": | ||||
|           this.onSearchPark(); | ||||
| @@ -126,8 +126,8 @@ Component({ | ||||
|       }) | ||||
|     }, | ||||
|     async onSearchMeter() { | ||||
|       const { searchText = "", park } = this.data; | ||||
|       const { code, message, data: parks = [] } = await getParkSimpleMeterList({keyword: searchText, park}); | ||||
|       const { searchText = "", park, filterBind } = this.data; | ||||
|       const { code, message, data: parks = [] } = await getParkSimpleMeterList({keyword: searchText, park, isNeedBind: !filterBind}); | ||||
|       if (code !== OK) { | ||||
|         alertInfo(message) | ||||
|         return | ||||
|   | ||||
| @@ -23,6 +23,7 @@ Component({ | ||||
|     year: String, | ||||
|     month: Number, | ||||
|     day: Number, | ||||
|     currentDate: Number, | ||||
|   }, | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|   | ||||
| @@ -20,9 +20,7 @@ Page({ | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|     const querys = decodeURIComponent(options.scene) | ||||
|     console.log('querys', querys) | ||||
|     const id = querys.slice(querys.indexOf("=") + 1) | ||||
|     console.log("id", id) | ||||
|     this.getInfo(id); | ||||
|   }, | ||||
|   async getInfo(id) { | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { getBillList } from "../../service/accounting" | ||||
| import { alertInfo } from "../../utils/index"; | ||||
| import { alertInfo, loadingFunc } from "../../utils/index"; | ||||
| import request from '../../utils/request' | ||||
| const { OK } = request; | ||||
|  | ||||
| @@ -17,11 +17,19 @@ Page({ | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|     this.init(); | ||||
|     const that = this; | ||||
|     loadingFunc(async () => { | ||||
|       await that.init(); | ||||
|     }) | ||||
|  | ||||
|   }, | ||||
|   async init() { | ||||
|     const { page, list } = this.data; | ||||
|     const { code, data, message } = await getBillList(page) | ||||
|     if (code !== OK) { | ||||
|       alertInfo(message) | ||||
|       return; | ||||
|     } | ||||
|     if (!data?.length) { | ||||
|       alertInfo("没有更多了") | ||||
|       return; | ||||
| @@ -33,8 +41,9 @@ Page({ | ||||
|   }, | ||||
|   jumpToDetail(e) { | ||||
|     const { id: report } = e.currentTarget.dataset | ||||
|     const tenement = wx.getStorageSync('tenement')?.id || "" | ||||
|     wx.navigateTo({ | ||||
|       url: '/childPackage/pages/billDetail/index?id=' + report, | ||||
|       url: `/childPackage/pages/billDetail/index?id=${report}&tenement=${tenement}`, | ||||
|     }) | ||||
|   }, | ||||
| }) | ||||
							
								
								
									
										87
									
								
								pages/billMeterDetail/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								pages/billMeterDetail/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,87 @@ | ||||
| // pages/billMeterDetail/index.js | ||||
| import { getRoundNumber } from "../../utils/index" | ||||
| Page({ | ||||
|  | ||||
|   /** | ||||
|    * 页面的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     data: {}, | ||||
|     headers: [ | ||||
|       { key: 'type', title: '' }, | ||||
|       { title: '尖',renderBody: (item) => { return item?.sharp } }, | ||||
|       { title: '峰',renderBody: (item) => { return item?.peak } }, | ||||
|       { title: '平',renderBody: (item) => { return item?.flat } }, | ||||
|       { title: '谷',renderBody: (item) => { return item?.valley } }, | ||||
|     ], | ||||
|     list: [] | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|     const data =  JSON.parse(options.data) || {} | ||||
|     this.setData({ | ||||
|       data: data, | ||||
|       list: [ | ||||
|         { type: "起码", sharp: data.startSharp, peak: data.startPeak, flat: data.startFlat, valley: data.startValley }, | ||||
|         { type: "止码", sharp: data.endSharp, peak: data.endPeak, flat: data.endFlat, valley: data.endValley }, | ||||
|         { type: "退补电量", sharp: data.refundSharp, peak: data.refundPeak, flat: data.refundFlat, valley: data.refundValley }, | ||||
|         { type: "从表电量", sharp: getRoundNumber(data.nestSharp), peak: getRoundNumber(data.nestPeak), flat: getRoundNumber(data.nestFlat), valley: getRoundNumber(data.nestValley) }, | ||||
|         { type: "电度电量", sharp: getRoundNumber(data?.critical?.amount), peak: getRoundNumber(data.peak?.amount), flat: getRoundNumber(data.flat?.amount), valley: getRoundNumber(data.valley?.amount) }, | ||||
|         { type: "分时单价", sharp: data.critical?.price, peak: data.peak?.price, flat: data.flat?.price, valley: data.valley?.price }, | ||||
|         { type: "电费", sharp: getRoundNumber(data.chargeSharp), peak: getRoundNumber(data.chargePeak), flat: getRoundNumber(data.chargeFlat), valley: getRoundNumber(data.chargeValley) }, | ||||
|       ] | ||||
|     }) | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面初次渲染完成 | ||||
|    */ | ||||
|   onReady() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面隐藏 | ||||
|    */ | ||||
|   onHide() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面卸载 | ||||
|    */ | ||||
|   onUnload() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面相关事件处理函数--监听用户下拉动作 | ||||
|    */ | ||||
|   onPullDownRefresh() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面上拉触底事件的处理函数 | ||||
|    */ | ||||
|   onReachBottom() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 用户点击右上角分享 | ||||
|    */ | ||||
|   onShareAppMessage() { | ||||
|  | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										10
									
								
								pages/billMeterDetail/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								pages/billMeterDetail/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| { | ||||
|   "usingComponents": { | ||||
|     "navigator": "/components/navigator/index", | ||||
|     "van-row": "@vant/weapp/row/index", | ||||
|     "van-col": "@vant/weapp/col/index", | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "table": "/components/table/table" | ||||
|   }, | ||||
|   "navigationStyle": "custom" | ||||
| } | ||||
							
								
								
									
										45
									
								
								pages/billMeterDetail/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								pages/billMeterDetail/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,45 @@ | ||||
| <!--pages/billMeterDetail/index.wxml--> | ||||
| <navigator title="详情" canBack="{{true}}" /> | ||||
| <view class="contentWrapper"> | ||||
|     <van-field | ||||
|         label="电表编号" | ||||
|         readonly="{{true}}" | ||||
|         border="{{false}}" | ||||
|         custom-style="padding-left: 0; padding-right: 0;" | ||||
|         title-width="132rpx" | ||||
|         value="{{data.meterNo}}" | ||||
|     /> | ||||
|     <van-field | ||||
|         label="电表地址" | ||||
|         readonly="{{true}}" | ||||
|         custom-style="padding-left: 0; padding-right: 0;" | ||||
|         title-width="132rpx" | ||||
|         border="{{false}}" | ||||
|         value="{{data.address}}" | ||||
|     /> | ||||
|     <van-field | ||||
|         label="倍率" | ||||
|         readonly="{{true}}" | ||||
|         border="{{false}}" | ||||
|         custom-style="padding-left: 0; padding-right: 0;" | ||||
|         title-width="132rpx" | ||||
|         value="{{data.ratio}}" | ||||
|     /> | ||||
|     <view class="table"> | ||||
|         <table header="{{headers}}" list="{{list}}"  /> | ||||
|     </view> | ||||
|     <view class="total"> | ||||
|         <van-row> | ||||
|             <van-col span="12"> | ||||
|                 <view class="totalNumber"> | ||||
|                     电度电量:{{data.overall.amount}} | ||||
|                 </view> | ||||
|             </van-col> | ||||
|             <van-col span="12"> | ||||
|                 <view class="totalNumber"> | ||||
|                     电度电费:{{data.overall.fee}} | ||||
|                 </view> | ||||
|             </van-col> | ||||
|         </van-row> | ||||
|     </view> | ||||
| </view> | ||||
							
								
								
									
										22
									
								
								pages/billMeterDetail/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								pages/billMeterDetail/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| /* pages/billMeterDetail/index.wxss */ | ||||
| .infoItem { | ||||
|     word-break: break-all; | ||||
| } | ||||
|  | ||||
| .contentWrapper { | ||||
|     margin: 20rpx; | ||||
| } | ||||
|  | ||||
| .table { | ||||
|     border: 1rpx solid rgba(204,204,204,.5); | ||||
|     margin-bottom: 40rpx; | ||||
| } | ||||
|  | ||||
| .total { | ||||
|     padding-top: 30rpx; | ||||
|     padding-bottom: 40rpx; | ||||
| } | ||||
|  | ||||
| .totalNumber { | ||||
|     word-break: break-all; | ||||
| } | ||||
| @@ -125,7 +125,6 @@ Page({ | ||||
|     wx.scanCode({ | ||||
|       scanType: "qrCode", | ||||
|       success: ({ path }) => { | ||||
|         console.log('path', path) | ||||
|         wx.navigateTo({ | ||||
|           url: '/' + path, | ||||
|         }) | ||||
| @@ -137,7 +136,6 @@ Page({ | ||||
|     }) | ||||
|   }, | ||||
|   onConfirm(e) { | ||||
|     console.log('e', e.detail) | ||||
|     const { type, data = {} } = e.detail; | ||||
|     switch(type) { | ||||
|       case "park": | ||||
|   | ||||
| @@ -115,6 +115,12 @@ Page({ | ||||
|       show: false, | ||||
|     }) | ||||
|   }, | ||||
|   jumpToMeterBalanceRecord(e) { | ||||
|     const id = e.currentTarget.dataset.id | ||||
|     wx.navigateTo({ | ||||
|       url: `/pages/meterBalanceRecord/index?id=${id}`, | ||||
|     }) | ||||
|   }, | ||||
|   changeMoney(e) { | ||||
|     const { money } = e.currentTarget.dataset; | ||||
|     this.setData({ | ||||
|   | ||||
| @@ -60,7 +60,12 @@ | ||||
|       <view class="cardItem"> | ||||
|         <view class="cardItemLabel"> 电表余额: </view> | ||||
|         <view class="cardItemValue" style="position: relative;"> | ||||
|           <view class="text"  wx:if="{{user.id}}"> {{meter.money}} </view> | ||||
|           <view  | ||||
|             class="text primaryTextBtn"   | ||||
|             wx:if="{{user.id}}" | ||||
|             bind:tap="jumpToMeterBalanceRecord" | ||||
|             data-id="{{meter.id}}" | ||||
|           > {{meter.money}} </view> | ||||
|           <view class="text"  wx:else> --- </view> | ||||
|             <!--     bind:click="refreshMeter" --> | ||||
|           <van-button  | ||||
|   | ||||
| @@ -1,6 +1,10 @@ | ||||
| /* pages/home/index.wxss */ | ||||
| @import "/app.wxss"; | ||||
|  | ||||
| .balanceText { | ||||
|   color: var(--primary-color) | ||||
| } | ||||
|  | ||||
| .top { | ||||
|   background-color: var(--deep-green); | ||||
|   position: fixed; | ||||
|   | ||||
| @@ -80,13 +80,31 @@ Page({ | ||||
|                 } | ||||
|                 wx.openDocument({ | ||||
|                   filePath: res.tempFilePath, | ||||
|                   showMenu: true, | ||||
|                   // fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了 !!! | ||||
|                   success: function (res) { | ||||
|                      | ||||
|                   }, | ||||
|                   fail: function (e) { | ||||
|                     alertError("打开失败") | ||||
|                     console.log('打开失败错误为', e) | ||||
|                     // alertError("打开失败") | ||||
|                     wx.showModal({ | ||||
|                       title: '提示', | ||||
|                       content: '打开失败,请复制链接后通过浏览器打开', | ||||
|                       complete: (res) => { | ||||
|                         if (res.cancel) { | ||||
|                            | ||||
|                         } | ||||
|                      | ||||
|                         if (res.confirm) { | ||||
|                           wx.setClipboardData({ | ||||
|                             data: data, | ||||
|                             success: () => { | ||||
|                               alertSuccess("复制成功") | ||||
|                             } | ||||
|                           }) | ||||
|                         } | ||||
|                       } | ||||
|                     }) | ||||
|                   } | ||||
|                 }) | ||||
|               } | ||||
|   | ||||
| @@ -43,6 +43,15 @@ Component({ | ||||
|         page: page + 1, | ||||
|       }) | ||||
|     }, | ||||
|     refresh() { | ||||
|       const that = this; | ||||
|       that.setData({ | ||||
|         page: 1, | ||||
|         list: [] | ||||
|       }, () => { | ||||
|         loadingFunc(() => that.getList()) | ||||
|       }) | ||||
|     }, | ||||
|     onRefresh() { | ||||
|       loadingFunc(() => this.getList()) | ||||
|     }, | ||||
|   | ||||
| @@ -2,6 +2,9 @@ | ||||
|  | ||||
|  | ||||
| <scroll-view wx:if="{{list.length}}" scroll-y lower-threshold="100px" bindscrolltolower="scrollToLower" style="height: 80vh;" scroll-top="{{topHeight}}px" class="scrView"> | ||||
|   <view style="margin: 18rpx 30rpx;"> | ||||
|     <van-button type="info" size="small" icon="replay" bind:click="refresh"> 刷新 </van-button> | ||||
|   </view> | ||||
|   <view class="card" wx:for="{{list}}"> | ||||
|     <view class="left"> | ||||
|       <view class="title"> | ||||
| @@ -28,7 +31,7 @@ | ||||
|       </view> | ||||
|     </view> | ||||
|     <view class="{{item.status === 1 ? 'approving' : 'already'}}"> | ||||
|         <view wx:if="{{item.status === 1}}"> 审核中 </view> | ||||
|         <view wx:if="{{item.status === 1}}"> 开票中 </view> | ||||
|         <view wx:else> 已开票 </view> | ||||
|       </view> | ||||
|   </view> | ||||
|   | ||||
| @@ -14,7 +14,7 @@ Component({ | ||||
|   }, | ||||
|   lifetimes: { | ||||
|     attached() { | ||||
|       loadingFunc(() => this.init()) | ||||
|       loadingFunc(async () => await this.init()) | ||||
|     } | ||||
|   }, | ||||
|   /** | ||||
| @@ -42,7 +42,7 @@ Component({ | ||||
|       this.setData({ list: data, selectList: new Array(data?.length).map(() => false), allChecked: false, }) | ||||
|     }, | ||||
|     onRefresh() { | ||||
|       loadingFunc(() => this.init()) | ||||
|       loadingFunc(async () => await this.init()) | ||||
|     }, | ||||
|     onChange(e) { | ||||
|       const { id, index } = e.currentTarget.dataset; | ||||
|   | ||||
| @@ -82,18 +82,17 @@ Page({ | ||||
|     loadingFunc(async() => { | ||||
|       const {ids = [], remark } = this.data; | ||||
|       const tenement = wx.getStorageSync('tenement') | ||||
|       setTimeout(() => { | ||||
|         wx.redirectTo({ | ||||
|           url: '/pages/invoiceList/index?tab=1', | ||||
|         }) | ||||
|       }, 500) | ||||
|       const { code, message, data } = await makeInvoice({ ids, tenement: tenement.id, remark }) | ||||
|       if (code !== OK) { | ||||
|         alertInfo(message) | ||||
|         return; | ||||
|       } | ||||
|       alertSuccess("操作成功") | ||||
|       setTimeout(() => { | ||||
|         wx.redirectTo({ | ||||
|           url: '/pages/invoiceList/index?tab=1', | ||||
|         }) | ||||
|       }, 500) | ||||
|        | ||||
|     }) | ||||
|   }, | ||||
|   changeShow() { | ||||
|   | ||||
| @@ -54,10 +54,17 @@ Page({ | ||||
|         this.noPermission() | ||||
|         return; | ||||
|       } | ||||
|       alertSuccess("注册成功") | ||||
|       alertSuccess("登录成功") | ||||
|       const { token, ...user } = data | ||||
|       wx.setStorageSync('user', user) | ||||
|       wx.setStorageSync('token', data?.token) | ||||
|       console.log("user.workStatus", user.workStatus) | ||||
|       if (user.workStatus) { | ||||
|         wx.redirectTo({ | ||||
|           url: '/pages/workBenchNew/index', | ||||
|         }) | ||||
|         return | ||||
|       } | ||||
|       wx.switchTab({ | ||||
|         url: '/pages/home/index', | ||||
|       }) | ||||
|   | ||||
							
								
								
									
										149
									
								
								pages/meterBalanceRecord/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										149
									
								
								pages/meterBalanceRecord/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,149 @@ | ||||
| import dayjs from "../../utils/dayjs" | ||||
| import { getDayCalcList } from "../../service/calc" | ||||
| import { alertError } from "../../utils/index"; | ||||
| import request from "../../utils/request" | ||||
| const { OK } = request | ||||
|  | ||||
| // pages/meterBalanceRecord/index.js | ||||
| Page({ | ||||
|  | ||||
|   /** | ||||
|    * 页面的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     time: "", | ||||
|     timeStamp: undefined, | ||||
|     list: [], | ||||
|     page: 1, | ||||
|     size: 999, | ||||
|     header: [ | ||||
|       { key: 'day', title: '日期', }, | ||||
|       { key: "money", title: '充值金额', renderBody: (item) => { | ||||
|         if (item.type === 1 || item.type === 7) { | ||||
|           return item.topFee | ||||
|         } else if (item.type === 5 || item.type === 6 || item.type === 8) { | ||||
|           return `-${item.topFee}` | ||||
|         } else { | ||||
|           return 0 | ||||
|         } | ||||
|       } }, | ||||
|       { key: 'overall', title: '电费', renderBody: (item) => { | ||||
|         if (item.type == 1 || item.type === 5 || item.type === 6 || item.type === 7 || item.type === 8) { | ||||
|           return 0; | ||||
|         } else { | ||||
|           return item.money | ||||
|         } | ||||
|       } }, | ||||
|       { key: 'balance', title: '电表余额' }, | ||||
|     ], | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|     const { id } = options | ||||
|     const that = this; | ||||
|     this.setData({ | ||||
|       id, | ||||
|       time: dayjs().format("YYYY-MM"), | ||||
|       timeStamp: Date.now() | ||||
|     }, () => { | ||||
|       that.getList() | ||||
|     }) | ||||
|   }, | ||||
|   clickTime() { | ||||
|     this.setData({ | ||||
|       timeVisible: true | ||||
|     }) | ||||
|   }, | ||||
|   async getList() { | ||||
|     const { id, time, page, size } = this.data; | ||||
|     const { code, message, data } = await getDayCalcList({  | ||||
|       page,  | ||||
|       size,  | ||||
|       startTime: dayjs(time).subtract(1, 'month').endOf('month').format("YYYY-MM-DD"),  | ||||
|       endTime: dayjs(time).endOf('month').format("YYYY-MM-DD"), | ||||
|       codeId: id, | ||||
|     }) | ||||
|     if (code !== OK) { | ||||
|       alertError(message) | ||||
|       return | ||||
|     } | ||||
|     this.setData({ | ||||
|       list: data?.map(item => { | ||||
|         item.day = dayjs(item.endTime).format("DD日") | ||||
|         return item; | ||||
|       }) | ||||
|     }) | ||||
|   }, | ||||
|   onTimeConfirm(e) { | ||||
|     const { time } = e.detail; | ||||
|     const that = this; | ||||
|     this.setData({ | ||||
|       time, | ||||
|       timeStamp: new Date(time).getTime(), | ||||
|       timeVisible: false, | ||||
|     }, () => { | ||||
|       that.getList() | ||||
|     }) | ||||
|   }, | ||||
|   onTimeCancel() { | ||||
|     this.setData({ | ||||
|       timeVisible: false, | ||||
|     }) | ||||
|   }, | ||||
|   onTimeClose() { | ||||
|     this.setData({ | ||||
|       timeVisible: false, | ||||
|     }) | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面初次渲染完成 | ||||
|    */ | ||||
|   onReady() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面隐藏 | ||||
|    */ | ||||
|   onHide() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面卸载 | ||||
|    */ | ||||
|   onUnload() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面相关事件处理函数--监听用户下拉动作 | ||||
|    */ | ||||
|   onPullDownRefresh() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面上拉触底事件的处理函数 | ||||
|    */ | ||||
|   onReachBottom() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 用户点击右上角分享 | ||||
|    */ | ||||
|   onShareAppMessage() { | ||||
|  | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										13
									
								
								pages/meterBalanceRecord/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								pages/meterBalanceRecord/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| { | ||||
|   "usingComponents": { | ||||
|     "navigator": "/components/navigator/index", | ||||
|     "timePicker": "/components/timePicker/index", | ||||
|     "van-icon": "@vant/weapp/icon/index", | ||||
|     "van-tag": "@vant/weapp/tag/index", | ||||
|     "van-row": "@vant/weapp/row/index", | ||||
|     "empty": "/components/empty/index", | ||||
|     "table": "/components/table/table", | ||||
|     "van-col": "@vant/weapp/col/index" | ||||
|   }, | ||||
|   "navigationStyle": "custom" | ||||
| } | ||||
							
								
								
									
										74
									
								
								pages/meterBalanceRecord/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								pages/meterBalanceRecord/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,74 @@ | ||||
| <!--pages/meterBalanceRecord/index.wxml--> | ||||
| <navigator title="电费扣款记录" canBack="{{true}}" /> | ||||
| <view class="pageWrapper"> | ||||
|     <view class="timeChooseWrapper"> | ||||
|         <view> 选择时间 </view> | ||||
|         <view class="time" bind:tap="clickTime"> | ||||
|  | ||||
|             <view class="timeText"> {{time}} </view> | ||||
|             <van-icon name="arrow-down" /> | ||||
|         </view> | ||||
|     </view> | ||||
|  | ||||
|     <view class="customTable" wx:if="{{list.length}}"> | ||||
|         <!-- <view class="customTableTile"> | ||||
|             <van-row> | ||||
|                 <van-col span="4"> | ||||
|                     <view style="text-align: center;"> 日期 </view> | ||||
|                 </van-col> | ||||
|                 <van-col span="6"> | ||||
|                     <view style="text-align: center;"> 充值金额 </view> | ||||
|                 </van-col> | ||||
|                 <van-col span="6"> | ||||
|                     <view style="text-align: center;"> 电费 </view> | ||||
|                 </van-col> | ||||
|                 <van-col span="8"> | ||||
|                     <view style="text-align: center;"> 电表余额 </view> | ||||
|                 </van-col> | ||||
|             </van-row> | ||||
|         </view> | ||||
|         <view class="customTableContent" wx:for="{{list}}" wx:key="id"> | ||||
|             <view class="tableRow"> | ||||
|                 <van-row> | ||||
|                     <van-col span="4"> | ||||
|                         <view style="text-align: center;"> {{ item.day }} </view> | ||||
|                     </van-col> | ||||
|                     <van-col span="6"> | ||||
|                         <view style="text-align: center;" wx:if="{{item.type === 1 || item.type === 7}}"> {{ item.topFee }} </view> | ||||
|                         <view style="text-align: center;" wx:elif="{{item.type === 5 || item.type === 6 || item.type === 8}}"> -{{ item.topFee }} </view> | ||||
|                         <view style="text-align: center;" wx:else> 0 </view> | ||||
|                     </van-col> | ||||
|                     <van-col span="6"> | ||||
|                         <view style="text-align: center;" wx:if="{{item.type == 1 || item.type === 5 || item.type === 6 || item.type === 7 || item.type === 8}}"> | ||||
|                             0 | ||||
|                         </view> | ||||
|                         <view style="text-align: center;" wx:else> {{item.money}} </view> | ||||
|                     </van-col> | ||||
|                     <van-col span="8"> | ||||
|                         <view style="text-align: center;"> {{item.balance}} </view> | ||||
|                     </van-col> | ||||
|                 </van-row> | ||||
|             </view> | ||||
|              | ||||
|         </view> --> | ||||
|         <table  | ||||
|             header="{{header}}"  | ||||
|             list="{{list}}"  | ||||
|             border="{{true}}" | ||||
|             topStyle="text-align: center"  | ||||
|             bodyStyle="text-align: center"  | ||||
|             topColor="rgb(242,248,246)"   | ||||
|         /> | ||||
|     </view> | ||||
|     <empty bind:refresh="getList" wx:else /> | ||||
| </view> | ||||
|  | ||||
|  | ||||
| <timePicker  | ||||
|   type="month"  | ||||
|   currentDate="{{timeStamp}}"  | ||||
|   show="{{timeVisible}}"  | ||||
|   bind:cancel="onTimeCancel"  | ||||
|   bind:close="onTimeClose"  | ||||
|   bind:confirm="onTimeConfirm"  | ||||
| /> | ||||
							
								
								
									
										91
									
								
								pages/meterBalanceRecord/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								pages/meterBalanceRecord/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,91 @@ | ||||
| /* pages/meterBalanceRecord/index.wxss */ | ||||
| .pageWrapper { | ||||
|     margin: 30rpx; | ||||
| } | ||||
|  | ||||
| .time { | ||||
|     flex: 1; | ||||
|     margin-left: 30rpx; | ||||
|     margin-right: 30rpx; | ||||
|     display: flex; | ||||
|     padding: 10rpx 20rpx; | ||||
|     border-radius: 12rpx; | ||||
|     border: 1rpx solid #ccc; | ||||
|     background-color: #fff; | ||||
|   } | ||||
|  | ||||
|   .timeChooseWrapper { | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     font-size: 36rpx; | ||||
|   } | ||||
|    | ||||
|    | ||||
|   .timeText { | ||||
|     flex: 1; | ||||
|   } | ||||
|  | ||||
|   .table { | ||||
|     width: 890rpx; | ||||
|      | ||||
| } | ||||
|  | ||||
| .classWrapper { | ||||
|     width: 100vw; | ||||
|     overflow-x: auto; | ||||
| } | ||||
|  | ||||
| .thead { | ||||
|     display: flex; | ||||
|     flex-wrap: nowrap; | ||||
|     border-bottom: 1rpx solid #EEEEEE; | ||||
| } | ||||
|  | ||||
| .thead  .th { | ||||
|     padding: 20rpx; | ||||
|     white-space: nowrap; | ||||
|     text-align: center; | ||||
|     box-sizing: border-box; | ||||
|  | ||||
| } | ||||
|  | ||||
| .tbody { | ||||
|     width: 890rpx; | ||||
| } | ||||
|  | ||||
| .tbody .tr { | ||||
|     padding: 20rpx; | ||||
|     border-bottom: 1rpx solid #EEEEEE; | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     flex-wrap: nowrap; | ||||
| } | ||||
|  | ||||
| .tbody .th { | ||||
|     word-break: break-all; | ||||
|     text-align: center; | ||||
| } | ||||
|  | ||||
| .customTable { | ||||
|     margin: 20rpx 0; | ||||
|     padding-bottom: 30rpx; | ||||
| } | ||||
|  | ||||
| .customTableTile { | ||||
|     background-color: var(--light-green); | ||||
|     padding: 16rpx; | ||||
|     box-sizing: border-box; | ||||
|     font-weight: 700; | ||||
| } | ||||
|  | ||||
| .tableRow { | ||||
|     padding: 16rpx; | ||||
|     border: 1rpx solid #ccc; | ||||
|     border-top: 0rpx; | ||||
|     font-size: 32rpx; | ||||
| } | ||||
|  | ||||
|  | ||||
| page { | ||||
|     background-color: var(--transparent-green); | ||||
|   } | ||||
| @@ -97,7 +97,7 @@ Page({ | ||||
|   }, | ||||
|   jumpToWorkBench() { | ||||
|     wx.navigateTo({ | ||||
|       url: '/pages/workBench/index', | ||||
|       url: '/pages/workBenchNew/index', | ||||
|     }) | ||||
|   }, | ||||
|   jumpToIntegral() { | ||||
| @@ -144,15 +144,27 @@ Page({ | ||||
|     }) | ||||
|   }, | ||||
|   connect() { | ||||
|     Dialog.alert({ | ||||
|       title: '提示', | ||||
|       message: '将进入咨询客服页面', | ||||
|       confirmButtonOpenType: "contact", | ||||
|       showCancelButton: true, | ||||
|     }).then(() => { | ||||
|       // on close | ||||
|     }); | ||||
|      | ||||
|     // Dialog.alert({ | ||||
|     //   title: '提示', | ||||
|     //   message: '将进入咨询客服页面', | ||||
|     //   "confirm-button-open-type": "contact", | ||||
|     //   showCancelButton: true, | ||||
|     // }).then(() => { | ||||
|     //   // on close | ||||
|     // }); | ||||
|     this.setData({ | ||||
|       connectShow: true | ||||
|     }) | ||||
|   }, | ||||
|   bindConnect() { | ||||
|     this.setData({ | ||||
|       connectShow: false | ||||
|     }) | ||||
|   }, | ||||
|   bindCancelConnect() { | ||||
|     this.setData({ | ||||
|       connectShow: false | ||||
|     }) | ||||
|   }, | ||||
|   jumpToFinance() { | ||||
|     wx.navigateTo({ | ||||
|   | ||||
| @@ -69,6 +69,7 @@ | ||||
|     /> | ||||
|   </view> | ||||
|   <view style="border-radius: 16rpx; overflow: hidden;"> | ||||
|   <!-- <button open-type="contact" class="connect"> 联系客服 </button> --> | ||||
|     <van-cell title="联系客服" value="" is-link bind:tap="connect" icon="service-o" /> | ||||
|     <van-cell icon="qr" wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" /> | ||||
|     <van-cell icon="friends-o" wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember"> | ||||
| @@ -88,4 +89,18 @@ | ||||
|   </view> | ||||
|  | ||||
|   <van-dialog id="van-dialog" /> | ||||
| </view> | ||||
| </view> | ||||
|  | ||||
| <van-dialog | ||||
|   title="提示" | ||||
|   message="将进入咨询客服页面" | ||||
|   show="{{ connectShow }}" | ||||
|   custom-class="my-custom-class" | ||||
|   show-cancel-button | ||||
|   use-confirm-button-slot="{{true}}" | ||||
|   use-cancel-button-slot="{{true}}" | ||||
| > | ||||
|   <button slot="cancel-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindCancelConnect"> 取消 </button> | ||||
|   <button open-type="contact" slot="confirm-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindConnect"> 确认 </button> | ||||
| </van-dialog> | ||||
|  | ||||
|   | ||||
| @@ -40,3 +40,6 @@ | ||||
|   margin-top: 6rpx; | ||||
| } | ||||
|  | ||||
| .connect { | ||||
|   display: none; | ||||
| } | ||||
|   | ||||
							
								
								
									
										30
									
								
								pages/readingHistory/components/detailModal/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								pages/readingHistory/components/detailModal/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| // pages/readingHistory/components/detailModal/index.js | ||||
| Component({ | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|     visible: Boolean, | ||||
|     detail: Object, | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|     showImage() { | ||||
|       this.setData({ show: true }) | ||||
|     }, | ||||
|     onClose() { | ||||
|       this.setData({ show: false }) | ||||
|     } | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										9
									
								
								pages/readingHistory/components/detailModal/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								pages/readingHistory/components/detailModal/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| { | ||||
|   "component": true, | ||||
|   "usingComponents": { | ||||
|     "van-dialog": "@vant/weapp/dialog/index", | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-image": "@vant/weapp/image/index", | ||||
|     "van-popup": "@vant/weapp/popup/index" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										64
									
								
								pages/readingHistory/components/detailModal/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								pages/readingHistory/components/detailModal/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| <!--pages/readingHistory/components/detailModal/index.wxml--> | ||||
| <van-dialog | ||||
|   use-slot | ||||
|   title="详情" | ||||
|   show="{{ visible }}" | ||||
|   confirmButtonText="关闭" | ||||
|   bind:close="onClose" | ||||
| > | ||||
|   <view class="modalContentWrapper"> | ||||
|     <van-field | ||||
|         value="{{ detail.readAt }}" | ||||
|         label="时间" | ||||
|         readonly | ||||
|         border="{{ false }}" | ||||
|         use-button-slot | ||||
|         title-width="100rpx" | ||||
|     > | ||||
|     </van-field> | ||||
|     <van-field | ||||
|         value="{{ detail.overall }}" | ||||
|         placeholder="请输入读数" | ||||
|         label="读数" | ||||
|         readonly | ||||
|         type="digit" | ||||
|         border="{{ false }}" | ||||
|         title-width="100rpx" | ||||
|     > | ||||
|     </van-field> | ||||
|     <van-field | ||||
|         wx:if="{{!!detail.url}}" | ||||
|         value="{{ detail.overall }}" | ||||
|         label="图片" | ||||
|         readonly | ||||
|         border="{{ false }}" | ||||
|         title-width="100rpx" | ||||
|         use-button-slot | ||||
|     > | ||||
|         <view slot="input"> | ||||
|             <van-image  | ||||
|                 width="100"  | ||||
|                 height="100"  | ||||
|                 fit="contain" | ||||
|                 src="{{detail.url}}"  | ||||
|                 bind:click="showImage" | ||||
|             /> | ||||
|         </view> | ||||
|     </van-field> | ||||
| </view> | ||||
|   | ||||
| </van-dialog> | ||||
|  | ||||
| <van-popup  | ||||
|     show="{{ show }}"  | ||||
|     bind:close="onClose" | ||||
|     z-index="99999" | ||||
| > | ||||
|     <van-image  | ||||
|         width="100vw" | ||||
|         height="99.1vh" | ||||
|         fit="contain" | ||||
|         src="{{detail.url}}"  | ||||
|         bind:click="onClose" | ||||
|     /> | ||||
| </van-popup> | ||||
							
								
								
									
										1
									
								
								pages/readingHistory/components/detailModal/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								pages/readingHistory/components/detailModal/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| /* pages/readingHistory/components/detailModal/index.wxss */ | ||||
							
								
								
									
										116
									
								
								pages/readingHistory/components/editModal/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										116
									
								
								pages/readingHistory/components/editModal/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,116 @@ | ||||
| // pages/workBench/components/tenement/components/bindMeter/index.js | ||||
| // 0015980101 | ||||
| import { createReading, updateReading } from "../../../../service/workBench" | ||||
| import { getWorkMeterDetail } from "../../../../service/meter" | ||||
| import { alertInfo, alertSuccess, alertError } from "../../../../utils/index"; | ||||
| import request from "../../../../utils/request" | ||||
| import dayjs from "../../../../utils/dayjs" | ||||
| const { OK } = request | ||||
| Component({ | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|     visible: Boolean, | ||||
|     title: String, | ||||
|     timeProps: String, | ||||
|     numberProps: String, | ||||
|     idProps: String, | ||||
|     meter: String, | ||||
|     park: String, | ||||
|     routeId: String, | ||||
|   }, | ||||
|   observers: { | ||||
|     "timeProps": function(newValue) { | ||||
|       this.setData({ | ||||
|         time: newValue, | ||||
|         // startTime: newValue | ||||
|       }) | ||||
|     }, | ||||
|     "numberProps": function(newValue) { | ||||
|       this.setData({ | ||||
|         number: newValue | ||||
|       }) | ||||
|     }, | ||||
|   }, | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     dateTimeShow: false, | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|     onCancel() { | ||||
|       this.setData({ | ||||
|         show: false, | ||||
|         title: "", | ||||
|         type: "", | ||||
|       }) | ||||
|       // this.triggerEvent("close") | ||||
|     }, | ||||
|     onClose() { | ||||
|       this.setData({ | ||||
|         show: false, | ||||
|         title: "", | ||||
|         type: "", | ||||
|       }) | ||||
|     }, | ||||
|     onChange(e) { | ||||
|       const { name } = e.currentTarget.dataset; | ||||
|       this.setData({ | ||||
|         [name]: e.detail | ||||
|       }) | ||||
|     }, | ||||
|     async onSubmit() { | ||||
|       const { time, number, idProps, park, meter, timeProps, routeId } = this.data; | ||||
|       if (time == null || number == null) { | ||||
|         alertInfo("请正确填写后保存") | ||||
|         return; | ||||
|       } | ||||
|       if (!idProps) { | ||||
|         const { code, message } = await createReading(park, meter, routeId, { | ||||
|           overall: `${number}`, | ||||
|           flat: `${number}`, | ||||
|           readAt: time, | ||||
|           source: 1,        | ||||
|         }) | ||||
|         if (code !== OK) { | ||||
|           alertError(message) | ||||
|           return | ||||
|         } | ||||
|         alertSuccess("录入成功") | ||||
|         this.setData({ number: null, time: null, startTime: null }) | ||||
|       } else { | ||||
|         const { code, message } = await updateReading(park, meter, new Date(timeProps).getTime() * 1000, { | ||||
|           overall: `${number}`, | ||||
|           flat: `${number}`, | ||||
|         }) | ||||
|         if (code !== OK) { | ||||
|           alertError(message) | ||||
|           return | ||||
|         } | ||||
|         alertSuccess("录入成功") | ||||
|         this.setData({ number: null, time: null, startTime: null }) | ||||
|       } | ||||
|       const that = this; | ||||
|       setTimeout(() => { | ||||
|         that.triggerEvent("ok") | ||||
|       }, 300) | ||||
|     }, | ||||
|  | ||||
|     dateTimeConfirm(e) { | ||||
|       this.setData({ time: e.detail.time, dateTimeShow: false }) | ||||
|     }, | ||||
|     dateTimeCancal(e) { | ||||
|       this.setData({ dateTimeShow: false }) | ||||
|     }, | ||||
|     onTimeFocus() { | ||||
|       this.setData({ dateTimeShow: true }) | ||||
|     } | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										10
									
								
								pages/readingHistory/components/editModal/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								pages/readingHistory/components/editModal/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| { | ||||
|   "component": true, | ||||
|   "usingComponents": { | ||||
|     "van-dialog": "@vant/weapp/dialog/index", | ||||
|     "search-select": "/components/searchSelect/index", | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "date-time-picker": "/components/DateTimePicker/index" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										54
									
								
								pages/readingHistory/components/editModal/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								pages/readingHistory/components/editModal/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,54 @@ | ||||
| <!--pages/workBench/components/tenement/components/bindMeter/index.wxml--> | ||||
| <van-dialog | ||||
|   use-slot | ||||
|   title="{{title}}" | ||||
|   show="{{ visible }}" | ||||
|   show-cancel-button | ||||
|   bind:confirm="onSubmit" | ||||
|   bind:close="onClose" | ||||
| > | ||||
|   <view class="modalContentWrapper"> | ||||
|     <van-field | ||||
|         value="{{ time }}" | ||||
|         placeholder="请选择绑定时间" | ||||
|         label="时间" | ||||
|         readonly | ||||
|         border="{{ false }}" | ||||
|         use-button-slot | ||||
|         title-width="100rpx" | ||||
|     > | ||||
|         <!-- <van-button slot="button" size="small" type="info" bind:click="onTimeFocus" wx:if="{{!idProps}}"> | ||||
|         选择 | ||||
|         </van-button> --> | ||||
|     </van-field> | ||||
|     <van-field | ||||
|         value="{{ number }}" | ||||
|         placeholder="请输入读数" | ||||
|         label="读数" | ||||
|         bind:change="onChange" | ||||
|         data-name="number" | ||||
|         type="digit" | ||||
|         border="{{ false }}" | ||||
|         title-width="100rpx" | ||||
|     > | ||||
|     </van-field> | ||||
| </view> | ||||
|   | ||||
| </van-dialog> | ||||
|  | ||||
| <search-select  | ||||
|     show="{{show}}"  | ||||
|     title="{{title}}"  | ||||
|     type="{{type}}"  | ||||
|     park="{{park}}" | ||||
|     bindconfirm="onConfirm" | ||||
|     bindcancel="onCancel" | ||||
| /> | ||||
|  | ||||
| <date-time-picker  | ||||
|     wx:if="{{dateTimeShow}}" | ||||
|     show="{{dateTimeShow}}" | ||||
|     time="{{startTime}}" | ||||
|     bind:confirm="dateTimeConfirm" | ||||
|     bind:cancel="dateTimeCancal" | ||||
| /> | ||||
							
								
								
									
										1
									
								
								pages/readingHistory/components/editModal/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								pages/readingHistory/components/editModal/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| /* pages/workBench/components/tenement/components/bindMeter/index.wxss */ | ||||
							
								
								
									
										24
									
								
								pages/readingHistory/components/meterInfo/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								pages/readingHistory/components/meterInfo/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| // pages/readingHistory/components/meterInfo/index.js | ||||
| Component({ | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|     meterInfo: Object, | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|  | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										8
									
								
								pages/readingHistory/components/meterInfo/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								pages/readingHistory/components/meterInfo/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| { | ||||
|   "component": true, | ||||
|   "usingComponents": { | ||||
|     "van-row": "@vant/weapp/row/index", | ||||
|     "van-col": "@vant/weapp/col/index", | ||||
|     "van-tag": "@vant/weapp/tag/index" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										68
									
								
								pages/readingHistory/components/meterInfo/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								pages/readingHistory/components/meterInfo/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,68 @@ | ||||
| <!--pages/readingHistory/components/meterInfo/index.wxml--> | ||||
| <view class="wrapper"> | ||||
|     <view class="title"> | ||||
|         <view class="address"> | ||||
|             {{meterInfo.address}} | ||||
|         </view> | ||||
|         <view class="status"> | ||||
|             <view wx:if="{{meterInfo.enabled}}"> | ||||
|                 正常 | ||||
|             </view> | ||||
|             <view wx:else> | ||||
|                 停用 | ||||
|             </view> | ||||
|         </view> | ||||
|     </view> | ||||
|     <view class="detail"> | ||||
|             <van-row gutter="20"> | ||||
|                 <van-col span="12"> | ||||
|                     <view class="text"> | ||||
|                         <view> | ||||
|                            设备编号 | ||||
|                         </view> | ||||
|                         <view> | ||||
|                             {{meterInfo.meterSn}} | ||||
|                         </view> | ||||
|                     </view> | ||||
|                 </van-col> | ||||
|                 <van-col span="12"> | ||||
|                     <view class="text"> | ||||
|                         <view> | ||||
|                             电表类型 | ||||
|                         </view> | ||||
|                         <view> | ||||
|                             <view wx:if="{{meterInfo.meterBelongType === 0}}"> | ||||
|                                 商户电表 | ||||
|                             </view> | ||||
|                             <view wx:elif="{{meterInfo.meterBelongType === 1}}"> | ||||
|                                 公区电表 | ||||
|                             </view> | ||||
|                             <view wx:elif="{{meterInfo.meterBelongType === 2}}"> | ||||
|                                 公摊电表 | ||||
|                             </view> | ||||
|                         </view> | ||||
|                     </view> | ||||
|                 </van-col> | ||||
|                 <van-col span="12"> | ||||
|                     <view class="text"> | ||||
|                         <view> | ||||
|                             最近读数 | ||||
|                         </view> | ||||
|                         <view> | ||||
|                             {{meterInfo.overall}} | ||||
|                         </view> | ||||
|                     </view> | ||||
|                 </van-col> | ||||
|                 <van-col span="12"> | ||||
|                     <view class="text"> | ||||
|                         <view> | ||||
|                             读数日期 | ||||
|                         </view> | ||||
|                         <view> | ||||
|                             {{meterInfo.readAt}} | ||||
|                         </view> | ||||
|                     </view> | ||||
|                 </van-col> | ||||
|             </van-row> | ||||
|         </view> | ||||
| </view> | ||||
							
								
								
									
										26
									
								
								pages/readingHistory/components/meterInfo/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								pages/readingHistory/components/meterInfo/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| /* pages/readingHistory/components/meterInfo/index.wxss */ | ||||
| .wrapper { | ||||
|     margin: 20rpx 0; | ||||
|     padding: 20rpx; | ||||
|     box-sizing: border-box; | ||||
|     background-color: white; | ||||
|     border-radius: 16rpx; | ||||
| } | ||||
|  | ||||
| .title { | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     justify-content: space-between; | ||||
|     margin-bottom: 40rpx; | ||||
| } | ||||
|  | ||||
| .detail .text { | ||||
|     display: flex; | ||||
|     justify-content: space-between; | ||||
|     font-size: 30rpx; | ||||
|     margin-bottom: 20rpx; | ||||
| } | ||||
|  | ||||
| .status { | ||||
|     font-size: 30rpx; | ||||
| } | ||||
							
								
								
									
										180
									
								
								pages/readingHistory/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										180
									
								
								pages/readingHistory/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,180 @@ | ||||
| // pages/readingHistory/index.js | ||||
| import { getMeterReadingRouteMeterDetail, getReadingList, deleteReading } from "../../service/workBench" | ||||
| import request from "../../utils/request" | ||||
| import { alertInfo, alertSuccess, alertError, loadingFunc } from "../../utils/index" | ||||
| const { OK } = request; | ||||
| import dayjs from "../../utils/dayjs" | ||||
| Page({ | ||||
|  | ||||
|   /** | ||||
|    * 页面的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     list: [], | ||||
|     page: 1, | ||||
|     size: 20, | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|     const { meter, park, routeId, disabled } = options; | ||||
|     const that = this; | ||||
|     this.setData({ | ||||
|       meter, | ||||
|       park, | ||||
|       routeId, | ||||
|       disabled | ||||
|     }, () => { | ||||
|       that.refresh(); | ||||
|     }) | ||||
|     this.getMeterInfo(meter); | ||||
|   }, | ||||
|   refresh() { | ||||
|     const that = this; | ||||
|     loadingFunc(async () => { | ||||
|       await that.getList(); | ||||
|     }) | ||||
|   }, | ||||
|   onEditFinish() { | ||||
|     this.setData({ | ||||
|       title: null, | ||||
|       visible: null, | ||||
|       time: null, | ||||
|       number: null, | ||||
|       id: null, | ||||
|       readAtTimestamp: null, | ||||
|       type: null, | ||||
|     }) | ||||
|     this.refresh() | ||||
|   }, | ||||
|   async getMeterInfo(id) { | ||||
|     const { code, message, data } = await getMeterReadingRouteMeterDetail(id) | ||||
|     if (code !== OK) { | ||||
|       alertError(message) | ||||
|       return; | ||||
|     } | ||||
|     this.setData({ meterInfo: data }) | ||||
|   }, | ||||
|   async getList() { | ||||
|     const { meter, park, page, size } = this.data; | ||||
|     const { code, message, records: data } = await getReadingList(park, meter, page) | ||||
|     if (code !== OK) { | ||||
|       alertError(message) | ||||
|       return; | ||||
|     } | ||||
|     this.setData({ | ||||
|       list: data, | ||||
|       totalPage: Math.ceil(data?.length / size) | ||||
|     }) | ||||
|   }, | ||||
|   async onChangePage(e) { | ||||
|     const newPage = e.detail.currentIndex; | ||||
|     const that = this; | ||||
|     this.setData({ | ||||
|       page: newPage | ||||
|     }, () => { | ||||
|       that.getList(); | ||||
|     }) | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面初次渲染完成 | ||||
|    */ | ||||
|   onReady() { | ||||
|  | ||||
|   }, | ||||
|   handleCreate() { | ||||
|     this.setData({ | ||||
|       title: "新增记录", | ||||
|       visible: true, | ||||
|       type: "create", | ||||
|       time: dayjs().format("YYYY-MM-DD HH:mm:ss") | ||||
|     }) | ||||
|   }, | ||||
|   handleUpdate(e) { | ||||
|     const { data } = e.currentTarget.dataset; | ||||
|     this.setData({ | ||||
|       title: "编辑记录", | ||||
|       visible: true, | ||||
|       time: data.readAt, | ||||
|       number: data.overall, | ||||
|       id: data.id, | ||||
|       readAtTimestamp: data.readAtTimestamp, | ||||
|       type: "edit", | ||||
|     }) | ||||
|   }, | ||||
|   handleDetail(e) { | ||||
|     const { data } = e.currentTarget.dataset; | ||||
|     this.setData({ | ||||
|       detail: data, | ||||
|       detailVisible: true | ||||
|     }) | ||||
|   }, | ||||
|   handleDelete(e) { | ||||
|     const { data } = e.currentTarget.dataset; | ||||
|     const that = this; | ||||
|     wx.showModal({ | ||||
|       title: '删除确认', | ||||
|       content: '确认要删除这一项记录吗?', | ||||
|       complete: async (res) => { | ||||
|         if (res.cancel) { | ||||
|            | ||||
|         } | ||||
|      | ||||
|         if (res.confirm) { | ||||
|           const { code, message } = await deleteReading(data?.id, data?.overall) | ||||
|           if (code !== OK) { | ||||
|             alertError(message) | ||||
|             return | ||||
|           } | ||||
|           alertSuccess("删除成功") | ||||
|           setTimeout(() => { | ||||
|             that.refresh() | ||||
|           }, 300) | ||||
|         } | ||||
|       } | ||||
|     }) | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面隐藏 | ||||
|    */ | ||||
|   onHide() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面卸载 | ||||
|    */ | ||||
|   onUnload() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面相关事件处理函数--监听用户下拉动作 | ||||
|    */ | ||||
|   onPullDownRefresh() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面上拉触底事件的处理函数 | ||||
|    */ | ||||
|   onReachBottom() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 用户点击右上角分享 | ||||
|    */ | ||||
|   onShareAppMessage() { | ||||
|  | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										13
									
								
								pages/readingHistory/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								pages/readingHistory/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| { | ||||
|   "usingComponents": { | ||||
|     "navigator": "/components/navigator/index", | ||||
|     "meterInfo": "./components/meterInfo/index", | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "van-icon": "@vant/weapp/icon/index", | ||||
|     "editModal": "./components/editModal/index", | ||||
|     "pagination": "/components/pagination/index", | ||||
|     "empty": "/components/empty/index", | ||||
|     "detailModal": "./components/detailModal/index" | ||||
|   }, | ||||
|   "navigationStyle": "custom" | ||||
| } | ||||
							
								
								
									
										67
									
								
								pages/readingHistory/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								pages/readingHistory/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,67 @@ | ||||
| <!--pages/readingHistory/index.wxml--> | ||||
| <navigator title="历史抄表记录" canBack="{{true}}" /> | ||||
| <view class="wrapper"> | ||||
|     <meterInfo meterInfo="{{meterInfo}}" /> | ||||
|     <view class="historyTitle"> | ||||
|         <view class="text"> | ||||
|             抄表记录历史 | ||||
|         </view> | ||||
|         <van-button disabled="{{disabled === 'true'}}" type="info" size="small" icon="plus" bind:tap="handleCreate"> 新增记录 </van-button> | ||||
|     </view> | ||||
|     <view> | ||||
|         <view wx:if="{{list.length}}"> | ||||
|             <view class="tableWrapper"> | ||||
|                 <view class="table"> | ||||
|                     <view class="thead"> | ||||
|                         <view class="th" style="width: 40%; text-align: center;"> 抄表时间 </view> | ||||
|                         <view class="th" style="width: 30%; text-align: center;"> 抄表读数 </view> | ||||
|                         <view class="th" style="width: 30%; text-align: center;"> 操作 </view> | ||||
|                     </view> | ||||
|                     <view class="tbody"> | ||||
|                         <view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item"> | ||||
|                             <view class="tr" style="display: flex; align-items: center; "> | ||||
|                                 <view class="th" style="width: 40%; text-align: center; font-size: 30rpx;"> | ||||
|                                     {{ item.readAt }} | ||||
|                                 </view> | ||||
|                                 <view class="th" style="width: 30%; text-align: center; font-size: 30rpx;"> | ||||
|                                     {{ item.overall }} | ||||
|                                 </view> | ||||
|      | ||||
|                                 <view class="th" style="width: 30%; text-align: center; justify-content: center; display: flex; align-items: center;"> | ||||
|                                     <van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="edit" size="40rpx" bind:tap="handleUpdate"  data-data="{{item}}" color="#15755e" /> | ||||
|                                     <van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="delete" size="40rpx" bind:tap="handleDelete" data-data="{{item}}" color="#15755e" custom-style="margin-left: 20rpx" /> | ||||
|                                     <van-icon name="ellipsis" size="40rpx" data-data="{{item}}" color="#15755e" bind:tap="handleDetail" custom-style="margin-left: 20rpx" /> | ||||
|                                 </view> | ||||
|                             </view> | ||||
|                         </view> | ||||
|                     </view> | ||||
|                 </view> | ||||
|             </view> | ||||
|  | ||||
|             <pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" /> | ||||
|  | ||||
|         </view> | ||||
|         <empty bind:refresh="refresh" wx:else /> | ||||
|  | ||||
|     </view> | ||||
| </view> | ||||
|  | ||||
| <editModal  | ||||
|     wx:if="{{visible}}" | ||||
|     title="{{title}}"  | ||||
|     visible="{{visible}}"  | ||||
|     timeProps="{{time}}"  | ||||
|     timeStamp="{{readAtTimestamp}}" | ||||
|     numberProps="{{number}}"  | ||||
|     idProps="{{id}}"  | ||||
|     park="{{park}}" | ||||
|     meter="{{meter}}"  | ||||
|     bind:ok="onEditFinish"    | ||||
|     startTime="{{startTime}}" | ||||
|     routeId="{{routeId}}" | ||||
| /> | ||||
|  | ||||
| <detailModal | ||||
|     visible="{{detailVisible}}" | ||||
|     detail="{{detail}}" | ||||
| /> | ||||
							
								
								
									
										77
									
								
								pages/readingHistory/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								pages/readingHistory/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,77 @@ | ||||
| /* pages/readingHistory/index.wxss */ | ||||
| page { | ||||
|     background-color: #ebedf0; | ||||
| } | ||||
|  | ||||
| .wrapper { | ||||
|     padding: 0 20rpx 20rpx; | ||||
|     box-sizing: border-box; | ||||
| } | ||||
|  | ||||
| .historyTitle { | ||||
|     display: flex; | ||||
|     justify-content: space-between; | ||||
|     align-items: center; | ||||
| } | ||||
|  | ||||
| .historyTitle .text { | ||||
|     font-size: 32rpx; | ||||
| } | ||||
|  | ||||
| .table { | ||||
|     width: 100%; | ||||
|  | ||||
| } | ||||
|  | ||||
| .tableWrapper { | ||||
|     width: 100%; | ||||
|     margin-top: 30rpx; | ||||
|     background-color: #fff; | ||||
|     overflow-x: auto; | ||||
|     padding: 20rpx 12rpx; | ||||
|     box-sizing: border-box; | ||||
| } | ||||
|  | ||||
| .thead { | ||||
|      | ||||
|     display: flex; | ||||
|     flex-wrap: nowrap; | ||||
|   | ||||
| } | ||||
|  | ||||
| .thead  .th { | ||||
|     padding: 10rpx; | ||||
|     white-space: nowrap; | ||||
|     text-align: center; | ||||
|     box-sizing: border-box; | ||||
| } | ||||
|  | ||||
| .primaryTextBtn { | ||||
|     color: #1989fa; | ||||
|   } | ||||
|  | ||||
| .tbody { | ||||
|     width: 100%; | ||||
| } | ||||
|  | ||||
| .tbody .tr { | ||||
|     padding: 10rpx; | ||||
|     border-bottom: 1rpx solid #EEEEEE; | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     flex-wrap: nowrap; | ||||
| } | ||||
|  | ||||
| .tbody .tr { | ||||
|     word-break: break-all; | ||||
|     text-align: center; | ||||
| } | ||||
|  | ||||
| .more-icon { | ||||
|     padding: 20rpx; | ||||
|     color: #1989fa; | ||||
|     display: flex; | ||||
|     justify-content: center; | ||||
|     align-items: center; | ||||
|   } | ||||
|    | ||||
| @@ -94,6 +94,7 @@ Page({ | ||||
|                   wx.openDocument({ | ||||
|                     filePath: res.tempFilePath, | ||||
|                     fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!! | ||||
|                     showMenu: true, | ||||
|                     success: function (res) { | ||||
|                       resolve() | ||||
|                     }, | ||||
|   | ||||
| @@ -11,7 +11,7 @@ | ||||
|     border="{{ false }}" | ||||
|   /> | ||||
|   <van-field | ||||
|     value="{{detail.meter.code}}" | ||||
|     value="{{detail.meter.sn}}(SN)" | ||||
|     label="电表编号" | ||||
|     readonly | ||||
|     autosize="{{true}}" | ||||
|   | ||||
| @@ -102,7 +102,6 @@ Page({ | ||||
|   }, | ||||
|   onChangePay(e) { | ||||
|     const { id, name } = e; | ||||
|     console.log('e', e) | ||||
|     const { year, codeId } = this.data; | ||||
|     this.setData({ | ||||
|       payType: name,  | ||||
|   | ||||
| @@ -71,11 +71,9 @@ Page({ | ||||
|         }) | ||||
|       }, | ||||
|       fail: (res) => { | ||||
|         console.log('fail', res) | ||||
|         alertInfo("请稍后重试") | ||||
|       }, | ||||
|       complete: (res) => { | ||||
|         console.log('complete') | ||||
|         that.handleGetMeterDetail(meter.id) | ||||
|       } | ||||
|     }) | ||||
|   | ||||
							
								
								
									
										103
									
								
								pages/workBench/components/reading/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								pages/workBench/components/reading/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,103 @@ | ||||
| // pages/workBench/components/reading/index.js | ||||
| import { getMeterReadingRouteList, changeMeterRouteStatus } from "../../../../service/workBench" | ||||
| import { alertError, alertSuccess, loadingFunc } from "../../../../utils/index" | ||||
| import request from "../../../../utils/request" | ||||
| const { OK } = request | ||||
|  | ||||
| Component({ | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     park: "", | ||||
|     parkName: "" | ||||
|   }, | ||||
|   lifetimes: { | ||||
|     attached() { | ||||
|       if (this.data.parkName) { | ||||
|         this.init(); | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|     onParkFocus(e) { | ||||
|       this.setData({ | ||||
|         show: true, | ||||
|         title: "园区", | ||||
|         type: 'park' | ||||
|       }) | ||||
|     }, | ||||
|     async init() { | ||||
|       const { parkName, park } = this.data; | ||||
|       const { code, message, data } = await getMeterReadingRouteList(parkName) | ||||
|       if (code !== OK) { | ||||
|         alertError(message) | ||||
|         return | ||||
|       } | ||||
|       this.setData({ | ||||
|         list: data | ||||
|       }) | ||||
|     }, | ||||
|     onConfirm(e) { | ||||
|       const { data } = e.detail; | ||||
|       const that = this; | ||||
|       this.setData({ | ||||
|         parkName: data.name, | ||||
|         park: data.id, | ||||
|       }, () => { | ||||
|         loadingFunc(async () => { | ||||
|           await that.init(); | ||||
|         }) | ||||
|       }) | ||||
|       this.onConcal(); | ||||
|     }, | ||||
|     onConcal() { | ||||
|       this.setData({ | ||||
|         show: false, | ||||
|         title: "", | ||||
|         type: "", | ||||
|       }) | ||||
|     }, | ||||
|     jumpToReading(e) { | ||||
|       const { id } = e.currentTarget.dataset; | ||||
|       wx.navigateTo({ | ||||
|         url: `/pages/writeReading/index?id=${id}`, | ||||
|       }) | ||||
|     }, | ||||
|     async changeStartStatus(e) { | ||||
|       const that = this; | ||||
|       const { id } = e.currentTarget.dataset; | ||||
|       const { code, message } = await changeMeterRouteStatus({ id, status: 1 }) | ||||
|       if (code !== OK) { | ||||
|         alertError(message) | ||||
|         return | ||||
|       } | ||||
|       alertSuccess("操作成功") | ||||
|       this.init() | ||||
|       setTimeout(() => { | ||||
|         that.jumpToReading({ currentTarget: { dataset: { id } } }) | ||||
|       }, 500) | ||||
|     }, | ||||
|     async changeEndStatus(e) { | ||||
|       const { id } = e.currentTarget.dataset; | ||||
|       const { code, message } = await changeMeterRouteStatus({ id, status: 0 }) | ||||
|       if (code !== OK) { | ||||
|         alertError(message) | ||||
|         return | ||||
|       } | ||||
|       alertSuccess("操作成功") | ||||
|       this.init() | ||||
|     } | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										16
									
								
								pages/workBench/components/reading/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								pages/workBench/components/reading/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| { | ||||
|   "component": true, | ||||
|   "usingComponents": { | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "search-select": "/components/searchSelect/index", | ||||
|     "van-empty": "@vant/weapp/empty/index", | ||||
|     "table": "/components/table/table", | ||||
|     "pagination": "/components/pagination/index", | ||||
|     "empty": "/components/empty/index", | ||||
|     "van-radio": "@vant/weapp/radio/index", | ||||
|     "van-radio-group": "@vant/weapp/radio-group/index", | ||||
|     "van-dialog": "@vant/weapp/dialog/index", | ||||
|     "van-cell": "@vant/weapp/cell/index" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										64
									
								
								pages/workBench/components/reading/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								pages/workBench/components/reading/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| <!--pages/workBench/components/reading/index.wxml--> | ||||
| <van-field | ||||
|     value="{{ parkName }}" | ||||
|     placeholder="请选择园区" | ||||
|     label="园区" | ||||
|     readonly | ||||
|     border="{{ false }}" | ||||
|     use-button-slot | ||||
|     title-width="100rpx" | ||||
| > | ||||
|     <van-button slot="button" size="small" type="primary" bind:click="onParkFocus"> | ||||
|       选择 | ||||
|     </van-button> | ||||
| </van-field> | ||||
|  | ||||
| <search-select  | ||||
|     show="{{show}}"  | ||||
|     title="{{title}}"  | ||||
|     type="{{type}}"  | ||||
|     park="{{park}}" | ||||
|     bindconfirm="onConfirm" | ||||
|     bindcancel="onConcal" | ||||
| /> | ||||
|  | ||||
| <van-empty description="请先选择园区" wx:if="{{!park}}" /> | ||||
|  | ||||
| <view wx:else> | ||||
|     <view wx:if="{{list.length}}"> | ||||
|         <van-cell  | ||||
|             wx:for="{{list}}" | ||||
|             wx:key="id" | ||||
|             title="{{item.readingRouteName}}"  | ||||
|             label="包含{{item.meterRoute}}个抄表点"     | ||||
|         > | ||||
|             <view slot="right-icon"> | ||||
|                 <van-button  | ||||
|                     type="primary"  | ||||
|                     size="small"  | ||||
|                     type="primary"  | ||||
|                     bind:tap="changeStartStatus" | ||||
|                     custom-style="margin-right: 20rpx;" | ||||
|                     data-id="{{item.id}}" | ||||
|                     wx:if="{{item.status === 0}}" | ||||
|                 > 开始抄表 </van-button> | ||||
|                 <van-button  | ||||
|                     type="primary"  | ||||
|                     size="small"  | ||||
|                     bind:tap="jumpToReading" | ||||
|                     data-id="{{item.id}}" | ||||
|                     custom-style="margin-right: 20rpx;" | ||||
|                     wx:if="{{item.status === 1}}" | ||||
|                 > 去抄表 </van-button> | ||||
|                 <van-button  | ||||
|                     size="small"  | ||||
|                     type="danger"  | ||||
|                     bind:tap="changeEndStatus" | ||||
|                     data-id="{{item.id}}" | ||||
|                     wx:if="{{item.status === 1}}" | ||||
|                 > 结束抄表 </van-button> | ||||
|             </view> | ||||
|         </van-cell> | ||||
|     </view> | ||||
|     <empty wx:else bind:refresh="init" /> | ||||
| </view> | ||||
							
								
								
									
										1
									
								
								pages/workBench/components/reading/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								pages/workBench/components/reading/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| /* pages/workBench/components/reading/index.wxss */ | ||||
| @@ -1,190 +1,279 @@ | ||||
| // pages/workBench/components/recharge/components/waitApprove/index.js | ||||
| import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index"; | ||||
| import { getRechargeApproveList, rechargeApprove } from "../../../../../../service/recharge" | ||||
| import { | ||||
|     alertInfo, | ||||
|     alertSuccess, | ||||
|     loadingFunc | ||||
| } from "../../../../../../utils/index"; | ||||
| import { | ||||
|     getRechargeApproveList, | ||||
|     rechargeApprove | ||||
| } from "../../../../../../service/recharge" | ||||
| import request from "../../../../../../utils/request" | ||||
| const { OK } = request | ||||
| import dayjs from "../../../../../../utils/dayjs" | ||||
| const { | ||||
|     OK | ||||
| } = request | ||||
|  | ||||
| // pages/workBench/components/record/index.js | ||||
| Component({ | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|     status: Number | ||||
|   }, | ||||
|    | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     keyword: "", | ||||
|     keywordTemp: "", | ||||
|     page: 1, | ||||
|   }, | ||||
|   lifetimes: { | ||||
|     attached() { | ||||
|       loadingFunc(async () => { | ||||
|         await this.init(); | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|     onParkFocus(e) { | ||||
|       this.setData({ | ||||
|         show: true, | ||||
|         title: "园区", | ||||
|         type: 'park' | ||||
|       }) | ||||
|     /** | ||||
|      * 组件的属性列表 | ||||
|      */ | ||||
|     properties: { | ||||
|         status: Number | ||||
|     }, | ||||
|     onConfirm(e) { | ||||
|       const { data } = e.detail; | ||||
|       const that = this; | ||||
|       this.setData({ | ||||
|         parkName: data.name, | ||||
|         park: data.id, | ||||
|       }, () => { | ||||
|         loadingFunc(async () => { | ||||
|           await that.init(); | ||||
|         }) | ||||
|       }) | ||||
|       this.onCancel(); | ||||
|  | ||||
|     /** | ||||
|      * 组件的初始数据 | ||||
|      */ | ||||
|     data: { | ||||
|         keyword: "", | ||||
|         keywordTemp: "", | ||||
|         page: 1, | ||||
|         currentActionSheet: null, | ||||
|         actionItems: [{ | ||||
|             name: '查看详细', | ||||
|             value: 'detail' | ||||
|         }], | ||||
|     }, | ||||
|     onSearchKeyword(e) { | ||||
|       const that = this; | ||||
|       that.setData({ | ||||
|         keyword: e.detail | ||||
|       }, () => { | ||||
|         loadingFunc(async () => { | ||||
|           await that.init(); | ||||
|         }) | ||||
|       }) | ||||
|     }, | ||||
|     onChangeKeyword(e) { | ||||
|       this.setData({ keywordTemp: e.detail }) | ||||
|     }, | ||||
|     onSearch() { | ||||
|       const that = this; | ||||
|       that.setData({ | ||||
|         keyword: that.data.keywordTemp | ||||
|       }, () => { | ||||
|         loadingFunc(async () => { | ||||
|           await that.init(); | ||||
|         }) | ||||
|       }) | ||||
|     }, | ||||
|     async init() { | ||||
|       const { page, keyword, park, status } = this.data; | ||||
|       const { code, message, data, total } = await getRechargeApproveList({ park, page, keyword, status }) | ||||
|       if (code !== OK) { | ||||
|         alertInfo(message); | ||||
|         return; | ||||
|       } | ||||
|       this.setData({ | ||||
|         list: data, | ||||
|         total: total, | ||||
|         totalPage: Math.ceil(total / 20) | ||||
|       }) | ||||
|     }, | ||||
|     onChangeReason(e) { | ||||
|       this.setData({ | ||||
|         reason: e.detail, | ||||
|       }) | ||||
|     }, | ||||
|     onApproveClose() { | ||||
|       this.setData({ | ||||
|         reason: "", | ||||
|         approveShow: false, | ||||
|       }) | ||||
|     }, | ||||
|     onApproveConfirm() { | ||||
|       const { reason, record } = this.data; | ||||
|       const that = this; | ||||
|       if (!reason) { | ||||
|         alertInfo("请输入拒绝理由") | ||||
|         return; | ||||
|       } | ||||
|       loadingFunc(async () => { | ||||
|         const { code, message } = await rechargeApprove({ id: record, status: 1, reason }) | ||||
|         if (code !== OK) { | ||||
|           alertInfo(message) | ||||
|           return; | ||||
|         } | ||||
|         alertSuccess("已拒绝") | ||||
|         that.init(); | ||||
|         that.setData({ | ||||
|           reason: "", | ||||
|           approveShow: false, | ||||
|           record: "", | ||||
|         }) | ||||
|       }) | ||||
|        | ||||
|     }, | ||||
|     handleApprove(e) { | ||||
|       const status = e.currentTarget.dataset.status; | ||||
|       const that = this; | ||||
|       if (status === '1') { | ||||
|         this.setData({ | ||||
|           approveShow: true | ||||
|         }) | ||||
|         return; | ||||
|       } | ||||
|       const { record, list } = this.data; | ||||
|       const item = list.find(ele => ele.id === record) | ||||
|      | ||||
|       wx.showModal({ | ||||
|         title: '提示', | ||||
|         content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`, | ||||
|         complete: async (res) => { | ||||
|           if (res.cancel) { | ||||
|              | ||||
|           } | ||||
|           if (res.confirm) { | ||||
|  | ||||
|     lifetimes: { | ||||
|         attached() { | ||||
|             loadingFunc(async () => { | ||||
|               const { code, message } = await rechargeApprove({ id: record, status: 0,  }) | ||||
|               if (code !== OK) { | ||||
|                 alertInfo(message) | ||||
|                 return; | ||||
|               } | ||||
|               alertSuccess("已同意") | ||||
|               that.init(); | ||||
|                 await this.init(); | ||||
|             }) | ||||
|              | ||||
|           } | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     jumpToDetail(e) { | ||||
|       const { id } = e.currentTarget.dataset; | ||||
|       wx.navigateTo({ | ||||
|         url: '/pages/rechargeDetail/index?id=' + id, | ||||
|       }) | ||||
|     }, | ||||
|     async onChangePage(e) { | ||||
|       const page = e.detail.currentIndex; | ||||
|       const that = this; | ||||
|       this.setData({ | ||||
|         page | ||||
|       }, () => { | ||||
|         loadingFunc(async () => { | ||||
|           await that.init(); | ||||
|         }) | ||||
|       }) | ||||
|     }, | ||||
|     onCancel() { | ||||
|       this.setData({ | ||||
|         show: false, | ||||
|         title: "", | ||||
|         type: "", | ||||
|       }) | ||||
|     }, | ||||
|     onChangeSelectRecharge(e) { | ||||
|       this.setData({ | ||||
|         record: e.detail | ||||
|       }) | ||||
|     /** | ||||
|      * 组件的方法列表 | ||||
|      */ | ||||
|     methods: { | ||||
|         onParkFocus(e) { | ||||
|             this.setData({ | ||||
|                 show: true, | ||||
|                 title: "园区", | ||||
|                 type: 'park' | ||||
|             }) | ||||
|         }, | ||||
|         onConfirm(e) { | ||||
|             const { | ||||
|                 data | ||||
|             } = e.detail; | ||||
|             const that = this; | ||||
|             this.setData({ | ||||
|                 parkName: data.name, | ||||
|                 park: data.id, | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|             this.onCancel(); | ||||
|         }, | ||||
|         onSearchKeyword(e) { | ||||
|             const that = this; | ||||
|             that.setData({ | ||||
|                 keyword: e.detail | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|         }, | ||||
|         onChangeKeyword(e) { | ||||
|             this.setData({ | ||||
|                 keywordTemp: e.detail | ||||
|             }) | ||||
|         }, | ||||
|         onSearch() { | ||||
|             const that = this; | ||||
|             that.setData({ | ||||
|                 keyword: that.data.keywordTemp | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|         }, | ||||
|         async init() { | ||||
|             const { | ||||
|                 page, | ||||
|                 keyword, | ||||
|                 park, | ||||
|                 status | ||||
|             } = this.data; | ||||
|             const { | ||||
|                 code, | ||||
|                 message, | ||||
|                 data, | ||||
|                 total | ||||
|             } = await getRechargeApproveList({ | ||||
|                 park, | ||||
|                 page, | ||||
|                 keyword, | ||||
|                 status | ||||
|             }) | ||||
|             if (code !== OK) { | ||||
|                 alertInfo(message); | ||||
|                 return; | ||||
|             } | ||||
|             this.setData({ | ||||
|                 list: data.map(item => { | ||||
|                     item.topTime = dayjs(item.topTime).format("MM-DD") | ||||
|                     return item | ||||
|                 }), | ||||
|                 total: total, | ||||
|                 totalPage: Math.ceil(total / 20) | ||||
|             }) | ||||
|         }, | ||||
|         onChangeReason(e) { | ||||
|             this.setData({ | ||||
|                 reason: e.detail, | ||||
|             }) | ||||
|         }, | ||||
|         onApproveClose() { | ||||
|             this.setData({ | ||||
|                 reason: "", | ||||
|                 approveShow: false, | ||||
|             }) | ||||
|         }, | ||||
|         onApproveConfirm() { | ||||
|             const { | ||||
|                 reason, | ||||
|                 record | ||||
|             } = this.data; | ||||
|             const that = this; | ||||
|             if (!reason) { | ||||
|                 alertInfo("请输入拒绝理由") | ||||
|                 return; | ||||
|             } | ||||
|             loadingFunc(async () => { | ||||
|                 const { | ||||
|                     code, | ||||
|                     message | ||||
|                 } = await rechargeApprove({ | ||||
|                     id: record, | ||||
|                     status: 1, | ||||
|                     reason | ||||
|                 }) | ||||
|                 if (code !== OK) { | ||||
|                     alertInfo(message) | ||||
|                     return; | ||||
|                 } | ||||
|                 alertSuccess("已拒绝") | ||||
|                 that.init(); | ||||
|                 that.setData({ | ||||
|                     reason: "", | ||||
|                     approveShow: false, | ||||
|                     record: "", | ||||
|                 }) | ||||
|             }) | ||||
|  | ||||
|         }, | ||||
|         handleApprove(e) { | ||||
|             const status = e.currentTarget.dataset.status; | ||||
|             const that = this; | ||||
|             if (status === '1') { | ||||
|                 this.setData({ | ||||
|                     approveShow: true | ||||
|                 }) | ||||
|                 return; | ||||
|             } | ||||
|             const { | ||||
|                 record, | ||||
|                 list | ||||
|             } = this.data; | ||||
|             const item = list.find(ele => ele.id === record) | ||||
|  | ||||
|             wx.showModal({ | ||||
|                 title: '提示', | ||||
|                 content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`, | ||||
|                 complete: async (res) => { | ||||
|                     if (res.cancel) { | ||||
|  | ||||
|                     } | ||||
|                     if (res.confirm) { | ||||
|                         loadingFunc(async () => { | ||||
|                             const { | ||||
|                                 code, | ||||
|                                 message | ||||
|                             } = await rechargeApprove({ | ||||
|                                 id: record, | ||||
|                                 status: 0, | ||||
|                             }) | ||||
|                             if (code !== OK) { | ||||
|                                 alertInfo(message) | ||||
|                                 return; | ||||
|                             } | ||||
|                             alertSuccess("已同意") | ||||
|                             that.init(); | ||||
|                         }) | ||||
|  | ||||
|                     } | ||||
|                 } | ||||
|             }) | ||||
|         }, | ||||
|  | ||||
|         showActionMenu(e) { | ||||
|             this.setData({ | ||||
|                 currentActionSheet: e.currentTarget.dataset.id | ||||
|             }); | ||||
|         }, | ||||
|  | ||||
|         hideActionMenu() { | ||||
|             this.setData({ | ||||
|                 currentActionSheet: null | ||||
|             }); | ||||
|         }, | ||||
|  | ||||
|         onMenuSelect(e) { | ||||
|             const { | ||||
|                 value | ||||
|             } = e.detail; | ||||
|             const id = e.currentTarget.dataset.id; | ||||
|  | ||||
|             if (value === 'detail') { | ||||
|                 this.jumpToDetail({ | ||||
|                     currentTarget: { | ||||
|                         dataset: { | ||||
|                             id | ||||
|                         } | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }, | ||||
|  | ||||
|         jumpToDetail(e) { | ||||
|             const { | ||||
|                 id | ||||
|             } = e.currentTarget.dataset; | ||||
|             wx.navigateTo({ | ||||
|                 url: '/pages/rechargeDetail/index?id=' + id, | ||||
|             }) | ||||
|         }, | ||||
|         async onChangePage(e) { | ||||
|             const page = e.detail.currentIndex; | ||||
|             const that = this; | ||||
|             this.setData({ | ||||
|                 page | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|         }, | ||||
|         onCancel() { | ||||
|             this.setData({ | ||||
|                 show: false, | ||||
|                 title: "", | ||||
|                 type: "", | ||||
|             }) | ||||
|         }, | ||||
|         onChangeSelectRecharge(e) { | ||||
|             this.setData({ | ||||
|                 record: e.detail | ||||
|             }) | ||||
|         } | ||||
|     } | ||||
|   } | ||||
| }) | ||||
| @@ -11,6 +11,8 @@ | ||||
|     "van-radio": "@vant/weapp/radio/index", | ||||
|     "van-radio-group": "@vant/weapp/radio-group/index", | ||||
|     "van-dialog": "@vant/weapp/dialog/index", | ||||
|     "searchSelectWrapper": "/components/searchSelectWrapper/index" | ||||
|     "searchSelectWrapper": "/components/searchSelectWrapper/index", | ||||
|     "van-icon": "@vant/weapp/icon/index", | ||||
|     "van-action-sheet": "@vant/weapp/action-sheet/index"     | ||||
|   } | ||||
| } | ||||
| @@ -1,100 +1,66 @@ | ||||
| <!--pages/workBench/components/recharge/components/waitApprove/index.wxml--> | ||||
| <searchSelectWrapper  | ||||
|     label="园区"  | ||||
|     placeholder="请选择园区" | ||||
|     text="{{parkName}}" | ||||
|     bind:search="onParkFocus" | ||||
| /> | ||||
| <searchSelectWrapper label="园区" placeholder="请选择园区" text="{{parkName}}" bind:search="onParkFocus" /> | ||||
|  | ||||
| <searchSelectWrapper  | ||||
|     label="关键字"  | ||||
|     placeholder="请输入关键字" | ||||
|     text="{{meterName}}" | ||||
|     bind:searchKeyword="onSearchKeyword" | ||||
|     type="inputSearch" | ||||
| /> | ||||
| <searchSelectWrapper label="关键字" placeholder="请输入关键字" text="{{meterName}}" bind:searchKeyword="onSearchKeyword" type="inputSearch" /> | ||||
| <view> | ||||
|     <view wx:if="{{list.length}}"> | ||||
|         <view class="operate" wx:if="{{status === 2}}"> | ||||
|             <view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;"> | ||||
|                 <van-button  | ||||
|                     type="info"  | ||||
|                     size="small"  | ||||
|                     style="margin-right: 30rpx;"  | ||||
|                     bind:click="handleApprove" | ||||
|                     data-status="0" | ||||
|                     disabled="{{!record}}" | ||||
|                 > 同意 </van-button> | ||||
|                 <van-button  | ||||
|                     size="small"  | ||||
|                     bind:click="handleClear"   | ||||
|                     disabled="{{!record}}"  | ||||
|                     bind:click="handleApprove" | ||||
|                     data-status="1" | ||||
|                 > 拒绝 </van-button> | ||||
|                 <van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleApprove" data-status="0" disabled="{{!record}}"> 同意 </van-button> | ||||
|                 <van-button size="small" bind:click="handleClear" disabled="{{!record}}" bind:click="handleApprove" data-status="1"> 拒绝 </van-button> | ||||
|             </view> | ||||
|         </view> | ||||
|         <view class="tableWrapper"> | ||||
|             <view class="table"> | ||||
|                 <view class="thead"> | ||||
|                     <view class="th" style="width: 70rpx">  </view> | ||||
|                     <view class="th" style="width: 250rpx"> 商户名字 </view> | ||||
|                     <view class="th" style="width: 150rpx"> 充值金额 </view> | ||||
|                     <view class="th" style="width: 200rpx"> 操作 </view> | ||||
|                     <view class="th" style="flex: 0 0 80rpx; display: {{status === 2 ? 'block' : 'none'}};"> </view> | ||||
|                     <!-- <view class="th" style="flex: 0 0 0rpx; display: {{status === 1 ? 'block' : 'none'}};"> </view> --> | ||||
|                     <view class="th" style="flex: 0 0 130rpx;"> 商户名字</view> | ||||
|                     <view class="th" style="flex: 0 0 150rpx;"> 充值金额 </view> | ||||
|                     <view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">状态</view> | ||||
|                     <view class="th"  style="flex: 0 0 150rpx;">提交时间</view> | ||||
|                     <view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view> | ||||
|                 </view> | ||||
|                 <view class="tbody"> | ||||
|                     <van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge"> | ||||
|                         <block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item"> | ||||
|                             <view class="tr"> | ||||
|                                 <view class="th" style="width: 70rpx"> | ||||
|                             <view class="tr" style="display: flex; align-items: center; "> | ||||
|                                 <view class="th" style="flex: 0 0 80rpx; ; display: {{status === 2 ? 'block' : 'none'}};"> | ||||
|                                     <van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio> | ||||
|                                 </view> | ||||
|                                 <view class="th" style="width: 250rpx"> {{ item.tenement.shortName }} </view> | ||||
|                                 <view class="th" style="width: 150rpx"> {{ item.money }} </view> | ||||
|                                 <view class="th" style="width: 200rpx"> | ||||
|                                     <view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}"> | ||||
|                                         查看详细 | ||||
|                                     </view> | ||||
|                                 <view class="th" style="flex: 0 0 130rpx;"> | ||||
|                                     {{ item.tenement.shortName }} | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 150rpx;"> | ||||
|                                     {{ item.money }} | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};"> | ||||
|                                     <view class="tag">{{item.orderStatus}}</view> | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 150rpx; font-size: 30rpx;"> | ||||
|                                     {{item.topTime}} | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> | ||||
|                                     <van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-id="{{item.id}}" class="more-icon" /> | ||||
|                                     <van-action-sheet show="{{ currentActionSheet === item.id }}" actions="{{ actionItems }}" bind:close="hideActionMenu" bind:select="onMenuSelect" data-id="{{item.id}}" close-on-click-action /> | ||||
|                                 </view> | ||||
|                             </view> | ||||
|  | ||||
|                         </block> | ||||
|                     </van-radio-group> | ||||
|                 </view> | ||||
|             </view> | ||||
|         </view> | ||||
|          | ||||
|         <pagination  | ||||
|             currentIndex="{{page}}"  | ||||
|             totalPage="{{totalPage}}"  | ||||
|             bind:pagingChange="onChangePage"   | ||||
|         /> | ||||
|          | ||||
|  | ||||
|         <pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" /> | ||||
|  | ||||
|     </view> | ||||
|     <empty bind:refresh="init" wx:else /> | ||||
|      | ||||
|  | ||||
| </view> | ||||
|  | ||||
| <search-select  | ||||
|     show="{{show}}"  | ||||
|     title="{{title}}"  | ||||
|     type="{{type}}"  | ||||
|     park="{{park}}" | ||||
|     bindconfirm="onConfirm" | ||||
|     bindcancel="onCancel" | ||||
| /> | ||||
| <search-select show="{{show}}" title="{{title}}" type="{{type}}" park="{{park}}" bindconfirm="onConfirm" bindcancel="onCancel" /> | ||||
|  | ||||
| <van-dialog | ||||
|   use-slot | ||||
|   title="审核" | ||||
|   show="{{ approveShow }}" | ||||
|   show-cancel-button | ||||
|   bind:close="onApproveClose" | ||||
|   bind:confirm="onApproveConfirm" | ||||
| > | ||||
|     <van-field | ||||
|         label="拒绝理由" | ||||
|         value="{{ reason }}" | ||||
|         placeholder="请输入拒绝理由" | ||||
|         bind:change="onChangeReason" | ||||
|     /> | ||||
| <van-dialog use-slot title="审核" show="{{ approveShow }}" show-cancel-button bind:close="onApproveClose" bind:confirm="onApproveConfirm"> | ||||
|     <van-field label="拒绝理由" value="{{ reason }}" placeholder="请输入拒绝理由" bind:change="onChangeReason" /> | ||||
| </van-dialog> | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* pages/workBench/components/recharge/components/waitApprove/index.wxss */ | ||||
| .table { | ||||
|     width: 810rpx; | ||||
|     width: 500rpx; | ||||
|  | ||||
| } | ||||
|  | ||||
| @@ -17,7 +17,7 @@ | ||||
| } | ||||
|  | ||||
| .thead  .th { | ||||
|     padding: 20rpx; | ||||
|     padding: 10rpx; | ||||
|     white-space: nowrap; | ||||
|     text-align: center; | ||||
|     box-sizing: border-box; | ||||
| @@ -28,11 +28,11 @@ | ||||
|   } | ||||
|  | ||||
| .tbody { | ||||
|     width: 810rpx; | ||||
|     width: 500rpx; | ||||
| } | ||||
|  | ||||
| .tbody .tr { | ||||
|     padding: 20rpx; | ||||
|     padding: 10rpx; | ||||
|     border-bottom: 1rpx solid #EEEEEE; | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
| @@ -43,3 +43,28 @@ | ||||
|     word-break: break-all; | ||||
|     text-align: center; | ||||
| } | ||||
|  | ||||
| .more-icon { | ||||
|     padding: 20rpx; | ||||
|     color: #1989fa; | ||||
|     display: flex; | ||||
|     justify-content: center; | ||||
|     align-items: center; | ||||
|   } | ||||
|    | ||||
| /* 基础标签样式 */ | ||||
| .tag { | ||||
|     display: inline-block; | ||||
|     padding: 4px 5px; | ||||
|     margin-right: 0px; | ||||
|     border-radius: 16px; | ||||
|     background: #07c160; | ||||
|     color: white; | ||||
|     font-size: 25rpx; | ||||
|   } | ||||
|    | ||||
|   /* 激活状态样式 */ | ||||
|   .tag.active { | ||||
|     background: #07c160; | ||||
|     color: white; | ||||
|   } | ||||
| @@ -23,7 +23,6 @@ Component({ | ||||
|    */ | ||||
|   methods: { | ||||
|     changeQueryType(e) { | ||||
|       console.log("change", e) | ||||
|       const { type } = e.currentTarget.dataset; | ||||
|       this.setData({ | ||||
|         active: type | ||||
|   | ||||
| @@ -23,7 +23,7 @@ Component({ | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|  | ||||
|     dateTimeShow: false, | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
| @@ -64,11 +64,19 @@ Component({ | ||||
|       }) | ||||
|     }, | ||||
|     async onSubmit() { | ||||
|       const { overall, critical, peak, valley, park, tenement, meter } = this.data; | ||||
|       const { code, message } = await bindMeter(park, tenement, { code: meter,  overall:overall? Number(overall) : overall,  | ||||
|         critical : critical ? Number(critical) : critical,  | ||||
|         peak: peak ? Number(peak) : peak,  | ||||
|         valley : valley ? Number(valley) : valley, readAt: dayjs().format('YYYY-MM-DD HH:mm:ss') }) | ||||
|       const { overall, critical, peak, valley, park, tenement, meter, readAt } = this.data; | ||||
|       const { code, message } = await bindMeter( | ||||
|         park,  | ||||
|         tenement,  | ||||
|         {  | ||||
|           code: meter,   | ||||
|           overall:overall? Number(overall) : overall,  | ||||
|           critical : critical ? Number(critical) : critical,  | ||||
|           peak: peak ? Number(peak) : peak,  | ||||
|           valley : valley ? Number(valley) : valley,  | ||||
|           readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')  | ||||
|         } | ||||
|         ) | ||||
|       if (code !== OK) { | ||||
|         alertInfo(message) | ||||
|         return; | ||||
| @@ -79,7 +87,6 @@ Component({ | ||||
|     onConfirm(e) { | ||||
|       const { type, data } = e.detail; | ||||
|       const that = this; | ||||
|       console.log("e.deail", e.detail) | ||||
|       switch(type) { | ||||
|         case "meter": | ||||
|           this.setData({ | ||||
| @@ -101,6 +108,15 @@ Component({ | ||||
|         overall: Number(data?.overall || 0), | ||||
|         status: data?.breakType ? '合闸' : "分闸" | ||||
|       }) | ||||
|     }, | ||||
|     dateTimeConfirm(e) { | ||||
|       this.setData({ readAt: e.detail.time, dateTimeShow: false }) | ||||
|     }, | ||||
|     dateTimeCancal(e) { | ||||
|       this.setData({ dateTimeShow: false }) | ||||
|     }, | ||||
|     onTimeFocus() { | ||||
|       this.setData({ dateTimeShow: true }) | ||||
|     } | ||||
|   } | ||||
| }) | ||||
| @@ -4,6 +4,7 @@ | ||||
|     "van-dialog": "@vant/weapp/dialog/index", | ||||
|     "search-select": "/components/searchSelect/index", | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-button": "@vant/weapp/button/index" | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "date-time-picker": "/components/DateTimePicker/index" | ||||
|   } | ||||
| } | ||||
| @@ -38,6 +38,19 @@ | ||||
|         readonly | ||||
|         type="digit" | ||||
|     /> | ||||
|     <van-field | ||||
|         value="{{ readAt }}" | ||||
|         placeholder="请选择绑定时间" | ||||
|         label="时间" | ||||
|         readonly | ||||
|         border="{{ false }}" | ||||
|         use-button-slot | ||||
|         title-width="100rpx" | ||||
|     > | ||||
|         <van-button slot="button" size="small" type="info" bind:click="onTimeFocus"> | ||||
|         选择 | ||||
|         </van-button> | ||||
|     </van-field> | ||||
|     <van-field | ||||
|         value="{{ overall }}" | ||||
|         label="表字" | ||||
| @@ -99,4 +112,10 @@ | ||||
|     park="{{park}}" | ||||
|     bindconfirm="onConfirm" | ||||
|     bindcancel="onCancel" | ||||
| /> | ||||
| /> | ||||
|  | ||||
| <date-time-picker  | ||||
|     show="{{dateTimeShow}}" | ||||
|     bind:confirm="dateTimeConfirm" | ||||
|     bind:cancel="dateTimeCancal" | ||||
| /> | ||||
|   | ||||
| @@ -69,6 +69,7 @@ | ||||
|             use-button-slot | ||||
|             readonly | ||||
|             title-width="120rpx" | ||||
|             required | ||||
|         > | ||||
|             <van-button slot="button" size="small" type="info" bind:click="onBuildingFocus"> | ||||
|                 选择 | ||||
|   | ||||
| @@ -5,6 +5,7 @@ import request from "../../../../../../utils/request" | ||||
| import { alertInfo, alertSuccess } from "../../../../../../utils/index"; | ||||
| const { OK } = request | ||||
| import { getWorkMeterDetail } from "../../../../../../service/meter" | ||||
| import dayjs from "../../../../../../utils/dayjs" | ||||
|  | ||||
| Component({ | ||||
|  | ||||
| @@ -28,7 +29,7 @@ Component({ | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|  | ||||
|     dateTimeShow: false | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
| @@ -68,13 +69,17 @@ Component({ | ||||
|       }) | ||||
|     }, | ||||
|     async onSubmit() { | ||||
|       const { overall, critical, peak, valley, park, tenement, meterId } = this.data; | ||||
|       const { code, message, } = await unbindMeter(park, tenement, meterId,  | ||||
|       const { overall, critical, peak, valley, park, tenement, meterId,readAt } = this.data; | ||||
|       const { code, message, } = await unbindMeter( | ||||
|         park,  | ||||
|         tenement,  | ||||
|         meterId,  | ||||
|         {  | ||||
|           overall:overall? Number(overall) : overall,  | ||||
|           critical : critical ? Number(critical) : critical,  | ||||
|           peak: peak ? Number(peak) : peak,  | ||||
|           valley : valley ? Number(valley) : valley,  | ||||
|           readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')  | ||||
|         }); | ||||
|       if (code !== OK) { | ||||
|         alertInfo(message) | ||||
| @@ -82,6 +87,15 @@ Component({ | ||||
|       } | ||||
|       alertSuccess("解绑成功") | ||||
|       this.triggerEvent("ok") | ||||
|     }, | ||||
|     dateTimeConfirm(e) { | ||||
|       this.setData({ readAt: e.detail.time, dateTimeShow: false }) | ||||
|     }, | ||||
|     dateTimeCancal(e) { | ||||
|       this.setData({ dateTimeShow: false }) | ||||
|     }, | ||||
|     onTimeFocus() { | ||||
|       this.setData({ dateTimeShow: true }) | ||||
|     } | ||||
|   } | ||||
| }) | ||||
| @@ -3,6 +3,8 @@ | ||||
|   "usingComponents": { | ||||
|     "van-dialog": "@vant/weapp/dialog/index", | ||||
|     "search-select": "/components/searchSelect/index", | ||||
|     "van-field": "@vant/weapp/field/index" | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "date-time-picker": "/components/DateTimePicker/index" | ||||
|   } | ||||
| } | ||||
| @@ -26,6 +26,19 @@ | ||||
|         title-width="132rpx" | ||||
|         border="{{false}}" | ||||
|     /> | ||||
|     <van-field | ||||
|         value="{{ readAt }}" | ||||
|         placeholder="请选择解绑时间" | ||||
|         label="时间" | ||||
|         readonly | ||||
|         border="{{ false }}" | ||||
|         use-button-slot | ||||
|         title-width="100rpx" | ||||
|     > | ||||
|         <van-button slot="button" size="small" type="info" bind:click="onTimeFocus"> | ||||
|         选择 | ||||
|         </van-button> | ||||
|     </van-field> | ||||
|     <van-field | ||||
|         value="{{ overall }}" | ||||
|         label="表字" | ||||
| @@ -78,4 +91,10 @@ | ||||
|     /> | ||||
| </view> | ||||
|   | ||||
| </van-dialog> | ||||
| </van-dialog> | ||||
|  | ||||
| <date-time-picker  | ||||
|     show="{{dateTimeShow}}" | ||||
|     bind:confirm="dateTimeConfirm" | ||||
|     bind:cancel="dateTimeCancal" | ||||
| /> | ||||
|   | ||||
| @@ -126,7 +126,6 @@ Component({ | ||||
|       }) | ||||
|     }, | ||||
|     onBindClose() { | ||||
|       console.log("-----------") | ||||
|       this.setData({ | ||||
|         bindVisible: false, | ||||
|       }) | ||||
| @@ -183,6 +182,9 @@ Component({ | ||||
|         bindVisible: false, | ||||
|       }) | ||||
|       this.getTenementMeters(); | ||||
|     }, | ||||
|     onTimeConfirm(e) { | ||||
|   | ||||
|     } | ||||
|   } | ||||
| }) | ||||
| @@ -132,4 +132,4 @@ | ||||
|     meterId="{{meterId}}" | ||||
|     meterAddress="{{meterAddress}}" | ||||
|     bind:ok="onUnbindOk" | ||||
| /> | ||||
| /> | ||||
|   | ||||
| @@ -5,14 +5,14 @@ Page({ | ||||
|    * 页面的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     active: 0, | ||||
|     active: 0 | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|  | ||||
|      | ||||
|   }, | ||||
|   onTabChange(e) { | ||||
|     this.setData({ active: e.detail.index }) | ||||
| @@ -28,7 +28,7 @@ Page({ | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|     console.log("this,data", this.data) | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|   | ||||
| @@ -5,6 +5,7 @@ | ||||
|     "navigator": "/components/navigator/index", | ||||
|     "recharge": "./components/recharge/index", | ||||
|     "record": "./components/record/index", | ||||
|     "reading": "./components/reading/index", | ||||
|     "tenement": "./components/tenement/index", | ||||
|     "account": "./components/account/index" | ||||
|   }, | ||||
|   | ||||
| @@ -13,4 +13,7 @@ | ||||
|     <van-tab title="C端账号" > | ||||
|         <account /> | ||||
|     </van-tab> | ||||
|     <van-tab title="抄表"> | ||||
|         <reading /> | ||||
|     </van-tab> | ||||
| </van-tabs> | ||||
| @@ -0,0 +1,279 @@ | ||||
| // pages/workBench/components/recharge/components/waitApprove/index.js | ||||
| import { | ||||
|     alertInfo, | ||||
|     alertSuccess, | ||||
|     loadingFunc | ||||
| } from "../../../../../../utils/index"; | ||||
| import { | ||||
|     getRechargeApproveList, | ||||
|     rechargeApprove | ||||
| } from "../../../../../../service/recharge" | ||||
| import request from "../../../../../../utils/request" | ||||
| import dayjs from "../../../../../../utils/dayjs" | ||||
| const { | ||||
|     OK | ||||
| } = request | ||||
|  | ||||
| // pages/workBench/components/record/index.js | ||||
| Component({ | ||||
|  | ||||
|     /** | ||||
|      * 组件的属性列表 | ||||
|      */ | ||||
|     properties: { | ||||
|         status: Number | ||||
|     }, | ||||
|  | ||||
|     /** | ||||
|      * 组件的初始数据 | ||||
|      */ | ||||
|     data: { | ||||
|         keyword: "", | ||||
|         keywordTemp: "", | ||||
|         page: 1, | ||||
|         currentActionSheet: null, | ||||
|         actionItems: [{ | ||||
|             name: '查看详细', | ||||
|             value: 'detail' | ||||
|         }], | ||||
|     }, | ||||
|  | ||||
|     lifetimes: { | ||||
|         attached() { | ||||
|             loadingFunc(async () => { | ||||
|                 await this.init(); | ||||
|             }) | ||||
|         } | ||||
|     }, | ||||
|     /** | ||||
|      * 组件的方法列表 | ||||
|      */ | ||||
|     methods: { | ||||
|         onParkFocus(e) { | ||||
|             this.setData({ | ||||
|                 show: true, | ||||
|                 title: "园区", | ||||
|                 type: 'park' | ||||
|             }) | ||||
|         }, | ||||
|         onConfirm(e) { | ||||
|             const { | ||||
|                 data | ||||
|             } = e.detail; | ||||
|             const that = this; | ||||
|             this.setData({ | ||||
|                 parkName: data.name, | ||||
|                 park: data.id, | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|             this.onCancel(); | ||||
|         }, | ||||
|         onSearchKeyword(e) { | ||||
|             const that = this; | ||||
|             that.setData({ | ||||
|                 keyword: e.detail | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|         }, | ||||
|         onChangeKeyword(e) { | ||||
|             this.setData({ | ||||
|                 keywordTemp: e.detail | ||||
|             }) | ||||
|         }, | ||||
|         onSearch() { | ||||
|             const that = this; | ||||
|             that.setData({ | ||||
|                 keyword: that.data.keywordTemp | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|         }, | ||||
|         async init() { | ||||
|             const { | ||||
|                 page, | ||||
|                 keyword, | ||||
|                 park, | ||||
|                 status | ||||
|             } = this.data; | ||||
|             const { | ||||
|                 code, | ||||
|                 message, | ||||
|                 data, | ||||
|                 total | ||||
|             } = await getRechargeApproveList({ | ||||
|                 park, | ||||
|                 page, | ||||
|                 keyword, | ||||
|                 status | ||||
|             }) | ||||
|             if (code !== OK) { | ||||
|                 alertInfo(message); | ||||
|                 return; | ||||
|             } | ||||
|             this.setData({ | ||||
|                 list: data.map(item => { | ||||
|                     item.topTime = dayjs(item.topTime).format("MM-DD") | ||||
|                     return item | ||||
|                 }), | ||||
|                 total: total, | ||||
|                 totalPage: Math.ceil(total / 20) | ||||
|             }) | ||||
|         }, | ||||
|         onChangeReason(e) { | ||||
|             this.setData({ | ||||
|                 reason: e.detail, | ||||
|             }) | ||||
|         }, | ||||
|         onApproveClose() { | ||||
|             this.setData({ | ||||
|                 reason: "", | ||||
|                 approveShow: false, | ||||
|             }) | ||||
|         }, | ||||
|         onApproveConfirm() { | ||||
|             const { | ||||
|                 reason, | ||||
|                 record | ||||
|             } = this.data; | ||||
|             const that = this; | ||||
|             if (!reason) { | ||||
|                 alertInfo("请输入拒绝理由") | ||||
|                 return; | ||||
|             } | ||||
|             loadingFunc(async () => { | ||||
|                 const { | ||||
|                     code, | ||||
|                     message | ||||
|                 } = await rechargeApprove({ | ||||
|                     id: record, | ||||
|                     status: 1, | ||||
|                     reason | ||||
|                 }) | ||||
|                 if (code !== OK) { | ||||
|                     alertInfo(message) | ||||
|                     return; | ||||
|                 } | ||||
|                 alertSuccess("已拒绝") | ||||
|                 that.init(); | ||||
|                 that.setData({ | ||||
|                     reason: "", | ||||
|                     approveShow: false, | ||||
|                     record: "", | ||||
|                 }) | ||||
|             }) | ||||
|  | ||||
|         }, | ||||
|         handleApprove(e) { | ||||
|             const status = e.currentTarget.dataset.status; | ||||
|             const that = this; | ||||
|             if (status === '1') { | ||||
|                 this.setData({ | ||||
|                     approveShow: true | ||||
|                 }) | ||||
|                 return; | ||||
|             } | ||||
|             const { | ||||
|                 record, | ||||
|                 list | ||||
|             } = this.data; | ||||
|             const item = list.find(ele => ele.id === record) | ||||
|  | ||||
|             wx.showModal({ | ||||
|                 title: '提示', | ||||
|                 content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`, | ||||
|                 complete: async (res) => { | ||||
|                     if (res.cancel) { | ||||
|  | ||||
|                     } | ||||
|                     if (res.confirm) { | ||||
|                         loadingFunc(async () => { | ||||
|                             const { | ||||
|                                 code, | ||||
|                                 message | ||||
|                             } = await rechargeApprove({ | ||||
|                                 id: record, | ||||
|                                 status: 0, | ||||
|                             }) | ||||
|                             if (code !== OK) { | ||||
|                                 alertInfo(message) | ||||
|                                 return; | ||||
|                             } | ||||
|                             alertSuccess("已同意") | ||||
|                             that.init(); | ||||
|                         }) | ||||
|  | ||||
|                     } | ||||
|                 } | ||||
|             }) | ||||
|         }, | ||||
|  | ||||
|         showActionMenu(e) { | ||||
|             this.setData({ | ||||
|                 currentActionSheet: e.currentTarget.dataset.id | ||||
|             }); | ||||
|         }, | ||||
|  | ||||
|         hideActionMenu() { | ||||
|             this.setData({ | ||||
|                 currentActionSheet: null | ||||
|             }); | ||||
|         }, | ||||
|  | ||||
|         onMenuSelect(e) { | ||||
|             const { | ||||
|                 value | ||||
|             } = e.detail; | ||||
|             const id = e.currentTarget.dataset.id; | ||||
|  | ||||
|             if (value === 'detail') { | ||||
|                 this.jumpToDetail({ | ||||
|                     currentTarget: { | ||||
|                         dataset: { | ||||
|                             id | ||||
|                         } | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }, | ||||
|  | ||||
|         jumpToDetail(e) { | ||||
|             const { | ||||
|                 id | ||||
|             } = e.currentTarget.dataset; | ||||
|             wx.navigateTo({ | ||||
|                 url: '/pages/rechargeDetail/index?id=' + id, | ||||
|             }) | ||||
|         }, | ||||
|         async onChangePage(e) { | ||||
|             const page = e.detail.currentIndex; | ||||
|             const that = this; | ||||
|             this.setData({ | ||||
|                 page | ||||
|             }, () => { | ||||
|                 loadingFunc(async () => { | ||||
|                     await that.init(); | ||||
|                 }) | ||||
|             }) | ||||
|         }, | ||||
|         onCancel() { | ||||
|             this.setData({ | ||||
|                 show: false, | ||||
|                 title: "", | ||||
|                 type: "", | ||||
|             }) | ||||
|         }, | ||||
|         onChangeSelectRecharge(e) { | ||||
|             this.setData({ | ||||
|                 record: e.detail | ||||
|             }) | ||||
|         } | ||||
|     } | ||||
| }) | ||||
| @@ -0,0 +1,18 @@ | ||||
| { | ||||
|   "component": true, | ||||
|   "usingComponents": { | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "search-select": "/components/searchSelect/index", | ||||
|     "van-empty": "@vant/weapp/empty/index", | ||||
|     "table": "/components/table/table", | ||||
|     "pagination": "/components/pagination/index", | ||||
|     "empty": "/components/empty/index", | ||||
|     "van-radio": "@vant/weapp/radio/index", | ||||
|     "van-radio-group": "@vant/weapp/radio-group/index", | ||||
|     "van-dialog": "@vant/weapp/dialog/index", | ||||
|     "searchSelectWrapper": "/components/searchSelectWrapper/index", | ||||
|     "van-icon": "@vant/weapp/icon/index", | ||||
|     "van-action-sheet": "@vant/weapp/action-sheet/index"     | ||||
|   } | ||||
| } | ||||
| @@ -0,0 +1,66 @@ | ||||
| <!--pages/workBench/components/recharge/components/waitApprove/index.wxml--> | ||||
| <searchSelectWrapper label="园区" placeholder="请选择园区" text="{{parkName}}" bind:search="onParkFocus" /> | ||||
|  | ||||
| <searchSelectWrapper label="关键字" placeholder="请输入关键字" text="{{meterName}}" bind:searchKeyword="onSearchKeyword" type="inputSearch" /> | ||||
| <view> | ||||
|     <view wx:if="{{list.length}}"> | ||||
|         <view class="operate" wx:if="{{status === 2}}"> | ||||
|             <view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;"> | ||||
|                 <van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleApprove" data-status="0" disabled="{{!record}}"> 同意 </van-button> | ||||
|                 <van-button size="small" bind:click="handleClear" disabled="{{!record}}" bind:click="handleApprove" data-status="1"> 拒绝 </van-button> | ||||
|             </view> | ||||
|         </view> | ||||
|         <view class="tableWrapper"> | ||||
|             <view class="table"> | ||||
|                 <view class="thead"> | ||||
|                     <view class="th" style="flex: 0 0 80rpx; display: {{status === 2 ? 'block' : 'none'}};"> </view> | ||||
|                     <!-- <view class="th" style="flex: 0 0 0rpx; display: {{status === 1 ? 'block' : 'none'}};"> </view> --> | ||||
|                     <view class="th" style="flex: 0 0 130rpx;"> 商户名字</view> | ||||
|                     <view class="th" style="flex: 0 0 150rpx;"> 充值金额 </view> | ||||
|                     <view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">状态</view> | ||||
|                     <view class="th"  style="flex: 0 0 150rpx;">提交时间</view> | ||||
|                     <view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view> | ||||
|                 </view> | ||||
|                 <view class="tbody"> | ||||
|                     <van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge"> | ||||
|                         <block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item"> | ||||
|                             <view class="tr" style="display: flex; align-items: center; "> | ||||
|                                 <view class="th" style="flex: 0 0 80rpx; ; display: {{status === 2 ? 'block' : 'none'}};"> | ||||
|                                     <van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio> | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 130rpx;"> | ||||
|                                     {{ item.tenement.shortName }} | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 150rpx;"> | ||||
|                                     {{ item.money }} | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};"> | ||||
|                                     <view class="tag">{{item.orderStatus}}</view> | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 150rpx; font-size: 30rpx;"> | ||||
|                                     {{item.topTime}} | ||||
|                                 </view> | ||||
|                                 <view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> | ||||
|                                     <van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-id="{{item.id}}" class="more-icon" /> | ||||
|                                     <van-action-sheet show="{{ currentActionSheet === item.id }}" actions="{{ actionItems }}" bind:close="hideActionMenu" bind:select="onMenuSelect" data-id="{{item.id}}" close-on-click-action /> | ||||
|                                 </view> | ||||
|                             </view> | ||||
|  | ||||
|                         </block> | ||||
|                     </van-radio-group> | ||||
|                 </view> | ||||
|             </view> | ||||
|         </view> | ||||
|  | ||||
|         <pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" /> | ||||
|  | ||||
|     </view> | ||||
|     <empty bind:refresh="init" wx:else /> | ||||
|  | ||||
| </view> | ||||
|  | ||||
| <search-select show="{{show}}" title="{{title}}" type="{{type}}" park="{{park}}" bindconfirm="onConfirm" bindcancel="onCancel" /> | ||||
|  | ||||
| <van-dialog use-slot title="审核" show="{{ approveShow }}" show-cancel-button bind:close="onApproveClose" bind:confirm="onApproveConfirm"> | ||||
|     <van-field label="拒绝理由" value="{{ reason }}" placeholder="请输入拒绝理由" bind:change="onChangeReason" /> | ||||
| </van-dialog> | ||||
| @@ -0,0 +1,70 @@ | ||||
| /* pages/workBench/components/recharge/components/waitApprove/index.wxss */ | ||||
| .table { | ||||
|     width: 500rpx; | ||||
|  | ||||
| } | ||||
|  | ||||
| .tableWrapper { | ||||
|     width: 100vw; | ||||
|     overflow-x: auto; | ||||
| } | ||||
|  | ||||
| .thead { | ||||
|      | ||||
|     display: flex; | ||||
|     flex-wrap: nowrap; | ||||
|   | ||||
| } | ||||
|  | ||||
| .thead  .th { | ||||
|     padding: 10rpx; | ||||
|     white-space: nowrap; | ||||
|     text-align: center; | ||||
|     box-sizing: border-box; | ||||
| } | ||||
|  | ||||
| .primaryTextBtn { | ||||
|     color: #1989fa; | ||||
|   } | ||||
|  | ||||
| .tbody { | ||||
|     width: 500rpx; | ||||
| } | ||||
|  | ||||
| .tbody .tr { | ||||
|     padding: 10rpx; | ||||
|     border-bottom: 1rpx solid #EEEEEE; | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     flex-wrap: nowrap; | ||||
| } | ||||
|  | ||||
| .tbody .tr { | ||||
|     word-break: break-all; | ||||
|     text-align: center; | ||||
| } | ||||
|  | ||||
| .more-icon { | ||||
|     padding: 20rpx; | ||||
|     color: #1989fa; | ||||
|     display: flex; | ||||
|     justify-content: center; | ||||
|     align-items: center; | ||||
|   } | ||||
|    | ||||
| /* 基础标签样式 */ | ||||
| .tag { | ||||
|     display: inline-block; | ||||
|     padding: 4px 5px; | ||||
|     margin-right: 0px; | ||||
|     border-radius: 16px; | ||||
|     background: #07c160; | ||||
|     color: white; | ||||
|     font-size: 25rpx; | ||||
|   } | ||||
|    | ||||
|   /* 激活状态样式 */ | ||||
|   .tag.active { | ||||
|     background: #07c160; | ||||
|     color: white; | ||||
|   } | ||||
| @@ -0,0 +1,152 @@ | ||||
| // pages/workBench/components/recharge/components/reharge/index.js | ||||
|  | ||||
| import { handleRecharge } from "../../../../../../service/recharge"; | ||||
| import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index"; | ||||
| import request from '../../../../../../utils/request' | ||||
| const { OK } = request; | ||||
|  | ||||
| Component({ | ||||
|  | ||||
|   /** | ||||
|    * 组件的属性列表 | ||||
|    */ | ||||
|   properties: { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 组件的方法列表 | ||||
|    */ | ||||
|   methods: { | ||||
|     onParkFocus() { | ||||
|       this.setData({ | ||||
|         show: true, | ||||
|         title: "园区", | ||||
|         type: 'park' | ||||
|       }) | ||||
|     }, | ||||
|     onMeterFocus() { | ||||
|       const { park } = this.data; | ||||
|       if (!park) { | ||||
|         alertInfo("请先选择园区") | ||||
|         return; | ||||
|       } | ||||
|       this.setData({ | ||||
|         show: true, | ||||
|         title: "电表", | ||||
|         type: 'meter' | ||||
|       }) | ||||
|     }, | ||||
|     onConfirm(e) { | ||||
|       const { data, type, way } = e.detail; | ||||
|       switch(type) { | ||||
|         case "park": | ||||
|           this.setData({ | ||||
|             parkName: data.name, | ||||
|             park: data.id, | ||||
|           }) | ||||
|           break; | ||||
|         case "meter": | ||||
|           this.setData({ | ||||
|             meterName: `${data.meterNo}-${data.address}${data.tenement?.name ? '-' + data.tenement?.name : ''}`, | ||||
|             meter: data.id, | ||||
|           }) | ||||
|           break; | ||||
|         case "pay": | ||||
|           this.setData({ | ||||
|             payName: data, | ||||
|             way: way, | ||||
|           }); | ||||
|           break; | ||||
|       } | ||||
|       this.onCancel(); | ||||
|     }, | ||||
|     onCancel() { | ||||
|       this.setData({ | ||||
|         show: false, | ||||
|         title: "", | ||||
|         type: "", | ||||
|       }) | ||||
|     }, | ||||
|     onPayFocus() { | ||||
|       this.setData({ | ||||
|         show: true, | ||||
|         title: "付款方式", | ||||
|         type: 'pay' | ||||
|       }) | ||||
|     }, | ||||
|     onChangeMoney(e) { | ||||
|       this.setData({ money: e.detail }) | ||||
|     }, | ||||
|     onChangeVoucherNo(e) { | ||||
|       this.setData({ voucherNo: e.detail }) | ||||
|     }, | ||||
|     handleClear() { | ||||
|       this.setData({ | ||||
|         park: "", | ||||
|         parkName: "", | ||||
|         meter: "", | ||||
|         meterName: "", | ||||
|         way: "", | ||||
|         payName: "", | ||||
|         show: false, | ||||
|         title: "", | ||||
|         type: "", | ||||
|         money: null, | ||||
|         voucherNo: null | ||||
|       }) | ||||
|     }, | ||||
|     async handleSubmit() { | ||||
|       const that = this; | ||||
|       const { park, meter, money, way, voucherNo } = this.data; | ||||
|       if (!park) { | ||||
|         alertInfo("请选择园区"); | ||||
|         return; | ||||
|       } | ||||
|       if (!meter) { | ||||
|         alertInfo("请选择电表") | ||||
|         return; | ||||
|       } | ||||
|       if (!money) { | ||||
|         alertInfo("请输入金额") | ||||
|         return | ||||
|       } | ||||
|       if (!way && way !== 0) { | ||||
|         alertInfo("请选择付款方式") | ||||
|         return | ||||
|       } | ||||
|       if (!voucherNo) { | ||||
|         alertInfo("请输入凭证号") | ||||
|         return | ||||
|       } | ||||
|       loadingFunc(async () => { | ||||
|         const { code, message } = await handleRecharge(park, {  | ||||
|           amount: `${money || ''}`,  | ||||
|           meter,  | ||||
|           paymentType: way,  | ||||
|           voucherNo,  | ||||
|           type: 0  | ||||
|         }) | ||||
|         if (code !== OK) { | ||||
|           alertInfo(message) | ||||
|           return | ||||
|         } | ||||
|         alertSuccess("充值成功") | ||||
|         setTimeout(() => { | ||||
|           that.handleClear() | ||||
|           that.setData({ | ||||
|              | ||||
|           }) | ||||
|         }, 500) | ||||
|       }) | ||||
|        | ||||
|     } | ||||
|   } | ||||
| }) | ||||
| @@ -0,0 +1,10 @@ | ||||
| { | ||||
|   "component": true, | ||||
|   "usingComponents": { | ||||
|     "van-popup": "@vant/weapp/popup/index", | ||||
|     "search-select": "/components/searchSelect/index", | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "searchSelectWrapper": "/components/searchSelectWrapper/index" | ||||
|   } | ||||
| } | ||||
| @@ -0,0 +1,50 @@ | ||||
| <!--pages/workBench/components/recharge/components/reharge/index.wxml--> | ||||
| <van-cell-group> | ||||
|   <searchSelectWrapper  | ||||
|     label="园区"  | ||||
|     placeholder="请选择园区" | ||||
|     text="{{parkName}}" | ||||
|     bind:search="onParkFocus" | ||||
|   /> | ||||
|  | ||||
|   <searchSelectWrapper  | ||||
|     label="电表"  | ||||
|     placeholder="请选择电表" | ||||
|     text="{{meterName}}" | ||||
|     bind:search="onMeterFocus" | ||||
|   /> | ||||
|   <searchSelectWrapper  | ||||
|     label="金额"  | ||||
|     placeholder="请输入金额" | ||||
|     text="{{meterName}}" | ||||
|     fieldType="number" | ||||
|     type="input" | ||||
|     bind:changeText="onChangeMoney" | ||||
|   /> | ||||
|   <searchSelectWrapper  | ||||
|     label="付款方式"  | ||||
|     placeholder="请选择付款方式" | ||||
|     text="{{payName}}" | ||||
|     bind:search="onPayFocus" | ||||
|   /> | ||||
|   <searchSelectWrapper  | ||||
|     label="凭证"  | ||||
|     placeholder="请输入凭证" | ||||
|     type="input" | ||||
|     bind:changeText="onChangeVoucherNo" | ||||
|   /> | ||||
| </van-cell-group> | ||||
|  | ||||
| <view style="margin-top: 60rpx;display: flex; justify-content: center; align-items: center;"> | ||||
|   <van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleSubmit"> 确认 </van-button> | ||||
|   <van-button size="small" bind:click="handleClear"> 清空 </van-button> | ||||
| </view> | ||||
| <search-select  | ||||
|   show="{{show}}"  | ||||
|   title="{{title}}"  | ||||
|   type="{{type}}"  | ||||
|   park="{{park}}" | ||||
|   bindconfirm="onConfirm" | ||||
|   bindcancel="onCancel" | ||||
|   wx:if="{{show}}" | ||||
| /> | ||||
| @@ -0,0 +1 @@ | ||||
| /* pages/workBench/components/recharge/components/reharge/index.wxss */ | ||||
							
								
								
									
										72
									
								
								pages/workBenchNew/components/workBenchApprove/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								pages/workBenchNew/components/workBenchApprove/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,72 @@ | ||||
| // pages/workBenchNew/components/workBenchApprove/index.js | ||||
| Page({ | ||||
|  | ||||
|   /** | ||||
|    * 页面的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     active: 0, | ||||
|     segmentedList: ['待审核', '已审核', '充值'], | ||||
|   }, | ||||
|   changeQueryType(e) { | ||||
|     const { type } = e.currentTarget.dataset; | ||||
|     this.setData({ | ||||
|       active: type | ||||
|     }) | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面初次渲染完成 | ||||
|    */ | ||||
|   onReady() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面隐藏 | ||||
|    */ | ||||
|   onHide() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面卸载 | ||||
|    */ | ||||
|   onUnload() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面相关事件处理函数--监听用户下拉动作 | ||||
|    */ | ||||
|   onPullDownRefresh() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面上拉触底事件的处理函数 | ||||
|    */ | ||||
|   onReachBottom() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 用户点击右上角分享 | ||||
|    */ | ||||
|   onShareAppMessage() { | ||||
|  | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										12
									
								
								pages/workBenchNew/components/workBenchApprove/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								pages/workBenchNew/components/workBenchApprove/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| { | ||||
|   "usingComponents": { | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "segmented": "/components/Segmented/index", | ||||
|     "recharge": "./components/reharge/index", | ||||
|     "approve": "./components/approve/index", | ||||
|     "van-row": "@vant/weapp/row/index", | ||||
|     "van-col": "@vant/weapp/col/index", | ||||
|     "navigator": "/components/navigator/index" | ||||
|   }, | ||||
|   "navigationStyle": "custom" | ||||
| } | ||||
							
								
								
									
										21
									
								
								pages/workBenchNew/components/workBenchApprove/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								pages/workBenchNew/components/workBenchApprove/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| <!--pages/workBench/components/recharge/index.wxml--> | ||||
| <navigator title="充值审核" canBack="{{true}}" /> | ||||
| <view style=""> | ||||
|   <view class="typeQuery"> | ||||
|       <van-row> | ||||
|         <van-col span="8"> | ||||
|           <view class="typeQueryText" style="color: {{active === 0 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{0}}"> 待审核 </view> | ||||
|         </van-col> | ||||
|         <van-col span="8"> | ||||
|           <view class="typeQueryText" style="color: {{active === 1 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{1}}"> 已审核 </view> | ||||
|         </van-col> | ||||
|         <van-col span="8"> | ||||
|           <view class="typeQueryText" style="color: {{active === 2 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{2}}"> 充值 </view> | ||||
|         </van-col> | ||||
|       </van-row> | ||||
|     </view> | ||||
| </view> | ||||
|  | ||||
| <approve status="{{2}}" wx:if="{{active === 0}}" /> | ||||
| <approve status="{{1}}" wx:if="{{active === 1}}" /> | ||||
| <recharge wx:if="{{active === 2}}" /> | ||||
							
								
								
									
										27
									
								
								pages/workBenchNew/components/workBenchApprove/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								pages/workBenchNew/components/workBenchApprove/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* pages/workBench/components/recharge/index.wxss */ | ||||
| page { | ||||
|     background-color: rgb(228,240,236); | ||||
|     font-size: 32rpx; | ||||
|   } | ||||
|  | ||||
|  | ||||
|   .query { | ||||
|     margin: 20rpx 0rpx; | ||||
|   } | ||||
|    | ||||
|   .typeQueryText { | ||||
|     text-align: center; | ||||
|     padding: 20rpx; | ||||
|     background-color: var(--light-green); | ||||
|     font-size: 32rpx; | ||||
|   } | ||||
|    | ||||
|   .select { | ||||
|     border: 1rpx solid #ccc; | ||||
|     padding: 12rpx; | ||||
|     border-radius: 12rpx; | ||||
|     flex: 1; | ||||
|     display: flex; | ||||
|     justify-content: space-between; | ||||
|     font-size: 30rpx; | ||||
|   } | ||||
							
								
								
									
										218
									
								
								pages/workBenchNew/components/workBenchMeter/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										218
									
								
								pages/workBenchNew/components/workBenchMeter/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,218 @@ | ||||
| // pages/workBenchNew/components/workBenchMeter/index.js | ||||
|  | ||||
| import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index"; | ||||
| import { getParkMeterList, handleOperateMeterSwitch } from "../../../../service/meter" | ||||
| import request from "../../../../utils/request" | ||||
| const { OK } = request | ||||
|  | ||||
| Page({ | ||||
|  | ||||
|   /** | ||||
|    * 页面的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     keyword: "", | ||||
|     keywordTemp: "", | ||||
|     page: 1, | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|  | ||||
|   }, | ||||
|   onParkFocus(e) { | ||||
|     this.setData({ | ||||
|       show: true, | ||||
|       title: "园区", | ||||
|       type: 'park' | ||||
|     }) | ||||
|   }, | ||||
|   onMeterFocus(e) { | ||||
|     const { park } = this.data; | ||||
|     if (!park) { | ||||
|       alertInfo("请先选择园区") | ||||
|       return; | ||||
|     } | ||||
|     this.setData({ | ||||
|       show: true, | ||||
|       title: "电表", | ||||
|       type: 'meter' | ||||
|     }) | ||||
|   }, | ||||
|   onConfirm(e) { | ||||
|     const { data, type } = e.detail; | ||||
|     const that = this; | ||||
|     switch(type) { | ||||
|       case "park": | ||||
|         this.setData({ | ||||
|           parkName: data.name, | ||||
|           park: data.id, | ||||
|         }) | ||||
|         break; | ||||
|       case "meter": | ||||
|         this.setData({ | ||||
|           meterName: data.address, | ||||
|           meter: data.id, | ||||
|         }, () => { | ||||
|           loadingFunc(async () => { | ||||
|             await that.init(); | ||||
|           }) | ||||
|         }) | ||||
|         break; | ||||
|     } | ||||
|      | ||||
|     this.onCancel(); | ||||
|   }, | ||||
|   onChangeKeyword(e) { | ||||
|     this.setData({ keywordTemp: e.detail }) | ||||
|   }, | ||||
|   onSearch() { | ||||
|     const that = this; | ||||
|     that.setData({ | ||||
|       keyword: that.data.keywordTemp | ||||
|     }, () => { | ||||
|       loadingFunc(async () => { | ||||
|         await that.init(); | ||||
|       }) | ||||
|     }) | ||||
|   }, | ||||
|   async init() { | ||||
|     const { page, park, meter } = this.data; | ||||
|     if (!park) { | ||||
|       return; | ||||
|     } | ||||
|     const { code, message, data, total } = await getParkMeterList({ park, keyword: meter, page }) | ||||
|     if (code !== OK) { | ||||
|       alertInfo(message); | ||||
|       return; | ||||
|     } | ||||
|     this.setData({ | ||||
|       list: data, | ||||
|       total: total, | ||||
|       totalPage: Math.ceil(total / 20) | ||||
|     }) | ||||
|   }, | ||||
|   async onChangePage(e) { | ||||
|     const page = e.detail.currentIndex; | ||||
|     const that = this; | ||||
|     this.setData({ | ||||
|       page | ||||
|     }, () => { | ||||
|       loadingFunc(async () => { | ||||
|         await that.init(); | ||||
|       }) | ||||
|     }) | ||||
|   }, | ||||
|   onCancel() { | ||||
|     this.setData({ | ||||
|       show: false, | ||||
|       title: "", | ||||
|       type: "", | ||||
|     }) | ||||
|   }, | ||||
|   onChangeSelectMeter(e) { | ||||
|     this.setData({ | ||||
|       meter: e.detail | ||||
|     }) | ||||
|   }, | ||||
|   async handleMeterSwitchOn() { | ||||
|     const that = this; | ||||
|     const { meter, meterName } = this.data; | ||||
|     wx.showModal({ | ||||
|       title: '提示', | ||||
|       content: `您确认要对${meterName || 当前电表}进行合闸吗?`, | ||||
|       complete: async (res) => { | ||||
|         if (res.cancel) { | ||||
|            | ||||
|         } | ||||
|      | ||||
|         if (res.confirm) { | ||||
|           loadingFunc(async () => { | ||||
|             const { code, message } = await handleOperateMeterSwitch({ ids: [meter], status: 0 }) | ||||
|             if (code !== OK) { | ||||
|               alertInfo(message) | ||||
|               return; | ||||
|             } | ||||
|             alertSuccess("合闸成功") | ||||
|             that.init(); | ||||
|           }) | ||||
|            | ||||
|         } | ||||
|       } | ||||
|     }) | ||||
|   }, | ||||
|   async handleMeterSwitchOff() { | ||||
|     const that = this; | ||||
|     const { meter, meterName } = this.data; | ||||
|     wx.showModal({ | ||||
|       title: '提示', | ||||
|       content: `您确认要对${meterName || 当前电表}进行拉闸吗?`, | ||||
|       complete: async (res) => { | ||||
|         if (res.cancel) { | ||||
|           return; | ||||
|         } | ||||
|         if (res.confirm) { | ||||
|           loadingFunc(async () => { | ||||
|             const { code, message } = await handleOperateMeterSwitch({ ids: [meter], status: 1 }) | ||||
|             if (code !== OK) { | ||||
|               alertInfo(message) | ||||
|               return; | ||||
|             } | ||||
|             alertSuccess("拉闸成功") | ||||
|             that.init(); | ||||
|           }) | ||||
|         } | ||||
|       } | ||||
|     }) | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面初次渲染完成 | ||||
|    */ | ||||
|   onReady() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面隐藏 | ||||
|    */ | ||||
|   onHide() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面卸载 | ||||
|    */ | ||||
|   onUnload() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面相关事件处理函数--监听用户下拉动作 | ||||
|    */ | ||||
|   onPullDownRefresh() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面上拉触底事件的处理函数 | ||||
|    */ | ||||
|   onReachBottom() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 用户点击右上角分享 | ||||
|    */ | ||||
|   onShareAppMessage() { | ||||
|  | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										19
									
								
								pages/workBenchNew/components/workBenchMeter/index.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								pages/workBenchNew/components/workBenchMeter/index.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| { | ||||
|   "usingComponents": { | ||||
|     "van-field": "@vant/weapp/field/index", | ||||
|     "van-button": "@vant/weapp/button/index", | ||||
|     "search-select": "/components/searchSelect/index", | ||||
|     "van-empty": "@vant/weapp/empty/index", | ||||
|     "table": "/components/table/table", | ||||
|     "pagination": "/components/pagination/index", | ||||
|     "empty": "/components/empty/index", | ||||
|     "van-radio": "@vant/weapp/radio/index", | ||||
|     "van-radio-group": "@vant/weapp/radio-group/index", | ||||
|     "van-tag": "@vant/weapp/tag/index", | ||||
|     "van-row": "@vant/weapp/row/index", | ||||
|     "van-col": "@vant/weapp/col/index", | ||||
|     "navigator": "/components/navigator/index", | ||||
|     "searchSelectWrapper": "/components/searchSelectWrapper/index" | ||||
|   }, | ||||
|   "navigationStyle": "custom" | ||||
| } | ||||
							
								
								
									
										102
									
								
								pages/workBenchNew/components/workBenchMeter/index.wxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								pages/workBenchNew/components/workBenchMeter/index.wxml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,102 @@ | ||||
| <!--pages/workBench/components/record/index.wxml--> | ||||
| <navigator title="电表信息" canBack="{{true}}" /> | ||||
| <searchSelectWrapper  | ||||
|     label="园区"  | ||||
|     placeholder="请选择园区" | ||||
|     text="{{parkName}}" | ||||
|     bind:search="onParkFocus" | ||||
| /> | ||||
|  | ||||
| <searchSelectWrapper  | ||||
|     label="电表"  | ||||
|     placeholder="请选择电表" | ||||
|     text="{{meterName}}" | ||||
|     bind:search="onMeterFocus" | ||||
| /> | ||||
| <van-empty wx:if="{{!meter}}" description="选择电表后查看" /> | ||||
| <view wx:else> | ||||
|     <view wx:if="{{list.length}}"> | ||||
|         <view class="operate"> | ||||
|             <view style="margin-top: 24rpx; margin-bottom: 24rpx;display: flex; justify-content: center; align-items: center;"> | ||||
|                 <van-button  | ||||
|                     type="info"  | ||||
|                     size="small"  | ||||
|                     style="margin-right: 30rpx;"  | ||||
|                     bind:click="handleMeterSwitchOn" | ||||
|                     disabled="{{!meter}}" | ||||
|                 > 合闸 </van-button> | ||||
|                 <van-button size="small" bind:click="handleClear"  disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button> | ||||
|             </view> | ||||
|         </view>  | ||||
|         <view class="customTable" wx:for="{{list}}" wx:key="id"> | ||||
|             <view class="customTableTile"> | ||||
|                 <van-row> | ||||
|                     <van-col span="8"> | ||||
|                         <view style="text-align: center;"> {{item.tenement.shortName}} </view> | ||||
|                     </van-col> | ||||
|                     <van-col span="16"><view style="margin-left: 16rpx;">{{item.tenement.name}}</view> </van-col> | ||||
|                 </van-row> | ||||
|             </view> | ||||
|             <view class="customTableContent"> | ||||
|                 <van-row > | ||||
|                     <van-col span="24"> | ||||
|                         <view class="tableRow"> | ||||
|                             <van-row gutter="5"> | ||||
|                                 <van-col span="8" wx:if="{{item.type === 0}}"> | ||||
|                                     <view style="text-align: center;border-right: 1rpx solid #ccc;"> 商户电表 </view></van-col> | ||||
|                                 <van-col span="8" wx:elif="{{item.type === 2}}"> | ||||
|                                     <view style="text-align: center;border-right: 1rpx solid #ccc;"> 公摊电表 </view></van-col> | ||||
|                                 <van-col span="8" wx:else> | ||||
|                                     <view style="text-align: center;border-right: 1rpx solid #ccc;"> 园区电表 </view></van-col> | ||||
|                                 <van-col span="16">表号:{{item.meterNo}}</van-col> | ||||
|                             </van-row> | ||||
|                         </view> | ||||
|                     </van-col> | ||||
|                     <van-col span="24"> | ||||
|                         <view class="tableRow"> | ||||
|                             <van-row gutter="5"> | ||||
|                                 <van-col span="8"> | ||||
|                                     <view style="text-align: center;border-right: 1rpx solid #ccc;"> {{item.address}} </view> | ||||
|                                 </van-col> | ||||
|                                 <van-col span="16">SN:{{item.meterSn}}</van-col> | ||||
|                             </van-row> | ||||
|                         </view> | ||||
|                     </van-col> | ||||
|                     <van-col span="24"> | ||||
|                         <view class="tableRow"> | ||||
|                             <van-row gutter="5"> | ||||
|                                 <van-col span="8"> | ||||
|                                     <view style="text-align: center;border-right: 1rpx solid #ccc;"> 表字:{{item.amount}} </view> | ||||
|                                 </van-col> | ||||
|                                 <van-col span="16">余额:{{item.money}}</van-col> | ||||
|                             </van-row> | ||||
|                         </view> | ||||
|                     </van-col> | ||||
|                     <van-col span="24"> | ||||
|                         <view class="tableRow"> | ||||
|                             <van-row gutter="5"> | ||||
|                                 <van-col span="8" wx:if="{{item.onPosition === 0}}"> | ||||
|                                     <view style="text-align: center;border-right: 1rpx solid #ccc;">合闸</view> </van-col> | ||||
|                                 <van-col span="8" wx:else><view style="text-align: center;border-right: 1rpx solid #ccc;">拉闸</view> </van-col> | ||||
|                                 <van-col span="8" wx:if="{{item.canConnect}}"><view style="text-align: center;">在线</view> </van-col> | ||||
|                                 <van-col span="8" wx:else><view style="text-align: center;">失联</view> </van-col> | ||||
|                             </van-row> | ||||
|                         </view> | ||||
|                     </van-col> | ||||
|                 </van-row> | ||||
|             </view> | ||||
|         </view> | ||||
|     </view> | ||||
|     <empty bind:refresh="init" wx:else /> | ||||
|      | ||||
| </view> | ||||
|  | ||||
| <search-select  | ||||
|     show="{{show}}"  | ||||
|     title="{{title}}"  | ||||
|     type="{{type}}"  | ||||
|     park="{{park}}" | ||||
|     bindconfirm="onConfirm" | ||||
|     bindcancel="onCancel" | ||||
|     wx:if="{{show}}" | ||||
| /> | ||||
							
								
								
									
										63
									
								
								pages/workBenchNew/components/workBenchMeter/index.wxss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								pages/workBenchNew/components/workBenchMeter/index.wxss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| /* pages/workBench/components/record/index.wxss */ | ||||
| .table { | ||||
|     width: 890rpx; | ||||
|      | ||||
| } | ||||
|  | ||||
| .classWrapper { | ||||
|     width: 100vw; | ||||
|     overflow-x: auto; | ||||
| } | ||||
|  | ||||
| .thead { | ||||
|     display: flex; | ||||
|     flex-wrap: nowrap; | ||||
|     border-bottom: 1rpx solid #EEEEEE; | ||||
| } | ||||
|  | ||||
| .thead  .th { | ||||
|     padding: 20rpx; | ||||
|     white-space: nowrap; | ||||
|     text-align: center; | ||||
|     box-sizing: border-box; | ||||
|  | ||||
| } | ||||
|  | ||||
| .tbody { | ||||
|     width: 890rpx; | ||||
| } | ||||
|  | ||||
| .tbody .tr { | ||||
|     padding: 20rpx; | ||||
|     border-bottom: 1rpx solid #EEEEEE; | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     flex-wrap: nowrap; | ||||
| } | ||||
|  | ||||
| .tbody .th { | ||||
|     word-break: break-all; | ||||
|     text-align: center; | ||||
| } | ||||
|  | ||||
| .customTable { | ||||
|     margin: 20rpx; | ||||
| } | ||||
|  | ||||
| .customTableTile { | ||||
|     background-color: var(--light-green); | ||||
|     padding: 16rpx; | ||||
|     box-sizing: border-box; | ||||
|     font-weight: 700; | ||||
| } | ||||
|  | ||||
| .tableRow { | ||||
|     padding: 16rpx; | ||||
|     border: 1rpx solid #ccc; | ||||
|     border-top: 0rpx; | ||||
| } | ||||
|  | ||||
| page { | ||||
|     background-color: rgb(228,240,236); | ||||
|     font-size: 32rpx; | ||||
|   } | ||||
							
								
								
									
										190
									
								
								pages/workBenchNew/components/workBenchReading/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										190
									
								
								pages/workBenchNew/components/workBenchReading/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,190 @@ | ||||
| // pages/workBenchNew/components/workBenchReading/index.js | ||||
| import { getMeterReadingRouteList, changeMeterRouteStatus, checkReadingFinish } from "../../../../service/workBench" | ||||
| import { alertError, alertSuccess, loadingFunc } from "../../../../utils/index" | ||||
| import request from "../../../../utils/request" | ||||
| const { OK } = request | ||||
|  | ||||
|  | ||||
| Page({ | ||||
|  | ||||
|   /** | ||||
|    * 页面的初始数据 | ||||
|    */ | ||||
|   data: { | ||||
|     park: "", | ||||
|     parkName: "", | ||||
|   }, | ||||
|   onParkFocus(e) { | ||||
|     this.setData({ | ||||
|       show: true, | ||||
|       title: "园区", | ||||
|       type: 'park' | ||||
|     }) | ||||
|   }, | ||||
|   async init() { | ||||
|     const { parkName, park } = this.data; | ||||
|     const { code, message, data } = await getMeterReadingRouteList(parkName) | ||||
|     if (code !== OK) { | ||||
|       alertError(message) | ||||
|       return | ||||
|     } | ||||
|     this.setData({ | ||||
|       list: data | ||||
|     }) | ||||
|   }, | ||||
|   onConfirm(e) { | ||||
|     const { data } = e.detail; | ||||
|     const that = this; | ||||
|     this.setData({ | ||||
|       parkName: data.name, | ||||
|       park: data.id, | ||||
|     }, () => { | ||||
|       loadingFunc(async () => { | ||||
|         await that.init(); | ||||
|       }) | ||||
|     }) | ||||
|     this.onConcal(); | ||||
|   }, | ||||
|   onConcal() { | ||||
|     this.setData({ | ||||
|       show: false, | ||||
|       title: "", | ||||
|       type: "", | ||||
|     }) | ||||
|   }, | ||||
|   jumpToReading(e) { | ||||
|     const { id, type } = e.currentTarget.dataset; | ||||
|     wx.navigateTo({ | ||||
|       url: `/pages/writeReading/index?id=${id}&type=${type}`, | ||||
|     }) | ||||
|   }, | ||||
|   async changeStartStatus(e) { | ||||
|     const that = this; | ||||
|     const { id, routeid: routeId } = e.currentTarget.dataset; | ||||
|     const { code, message } = await changeMeterRouteStatus({ id, status: 1, routeId }) | ||||
|     if (code !== OK) { | ||||
|       alertError(message) | ||||
|       return | ||||
|     } | ||||
|     alertSuccess("操作成功") | ||||
|     this.init() | ||||
|     setTimeout(() => { | ||||
|       that.jumpToReading({ currentTarget: { dataset: { id } } }) | ||||
|     }, 500) | ||||
|   }, | ||||
|   // async checkFinish(id) { | ||||
|      | ||||
|   //   return {data, num}; | ||||
|   // }, | ||||
|   async changeEndStatus(e) { | ||||
|     const that = this; | ||||
|     wx.showModal({ | ||||
|       title: '提示', | ||||
|       content: '确认要结束吗?', | ||||
|       complete: async (res) => { | ||||
|         if (res.cancel) { | ||||
|            | ||||
|         } | ||||
|      | ||||
|         if (res.confirm) { | ||||
|             const { id, routeid: routeId } = e.currentTarget.dataset; | ||||
|           const { code, message, data, num } = await checkReadingFinish(id || this.data.routeId); | ||||
|           if (code !== OK) { | ||||
|             alertError(message) | ||||
|             return; | ||||
|           }  | ||||
|           console.log("data", data, "num", num) | ||||
|           if (!data) { | ||||
|             wx.showModal({ | ||||
|               title: '提示', | ||||
|               content: `该路线还有${num}块电表还没有抄完,是否确认结束结束抄表?`, | ||||
|               complete: async (res) => { | ||||
|                 if (res.cancel) { | ||||
|                    | ||||
|                 } | ||||
|              | ||||
|                 if (res.confirm) { | ||||
|                   const { code: cd, message } = await changeMeterRouteStatus({ id, status: 0, routeId }) | ||||
|                   if (cd !== OK) { | ||||
|                     alertError(message) | ||||
|                     return | ||||
|                   } | ||||
|                   alertSuccess("操作成功") | ||||
|                   that.init() | ||||
|                 } | ||||
|               } | ||||
|             }) | ||||
|             return | ||||
|           } | ||||
|           const { code: c, message: m } = await changeMeterRouteStatus({ id, status: 0, routeId }) | ||||
|           if (c !== OK) { | ||||
|             alertError(m) | ||||
|             return | ||||
|           } | ||||
|           alertSuccess("操作成功") | ||||
|           that.init() | ||||
|         } | ||||
|       } | ||||
|     }) | ||||
|  | ||||
|   }, | ||||
|   /** | ||||
|    * 生命周期函数--监听页面加载 | ||||
|    */ | ||||
|   onLoad(options) { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面初次渲染完成 | ||||
|    */ | ||||
|   onReady() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面显示 | ||||
|    */ | ||||
|   onShow() { | ||||
|     const { parkName } = this.data; | ||||
|     if (!parkName) { | ||||
|       return | ||||
|     } | ||||
|     this.init() | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面隐藏 | ||||
|    */ | ||||
|   onHide() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 生命周期函数--监听页面卸载 | ||||
|    */ | ||||
|   onUnload() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面相关事件处理函数--监听用户下拉动作 | ||||
|    */ | ||||
|   onPullDownRefresh() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 页面上拉触底事件的处理函数 | ||||
|    */ | ||||
|   onReachBottom() { | ||||
|  | ||||
|   }, | ||||
|  | ||||
|   /** | ||||
|    * 用户点击右上角分享 | ||||
|    */ | ||||
|   onShareAppMessage() { | ||||
|  | ||||
|   } | ||||
| }) | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user