Commit d177e970 by 李伟康

commit 提交

1 parent 94f0107d
...@@ -148,7 +148,8 @@ export default { ...@@ -148,7 +148,8 @@ export default {
customerType: { customerType: {
type: Number, type: Number,
default: 1 default: 1
} },
titleTips: String
}, },
data () { data () {
return { return {
...@@ -218,8 +219,8 @@ export default { ...@@ -218,8 +219,8 @@ export default {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
tips () { tips () {
let { sceneType } = this, let { sceneType, titleTips } = this,
text = '检测到“交车通知书”中未填写客户档案,请填写后再完成接待。' text = titleTips || '检测到“交车通知书”中未填写客户档案,请填写后再完成接待。'
if (sceneType == 1) text = '请确认“精品加装服务说明页”中的客户信息,并点击完成接待结束客户接待。' if (sceneType == 1) text = '请确认“精品加装服务说明页”中的客户信息,并点击完成接待结束客户接待。'
return text return text
} }
...@@ -381,7 +382,7 @@ export default { ...@@ -381,7 +382,7 @@ export default {
} }
.required { .required {
&::before { &::before {
content: "*"; content: '*';
color: #ff0000; color: #ff0000;
position: absolute; position: absolute;
left: -20rpx; left: -20rpx;
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
key: 'newCarFare', key: 'newCarFare',
type: 'input', type: 'input',
inputType: 'digit', inputType: 'digit',
maxlength: 9, maxlength: 10,
unit: '元', unit: '元',
}, },
], ],
...@@ -165,10 +165,10 @@ export default { ...@@ -165,10 +165,10 @@ export default {
if (e?.currentTarget && e?.target) { if (e?.currentTarget && e?.target) {
const { key } = e.currentTarget.dataset const { key } = e.currentTarget.dataset
if (key == 'newCarFare') { if (key == 'newCarFare') {
let value = Number(e.target.value >= 999999 ? 999999 : e.target.value) let value = Number(e.target.value) >= 9999999 ? 9999999 : e.target.value
// 判断是否为整数 // 判断是否为整数
if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1') if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1')
this.customerInfo[key] = Number(value).toFixed(2) ? value > 0 ? value : '' : '' this.customerInfo[key] = Number(value).toFixed(2) ? value >= 0 ? value : '' : ''
this.inputCustomer() this.inputCustomer()
} }
} }
......
...@@ -176,9 +176,9 @@ export default { ...@@ -176,9 +176,9 @@ export default {
handleInput (event) { handleInput (event) {
let value = event.target.value, let value = event.target.value,
{ index } = event.currentTarget.dataset { index } = event.currentTarget.dataset
value = Number(value > 999999 ? 999999 : value) value = Number(value) > 999999 ? 999999 : value
// 使用正则表达式来限制小数点后的位数 if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1')
this.insuranceList[index].cost = Number(value).toFixed(2) > 0 ? String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1') : '' this.insuranceList[index].cost = Number(value).toFixed(2) ? value >= 0 ? value : '' : ''
}, },
defaultBlock (item) { defaultBlock (item) {
return item.main == '交强险' ? (this.isPreview ? 'has-default' : item.show ? 'has-default' : '') : '' return item.main == '交强险' ? (this.isPreview ? 'has-default' : item.show ? 'has-default' : '') : ''
...@@ -216,7 +216,7 @@ export default { ...@@ -216,7 +216,7 @@ export default {
this.setInsuranceList(storageKey, list || []) this.setInsuranceList(storageKey, list || [])
} }
else { else {
const { insuranceList } = this, let { insuranceList } = this,
combinedList = [...insuranceList, ...list] combinedList = [...insuranceList, ...list]
const deduplicatedList = combinedList.reduce((acc, item) => { const deduplicatedList = combinedList.reduce((acc, item) => {
const existingItem = acc.find(existing => String(existing.id) === String(item.id)); const existingItem = acc.find(existing => String(existing.id) === String(item.id));
...@@ -227,7 +227,12 @@ export default { ...@@ -227,7 +227,12 @@ export default {
} else acc.push(item) } else acc.push(item)
return acc; return acc;
}, []) }, [])
this.setInsuranceList(storageKey, deduplicatedList) let arr = []
deduplicatedList.map(e =>{
let index = list.findIndex(item => String(item.id) === String(e.id))
if(index != -1) arr.push(e)
})
this.setInsuranceList(storageKey, arr)
} }
} catch (error) { } catch (error) {
this.flag = true this.flag = true
......
...@@ -73,6 +73,7 @@ export default { ...@@ -73,6 +73,7 @@ export default {
// 选择场景 // 选择场景
async selectScene ({ sceneType }, index) { async selectScene ({ sceneType }, index) {
let { sceneList, openSceneArr, userInfo } = this let { sceneList, openSceneArr, userInfo } = this
try {
if (!openSceneArr.includes(sceneType) && !userInfo?.isSuper) return uni.showToast({ if (!openSceneArr.includes(sceneType) && !userInfo?.isSuper) return uni.showToast({
title: '暂未开通此场景', title: '暂未开通此场景',
icon: 'none' icon: 'none'
...@@ -86,24 +87,28 @@ export default { ...@@ -86,24 +87,28 @@ export default {
}) })
if (userInfo?.isSuper) this.jump(userInfo) if (userInfo?.isSuper) this.jump(userInfo)
else { else {
try {
const data = await uni.$api.userApi.selectMerchantScene({ const data = await uni.$api.userApi.selectMerchantScene({
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName, merchantName: userInfo.shopMerchantName,
sceneType sceneType
}) })
if (data) this.jump(userInfo, data) if (data) this.jump(userInfo, data)
else {
this.$sendSentry(`选择场景异常:merchantId:${userInfo.shopMerchantId},merchantName:${userInfo.shopMerchantName},sceneType:${sceneType},接口返回:${JSON.stringify(data || '')}`)
}
}
} catch (error) { } catch (error) {
this.$sendSentry(`选择场景异常:merchantId:${userInfo.shopMerchantId},merchantName:${userInfo.shopMerchantName},sceneType:${sceneType},失败原因:${JSON.stringify(error)}`)
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: error, title: error,
icon: 'none' icon: 'none'
}) })
console.log(error)
} }
}
}, },
async jump (userInfo, data) { async jump (userInfo, data) {
try {
uni.hideLoading() uni.hideLoading()
if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant
let { shopMerchantId } = userInfo let { shopMerchantId } = userInfo
...@@ -125,6 +130,14 @@ export default { ...@@ -125,6 +130,14 @@ export default {
uni.reLaunch({ uni.reLaunch({
url url
}) })
} catch (error) {
this.$sendSentry(`选择场景后跳转异常:${error}`)
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none'
})
}
} }
} }
} }
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<finish-step <finish-step
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
:titleTips="finishTips"
/> />
<informationEntry <informationEntry
:showPayPage.sync="showPayPage" :showPayPage.sync="showPayPage"
...@@ -139,6 +140,12 @@ export default { ...@@ -139,6 +140,12 @@ export default {
name = this.media.find((e) => e.id == id)?.detailTitle || "" name = this.media.find((e) => e.id == id)?.detailTitle || ""
return name; return name;
}, },
finishTips(){
const {channelType} = uni.$storage.get("userInfo")
let text = ''
if(channelType != 1) text = '检测到“汽车保险告知书”中未填写客户档案,请填写后再完成接待。'
return text
}
}, },
watch: { watch: {
watchStatus: { watchStatus: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!