准备联调抄表记录
This commit is contained in:
84
pages/readingHistory/components/editModal/index.js
Normal file
84
pages/readingHistory/components/editModal/index.js
Normal file
@@ -0,0 +1,84 @@
|
||||
// pages/workBench/components/tenement/components/bindMeter/index.js
|
||||
// 0015980101
|
||||
import { bindMeter, } from "../../../../service/tenement"
|
||||
import { getWorkMeterDetail } from "../../../../service/meter"
|
||||
import { alertInfo, alertSuccess } 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,
|
||||
id: String
|
||||
},
|
||||
observers: {
|
||||
"timeProps": function(newValue) {
|
||||
this.setData({
|
||||
time: 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 } = this.data;
|
||||
if (time == null || number == null) {
|
||||
alertInfo("请正确填写后保存")
|
||||
return;
|
||||
}
|
||||
this.triggerEvent("ok")
|
||||
},
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
50
pages/readingHistory/components/editModal/index.wxml
Normal file
50
pages/readingHistory/components/editModal/index.wxml
Normal file
@@ -0,0 +1,50 @@
|
||||
<!--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">
|
||||
选择
|
||||
</van-button>
|
||||
</van-field>
|
||||
<van-field
|
||||
value="{{ number }}"
|
||||
placeholder="请输入读数"
|
||||
label="读数"
|
||||
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
|
||||
show="{{dateTimeShow}}"
|
||||
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 */
|
||||
@@ -5,7 +5,7 @@ Component({
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
meterInfo: Object,
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
<view class="address">
|
||||
标1东-307
|
||||
{{meterInfo.address}}
|
||||
</view>
|
||||
<view class="status">
|
||||
正常运行中
|
||||
<view wx:if="{{meterInfo.enabled}}">
|
||||
正常
|
||||
</view>
|
||||
<view wx:else>
|
||||
停用
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail">
|
||||
@@ -16,7 +21,7 @@
|
||||
设备编号
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
{{meterInfo.meterSn}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
@@ -26,7 +31,15 @@
|
||||
电表类型
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
<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>
|
||||
@@ -36,7 +49,7 @@
|
||||
最近读数
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
{{meterInfo.overall}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
@@ -46,7 +59,7 @@
|
||||
读数日期
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
{{meterInfo.readAt}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
|
||||
Reference in New Issue
Block a user