Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
7ff5b18e16
11 changed files with 331 additions and 5 deletions
  1. 2
      app.js
  2. 92
      xtends/statics/agent-report/index.js
  3. 3
      xtends/statics/agent-report/index.json
  4. 12
      xtends/statics/agent-report/index.wxml
  5. 92
      xtends/statics/gross-report/index.js
  6. 3
      xtends/statics/gross-report/index.json
  7. 12
      xtends/statics/gross-report/index.wxml
  8. 12
      xtends/statics/purchase-report/index.js
  9. 93
      xtends/statics/sale-report/index.js
  10. 3
      xtends/statics/sale-report/index.json
  11. 12
      xtends/statics/sale-report/index.wxml

2
app.js

@ -2,7 +2,7 @@
App({
evn: 0, // 0: 开发版本;1:测试版本;2:生产版本
tmplIds: ['AFoM5TOfsgERsfcetNSB0UlmEixnLF1ySXr54Bqno2M', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'],
version: '2.0.0',
version: '2.1.0',
xAppId: '503258978847953926',
userInfo: null,
//----------------------------------------------globalData--------------------------------------

92
xtends/statics/agent-report/index.js

@ -1,15 +1,105 @@
import Scene from '../../../pages/index/scene'
import { getStatisticsInfo } from "../../../api/saas"
import util from '../../../utils/util'
const app = getApp()
Scene({
/**
* 页面的初始数据
*/
data: {
height: app.globalData.fragmentHeight,
form: {},
columns: [
{ key: 'catname', title: '品类', width: 100, fixed: 'left', align: 'center' },
{ key: 'product_title', width: 100, fixed: 'left', title: '结算重量(吨)' },
{ key: 'product_bar_code', title: '实收金额(元)', width: 100, },
{ key: 'quantity', width: 100, title: '代卖费(元)' }
],
data: [
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '187500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '187500.00', quantity: '2.500'},
],
show: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '加载中', mask: true })
var min = new Date()
min.setFullYear(min.getFullYear() - 1, min.getMonth(), min.getDate())
min.setHours(0, 0, 0)
var minDate = min.getTime()
var max = new Date(new Date().getTime() + 24 * 60 * 60 * 1000)
max.setHours(0, 0, 0)
var maxDate = max.getTime()
var today = new Date()
today.setHours(0, 0, 0)
var vdate = [today.getTime(), maxDate]
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D')
this.data.form.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, 'Y-M-D') + ' 00:00:00'
this.setData({ height: app.globalData.fragmentHeight - 80, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo()
},
showCalendar: function(){
this.setData({ show: true })
},
onClose: function() {
this.setData({ show: false })
},
onSelect: function({detail}) {
var start = new Date(detail[0])
var end = new Date(detail[1])
var vdateString = util.formatDate(start, 'Y-M-D') + '至' + util.formatDate(end, 'Y-M-D')
this.data.form.startTime = util.formatDate(start, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00'
this.setData({ show: false, vdateString })
wx.showLoading({ title: '加载中', mask: true })
this.fetchStatisticsInfo()
},
fetchStatisticsInfo: function(){
getStatisticsInfo(this.data.form).then(result => {
// this.setData({ })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
})
}
})

3
xtends/statics/agent-report/index.json

@ -1,5 +1,8 @@
{
"usingComponents": {
"van-icon": "/components/icon/index",
"van-table": "/components/table/index",
"van-calendar": "/components/calendar/index",
"notification": "/pages/message/notification/index"
}
}

12
xtends/statics/agent-report/index.wxml

@ -3,6 +3,18 @@
<view slot="content">代卖报表</view>
</cu-custom>
<view class="bg-white flex flex-justify" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="flex flex-center" bindtap="showCalendar">
<view style="height:24rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">出货信息</view>
</view>
<view class="flex flex-center" style="padding: 2rpx 0rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view>
</view>
<van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table>
<van-calendar show="{{ show }}" type="range" row-height="50" color="#008AFF" z-index="22" min-date="{{ minDate }}" max-date="{{ maxDate }}" default-date="{{ vdate }}" title="日期范围选择" show-subtitle="{{ false }}" show-confirm="{{ false }}" bind:close="onClose" bind:confirm="onSelect"/>
<notification id="qn-notification"/>

92
xtends/statics/gross-report/index.js

@ -1,15 +1,105 @@
import Scene from '../../../pages/index/scene'
import { getStatisticsInfo } from "../../../api/saas"
import util from '../../../utils/util'
const app = getApp()
Scene({
/**
* 页面的初始数据
*/
data: {
height: app.globalData.fragmentHeight,
form: {},
columns: [
{ key: 'catname', title: '品类', width: 100, fixed: 'left', align: 'center' },
{ key: 'product_title', width: 100, fixed: 'left', title: '采购金额(元)' },
{ key: 'product_bar_code', title: '销售金额(元)', width: 100, },
{ key: 'quantity', width: 80, title: '毛利(元)' }
],
data: [
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '187500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '87500.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '35000.00', product_title: '187500.00', quantity: '2.500'},
],
show: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '加载中', mask: true })
var min = new Date()
min.setFullYear(min.getFullYear() - 1, min.getMonth(), min.getDate())
min.setHours(0, 0, 0)
var minDate = min.getTime()
var max = new Date(new Date().getTime() + 24 * 60 * 60 * 1000)
max.setHours(0, 0, 0)
var maxDate = max.getTime()
var today = new Date()
today.setHours(0, 0, 0)
var vdate = [today.getTime(), maxDate]
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D')
this.data.form.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, 'Y-M-D') + ' 00:00:00'
this.setData({ height: app.globalData.fragmentHeight - 80, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo()
},
showCalendar: function(){
this.setData({ show: true })
},
onClose: function() {
this.setData({ show: false })
},
onSelect: function({detail}) {
var start = new Date(detail[0])
var end = new Date(detail[1])
var vdateString = util.formatDate(start, 'Y-M-D') + '至' + util.formatDate(end, 'Y-M-D')
this.data.form.startTime = util.formatDate(start, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00'
this.setData({ show: false, vdateString })
wx.showLoading({ title: '加载中', mask: true })
this.fetchStatisticsInfo()
},
fetchStatisticsInfo: function(){
getStatisticsInfo(this.data.form).then(result => {
// this.setData({ })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
})
}
})

3
xtends/statics/gross-report/index.json

@ -1,5 +1,8 @@
{
"usingComponents": {
"van-icon": "/components/icon/index",
"van-table": "/components/table/index",
"van-calendar": "/components/calendar/index",
"notification": "/pages/message/notification/index"
}
}

12
xtends/statics/gross-report/index.wxml

@ -3,6 +3,18 @@
<view slot="content">毛利报表</view>
</cu-custom>
<view class="bg-white flex flex-justify" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="flex flex-center" bindtap="showCalendar">
<view style="height:24rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">出货信息</view>
</view>
<view class="flex flex-center" style="padding: 2rpx 0rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view>
</view>
<van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table>
<van-calendar show="{{ show }}" type="range" row-height="50" color="#008AFF" z-index="22" min-date="{{ minDate }}" max-date="{{ maxDate }}" default-date="{{ vdate }}" title="日期范围选择" show-subtitle="{{ false }}" show-confirm="{{ false }}" bind:close="onClose" bind:confirm="onSelect"/>
<notification id="qn-notification"/>

12
xtends/statics/purchase-report/index.js

@ -1,5 +1,7 @@
import Scene from '../../../pages/index/scene'
import { getStatisticsInfo } from "../../../api/saas"
import util from '../../../utils/util'
const app = getApp()
Scene({
@ -59,6 +61,7 @@ Scene({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '加载中', mask: true })
var min = new Date()
min.setFullYear(min.getFullYear() - 1, min.getMonth(), min.getDate())
min.setHours(0, 0, 0)
@ -73,6 +76,7 @@ Scene({
this.data.form.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, 'Y-M-D') + ' 00:00:00'
this.setData({ height: app.globalData.fragmentHeight - 80, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo()
},
showCalendar: function(){
this.setData({ show: true })
@ -87,9 +91,15 @@ Scene({
this.data.form.startTime = util.formatDate(start, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00'
this.setData({ show: false, vdateString })
wx.showLoading({ title: '加载中', mask: true })
this.fetchStatisticsInfo()
},
fetchStatisticsInfo: function(){
getStatisticsInfo(this.data.form).then(result => {
// this.setData({ })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
})
}
})

93
xtends/statics/sale-report/index.js

@ -1,15 +1,106 @@
import Scene from '../../../pages/index/scene'
import { getStatisticsInfo } from "../../../api/saas"
import util from '../../../utils/util'
const app = getApp()
Scene({
/**
* 页面的初始数据
*/
data: {
height: app.globalData.fragmentHeight,
form: {},
columns: [
{ key: 'catname', title: '品类', width: 100, fixed: 'left', align: 'center' },
{ key: 'product_title', width: 90, fixed: 'left', title: '出货重量' },
{ key: 'product_bar_code', title: '结算重量', width: 90, },
{ key: 'quantity', width: 90, title: '结算均价' },
{ key: 'quantity', width: 90, title: '结算金额' }
],
data: [
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '1870.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '870.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '870.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '875.00', quantity: '2.500'},
{catname: '黄纸皮A级', product_bar_code: '2400.00', product_title: '1875.00', quantity: '2.500'},
],
show: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '加载中', mask: true })
var min = new Date()
min.setFullYear(min.getFullYear() - 1, min.getMonth(), min.getDate())
min.setHours(0, 0, 0)
var minDate = min.getTime()
var max = new Date(new Date().getTime() + 24 * 60 * 60 * 1000)
max.setHours(0, 0, 0)
var maxDate = max.getTime()
var today = new Date()
today.setHours(0, 0, 0)
var vdate = [today.getTime(), maxDate]
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D')
this.data.form.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, 'Y-M-D') + ' 00:00:00'
this.setData({ height: app.globalData.fragmentHeight - 80, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo()
},
showCalendar: function(){
this.setData({ show: true })
},
onClose: function() {
this.setData({ show: false })
},
onSelect: function({detail}) {
var start = new Date(detail[0])
var end = new Date(detail[1])
var vdateString = util.formatDate(start, 'Y-M-D') + '至' + util.formatDate(end, 'Y-M-D')
this.data.form.startTime = util.formatDate(start, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00'
this.setData({ show: false, vdateString })
wx.showLoading({ title: '加载中', mask: true })
this.fetchStatisticsInfo()
},
fetchStatisticsInfo: function(){
getStatisticsInfo(this.data.form).then(result => {
// this.setData({ })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
})
}
})

3
xtends/statics/sale-report/index.json

@ -1,5 +1,8 @@
{
"usingComponents": {
"van-icon": "/components/icon/index",
"van-table": "/components/table/index",
"van-calendar": "/components/calendar/index",
"notification": "/pages/message/notification/index"
}
}

12
xtends/statics/sale-report/index.wxml

@ -3,6 +3,18 @@
<view slot="content">销售报表</view>
</cu-custom>
<view class="bg-white flex flex-justify" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="flex flex-center" bindtap="showCalendar">
<view style="height:24rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">出货信息</view>
</view>
<view class="flex flex-center" style="padding: 2rpx 0rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view>
</view>
<van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table>
<van-calendar show="{{ show }}" type="range" row-height="50" color="#008AFF" z-index="22" min-date="{{ minDate }}" max-date="{{ maxDate }}" default-date="{{ vdate }}" title="日期范围选择" show-subtitle="{{ false }}" show-confirm="{{ false }}" bind:close="onClose" bind:confirm="onSelect"/>
<notification id="qn-notification"/>
Loading…
Cancel
Save