|
@@ -5,6 +5,7 @@
|
|
|
<text>{{searchForm.beginDate}}至{{searchForm.endDate}}</text>
|
|
|
<u-image v-if="hasLogin" @click="openScreen=true" class="filter-img" width="36rpx" height="36rpx" src="/static/filter.png"></u-image>
|
|
|
</view>
|
|
|
+ <!-- 总计 -->
|
|
|
<view class="header-cont">
|
|
|
<view class="cont-item">
|
|
|
<text>其它垃圾</text>
|
|
@@ -28,25 +29,28 @@
|
|
|
<view class="cell-item" v-for="item in listdata">
|
|
|
<view class="cell-item-title" >
|
|
|
<view>
|
|
|
- <text>2020-02-23 15:12:30</text>
|
|
|
+ <text>{{item.createDate}}</text>
|
|
|
</view>
|
|
|
- <view @click="intoPage()">
|
|
|
+ <view @click="intoPage(item)">
|
|
|
<span class="view">查看详情</span>
|
|
|
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="cell-item-cont">
|
|
|
+ <!-- 其他垃圾 -->
|
|
|
<view class="cont-item">
|
|
|
<u-image src="/static/index/other.png"></u-image>
|
|
|
- <text>1000kg</text>
|
|
|
+ <text>{{item.gatherOther? (item.gatherOther/1000).toFixed(3)/1 :0}}kg</text>
|
|
|
</view>
|
|
|
+ <!-- 建筑垃圾 -->
|
|
|
<view class="cont-item">
|
|
|
<u-image src="/static/index/jianzhu.png"></u-image>
|
|
|
- <text>1000kg</text>
|
|
|
+ <text>{{item.gatherBuilding ? (item.gatherBuilding/1000).toFixed(3)/1 :0}}kg</text>
|
|
|
</view>
|
|
|
+ <!-- 厨余垃圾 -->
|
|
|
<view class="cont-item">
|
|
|
<u-image src="/static/index/chuyu.png"></u-image>
|
|
|
- <text>1000kg</text>
|
|
|
+ <text>{{item.gatherKitchen ? (item.gatherKitchen/1000).toFixed(3)/1 :0}}kg</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -68,7 +72,7 @@
|
|
|
|
|
|
<script>
|
|
|
import searchModal from './searchModal.vue'
|
|
|
- import {gatherQuery} from '@/api/index.js'
|
|
|
+ import {gatherList,gatherTotal} from '@/api/index.js'
|
|
|
import { checkLogin } from '@/api/login.js'
|
|
|
import moment from 'moment'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
@@ -128,6 +132,7 @@
|
|
|
this.searchForm.endDate = getDate.getRecentday().endtime
|
|
|
console.log(this.searchForm,'this.searchForm')
|
|
|
this.searchHandle()
|
|
|
+ this.getTotal()
|
|
|
},
|
|
|
// 获取查询参数 刷新列表
|
|
|
refresh(params){
|
|
@@ -135,16 +140,17 @@
|
|
|
this.listdata = []
|
|
|
this.total = 0
|
|
|
this.searchHandle(1)
|
|
|
+ this.getTotal()
|
|
|
},
|
|
|
// 搜索查询
|
|
|
searchHandle (pageNo) {
|
|
|
this.status = "loading"
|
|
|
pageNo ? this.pageNo = pageNo : null
|
|
|
- gatherQuery({
|
|
|
+ gatherList({
|
|
|
pageNo: this.pageNo,
|
|
|
pageSize: this.pageSize,
|
|
|
- beginDate: this.searchForm.beginDate,
|
|
|
- endDate: this.searchForm.endDate,
|
|
|
+ beginDate: this.searchForm.beginDate+' 00:00:00',
|
|
|
+ endDate: this.searchForm.endDate+' 23:59:59',
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
if(this.pageNo>1){
|
|
@@ -168,14 +174,29 @@
|
|
|
console.log(111111)
|
|
|
if(this.listdata.length < this.total){
|
|
|
this.pageNo += 1
|
|
|
- // this.searchHandle()
|
|
|
+ this.searchHandle()
|
|
|
}else{
|
|
|
uni.showToast({ title: '已经到底了', icon: 'none' })
|
|
|
this.status = "nomore"
|
|
|
}
|
|
|
},
|
|
|
+ // 总计
|
|
|
+ getTotal(){
|
|
|
+ gatherTotal({
|
|
|
+ beginDate: this.searchForm.beginDate,
|
|
|
+ endDate: this.searchForm.endDate}).then(res=>{
|
|
|
+ if(res.status==200){
|
|
|
+ this.otherTotal=res.data.GATHER_OTHER ? (res.data.GATHER_OTHER/1000).toFixed(3)/1:0
|
|
|
+ this.jianzhuTotal=res.data.GATHER_BUILDING ? (res.data.GATHER_BUILDING/1000).toFixed(3)/1:0
|
|
|
+ this.chuyuTotal=res.data.GATHER_KITCHEN? (res.data.GATHER_KITCHEN/1000).toFixed(3)/1:0
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 打开垃圾数据录入页面
|
|
|
- intoPage(flag) {
|
|
|
+ intoPage(item) {
|
|
|
+ const flag=item ? item.gatherId : ''
|
|
|
+ console.log(flag,'---------hangid,;;;;')
|
|
|
let url = flag ? `/pages/index/addData?id=${flag}` : `/pages/index/addData`
|
|
|
// uni.navigateTo({
|
|
|
// url: url
|