Commit 74c57688 by zhangxw

接待记录交互优化

1 parent 52d08e51
...@@ -203,7 +203,7 @@ class Calendar { ...@@ -203,7 +203,7 @@ class Calendar {
range(e) { range(e) {
const _this = this[_CalendarObject_] const _this = this[_CalendarObject_]
let { index, data, ind } = e.currentTarget.dataset let { index, data, ind } = e.currentTarget.dataset
let { allowSameDay, showConfirm, monthList, rangeDate, maxDayRange } = _this.data let { allowSameDay, showConfirm, monthList, rangeDate, maxDayRange, maxDayRangeType } = _this.data
const start = Date.parse(rangeDate.start) const start = Date.parse(rangeDate.start)
if (rangeDate.end || start > Date.parse(data)) { if (rangeDate.end || start > Date.parse(data)) {
monthList = this.clearStatus({ monthList = this.clearStatus({
...@@ -215,7 +215,18 @@ class Calendar { ...@@ -215,7 +215,18 @@ class Calendar {
rangeDate.end = '' rangeDate.end = ''
} else { } else {
if (!allowSameDay && Date.parse(data) == Date.parse(rangeDate.start)) return if (!allowSameDay && Date.parse(data) == Date.parse(rangeDate.start)) return
if (maxDayRange && Date.parse(data) > (Date.parse(rangeDate.start) + (maxDayRange - 1) * 24 * 60 * 60 * 1000)) return wx.showToast({title: `选择天数不能超过${maxDayRange}天`, icon: 'none'}) if (maxDayRangeType == 'day') {
if (Date.parse(data) > (Date.parse(rangeDate.start) + (maxDayRange - 1) * 24 * 60 * 60 * 1000)) return wx.showToast({title: `选择范围不能超过${maxDayRange}天`, icon: 'none'})
}
if (maxDayRangeType == 'month') {
let start = new Date(rangeDate.start)
let end = new Date(data)
let months = (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth())
if (start.getDate() > end.getDate()) {
months--
}
if (months >= maxDayRange) return wx.showToast({title: `选择范围不能超过${maxDayRange}个月`, icon: 'none'})
}
monthList[index].data[ind].active = true monthList[index].data[ind].active = true
monthList[index].data[ind].end = true monthList[index].data[ind].end = true
rangeDate.end = data rangeDate.end = data
......
...@@ -83,7 +83,8 @@ export default { ...@@ -83,7 +83,8 @@ export default {
/**隐藏水印 */ /**隐藏水印 */
hideMark: Boolean, hideMark: Boolean,
isComponents: Boolean, isComponents: Boolean,
maxDayRange: Number // 最大可选天数范围 maxDayRange: Number, // 最大可选范围长度
maxDayRangeType: String // 最大可选范围类型
// dataDateStr: { // dataDateStr: {
// type: String, // type: String,
// observer: function (n) { // observer: function (n) {
......
...@@ -16,11 +16,22 @@ var filterMerchantName = function (list) { ...@@ -16,11 +16,22 @@ var filterMerchantName = function (list) {
return list.join(',') return list.join(',')
} }
var isShowEmpty = function (listData) {
var listDataLength = 0
for (var i = 0; i < listData.length; i++) {
var curr = listData[i]
listDataLength += curr.receptionStaticInfoDTOList ? curr.receptionStaticInfoDTOList.length : 0
}
console.log(listDataLength > 0)
return listDataLength > 0
}
/* /*
* 导出 * 导出
*/ */
module.exports = { module.exports = {
replaceItemText: replaceItemText, replaceItemText: replaceItemText,
isIncludesItem: isIncludesItem, isIncludesItem: isIncludesItem,
filterMerchantName: filterMerchantName filterMerchantName: filterMerchantName,
isShowEmpty: isShowEmpty
} }
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<order-no-popup wx:if="{{ tipsProps }}" show="{{ tipsProps }}" title="请选择支付订单号" bind:success="navigator" orderNoList="{{ orderNoList }}" /> <order-no-popup wx:if="{{ tipsProps }}" show="{{ tipsProps }}" title="请选择支付订单号" bind:success="navigator" orderNoList="{{ orderNoList }}" />
<page-container show="{{ show_order_confirm || show_reception_confirm }}" duration="{{ 0 }}" overlay="{{ false }}" bind:afterleave="containerBack"> <page-container show="{{ show_order_confirm || show_reception_confirm }}" duration="{{ 0 }}" overlay="{{ false }}" bind:afterleave="containerBack">
<view wx:if="{{ showReceptionRendering }}"> <view wx:if="{{ showReceptionRendering }}">
<reception-screen show="{{ show_reception_confirm }}" userInfo="{{ userInfo }}" isFilterUpgrade="{{isFilterUpgrade}}" isFilterDefeat="{{isFilterDefeat}}" navBarHeight="{{ navBarHeight }}" bindconfirm="searchScreen" /> <reception-screen show="{{ show_reception_confirm }}" userInfo="{{ userInfo }}" dateTime="{{dateTime}}" isFilterUpgrade="{{isFilterUpgrade}}" isFilterDefeat="{{isFilterDefeat}}" maxDayRange="{{7}}" maxDayRangeType="day" navBarHeight="{{ navBarHeight }}" bindconfirm="searchScreen" />
</view> </view>
<view wx:if="{{ showOrderRendering }}"> <view wx:if="{{ showOrderRendering }}">
<order-screen show="{{ show_order_confirm }}" userInfo="{{ userInfo }}" navBarHeight="{{ navBarHeight }}" status="{{ orderStatus }}" bindconfirm="searchScreen" /> <order-screen show="{{ show_order_confirm }}" userInfo="{{ userInfo }}" navBarHeight="{{ navBarHeight }}" status="{{ orderStatus }}" bindconfirm="searchScreen" />
......
...@@ -28,7 +28,9 @@ Component({ ...@@ -28,7 +28,9 @@ Component({
} }
}, },
isFilterDefeat: Boolean, isFilterDefeat: Boolean,
isFilterUpgrade: Boolean isFilterUpgrade: Boolean,
maxDayRange: Number,
maxDayRangeType: String
}, },
/** /**
...@@ -315,8 +317,10 @@ Component({ ...@@ -315,8 +317,10 @@ Component({
obj['staffUuids'] = arr obj['staffUuids'] = arr
} }
// 日期 // 日期
obj.startDateTime = startDateTime || '', if (e == 'dateTime') {
obj.endDateTime = endDateTime || '' obj.startDateTime = startDateTime || '',
obj.endDateTime = endDateTime || ''
}
// 质检分数 // 质检分数
if (e == 'scoreList') { if (e == 'scoreList') {
let qualityCheckScore = ['', [0, 20], [21, 50], [51, 80], [81, 100]] let qualityCheckScore = ['', [0, 20], [21, 50], [51, 80], [81, 100]]
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
日期 日期
</view> </view>
<view class="list-box" wx:for="{{form.dateTime}}" wx:key="index"> <view class="list-box" wx:for="{{form.dateTime}}" wx:key="index">
<calendar allowSameDay maxDayRange="7" shortcut bindselect='rangeSelect' id="orderCalendar" data-index="{{index}}" data-name="dateTime" dateType='range' calenderColor='#347BFF' <calendar allowSameDay maxDayRange="{{maxDayRange}}" maxDayRangeType="{{maxDayRangeType}}" shortcut bindselect='rangeSelect' id="orderCalendar" data-index="{{index}}" data-name="dateTime" dateType='range' calenderColor='#347BFF'
vertical minDate="2020-10-01" maxDate="{{maxDate}}" minDate="2024-01-01" isComponents> vertical minDate="2020-10-01" maxDate="{{maxDate}}" minDate="2024-01-01" isComponents>
</calendar> </calendar>
<view style="display: flex;align-items: center;width: 100%;"> <view style="display: flex;align-items: center;width: 100%;">
......
...@@ -9,20 +9,29 @@ Component({ ...@@ -9,20 +9,29 @@ Component({
record: { record: {
type: Object, type: Object,
observer: function (params) { observer: function (params) {
let { timelineWidth } = this.data
const totalMinutes = params.totalDuration / 1000
let _this = this let _this = this
_this.calculatePositions(params) _this.calculatePositions(params)
let query = wx.createSelectorQuery().in(_this) if (!timelineWidth) {
query.select(`.line-status`).boundingClientRect() let query = wx.createSelectorQuery().in(_this)
query.exec(function(res){ query.select(`.line-status`).boundingClientRect()
const timelineWidth = res?.[0]?.width - 32; // 时间轴宽度 query.exec(function(res){
const totalMinutes = params.totalDuration / 1000 // 时间跨度 (秒数) timelineWidth = res?.[0]?.width - 32; // 时间轴宽度
// if (params.receptionStaticInfoDetailDTOList) { // 质检环节 _this.setData({timelineWidth})
// 质检环节
_this.getProcess(params.receptionStaticInfoDetailDTOList, timelineWidth, totalMinutes) _this.getProcess(params.receptionStaticInfoDetailDTOList, timelineWidth, totalMinutes)
// } if (params.receptionStaticInfoODDetailDTOList) { // 攻防点
_this.getDefensePoints(params.receptionStaticInfoODDetailDTOList, timelineWidth, totalMinutes)
}
})
} else {
// 质检环节
_this.getProcess(params.receptionStaticInfoDetailDTOList, timelineWidth, totalMinutes)
if (params.receptionStaticInfoODDetailDTOList) { // 攻防点 if (params.receptionStaticInfoODDetailDTOList) { // 攻防点
_this.getDefensePoints(params.receptionStaticInfoODDetailDTOList, timelineWidth, totalMinutes) _this.getDefensePoints(params.receptionStaticInfoODDetailDTOList, timelineWidth, totalMinutes)
} }
}) }
} }
} }
}, },
...@@ -32,7 +41,8 @@ Component({ ...@@ -32,7 +41,8 @@ Component({
*/ */
data: { data: {
contantsData, contantsData,
itemInfo: {} itemInfo: {},
timelineWidth: 0
}, },
/** /**
...@@ -70,7 +80,7 @@ Component({ ...@@ -70,7 +80,7 @@ Component({
events?.forEach((event, index) => { events?.forEach((event, index) => {
event.stage = event.stage.replace('环节', '') event.stage = event.stage.replace('环节', '')
event.width = this.getWidth(event, totalMinutes, timelineWidth) event.width = this.getWidth(event, totalMinutes, timelineWidth)
event.left = Math.ceil(Math.min(...event.mergedOffset) / totalMinutes * timelineWidth) event.left = event.mergedOffset && Math.ceil(Math.min(...event.mergedOffset) / totalMinutes * timelineWidth)
if (index == (events?.length - 1) && event.left > (timelineWidth - event.width)) { // 最后的质检环节 if (index == (events?.length - 1) && event.left > (timelineWidth - event.width)) { // 最后的质检环节
event.left = (timelineWidth - event.width) event.left = (timelineWidth - event.width)
} }
...@@ -112,7 +122,7 @@ Component({ ...@@ -112,7 +122,7 @@ Component({
}) })
}, },
getWidth(item, totalMinutes, timelineWidth) { getWidth(item, totalMinutes, timelineWidth) {
let diff = Math.max(...item.mergedOffset) - Math.min(...item.mergedOffset) let diff = item.mergedOffset && Math.max(...item.mergedOffset) - Math.min(...item.mergedOffset)
let width = Math.ceil(diff / totalMinutes * timelineWidth) let width = Math.ceil(diff / totalMinutes * timelineWidth)
let minWidth = item.stage?.length == 3 ? 56 : item.stage?.length == 4 ? 72 : 44 // 根据质检环节最小宽度 let minWidth = item.stage?.length == 3 ? 56 : item.stage?.length == 4 ? 72 : 44 // 根据质检环节最小宽度
let filterWidth = width > minWidth ? width : minWidth // 最小宽度 let filterWidth = width > minWidth ? width : minWidth // 最小宽度
......
...@@ -219,6 +219,7 @@ ...@@ -219,6 +219,7 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
position: relative; position: relative;
color: #757980;
margin-top: var(--fontSize10); margin-top: var(--fontSize10);
.line{ .line{
width: 100%; width: 100%;
...@@ -230,8 +231,9 @@ ...@@ -230,8 +231,9 @@
transform: translateY(-50%); transform: translateY(-50%);
} }
.time-bt{ .time-bt{
background: #FFFFFF; background: #FAFAFA;
border-radius: var(--fontSize28); border-radius: var(--fontSize28);
font-size: var(--fontSize20);
z-index: 10; z-index: 10;
&.pad-4{ &.pad-4{
padding: 0 var(--fontSize8); padding: 0 var(--fontSize8);
......
...@@ -359,19 +359,19 @@ Component({ ...@@ -359,19 +359,19 @@ Component({
}); });
}, },
// 接待记录查询条件 // 接待记录查询条件
getParams(index) { getParams() {
let { searchForm, isFilterDefeat, isFilterUpgrade, storeRangeList } = this.data let { searchForm, isFilterDefeat, isFilterUpgrade, storeRangeList } = this.data
let userInfo = wx.$util.getUserInfo() || {}; let userInfo = wx.$util.getUserInfo() || {};
let endDayNum = index > 1 ? (index - 1) * 7 : 0
let startDayNum = index > 1 ? index * 7 - 1 : index * 6
// 获取当前时间的时间戳 // 获取当前时间的时间戳
let timestamp = new Date().getTime() let timestamp = new Date().getTime()
let sevenDaysAgoTimestamp = timestamp - startDayNum * 24 * 60 * 60 * 1000 let sevenDaysAgoTimestamp = timestamp - 6 * 24 * 60 * 60 * 1000
let sevenDaysAgoDate = new Date(sevenDaysAgoTimestamp).format('yyyy-MM-dd') let sevenDaysAgoDate = new Date().format('yyyy-MM-dd')
searchForm.orderResult = (isFilterDefeat ? [2] : []).concat(isFilterUpgrade ? [1] : []) if (!searchForm.orderResult?.length) searchForm.orderResult = (isFilterDefeat ? [2] : []).concat(isFilterUpgrade ? [1] : [])
let obj = { let obj = {
startDateTime: searchForm?.startDateTime || sevenDaysAgoDate, // startDateTime: searchForm?.startDateTime || new Date(sevenDaysAgoTimestamp).format('yyyy-MM-dd'),
endDateTime: searchForm?.endDateTime || new Date(timestamp - endDayNum * 24 * 60 * 60 * 1000).format('yyyy-MM-dd'), // endDateTime: searchForm?.endDateTime || sevenDaysAgoDate,
startDateTime: '2024-06-01',
endDateTime: '2024-06-09',
customerName: searchForm?.customerName || '', customerName: searchForm?.customerName || '',
qualityCheckScoreBegin: searchForm?.qualityCheckScoreBegin, qualityCheckScoreBegin: searchForm?.qualityCheckScoreBegin,
qualityCheckScoreEnd: searchForm?.qualityCheckScoreEnd, qualityCheckScoreEnd: searchForm?.qualityCheckScoreEnd,
...@@ -521,7 +521,7 @@ Component({ ...@@ -521,7 +521,7 @@ Component({
}, },
// 获取接待记录统计数据 // 获取接待记录统计数据
getReceptionList() { getReceptionList() {
let params = this.getParams(1) let params = this.getParams()
getReceptionRecordList({ getReceptionRecordList({
merchantNo: params.merchantNo, merchantNo: params.merchantNo,
startDateTime: params.startDateTime, startDateTime: params.startDateTime,
...@@ -550,7 +550,7 @@ Component({ ...@@ -550,7 +550,7 @@ Component({
let { pageNum, listData, nothing } = this.data let { pageNum, listData, nothing } = this.data
let params = { let params = {
pageNum, pageNum,
...this.getParams(1) ...this.getParams()
} }
if (nothing) return // 进获取近七天数据 if (nothing) return // 进获取近七天数据
getRecordDetailList(params).then(res => { getRecordDetailList(params).then(res => {
......
...@@ -515,15 +515,13 @@ swiper{ ...@@ -515,15 +515,13 @@ swiper{
height: var(--fontSize72); height: var(--fontSize72);
line-height: var(--fontSize72); line-height: var(--fontSize72);
padding: var(--fontSize16); padding: var(--fontSize16);
background: #F7F8FA;
&.sticky-date-section{ &.sticky-date-section{
position: sticky; position: sticky;
top: var(--fontSize80); top: var(--fontSize80);
left: 0; left: 0;
z-index: 1000; z-index: 1000;
} }
&.bg-white{
background: #FFFFFF;
}
.date { .date {
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #292D33; color: #292D33;
......
...@@ -102,11 +102,11 @@ ...@@ -102,11 +102,11 @@
</block> </block>
</view> --> </view> -->
</view> </view>
<view class="receive-list {{isSticky ? 'minh100' :''}}" wx:if="{{storeRangeList.length}}"> <view class="receive-list" wx:if="{{storeRangeList.length}}">
<view class="'screen-box' {{showScreen ? '' : 'sticky-screen'}} {{isScrollTop ? 'bg-white' : ''}}"> <view class="'screen-box' {{showScreen ? '' : 'sticky-screen'}} {{isScrollTop ? 'bg-white' : ''}}">
<view> <view>
<text class="title">接待记录</text> <text class="title">接待记录</text>
<text class="name text-hide">{{searchForm.merchantNames.length ? filter.filterMerchantName(searchForm.merchantNames) : !userInfo.isSuper ? userInfo.default4SStoreInfo.merchantName : ''}}</text> <text class="name text-hide">{{searchForm.merchantNames.length > 1 ? '部分门店' : searchForm.merchantNames.length ? filter.filterMerchantName(searchForm.merchantNames) : !userInfo.isSuper ? userInfo.default4SStoreInfo.merchantName : '全部门店'}}</text>
</view> </view>
<view bindtap="showScreenPop"> <view bindtap="showScreenPop">
<text class="text">筛选</text> <text class="text">筛选</text>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</view> </view>
<view class="list-box"> <view class="list-box">
<block wx:for="{{listData}}" wx:key="date" wx:if="{{item.receptionStaticInfoDTOList.length}}"> <block wx:for="{{listData}}" wx:key="date" wx:if="{{item.receptionStaticInfoDTOList.length}}">
<view class="date-section {{showScreen ? '' : 'sticky-date-section'}} {{isScrollTop ? 'bg-white' : ''}}"> <view class="date-section {{showScreen ? '' : 'sticky-date-section'}}">
<text class="date">{{item.staticDateStr}}</text> <text class="date">{{item.staticDateStr}}</text>
<text class="summary-item">交付量 {{item.deliveryVolume}}</text> <text class="summary-item">交付量 {{item.deliveryVolume}}</text>
<text class="line"></text> <text class="line"></text>
......
...@@ -13,8 +13,8 @@ Page({ ...@@ -13,8 +13,8 @@ Page({
scrollTop: 0, scrollTop: 0,
listData: [], listData: [],
pageNum: 1, pageNum: 1,
staticPage: 1, searchForm: {},
searchForm: {} nothing: false
}, },
/** /**
...@@ -23,6 +23,9 @@ Page({ ...@@ -23,6 +23,9 @@ Page({
onLoad(options) { onLoad(options) {
let userInfo = wx.$util.getUserInfo() || {} let userInfo = wx.$util.getUserInfo() || {}
// 超管获取所有质检门店/员工 // 超管获取所有质检门店/员工
this.setData({
nothing: false
})
if (userInfo?.isSuper) { if (userInfo?.isSuper) {
this.getStoreList() this.getStoreList()
} else { } else {
...@@ -47,28 +50,22 @@ Page({ ...@@ -47,28 +50,22 @@ Page({
} }
}) })
}, },
getParams(index) { getParams() {
let { searchForm, isFilterDefeat, isFilterUpgrade, storeRangeList } = this.data let { searchForm, isFilterDefeat, isFilterUpgrade, storeRangeList } = this.data
let userInfo = wx.$util.getUserInfo() || {}; let userInfo = wx.$util.getUserInfo() || {};
let endDayNum = index > 1 ? (index - 1) * 7 : 0 const now = new Date();
let startDayNum = index > 1 ? index * 7 - 1 : index * 6 const threeMonthsAgo = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate() - 1)
// 获取当前时间的时间戳 if (!searchForm.orderResult?.length) searchForm.orderResult = (isFilterDefeat ? [2] : []).concat(isFilterUpgrade ? [1] : [])
let timestamp = new Date().getTime()
let sevenDaysAgoTimestamp = timestamp - startDayNum * 24 * 60 * 60 * 1000
let sevenDaysAgoDate = new Date(sevenDaysAgoTimestamp).format('yyyy-MM-dd')
searchForm.orderResult = (isFilterDefeat ? [2] : []).concat(isFilterUpgrade ? [1] : []);
let obj = { let obj = {
startDateTime: searchForm?.startDateTime || sevenDaysAgoDate, startDateTime: searchForm?.startDateTime || new Date(threeMonthsAgo).format('yyyy-MM-dd'),
endDateTime: searchForm?.endDateTime || new Date(timestamp - endDayNum * 24 * 60 * 60 * 1000).format('yyyy-MM-dd'), endDateTime: searchForm?.endDateTime || now.format('yyyy-MM-dd'),
// startDateTime: '2024-06-02',
// endDateTime: '2024-06-08',
customerName: searchForm?.customerName || '', customerName: searchForm?.customerName || '',
qualityCheckScoreBegin: searchForm?.qualityCheckScoreBegin || '', qualityCheckScoreBegin: searchForm?.qualityCheckScoreBegin || '',
qualityCheckScoreEnd: searchForm?.qualityCheckScoreEnd || '', qualityCheckScoreEnd: searchForm?.qualityCheckScoreEnd || '',
customerTypes: searchForm?.customerTypes, customerTypes: searchForm?.customerTypes,
carModels: searchForm?.carModels, carModels: searchForm?.carModels,
orderResult: searchForm?.orderResult, orderResult: searchForm?.orderResult,
merchantNo: userInfo?.isSuper && !searchForm?.merchantNo?.length ? storeRangeList.map(v => {if (v.merchantNo) return v.merchantNo}) : (searchForm?.merchantNo || [userInfo.default4SStoreInfo.merchantId]), merchantNo: userInfo?.isSuper && !searchForm?.merchantNo?.length ? storeRangeList?.map(v => {if (v.merchantNo) return v.merchantNo}) : (searchForm?.merchantNo || [userInfo.default4SStoreInfo.merchantId]),
staffUuids: searchForm?.staffUuids staffUuids: searchForm?.staffUuids
} }
return obj return obj
...@@ -109,9 +106,12 @@ Page({ ...@@ -109,9 +106,12 @@ Page({
isFilterDefeat: orderResult?.includes(2) isFilterDefeat: orderResult?.includes(2)
}) })
this.setData({ this.setData({
searchForm searchForm,
nothing: false,
listData: []
}, () => {
this.getReceptionList()
}) })
this.getReceptionList()
this.containerBack(); this.containerBack();
}, },
...@@ -121,13 +121,15 @@ Page({ ...@@ -121,13 +121,15 @@ Page({
// 获取接待记录统计数据 // 获取接待记录统计数据
getReceptionList() { getReceptionList() {
let { staticPage, listData } = this.data let { listData } = this.data
let params = this.getParams(staticPage) let params = this.getParams()
wx.$util.showLoading()
getReceptionRecordList({ getReceptionRecordList({
merchantNo: params.merchantNo, merchantNo: params.merchantNo,
startDateTime: params.startDateTime, startDateTime: params.startDateTime,
endDateTime: params.endDateTime endDateTime: params.endDateTime
}).then(res => { }).then(res => {
wx.$util.hideLoading()
let { code, message, data } = res let { code, message, data } = res
if (code == 0) { if (code == 0) {
data?.forEach(val => { data?.forEach(val => {
...@@ -147,11 +149,12 @@ Page({ ...@@ -147,11 +149,12 @@ Page({
}, },
// 获取接待记录接待时间轴详情数据 // 获取接待记录接待时间轴详情数据
getReceptionRecordDetailInfo() { getReceptionRecordDetailInfo() {
let { pageNum, listData, staticPage } = this.data let { pageNum, listData, nothing } = this.data
let params = { let params = {
pageNum, pageNum,
...this.getParams(staticPage) ...this.getParams()
} }
if (nothing) return
getRecordDetailList(params).then(res => { getRecordDetailList(params).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
...@@ -160,21 +163,13 @@ Page({ ...@@ -160,21 +163,13 @@ Page({
if (val.staticDate == subV.staticDate) val.receptionStaticInfoDTOList.push(subV) if (val.staticDate == subV.staticDate) val.receptionStaticInfoDTOList.push(subV)
}) })
}) })
let listDataLength = listData.reduce((acc, curr) => acc + curr?.receptionStaticInfoDTOList?.length, 0)
this.setData({ this.setData({
listData, listData,
pageNum: pageNum + 1, pageNum: pageNum + 1,
triggered: false triggered: false,
nothing: listDataLength == data?.total
}) })
let listDataLength = listData.reduce((acc, curr) => acc + curr?.receptionStaticInfoDTOList?.length, 0)
if (listDataLength < 5) { // 未铺满一屏 或
// 近七天数据加载完毕 继续加载上一个七天周期的数据
this.setData({
staticPage: staticPage + 1
})
setTimeout(() => {
this.getReceptionList()
}, 200)
}
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
...@@ -183,14 +178,18 @@ Page({ ...@@ -183,14 +178,18 @@ Page({
// 过滤升级/战败接待记录数据 // 过滤升级/战败接待记录数据
filterItemData(e) { filterItemData(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
if (type == 'upgrade') { const keyMap = {
this.setData({ upgrade: 'isFilterUpgrade',
isFilterUpgrade: !this.data.isFilterUpgrade defeat: 'isFilterDefeat'
}) };
} else {
this.setData({isFilterDefeat: !this.data.isFilterDefeat}) const key = keyMap[type] || 'isFilterDefeat'
} this.setData({
this.getReceptionList() [key]: !this.data[key],
nothing: false
}, () => {
this.getReceptionList()
})
}, },
// 触底加载更多 // 触底加载更多
onBottomRefresh() { onBottomRefresh() {
...@@ -199,10 +198,11 @@ Page({ ...@@ -199,10 +198,11 @@ Page({
// 下拉刷新数据 // 下拉刷新数据
refreshListData() { refreshListData() {
this.setData({ this.setData({
staticPage: 1, listData: [],
listData: [] nothing: false
}, () => {
this.getReceptionList()
}) })
this.getReceptionList()
}, },
goto(e){ goto(e){
let {record} = e.currentTarget.dataset let {record} = e.currentTarget.dataset
......
...@@ -55,14 +55,13 @@ ...@@ -55,14 +55,13 @@
height: var(--fontSize72); height: var(--fontSize72);
line-height: var(--fontSize72); line-height: var(--fontSize72);
padding: var(--fontSize16); padding: var(--fontSize16);
background: #F7F8FA;
position: sticky;
top: 0;
left: 0;
z-index: 1000;
&.sticky-date-section{ &.sticky-date-section{
position: sticky;
top: 0;
left: 0;
z-index: 1000;
}
&.bg-white{
background: #FFFFFF;
} }
.date { .date {
font-size: var(--fontSize28); font-size: var(--fontSize28);
......
/* packageEquity/pages/receptionRecords/receptionRecords.wxss */
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<block wx:else> <block wx:else>
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack navStyle="{{'background-color: #FFFFFF;box-shadow:none;' }}" bindback="back"> <navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack navStyle="{{'background-color: #FFFFFF;box-shadow:none;' }}" bindback="back">
<view class="navigation-title"> <view class="navigation-title">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}}</view> <view class="navigation-title-text text-hide">{{userInfo && userInfo.isSuper ? '接待记录' : (userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName)}}</view>
</view> </view>
</navigation-bar> </navigation-bar>
</block> </block>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<view class="screen-box"> <view class="screen-box">
<view> <view>
<text class="title">接待记录</text> <text class="title">接待记录</text>
<text class="name text-hide">{{searchForm.merchantNames.length ? filter.filterMerchantName(searchForm.merchantNames) : !userInfo.isSuper ? userInfo.default4SStoreInfo.merchantName : ''}}</text> <text class="name text-hide">{{searchForm.merchantNames.length > 1 ? '部分门店' : searchForm.merchantNames.length ? filter.filterMerchantName(searchForm.merchantNames) : !userInfo.isSuper ? userInfo.default4SStoreInfo.merchantName : '全部门店'}}</text>
</view> </view>
<view bindtap="showScreenPop"> <view bindtap="showScreenPop">
<text class="text">筛选</text> <text class="text">筛选</text>
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
</view> </view>
<scroll-view scroll-y class="list-box" enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshListData" bindscrolltolower="onBottomRefresh" style="height: calc(100% - var(--fontSize80));" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}"> <scroll-view scroll-y class="list-box" enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshListData" bindscrolltolower="onBottomRefresh" style="height: calc(100% - var(--fontSize80));" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="box-content"> <view class="box-content">
<block wx:if="{{listData.length}}"> <block wx:if="{{filter.isShowEmpty(listData)}}">
<block wx:for="{{listData}}" wx:key="date" wx:if="{{item.receptionStaticInfoDTOList.length}}"> <block wx:for="{{listData}}" wx:key="date" wx:if="{{item.receptionStaticInfoDTOList.length}}">
<view class="date-section sticky-date-section bg-white"> <view class="date-section">
<text class="date">{{item.staticDate}}</text> <text class="date">{{item.staticDate}}</text>
<text class="summary-item">交付量 {{item.summary.deliveries}}</text> <text class="summary-item">交付量 {{item.summary.deliveries}}</text>
<text class="line"></text> <text class="line"></text>
...@@ -47,12 +47,18 @@ ...@@ -47,12 +47,18 @@
</view> </view>
</block> </block>
</block> </block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block> </block>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<page-container show="{{ show_reception_confirm }}" duration="{{ 0 }}" overlay="{{ false }}" bind:afterleave="containerBack"> <page-container show="{{ show_reception_confirm }}" duration="{{ 0 }}" overlay="{{ false }}" bind:afterleave="containerBack">
<view wx:if="{{ showReceptionRendering }}"> <view wx:if="{{ showReceptionRendering }}">
<reception-screen show="{{ show_reception_confirm }}" userInfo="{{ userInfo }}" navBarHeight="{{ navBarHeight }}" bindconfirm="searchScreen" /> <reception-screen show="{{ show_reception_confirm }}" userInfo="{{ userInfo }}" maxDayRange="{{3}}" maxDayRangeType="month" navBarHeight="{{ navBarHeight }}" bindconfirm="searchScreen" />
</view> </view>
</page-container> </page-container>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!