导入抄表记录完成电表列表部分(未调试)
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
// pages/workBench/components/reading/index.js
|
||||
import { getMeterReadingRouteList } from "../../../../service/workBench"
|
||||
import { alertError, loadingFunc } from "../../../../utils/index"
|
||||
import request from "../../../../utils/request"
|
||||
const { OK } = request
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
@@ -12,7 +17,8 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
park: "",
|
||||
parkName: ""
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -27,7 +33,15 @@ Component({
|
||||
})
|
||||
},
|
||||
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;
|
||||
@@ -51,7 +65,6 @@ Component({
|
||||
},
|
||||
jumpToReading(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
console.log("id", id, "e", e)
|
||||
wx.navigateTo({
|
||||
url: '/pages/writeReading/index',
|
||||
})
|
||||
|
@@ -22,27 +22,17 @@
|
||||
bindcancel="onConcal"
|
||||
/>
|
||||
|
||||
<van-empty description="请先选择园区" wx:if="{{!park}}" />
|
||||
|
||||
<van-cell
|
||||
title="路线1"
|
||||
label="包含12个抄表点"
|
||||
>
|
||||
<view slot="right-icon">
|
||||
<!-- <van-icon name="search" class="search-icon" /> -->
|
||||
<van-button type="primary" size="small" type="primary"> 去抄表 </van-button>
|
||||
</view>
|
||||
</van-cell>
|
||||
<van-cell
|
||||
title="路线2"
|
||||
label="包含12个抄表点"
|
||||
>
|
||||
<view slot="right-icon">
|
||||
<!-- <van-icon name="search" class="search-icon" /> -->
|
||||
<van-button
|
||||
type="primary"
|
||||
size="small"
|
||||
bind:tap="jumpToReading"
|
||||
data-id="1234"
|
||||
> 去抄表 </van-button>
|
||||
</view>
|
||||
</van-cell>
|
||||
<view wx:else>
|
||||
<van-cell
|
||||
wx:for="{{list}}"
|
||||
wx:key="id"
|
||||
title="路线1"
|
||||
label="包含12个抄表点"
|
||||
>
|
||||
<view slot="right-icon">
|
||||
<van-button type="primary" size="small" type="primary"> 去抄表 </van-button>
|
||||
</view>
|
||||
</van-cell>
|
||||
</view>
|
||||
|
Reference in New Issue
Block a user