Commit 10d9b14a by yuzhenWang

Merge branch 'feature-20250827wyz-写业务' into 'test'

发布测试合并代码

See merge request !37
parents b29dcd31 92304c31
......@@ -313,6 +313,21 @@ const customer = [
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '受供养人数目',
key: 'dependentsNum',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: false,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
......
......@@ -71,7 +71,11 @@
:placeholder="child.placeholder"
maxlength="30"
:disabled="
child.key == 'age' || child.key == 'bmi' ? true : editStatus
child.key == 'age' ||
child.key == 'bmi' ||
child.key == 'dependentsNum'
? true
: editStatus
"
@blur="handleInputBlur(child)"
>
......@@ -105,7 +109,7 @@
v-model="form[child.key]"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD"
:placeholder="child.placeholder"
:disabled="editStatus"
:disabled-date="time => disabledDate(time, child)"
......@@ -977,7 +981,12 @@ const setFormValue = (obj, formData, exportValue) => {
if (obj.isRetirement || obj.isRetirement == 0) {
form.value['isRetirement'] = String(obj.isRetirement)
}
if (obj.dependentsNum) {
field.show = true
}
if (field.dictType == 'sys_no_yes') {
form.value[field.key] = String(obj[field.key])
}
//要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) {
case 'phone':
......@@ -1080,7 +1089,7 @@ const setFormValue = (obj, formData, exportValue) => {
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
processedCustomerData.value = processedData
console.log('processedCustomerData.value', processedCustomerData.value)
console.log('form.value', form.value)
}
// 数组去重
function removeDuplicates(arr, key) {
......
......@@ -426,6 +426,8 @@ const handleRemoteSelectChange = async (row, column, father) => {
if (item.value == row.insuranceType) {
if (item.code == 'CI') {
row.showSumInsured = true
} else {
row.showSumInsured = false
}
row.insuranceType = item.label
}
......@@ -748,7 +750,7 @@ const setFormValue = (obj, formData) => {
loading.value = true
let processedData = JSON.parse(JSON.stringify(formData))
// 重疾险要加上row.showSumInsured = true便于控制重疾险保额输入框的显示
for (const section of processedData) {
if (section.keyType == 'Array') {
section.data = obj[section.key] ? obj[section.key] : []
......
......@@ -1006,21 +1006,8 @@ const processFormData = async () => {
}
}
}
console.log('searchOptions.value', searchOptions.value)
setFormValue(props.detailInfo, processedData)
// if (props.idsObj.appointmentBizId) {
// setFormValue(props.apiAppointmentInfoDto, processedData)
// return
// } else if (showDetail.value) {
// // 回显历史签约详情
// setFormValue(detailData.value, processedData)
// return
// } else {
// // 新增给默认值
// form.value['isReferrerAccompany'] = form.value['isOpenAccount'] = form.value['isUseCar'] = 0
// processedAppointmentData.value = processedData
// }
// setFormValue(props.detailInfo, processedData)
}
//弹出右侧抽屉
......@@ -1245,7 +1232,9 @@ const setFormValue = (obj, formData) => {
}
// 给表单表格赋值
for (const objKey in obj) {
if (objKey == section.key && section.keyType == 'Array' && obj[section.key].length > 0) {
if (objKey == section.key && section.keyType == 'Array') {
console.log('key', section.key, obj[section.key])
section.data = obj[section.key]
}
}
......@@ -1380,6 +1369,9 @@ const setFormValue = (obj, formData) => {
processedAppointmentData.value = oldAppointmentData.value = processedData
oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
console.log('form.value', form.value)
console.log('====================================')
console.log('详情', processedAppointmentData.value)
console.log('====================================')
}
// 数组去重
function removeDuplicates(arr, key) {
......@@ -1557,7 +1549,8 @@ watch(
}
)
if (Object.keys(props.detailInfo).length > 0) {
processFormData()
// processFormData()
setFormValue(props.detailInfo, appointmentDomData)
}
// 暴露给父组件
defineExpose({
......
......@@ -388,11 +388,6 @@
<template #table>
<el-table v-loading="tableLoading" :data="tableData" border>
<el-table-column label="创建人" align="center" prop="creatorName" />
<!-- <el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :options="fetchDictData('sys_gender')" :value="scope.row.gender" />
</template>
</el-table-column> -->
<el-table-column label="创建时间" align="center" prop="createTime">
<template #default="scope">
......@@ -626,6 +621,11 @@ function getItineraryInfo() {
appointmentSummeryInfo.value.meetingPoint = item.label
}
})
fetchDictData('bx_currency_type').forEach(item => {
if (item.value == appointmentSummeryInfo.value.currency) {
appointmentSummeryInfo.value.currency = item.label
}
})
if (appointmentSummeryInfo.value.total) {
appointmentSummeryInfo.value.total = Number(appointmentSummeryInfo.value.total).toFixed(2)
}
......@@ -663,9 +663,11 @@ function getItineraryInfo() {
},
{
label: '联系电话',
value: appointmentSummeryInfo.value.businessRepresentMobile1
value: appointmentSummeryInfo.value.businessRepresentMobile1Code
? appointmentSummeryInfo.value.businessRepresentMobile1Code +
appointmentSummeryInfo.value.businessRepresentMobile1
: appointmentSummeryInfo.value.businessRepresentMobile1
? appointmentSummeryInfo.value.businessRepresentMobile1
: '-',
span: 12 // 占12/24
}
......@@ -773,11 +775,11 @@ const handleExprot = async row => {
}
const changePageNo = val => {
queryParams.value.pageNo = val
// getList()
viewHistory()
}
const changePageSize = val => {
queryParams.value.pageSize = val
// getList()
viewHistory()
}
const timeValueChange = child => {
if (form.value[child.key]) {
......@@ -1037,11 +1039,11 @@ const fetchDictData = dictType => {
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == dictType) {
// options = item.dictItemList
if (dictType == 'sys_no_yes') {
item.dictItemList.forEach(item1 => {
item1.value = Number(item1.value)
})
}
// if (dictType == 'sys_no_yes') {
// item.dictItemList.forEach(item1 => {
// item1.value = Number(item1.value)
// })
// }
options = item.dictItemList
}
})
......@@ -1075,6 +1077,8 @@ const processFormData = async () => {
}
if (section.data) {
for (const field of section.data) {
// 给默认值赋值
if (section.key == 'openAccount') {
openAccountKey.value[field.key] = field.key
}
......@@ -1090,35 +1094,37 @@ const processFormData = async () => {
}
if (field.required) {
if (field.key === 'firstNamePinyin') {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' },
{ validator: validateEnglish, trigger: 'change' }
]
} else {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
// 新增赋默认值
if (
!props.idsObj.appointmentBizId &&
(field.key == 'isUseCar' ||
field.key == 'isOpenAccount' ||
field.key == 'isReferrerAccompany')
) {
field.options.forEach(item => {
if (item.value == '0') {
form.value[field.key] = item.value
}
})
}
}
}
}
console.log('searchOptions.value', searchOptions.value)
// 编辑状态下回显值
if (props.idsObj.appointmentBizId) {
setFormValue(props.apiAppointmentInfoDto, processedData)
return
} else if (showDetail.value) {
// 回显历史签约详情
setFormValue(detailData.value, processedData)
return
} else {
// 新增给默认值
form.value['isReferrerAccompany'] = form.value['isOpenAccount'] = form.value['isUseCar'] = 0
processedAppointmentData.value = processedData
console.log('processedAppointmentData.value', processedAppointmentData.value)
}
console.log('processedAppointmentData.value', processedAppointmentData.value)
console.log('form.value', form.value)
}
//弹出右侧抽屉
......@@ -1383,6 +1389,9 @@ const setFormValue = (obj, formData) => {
field.finishTime = obj[field.key]
}
if (field.dictType == 'sys_no_yes') {
form.value[field.key] = String(form.value[field.key])
}
//要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) {
case 'phone':
......@@ -1664,12 +1673,17 @@ watch(showDetail, newVal => {
detailInfo.value = {}
}
})
const hasLoaded = ref(false) // 新增:是否已加载过数据
watch(
() => props.activeName,
newVal => {
appointmentRef.value = null
if (newVal === 'appointmentInfo') {
if (!hasLoaded.value) {
processFormData()
hasLoaded.value = true
}
showDetail.value = false
openList.value = false
}
......
......@@ -540,6 +540,11 @@ const fetchDictData = dictType => {
try {
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == dictType) {
if (dictType == 'sys_no_yes') {
item.dictItemList.forEach(item1 => {
item1.value = Number(item1.value)
})
}
options = item.dictItemList
}
})
......@@ -580,19 +585,6 @@ const processFormData = async obj => {
}
}
}
if (
tempBeneficiaryDomData.value.length > 0 &&
!props.idsObj.appointmentBizId &&
props.pageSource == 'fnaList'
) {
form.value = { ...tempBeneficiaryForm.value }
saveKey.value = { ...tempSaveKey.value }
addressQuickList.value = JSON.parse(JSON.stringify(tempAddressQuickList.value))
phoneQuickList.value = JSON.parse(JSON.stringify(tempPhoneQuickList.value))
processedBeneficiaryData.value = JSON.parse(JSON.stringify(tempBeneficiaryDomData.value))
} else {
processedBeneficiaryData.value = oldAppointmentData.value = processedData
}
if (props.idsObj.appointmentBizId) {
setFormValue(processedData)
} else {
......@@ -862,6 +854,8 @@ const setFormValue = processedData => {
}
}
processedBeneficiaryData.value = oldDom
console.log('受益人表单', form.value)
console.log('dom', processedBeneficiaryData.value)
}
// 获取校验失败的字段信息
const getInvalidFields = fields => {
......@@ -882,7 +876,6 @@ const handleFormValues = () => {
return new Promise(async resolve => {
if (processedBeneficiaryData.value.length > 0) {
let submitObj = { ...form.value }
// 因为投保人没有policyholderRel的校验会影响 受保人,所以暂时先赋值处理
proxy.$refs['beneficiaryInfoFormRef'].validate((valid, fields) => {
if (valid) {
......@@ -941,29 +934,19 @@ const resetForm = () => {
.catch(() => {})
}
const hasLoaded = ref(false) // 新增:是否已加载过数据
watch(
() => props.activeName,
newVal => {
// 切换tab的时侯把表单值保存在临时变量里,方便切换回来的时候回显
tempBeneficiaryForm.value = { ...form.value }
tempSaveKey.value = { ...saveKey.value }
tempAddressQuickList.value = JSON.parse(JSON.stringify(addressQuickList.value))
tempPhoneQuickList.value = JSON.parse(JSON.stringify(phoneQuickList.value))
tempBeneficiaryDomData.value = JSON.parse(JSON.stringify(processedBeneficiaryData.value))
if (newVal === 'beneficiary') {
openList.value = false
if (!hasLoaded.value) {
processFormData({
domdata: beneficiaryDomData,
exportValue: null
})
// if (props.idsObj.appointmentBizId) {
// setFormValue()
// } else {
// // 新增状态
// }
hasLoaded.value = true
}
}
}
)
......
......@@ -388,12 +388,7 @@ const handleFormValues = () => {
proxy.$refs['heathFormRef'].validate((valid, fields) => {
if (valid) {
errorFields.value = [] // 清空错误信息
if (props.activeName == 'questionnaires') {
submitObj = JSON.parse(JSON.stringify(form.value))
} else {
submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
}
let answerSessionsDtoList = []
if (submitObj.length > 0) {
......
......@@ -587,6 +587,11 @@ const fetchDictData = dictType => {
try {
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == dictType) {
if (dictType == 'sys_no_yes') {
item.dictItemList.forEach(item1 => {
item1.value = Number(item1.value)
})
}
options = item.dictItemList
}
})
......
......@@ -394,6 +394,11 @@ const fetchDictData = dictType => {
try {
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == dictType) {
if (dictType == 'sys_no_yes') {
item.dictItemList.forEach(item1 => {
item1.value = Number(item1.value)
})
}
options = item.dictItemList
}
})
......@@ -733,7 +738,7 @@ const resetForm = () => {
.catch(() => {})
}
const hasLoaded = ref(false) // 新增:是否已加载过数据
watch(
() => props.activeName,
newVal => {
......@@ -742,6 +747,7 @@ watch(
if (newVal === 'secondHolder') {
openList.value = false
if (!hasLoaded.value) {
if (props.idsObj.appointmentBizId) {
processFormData({
domdata: secondHolderDomData,
......@@ -755,6 +761,8 @@ watch(
exportValue: null
})
}
hasLoaded.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