Commit 075181d7 by 李伟康

feat(dailyNewspaper): 更新日报上报确认弹窗和客户选择器功能

- 修改日报上报确认弹窗标题为"确定上报数据?",描述更明确上报影响
- 将确认按钮文字从"确定提交"改为"确定",取消按钮从"取消"改为"我再想想"
- 在客户选择器组件中新增activeDate属性用于控制日期范围
- 客户选择器支持前后29天的时间范围选择
- 修复客户列表加载时的日期计算逻辑,以当前激活日期为基础
- 调整客户选择器中的变量名getDateTips返回值从tips改为desc
1 parent bb31c7e9
......@@ -74,12 +74,15 @@ import Popup from '@/components/Popup.vue'
import utils from '@/utils/utils'
import dayjs from 'dayjs'
import Nothing from '../../components/Nothing'
const nextDayNum = 29,
prevDayNum = 29
export default {
inject: ['userInfo'],
components: { Popup, Nothing },
name: 'CustomerDrawer',
props: {
activeDate: String
},
data() {
return {
......@@ -95,9 +98,9 @@ export default {
dayText = dayjs(currentDate).format('M日D日'),
weekText = this.weekCN[currentDate.day()],
/**今天/明天/昨天/N天前/N天后 */
tips = this.getDateTips(currentDate)
desc = this.getDateTips(currentDate)
return `${dayText} ${weekText}(${tips})`
return `${dayText} ${weekText}(${desc})`
},
isAllSelected() {
return this.customerList.length > 0 && this.customerList.every(item => item.selected)
......@@ -148,7 +151,7 @@ export default {
}
},
open() {
this.currentDate = dayjs()
this.currentDate = dayjs(this.activeDate)
this.$nextTick(() => {
this.$refs.popup.open()
})
......@@ -180,7 +183,7 @@ export default {
})
},
getDateTips(currentDate) {
const today = dayjs().startOf('day')
const today = dayjs(this.activeDate).startOf('day')
const targetDate = dayjs(currentDate).startOf('day')
const diffDays = targetDate.diff(today, 'day')
if (diffDays === 0) return '今天'
......@@ -193,16 +196,16 @@ export default {
return ''
},
changeDay(offset) {
if (this.currentDate.add(offset, 'day').isAfter(dayjs().add(6, 'day'))) {
if (this.currentDate.add(offset, 'day').isAfter(dayjs(this.activeDate).add(nextDayNum, 'day'))) {
return
}
if (this.currentDate.add(offset, 'day').isBefore(dayjs().subtract(7, 'day'))) {
if (this.currentDate.add(offset, 'day').isBefore(dayjs(this.activeDate).subtract(prevDayNum, 'day'))) {
return
}
this.currentDate = dayjs(this.currentDate).add(offset, 'day')
},
disabledBtn(offset) {
return this.currentDate.add(offset, 'day').isAfter(dayjs().add(6, 'day')) || this.currentDate.add(offset, 'day').isBefore(dayjs().subtract(7, 'day'))
return this.currentDate.add(offset, 'day').isAfter(dayjs(this.activeDate).add(nextDayNum, 'day')) || this.currentDate.add(offset, 'day').isBefore(dayjs(this.activeDate).subtract(prevDayNum, 'day'))
},
}
......
......@@ -51,7 +51,7 @@
<nothing v-else />
</template>
<EditForm ref="editForm" @onDel="delItem" @onConfirm="confirm" />
<CustomerDrawer ref="CustomerDrawer" @onConfirm="chooseCustomer" />
<CustomerDrawer ref="CustomerDrawer" @onConfirm="chooseCustomer" :activeDate="currentDate" />
</view>
</template>
......@@ -72,7 +72,8 @@ export default {
type: Array,
default: () => []
},
ReportStatus: null
ReportStatus: null,
currentDate:String
},
data() {
return {
......@@ -118,7 +119,7 @@ export default {
data = await uni.$api.dailyTemplateApi.getTodayPlanStoreCount({
merchantId: shopMerchantId,
advanceUserId: uuid,
inviteDate: dayjs().format('YYYY-MM-DD')
inviteDate: this.currentDate
})
this.customerCount = data
} catch (error) {
......
......@@ -5,7 +5,7 @@
</template>
<template v-else>
<Edit :templateData="templateData" @submitReport="submitReport" @getSaveBtnStatus="saveBtnStatus = $event"
:ReportStatus="ReportStatus" @maxLengthError="$emit('maxLengthError',$event)" />
:ReportStatus="ReportStatus" @maxLengthError="$emit('maxLengthError',$event)" :currentDate="currentDate" />
</template>
</view>
</template>
......
......@@ -412,19 +412,19 @@ export default {
if (this.templateType == 2 && !skip) {
uni.hideLoading()
this.noticeObj = {
title: '重要提示',
text: '确认提交后将不可再编辑,确认继续?',
title: '确定上报数据?',
text: '请确认驻店人员在当前场景下已完成所有个人的驻店日报及洽谈明细。门店日报上报后,将立即发送相关门店经营统计数据到指定消息群。',
type: 'warning',
buttons: [
{
text: '取消',
text: '我再想想',
type: 'default',
callback: _ => {
this.$refs.notice.close()
}
},
{
text: '确定提交',
text: '确定',
type: 'primary',
callback: _ => {
this.submitReport(reportParams, true)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!