Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
e34c10caa5
7 changed files with 58 additions and 13 deletions
  1. 10
      components/calendar/calendar.wxml
  2. 1
      components/calendar/index.wxml
  3. 2
      pages/agent/appointment/index.js
  4. 11
      xtends/statics/index/index.js
  5. 37
      xtends/statics/sale-report/index.js
  6. 2
      xtends/statics/sale-report/index.json
  7. 8
      xtends/statics/sale-report/index.wxml

10
components/calendar/calendar.wxml

@ -11,6 +11,16 @@
showMonthTitle="{{ index !== 0 || !showSubtitle }}" bind:click="onClickDay" /> showMonthTitle="{{ index !== 0 || !showSubtitle }}" bind:click="onClickDay" />
</scroll-view> </scroll-view>
<!-- <swiper current="{{0}}" class="van-calendar__body">
<swiper-item wx:for="{{ computed.getMonths(minDate, maxDate) }}" wx:key="index">
<month id="month{{ index }}" class="month" data-date="{{ item }}" date="{{ item }}" type="{{ type }}"
color="{{ color }}" index="{{ index }}" minDate="{{ minDate }}" maxDate="{{ maxDate }}"
showMark="{{ showMark }}" formatter="{{ formatter }}" rowHeight="{{ rowHeight }}"
currentDate="{{ currentDate }}" showSubtitle="{{ showSubtitle }}" allowSameDay="{{ allowSameDay }}"
showMonthTitle="{{ index !== 0 || !showSubtitle }}" bind:click="onClickDay" />
</swiper-item>
</swiper> -->
<view class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"> <view class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}">
<slot name="footer"></slot> <slot name="footer"></slot>
</view> </view>

1
components/calendar/index.wxml

@ -1,6 +1,5 @@
<wxs src="./index.wxs" module="computed" /> <wxs src="./index.wxs" module="computed" />
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<import src="./calendar.wxml" /> <import src="./calendar.wxml" />
<van-popup wx:if="{{ poppable }}" custom-class="van-calendar__popup--{{ position }}" <van-popup wx:if="{{ poppable }}" custom-class="van-calendar__popup--{{ position }}"

2
pages/agent/appointment/index.js

@ -129,8 +129,6 @@ Scene({
onEdit: function(e){ onEdit: function(e){
this.setData({ editing: true }) this.setData({ editing: true })
}, },
bindRemark: function (e) {
},
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

11
xtends/statics/index/index.js

@ -67,7 +67,16 @@ Scene({
}, },
showCalendar: function(e){ showCalendar: function(e){
this.data.selectId = e.currentTarget.id this.data.selectId = e.currentTarget.id
this.setData({ show: true })
if(this.data.selectId == 'form1') {
var start = new Date(this.data.form1.dimensionDateStart + ' 00:00:00')
var end = new Date(this.data.form1.dimensionDateEnd + ' 00:00:00')
this.data.vdate = [start.getTime(), end.getTime()]
} else {
var start = new Date(this.data.form2.dimensionDateStart + ' 00:00:00')
var end = new Date(this.data.form2.dimensionDateEnd + ' 00:00:00')
this.data.vdate = [start.getTime(), end.getTime()]
}
this.setData({ show: true, vdate: this.data.vdate })
}, },
onClose: function() { onClose: function() {
this.setData({ show: false }) this.setData({ show: false })

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

@ -3,6 +3,25 @@ import { getSalesReport } from "../../../api/saas"
import util from '../../../utils/util' import util from '../../../utils/util'
const app = getApp() const app = getApp()
const columns1 = [
{ prop: 'productCategoryName', width: 200, label: '品类', color: '#55C355' },
{ prop: 'outboundDeliveryNetWeight', width: 180, label: '出货重量(吨)' },
{ prop: 'settleWeight', width: 180, label: '结算重量(吨)' },
{ prop: 'settleAvgPrice ', width: 220, label: '结算均价(元/吨)' },
{ prop: 'settlePrice', width: 180, label: '结算金额(元)' }
]
const columns2 = [
{ prop: 'productCategoryName', width: 200, label: '品类', color: '#55C355' },
{ prop: 'outboundDeliveryNetWeight ', width: 185, label: '出货重量(吨)' },
{ prop: 'netWeight', width: 180, label: '纸厂净重(吨)' },
{ prop: 'differenceWeight ', width: 185, label: '差异重量(吨)' }
]
const columns3 = [
{ prop: 'productCategoryName', width: 200, label: '品类', color: '#55C355' },
{ prop: 'netWeight', width: 185, label: '纸厂净重(吨)' },
{ prop: 'settleWeight', width: 185, label: '结算重量(吨)' },
{ prop: 'avgDeductPercent ', width: 180, label: '平均扣点(%)' }
]
Scene({ Scene({
/** /**
@ -11,13 +30,8 @@ Scene({
data: { data: {
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
form: {}, form: {},
columns: [
{ prop: 'productCategoryName', width: 200, label: '品类', color: '#55C355' },
{ prop: 'outboundDeliveryNetWeight', width: 180, label: '出货重量(吨)' },
{ prop: 'settleWeight', width: 180, label: '结算重量(吨)' },
{ prop: 'settleAvgPrice ', width: 220, label: '结算均价(元/吨)' },
{ prop: 'settlePrice', width: 180, label: '结算金额(元)' }
],
columnsList: [ columns1, columns2, columns3 ],
columns: columns1,
reportInfo:{ reportInfo:{
productSalesDailyReportList: [], productSalesDailyReportList: [],
carNumber: 0, carNumber: 0,
@ -45,7 +59,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.dimensionDateStart = util.formatDate(today, 'Y-M-D') this.data.form.dimensionDateStart = util.formatDate(today, 'Y-M-D')
this.data.form.dimensionDateEnd = util.formatDate(max, '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 - 484, minDate, maxDate, vdate, vdateString })
this.fetchStatisticsInfo() this.fetchStatisticsInfo()
}, },
showCalendar: function(){ showCalendar: function(){
@ -54,6 +68,13 @@ Scene({
onClose: function() { onClose: function() {
this.setData({ show: false }) this.setData({ show: false })
}, },
onTabChange: function ({ detail }) {
if (this.data.tabIndex == Number(detail.index)) {
return
}
this.setData({ columns: this.data.columnsList[detail.index] })
this.data.tabIndex = Number(detail.index)
},
onSelect: function({detail}) { onSelect: function({detail}) {
var start = new Date(detail[0]) var start = new Date(detail[0])
var end = new Date(detail[1]) var end = new Date(detail[1])

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

@ -3,6 +3,8 @@
"van-icon": "/components/icon/index", "van-icon": "/components/icon/index",
"van-table": "/components/table/index", "van-table": "/components/table/index",
"van-calendar": "/components/calendar/index", "van-calendar": "/components/calendar/index",
"van-tab": "/components/tab/index",
"van-tabs": "/components/tabs/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }
} }

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

@ -34,7 +34,13 @@
<view class="text-black text-sm">金额(元)</view> <view class="text-black text-sm">金额(元)</view>
</view> </view>
</view> </view>
<view class="bg-white" style="height:80rpx;">
<van-tabs type="card" color="#008AFF" bind:change="onTabChange">
<van-tab title="金额"></van-tab>
<van-tab title="重量差异"></van-tab>
<van-tab title="平均扣点"></van-tab>
</van-tabs>
</view>
<van-table headers="{{columns}}" data="{{ reportInfo.productSalesDailyReportList }}" 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"/>

Loading…
Cancel
Save