Commit 7d805a9c by 李伟康 Committed by chenwq1

feat(daily-report): 新增安心包Lite功能并优化驻店日报逻辑

- 新增安心包Lite相关字段配置
- 实现模板类型动态切换功能,支持权益和延保标签显示
- 添加驻店日报表单验证和错误提示
- 优化表单提交流程,增加发券数量校验
- 调整样式适配不同模板类型的表单展示
- 更新IP地址配置到新的开发环境地址
- 修复数据初始化和字段映射问题
1 parent 6ac9878f
...@@ -39,7 +39,7 @@ const secretKey = { ...@@ -39,7 +39,7 @@ const secretKey = {
const domain = { const domain = {
// ip: 'http://192.168.2.94:8558', // ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315', // ip: 'http://192.168.2.3:8315',
ip: 'http://192.168.1.122:8292', ip: 'http://192.168.1.76:8292',
/**登录: 192.168.2.3:8315 /**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */ 商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn', dev: 'https://scrm.dev.glsx.com.cn',
...@@ -50,7 +50,7 @@ const domain = { ...@@ -50,7 +50,7 @@ const domain = {
const djDomain = { const djDomain = {
// ip: 'http://dj.dev.glsx.com.cn', // ip: 'http://dj.dev.glsx.com.cn',
ip: 'http://192.168.1.122:8292', ip: 'http://192.168.1.76:8292',
dev: 'http://dj.dev.glsx.com.cn', dev: 'http://dj.dev.glsx.com.cn',
beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425 beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
...@@ -164,6 +164,7 @@ const pathEnum = { ...@@ -164,6 +164,7 @@ const pathEnum = {
staffMiniprogram: '/rop-dj-staff-miniprogram/' staffMiniprogram: '/rop-dj-staff-miniprogram/'
} }
const CONFIG_ENV_MAP = { const CONFIG_ENV_MAP = {
0: 'ip',
1: 'develop', 1: 'develop',
2: 'test', 2: 'test',
3: 'production', 3: 'production',
......
...@@ -345,7 +345,8 @@ export default { ...@@ -345,7 +345,8 @@ export default {
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
inputPlaceholder: '' inputPlaceholder: '',
blurFun: 'handleIssueCouponCountBlur'
}, },
{ {
label: '本月待邀约', label: '本月待邀约',
...@@ -566,6 +567,9 @@ export default { ...@@ -566,6 +567,9 @@ export default {
brandType, brandType,
tabName tabName
} }
if (item.firstBrandId == -1) {
item.issueCouponCount = item.issueCouponCount != null ? item.issueCouponCount : item.recordIssueCouponCount || 0
}
} else { } else {
hwOhterObjArray.forEach(e => { hwOhterObjArray.forEach(e => {
item[e.key] = null item[e.key] = null
...@@ -582,7 +586,7 @@ export default { ...@@ -582,7 +586,7 @@ export default {
this.orderObj = { this.orderObj = {
...orderObj, ...orderObj,
reportDate: currentDate, reportDate: currentDate,
isDateWithin7Days:editableDay ? !disabledReport : diffDay < 7, isDateWithin7Days: editableDay ? !disabledReport : diffDay < 7,
remark, remark,
lastStaffName: data.lastStaffName, lastStaffName: data.lastStaffName,
lastStaffUuid: data.lastStaffUuid, lastStaffUuid: data.lastStaffUuid,
...@@ -658,7 +662,17 @@ export default { ...@@ -658,7 +662,17 @@ export default {
item[key] = '' item[key] = ''
this.dateKey[`${key}_${index}`] = Date.now() this.dateKey[`${key}_${index}`] = Date.now()
} }
console.log(item[key]) if (i.blurFun) this[i.blurFun](item, index)
},
handleIssueCouponCountBlur (item) {
if (item.issueCouponCount < item.recordIssueCouponCount) {
uni.showToast({
title: `填写的今日店端实际发券数不能小于实际发券数!当前实际发券数=${item.recordIssueCouponCount}`,
icon: 'none'
})
return true
}
return false
}, },
async submit () { async submit () {
uni.showLoading({ uni.showLoading({
...@@ -669,24 +683,29 @@ export default { ...@@ -669,24 +683,29 @@ export default {
eventCode: 'app_submit_daily_report' eventCode: 'app_submit_daily_report'
}) //提交驻店日报埋点 }) //提交驻店日报埋点
try { try {
let { orderObj, carBandList, hwOhterObjArray, defaultObjArray } = this let { orderObj, carBandList, hwOhterObjArray, defaultObjArray } = this,
couponFlag = false
orderObj.isAdmin = false orderObj.isAdmin = false
orderObj.oprBy = orderObj.staffUuid orderObj.oprBy = orderObj.staffUuid
orderObj.sceneType = 1 orderObj.sceneType = 1
orderObj.brandDataList = carBandList orderObj.brandDataList = carBandList
if (couponFlag) return
if (orderObj.pickerValue == 0) { if (orderObj.pickerValue == 0) {
if (['', null].includes(orderObj.staffCount)) throw { if (['', null].includes(orderObj.staffCount)) throw {
message: '今日驻店人数(按店)', message: '今日驻店人数(按店)',
refId: 'staffCount' refId: 'staffCount'
} }
carBandList.map((item, index) => { carBandList.map((item, index) => {
if (item.firstBrandId == -1) defaultObjArray.map(el => { if (item.firstBrandId == -1) {
if (el.required && ['', null].includes(item[el.key])) throw { defaultObjArray.map(el => {
message: `${item.tabName}${el.label}`, if (el.required && ['', null].includes(item[el.key])) throw {
refId: `${el.refId}_${index}`, message: `${item.tabName}${el.label}`,
tabIndex: index refId: `${el.refId}_${index}`,
} tabIndex: index
}) }
})
couponFlag = this.handleIssueCouponCountBlur(item)
}
else hwOhterObjArray.map(el => { else hwOhterObjArray.map(el => {
if (el.required && ['', null].includes(item[el.key])) throw { if (el.required && ['', null].includes(item[el.key])) throw {
message: `${item.tabName}${el.label}`, message: `${item.tabName}${el.label}`,
...@@ -696,6 +715,7 @@ export default { ...@@ -696,6 +715,7 @@ export default {
}) })
}) })
} }
if (couponFlag) return
if (orderObj.onBreak == 'Y') { if (orderObj.onBreak == 'Y') {
orderObj.brandDataList.forEach(item => { orderObj.brandDataList.forEach(item => {
item.notDeliveryCount = item.notDeliveryCount || 0 item.notDeliveryCount = item.notDeliveryCount || 0
......
...@@ -61,6 +61,10 @@ const EQUITY_ORDER_COUNT_FIELDS = [ ...@@ -61,6 +61,10 @@ const EQUITY_ORDER_COUNT_FIELDS = [
prop: 'safePackageMaxAchieveCount' prop: 'safePackageMaxAchieveCount'
}, },
{ {
label: '安心包Lite',
prop: 'safePackageLiteAchieveCount'
},
{
label: '安心包', label: '安心包',
prop: 'safePackageAchieveCount' prop: 'safePackageAchieveCount'
}, },
......
...@@ -97,13 +97,13 @@ ...@@ -97,13 +97,13 @@
:tabIndex.sync="tabIndex" :tabIndex.sync="tabIndex"
nameKey="tabName" nameKey="tabName"
></type-tab-component> ></type-tab-component>
<view class="car-band-form-box"> <view :class="['car-band-form-box',{'car-band-form-box-type-2': orderObj.templateType == 2}]">
<template v-for="(item,index) in carBandList"> <template v-for="(item,index) in carBandList">
<view <view
:class="['box',{show:index == tabIndex}]" :class="['box',{show:index == tabIndex}]"
:key="index" :key="index"
> >
<template v-for="(i,ind) in hwOhterObjArray"> <template v-for="(i,ind) in templateList">
<view <view
:class="['form-item flex',{name:i.name}]" :class="['form-item flex',{name:i.name}]"
:key="`${index}_${ind}`" :key="`${index}_${ind}`"
...@@ -353,16 +353,16 @@ export default { ...@@ -353,16 +353,16 @@ export default {
}, },
{ {
label: '实际售前触客数', label: '实际售前触客数',
key: 'equityToShopCount', key: 'extendedWarrantyToShopCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
refId: 'equityToShopCount', refId: 'extendedWarrantyToShopCount',
}, },
{ {
label: '实际售后触客数', label: '实际售后触客数',
key: 'afterSaleEquityToShopCount', key: 'afterSaleExtendedWarrantyToShopCount',
type: 'number', type: 'number',
required: false, required: false,
min: 0, min: 0,
...@@ -427,6 +427,11 @@ export default { ...@@ -427,6 +427,11 @@ export default {
hide: NotAitoAndTemplateType3 hide: NotAitoAndTemplateType3
}, },
{ {
label: '安心包Lite成交数',
key: 'axPackageLiteCount',
hide: NotAitoAndTemplateType3
},
{
label: '安心包Pro成交数', label: '安心包Pro成交数',
key: 'axPackageProCount', key: 'axPackageProCount',
hide: NotAitoAndTemplateType3 hide: NotAitoAndTemplateType3
...@@ -480,7 +485,34 @@ export default { ...@@ -480,7 +485,34 @@ export default {
} }
] ]
return personalArray.filter(item => !item.hide) return personalArray.filter(item => !item.hide)
} },
templateList () {
const { hwOhterObjArray, orderObj: { templateType } } = this
const changeKeys = ['extendedWarrantyToShopCount', 'afterSaleExtendedWarrantyToShopCount']
const isType12 = templateType == 1 || templateType == 2
let base = hwOhterObjArray.map(item => {
const obj = { ...item }
if (isType12 && changeKeys.includes(obj.key)) {
obj.label = `延保${obj.label}`
} else if (!isType12 && changeKeys.includes(obj.key)) {
obj.label = `权益${obj.label}`
obj.key = obj.key === 'extendedWarrantyToShopCount' ? 'realEquityToShopCount' : 'afterSaleRealEquityToShopCount'
if (obj.refId) obj.refId = obj.key
}
return obj
})
if (templateType == 2) {
const afterIndex = base.findIndex(item => item.key == 'afterSaleExtendedWarrantyToShopCount')
if (afterIndex !== -1) {
const inserts = [
{ label: '权益实际售前触客数', key: 'realEquityToShopCount', type: 'number', required: true, min: 0, max: 100, refId: 'realEquityToShopCount' },
{ label: '权益实际售后触客数', key: 'afterSaleRealEquityToShopCount', type: 'number', required: false, min: 0, max: 100 }
]
base = [...base.slice(0, afterIndex + 1), ...inserts, ...base.slice(afterIndex + 1)]
}
}
return base
},
}, },
watch: { watch: {
currentMonth: { currentMonth: {
...@@ -495,7 +527,7 @@ export default { ...@@ -495,7 +527,7 @@ export default {
if (this.carBandList.length) this.getStaffDailyReportDetail() if (this.carBandList.length) this.getStaffDailyReportDetail()
}, },
deep: true, deep: true,
} },
}, },
mounted () { mounted () {
uni.$track.add({ uni.$track.add({
...@@ -621,10 +653,12 @@ export default { ...@@ -621,10 +653,12 @@ export default {
let { brandDataList, remark } = data let { brandDataList, remark } = data
if (brandDataList && brandDataList.length) { if (brandDataList && brandDataList.length) {
carBandList = carBandList.map((item, index) => { carBandList = carBandList.map((item, index) => {
this.dateKey[`deliveryCount_${index}`] = Date.now() let dataKeyList = ['deliveryCount', 'notDeliveryCount',
this.dateKey[`notDeliveryCount_${index}`] = Date.now() 'extendedWarrantyToShopCount', 'afterSaleExtendedWarrantyToShopCount',
this.dateKey[`equityToShopCount_${index}`] = Date.now() 'realEquityToShopCount', 'afterSaleRealEquityToShopCount']
this.dateKey[`afterSaleEquityToShopCount_${index}`] = Date.now() dataKeyList.map(key => {
this.dateKey[`${key}_${index}`] = Date.now()
})
let carBand = brandDataList.find(ele => { let carBand = brandDataList.find(ele => {
if ([0, 1, 3, 4, 5, 6].includes(ele.brandType)) { if ([0, 1, 3, 4, 5, 6].includes(ele.brandType)) {
return ele.brandType == item.brandType return ele.brandType == item.brandType
...@@ -668,7 +702,7 @@ export default { ...@@ -668,7 +702,7 @@ export default {
this.orderObj = { this.orderObj = {
...orderObj, ...orderObj,
reportDate: currentDate, reportDate: currentDate,
isDateWithin7Days:editableDay ? !disabledReport : diffDay < 7, isDateWithin7Days: editableDay ? !disabledReport : diffDay < 7,
remark, remark,
lastStaffName: data.lastStaffName, lastStaffName: data.lastStaffName,
lastStaffUuid: data.lastStaffUuid, lastStaffUuid: data.lastStaffUuid,
...@@ -680,7 +714,7 @@ export default { ...@@ -680,7 +714,7 @@ export default {
cancelOrderMoney: data.cancelOrderMoney, cancelOrderMoney: data.cancelOrderMoney,
templateType: isHmStore ? 1 : data.templateType || 1, templateType: isHmStore ? 1 : data.templateType || 1,
staffCount: data.staffCount, staffCount: data.staffCount,
onBreak: data.onBreak ? data.onBreak : diffDay < 7 ? data.onBreak || 'N' : '', onBreak: data.onBreak ? data.onBreak : diffDay < 7 ? data.onBreak || 'N' : 'N',
pickerValue: data.onBreak == 'Y' ? 1 : 0, pickerValue: data.onBreak == 'Y' ? 1 : 0,
staffCountError: false, staffCountError: false,
} }
...@@ -778,7 +812,7 @@ export default { ...@@ -778,7 +812,7 @@ export default {
eventCode: 'app_submit_daily_report' eventCode: 'app_submit_daily_report'
}) //提交驻店日报埋点 }) //提交驻店日报埋点
try { try {
let { orderObj, carBandList, hwOhterObjArray, userInfo } = this let { orderObj, carBandList, templateList, userInfo, orderObj:{templateType} } = this
orderObj.isAdmin = false orderObj.isAdmin = false
orderObj.oprBy = orderObj.staffUuid orderObj.oprBy = orderObj.staffUuid
orderObj.sceneType = 0 orderObj.sceneType = 0
...@@ -789,8 +823,8 @@ export default { ...@@ -789,8 +823,8 @@ export default {
refId: 'staffCount' refId: 'staffCount'
} }
carBandList.map((item, index) => { carBandList.map((item, index) => {
hwOhterObjArray.map(el => { templateList.map(el => {
if (el.required && ['', null].includes(item[el.key])) throw { if (el.required && ['', null, undefined].includes(item[el.key])) throw {
message: `${item.tabName}${el.label}`, message: `${item.tabName}${el.label}`,
refId: `${el.refId}_${index}`, refId: `${el.refId}_${index}`,
tabIndex: index tabIndex: index
...@@ -800,8 +834,11 @@ export default { ...@@ -800,8 +834,11 @@ export default {
} }
if (orderObj.onBreak == 'Y') { if (orderObj.onBreak == 'Y') {
orderObj.brandDataList.forEach(item => { orderObj.brandDataList.forEach(item => {
// 如果是调休,店端总未触客数&实际售前触客数默认值为空默认赋值为0
item.notDeliveryCount = item.notDeliveryCount || 0 item.notDeliveryCount = item.notDeliveryCount || 0
item.equityToShopCount = item.equityToShopCount || 0 if(templateType == 1 || templateType == 2) item.extendedWarrantyToShopCount = item.extendedWarrantyToShopCount || 0
if(templateType == 3 || templateType == 2) item.realEquityToShopCount = item.realEquityToShopCount || 0
}) })
} }
// 非调休 日报填报前参数校验 // 非调休 日报填报前参数校验
...@@ -865,6 +902,41 @@ export default { ...@@ -865,6 +902,41 @@ export default {
this.orderObj[i.submitValue] = value this.orderObj[i.submitValue] = value
}, },
handleTemplagePickerChange ({ item }) { handleTemplagePickerChange ({ item }) {
// const oldTemplateType = this.orderObj.templateType;
// const newTemplateType = item.value;
// // 更新模板类型
// this.orderObj.templateType = newTemplateType;
// // 如果模板类型发生变化,清空 carBandList 中受模板影响的字段
// if (oldTemplateType !== newTemplateType) {
// this.carBandList = this.carBandList.map(carBand => {
// const resetFields = {};
// // 所有模板共用的字段保留,但以下字段可能因模板而异,需重置
// const fieldsToReset = [
// 'extendedWarrantyToShopCount',
// 'afterSaleExtendedWarrantyToShopCount',
// 'realEquityToShopCount',
// 'afterSaleRealEquityToShopCount'
// ];
// fieldsToReset.forEach(key => {
// resetFields[key] = null;
// });
// // 可选:如果新模板是“广联权益”(3),也清空延保相关字段(如个人退单等,但这些在 orderObj,非 carBand)
// return { ...carBand, ...resetFields };
// });
// // 同步更新 dateKey,触发 input 重新渲染(避免缓存问题)
// this.carBandList.forEach((_, index) => {
// ['extendedWarrantyToShopCount', 'afterSaleExtendedWarrantyToShopCount', 'realEquityToShopCount', 'afterSaleRealEquityToShopCount']
// .forEach(key => {
// this.dateKey[`${key}_${index}`] = Date.now();
// });
// });
// }
this.orderObj.templateType = item.value this.orderObj.templateType = item.value
}, },
cancel () { cancel () {
...@@ -1050,6 +1122,9 @@ export default { ...@@ -1050,6 +1122,9 @@ export default {
visibility: visible; visibility: visible;
} }
} }
.car-band-form-box-type-2 {
height: toRpx(672);
}
.box { .box {
margin: 0; margin: 0;
border-radius: 0 0 toRpx(32); border-radius: 0 0 toRpx(32);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!