Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
8e00e9159a
10 changed files with 169 additions and 184 deletions
  1. 6
      api/saas.js
  2. 36
      components/textarea/index.js
  3. 4
      components/textarea/index.wxml
  4. 6
      pages/agent/appointment/index.js
  5. 147
      pages/agent/appointment/index.wxml
  6. 4
      xtends/statics/index/index.js
  7. 72
      xtends/statics/purchase-report/index.js
  8. 6
      xtends/statics/purchase-report/index.wxml
  9. 62
      xtends/statics/sale-report/index.js
  10. 10
      xtends/statics/sale-report/index.wxml

6
api/saas.js

@ -76,7 +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)
const getReceiptReport = (params) => mGet(`/ztb-factory/get/receipt-daily-report`, params, sconfig)
const getSalesReport = (params) => mGet(`/ztb-factory/get/sales-daily-report`, params, sconfig)
export { export {
sconfig, sconfig,
@ -144,5 +145,6 @@ export {
poundSideOrder, poundSideOrder,
priceSideOrder, priceSideOrder,
repeatSideOrder, repeatSideOrder,
getSummaryReport
getReceiptReport,
getSalesReport
} }

36
components/textarea/index.js

@ -20,7 +20,9 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
editing: false
editing: false,
scroll_top: 0,
top: 0,
}, },
/** /**
@ -29,9 +31,41 @@ Component({
methods: { methods: {
onEdit: function(e) { onEdit: function(e) {
this.setData({ editing: true }) this.setData({ editing: true })
if (this.data.scroll_top > 0 || Number(e.detail.height) <= 0) {
return;
}
if(this.data.top > 0){
that.triggerEvent('focus', that.data.top)
return
}
const res = wx.getSystemInfoSync();
let windowHeight = res.windowHeight;
let keybordHeight = e.detail.height;
const query = wx.createSelectorQuery();
query.select('#' + e.currentTarget.id).boundingClientRect();
query.selectViewport().scrollOffset();
var that = this;
query.exec(function(res) {
if (!res[0]) {
that.data.scroll_top = 0
that.triggerEvent('focus', 0)
return;
}
let bottom = res[0].bottom;
if ((windowHeight - keybordHeight) < (bottom + 20)) {
that.data.scroll_top = bottom + 80 - windowHeight - keybordHeight
that.data.top = that.data.scroll_top
that.triggerEvent('focus', that.data.scroll_top)
} else {
that.triggerEvent('focus', 0)
that.data.scroll_top = 0
}
})
}, },
onBlur: function(e) { onBlur: function(e) {
this.setData({ editing: false }) this.setData({ editing: false })
this.data.scroll_top = 0
this.triggerEvent('focus', 0)
}, },
bindInput: function(e) { bindInput: function(e) {
this.setData({ value: e.detail.value }) this.setData({ value: e.detail.value })

4
components/textarea/index.wxml

@ -1,4 +1,4 @@
<view class="textarea {{ value ? 'text-black' : 'text-gray' }}" bindtap="onEdit" wx:if="{{!editing}}">{{value || placeholder }}</view> <view class="textarea {{ value ? 'text-black' : 'text-gray' }}" bindtap="onEdit" wx:if="{{!editing}}">{{value || placeholder }}</view>
<textarea wx:else maxlength="100" value="{{value}}" style="padding-top:16rpx" class="textarea"
cursor-spacing="60" focus="{{editing}}" bindblur="onBlur" show-confirm-bar="{{false}}"
<textarea id="remark" wx:else maxlength="100" value="{{value}}" style="padding-top:16rpx" class="textarea"
cursor-spacing="60" focus="{{editing}}" bindblur="onBlur" bindfocus="onEdit" show-confirm-bar="{{false}}"
bindinput="bindInput" placeholder-style="color:#aaa" placeholder="{{placeholder}}"></textarea> bindinput="bindInput" placeholder-style="color:#aaa" placeholder="{{placeholder}}"></textarea>

6
pages/agent/appointment/index.js

@ -32,7 +32,8 @@ Scene({
toolId: '', toolId: '',
visible: false, visible: false,
show: false, show: false,
code: ''
code: '',
marginTop: 0
}, },
onLoad: function (options) { onLoad: function (options) {
if(options.activityId){ if(options.activityId){
@ -120,6 +121,9 @@ Scene({
this.setData({ [form_data]: e.detail }) this.setData({ [form_data]: e.detail })
} }
}, },
bindFocus: function(e){
// this.setData({ marginTop: e.detail })
},
bindInput: function (e) { bindInput: function (e) {
if(!util.isEmpty(e.currentTarget.id)){ if(!util.isEmpty(e.currentTarget.id)){
var form_data = 'form.' + e.currentTarget.id var form_data = 'form.' + e.currentTarget.id

147
pages/agent/appointment/index.wxml

@ -4,88 +4,89 @@
<view slot="content">代卖预约</view> <view slot="content">代卖预约</view>
</cu-custom> </cu-custom>
<scroll-view scroll-y="true" style="height:{{height}}rpx">
<view class="bg-white flex flex-center" style="height:90rpx">
<view class="text-df flex flex-center" style="flex:1">提交订单</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">等待预约</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">线下送货</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">余额提现</view>
</view>
<view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
<van-cell clickable center bind:click="chooseCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">纸厂名称</view>
<view class="{{factoryDetail.name ? 'text-black' : 'text-gray'}}">{{factoryDetail.name}}</view>
<view style="margin-top:{{marginTop}}rpx">
<scroll-view scroll-y="true" style="height:{{height}}rpx">
<view class="bg-white flex flex-center" style="height:90rpx">
<view class="text-df flex flex-center" style="flex:1">提交订单</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">等待预约</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">线下送货</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">余额提现</view>
</view> </view>
</van-cell>
<van-cell id="cateName" clickable center is-link arrow-direction="down" bind:click="showPicker">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">纸品品类</view>
<view class="{{cateName ? 'text-black' : 'text-gray'}}">{{cateName || '请选择品类'}}</view>
<view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
</van-cell>
<van-cell clickable center bind:click="chooseCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">预估单价(元/吨)</view>
<view class="text-sg text-black">
<text>{{formate.formatePrice(form.unitPrice)}}</text>
<text class="text-sm" wx:if="{{form.publicSubsidies}}">(已含补贴{{formate.formatePrice(form.publicSubsidies)}}元/吨)</text>
<van-cell clickable center bind:click="chooseCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">纸厂名称</view>
<view class="{{factoryDetail.name ? 'text-black' : 'text-gray'}}">{{factoryDetail.name}}</view>
</view>
</van-cell>
<van-cell id="cateName" clickable center is-link arrow-direction="down" bind:click="showPicker">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">纸品品类</view>
<view class="{{cateName ? 'text-black' : 'text-gray'}}">{{cateName || '请选择品类'}}</view>
</view>
</van-cell>
<van-cell clickable center bind:click="chooseCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">预估单价(元/吨)</view>
<view class="text-sg text-black">
<text>{{formate.formatePrice(form.unitPrice)}}</text>
<text class="text-sm" wx:if="{{form.publicSubsidies}}">(已含补贴{{formate.formatePrice(form.publicSubsidies)}}元/吨)</text>
</view>
</view>
</van-cell>
<van-field id="totalEstimatedWeight" type="digit" placeholder="请输入预估重量" clearable input-align="right" bind:change="onInput">
<view slot="label" class="flex text-black" style="width:200rpx">
<text>预估重量(吨)</text>
</view>
</van-field>
<van-cell id="deliveryTime" clickable center is-link arrow-direction="down" bind:click="showPicker">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">货到时间</view>
<view class="{{form.deliveryTime ? 'text-black' : 'text-gray'}}">{{form.deliveryTime||'请选择货到时间'}}</view>
</view> </view>
</van-cell>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
</van-cell>
<van-field id="totalEstimatedWeight" type="digit" placeholder="请输入预估重量" clearable input-align="right" bind:change="onInput">
<view slot="label" class="flex text-black" style="width:200rpx">
<text>预估重量(吨)</text>
<view class="bg-white cu-list grid col-4 no-border" style="padding: 16rpx 24rpx 0rpx 24rpx" wx:if="{{vateList.length}}">
<view class="cu-item" wx:for="{{vateList}}" wx:key="index" style="padding: 0rpx 8rpx 8rpx 8rpx">
<van-button plain round size="small" data-index="{{index}}" custom-style="padding: 0;min-width: 160rpx;" bind:click="tagChange">{{item.plateNumber}}</van-button>
</view>
</view> </view>
</van-field>
<van-cell id="deliveryTime" clickable center is-link arrow-direction="down" bind:click="showPicker">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">货到时间</view>
<view class="{{form.deliveryTime ? 'text-black' : 'text-gray'}}">{{form.deliveryTime||'请选择货到时间'}}</view>
<van-cell clickable center wx:for="{{vehicleList}}" wx:key="index" data-index="{{index}}" bind:click="showKeyboard">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black text-sg">
<text class="text-sm" style="width: 14px;line-height: 14px;text-align: center;border-radius: 50%;border: 1px solid #999">{{index + 1}}</text>
<text style="margin-left: 8rpx">货车车牌:</text>
</view>
<view class="{{item.plateNumber ? 'text-black' : 'text-gray'}}" style="flex:1">{{item.plateNumber || '点击输入车牌号码'}}</view>
<text class="cuIcon-close text-gray" style="font-size:44rpx;" data-index="{{index}}" wx:if="{{vehicleList.length > 1}}" catchtap="deleteCate"></text>
</view>
</van-cell>
<view class="bg-white flex flex-center" style="height:90rpx;line-height:90rpx" bindtap="addCate">
<text class="cuIcon-roundadd text-blue" style="font-size: 16px;"></text>
<text class="text-blue text-sg" style="margin-left:8rpx">添加车辆</text>
</view> </view>
</van-cell>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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="bg-white cu-list grid col-4 no-border" style="padding: 16rpx 24rpx 0rpx 24rpx" wx:if="{{vateList.length}}">
<view class="cu-item" wx:for="{{vateList}}" wx:key="index" style="padding: 0rpx 8rpx 8rpx 8rpx">
<van-button plain round size="small" data-index="{{index}}" custom-style="padding: 0;min-width: 160rpx;" bind:click="tagChange">{{item.plateNumber}}</van-button>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
</view>
<van-cell clickable center wx:for="{{vehicleList}}" wx:key="index" data-index="{{index}}" bind:click="showKeyboard">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black text-sg">
<text class="text-sm" style="width: 14px;line-height: 14px;text-align: center;border-radius: 50%;border: 1px solid #999">{{index + 1}}</text>
<text style="margin-left: 8rpx">货车车牌:</text>
</view>
<view class="{{item.plateNumber ? 'text-black' : 'text-gray'}}" style="flex:1">{{item.plateNumber || '点击输入车牌号码'}}</view>
<text class="cuIcon-close text-gray" style="font-size:44rpx;" data-index="{{index}}" wx:if="{{vehicleList.length > 1}}" catchtap="deleteCate"></text>
<view class="bg-white" style="padding:24rpx 30rpx">
<van-textarea id="remark" bind:change="bindInput" bind:focus="bindFocus" placeholder="点击输入备注,最多100字"></van-textarea>
</view> </view>
</van-cell>
<view class="bg-white flex flex-center" style="height:90rpx;line-height:90rpx" bindtap="addCate">
<text class="cuIcon-roundadd text-blue" style="font-size: 16px;"></text>
<text class="text-blue text-sg" style="margin-left:8rpx">添加车辆</text>
</view>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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="bg-white" style="padding:24rpx 30rpx">
<van-textarea id="remark" bind:change="bindInput" placeholder="点击输入备注,最多100字"></van-textarea>
</view>
<view style="height:16rpx"></view>
</scroll-view>
<view style="height:16rpx"></view>
</scroll-view>
</view>
<submit-layout> <submit-layout>
<van-button type="info" loading="{{requesting}}" custom-style="height:88rpx;width:688rpx" bind:click="submitForm">提交订单</van-button> <van-button type="info" loading="{{requesting}}" custom-style="height:88rpx;width:688rpx" bind:click="submitForm">提交订单</van-button>
</submit-layout> </submit-layout>

4
xtends/statics/index/index.js

@ -1,7 +1,7 @@
// 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"
import { getReceiptReport } from "../../../api/saas"
const math = require('../../../utils/math') const math = require('../../../utils/math')
import util from '../../../utils/util' import util from '../../../utils/util'
const app = getApp() const app = getApp()
@ -52,7 +52,7 @@ Scene({
this.fetchSummaryInfo(this.data.form1) this.fetchSummaryInfo(this.data.form1)
}, },
fetchSummaryInfo: function(form){ fetchSummaryInfo: function(form){
getSummaryReport(form).then(result => {
getReceiptReport(form).then(result => {
// this.setData({ }) // this.setData({ })
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {

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

@ -1,5 +1,5 @@
import Scene from '../../../pages/index/scene' import Scene from '../../../pages/index/scene'
import { getSummaryReport } from "../../../api/saas"
import { getReceiptReport } from "../../../api/saas"
import util from '../../../utils/util' import util from '../../../utils/util'
const app = getApp() const app = getApp()
@ -12,49 +12,16 @@ Scene({
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
form: {}, form: {},
columns: [ columns: [
{ 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: [
{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'},
{ prop: 'productCategoryName', width: 200, label: '品类', color: '#55C355' },
{ prop: 'settleWeight', width: 175, label: '重量(公斤)' },
{ prop: 'settlePrice', width: 175, label: '金额(元)' },
{ prop: 'settleAvgPrice', width: 200, label: '均价(元/公斤)' }
], ],
reportInfo:{
productReceiptReportList: [],
totalSettlePrice: 0,
totalSettleWeight: 0
},
show: false show: false
}, },
/** /**
@ -72,9 +39,9 @@ Scene({
var today = new Date() var today = new Date()
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')
this.data.form.dimensionDateStart = util.formatDate(today, 'Y-M-D')
this.data.form.dimensionDateEnd = util.formatDate(max, 'Y-M-D')
var vdateString = util.formatDate(min, 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D')
this.data.form.dimensionDateStart = util.formatDate(min, 'Y-M-D')
this.data.form.dimensionDateEnd = util.formatDate(today, 'Y-M-D')
this.setData({ height: app.globalData.fragmentHeight - 304, minDate, maxDate, vdate, vdateString }) this.setData({ height: app.globalData.fragmentHeight - 304, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
@ -89,14 +56,19 @@ Scene({
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.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00'
this.data.form.dimensionDateStart = util.formatDate(start, 'Y-M-D')
this.data.form.dimensionDateEnd = util.formatDate(end, 'Y-M-D')
this.setData({ show: false, vdateString }) this.setData({ show: false, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
fetchStatisticsInfo: function(){ fetchStatisticsInfo: function(){
getSummaryReport(this.data.form).then(result => {
// this.setData({ })
getReceiptReport(this.data.form).then(result => {
if(result.data){
this.setData({reportInfo: result.data})
} else {
this.setData({reportInfo: { productReceiptReportList: [], totalSettlePrice: 0, totalSettleWeight: 0 } })
}
console.log(result)
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()

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

@ -16,15 +16,15 @@
</view> </view>
<view class="bg-white flex" style="height:140rpx;padding-top:24rpx;"> <view class="bg-white flex" style="height:140rpx;padding-top:24rpx;">
<view style="width:320rpx;padding-left:48rpx"> <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-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(reportInfo.totalSettleWeight || 0)}}</view>
<view class="text-black text-sm">重量(公斤)</view> <view class="text-black text-sm">重量(公斤)</view>
</view> </view>
<view style="width:300rpx;"> <view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(reportInfo.totalSettlePrice || 0)}}</view>
<view class="text-black text-sm">合计金额(元)</view> <view class="text-black text-sm">合计金额(元)</view>
</view> </view>
</view> </view>
<van-table headers="{{columns}}" data="{{ data }}" height="{{ height }}" stripe="{{ true }}"/>
<van-table headers="{{columns}}" data="{{ reportInfo.productReceiptReportList }}" 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"/>

62
xtends/statics/sale-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 { getSalesReport } from "../../../api/saas"
import util from '../../../utils/util' import util from '../../../utils/util'
const app = getApp() const app = getApp()
@ -18,44 +18,12 @@ Scene({
{ prop: 'work_hour', width: 220, label: '结算均价(元/吨)' }, { prop: 'work_hour', width: 220, label: '结算均价(元/吨)' },
{ prop: 'status', width: 180, label: '结算金额(元)' } { prop: 'status', width: 180, label: '结算金额(元)' }
], ],
data: [
{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'},
],
reportInfo:{
productSalesDailyReportList: [],
totalOutboundDeliveryNetWeight: 0,
totalSettlePrice: 0,
totalSettleWeight: 0
},
show: false show: false
}, },
/** /**
@ -74,8 +42,8 @@ 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.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 - 404, minDate, maxDate, vdate, vdateString }) this.setData({ height: app.globalData.fragmentHeight - 404, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
@ -89,16 +57,20 @@ Scene({
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.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00'
this.data.form.dimensionDateStart = util.formatDate(start, 'Y-M-D')
this.data.form.dimensionDateEnd = util.formatDate(end, 'Y-M-D')
this.setData({ show: false, vdateString }) this.setData({ show: false, vdateString })
wx.showLoading({ title: '加载中', mask: true }) wx.showLoading({ title: '加载中', mask: true })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
fetchStatisticsInfo: function(){ fetchStatisticsInfo: function(){
getStatisticsInfo(this.data.form).then(result => {
// this.setData({ })
getSalesReport(this.data.form).then(result => {
wx.hideLoading() wx.hideLoading()
if(result.data){
this.setData({reportInfo: result.data})
} else {
this.setData({ reportInfo: { productSalesDailyReportList: [], totalOutboundDeliveryNetWeight: 0, totalSettlePrice: 0, totalSettleWeight: 0 } })
}
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
}) })

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

@ -16,26 +16,26 @@
</view> </view>
<view class="bg-white flex" style="height:120rpx;padding-top:24rpx;"> <view class="bg-white flex" style="height:120rpx;padding-top:24rpx;">
<view style="width:320rpx;padding-left:48rpx"> <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-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(reportInfo.totalOutboundDeliveryNetWeight || 0)}}</view>
<view class="text-black text-sm">出货重量(吨)</view> <view class="text-black text-sm">出货重量(吨)</view>
</view> </view>
<view style="width:300rpx;"> <view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(reportInfo.totalSettlePrice || 0)}}</view>
<view class="text-black text-sm">结算重量(吨)</view> <view class="text-black text-sm">结算重量(吨)</view>
</view> </view>
</view> </view>
<view class="bg-white flex" style="height:120rpx;padding-top:8rpx"> <view class="bg-white flex" style="height:120rpx;padding-top:8rpx">
<view style="width:320rpx;padding-left:48rpx"> <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-xxl text-bold" style="color:#278CC8">{{reportInfo.carNumber || 0}}</view>
<view class="text-black text-sm">出货车数(车)</view> <view class="text-black text-sm">出货车数(车)</view>
</view> </view>
<view style="width:300rpx;"> <view style="width:300rpx;">
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(totalInfo.totalWeight || 0)}}</view>
<view class="text-xxl text-bold" style="color:#278CC8">{{formate.formateWeight(reportInfo.totalSettlePrice || 0)}}</view>
<view class="text-black text-sm">金额(元)</view> <view class="text-black text-sm">金额(元)</view>
</view> </view>
</view> </view>
<van-table headers="{{columns}}" data="{{ data }}" height="{{ height }}" stripe="{{ true }}"/>
<van-table headers="{{columns}}" data="{{ reportInfo.productSalesDailyReportList }}" 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