Commit 6a79d2ed by 张立顺

Merge branch 'develop' into 'V4.37.6-0417'

Develop

See merge request !57
2 parents 8dd98318 8c9d2429
...@@ -31,11 +31,10 @@ ...@@ -31,11 +31,10 @@
} }
.searchTime { .searchTime {
margin-top: 24rpx; padding: 24rpx 0rpx;
display: flex; display: flex;
align-items: center; align-items: center;
z-index: 9999; z-index: 9999;
margin-bottom: 20rpx;
position: relative; position: relative;
.time { .time {
...@@ -43,7 +42,7 @@ ...@@ -43,7 +42,7 @@
// border: 2rpx solid #EBEBEB; // border: 2rpx solid #EBEBEB;
// border-radius: 32rpx; // border-radius: 32rpx;
background: #FFFFFF; background: #FFFFFF;
border: 1rpx solid #C3C3C3; border: 2rpx solid #C3C3C3;
border-radius: 6rpx; border-radius: 6rpx;
font-weight: 400; font-weight: 400;
font-size: 20rpx; font-size: 20rpx;
...@@ -57,7 +56,7 @@ ...@@ -57,7 +56,7 @@
// color: #4466F0; // color: #4466F0;
color: #fff; color: #fff;
background: #3582EE; background: #3582EE;
border: 1prx solid #3582EE; border: 2rpx solid #3582EE;
} }
.time+.time { .time+.time {
......
...@@ -80,6 +80,6 @@ ...@@ -80,6 +80,6 @@
</scroll-view> </scroll-view>
<view wx:if="{{calendarLoading}}"> <view wx:if="{{calendarLoading}}">
<van-calendar max-range="{{ 30 }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" show="{{ isShow }}" <van-calendar max-range="{{ 31 }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" show="{{ isShow }}"
type="range" color="#4466F0" bind:confirm="onConfirm" bind:close="onClose" /> type="range" color="#4466F0" bind:confirm="onConfirm" bind:close="onClose" />
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -6,6 +6,22 @@ Page({ ...@@ -6,6 +6,22 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
typeShow: true,
selectTxt: '产值',
selectValue: 1,
dataType: [{
label: '产值',
value: 1
}, {
label: '成交量',
value: 2
}, {
label: '报价量',
value: 3
}, {
label: '转化率',
value: 4
}],
show: false, show: false,
date: '2023年4月10日', date: '2023年4月10日',
maxDate: new Date().getTime(), maxDate: new Date().getTime(),
...@@ -17,17 +33,17 @@ Page({ ...@@ -17,17 +33,17 @@ Page({
label: '报价量(单)', label: '报价量(单)',
name: 'quotationCount', name: 'quotationCount',
unit: '', unit: '',
iconUrl:'output/icon02.png' iconUrl: 'store-assistant-assemble/output/icon02.png'
}, { }, {
label: '成交量(单)', label: '成交量(单)',
name: 'successCount', name: 'successCount',
unit: '', unit: '',
iconUrl:'output/icon07.png' iconUrl: 'store-assistant-assemble/output/icon07.png'
}, { }, {
label: '产值(元)', label: '产值(元)',
name: 'outputValue', name: 'outputValue',
_unit: '¥', _unit: '¥',
iconUrl:'output/icon05.png' iconUrl: 'store-assistant-assemble/output/icon05.png'
}], }],
outputValueBoutique: [ outputValueBoutique: [
// { // {
...@@ -44,19 +60,19 @@ Page({ ...@@ -44,19 +60,19 @@ Page({
label: '升级订单(单)', label: '升级订单(单)',
name: 'upgradeCountTotal', name: 'upgradeCountTotal',
unit: '', unit: '',
iconUrl:'output/icon02.png' iconUrl: 'store-assistant-assemble/output/icon02.png'
}, },
{ {
label: '转化率', label: '转化率',
name: 'upgradeRatio', name: 'upgradeRatio',
unit_: '%', unit_: '%',
iconUrl:'output/icon07.png' iconUrl: 'store-assistant-assemble/output/icon07.png'
}, },
{ {
label: '客单价(元)', label: '客单价(元)',
name: 'averagePrice', name: 'averagePrice',
_unit: '¥', _unit: '¥',
iconUrl:'output/icon05.png' iconUrl: 'store-assistant-assemble/output/icon05.png'
}, },
], ],
} }
...@@ -66,11 +82,28 @@ Page({ ...@@ -66,11 +82,28 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const { time, type, merchantId,merchantName } = options const { time, type, merchantId, merchantName } = options
this.setData({ timeType: time, type, merchantId,merchantName }) this.setData({ timeType: time, type, merchantId, merchantName })
this.getReport() this.getReport()
}, },
//选择排序
selectType(e) {
const {
value,
label
} = e.target.dataset
this.setData({
selectValue: value,
typeShow: true,
selectTxt: label
})
this.getReport()
},
showUp() {
this.setData({
typeShow: false
})
},
onDisplay() { onDisplay() {
this.setData({ show: true }); this.setData({ show: true });
}, },
...@@ -79,8 +112,8 @@ Page({ ...@@ -79,8 +112,8 @@ Page({
}, },
//查看报表 //查看报表
getReport() { getReport() {
const { type, timeType, merchantId,timeValue } = this.data const { type, timeType, merchantId, timeValue,selectValue } = this.data
let apiName,params let apiName, params
const dataT = { const dataT = {
1: { 1: {
day: () => { day: () => {
...@@ -94,7 +127,7 @@ Page({ ...@@ -94,7 +127,7 @@ Page({
apiName = 'boutiquecouponQueryByMonthReport', apiName = 'boutiquecouponQueryByMonthReport',
params = { params = {
merchantId, merchantId,
reportMonth: timeValue.substring(0,7) reportMonth: timeValue.substring(0, 7)
} }
} }
}, },
...@@ -110,28 +143,40 @@ Page({ ...@@ -110,28 +143,40 @@ Page({
month: () => { month: () => {
apiName = 'merchantsOutputReport', apiName = 'merchantsOutputReport',
params = { params = {
orderBy:selectValue,
merchantIds: [merchantId], merchantIds: [merchantId],
startTime: new Date(timeValue).format('yyyy-MM')+'-01' + ' 00:00:00', startTime: new Date(timeValue).format('yyyy-MM') + '-01' + ' 00:00:00',
endTime: new Date(this.getNextMonth(timeValue)).format('yyyy-MM')+'-01' + ' 00:00:00', endTime: new Date(this.getNextMonth(timeValue)).format('yyyy-MM') + '-01' + ' 00:00:00',
}
} }
} }
} }
let orderValue = {
1: {
unit: '¥',
value: 'outputValue',mult:1
}, 2: {
unit: '',
value: 'successCount',mult:1
}, 3: { unit: '', value: 'quotationCount',mult:1 }, 4: { sign: '%', value: 'conversionRate',mult:100 }
} }
dataT[type][timeType]() dataT[type][timeType]()
ActivityApi[apiName](params).then(res => { ActivityApi[apiName](params).then(res => {
const list = res.employeeOutputList || res.staffList const list = res.employeeOutputList || res.staffList
const arr = [] const arr = []
const staffList = list.length?Object.assign(arr,list.splice(0,3)):arr const staffList = list.length ? Object.assign(arr, list.splice(0, 3)) : arr
const billboard = staffList.map((item,idx)=>{ const billboard = staffList.map((item, idx) => {
return { return {
sort: idx+1, sort: idx + 1,
value:item.outputValue || item.orderMoneyTotal || 0, unit: (type == 2 && timeType == 'month')?orderValue[selectValue].unit:'¥',
name: item.transferName||item.employeeName sign: (type == 2 && timeType == 'month')?orderValue[selectValue].sign:'',
value: (type == 2 && timeType == 'month') ? item[orderValue[selectValue].value]*orderValue[selectValue].mult : (item.outputValue || item.orderMoneyTotal || 0),
name: item.transferName || item.employeeName
} }
}) })
this.setData({ this.setData({
outputData: res||{}, outputData: res || {},
triggered:false, triggered: false,
billboard billboard
}) })
}) })
...@@ -149,7 +194,7 @@ Page({ ...@@ -149,7 +194,7 @@ Page({
if (month < 10) { if (month < 10) {
month = "0" + month; month = "0" + month;
} }
const nextMonth = year + "-" + month +"-" + day; const nextMonth = year + "-" + month + "-" + day;
return nextMonth; return nextMonth;
}, },
formatDate(date) { formatDate(date) {
......
...@@ -248,11 +248,52 @@ ...@@ -248,11 +248,52 @@
line-height: 48rpx; line-height: 48rpx;
margin-bottom: 22rpx; margin-bottom: 22rpx;
display: flex; display: flex;
justify-content: space-between;
}
.select-up {
font-weight: 400;
font-size: 24rpx;
color: #666666;
position: relative;
.unit { text-align: center;
margin-left: auto;
.staff-type {
width: 160rpx;
text {
display: inline-block;
width: 120rpx;
text-align: right;
}
.up-icon {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
}
}
.up-box {
position: absolute;
width: 128rpx;
left: 20rpx;
background: #FFFFFF;
box-shadow: 0 0 18rpx 0 #3a596a1c;
border-radius: 8rpx;
z-index: 100;
.up-item {
flex: auto;
font-weight: 400;
font-size: 22rpx; font-size: 22rpx;
color: #5A6066; color: #666666;
line-height: 53rpx;
&.checked {
color: #708CFF;
}
}
} }
} }
} }
......
...@@ -51,14 +51,24 @@ ...@@ -51,14 +51,24 @@
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<glsx-image src="{{item.iconUrl}}" class="icon" /> <glsx-image src="{{item.iconUrl}}" class="icon" />
</view> </view>
<view class="output-num"><text class="_unit">{{item._unit}}</text> {{outputData[item.name] ||0}}<text class="unit_">{{item.unit_}}</text></view> <view class="output-num" style="font-size: {{(outputData[item.name] ||0) > 10000000?27:36}}rpx"><text class="_unit">{{item._unit}}</text> {{outputData[item.name] ||0}}<text class="unit_">{{item.unit_}}</text></view>
</view> </view>
</view> </view>
</view> </view>
<view class="billboard-box"> <view class="billboard-box">
<view class="billboard-title"> <view class="billboard-title">
<text>当{{timeType=='day'?'日':'月'}}员工龙虎榜</text> <text>当{{timeType=='day'?'日':'月'}}员工龙虎榜</text>
<text class="unit">累计产值(元)</text> <view class="select-up" wx:if="{{type == 2 && timeType!='day'}}">
<view catchtap="showUp" class="staff-type">
<text>{{dataType[selectValue-1].label}}</text>
<glsx-image webp custom-class="up-icon" src="/output/down.png"></glsx-image>
</view>
<view class="up-box" hidden="{{typeShow}}">
<view class="up-item {{selectValue == item.value? 'checked':''}}" wx:for="{{dataType}}" wx:key="index" data-label="{{item.label}}" data-value="{{item.value}}" catchtap="selectType">
{{item.label}}
</view>
</view>
</view>
</view> </view>
<view class="billboard-border"> <view class="billboard-border">
<block wx:if="{{billboard.length}}"> <block wx:if="{{billboard.length}}">
...@@ -66,7 +76,7 @@ ...@@ -66,7 +76,7 @@
<view class="billboard-item-bar"> <view class="billboard-item-bar">
<view class="bill-border"> <view class="bill-border">
<view class="bill-name">{{item.name}}</view> <view class="bill-name">{{item.name}}</view>
<view class="bill-num" wx:if="{{item.name}}"><text class="unit">¥</text>{{item.value}}</view> <view class="bill-num" wx:if="{{item.name}}"><text class="unit" wx:if="{{item.unit}}">{{item.unit}}</text>{{item.value}}<text class="unit" wx:if="{{item.sign}}">{{item.sign}}</text></view>
</view> </view>
<glsx-image webp custom-class="bill-bg" src="output/bill0{{item.sort}}.png"></glsx-image> <glsx-image webp custom-class="bill-bg" src="output/bill0{{item.sort}}.png"></glsx-image>
</view> </view>
......
...@@ -292,7 +292,7 @@ Page({ ...@@ -292,7 +292,7 @@ Page({
// item.orderTotal.price = Number(orderTotal.price).toFixed(2) // item.orderTotal.price = Number(orderTotal.price).toFixed(2)
// } // }
item.conversionRate = (item.conversionRate * 100).toFixed(0) item.conversionRate = (item.conversionRate * 100).toFixed(0)
item.turnover = (item.turnover / 100).toFixed(2) item.turnover = (item.turnover1 / 100).toFixed(2)
item.fuseCustomerPrice = (item.fuseCustomerPrice / 100).toFixed(2) item.fuseCustomerPrice = (item.fuseCustomerPrice / 100).toFixed(2)
item.equityCustomerPrice = (item.equityCustomerPrice / 100).toFixed(2) item.equityCustomerPrice = (item.equityCustomerPrice / 100).toFixed(2)
total = item.turnover total = item.turnover
......
...@@ -169,7 +169,7 @@ const getImgVersion = () => { ...@@ -169,7 +169,7 @@ const getImgVersion = () => {
}; };
//获取当前页面路径 //获取当前页面路径
const getCurrentPageUrl = () =>{ const getCurrentPageUrl = () => {
const pages = getCurrentPages() const pages = getCurrentPages()
const currentPage = pages[pages.length - 1] const currentPage = pages[pages.length - 1]
const url = `/${currentPage.route}` const url = `/${currentPage.route}`
...@@ -181,7 +181,7 @@ const deepClone = (target) => { ...@@ -181,7 +181,7 @@ const deepClone = (target) => {
const map = new WeakMap() const map = new WeakMap()
function isObject(target) { function isObject(target) {
return (typeof target === 'object' && target ) || typeof target === 'function' return (typeof target === 'object' && target) || typeof target === 'function'
} }
function clone(data) { function clone(data) {
...@@ -241,7 +241,7 @@ const deepClone = (target) => { ...@@ -241,7 +241,7 @@ const deepClone = (target) => {
} }
//设置标题 //设置标题
const setNavigationBarTitle = (title) =>{ const setNavigationBarTitle = (title) => {
wx.getSystemInfo({ wx.getSystemInfo({
success: (res) => { success: (res) => {
// console.log('++++++++++++++', res); // console.log('++++++++++++++', res);
...@@ -253,7 +253,7 @@ const setNavigationBarTitle = (title) =>{ ...@@ -253,7 +253,7 @@ const setNavigationBarTitle = (title) =>{
// space = space + ' '; // space = space + ' ';
// } // }
width = width-(title.length)/2 width = width - (title.length) / 2
for (let i = 0; i < width; i++) { for (let i = 0; i < width; i++) {
space = space + ' '; space = space + ' ';
...@@ -345,7 +345,12 @@ const checkRule = function (obj, formRule) { ...@@ -345,7 +345,12 @@ const checkRule = function (obj, formRule) {
} }
return false return false
} }
const accMul = (arg1, arg2) => {
var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
try { m += s1.split(".")[1].length } catch (e) { }
try { m += s2.split(".")[1].length } catch (e) { }
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
}
const Util = { const Util = {
getImgVersion, getImgVersion,
...@@ -360,6 +365,7 @@ const Util = { ...@@ -360,6 +365,7 @@ const Util = {
deepClone, deepClone,
setNavigationBarTitle, setNavigationBarTitle,
moneyThreeForTwoThousands, moneyThreeForTwoThousands,
checkRule checkRule,
accMul
}; };
export default Util; export default Util;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!