From a40888d5a64a9d90fa253778c25e17dec8c0fd0e Mon Sep 17 00:00:00 2001 From: mengxiaolong Date: Thu, 27 Aug 2020 10:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E8=B5=84=E6=96=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BB=B6=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=96=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/questions/QuestionsDetail.vue | 246 ++----------------- 1 file changed, 17 insertions(+), 229 deletions(-) diff --git a/src/views/ebiz/questions/QuestionsDetail.vue b/src/views/ebiz/questions/QuestionsDetail.vue index 84389349a..e35c02e09 100644 --- a/src/views/ebiz/questions/QuestionsDetail.vue +++ b/src/views/ebiz/questions/QuestionsDetail.vue @@ -11,60 +11,11 @@
问题说明

- {{ supplement.descriptionInsurant }} + {{ problemDetail.issueContent }}

-

身份证头像面照片

- -

身份证国徽面照片

- - - -
-
申请人身份证明、银行账户复印件
-
-
-
问题说明
-

- {{ supplement.descriptionPolicyholder }} -

-
-

身份证头像面照片

- -

身份证国徽面照片

- -

银行卡照片

- +

请上传补充资料

+
@@ -175,28 +126,12 @@ export default { data() { let isWeixin = this.$utils.device().isWeixin return { + imageList: [], + imageResultList: [], sendTime: 0, isWeixin, - problemInfo: null, - problemDetail: null, - supplement: { - // 被保人问题描述 - descriptionInsurant: '', - // 投保人问题描述 - descriptionPolicyholder: '', - // 被保人身份证明 - insurantIdCardA: [], - insurantIdCardAUploadResult: null, - insurantIdCardB: [], - insurantIdCardBUploadResult: null, - // 投保人身份证明等资料 - policyholderIdCardA: [], - policyholderIdCardAUploadResult: null, - policyholderIdCardB: [], - policyholderIdCardBUploadResult: null, - policyholderBankCardA: [], - policyholderBankCardAUploadResult: null - }, + problemInfo: {}, + problemDetail: {}, newContract: { // 新契约 feedback: '', @@ -240,97 +175,22 @@ export default { } }, methods: { - // 补充资料问题件投保人上传身份证照片,银行卡照片 - async policyHolderUpload(file, detail) { - // 微信端将上传的图片保存到localstorage中供签名回调使用 - if (this.isWeixin) { - localStorage.setItem(detail.name, file.content) - } - let res = await this.afterRead(file) - let imageType = detail.name === 'policyholderIdCardA' ? 1 : detail.name === 'policyholderIdCardB' ? 2 : 3 - let result = { - rgssUrl: res.path, - imageInfoType: imageType, - subBusinessType: 0 - } - switch (detail.name) { - case 'policyholderIdCardA': - this.supplement.policyholderIdCardAUploadResult = result - if (this.isWeixin) { - localStorage.setItem('policyholderIdCardAUploadResult', JSON.stringify(result)) - } - break - case 'policyholderIdCardB': - this.supplement.policyholderIdCardBUploadResult = result - if (this.isWeixin) { - localStorage.setItem('policyholderIdCardBUploadResult', JSON.stringify(result)) - } - break - case 'policyholderBankCardA': - this.supplement.policyholderBankCardAUploadResult = result - if (this.isWeixin) { - localStorage.setItem('policyholderBankCardAUploadResult', JSON.stringify(result)) - } - break - } - }, - // 投保人删除资料回调方法 - policyHolderDelete(file, detail) { - switch (detail.name) { - case 'policyholderIdCardA': - this.supplement.policyholderIdCardAUploadResult = null - return true - case 'policyholderIdCardB': - this.supplement.policyholderIdCardBUploadResult = null - return true - case 'policyholderBankCardA': - this.supplement.policyholderBankCardAUploadResult = null - return true - } - }, - checkPolicyholderUpload() { - return ( - this.supplement.policyholderIdCardAUploadResult && this.supplement.policyholderIdCardBUploadResult && this.supplement.policyholderBankCardAUploadResult - ) - }, // 补充资料问题件被保人上传身份证照片 - async insurantUpload(file, detail) { + async uploadSupplementImg(file) { + console.dir(file) if (this.isWeixin) { - localStorage.setItem(detail.name, file.content) + localStorage.setItem('supplementImages', JSON.stringify(this.imageList)) } let res = await this.afterRead(file) let result = { rgssUrl: res.path, - imageInfoType: detail.name === 'insurantIdCardA' ? 1 : 2, + imageInfoType: 1, subBusinessType: 1 } - switch (detail.name) { - case 'insurantIdCardA': - this.supplement.insurantIdCardAUploadResult = result - if (this.isWeixin) { - localStorage.setItem('insurantIdCardAUploadResult', JSON.stringify(result)) - } - break - case 'insurantIdCardB': - this.supplement.insurantIdCardBUploadResult = result - if (this.isWeixin) { - localStorage.setItem('insurantIdCardBUploadResult', JSON.stringify(result)) - } - break - } + this.imageResultList.push(result) }, - insurantDelete(file, detail) { - switch (detail.name) { - case 'insurantIdCardA': - this.supplement.insurantIdCardAUploadResult = null - return true - case 'insurantIdCardB': - this.supplement.insurantIdCardBUploadResult = null - return true - } - }, - checkInsurantUpload() { - return this.supplement.insurantIdCardAUploadResult && this.supplement.insurantIdCardBUploadResult + checkSupplementData() { + return this.imageResultList.length !== 0 }, // 转账不成功问题件添加银行卡照片 async cardUpload(file, detail) { @@ -512,8 +372,7 @@ export default { return this.$toast('请输入4-400个字符') // 校验补充资料 if (this.issueType === '828601') { - if (!this.checkInsurantUpload()) return this.$toast('请上传被保人补充资料') - if (!this.checkPolicyholderUpload()) return this.$toast('请上传申请人补充资料') + if (!this.checkSupplementData()) return this.$toast('请上传补充资料') } // 转账不成功 if (this.issueType === '818901') { @@ -585,13 +444,7 @@ export default { } // 补充资料类问题件 else if (this.issueType === '828601') { - // 被保人资料 - problemData.list.push(this.supplement.insurantIdCardAUploadResult) - problemData.list.push(this.supplement.insurantIdCardBUploadResult) - // 投保人资料 - problemData.list.push(this.supplement.policyholderIdCardAUploadResult) - problemData.list.push(this.supplement.policyholderIdCardBUploadResult) - problemData.list.push(this.supplement.policyholderBankCardAUploadResult) + problemData.list.push(...this.imageList) } // 转账不成功问题件 else { @@ -657,10 +510,6 @@ export default { this.problemDetail = this.problemInfo.list[0] // 问题件接收人类型: 0投保人, 1被保人 this.problemDetail.receiveType = this.$route.query.receiveType - // 被保人资料问题描述 - this.supplement.descriptionInsurant = this.problemDetail.content - // 投保人资料问题描述 - this.supplement.descriptionPolicyholder = this.problemDetail.issueContent } else { this.$toast(rs.resultMessage) } @@ -792,68 +641,7 @@ export default { } } - // 补充资料问题件 - { - // 签名回调回显被保人身份证头像面 - if (localStorage.getItem('policyholderIdCardA')) { - this.supplement.insurantIdCardA.push({ - content: localStorage.getItem('policyholderIdCardA') - }) - } - - // 签名回调保存被保人身份证头像面上传结果 - if (localStorage.getItem('insurantIdCardAUploadResult')) { - this.supplement.insurantIdCardAUploadResult = JSON.parse(localStorage.getItem('insurantIdCardAUploadResult')) - } - - // 签名回调回显被保人身份证国徽面照片 - if (localStorage.getItem('policyholderIdCardB')) { - this.supplement.insurantIdCardB.push({ - content: localStorage.getItem('policyholderIdCardB') - }) - } - - // 签名回调回显被保人身份证国徽面 - if (localStorage.getItem('insurantIdCardBUploadResult')) { - this.supplement.insurantIdCardBUploadResult = JSON.parse(localStorage.getItem('insurantIdCardBUploadResult')) - } - - // 签名回调回显投保人身份证头像面 - if (localStorage.getItem('policyholderIdCardA')) { - this.supplement.policyholderIdCardA.push({ - content: localStorage.getItem('policyholderIdCardA') - }) - } - - // 签名回调保存投保人身份证头像面上传结果 - if (localStorage.getItem('policyholderIdCardAUploadResult')) { - this.supplement.policyholderIdCardAUploadResult = JSON.parse(localStorage.getItem('policyholderIdCardAUploadResult')) - } - - // 签名回调回显投保人身份证国徽面 - if (localStorage.getItem('policyholderIdCardB')) { - this.supplement.policyholderIdCardB.push({ - content: localStorage.getItem('policyholderIdCardB') - }) - } - - // 签名回调保存投保人身份证国徽面上传结果 - if (localStorage.getItem('policyholderIdCardBUploadResult')) { - this.supplement.policyholderIdCardBUploadResult = JSON.parse(localStorage.getItem('policyholderIdCardBUploadResult')) - } - - // 签名回调回显投保人银行卡照片 - if (localStorage.getItem('policyholderBankCardA')) { - this.supplement.policyholderBankCardA.push({ - content: localStorage.getItem('policyholderBankCardA') - }) - } - - // 签名回调后保存转账不成功上传银行卡照片结果信息 - if (localStorage.getItem('transferCardUploadResult')) { - this.transfer.cardUploadResult = JSON.parse(localStorage.getItem('transferCardUploadResult')) - } - } + // 补充资料问题件回显资料照片 } this.getBankList() this.getQuestionDetail()