|
@@ -21,8 +21,8 @@
|
|
|
{{item.name}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <uni-datetime-picker v-model="range" type="daterange" start-placeholder="起始时间" end-placeholder="终止时间"
|
|
|
- @change="handelDate" return-type="timestamp" />
|
|
|
+ <uni-datetime-picker v-model="range" type="datetimerange" start-placeholder="起始时间"
|
|
|
+ end-placeholder="终止时间" @change="handelDate" return-type="timestamp" />
|
|
|
<view class="month-btn">
|
|
|
<u-button class="reset" style="width:200rpx" @click="reset">重置</u-button>
|
|
|
<u-button type="primary" style="width:200rpx" @click="handelQuery">确认</u-button>
|
|
@@ -88,6 +88,28 @@
|
|
|
dataItem: []
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ monthCurrent: {
|
|
|
+ handler(val) {
|
|
|
+ switch (val) {
|
|
|
+ case 1:
|
|
|
+ this.range = getLastMonth()
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.range = getLast3Month()
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ this.range = getLast6Month()
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ this.range = getLastWeek()
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.handelDate(this.range)
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.getUserData()
|
|
|
this.range = getLastWeek()
|
|
@@ -100,24 +122,12 @@
|
|
|
// 切换时间
|
|
|
monthChange(current) {
|
|
|
this.monthCurrent = current
|
|
|
- switch (current) {
|
|
|
- case 1:
|
|
|
- this.range = getLastMonth()
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- this.range = getLast3Month()
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- this.range = getLast6Month()
|
|
|
- break;
|
|
|
- default:
|
|
|
- this.range = getLastWeek()
|
|
|
- break;
|
|
|
- }
|
|
|
},
|
|
|
//获取当前登录人所有数据组
|
|
|
getUserData() {
|
|
|
- uni.$http.get('/itemGroup/getAllItemGroup').then(res => {
|
|
|
+ uni.$http.get('/itemGroup/getAllItemGroup', {
|
|
|
+ readMode: 0
|
|
|
+ }).then(res => {
|
|
|
const data = res.data
|
|
|
if (data.code === 200) {
|
|
|
this.datasList = data.data.map(item => {
|
|
@@ -131,7 +141,10 @@
|
|
|
},
|
|
|
//通过id获取数据组
|
|
|
getDataListById(id) {
|
|
|
- uni.$http.get('/itemGroup/getItemGroupById/' + id).then(res => {
|
|
|
+ uni.$http.get('/itemGroup/getItemGroupById', {
|
|
|
+ id: id,
|
|
|
+ itemType: 1
|
|
|
+ }).then(res => {
|
|
|
const data = res.data
|
|
|
if (data.code === 200) {
|
|
|
this.dataItem = data.data.itemList.map(item => {
|
|
@@ -153,8 +166,8 @@
|
|
|
timestr += ':'
|
|
|
timestr += date.getSeconds() < 10 ? ('0' + date.getSeconds()) : date.getSeconds()
|
|
|
// 临时当前时间,需要改成选择时间----结束
|
|
|
- this.queryParams.startTime = this.resolvingDate2(this.range[0]) + ' ' + timestr
|
|
|
- this.queryParams.endTime = this.resolvingDate2(this.range[1]) + ' ' + timestr
|
|
|
+ // this.queryParams.startTime = this.resolvingDate2(this.range[0]) + ' ' + timestr
|
|
|
+ // this.queryParams.endTime = this.resolvingDate2(this.range[1]) + ' ' + timestr
|
|
|
uni.$http.get('/itemGroup/itemDataQuery', this.queryParams).then(res => {
|
|
|
const data = res.data
|
|
|
if (data.code === 200) {
|