建议书编辑状态删除主险添加提示语"编辑状态不可删除主险"

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-07-06 16:45:17 +08:00
parent 0bf3a2e6c8
commit e6be9aa6ef

View File

@@ -1908,110 +1908,115 @@ export default {
},
//删除所选产品
deleteRisk(index,data) {
Dialog.confirm({
title: '提示',
message: '确认删除该险种?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF',
className: 'dialog-delete'
})
.then(() => {
let currentGFRS_A0011
if (this.chooseProducts[index].isMainRisk == 0) {
this.chooseProducts = []
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
let thismyurl = ''
if (this.$route.query.orderNo) {
thismyurl = '/?orderNo=' + this.$route.query.orderNo
} else if (this.$route.query.proposalOrderNo) {
thismyurl = '?proposalOrderNo=' + this.$route.query.proposalOrderNo
}
this.$jump({
flag: 'goBack',
extra: {
refresh: '1',
index: '-2'
},
routerInfo: {
type: 2,
index: -2,
path: '/common/selectedProduct' + thismyurl
}
})
localStorage.trialList = ''
}else{
currentGFRS_A0011 = this.chooseProducts[index].productCode == 'GFRS_A0011'?true:false //当前删除的是否是两全
this.chooseProducts.splice(index, 1)
}
if (
this.chooseProducts[0].mainRiskCode == 'GFRS_M0051' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0044' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0060' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0035' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0038' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0040'
) {
if (currentGFRS_A0011 && (JSON.stringify(this.chooseProducts).includes('GFRS_A0010') || JSON.stringify(this.chooseProducts).includes('GFRS_A0014'))) {
this.chooseProducts.forEach((item, index01) => {
if(item.productCode == 'GFRS_A0010' ||item.productCode == 'GFRS_A0014'){
this.chooseProducts.splice(index01, 1)
}
})
// Dialog.alert({
// title: '提示',
// message: '当前未投保其他长险附加险,将删除该险种重新选择附加险!'
// }).then(() => {
// })
}
if (this.chooseProducts[index].isMainRisk == 0 && this.$route.query.insuanceIdInfo) {
this.$toast('编辑状态不可删除主险')
} else {
Dialog.confirm({
title: '提示',
message: '确认删除该险种?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF',
className: 'dialog-delete'
})
.then(() => {
let currentGFRS_A0011
if (this.chooseProducts[index].isMainRisk == 0) {
this.chooseProducts = []
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
let thismyurl = ''
if (this.$route.query.orderNo) {
thismyurl = '/?orderNo=' + this.$route.query.orderNo
} else if (this.$route.query.proposalOrderNo) {
thismyurl = '?proposalOrderNo=' + this.$route.query.proposalOrderNo
}
this.$jump({
flag: 'goBack',
extra: {
refresh: '1',
index: '-2'
},
routerInfo: {
type: 2,
index: -2,
path: '/common/selectedProduct' + thismyurl
}
})
localStorage.trialList = ''
} else {
currentGFRS_A0011 = this.chooseProducts[index].productCode == 'GFRS_A0011' ? true : false //当前删除的是否是两全
this.chooseProducts.splice(index, 1)
}
if (
this.chooseProducts[0].mainRiskCode == 'GFRS_M0051' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0044' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0060' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0035' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0038' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0040'
) {
if (currentGFRS_A0011 && (JSON.stringify(this.chooseProducts).includes('GFRS_A0010') || JSON.stringify(this.chooseProducts).includes('GFRS_A0014'))) {
this.chooseProducts.forEach((item, index01) => {
if (item.productCode == 'GFRS_A0010' || item.productCode == 'GFRS_A0014') {
this.chooseProducts.splice(index01, 1)
}
})
// Dialog.alert({
// title: '提示',
// message: '当前未投保其他长险附加险,将删除该险种重新选择附加险!'
// }).then(() => {
// })
}
// let risks = this.chooseProducts
// let longRisks = []
// //拿到长险附加险数组
// for (let i = 1; i < risks.length; i++) {
// for (let j = 0; j < risks[i].calFactorLst.length; j++) {
// if (risks[i].calFactorLst[j].code === 'insuYear') {
// if (
// ((risks[i].calFactorLst[j].insuYearFlag == 'Y' && risks[i].calFactorLst[j].insuYear > 1) || risks[i].calFactorLst[j].insuYearFlag == 'A') &&
// risks[i].productCode != 'GFRS_A0010'
// ) {
// longRisks.push(risks[i].productCode)
// }
// }
// }
// }
// if (
// (this.chooseProducts.length == 2 && this.chooseProducts[1].productCode == 'GFRS_A0010') ||
// (this.chooseProducts.length == 3 &&
// JSON.stringify(this.chooseProducts).includes('GFRS_A0010') &&
// JSON.stringify(this.chooseProducts).includes('GFRS_A0009')) ||
// (longRisks.length <= 0 && this.chooseProducts.length > 1)
// ) {
// Dialog.alert({
// title: '提示',
// message: '当前未投保其他长险附加险,将删除该险种重新选择附加险!'
// }).then(() => {
// this.chooseProducts.splice(1, 1)
// localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
// this.getTrial()
// })
// // this.$toast('当前未投保其他长险附加险,请删除该险种重新选择附加险!')
// // this.nextStepFlag = true
// }
}
if (localStorage.oldAddRiskCodes && JSON.parse(localStorage.oldAddRiskCodes)) {
let thismyoldAddRiskCodes = JSON.parse(localStorage.oldAddRiskCodes)
thismyoldAddRiskCodes.forEach((item,index0)=>{
if(item == data.productCode){
thismyoldAddRiskCodes.splice(index0,1)
}
})
localStorage.oldAddRiskCodes = JSON.stringify(thismyoldAddRiskCodes)
}
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
this.getTrial()
})
.catch(() => {})
// let risks = this.chooseProducts
// let longRisks = []
// //拿到长险附加险数组
// for (let i = 1; i < risks.length; i++) {
// for (let j = 0; j < risks[i].calFactorLst.length; j++) {
// if (risks[i].calFactorLst[j].code === 'insuYear') {
// if (
// ((risks[i].calFactorLst[j].insuYearFlag == 'Y' && risks[i].calFactorLst[j].insuYear > 1) || risks[i].calFactorLst[j].insuYearFlag == 'A') &&
// risks[i].productCode != 'GFRS_A0010'
// ) {
// longRisks.push(risks[i].productCode)
// }
// }
// }
// }
// if (
// (this.chooseProducts.length == 2 && this.chooseProducts[1].productCode == 'GFRS_A0010') ||
// (this.chooseProducts.length == 3 &&
// JSON.stringify(this.chooseProducts).includes('GFRS_A0010') &&
// JSON.stringify(this.chooseProducts).includes('GFRS_A0009')) ||
// (longRisks.length <= 0 && this.chooseProducts.length > 1)
// ) {
// Dialog.alert({
// title: '提示',
// message: '当前未投保其他长险附加险,将删除该险种重新选择附加险!'
// }).then(() => {
// this.chooseProducts.splice(1, 1)
// localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
// this.getTrial()
// })
// // this.$toast('当前未投保其他长险附加险,请删除该险种重新选择附加险!')
// // this.nextStepFlag = true
// }
}
if (localStorage.oldAddRiskCodes && JSON.parse(localStorage.oldAddRiskCodes)) {
let thismyoldAddRiskCodes = JSON.parse(localStorage.oldAddRiskCodes)
thismyoldAddRiskCodes.forEach((item, index0) => {
if (item == data.productCode) {
thismyoldAddRiskCodes.splice(index0, 1)
}
})
localStorage.oldAddRiskCodes = JSON.stringify(thismyoldAddRiskCodes)
}
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
this.getTrial()
})
.catch(() => {
})
}
},
//试算
async getTrial() {