Commit 0d1d08b0 by 李伟康

fix(dailyReport): 修复日报模块中的多个问题并优化功能

- 修改环境配置中默认索引值从1调整为2
- 移除所有API调用中的第三个参数false和'ip'配置
- 修正getMonthlyPendingCount方法的API端点名称拼写错误
- 在入口组件中添加页面事件追踪代码
- 修复日期切换逻辑中的条件判断错误
- 重构退出拦截提示框的实现方式
- 添加日期变更前的检查和确认流程
- 优化门店日报编辑页面的数据获取和展示逻辑
- 更新员工选择弹窗的配置映射关系
1 parent 4771a714
......@@ -35,7 +35,7 @@ const getReportList = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.weekly.list',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
/**
查询日报详情
......@@ -45,7 +45,7 @@ const getReportDetail = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.detail.get',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
/**
是否需要新版本日报填报
......@@ -56,17 +56,17 @@ const isNewVersionNeed = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.new.version.isNeed',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
/**
查询门店日报本月待邀约数
查询门店日报本月待邀约数
*/
const getMonthlyPendingCount = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.monthly.pending.count',
method: 'dj.api.smartcarlife.dailyReport.monthly.pending.get',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
/**
查询洽谈明细驻店人员名单
......@@ -76,7 +76,7 @@ const getDiscussionStaffList = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.discussion.staff.list',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
/**
日报草稿数据保存
......@@ -86,7 +86,7 @@ const saveDraft = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.dynamic.draft.save',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
/**
日报数据提交
......@@ -96,7 +96,7 @@ const submitReport = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.dynamic.save',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
/**
* 当前门店驻店人员在选中成交日期交付的延保及权益订单
......@@ -106,7 +106,7 @@ const getGoodsOrderList = async (data = {}) => {
method: 'dj.api.smartcarlife.goodsOrder.product.outputValue.list',
projectName: 'boutique',
...data
}, false, 'ip')
})
}
module.exports = {
......
......@@ -173,7 +173,7 @@ export default {
label: '门店日报',
name: 'storeDailyReport',
page: '/pages/common/dailyNewspaper/index',
// sceneType: [0, 1],
eventCode: 'store_daily_report_page',
noInterception: true
},
{
......@@ -181,7 +181,7 @@ export default {
name: 'NegotiationDetail',
label: '洽谈明细',
page: '/pages/common/dailyNewspaper/index',
// sceneType: [0, 1],
eventCode: 'negotiation_detail_page',
noInterception: true
},
]
......@@ -189,9 +189,10 @@ export default {
let userInfo = uni.$storage.get('userInfo'),
{ sceneType, shopMerchantId } = userInfo,
newReport = await this.isNewVersionNeed(shopMerchantId)
if (!newReport && sceneType != 7) {
if (newReport && sceneType != 7) {
entranceList[0].name = 'staffDailyReport'
entranceList[0].page = '/pages/common/dailyNewspaper/index'
entranceList[0].eventCode = 'staff_daily_report_page'
entranceList.map(e => {
if (['storeDailyReport', 'NegotiationDetail'].includes(e.name)) e.sceneType = [0, 1]
})
......
......@@ -795,6 +795,7 @@ export default {
this.checkVersion()
},
async entranceClick (item) {
if(item.eventCode) uni.$track.add({ eventCode: item.eventCode })
// 清除评估单的图片视频资源缓存
const { sceneType } = this
if (!item.noInterception) {
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1
const index = 2
/**
*
0本地
......
......@@ -109,11 +109,13 @@ import DailyPopup from '../components/DailyPopup/index.vue'
export default {
name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem, DailyPopup },
inject: ['userInfo'],
props: {
templateData: {
type: Array,
default: () => []
}
},
reportDate: String
},
data () {
return {
......@@ -135,8 +137,10 @@ export default {
}
},
mounted () {
this.getMonthlyPendingCount()
},
methods: {
itemShow (i) {
if (i.rules) {
let { keys, result } = i.rules,
......@@ -215,14 +219,31 @@ export default {
onPopupConfirm (data) {
console.log(data)
const { popupType, chooseContent, itemIndex } = data
if (popupType == 1) {
if (popupType == 2) {
console.log(this.list)
let { key } = this.list[itemIndex]
let { key,completeFun } = this.list[itemIndex]
this.$set(this.list[itemIndex], 'value', chooseContent.map(e => e.staffName).join('/'))
this.$set(this.list[itemIndex], key, chooseContent.map(e => e.uuid))
if (completeFun) {
let {key, result} = completeFun,
index = this.list.findIndex(i => i.key == key),
func = eval(`(function(list) { return ${result}; })`)
this.$set(this.list[index], 'value', func(chooseContent))
}
}
},
async getMonthlyPendingCount () {
let { reportDate, userInfo,list } = this,
{ shopMerchantId } = userInfo
const res = await uni.$api.dailyTemplateApi.getMonthlyPendingCount({
merchantId: shopMerchantId,
reportDate
})
let index = list.findIndex(i => i.key == 'F2-24')
this.$set(this.list[index], 'value', res)
}
}
}
</script>
......
......@@ -10,6 +10,7 @@
@showNegotiationList="changeComponent(true)"
@saveReport="saveReport"
@submitReport="submitReport"
:reportDate="currentDate"
/>
</template>
</view>
......
......@@ -18,7 +18,7 @@ const componentConfig = {
searchValue: '',
noData: false
},
1: {
2: {
name: 'EmployeeList',
title: '多选',
multiple: true,
......@@ -30,16 +30,6 @@ const componentConfig = {
searchValue: '',
noData: false
},
2: {
name: 'EmployeeList',
title: '选择人员',
placeholder: '请输入姓名',
idKey: ['userId'],
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
3: {
name: 'CarModelList',
title: '选择车型',
......
......@@ -32,11 +32,12 @@
:endDate="endDate"
:showMonth="false"
@monthSwitch="changeMonth"
@change="changeCurrentDate"
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
:calendarItemStyle="{width:'84rpx',height:'90rpx'}"
openBeforeChange
@beforeChange="changeDate"
/>
</view>
</view>
......@@ -185,35 +186,25 @@ export default {
onUnload () {
},
methods: {
back () {
this.noticeObj = {
title: '重要提示',
exitInterception (callBack) {
this.openNotice({
text: '内容尚未保存,是否退出编辑?',
type: 'warning',
buttons: [
{
text: '继续编辑',
type: 'default',
callback: _ => {
this.$refs.notice.close()
}
},
{
text: '确定退出',
type: 'primary',
callback: _ => {
this.backPage()
}
}
]
}
buttons: {
cancelText: '继续编辑',
confirmText: '确定退出'
}
}, false, _ => {
if (callBack) callBack()
else this.backPage()
})
},
back () {
let now = dayjs().format('YYYY-MM-DD')
if (this.currentDate == now) {
if (this.templateType != 2) {
this.$refs.notice.open()
if (this.templateType == 2) {
if (this.reportStatus != 1) this.exitInterception()
} else {
if (this.reportStatus != 1) this.$refs.notice.open()
else this.backPage()
this.exitInterception()
}
} else this.backPage()
},
......@@ -302,9 +293,65 @@ export default {
},
changeCurrentDate (e) {
this.templateData = []
this.currentDate = e.fulldate
this.currentDate = e.fullDate
this.getReportDetail()
},
async checkReport () {
let { templateType, reportStatus } = this, currentComponent = this.$refs[`ref-${this.componentName}`]
console.log(currentComponent.isToday)
if (currentComponent.isToday) {
if (templateType == 2) {
return reportStatus != 1
} else {
return true
}
} return false
},
async changeDate (e) {
if (e.fullDate == this.currentDate) return
const openNotice = await this.checkReport()
if (!openNotice) {
this.$refs.calendar.manualChangeDate(e)
this.changeCurrentDate(e)
return
}
this.exitInterception(_ => {
this.$refs.calendar.manualChangeDate(e)
this.changeCurrentDate(e)
})
},
openNotice ({
title,
text,
type,
buttons
}, back = true, callBack) {
this.noticeObj = {
title: title || '重要提示',
text: text || '确认提交后将不可再编辑,确认继续?',
type: type || 'warning',
buttons: [
{
text: buttons.cancelText || '取消',
type: 'default',
callback: _ => {
this.$refs.notice.close()
}
},
{
text: buttons.confirmText || '确定提交',
type: 'primary',
callback: _ => {
this.$refs.notice.close()
if (back) uni.navigateBack()
if (callBack && typeof callBack === 'function') callBack()
}
}
]
}
this.$refs.notice.open()
},
async getReportDetail () {
uni.showLoading({ title: '加载中...', mask: true })
try {
......@@ -317,7 +364,7 @@ export default {
templateType,
reportDate: currentDate
})
if (data) {
uni.hideLoading()
this.dailyReportRecordId = data.id
......
......@@ -127,7 +127,7 @@ export default {
reportParams.subformDataList = subformDataList
console.log(reportParams)
uni.hideLoading()
this.$emit('submitReport', reportParams)
// this.$emit('submitReport', reportParams)
} catch (error) {
uni.hideLoading()
uni.showToast({ title: error, icon: 'none' })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!