Commit defde772 by yuzhenWang

Merge branch 'wyz' into 'test'

修复保费对账--汇款记录bug

See merge request !162
parents 3418bbc1 f625bc36
...@@ -780,7 +780,7 @@ const remittanceConfig = [ ...@@ -780,7 +780,7 @@ const remittanceConfig = [
// }, // },
{ {
type: 'upload', type: 'upload',
prop: 'paymentVoucherList', prop: 'paymentVoucherDtoList',
label: '支付凭证', label: '支付凭证',
uploadType: 'file', uploadType: 'file',
multiple: true, multiple: true,
...@@ -799,7 +799,7 @@ const remittanceConfig = [ ...@@ -799,7 +799,7 @@ const remittanceConfig = [
}, },
{ {
type: 'upload', type: 'upload',
prop: 'accountVerificationList', prop: 'accountVerificationDtoList',
label: '账户证明', label: '账户证明',
uploadType: 'file', uploadType: 'file',
multiple: true, multiple: true,
...@@ -874,6 +874,9 @@ async function onSelectChange(type, prop, value, item) { ...@@ -874,6 +874,9 @@ async function onSelectChange(type, prop, value, item) {
} }
} }
} else if (type == 'addCheckRecord') { } else if (type == 'addCheckRecord') {
console.log('====================================')
console.log('保单号改变')
console.log('====================================')
//新增保费对账弹窗 //新增保费对账弹窗
if (prop === 'policyNo' && value) { if (prop === 'policyNo' && value) {
tempPolicyNo.value = value tempPolicyNo.value = value
...@@ -910,6 +913,13 @@ const addRemittance = async () => { ...@@ -910,6 +913,13 @@ const addRemittance = async () => {
} }
try { try {
const formData = await addCheckRecordFormRef.value.validate() const formData = await addCheckRecordFormRef.value.validate()
const res = await getCheckPolicyNoApi(formData.policyNo)
console.log('校验保单res', res)
if (!res.data) {
ElMessage.warning(res.msg)
return
}
// 汇款记录详情也需要回显保费对账得一些字段 // 汇款记录详情也需要回显保费对账得一些字段
remittanceFormModel.value = { remittanceFormModel.value = {
...formData ...formData
...@@ -917,6 +927,7 @@ const addRemittance = async () => { ...@@ -917,6 +927,7 @@ const addRemittance = async () => {
remittanceFormModel.value.apiPremiumRemittanceFileDtoList = [] remittanceFormModel.value.apiPremiumRemittanceFileDtoList = []
tempOtherFileList.value = [] tempOtherFileList.value = []
remittanceDialogTitle.value = '新增汇款' remittanceDialogTitle.value = '新增汇款'
showRemittance.value = true showRemittance.value = true
} catch (error) { } catch (error) {
// ❌ 校验失败或提交异常都会进入这里 // ❌ 校验失败或提交异常都会进入这里
...@@ -993,11 +1004,16 @@ const confirmRemittance = async data => { ...@@ -993,11 +1004,16 @@ const confirmRemittance = async data => {
const formData = await remittanceFormRef.value.validate() const formData = await remittanceFormRef.value.validate()
let newFormData = JSON.parse(JSON.stringify(formData)) let newFormData = JSON.parse(JSON.stringify(formData))
// 因为汇款记录回显了保费对账的一些字段,但提交汇款记录的时候这些回显的字段是不能提交的,所以在这里做删除 // 因为汇款记录回显了保费对账的一些字段,但提交汇款记录的时候这些回显的字段是不能提交的,所以在这里做删除
console.log('确认汇款', newFormData)
// return
let objMap = {
apiPremiumRemittanceFileDtoList: 'apiPremiumRemittanceFileDtoList',
paymentVoucherDtoList: 'paymentVoucherDtoList',
accountVerificationDtoList: 'accountVerificationDtoList'
}
for (const key in newFormData) { for (const key in newFormData) {
if (key == deleteObjkeys[key]) delete newFormData[key] if (key == deleteObjkeys[key]) delete newFormData[key]
// 文件上传的数据格式在这里统一处理 if (key == objMap[key] && newFormData[key] && newFormData[key].length > 0) {
if (key == 'apiPremiumRemittanceFileDtoList' && newFormData[key].length > 0) {
newFormData[key] = newFormData[key].map(item => { newFormData[key] = newFormData[key].map(item => {
// 有response说明是新上传得,要处理返回格式和字段 // 有response说明是新上传得,要处理返回格式和字段
if (item.response) { if (item.response) {
...@@ -1007,22 +1023,19 @@ const confirmRemittance = async data => { ...@@ -1007,22 +1023,19 @@ const confirmRemittance = async data => {
fileType: newObj.fileType, //文件类型 fileType: newObj.fileType, //文件类型
fileUrl: newObj.url, //文件URL, fileUrl: newObj.url, //文件URL,
url: newObj.url //文件URL url: newObj.url //文件URL
// name: newObj.originalName //文件名
} }
} else { } else {
return item return item
} }
}) })
} else if (
(key == 'paymentVoucherList' || key == 'accountVerificationList') &&
newFormData[key].length > 0
) {
newFormData[key] = newFormData[key].map(item => item.url)
} }
} }
let res = {} let res = {}
console.log('====================================') // console.log('====================================')
console.log('newFormData', newFormData) // console.log('newFormData', newFormData)
console.log('====================================') // console.log('====================================')
// return
if (currentRow.value.premiumReconciliationBizId && !formData.premiumRemittanceBizId) { if (currentRow.value.premiumReconciliationBizId && !formData.premiumRemittanceBizId) {
//编辑保费对账状态下新增汇款记录 //编辑保费对账状态下新增汇款记录
const params = { const params = {
...@@ -1089,10 +1102,10 @@ const editRemittance = async row => { ...@@ -1089,10 +1102,10 @@ const editRemittance = async row => {
// 上传回显得格式是[{url:''}]所以要处理一下 // 上传回显得格式是[{url:''}]所以要处理一下
for (const key in newObj) { for (const key in newObj) {
if (key == 'accountVerificationDtoList' || key == 'paymentVoucherDtoList') { if (key == 'accountVerificationDtoList' || key == 'paymentVoucherDtoList') {
console.log('key', key)
if (newObj[key] && newObj[key].length > 0) { if (newObj[key] && newObj[key].length > 0) {
newObj[key] = newObj[key].map(item => { newObj[key] = newObj[key].map(item => {
return { return {
...item,
url: item.fileUrl, url: item.fileUrl,
name: item.fileName name: item.fileName
} }
...@@ -1114,17 +1127,6 @@ const editRemittance = async row => { ...@@ -1114,17 +1127,6 @@ const editRemittance = async row => {
} }
remittanceFormModel.value = newObj remittanceFormModel.value = newObj
if (newObj.accountVerificationDtoList && newObj.accountVerificationDtoList.length > 0) {
remittanceFormModel.value.accountVerificationList = newObj.accountVerificationDtoList
} else {
remittanceFormModel.value.accountVerificationList = []
}
if (newObj.paymentVoucherDtoList && newObj.paymentVoucherDtoList.length > 0) {
remittanceFormModel.value.paymentVoucherList = newObj.paymentVoucherDtoList
} else {
remittanceFormModel.value.paymentVoucherList = []
}
if (remittanceFormModel.value.apiPremiumRemittanceFileDtoList.length > 0) { if (remittanceFormModel.value.apiPremiumRemittanceFileDtoList.length > 0) {
tempOtherFileList.value = remittanceFormModel.value.apiPremiumRemittanceFileDtoList tempOtherFileList.value = remittanceFormModel.value.apiPremiumRemittanceFileDtoList
} }
...@@ -1239,7 +1241,7 @@ const getPremiumReconciliationDetail = async row => { ...@@ -1239,7 +1241,7 @@ const getPremiumReconciliationDetail = async row => {
// 按钮事件处理 // 按钮事件处理
const handleAdd = () => { const handleAdd = () => {
console.log(addCheckRecordFormModel.value) console.log(addCheckRecordFormModel.value)
currentRow.value = {}
receiptsDialogTitle.value = '新增保单对账' receiptsDialogTitle.value = '新增保单对账'
receiptsFlag.value = true receiptsFlag.value = true
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment