Commit f1a17490 by yuzhenWang

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

修改流程2

See merge request !9
parents e731143c eb5a516b
......@@ -24,7 +24,7 @@ const appointmentInfo = [
label: '预约时间',
key: 'confirmAppointmentTime',
domType: 'datetimePicker',
required: true,
required: false,
disabled: true,
placeholder: '请选择',
show: false,
......
......@@ -377,7 +377,7 @@ const beneficiary = [
showMoudle: true, //模块是否展示
data: [
{
label: '受益比',
label: '受益比',
key: 'benefitRatio',
customerKey: 'idCard',
domType: 'Input',
......
......@@ -4,36 +4,36 @@ const customer = [
type: 'object',
key: 'personInfo',
data: [
{
label: '姓氏',
key: 'lastName',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 5,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '名字',
key: 'firstName',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 10,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '姓氏',
// key: 'lastName',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 5,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '名字',
// key: 'firstName',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 10,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '姓名',
key: 'name',
......@@ -49,36 +49,36 @@ const customer = [
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '姓氏拼音',
key: 'lastNamePinyin',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '姓名拼音',
key: 'pinyin',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '姓氏拼音',
// key: 'lastNamePinyin',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '姓名拼音',
// key: 'pinyin',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '名字-英文',
key: 'firstNamePinyin',
......@@ -126,7 +126,7 @@ const customer = [
label: '生日',
key: 'birthdate',
type: 'DatePicker',
required: false,
required: true,
disabled: false,
placeholder: '请选择',
show: true,
......@@ -142,7 +142,7 @@ const customer = [
inputType: 'number',
maxLength: 30,
required: true,
disabled: false,
disabled: true,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
......@@ -251,7 +251,7 @@ const customer = [
type: 'Input',
inputType: 'text',
maxLength: 300,
required: true,
required: false,
disabled: false,
placeholder: '请输入',
show: true,
......
......@@ -41,6 +41,7 @@
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
@change="handleInputChange(child)"
/>
<el-select
v-if="child.type === 'Select'"
......@@ -63,6 +64,9 @@
type="date"
:placeholder="child.placeholder"
:disabled="child.disabled"
:disabled-date="time => disabledDate(time, child)"
:default-value="defaultDisplayDate"
@change="handleDateChange(child)"
/>
<el-input
......@@ -180,6 +184,8 @@
</div>
</template>
<script setup name="customer">
import { calculateExactAge } from '@/utils/date'
import dayjs from 'dayjs'
import { ArrowRight } from '@element-plus/icons-vue'
import customerDomData from '@/formJson/customer'
import Country from '@/views/components/country'
......@@ -211,6 +217,10 @@ const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const tableLoading = ref(false)
const tableData = ref([])
const total = ref(0)
const customerRef = ref(null)
// / 计算默认显示的日期(18年前的今天)
const defaultDisplayDate = ref(dayjs().subtract(18, 'year').toDate())
// 地址组件菜单数据
const addressMenuList = ref([
{
......@@ -281,6 +291,34 @@ const data = reactive({
}
})
const { form, rules, processedCustomerData, queryParams, oldCustomerData } = toRefs(data)
const handleInputChange = child => {
if (
(child.key == 'lastName' || child.key == 'firstName') &&
form.value['lastName'] &&
form.value['firstName']
) {
form.value['name'] = form.value['lastName'] + form.value['firstName']
}
}
const handleDateChange = child => {
let age = null
if (child.key == 'birthdate') {
age = calculateExactAge(proxy.formatToDate(form.value.birthdate))
if (age >= 18) {
form.value.age = age
}
}
}
const disabledDate = (time, child) => {
if (child.key == 'birthdate') {
// 计算18年前的今天
const eighteenYearsAgo = dayjs().subtract(18, 'year')
// 禁用今天之后的日期和18年前的今天之后的日期
return time.getTime() > Date.now() || time.getTime() > eighteenYearsAgo.valueOf()
} else {
return time.getTime() > Date.now()
}
}
const resetCustomerList = () => {
queryParams.value = {
pageNo: 1,
......@@ -369,7 +407,7 @@ const processFormData = async () => {
}
if (props.customerBizId) {
field.disabled = true
} else {
} else if (field.key !== 'age') {
field.disabled = false
}
}
......@@ -437,6 +475,7 @@ const handleCloseDrawer = () => {
showCountryDrawer.value = false
drawerInfo.value = {}
}
// 点击了抽屉的确定
const confirmDrawer = info => {
// info 为抽屉返回的值
if (drawerInfo.value.type == 'arrowRight' && drawerInfo.value.drawerType) {
......@@ -465,8 +504,13 @@ const confirmDrawer = info => {
default:
break
}
// 手动触发表单验证
nextTick(() => {
// 根据不同的drawerType确定要验证的字段key
const validateField = drawerInfo.value.key
customerRef.value.clearValidate(validateField)
})
}
console.log('saveKey.value', saveKey.value)
handleCloseDrawer()
}
......@@ -505,8 +549,6 @@ const handleSelectChange = child => {
// 改变编辑状态
const handleEditStatus = () => {
editStatus.value = !editStatus.value
console.log('触发了编辑状态', editStatus.value)
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(processedCustomerData.value))
for (const section of processedData) {
......@@ -514,7 +556,7 @@ const handleEditStatus = () => {
for (const field of section.data) {
if (editStatus.value) {
field.disabled = true
} else {
} else if (field.key !== 'age') {
field.disabled = false
}
}
......@@ -627,6 +669,15 @@ const setFormValue = (obj, formData, exportValue) => {
}
}
})
if (form.value['birthdate']) {
let age = calculateExactAge(proxy.formatToDate(form.value.birthdate))
if (age >= 18) {
form.value.age = age
}
} else {
form.value.age = null
}
console.log('form.value回填', form.value)
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
......@@ -760,7 +811,7 @@ const resetForm = () => {
.catch(() => {})
}
// 获取流程详情
// 获取客户详情
function getCustomerInfo(customerBizId, formData) {
getCustomerDetail(customerBizId).then(async res => {
if (res.code == 200) {
......
......@@ -106,6 +106,7 @@
:fnaFormBizId="processInfo.fnaFormBizId"
:customerBizId="processInfo.customerBizId"
:dictTypeLists="dictTypeLists"
:customerInfo="customerInfo"
@handleSuccess="handleSuccess"
/>
</div>
......@@ -130,7 +131,7 @@
import AppointmentEdit from '@/views/sign/appointment/appointmentEdit'
import useUserStore from '@/store/modules/user'
import useDictStore from '@/store/modules/dict'
import { addFna, getProcessDetail, updateProcess } from '@/api/sign/fna'
import { addFna, getProcessDetail, updateProcess, getCustomerDetail } from '@/api/sign/fna'
import { listTenantUser, getInsuranceProductList, getAdditionalProductList } from '@/api/common'
import Customer from './components/customer'
import FanForm from './components/fanForm'
......@@ -151,6 +152,7 @@ const processInfo = ref({
}) // 流程详情信息
const updateStatus = ref(false)
const dictTypeLists = ref([])
const customerInfo = ref({})
const tabsList = ref([
{
label: '总览',
......@@ -314,6 +316,9 @@ function getProcessInfo(fnaBizId, changeTab) {
}
// Tab切换前的验证
const beforeTabLeave = (activeTabName, oldTabName) => {
if (processInfo.value.customerBizId) {
getCustomerInfo(processInfo.value.customerBizId)
}
// 如果切换到总览,始终允许
if (activeTabName === 'overview' || activeTabName === 'customer') {
return true
......@@ -372,6 +377,14 @@ if (route.query.type == 'add') {
getProcessInfo(route.query.fnaBizId)
}, 100)
}
// 获取客户详情
function getCustomerInfo(customerBizId) {
getCustomerDetail(customerBizId).then(async res => {
if (res.code == 200) {
customerInfo.value = res.data
}
})
}
const handleSuccess = info => {
switch (info.tab) {
case 'customer':
......@@ -384,7 +397,7 @@ const handleSuccess = info => {
} else {
processUpdate({ fnaBizId: processInfo.value.fnaBizId, customerBizId: info.customerBizId })
}
getCustomerInfo(info.customerBizId)
break
case 'fnaform':
if (info.type == 'add') {
......
......@@ -80,15 +80,9 @@
@selection-change="tableSelect"
@sort-change="sortChange"
>
<el-table-column type="selection" width="55" />
<el-table-column type="index" width="50" />
<el-table-column label="流程编号" align="center" prop="fnaNo" width="200" />
<el-table-column label="预约编号" align="center" prop="appointmentNo" width="200" />
<el-table-column label="新单编号" align="center" prop="policyId" />
<el-table-column label="保单号" align="center" prop="policyNo" width="150" />
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column type="index" width="50" label="序号" />
<el-table-column label="客户姓名" align="center" prop="customerName" width="100" />
<el-table-column label="状态" align="center" width="150">
<template #default="scope">
<span v-if="scope.row.status == 'UNCOMPLETED'">
......@@ -102,6 +96,11 @@
</span>
</template>
</el-table-column>
<el-table-column label="流程编号" align="center" prop="fnaNo" width="200" />
<el-table-column label="预约编号" align="center" prop="appointmentNo" width="200" />
<el-table-column label="新单编号" align="center" prop="policyId" />
<el-table-column label="保单号" align="center" prop="policyNo" width="150" />
<el-table-column label="创建时间" sortable align="center" prop="createTime" width="200">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
......@@ -115,13 +114,9 @@
fixed="right"
>
<template #default="scope">
<el-button type="primary" @click="handleUpdate(scope.row)">修改</el-button>
<el-button type="success" @click="handleCopy(scope.row)">生成副本</el-button>
<!-- v-if="scope.row.status == 'COMPLETED'" -->
<el-button
v-if="scope.row.status == 'COMPLETED'"
type="danger"
@click="handleDelete(scope.row)"
<el-button type="primary" link @click="handleUpdate(scope.row)">修改</el-button>
<el-button type="success" link @click="handleCopy(scope.row)">生成副本</el-button>
<el-button v-if="!scope.row.policyNo" type="danger" link @click="handleDelete(scope.row)"
>删除</el-button
>
</template>
......
......@@ -124,6 +124,7 @@
:idsObj="idsObj"
:apiSecondHolderInfoDto="appointmentSummeryInfo.apiSecondHolderInfoDto"
:appointmentStatus="appointmentSummeryInfo.status"
:customerInfo="customerInfo"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="secondHolderInfoRef"
/>
......@@ -468,6 +469,7 @@ function getAppointmentInfo(appointmentBizId, changeTab) {
processInfo.value.status = item.label
}
})
getCustomerInfo(res.data.apiAppointmentInfoDto.customerBizId)
if (!appointmentSummeryInfo.value.apiAppointmentInfoDto.appointmentBizId) {
showStorage.value = true
}
......@@ -744,9 +746,7 @@ watch(
if (!idsObj.value.appointmentBizId) {
formStatus.value = 'appointmentAdd'
getCustomerInfo(props.processDetail.customerBizId)
// if (idsObj.value.appointmentBizId) {
// getAppointmentInfo(idsObj.value.appointmentBizId)
// }
tabsList.value = [
{
label: '预约信息',
......@@ -867,12 +867,14 @@ watch(
}
]
}
nextTick(() => {
activeName.value = 'appointmentInfo'
})
}
}
)
onUnmounted(() => {
console.log('预约编辑页面完全销毁')
......
......@@ -64,6 +64,7 @@
:placeholder="child.placeholder"
:disabled="child.disabled"
@change="handleDateChange(child)"
:disabled-date="time => disabledDate(time, child)"
format="YYYY-MM-DD HH:mm"
value-format="YYYY-MM-DD HH:mm:ss"
/>
......@@ -151,6 +152,7 @@
</div>
</template>
<script setup name="appointmentInfo">
import dayjs from 'dayjs'
import { ArrowRight } from '@element-plus/icons-vue'
import appointmentDomData from '@/formJson/appointmentInfo'
import Country from '@/views/components/country'
......@@ -256,6 +258,25 @@ const data = reactive({
}
})
const { form, rules, processedAppointmentData, queryParams, oldAppointmentData } = toRefs(data)
const disabledDate = (time, child) => {
// 获取“今天”的日期,并将其时间部分设置为 00:00:00
const today = dayjs().startOf('day') // :cite[7]
// 将传入的 timestamp 转换为 dayjs 对象
const inputDate = dayjs(time)
// 可以根据参数调整逻辑
if (child.key == 'intentionAppointmentTime') {
// 默认禁用今天及今天之前 (使用 isBefore 或 isSame)
return inputDate.isBefore(today, 'day') || inputDate.isSame(today, 'day') // :cite[3]
// 如果允许选择今天,只禁用今天之前的日期 (使用 isBefore)
// return inputDate.isBefore(today, 'day') // :cite[3]
} else {
// 如果允许选择今天,只禁用今天之前的日期 (使用 isBefore)
return inputDate.isBefore(today, 'day') // :cite[3]
// return time.getTime() > Date.now()
}
}
const handleButtonClick = child => {
if (child.key == 'newPolicyButton') {
let obj = {
......
......@@ -218,6 +218,7 @@ const props = defineProps({
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
const insuredInfoFormRef = ref(null)
const showPhoneDrawer = ref(false) //电话抽屉开关
const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关
......@@ -665,11 +666,7 @@ const confirmDrawer = info => {
// info 为抽屉返回的值
if (drawerInfo.value.domType == 'arrowRight' && drawerInfo.value.drawerType) {
let newObj = info[drawerInfo.value.key]
// if (form.value['customerType'] == 'COMPANY') {
// newObj.fatherKey = 'company'
// } else if (form.value['customerType'] == 'INDIVIDUAL') {
// newObj.fatherKey = 'person'
// }
//要判断drawerType
switch (drawerInfo.value.drawerType) {
case 'phone':
......@@ -692,6 +689,12 @@ const confirmDrawer = info => {
default:
break
}
// 手动触发表单验证
nextTick(() => {
// 根据不同的drawerType确定要验证的字段key
const validateField = drawerInfo.value.key
insuredInfoFormRef.value.clearValidate(validateField)
})
}
handleCloseDrawer()
......
......@@ -218,6 +218,7 @@ const props = defineProps({
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
const policyholderInfoFormRef = ref(null)
const showPhoneDrawer = ref(false) //电话抽屉开关
const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关
......@@ -609,10 +610,9 @@ const processFormData = async obj => {
//弹出右侧抽屉
const handleFoucs = child => {
if (child.disabled) return
console.log('saveKey.value', saveKey.value)
console.log('child', child)
drawerInfo.value = JSON.parse(JSON.stringify(child))
switch (child.drawerType) {
case 'phone':
phoneMenuList.value[0].key = child.code
......@@ -687,6 +687,12 @@ const confirmDrawer = info => {
default:
break
}
// 手动触发表单验证
nextTick(() => {
// 根据不同的drawerType确定要验证的字段key
const validateField = drawerInfo.value.key
policyholderInfoFormRef.value.clearValidate(validateField)
})
}
handleCloseDrawer()
......
......@@ -42,6 +42,7 @@
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
@input="handleInputChange(father, child)"
/>
<el-select
v-if="child.domType === 'Select'"
......@@ -200,6 +201,7 @@ const props = defineProps({
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) } //客户详情回显表单用
})
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
......@@ -208,7 +210,6 @@ const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关
const drawerInfo = ref({}) // 用于存储所有arrowRight类型的输入框输入值
const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const tempSaveKey = ref({}) // 用于tab切换的时候保存一份临时的值,防止切换的时候数据丢失
const errorFields = ref([]) // 存储校验失败的字段信息
const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const openList = ref(false) // 客户列表弹窗
......@@ -366,13 +367,11 @@ const fetchDictData = dictType => {
}
}
// 添加英文校验函数
const validateEnglish = (rule, value, callback) => {
const validateEnglish = (value, key) => {
if (value && !/^[A-Za-z]*$/.test(value)) {
// 清空非英文字符
form.value.firstNamePinyin = ''
callback(new Error('只能输入英文字母'))
} else {
callback()
form.value[key] = ''
proxy.$modal.msgError('请输入英文字符')
}
}
......@@ -420,12 +419,6 @@ const processFormData = async obj => {
if (props.idsObj.appointmentBizId) {
field.disabled = true
} else {
if (field.key == 'age') {
field.disabled = true
} else {
field.disabled = false
}
}
}
}
......@@ -558,53 +551,37 @@ const resetShow = obj => {
}
}
const handleSelectChange = (father, child) => {
const processData = JSON.parse(JSON.stringify(processedSecondHolderData.value))
for (const section of processData) {
switch (child.key) {
case 'customerType':
if (form.value[child.key] == 'COMPANY') {
showContacts.value = false
for (const section of processedSecondHolderData.value) {
if (section.key == 'company') {
for (const key1 in saveKey.value) {
for (const key2 in commonObj.value) {
if (key1 == key2) {
saveKey.value[key1]['fatherKey'] = section.key
}
}
case 'insurantRel':
for (const field of section.data) {
for (const key1 in field) {
for (const key2 in props.customerInfo) {
//当选择得关系是本人 用dom得key和用户信息得key做对比,给表单赋值
if (key1 == 'customerKey' && field[key1] == key2) {
form.value[field.key] = props.customerInfo[key2]
}
section.showMoudle = true
} else if (section.key !== 'customer') {
section.showMoudle = false
}
}
} else {
showContacts.value = true
for (const section of processedSecondHolderData.value) {
if (section.key == 'company') {
section.showMoudle = false
} else {
section.showMoudle = true
}
if (form.value['birthTime']) {
let age = calculateExactAge(proxy.formatToDate(form.value.birthTime))
if (age >= 0) {
form.value.age = age
}
}
break
case 'smokingAllowed':
// 选择吸烟,展示吸烟数量
if (form.value[child.key] == '1') {
resetShow({ type: 'child', key: 'smokingVolume', status: true })
} else {
resetShow({ type: 'child', key: 'smokingVolume', status: false })
}
default:
break
case 'isVip':
// 选择vip,展示vip备注
if (form.value[child.key] == '1') {
resetShow({ type: 'child', key: 'vipRemark', status: true })
} else {
resetShow({ type: 'child', key: 'vipRemark', status: false })
}
}
}
const handleInputChange = (father, child) => {
switch (child.key) {
case 'nameEn':
validateEnglish(form.value[child.key], child.key)
break
default:
......@@ -623,7 +600,7 @@ const handleEditStatus = status => {
for (const field of section.data) {
if (editStatus.value) {
field.disabled = true
} else {
} else if (field.key !== 'age') {
field.disabled = false
}
}
......@@ -732,10 +709,6 @@ watch(
exportValue: null
})
}, 500)
// processFormData({
// domdata: secondHolderDomData,
// exportValue: null
// })
}
}
)
......
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