mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-06 14:16:44 +08:00
【FIX】保费计算跳转修复及测评按钮置灰
This commit is contained in:
@@ -759,7 +759,7 @@ export default {
|
||||
// this.cvalidateStr = this.cvalidateFlag?this.activeType == 'KMH'?'2021-01-01':this.activeType == 'SQY'?'2021-06-01':'':''
|
||||
//GFRS-2552【需求】关于金掌桂投保流程增设指定生效日按钮的申请
|
||||
const orderNo = this.$route.query.orderNo
|
||||
let detailPromise = this.isFrom === 'proposal' ? localStorage.proposalMedical : await getOrderDetail({ orderNo,userAssessLogic:true })
|
||||
let detailPromise = this.isFrom === 'proposal' ? localStorage.proposalMedical : await getOrderDetail({ orderNo })
|
||||
let collect = (data, code) => {
|
||||
data.forEach((item) => {
|
||||
if (item.code == code) {
|
||||
@@ -777,8 +777,6 @@ export default {
|
||||
//活动生效日期
|
||||
this.cvalidateStr = detailPromise.orderDTO.orderInfoDTO.cvaliDate
|
||||
this.activeType = detailPromise.orderDTO.orderInfoDTO.activeType
|
||||
this.assessFlag = detailPromise.orderDTO.orderInfoDTO.assessFlag
|
||||
this.resultRiskType = detailPromise.orderDTO.orderInfoDTO.resultRiskType
|
||||
}
|
||||
this.cvalidateFlag = this.activeType && this.isFrom != 'proposal'
|
||||
//构建提交数据、渲染险种
|
||||
@@ -3386,37 +3384,49 @@ export default {
|
||||
} else if (this.$route.query.proposalOrderNo) {
|
||||
thismyurl = '?proposalOrderNo=' + this.$route.query.proposalOrderNo
|
||||
}
|
||||
console.log('this.assessFlag',this.assessFlag)
|
||||
if(this.assessFlag === '0'){ //需要填写问卷
|
||||
localStorage.setItem('evalateFrom', 'toEvaluate') //通过该字段确定跳回几层
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#' + `/sale/questionEvaluate?orderNo=${this.$route.query.orderNo}`
|
||||
},
|
||||
routerInfo: {
|
||||
path:`/sale/questionEvaluate?orderNo=${this.$route.query.orderNo}`
|
||||
getOrderDetail({orderNo: this.$route.query.orderNo,userAssessLogic:true}).then((res) => {
|
||||
if(res.result == '0'){
|
||||
this.assessFlag = res.orderDTO.orderInfoDTO.assessFlag
|
||||
this.resultRiskType = res.orderDTO.orderInfoDTO.resultRiskType
|
||||
console.log('this.assessFlag',this.assessFlag)
|
||||
if(this.assessFlag === '0'){ //需要填写问卷
|
||||
localStorage.setItem('evalateFrom', 'toEvaluate') //通过该字段确定跳回几层
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#' + `/sale/questionEvaluate?orderNo=${this.$route.query.orderNo}`
|
||||
},
|
||||
routerInfo: {
|
||||
path:`/sale/questionEvaluate?orderNo=${this.$route.query.orderNo}`
|
||||
}
|
||||
})
|
||||
}else if( this.assessFlag === '2'){ //2.不需要填写,超过次数限制弹提示,继续后续投保流程
|
||||
return this.$toast('已超过评估次数限制,无法重新评估')
|
||||
}else if( this.assessFlag === '3'){ //3.不需要填写,已有有效期的问卷,需展示结论
|
||||
localStorage.setItem('evalateFrom', 'toResult')
|
||||
this.showResultPopup = true
|
||||
this.showHasTested = true
|
||||
}else{
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-2'
|
||||
},
|
||||
routerInfo: {
|
||||
type: 2,
|
||||
index: -2,
|
||||
path: '/common/selectedProduct' + thismyurl
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}else if( this.assessFlag === '2'){ //2.不需要填写,超过次数限制弹提示,继续后续投保流程
|
||||
return this.$toast('已超过评估次数限制,无法重新评估')
|
||||
}else if( this.assessFlag === '3'){ //3.不需要填写,已有有效期的问卷,需展示结论
|
||||
localStorage.setItem('evalateFrom', 'toResult')
|
||||
this.showResultPopup = true
|
||||
this.showHasTested = true
|
||||
}
|
||||
// this.$jump({
|
||||
// flag: 'goBack',
|
||||
// extra: {
|
||||
// refresh: '1',
|
||||
// index: '-2'
|
||||
// },
|
||||
// routerInfo: {
|
||||
// type: 2,
|
||||
// index: -2,
|
||||
// path: '/common/selectedProduct' + thismyurl
|
||||
// }
|
||||
// })
|
||||
}else{
|
||||
this.$toast(res.resMessage)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
} else if (localStorage.isFrom == 'proposal') {
|
||||
let proposalOrderNo = this.$CacheUtils.getLocItem('proposalNo') || ''
|
||||
if (resultData.content.id) {
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="question-btn bottom-btn bg-white">
|
||||
<van-button type="danger" size="large" class="bottom-btn" @click="submitAnswer" v-no-more-click="1000">提交</van-button>
|
||||
<van-button type="danger" size="large" :disabled="disabled" class="bottom-btn" @click="submitAnswer" v-no-more-click="1000">提交</van-button>
|
||||
</div>
|
||||
<PopupQuesResult
|
||||
@reTestHandler="reTest"
|
||||
@@ -134,33 +134,38 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
answerList: {
|
||||
assessQuestionnaireDtoList: {
|
||||
handler(newVal) {
|
||||
if(newVal) {
|
||||
console.log('检测到了长度', newVal.length)
|
||||
if(newVal.length == this.questionList.length){
|
||||
// 检查每一项是否有空值
|
||||
// 使用every方法检查是否所有项都已填写
|
||||
// 问题在于every方法的逻辑反了,应该在有值时返回false(不禁用按钮)
|
||||
// 在没有值时返回true(禁用按钮)
|
||||
this.disabled = !Array.from(newVal).every(item => {
|
||||
console.log('item', item, !item)
|
||||
// 检查每一项是否有值
|
||||
if (!item || (Array.isArray(item) && item.length === 0)) {
|
||||
console.log('进入了', item, !item)
|
||||
return false // 如果没有值,返回false,表示不满足条件
|
||||
console.log('检测到了长度', newVal)
|
||||
if(newVal.length !== this.questionList.length){
|
||||
this.disabled = true
|
||||
}else{
|
||||
if(Array.from(newVal).some(item=>!item)){
|
||||
console.log('检测到了有空值', Array.from(newVal))
|
||||
this.disabled = true
|
||||
} else if(Array.from(newVal)[3].chooseDesc.split(',').length!=2||
|
||||
Array.from(newVal)[3].chooseDesc.split(',').some(item=>!item)||
|
||||
!Array.from(newVal)[4].chooseDesc
|
||||
){
|
||||
this.disabled = true
|
||||
}else if(Array.from(newVal)[1].choose.length==0){
|
||||
this.disabled = true
|
||||
}else if(Array.from(newVal)[1].choose.length>0&&Array.from(newVal)[1].choose.includes('B')){
|
||||
console.log('检测到了B', Array.from(newVal)[1])
|
||||
if(Array.from(newVal)[1].subOption=='Y' && !Array.from(newVal)[1].subOptionContent){
|
||||
this.disabled = true
|
||||
}else if(Array.from(newVal)[1].subOption=='N'){
|
||||
this.disabled = false
|
||||
}else if(!Array.from(newVal)[1].subOption){
|
||||
this.disabled = true
|
||||
}
|
||||
|
||||
// 如果是数组,检查数组中是否所有元素都有值
|
||||
if (Array.isArray(item)) {
|
||||
return item.every(subItem => subItem && subItem.trim() !== '')
|
||||
else{
|
||||
this.disabled = false
|
||||
}
|
||||
|
||||
return true // 有值,返回true,表示满足条件
|
||||
});
|
||||
console.log('disabled', this.disabled);
|
||||
}else{ //如果长度不够,则认为没有填写完整,禁用掉提交按钮
|
||||
this.disabled = false
|
||||
}else{
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -185,7 +190,7 @@ export default {
|
||||
},
|
||||
CheckBoxExtraDesc:{
|
||||
handler(newVal) {
|
||||
if(!!newVal&&this.answerList[1].includes('B')) {
|
||||
if(this.answerList[1].includes('B')) {
|
||||
// 创建一个新对象,保留原对象的所有属性,只修改subOption为空
|
||||
const updatedItem = {
|
||||
...this.assessQuestionnaireDtoList[1],
|
||||
@@ -198,8 +203,7 @@ export default {
|
||||
},
|
||||
'answerList.1': {
|
||||
handler(newVal) {
|
||||
console.log('检测到了第一项数据', newVal)
|
||||
|
||||
console.log('检测到了第一项数据', newVal)
|
||||
if(!newVal.includes('B')) {
|
||||
this.CheckBoxExtraDesc = ''
|
||||
this.CheckBoxExtraRadio =''
|
||||
|
||||
Reference in New Issue
Block a user