Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
985ebbc7fb
30 changed files with 954 additions and 523 deletions
  1. 5
      api/saas.js
  2. BIN
      assets/home/icon-report.png
  3. 43
      components/circle/canvas.js
  4. 185
      components/circle/index.js
  5. 3
      components/circle/index.json
  6. 9
      components/circle/index.wxml
  7. 1
      components/circle/index.wxss
  8. 3
      components/grid-item/index.js
  9. 7
      components/grid-item/index.wxml
  10. 215
      components/table/index.js
  11. 2
      components/table/index.json
  12. 43
      components/table/index.wxml
  13. 76
      components/table/index.wxss
  14. 2
      pages/home/index/index.wxml
  15. BIN
      xtends/image/icon-agent.png
  16. BIN
      xtends/image/icon-gross.png
  17. BIN
      xtends/image/icon-purchase.png
  18. BIN
      xtends/image/icon-sale.png
  19. 82
      xtends/statics/agent-report/index.js
  20. 26
      xtends/statics/agent-report/index.wxml
  21. 82
      xtends/statics/gross-report/index.js
  22. 27
      xtends/statics/gross-report/index.wxml
  23. 209
      xtends/statics/index/index.js
  24. 2
      xtends/statics/index/index.json
  25. 175
      xtends/statics/index/index.wxml
  26. 59
      xtends/statics/index/index.wxss
  27. 92
      xtends/statics/purchase-report/index.js
  28. 18
      xtends/statics/purchase-report/index.wxml
  29. 84
      xtends/statics/sale-report/index.js
  30. 27
      xtends/statics/sale-report/index.wxml

5
api/saas.js

@ -76,6 +76,8 @@ const poundSideOrder = (params) => mPost(`/ztb-factory/submit/scrap-paper-offsit
const priceSideOrder = (params) => mPost(`/ztb-factory/submit/scrap-paper-offsite-receipt-order-price`, params, sconfig) const priceSideOrder = (params) => mPost(`/ztb-factory/submit/scrap-paper-offsite-receipt-order-price`, params, sconfig)
const repeatSideOrder = (params) => mPost(`/ztb-factory/renew/scrap-paper-offsite-receipt-order-price`, params, sconfig) const repeatSideOrder = (params) => mPost(`/ztb-factory/renew/scrap-paper-offsite-receipt-order-price`, params, sconfig)
const getSummaryReport = (params) => mGet(`/ztb-factory/get/receipt-daily-report`, params, sconfig)
export { export {
sconfig, sconfig,
loginToken, loginToken,
@ -141,5 +143,6 @@ export {
saveSideOrder, saveSideOrder,
poundSideOrder, poundSideOrder,
priceSideOrder, priceSideOrder,
repeatSideOrder
repeatSideOrder,
getSummaryReport
} }

BIN
assets/home/icon-report.png

Before After
Width: 68  |  Height: 68  |  Size: 3.4 KiB

43
components/circle/canvas.js

@ -0,0 +1,43 @@
export function adaptor(ctx) {
// @ts-ignore
return Object.assign(ctx, {
setStrokeStyle(val) {
ctx.strokeStyle = val;
},
setLineWidth(val) {
ctx.lineWidth = val;
},
setLineCap(val) {
ctx.lineCap = val;
},
setFillStyle(val) {
ctx.fillStyle = val;
},
setFontSize(val) {
ctx.font = String(val);
},
setGlobalAlpha(val) {
ctx.globalAlpha = val;
},
setLineJoin(val) {
ctx.lineJoin = val;
},
setTextAlign(val) {
ctx.textAlign = val;
},
setMiterLimit(val) {
ctx.miterLimit = val;
},
setShadow(offsetX, offsetY, blur, color) {
ctx.shadowOffsetX = offsetX;
ctx.shadowOffsetY = offsetY;
ctx.shadowBlur = blur;
ctx.shadowColor = color;
},
setTextBaseline(val) {
ctx.textBaseline = val;
},
createCircularGradient() {},
draw() {},
});
}

185
components/circle/index.js

@ -0,0 +1,185 @@
import { VantComponent } from '../common/component';
import { BLUE, WHITE } from '../common/color';
import { adaptor } from './canvas';
import { isObj } from '../common/validator';
import { getSystemInfoSync } from '../common/utils';
function format(rate) {
return Math.min(Math.max(rate, 0), 100);
}
const PERIMETER = 2 * Math.PI;
const BEGIN_ANGLE = -Math.PI / 2;
const STEP = 1;
VantComponent({
props: {
text: String,
lineCap: {
type: String,
value: 'round',
},
value: {
type: Number,
value: 0,
observer: 'reRender',
},
speed: {
type: Number,
value: 50,
},
size: {
type: Number,
value: 100,
observer() {
this.drawCircle(this.currentValue);
},
},
fill: String,
layerColor: {
type: String,
value: WHITE,
},
color: {
type: null,
value: BLUE,
observer() {
this.setHoverColor().then(() => {
this.drawCircle(this.currentValue);
});
},
},
type: {
type: String,
value: '',
},
strokeWidth: {
type: Number,
value: 4,
},
clockwise: {
type: Boolean,
value: true,
},
},
data: {
hoverColor: BLUE,
},
methods: {
getContext() {
const { type, size } = this.data;
if (type === '') {
const ctx = wx.createCanvasContext('van-circle', this);
return Promise.resolve(ctx);
}
const dpr = getSystemInfoSync().pixelRatio;
return new Promise((resolve) => {
wx.createSelectorQuery()
.in(this)
.select('#van-circle')
.node()
.exec((res) => {
const canvas = res[0].node;
const ctx = canvas.getContext(type);
if (!this.inited) {
this.inited = true;
canvas.width = size * dpr;
canvas.height = size * dpr;
ctx.scale(dpr, dpr);
}
resolve(adaptor(ctx));
});
});
},
setHoverColor() {
const { color, size } = this.data;
if (isObj(color)) {
return this.getContext().then((context) => {
const LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color)
.sort((a, b) => parseFloat(a) - parseFloat(b))
.map((key) =>
LinearColor.addColorStop(parseFloat(key) / 100, color[key])
);
this.hoverColor = LinearColor;
});
}
this.hoverColor = color;
return Promise.resolve();
},
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
const { strokeWidth, lineCap, clockwise, size } = this.data;
const position = size / 2;
const radius = position - strokeWidth / 2;
context.setStrokeStyle(strokeStyle);
context.setLineWidth(strokeWidth);
context.setLineCap(lineCap);
context.beginPath();
context.arc(position, position, radius, beginAngle, endAngle, !clockwise);
context.stroke();
if (fill) {
context.setFillStyle(fill);
context.fill();
}
},
renderLayerCircle(context) {
const { layerColor, fill } = this.data;
this.presetCanvas(context, layerColor, 0, PERIMETER, fill);
},
renderHoverCircle(context, formatValue) {
const { clockwise } = this.data;
// 结束角度
const progress = PERIMETER * (formatValue / 100);
const endAngle = clockwise
? BEGIN_ANGLE + progress
: 3 * Math.PI - (BEGIN_ANGLE + progress);
this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle);
},
drawCircle(currentValue) {
const { size } = this.data;
this.getContext().then((context) => {
context.clearRect(0, 0, size, size);
this.renderLayerCircle(context);
const formatValue = format(currentValue);
if (formatValue !== 0) {
this.renderHoverCircle(context, formatValue);
}
context.draw();
});
},
reRender() {
// tofector 动画暂时没有想到好的解决方案
const { value, speed } = this.data;
if (speed <= 0 || speed > 1000) {
this.drawCircle(value);
return;
}
this.clearInterval();
this.currentValue = this.currentValue || 0;
this.interval = setInterval(() => {
if (this.currentValue !== value) {
if (this.currentValue < value) {
this.currentValue += STEP;
} else {
this.currentValue -= STEP;
}
this.drawCircle(this.currentValue);
} else {
this.clearInterval();
}
}, 1000 / speed);
},
clearInterval() {
if (this.interval) {
clearInterval(this.interval);
this.interval = null;
}
},
},
mounted() {
this.currentValue = this.data.value;
this.setHoverColor().then(() => {
this.drawCircle(this.currentValue);
});
},
destroyed() {
this.clearInterval();
},
});

3
components/circle/index.json

@ -0,0 +1,3 @@
{
"component": true
}

9
components/circle/index.wxml

@ -0,0 +1,9 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-circle">
<canvas class="van-circle__canvas" type="{{ type }}" style="width: {{ utils.addUnit(size) }};height:{{ utils.addUnit(size) }}" id="van-circle" canvas-id="van-circle"></canvas>
<view wx:if="{{ !text }}" class="van-circle__text">
<slot></slot>
</view>
<cover-view wx:else class="van-circle__text">{{ text }}</cover-view>
</view>

1
components/circle/index.wxss

@ -0,0 +1 @@
@import '../common/index.wxss';.van-circle{position:relative;display:inline-block;text-align:center}.van-circle__text{position:absolute;top:50%;left:0;width:100%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:#323233;color:var(--circle-text-color,#323233)}

3
components/grid-item/index.js

@ -14,6 +14,7 @@ VantComponent({
dot: Boolean, dot: Boolean,
info: null, info: null,
text: String, text: String,
contentStyle: String,
useSlot: Boolean useSlot: Boolean
}, },
data: { data: {
@ -54,7 +55,7 @@ VantComponent({
} }
this.setData({ this.setData({
viewStyle: styleWrapper.join('; '), viewStyle: styleWrapper.join('; '),
contentStyle,
// contentStyle,
center, center,
border, border,
square, square,

7
components/grid-item/index.wxml

@ -1,10 +1,7 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<view class="custom-class {{ utils.bem('grid-item', { square }) }}" style="{{ viewStyle }}" bindtap="onClick"> <view class="custom-class {{ utils.bem('grid-item', { square }) }}" style="{{ viewStyle }}" bindtap="onClick">
<view
class="content-class {{ utils.bem('grid-item__content', { center, square, clickable, surround: border && gutter }) }} {{ border ? 'van-hairline--surround' : '' }}"
style="{{ contentStyle }}"
>
<view class="content-class {{ utils.bem('grid-item__content', { center, square, clickable, surround: border && gutter }) }} {{ border ? 'van-hairline--surround' : '' }}" style="{{ contentStyle }}">
<block wx:if="{{ useSlot }}"> <block wx:if="{{ useSlot }}">
<slot /> <slot />
</block> </block>
@ -19,4 +16,4 @@
</view> </view>
</block> </block>
</view> </view>
</view>
</view>

215
components/table/index.js

@ -1,138 +1,89 @@
/** slot action
* btnName 按钮名
* valueCallback 按钮返回值
按钮绑定事件 btnClick
tr绑定事件 onRowClick
valueCallback tr返回值
columns 数组 {
key: '',
title: '',
width: 200,
fixed: 'left', //设置fixed 必须设置width
align: 'center',
// 按钮默认 slot action
slot: 'action'
valueCallback: '',
btnName: ''
}
**/
Component({ Component({
options: {
multipleSlots: true,
/**
* 外部样式类
*/
externalClasses: ['header-row-class-name', 'row-class-name', 'cell-class-name'],
/**
* 组件样式隔离
*/
options: {
styleIsolation: "isolated",
multipleSlots: true // 支持多个slot
},
/**
* 组件的属性列表
*/
properties: {
data: {
type: Array,
value: []
}, },
// 自定义外部样式class th头部样式 tr样式 td样式
externalClasses: ['thead-row-class', 'tbody-tow-class', 'td-class'],
properties: {
// td 数组
data: {
type: Array,
value: []
},
// thead 数组
columns: {
type: Array,
value: []
},
// table 高度
height: {
type: String,
value: 'auto'
},
// table 宽度
width: {
type: Number || String,
value: 750
},
// 单元格的宽度
tdWidth: {
type: Number,
value: 35
},
// 固定表头 thead达到Header的位置时就应该被fixed了
offsetTop: {
type: Number,
value: 150
},
// 是否带有纵向边框
isBorder: {
type: Boolean,
value: true
},
// 是否带有斑马条纹
isStripe: {
type: Boolean,
value: true
},
// tr 返回值Key
valueCallback: {
type: String,
value: ''
},
// 无数据时信息
msg: {
type: String,
value: '暂无数据~'
},
// thead 固定
isFixed: {
type: Boolean,
value: true
},
headers: {
type: Array,
value: []
}, },
data: {
scrolWidth: '100%',
marginTopValue: 0,
leftWidth: 0,
leftIndex: 0,
rightWidth: 0,
rightIndex: 0,
// table的高度, 溢出可滚动
height: {
type: Number || String,
value: 'auto'
},
width: {
type: Number || String,
value: '100%'
}, },
// 生命周期
lifetimes: {
// 组件实例进入页面节点树时调用
attached() {
const scrolWidth = this.properties.columns.reduce((total, item) => total + item.width, 0)
this.createSelectorQuery().selectAll(".thead .td").boundingClientRect((res) => {
if (!isNaN(scrolWidth)) {
this.properties.columns.map(item => {
item.width = item.width / scrolWidth * this.properties.width
})
} else {
this.properties.columns.map((item, index) => {
item.width = res[index].width
})
}
}).exec(res => {
let list = [], listLeft = [], listRight = [], leftWidth = 0, rightWidth = 0;
list = this.properties.columns.filter(item => !item.fixed)
listLeft = this.properties.columns.filter(item => item.fixed == 'left')
listLeft.map(item => {
leftWidth += item.width
})
listRight = this.properties.columns.filter(item => item.fixed == 'right')
listRight.map(item => {
rightWidth += item.width
})
this.setData({
columns: [...listLeft, ...list, ...listRight],
marginTopValue: res[0][0].height,
leftWidth: leftWidth,
rightWidth: rightWidth,
leftIndex: listLeft.length ? listLeft.length : 0,
rightIndex: listRight.length ? this.properties.columns.length - listRight.length - 1 : 0
})
})
},
// 单元格的宽度
tdWidth: {
type: Number,
value: 35
}, },
methods: {
onRowClick(e) {
this.triggerEvent('rowClick', e.target.dataset)
},
onBtnClick(e) {
this.triggerEvent('btnClick', e.target.dataset)
}
// 固定表头 thead达到Header的位置时就应该被fixed了
offsetTop: {
type: Number,
value: 150
}, },
})
// 是否带有纵向边框
stripe: {
type: Boolean,
value: false
},
// 是否带有纵向边框
border: {
type: Boolean,
value: true
},
msg: {
type: String,
value: '暂无数据~'
}
},
/**
* 组件的初始数据
*/
data: {
scrolWidth: '100%'
},
/**
* 组件的监听属性
*/
observers: {
// 在 numberA 或者 numberB 被设置时,执行这个函数
'headers': function headers(_headers) {
var reducer = function reducer(accumulator, currentValue) {
return accumulator + Number(currentValue.width);
};
var scrolWidth = _headers.reduce(reducer, 0);
this.setData({
scrolWidth: scrolWidth
});
}
},
/**
* 组件的方法列表
*/
methods: {
onRowClick: function onRowClick(e) {
this.triggerEvent('rowClick', e, e.currentTarget.dataset.it);
}
}
});

2
components/table/index.json

@ -1,3 +1,3 @@
{ {
"component": true "component": true
}
}

43
components/table/index.wxml

@ -1,22 +1,21 @@
<scroll-view scroll-x="true" enable-flex="true" class="table" style="width: 100%;">
<view class="thead {{isBorder ? 'thead-border' : ''}} thead-row-class" style="width: {{width}}rpx; position: {{isFixed ? 'fixed' : 'static'}}">
<view class="td" wx:for="{{columns}}" wx:key="index" style="width: {{item['width'] ? item['width'] : 200}}px; text-align: {{item.align ? item.align : 'center'}};">{{item.title}}</view>
</view>
<scroll-view scroll-y="true" class="tbody" style="width: {{width}}rpx; height: {{height ? height + 'rpx': 'auto'}};padding-top: {{marginTopValue}}px">
<block wx:for="{{data}}" wx:key="index" wx:if="{{data.length > 0}}">
<view class="tbody-tr {{ isStripe ? 'tbody-tr-stripe' : '' }} {{ isBorder ? 'tbody-tr-border' : ''}} tbody-tow-class">
<view wx:for-item="thead" wx:for-index="theadIndex" wx:key="theadIndex" wx:for="{{columns}}" class="td td-class"
style="width: {{columns[theadIndex].width}}px; text-align:{{columns[theadIndex].align ? columns[theadIndex].align : 'center'}}"
data-value="{{valueCallback ? item[valueCallback]: item}}" bindtap="onRowClick">
{{item[thead['key']]}}
<button wx:if="{{thead.slot}}" class='btn' plain="true" size='mini' data-value="{{item.valueCallback ? item[valueCallback]: item}}"
bindtap="onBtnClick">{{thead.btnName}}</button>
</view>
</view>
</block>
<block wx:if="{{data.length == 0}}">
<view class="no-data"> {{msg}} </view>
</block>
</scroll-view>
</scroll-view>
<slot></slot>
<scroll-view scroll-x="true" style="width:100%;" class="table table-border">
<!-- 表格头 start -->
<view class="thead {{ border ? 'thead-border' : ''}} header-row-class-name" style="width:{{ scrolWidth }}rpx;">
<view wx:for="{{ headers }}" wx:key="index" class="td" style="width:{{ item.width }}rpx;line-height: 80rpx">{{ item.label }}</view>
</view>
<!-- 表格体 start -->
<scroll-view scroll-y="true" class="tbody" style="width:{{ scrolWidth }}rpx; height:{{ height ? height : 'auto' }}rpx;">
<block wx:if="{{ data.length > 0 }}" wx:for-item="it" wx:for="{{ data }}" wx:for-index="idx" wx:key="idx">
<view class="tbody-tr {{ stripe ? 'tbody-tr-stripe' : '' }} {{ border ? 'tbody-tr-border' : ''}} row-class-name">
<view wx:for-item="head" wx:for="{{ headers }}" wx:key="index" class="td cell-class-name" data-it="{{it}}"
data-row="{{index}}" data-column="{{idx+1}}" style="width:{{ headers[index].width }}rpx;color:{{ headers[index].color }};" bindtap="onRowClick">
{{it[head["prop"]]}}
</view>
</view>
</block>
<!-- 列表无数据处理 -->
<block wx:if="{{ data.length === 0 }}">
<view class="no-data">{{ msg }}</view>
</block>
</scroll-view>
</scroll-view>

76
components/table/index.wxss

@ -1,68 +1,86 @@
.table { .table {
position: relative;
font-size: 28rpx; font-size: 28rpx;
background: #fff; background: #fff;
border-right:none; border-right:none;
/* border-radius: 8rpx; */
overflow: hidden; overflow: hidden;
} }
.thead{ .thead{
border-bottom: none;
display: flex; display: flex;
border: 1px solid #ebeef5;
justify-content: flex-start;
/* border-top-right-radius: 8rpx;
border-top-left-radius: 8rpx; */
overflow: visible;
color: #909399;
border: 1rpx solid #ebeef5;
box-sizing: border-box; box-sizing: border-box;
z-index: 9;
} }
.thead .td { .thead .td {
padding: 20rpx 10rpx;
/* padding: 20rpx 10rpx; */
font-weight: bold; font-weight: bold;
display: inline-block; display: inline-block;
white-space:nowrap;
text-align: center;
border-right: 1rpx solid #fff; border-right: 1rpx solid #fff;
background: #fff;
} }
.thead-border .td, .tbody-tr-border .td {
.thead .td:last-child {
border-right: none;
}
.thead-border .td {
border-right: 1rpx solid #ebeef5; border-right: 1rpx solid #ebeef5;
} }
.thead .td:last-child, .tbody-tr-border .td:last-child{
.thead-border .td:last-child {
border-right: none; border-right: none;
} }
/* .tr{
display: flex;
white-space:nowrap;
} */
.tbody { .tbody {
box-sizing: border-box; box-sizing: border-box;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
border: 1px solid #ebeef5;
border: 1px solid #ebeef5;
border-top: none; border-top: none;
/* border-bottom-left-radius: 8rpx;
border-bottom-right-radius: 8rpx; */
} }
.tbody-tr { .tbody-tr {
border-bottom: 1px solid #ebeef5;
display: flex; display: flex;
border-bottom: 1px solid #ebeef5;
} }
.tbody-tr .td {
padding: 20rpx 10rpx;
display: flex;
justify-content: center;
align-items: center;
background: #fff;
}
/* .tbody-tr:last-child {
border-bottom-left-radius: 8rpx;
border-bottom-right-radius: 8rpx;
} */
.tbody-tr-stripe { .tbody-tr-stripe {
background: #fff; background: #fff;
border-bottom: none; border-bottom: none;
} }
.tbody-tr-stripe:nth-child(2n) .td{
.tbody-tr-stripe:nth-child(2n) {
background: #F6F6F6; background: #F6F6F6;
} }
/* .tbody-tr .td text {
line-height: 0;
} */
.tbody-tr .td .btn {
font-size: 28rpx;
padding:0 5rpx;
color: #666;
width: 30px;
.tbody-tr .td {
white-space: wrap;
height: 80rpx;
/* padding:20rpx 10rpx; */
line-height: 80rpx;
text-align: center;
} }
.td {
overflow: hidden;
word-break: break-all;
.tbody-tr-border .td {
border-right: 1rpx solid #F6F6F6;
}
.tbody-tr-border .td:last-child {
border-right: none;
} }
.no-data { .no-data {
text-align: center;
padding: 40rpx;
display: flex;
padding: 50rpx;
color: #666; color: #666;
justify-content: center;
} }

2
pages/home/index/index.wxml

@ -47,7 +47,7 @@
<van-icon slot="icon" name="/assets/home/icon-card.png" size="76rpx" /> <van-icon slot="icon" name="/assets/home/icon-card.png" size="76rpx" />
</van-grid-item> </van-grid-item>
<van-grid-item text="智能报表" url="/xtends/statics/index/index" wx:if="{{isAdmin}}"> <van-grid-item text="智能报表" url="/xtends/statics/index/index" wx:if="{{isAdmin}}">
<van-icon slot="icon" name="/assets/home/icon-card.png" size="76rpx" />
<van-icon slot="icon" name="/assets/home/icon-report.png" size="76rpx" />
</van-grid-item> </van-grid-item>
</van-grid> </van-grid>
</view> </view>

BIN
xtends/image/icon-agent.png

Before After
Width: 80  |  Height: 80  |  Size: 3.6 KiB

BIN
xtends/image/icon-gross.png

Before After
Width: 80  |  Height: 80  |  Size: 4.3 KiB

BIN
xtends/image/icon-purchase.png

Before After
Width: 80  |  Height: 80  |  Size: 3.4 KiB

BIN
xtends/image/icon-sale.png

Before After
Width: 80  |  Height: 80  |  Size: 4.5 KiB

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

@ -12,48 +12,48 @@ Scene({
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
form: {}, form: {},
columns: [ 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: '代卖费(元)' }
{ prop: 'datetime', width: 200, label: '品类', color: '#55C355' },
{ prop: 'sign_in_time', width: 200, label: '结算重量(吨)' },
{ prop: 'sign_out_time', width: 200, label: '实收金额(元)' },
{ prop: 'work_hour', width: 150, label: '代卖费(元)' }
], ],
data: [ 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'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500'},
], ],
show: false show: false
}, },
@ -75,7 +75,7 @@ Scene({
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D') 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.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, '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.setData({ height: app.globalData.fragmentHeight - 404, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
showCalendar: function(){ showCalendar: function(){

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

@ -1,20 +1,38 @@
<!--xtends//statics/index/index.wxml--> <!--xtends//statics/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">代卖报表</view> <view slot="content">代卖报表</view>
</cu-custom> </cu-custom>
<view class="bg-white flex flex-justify" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="bg-white flex flex-justify van-hairline--bottom" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="flex flex-center" 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 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 class="text-black text-sg text-bold" style="margin-left: 12rpx">代卖统计</view>
</view> </view>
<view class="flex flex-center" style="padding: 2rpx 0rpx"> <view class="flex flex-center" style="padding: 2rpx 0rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view> <view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" /> <van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view> </view>
</view> </view>
<van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table>
<view class="bg-white flex" style="height:120rpx;padding-top:24rpx;">
<view style="width:320rpx;padding-left:48rpx">
<view class="text-xxl text-bold" style="color:#008AFF">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">代卖重量(吨)</view>
</view>
<view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#008AFF">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">实收(元)</view>
</view>
</view>
<view class="bg-white flex" style="height:120rpx;padding-top:8rpx">
<view style="width:320rpx;padding-left:48rpx">
<view class="text-xxl text-bold" style="color:#008AFF">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">代卖费(元)</view>
</view>
<view style="width:300rpx;">
</view>
</view>
<van-table headers="{{columns}}" data="{{ data }}" height="{{ height }}" stripe="{{ true }}"/>
<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"/> <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"/> <notification id="qn-notification"/>

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

@ -12,48 +12,48 @@ Scene({
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
form: {}, form: {},
columns: [ 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: '毛利(元)' }
{ prop: 'datetime', width: 200, label: '品类', color: '#55C355' },
{ prop: 'sign_in_time', width: 200, label: '采购金额(元)' },
{ prop: 'sign_out_time', width: 200, label: '销售金额(元)' },
{ prop: 'work_hour', width: 175, label: '毛利(元)' }
], ],
data: [ 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'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500', status: '2.500'},
], ],
show: false show: false
}, },
@ -75,7 +75,7 @@ Scene({
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D') 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.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, '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.setData({ height: app.globalData.fragmentHeight - 404, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
showCalendar: function(){ showCalendar: function(){

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

@ -1,20 +1,39 @@
<!--xtends//statics/index/index.wxml--> <!--xtends//statics/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">毛利报表</view> <view slot="content">毛利报表</view>
</cu-custom> </cu-custom>
<view class="bg-white flex flex-justify" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="bg-white flex flex-justify van-hairline--bottom" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="flex flex-center" 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 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 class="text-black text-sg text-bold" style="margin-left: 12rpx">收支统计</view>
</view> </view>
<view class="flex flex-center" style="padding: 2rpx 0rpx"> <view class="flex flex-center" style="padding: 2rpx 0rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view> <view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" /> <van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view> </view>
</view> </view>
<van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table>
<view class="bg-white flex" style="height:120rpx;padding-top:24rpx;">
<view style="width:320rpx;padding-left:48rpx">
<view class="text-xxl text-bold" style="color:#008AFF">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">总支出(元)</view>
</view>
<view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#008AFF">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">总收入(元)</view>
</view>
</view>
<view class="bg-white flex" style="height:120rpx;padding-top:8rpx">
<view style="width:320rpx;padding-left:48rpx">
<view class="text-xxl text-bold" style="color:#008AFF">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">总毛利(元)</view>
</view>
<view style="width:300rpx;">
</view>
</view>
<!-- <van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table> -->
<van-table headers="{{columns}}" data="{{ data }}" height="{{ height }}" stripe="{{ true }}"/>
<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"/> <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"/> <notification id="qn-notification"/>

209
xtends/statics/index/index.js

@ -1,102 +1,151 @@
// xtends//statics/index/index.js // xtends//statics/index/index.js
import Scene from '../../../pages/index/scene' import Scene from '../../../pages/index/scene'
import uCharts from '../../libs/u-charts'; import uCharts from '../../libs/u-charts';
import { getSummaryReport } from "../../../api/saas"
const math = require('../../../utils/math') const math = require('../../../utils/math')
import util from '../../../utils/util'
const app = getApp() const app = getApp()
var that;
var canvaColumn = null;
var windowWidth = 0;
// var that;
// var canvaColumn = null;
// var windowWidth = 0;
Scene({ Scene({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
cWidth: '',
cHeight: '',
// cWidth: '',
// cHeight: '',
form1: {},
form2: {},
percent: 85,
show: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
that = this
windowWidth = wx.getSystemInfoSync().windowWidth
this.data.cWidth = windowWidth - this.rpx2px(100)
// math.divide
this.data.cHeight = this.rpx2px(400)
this.getServerData()
// that = this
// windowWidth = wx.getSystemInfoSync().windowWidth
// this.data.cWidth = windowWidth - this.rpx2px(100)
// // math.divide
// this.data.cHeight = this.rpx2px(400)
// this.getServerData()
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.form1.dimensionDateStart = util.formatDate(today, 'Y-M-D')
this.data.form1.dimensionDateEnd = util.formatDate(max, 'Y-M-D')
this.data.form2.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form2.endTime = util.formatDate(max, 'Y-M-D') + ' 00:00:00'
this.setData({ minDate, maxDate, vdate, vdateString })
this.fetchSummaryInfo(this.data.form1)
}, },
rpx2px: function(rpx) {
return rpx / 750 * windowWidth;
},
getServerData: function() {
wx.request({
url: 'https://www.ucharts.cn/data.json',
success: function (res) {
let Column = { categories: [], series: [] };
Column.categories = res.data.data.Pie.categories;
Column.series = res.data.data.Pie.series;
// 自定义标签颜色和字体大小
// Column.series[1].textColor = 'red';
// Column.series[1].textSize = 18;
that.showColumn("canvasColumn", Column);
},
fail: () => {
console.log("请点击右上角【详情】,启用不校验合法域名");
},
fetchSummaryInfo: function(form){
getSummaryReport(form).then(result => {
// this.setData({ })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
}) })
}, },
showColumn(canvasId, chartData) {
let ctx = wx.createCanvasContext(canvasId, this);
canvaColumn = new uCharts({
type: 'ring',
context: ctx,
// fontSize: 11,
background: '#FFFFFF',
pixelRatio: 1,
// animation: true,
// categories: chartData.categories,
series: chartData.series,
color: [ "#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc" ],
dataLabel: true,
width: that.data.cWidth,
height: that.data.cHeight,
legend: {
show: true,
position: "right",
float: "center",
padding: 5,
margin: 5,
fontSize: 13,
fontColor: "#666666",
lineHeight: 25,
hiddenColor: "#CECECE",
itemGap: 10
},
extra: {
ring: {
ringWidth: 30,
centerColor: "#FFFFFF",
activeOpacity: 0.5,
activeRadius: 10,
offsetAngle: 0,
customRadius: 0,
labelWidth: 15,
border: true,
borderWidth: 3,
borderColor: "#FFFFFF",
linearType: "none"
}
}
});
showCalendar: function(e){
console.log(e.currentTarget.id)
this.setData({ show: true })
}, },
touchColumn(e) {
canvaColumn.showToolTip(e, {
formatter: function (item) {
console.log(item)
return item.name + ':' + item.data
}
})
}
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()
},
// rpx2px: function(rpx) {
// return rpx / 750 * windowWidth;
// },
// getServerData: function() {
// wx.request({
// url: 'https://www.ucharts.cn/data.json',
// success: function (res) {
// let Column = { categories: [], series: [] };
// Column.categories = res.data.data.Pie.categories;
// Column.series = res.data.data.Pie.series;
// // 自定义标签颜色和字体大小
// // Column.series[1].textColor = 'red';
// // Column.series[1].textSize = 18;
// that.showColumn("canvasColumn", Column);
// },
// fail: () => {
// console.log("请点击右上角【详情】,启用不校验合法域名");
// },
// })
// },
// showColumn(canvasId, chartData) {
// let ctx = wx.createCanvasContext(canvasId, this);
// canvaColumn = new uCharts({
// type: 'ring',
// context: ctx,
// // fontSize: 11,
// background: '#FFFFFF',
// pixelRatio: 1,
// // animation: true,
// // categories: chartData.categories,
// series: chartData.series,
// color: [ "#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc" ],
// dataLabel: true,
// width: that.data.cWidth,
// height: that.data.cHeight,
// legend: {
// show: false,
// position: "right",
// float: "center",
// padding: 5,
// margin: 5,
// fontSize: 13,
// fontColor: "#666666",
// lineHeight: 25,
// hiddenColor: "#CECECE",
// itemGap: 10
// },
// extra: {
// ring: {
// ringWidth: 30,
// centerColor: "#FFFFFF",
// activeOpacity: 0.5,
// activeRadius: 10,
// offsetAngle: 0,
// customRadius: 0,
// labelWidth: 15,
// border: true,
// borderWidth: 3,
// borderColor: "#FFFFFF",
// linearType: "none"
// }
// }
// });
// },
// touchColumn(e) {
// canvaColumn.showToolTip(e, {
// formatter: function (item) {
// console.log(item)
// return item.name + ':' + item.data
// }
// })
// }
}) })

2
xtends/statics/index/index.json

@ -3,6 +3,8 @@
"van-grid": "/components/grid/index", "van-grid": "/components/grid/index",
"van-grid-item": "/components/grid-item/index", "van-grid-item": "/components/grid-item/index",
"van-icon": "/components/icon/index", "van-icon": "/components/icon/index",
"van-circle": "/components/circle/index",
"van-calendar": "/components/calendar/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }
} }

175
xtends/statics/index/index.wxml

@ -4,82 +4,127 @@
<view slot="content">智能报表</view> <view slot="content">智能报表</view>
</cu-custom> </cu-custom>
<view style="padding: 0rpx 28rpx;margin-top:24rpx">
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx 12rpx 0rpx">
<van-grid column-num="4" border="{{fasle}}">
<van-grid-item text="采购报表" url="/xtends/statics/purchase-report/index">
<van-icon slot="icon" name="/assets/home/icon-employe.png" size="76rpx" />
</van-grid-item>
<van-grid-item text="销售报表" url="/xtends/statics/sale-report/index">
<van-icon slot="icon" name="/assets/home/icon-customer.png" size="76rpx" />
</van-grid-item>
<van-grid-item text="毛利报表" url="/xtends/statics/gross-report/index">
<van-icon slot="icon" name="/assets/home/icon-cate.png" size="76rpx" />
</van-grid-item>
<van-grid-item text="代卖报表" url="/xtends/statics/agent-report/index">
<van-icon slot="icon" name="/assets/home/icon-card.png" size="76rpx" />
</van-grid-item>
</van-grid>
</view>
</view>
<view style="padding: 0rpx 28rpx;margin-top:24rpx">
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx">
<view class="flex flex-justify" style="padding: 0rpx 28rpx 8rpx 28rpx">
<view class="text-black text-sg text-bold">收货统计</view>
</view>
<view style="padding:0rpx 24rpx 0rpx 24rpx">
<canvas canvas-id="canvasColumn" id="canvasColumn" class="charts" bindtouchstart="touchColumn"></canvas>
</view>
<view class="flex flex-justify" style="padding:0rpx 30rpx">
<view class="text-black text-sg">收货总重量</view>
<view class="text-black text-sg">收货总金额</view>
</view>
</view>
</view>
<view style="padding: 0rpx 28rpx;margin-top:24rpx">
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx 8rpx 0rpx">
<view class="flex flex-justify" style="padding: 0rpx 28rpx">
<view class="text-black text-sg text-bold">出货统计</view>
<view class="flex flex-center" bindtap="showSheet" style="padding: 2rpx 0rpx">
<view class="text-black text-sm" style="margin-right:8rpx">{{vdateString}}</view>
</view>
</view>
<view class="flex" style="padding: 16rpx 0rpx 8rpx 0rpx">
<view style="flex:1;padding:0rpx 32rpx;margin-right:12rpx">
<view class="flex flex-center" style="justify-content: flex-start">
<view style="height:24rpx;width:6rpx;background:#007AFF"></view>
<view class="text-black text-sm" style="margin-left: 12rpx">收货重量</view>
<view class="bg-white" style="padding: 16rpx 24rpx">
<van-grid column-num="2" border="{{fasle}}">
<van-grid-item content-style="padding: 8rpx 0rpx" use-slot url="/xtends/statics/purchase-report/index">
<view class="flex flex-justify" style="background: #F5F9F9;border-radius: 12rpx;padding: 24rpx;width:336rpx">
<view>
<view class="text-bold text-black text-lg">收货报表</view>
<view class="text-gray text-sm" style="margin-top:8rpx">核对收货数据</view>
</view> </view>
<view class="text-xxl text-bold" style="margin:12rpx 0rpx">{{formate.formateWeight(totalInfo.totalWeight || 0)}}吨</view>
<van-icon slot="icon" name="/xtends/image/icon-purchase.png" size="80rpx" />
</view> </view>
<view style="flex:1;padding:0rpx 32rpx;margin-left:12rpx">
<view class="flex flex-center" style="justify-content: flex-start">
<view style="height:24rpx;width:6rpx;background:#FF8413"></view>
<view class="text-black text-sm" style="margin-left: 12rpx">收货金额</view>
</van-grid-item>
<van-grid-item content-style="padding: 8rpx 0rpx" use-slot url="/xtends/statics/sale-report/index">
<view class="flex flex-justify" style="background: #F5F9F9;border-radius: 12rpx;padding: 24rpx;width:336rpx">
<view>
<view class="text-bold text-black text-lg">销售报表</view>
<view class="text-gray text-sm" style="margin-top:8rpx">核对销售数据</view>
</view> </view>
<view class="text-xxl text-bold text-price" style="margin:12rpx 0rpx">{{formate.formateAmount(totalInfo.totalMoney || 0)}}</view>
<van-icon slot="icon" name="/xtends/image/icon-sale.png" size="80rpx" />
</view> </view>
</view>
<view class="flex" style="padding: 16rpx 0rpx 8rpx 0rpx">
<view style="flex:1;padding:0rpx 32rpx;margin-right:12rpx">
<view class="flex flex-center" style="justify-content: flex-start">
<view style="height:24rpx;width:6rpx;background:#007AFF"></view>
<view class="text-black text-sm" style="margin-left: 12rpx">收货重量</view>
</van-grid-item>
<van-grid-item content-style="padding: 8rpx 0rpx" use-slot url="/xtends/statics/gross-report/index">
<view class="flex flex-justify" style="background: #F5F9F9;border-radius: 12rpx;padding: 24rpx;width:336rpx">
<view>
<view class="text-bold text-black text-lg">毛利报表</view>
<view class="text-gray text-sm" style="margin-top:8rpx">分析经营利润</view>
</view> </view>
<view class="text-xxl text-bold" style="margin:12rpx 0rpx">{{formate.formateWeight(totalInfo.totalWeight || 0)}}吨</view>
<van-icon slot="icon" name="/xtends/image/icon-gross.png" size="80rpx" />
</view> </view>
<view style="flex:1;padding:0rpx 32rpx;margin-left:12rpx">
<view class="flex flex-center" style="justify-content: flex-start">
<view style="height:24rpx;width:6rpx;background:#FF8413"></view>
<view class="text-black text-sm" style="margin-left: 12rpx">收货金额</view>
</van-grid-item>
<van-grid-item content-style="padding: 8rpx 0rpx" use-slot url="/xtends/statics/agent-report/index">
<view class="flex flex-justify" style="background: #F5F9F9;border-radius: 12rpx;padding: 24rpx;width:336rpx">
<view>
<view class="text-bold text-black text-lg">代卖报表</view>
<view class="text-gray text-sm" style="margin-top:8rpx">核对代卖数据</view>
</view> </view>
<view class="text-xxl text-bold text-price" style="margin:12rpx 0rpx">{{formate.formateAmount(totalInfo.totalMoney || 0)}}</view>
<van-icon slot="icon" name="/xtends/image/icon-agent.png" size="80rpx" />
</view> </view>
</van-grid-item>
</van-grid>
</view>
<view id="form1" class="bg-white flex flex-justify van-hairline--bottom" style="height:90rpx;margin-top:24rpx" bindtap="showCalendar">
<view class="flex flex-center" style="padding: 0rpx 32rpx">
<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-lg text-bold" style="margin-left: 12rpx">收货统计</view>
</view>
<view class="flex flex-center" style="padding: 2rpx 32rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view>
</view>
<view class="bg-white flex flex-center" style="padding: 32rpx 24rpx;">
<!-- <van-circle type="2d" value="{{ 60 }}" layer-color="#007AFF" color="#FF222C" stroke-width="24" wx:if="{{!show}}"/> -->
<view style="height:100px;width:100px">
<view class="shanxing {{((percent < 50 && percent != 0) || percent == 100) ? 'shanxing1' : 'shanxing2'}}">
<view wx:if="{{percent != 0 && percent != 100}}" class="sx1"></view>
<view wx:if="{{percent != 50 && percent != 0 && percent != 100}}" class="sx2" style="transform: rotate({{percent < 50 ? ((360 * percent / 100) - 180):(360 * (percent - 100) / 100)}}deg);"></view>
<view class="sx_t"></view>
</view>
</view>
<view class="flex" style="margin-left:24rpx;">
<view style="width:200rpx">
<view class="text-black text-sm">收货合计(吨)</view>
<view class="text-xxl" style="color:#278CC8;margin-top:8rpx">1230.45</view>
<view class="flex" style="margin-top:24rpx;align-items: center">
<text style="background-image: linear-gradient(270deg, #FF222C 0%, #FF691C 100%);border-radius:50%;height:16rpx;width:16rpx"></text>
<text class="text-black text-sm" style="margin-left:12rpx">场外收货(吨)</text>
</view>
<view class="text-black text-bold">1230.45</view>
</view>
<view style="width:240rpx">
<view class="text-black text-sm">收货总金额(元)</view>
<view class="text-xxl" style="color:#278CC8;margin-top:8rpx">1230.45</view>
<view class="flex" style="margin-top:24rpx;align-items: center">
<text style="background-image: linear-gradient(90deg, #007AFF 0%, #6BCDFF 100%);border-radius:50%;height:16rpx;width:16rpx"></text>
<text class="text-black text-sm" style="margin-left:12rpx">场内收货(吨)</text>
</view>
<view class="text-black text-bold">1230.45</view>
</view> </view>
</view> </view>
</view> </view>
<view id="form2" class="bg-white flex flex-justify van-hairline--bottom" style="height:90rpx;margin-top:24rpx" bindtap="showCalendar">
<view class="flex flex-center" style="padding: 0rpx 32rpx">
<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-lg text-bold" style="margin-left: 12rpx">销售统计</view>
</view>
<view class="flex flex-center" style="padding: 2rpx 32rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view>
</view>
<view class="bg-white flex flex-center">
<view class="flex flex-center flex-column" style="flex:1;padding:32rpx">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">总出货重量(吨)</view>
</view>
<view class="van-hairline--left" style="height:100rpx"></view>
<view class="flex flex-center flex-column" style="flex:1;padding:32rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">总结算重量(吨)</view>
</view>
</view>
<view class="bg-white flex flex-justify" style="padding: 0rpx 32rpx">
<view class="van-hairline--top" style="width:320rpx"></view>
<view class="van-hairline--top" style="width:320rpx"></view>
</view>
<view class="bg-white flex flex-center">
<view class="flex flex-center flex-column" style="flex:1;padding:32rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">总出车数(车)</view>
</view>
<view class="van-hairline--left" style="height:100rpx"></view>
<view class="flex flex-center flex-column" style="flex:1;padding: 32rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">总结算金额(元)</view>
</view>
</view>
<view style="height:24rpx"></view> <view style="height:24rpx"></view>
<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"/>
<notification id="qn-notification"/> <notification id="qn-notification"/>

59
xtends/statics/index/index.wxss

@ -8,4 +8,61 @@
width: 100%; width: 100%;
height: 400rpx; height: 400rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
}
}
.shanxing {
width: 200rpx;
height: 200rpx;
margin: 10rpx auto;
position: relative;
border-radius: 50%;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.sx1, .sx2 {
position: absolute;
top: 0;
left: 0;
width: 200rpx;
height: 200rpx;
clip: rect(0rpx, 100rpx, 200rpx, 0rpx);
}
.sx1 {
z-index: 1;
}
.sx2 {
z-index: 2;
}
.sx_t {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
z-index: 3;
background: #fff;
}
.shanxing1 {
/* background: #FF222C; */
background-image: linear-gradient(269deg, #FF222C 0%, #FF691C 100%);
}
.shanxing1 .sx1, .shanxing1 .sx2 {
background: #007AFF;
}
.shanxing2 {
background: #007AFF;
}
.shanxing2 .sx1, .shanxing2 .sx2 {
/* background: #FF222C; */
background-image: linear-gradient(269deg, #FF222C 0%, #FF691C 100%);
transform: rotate(180deg);
}

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

@ -1,5 +1,5 @@
import Scene from '../../../pages/index/scene' import Scene from '../../../pages/index/scene'
import { getStatisticsInfo } from "../../../api/saas"
import { getSummaryReport } from "../../../api/saas"
import util from '../../../utils/util' import util from '../../../utils/util'
const app = getApp() const app = getApp()
@ -12,48 +12,48 @@ Scene({
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
form: {}, form: {},
columns: [ columns: [
{ key: 'catname', title: '品类', width: 100, fixed: 'left', align: 'center' },
{ key: 'product_title', width: 80, fixed: 'left', title: '重量(公斤)' },
{ key: 'product_bar_code', title: '金额(元)', width: 80, },
{ key: 'quantity', width: 100, title: '均价(元/公斤)' }
{ prop: 'datetime', width: 200, label: '品类', color: '#55C355' },
{ prop: 'sign_in_time', width: 175, label: '重量(公斤)' },
{ prop: 'sign_out_time', width: 175, label: '金额(元)' },
{ prop: 'work_hour', width: 200, label: '均价(元/公斤)' }
], ],
data: [ 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'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500', status: '2.500'},
], ],
show: false show: false
}, },
@ -73,9 +73,9 @@ Scene({
today.setHours(0, 0, 0) today.setHours(0, 0, 0)
var vdate = [today.getTime(), maxDate] var vdate = [today.getTime(), maxDate]
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D') 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.data.form.dimensionDateStart = util.formatDate(today, 'Y-M-D')
this.data.form.dimensionDateEnd = util.formatDate(max, 'Y-M-D')
this.setData({ height: app.globalData.fragmentHeight - 304, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
showCalendar: function(){ showCalendar: function(){
@ -85,17 +85,17 @@ Scene({
this.setData({ show: false }) this.setData({ show: false })
}, },
onSelect: function({detail}) { onSelect: function({detail}) {
wx.showLoading({ title: '加载中', mask: true })
var start = new Date(detail[0]) var start = new Date(detail[0])
var end = new Date(detail[1]) var end = new Date(detail[1])
var vdateString = util.formatDate(start, 'Y-M-D') + '至' + util.formatDate(end, 'Y-M-D') 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.startTime = util.formatDate(start, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00' this.data.form.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00'
this.setData({ show: false, vdateString }) this.setData({ show: false, vdateString })
wx.showLoading({ title: '加载中', mask: true })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
fetchStatisticsInfo: function(){ fetchStatisticsInfo: function(){
getStatisticsInfo(this.data.form).then(result => {
getSummaryReport(this.data.form).then(result => {
// this.setData({ }) // this.setData({ })
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {

18
xtends/statics/purchase-report/index.wxml

@ -1,9 +1,10 @@
<!--xtends//statics/index/index.wxml--> <!--xtends//statics/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">采购报表</view>
<view slot="content">收货报表</view>
</cu-custom> </cu-custom>
<view class="bg-white flex flex-justify" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="bg-white flex flex-justify van-hairline--bottom" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="flex flex-center" 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 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 class="text-black text-sg text-bold" style="margin-left: 12rpx">出货信息</view>
@ -13,8 +14,17 @@
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" /> <van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view> </view>
</view> </view>
<van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table>
<view class="bg-white flex" style="height:140rpx;padding-top:24rpx;">
<view style="width:320rpx;padding-left:48rpx">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">重量(公斤)</view>
</view>
<view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">合计金额(元)</view>
</view>
</view>
<van-table headers="{{columns}}" data="{{ data }}" height="{{ height }}" stripe="{{ true }}"/>
<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"/> <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"/> <notification id="qn-notification"/>

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

@ -12,49 +12,49 @@ Scene({
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
form: {}, form: {},
columns: [ 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: '结算金额' }
{ prop: 'datetime', width: 200, label: '品类', color: '#55C355' },
{ prop: 'sign_in_time', width: 180, label: '出货重量(吨)' },
{ prop: 'sign_out_time', width: 180, label: '结算重量(吨)' },
{ prop: 'work_hour', width: 220, label: '结算均价(元/吨)' },
{ prop: 'status', width: 180, label: '结算金额(元)' }
], ],
data: [ 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'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '87500.00', work_hour: '2.500', status: '2.500'},
{datetime: '黄纸皮A级', sign_in_time: '35000.00', sign_out_time: '187500.00', work_hour: '2.500', status: '2.500'},
], ],
show: false show: false
}, },
@ -76,7 +76,7 @@ Scene({
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D') 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.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00'
this.data.form.endTime = util.formatDate(max, '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.setData({ height: app.globalData.fragmentHeight - 404, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
showCalendar: function(){ showCalendar: function(){

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

@ -1,20 +1,41 @@
<!--xtends//statics/index/index.wxml--> <!--xtends//statics/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">销售报表</view> <view slot="content">销售报表</view>
</cu-custom> </cu-custom>
<view class="bg-white flex flex-justify" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="bg-white flex flex-justify van-hairline--bottom" style="height:80rpx;padding: 0rpx 32rpx" bindtap="showCalendar">
<view class="flex flex-center" 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 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 class="text-black text-sg text-bold" style="margin-left: 12rpx">销售统计</view>
</view> </view>
<view class="flex flex-center" style="padding: 2rpx 0rpx"> <view class="flex flex-center" style="padding: 2rpx 0rpx">
<view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view> <view class="text-black text-df" style="margin-right:8rpx">{{vdateString}}</view>
<van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" /> <van-icon name="{{show ? 'arrow-up' : 'arrow-down'}}" />
</view> </view>
</view> </view>
<view class="bg-white flex" style="height:120rpx;padding-top:24rpx;">
<view style="width:320rpx;padding-left:48rpx">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">出货重量(吨)</view>
</view>
<view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">结算重量(吨)</view>
</view>
</view>
<view class="bg-white flex" style="height:120rpx;padding-top:8rpx">
<view style="width:320rpx;padding-left:48rpx">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">出货车数(车)</view>
</view>
<view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-black text-sm">金额(元)</view>
</view>
</view>
<van-table columns="{{columns}}" height="{{height}}" data="{{data}}"></van-table>
<van-table headers="{{columns}}" data="{{ data }}" height="{{ height }}" stripe="{{ true }}"/>
<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"/> <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"/> <notification id="qn-notification"/>
Loading…
Cancel
Save