123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <template>
- <view>
- <view>
- <u-row style="padding: 10px;border-bottom: 1px solid #000000;">
- <u-col span="4">
- <view class="viewCent">
- <u-text text="日期" size="14"></u-text>
- </view>
- </u-col>
- <u-col span="6" v-if="type == 'sc'">
- <view class="viewCent">
- <u-text text="运行时间" size="14"></u-text>
- </view>
- </u-col>
- <u-col span="6" v-if="type == 'nh'">
- <view class="viewCent">
- <u-text text="电量消耗 (预估)" size="14"></u-text>
- </view>
- </u-col>
- <u-col span="2">
- </u-col>
- </u-row>
- </view>
- <view v-for="item in dataList">
- <u-row style="padding: 10px;border-bottom: 1px solid #aaaaaa;">
- <u-col span="4">
- <view class="viewCent">
- <u-text :text="item.createTimeVo" size="18"></u-text>
- </view>
- </u-col>
- <u-col span="6" v-if="">
- <view class="viewCent">
- <u-text v-if="item.isStat === 0 && type == 'sc'" :text="item.dosage" size="18"></u-text>
- <u-text v-if="item.isStat === 0 && type == 'nh'"
- :text="(parseFloat(item.remark) * nhBz).toFixed(2) +' kWh'" size="18"></u-text>
- <u-text v-if="item.isStat === 1" text="统计中" color="#1c81df" size="18"></u-text>
- <u-text v-if="item.isStat === 2" text="未使用" color="#ffaa00" size="18"></u-text>
- </view>
- </u-col>
- <u-col span="2" @click="toStatDayPage(item)">
- <view class="viewCent">
- <u-text text="日志" size="12" color="#26a495"></u-text>
- </view>
- </u-col>
- </u-row>
- </view>
- <u-popup :show="show" @close="close" @open="open">
- <view style="padding: 20px 20px 0 20px;">
- <view>
- <u-row style="padding: 10px;border-bottom: 1px solid #aaaaaa;">
- <u-col span="9">
- <view class="viewCent">
- <u-text text="时间" size="18"></u-text>
- </view>
- </u-col>
- <u-col span="3">
- <view class="viewCent">
- <u-text text="操作" size="18"></u-text>
- </view>
- </u-col>
- </u-row>
- <view v-if="logList.length === 0" style="text-align: center;margin-top: 40px;">
- 暂无数据
- </view>
- <view>
- <u-list style="height:400px;">
- <u-list-item v-for="item in logList">
- <view>
- <u-row style="padding: 10px;border-bottom: 1px solid #aaaaaa;">
- <u-col span="9">
- <view class="viewCent">
- <u-text :text="item.createTime" size="16"></u-text>
- </view>
- </u-col>
- <u-col span="3">
- <view class="viewCent">
- <u-text v-if="item.useDescribe === '打开'" :text="item.useDescribe"
- color="#00cb62" size="18"></u-text>
- <u-text v-else color="#cf0000" :text="item.useDescribe" size="18">
- </u-text>
- </view>
- </u-col>
- </u-row>
- </view>
- </u-list-item>
- </u-list>
- </view>
- </view>
- <view style="text-align: center; margin-top: 20px;position: absolute;top: -10px;right: 15px;">
- <view @click="show = false;">
- <u-icon name="close" size="18"></u-icon>
- </view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- show: false,
- dataList: [],
- logList: [],
- type: '',
- nhBz: 0
- }
- },
- onLoad(option) {
- if (option && option.type) {
- console.log(option.type)
- this.type = option.type
- }
- this.nhBz = parseFloat(uni.getStorageSync('deviceInfo').energyConsumption)
- console.log(this.nhBz)
- this.getList()
- },
- methods: {
- async getList() {
- const {
- data: res
- } = await this.$httpRequest({
- url: '/api/control/statDayList?useNoId=' + uni.getStorageSync('deviceInfo').deviceUseNo +
- '&yearMonth=' + uni.getStorageSync('yearMonth'),
- method: 'get'
- });
- if (res.code === 200) {
- this.dataList = res.data
- console.log(this.dataList)
- } else {
- }
- },
- toStatDayPage(item) {
- this.show = true
- this.getLogList(item)
- },
- async getLogList(item) {
- this.logList = []
- const {
- data: res
- } = await this.$httpRequest({
- url: '/api/control/useLogList?useNoId=' + item.useNoId +
- '&date=' + item.createTime.substr(0, 10),
- method: 'get'
- });
- if (res.code === 200) {
- this.logList = res.data
- console.log(this.logList)
- } else {
- }
- },
- open() {
- // console.log('open');
- },
- close() {
- this.show = false
- // console.log('close');
- }
- }
- }
- </script>
- <style scoped>
- .viewCent {
- margin: 0 auto;
- }
- </style>
|