更新问题件内容

This commit is contained in:
mengxiaolong
2020-08-04 10:56:59 +08:00
parent 82037a6d43
commit 0bb7547e59
4 changed files with 262 additions and 77 deletions

View File

@@ -18,3 +18,12 @@ export function getQuestionDetail(data = {}) {
data
})
}
// 更新
export function updateQuestionDetail(data = {}) {
return request({
method: 'post',
url: getUrl('/sale/issue/updatePrtIssue', 1),
data
})
}

View File

@@ -37,7 +37,8 @@ export default {
data() {
return {
code: '',
sid: ''
sid: '',
getCaptcha: false
}
},
watch: {
@@ -55,9 +56,13 @@ export default {
},
methods: {
cancel() {
this.code = ''
this.$emit('update:show', false)
},
async confirm() {
if (!this.getCaptcha) {
return this.$toast('请先获取验证码')
}
if (!this.code.trim()) {
return this.$toast('请输入验证码')
}
@@ -67,21 +72,17 @@ export default {
})
console.log(res)
if (res.result === '0') {
//
this.$jump({
flag: 'h5',
extra: {
url: `${window.location.origin}/#/questions/result`
},
routerInfo: {
path: `/questions/result`
}
this.$emit('getMessage', {
type: 'confirm',
data: true
})
} else {
this.$toast('验证失败, 请重新获取验证码')
}
this.code = ''
},
async getMessage() {
this.getCaptcha = true
let data = {
operateType: 'appntInfoEntry',
type: 'H5',

View File

@@ -11,22 +11,22 @@
<div class="query">
<div>问题说明</div>
<p>
{{ supplement.problemDescription }}
{{ supplement.descriptionInsurant }}
</p>
</div>
<van-uploader :after-read="afterRead" name="id" v-model="supplement.idImgList" />
<van-uploader :after-read="insurantUpload" name="id" v-model="supplement.idImgList" />
</div>
</div>
<div class="updateInfo">
<div class="title">被保险人身份证明</div>
<div class="title">申请人身份证明银行账户复印件</div>
<div class="content">
<div class="query">
<div>问题说明</div>
<p>
{{ supplement.problemDescription }}
{{ supplement.descriptionPolicyholder }}
</p>
</div>
<van-uploader :after-read="afterRead" name="copy" v-model="supplement.copyImgList" />
<van-uploader :after-read="policyHolderUpload" name="copy" @delete="deleteImg" v-model="supplement.copyImgList" />
</div>
</div>
</div>
@@ -54,19 +54,19 @@
</van-field>
</div>
<div class="item">
<van-field v-model="transfer.back" @click="getBankListItem" label-class="labels" readonly label="开户银行" placeholder="请选择">
<template #button>
<van-field v-model="transfer.bank" @click="getBankListItem" label-class="labels" readonly label="开户银行" placeholder="请选择"> </van-field>
</div>
<div class="item">
<van-field v-model="transfer.card" :maxlength="19" label-class="labels" label="银行卡号" placeholder="请输入银行卡号"
><template #button>
<van-button size="small" class="button" round color="#e4393c" type="primary" @click.stop="toggleCardScan(true)">银行卡扫描</van-button>
</template>
</van-field>
</div>
<div class="item">
<van-field v-model="transfer.card" label-class="labels" label="银行卡号" placeholder="请输入用户名" />
</div>
<div class="item">
<van-field label-class="labels" readonly label="银行卡照片"></van-field>
<div class="cardList">
<van-uploader :max-count="2" :after-read="afterRead" name="card" v-model="transfer.cardPhoto" />
<van-uploader :max-count="2" :after-read="cardUpload" name="card" v-model="transfer.cardPhoto" />
</div>
</div>
<div class="checkedBox" v-if="issueType === '818901'">
@@ -79,14 +79,16 @@
<div class="autograph" v-if="issueType !== '818901'">
<div class="list">
<span>投保人/监护人亲笔签名</span>
<van-button class="button" round type="info" size="mini" color="#e4393c" @click="autograph(0)">签名</van-button>
<van-button type="danger" size="small" @click="autograph(0)">{{ policyholderSigned ? '已签名' : '签名' }}</van-button>
</div>
<div class="list">
<span>被投保人亲笔签名</span>
<van-button class="button" round type="info" size="mini" color="#e4393c" @click="autograph(1)">签名</van-button>
<van-button type="danger" size="small" @click="autograph(1)">{{ insurantSigned ? '已签名' : '签名' }}</van-button>
</div>
</div>
<van-button type="primary" block color="#e4393c" class="next" @click="submit">下一步</van-button>
<div class="bg-white bottom-btn">
<van-button type="danger" size="large" block @click="submit">下一步</van-button>
</div>
<short-message :show.sync="dialog.show" :type="dialog.type" :text="dialog.text" @getMessage="getMessage"></short-message>
<van-popup v-model="transfer.show" position="bottom">
<ul class="bankList">
@@ -112,7 +114,7 @@
<script>
import { Uploader, Checkbox, Field, Radio, RadioGroup, Popup, Overlay, Dialog } from 'vant'
import { getBankList, uploadImg } from '@/api/ebiz/sale/sale'
import { getQuestionDetail } from '@/api/ebiz/questions'
import { getQuestionDetail, updateQuestionDetail } from '@/api/ebiz/questions'
import BankCardScan from '@/components/ebiz/sale/BankCardScan'
import ShortMessage from '@/components/ebiz/question/ShortMessage.vue'
export default {
@@ -130,12 +132,21 @@ export default {
[Dialog.name]: Dialog
},
data() {
let isWeixin = this.$utils.device().isWeixin
return {
isWeixin,
problemDetail: null,
supplement: {
// 补充材料
problemDescription: '',
// 被保人问题描述
descriptionInsurant: '',
// 投保人问题描述
descriptionPolicyholder: '',
// 被保人身份证明
idImgList: [],
copyImgList: []
insurantUploadResult: [],
// 投保人身份证明等资料
copyImgList: [],
policyholderUploadResult: []
},
newContract: {
// 新契约
@@ -144,13 +155,15 @@ export default {
transfer: {
// 转账失败
mode: '',
back: '',
bank: '',
bankCode: '',
card: '',
cardPhoto: [],
backList: [],
bankList: [],
show: false, //显示银行列表
showDiscern: false, //是否开启银行卡识别
clear: false //是否清空银行卡识别数据
clear: false, //是否清空银行卡识别数据
cardUploadResult: []
},
// 勾选协议
checked: false,
@@ -167,27 +180,47 @@ export default {
insurantSigned: false,
// 接收验证码手机号码
phoneNum: '',
showConfirm: false
}
},
computed: {
problemType() {
if (!this.issueType === 0) {
return this.issueType
} else {
return 0
}
showConfirm: false,
src: '',
pdfUrl: ''
}
},
methods: {
async policyHolderUpload(file, detail) {
console.log(file, detail)
let res = await this.afterRead(file)
console.log(res)
this.supplement.policyholderUploadResult.push({
rgssUrl: res.path
})
},
deleteImg(file, detail) {
console.log(file, detail)
},
async insurantUpload(file) {
let res = await this.afterRead(file)
console.log(res)
this.supplement.insurantUploadResult.push({
rgssUrl: res.path
})
},
async cardUpload(file) {
let res = await this.afterRead(file)
this.transfer.cardUploadResult.push({
rgssUrl: res.path
})
console.log(res)
},
//签名
async autograph(personType) {
let problemInfo = JSON.parse(localStorage.getItem('currentProblemItem'))
if (!this.isWeixin) {
// eslint-disable-next-line
const res = await EWebBridge.webCallAppInJs('ca_sign', {
name: '李凯',
name: personType === 0 ? problemInfo.prtName : problemInfo.insuredName,
type: '1',
number: '142727199301063550',
keyword: '签字签字',
keyword: '签字',
pageNo: '1',
index: 1,
offset: 20,
@@ -202,6 +235,9 @@ export default {
this.insurantSigned = true
}
console.log(res)
} else {
this.toAirSign('0', '签字日期', '-150', '2', personType)
}
},
getBankNo(data) {
console.log(data)
@@ -209,16 +245,15 @@ export default {
toggleCardScan(data) {
this.transfer.showDiscern = data
if (data) {
console.log('set card')
localStorage.setItem('cardScanningType', 0)
} else {
console.log('remove card')
localStorage.removeItem('cardScanningType')
}
},
getBankListItem(item) {
this.transfer.show = !this.transfer.show
this.transfer.bank = item.code
this.transfer.bank = item.bankName
this.transfer.bankCode = item.code
},
async getBankList() {
this.transfer.bankList = (
@@ -228,15 +263,23 @@ export default {
).content
},
appCallBack(data) {
let title = ''
if (this.issueType === 'TB89') {
title = '国富人寿基本问题件处理'
} else if (this.issueType === '828601') {
title = '国富人寿补充资料问题件处理'
} else {
title = '国富人寿转账不成功问题件处理'
}
if (data.trigger == 'right_button_click') {
let token = window.localStorage.getItem('token')
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
title: '国富人寿欢迎您!',
title: title,
content: this.shareContent,
url: `${location.origin}/#/manpower/increaseStaffTools/PdfShare?&token=${token}`,
url: `${location.origin}/#/questions/detail?&token=${token}`,
img: this.$assetsUrl + 'images/logo.png'
}
})
@@ -248,14 +291,41 @@ export default {
}
},
async afterRead(file) {
console.dir(file)
let data = new FormData()
data.append('imgPath', file.file)
let res = await uploadImg(data)
console.log(res)
return await uploadImg(data)
},
submit() {
// 校验回复内容
if (this.issueType === 'TB89' && this.newContract.feedback.trim() === '') return this.$toast('请填写回复内容')
// 校验补充资料
if (this.issueType === '828601') {
if (this.supplement.idImgList.length === 0 || this.supplement.copyImgList.length === 0) {
return this.$toast('请上传补充资料')
}
}
if (this.issueType === '818901') {
// 校验处理方式
if (this.transfer.mode === '') {
return this.$toast('请选择处理方式')
}
// 校验开户行
if (!this.transfer.bank) {
return this.$toast('请选择开户行')
}
// 银行卡号校验
let regx = /^(\d{16}|\d{18}|\d{19})$/
if (!regx.test(this.transfer.card)) {
return this.$toast('银行卡号不符合规则')
}
if (this.transfer.cardPhoto.length === 0) {
return this.$toast('请上传银行卡图片')
}
}
if (!this.checked) return this.$toast('请先同意协议')
// 转账失败问题件不用签名
if (this.issueType !== '818901') {
// 校验签名
if (this.policyholderSigned && this.insurantSigned) {
this.dialog = {
type: 'confirm',
@@ -265,20 +335,113 @@ export default {
} else {
this.$toast('请完成全部签名后继续操作')
}
} else {
this.dialog = {
type: 'confirm',
show: true,
text: '为确定用户身份我们将向186xxxx8972此手机号发送验证码'
}
}
},
getMessage({ type, data }) {
async getMessage({ type, data }) {
// 获取dialog信息type为confirm时为短信框alert时是确定框
console.log(type, data)
let currentProblem = JSON.parse(localStorage.getItem('currentProblemItem'))
let problemData = {
id: currentProblem.id,
businessType: currentProblem.businessType,
content: '',
disposeStatus: '',
bankType: '',
bankName: '',
bankNo: '',
list: []
}
// 验证码验证成功
if (data) {
// 契约问题件
if (this.issueType === 'TB89') {
problemData.content = this.newContract.feedback
console.log(problemData)
}
// 补充资料类问题件
else if (this.issueType === '828601') {
// 被保人资料
for (let item of this.supplement.insurantUploadResult) {
item.imageInfoType = '1'
item.subBusinessType = '1'
}
problemData.list.push(...this.supplement.insurantUploadResult)
// 投保人资料
for (let item of this.supplement.policyholderUploadResult) {
item.imageInfoType = '1'
item.subBusinessType = '0'
}
problemData.list.push(...this.supplement.policyholderUploadResult)
console.log(problemData)
}
// 转账不成功问题件
else {
problemData.disposeStatus = this.transfer.mode
problemData.bankType = this.transfer.mode
problemData.bankName = this.transfer.bank
problemData.bankNo = this.transfer.card
for (let item of this.transfer.cardUploadResult) {
item.imageInfoType = '3'
item.subBusinessType = '0'
}
problemData.list = this.transfer.cardUploadResult
console.log(problemData)
}
// 更新
let res = await updateQuestionDetail(problemData)
console.log(res)
this.dialog.show = false
}
},
async getQuestionDetail() {
const rs = await getQuestionDetail({
id: this.$route.params.id
})
console.log(rs)
this.problemDetail = rs.content.list[0]
console.log(this.problemDetail)
let problemDetail = rs.content.list[0]
this.supplement.descriptionInsurant = problemDetail.content
this.supplement.descriptionPolicyholder = problemDetail.issueContent
},
//微信空签
toAirSign(status, keyword, offset, originStatus, personType) {
localStorage.setItem(
'signInfo',
JSON.stringify({
originStatus: originStatus,
idNo: localStorage.idNoD,
name: localStorage.idNameD,
type: '1',
keyword: keyword,
status: status,
offset: offset,
originUrl: location.href
})
)
window.location.href = this.$mainUrl + '/sign/index.html'
}
},
async created() {
this.issueType = this.$route.params.type
if (this.isWeixin) {
let imgBase64Data = sessionStorage.getItem('oneimgBase64Data')
let wxSigned = sessionStorage.getItem('onewxSigned')
let signInfo = JSON.parse(localStorage.getItem('signInfo'))
console.log(signInfo)
console.log('imgBase64Data: twoimgBase64Data:' + imgBase64Data)
console.log('wxSigned: ' + wxSigned)
if (wxSigned) {
console.log('第二次进问题件详情页面')
this.base64D = imgBase64Data
}
}
this.getBankList()
this.getQuestionDetail()
},

View File

@@ -34,7 +34,7 @@
</div>
<div class="col">
<van-tag class="tag" plain type="primary" color="#ffcc99">类型</van-tag>
<div class="text">{{ item.businessType }}</div>
<div class="text">{{ item.statusComment }}</div>
</div>
</div>
<div class="bottom">
@@ -44,7 +44,7 @@
</div>
<div class="list">
<van-tag class="tag" plain>状态</van-tag>
<div class="text">{{ item.statusComment }}</div>
<div class="text">{{ item.status | statusFilter }}</div>
</div>
</div>
<div class="buttons">
@@ -79,7 +79,7 @@
</div>
<div class="col">
<van-tag class="tag" plain type="primary" color="#ffcc99">类型</van-tag>
<div class="text">{{ item.businessType }}</div>
<div class="text">{{ item.statusComment }}</div>
</div>
</div>
<div class="bottom">
@@ -89,7 +89,7 @@
</div>
<div class="list">
<van-tag class="tag" plain>状态</van-tag>
<div class="text">{{ item.statusComment }}</div>
<div class="text">{{ item.status | statusFilter }}</div>
</div>
</div>
</div>
@@ -208,6 +208,18 @@ export default {
filters: {
createTimeFormatFilter(val) {
return dateUtil.formatDate(new Date(val), 'yyyy-MM-dd HH:mm:ss')
},
statusFilter(val) {
switch (val) {
case '0':
return '已下发'
case '1':
return '已打印'
case '2':
return '已回扫'
case '3':
return '已回销'
}
}
}
}