Commit 17384168 by yuzhenWang

做到了预约列表发布测试

parent 6bbe241c
...@@ -197,3 +197,19 @@ export function uploadOssFileList(data) { ...@@ -197,3 +197,19 @@ export function uploadOssFileList(data) {
method: 'post' method: 'post'
}) })
} }
// 提交附件
export function uploadOssFileSubmit(data) {
return request({
url: '/oss/api/relObjectMaterial/upload/submit',
data: data,
method: 'post'
})
}
// 下载材料包
export function downloadCompressedFile(data) {
return request({
url: '/oss/api/material/download/compressed/file',
data: data,
method: 'post'
})
}
...@@ -223,3 +223,34 @@ export function delSigleAppointment(appointmentBizId) { ...@@ -223,3 +223,34 @@ export function delSigleAppointment(appointmentBizId) {
}) })
} }
// 签约历史记录列表
export function getAppointmentlog(data) {
return request({
url: '/csf/api/appointment/log/page',
method: 'post',
data: data
})
}
// 查看签约历史记录详情
export function getAppointmentlogDetail(appointmentLogBizId) {
return request({
url: '/csf/api/appointment/log/detail?appointmentLogBizId=' + appointmentLogBizId,
method: 'get'
})
}
// 编辑状态预约暂存
export function appointmentEditStorage(data) {
return request({
url: '/csf/api/appointment/edit/storage',
method: 'put',
data: data
})
}
// 编辑状态预约取消申请
export function appointmentEditStatus(data) {
return request({
url: '/csf/api/appointment/edit/status',
method: 'put',
data: data
})
}
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<!-- 取消按钮 --> <!-- 取消按钮 -->
<el-button type="info" plain v-if="showCancle" @click="close">{{ cancleText }}</el-button> <el-button type="info" plain v-if="showCancle" @click="close">{{ cancleText }}</el-button>
<!-- 确认按钮 --> <!-- 确认按钮 -->
<el-button type="primary" v-if="showConfirm" @click="confirm">{{ <el-button :loading="confirmLoading" type="primary" v-if="showConfirm" @click="confirm">{{
confirmText confirmText
}}</el-button> }}</el-button>
</div> </div>
...@@ -81,6 +81,11 @@ const props = defineProps({ ...@@ -81,6 +81,11 @@ const props = defineProps({
center: { center: {
type: Boolean, type: Boolean,
default: true default: true
},
// 打开弹窗
confirmLoading: {
type: Boolean,
default: false
} }
}) })
const showDialog = ref(props.openDialog) const showDialog = ref(props.openDialog)
...@@ -115,7 +120,7 @@ watch( ...@@ -115,7 +120,7 @@ watch(
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 15px 0; padding: 15px 0;
color: rgba(0,0,0,0.9); color: rgba(0, 0, 0, 0.9);
} }
.content { .content {
padding: 0 15px; padding: 0 15px;
...@@ -127,5 +132,4 @@ watch( ...@@ -127,5 +132,4 @@ watch(
align-items: center; align-items: center;
padding: 20px 0; padding: 20px 0;
} }
</style> </style>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<el-card class="cardStyle"> <el-card class="cardStyle">
<el-row> <el-row>
<!-- 按钮区域 --> <!-- 按钮区域 -->
<el-col :span="24" class="operationBtn"> <el-col :span="24" class="operationBtn" v-if="showOperationBtn">
<div class="operationLeft"> <div class="operationLeft">
<!-- 左侧按钮 --> <!-- 左侧按钮 -->
<template v-for="btn in leftButtons" :key="btn.key || btn.label"> <template v-for="btn in leftButtons" :key="btn.key || btn.label">
...@@ -131,6 +131,8 @@ interface Props { ...@@ -131,6 +131,8 @@ interface Props {
showSearchForm?: boolean showSearchForm?: boolean
// 是否显示分页 // 是否显示分页
showPagination?: boolean showPagination?: boolean
// 是否显示操作按钮
showOperationBtn?: boolean
// 总条数 // 总条数
total?: number total?: number
// 当前页码 // 当前页码
...@@ -153,6 +155,7 @@ const props = withDefaults(defineProps<Props>(), { ...@@ -153,6 +155,7 @@ const props = withDefaults(defineProps<Props>(), {
operationBtnList: () => [], operationBtnList: () => [],
showSearchForm: true, showSearchForm: true,
showPagination: false, showPagination: false,
showOperationBtn: true,
total: 0, total: 0,
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
...@@ -489,6 +492,5 @@ onMounted(() => { ...@@ -489,6 +492,5 @@ onMounted(() => {
.cardStyle { .cardStyle {
margin-bottom: 8px; margin-bottom: 8px;
} }
} }
</style> </style>
...@@ -22,8 +22,8 @@ const appointmentInfo = [ ...@@ -22,8 +22,8 @@ const appointmentInfo = [
lg: 8 //栅格布局份数 lg: 8 //栅格布局份数
}, },
{ {
label: '意向签单日', label: '签单日',
key: 'intentionAppointmentTime', key: 'signDate',
domType: 'DatePicker', domType: 'DatePicker',
required: true, required: true,
disabled: false, disabled: false,
...@@ -76,58 +76,6 @@ const appointmentInfo = [ ...@@ -76,58 +76,6 @@ const appointmentInfo = [
sm: 12, //栅格布局份数 sm: 12, //栅格布局份数
lg: 8 //栅格布局份数 lg: 8 //栅格布局份数
} }
// {
// label: '预约时间',
// key: 'confirmAppointmentTime',
// domType: 'datetimePicker',
// required: false,
// disabled: true,
// placeholder: '请选择',
// show: false,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: ' ',
// key: 'newPolicyButton',
// domType: 'button',
// buttonTxt: '生成新单跟进记录',
// buttonType: 'primary',
// required: false,
// maxLength: 10,
// disabled: false,
// show: false,
// // labelPosition: 'top', //标签的位置
// labelWidth: '0px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// }
]
},
// 陪同转介人信息
{
fatherTitle: '陪同转介人',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'referrerDtoList',
anchorKey: 'referrerDtoList',
moudleType: 'referrerDtoList',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showTable: true,
showMoudle: false, //模块是否展示
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '陪同转介人', //新增按钮得文本
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
isOpen: false, //dom是否展开
data: [
// {
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// span: 24, //栅格布局份数
// email: '',
// phone: '',
// realName: ''
// }
] ]
}, },
// 到港信息 // 到港信息
...@@ -145,7 +93,7 @@ const appointmentInfo = [ ...@@ -145,7 +93,7 @@ const appointmentInfo = [
dateValue: '', //YYYY-MM-DD dateValue: '', //YYYY-MM-DD
timeValue: '', //HH:mm timeValue: '', //HH:mm
compositionTime: true, //是否组合时间 compositionTime: true, //是否组合时间
finishTime: '',
required: false, required: false,
disabled: false, disabled: false,
placeholder: '请选择', placeholder: '请选择',
...@@ -161,6 +109,7 @@ const appointmentInfo = [ ...@@ -161,6 +109,7 @@ const appointmentInfo = [
domType: 'datetimePicker', domType: 'datetimePicker',
dateValue: '', //YYYY-MM-DD dateValue: '', //YYYY-MM-DD
timeValue: '', //HH:mm timeValue: '', //HH:mm
finishTime: '',
compositionTime: true, //是否组合时间 compositionTime: true, //是否组合时间
required: false, required: false,
disabled: false, disabled: false,
...@@ -222,6 +171,31 @@ const appointmentInfo = [ ...@@ -222,6 +171,31 @@ const appointmentInfo = [
}, },
// 陪同转介人信息 // 陪同转介人信息
{ {
fatherTitle: '陪同转介人',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'referrerDtoList',
anchorKey: 'referrerDtoList',
moudleType: 'referrerDtoList',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showTable: true,
showMoudle: false, //模块是否展示
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '陪同转介人', //新增按钮得文本
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
isOpen: false, //dom是否展开
data: [
// {
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// span: 24, //栅格布局份数
// email: '',
// phone: '',
// realName: ''
// }
]
},
// 陪同转介人信息
{
fatherTitle: '签单员', fatherTitle: '签单员',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象 keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'userSignDtoList', key: 'userSignDtoList',
......
...@@ -39,7 +39,7 @@ const productPlan = [ ...@@ -39,7 +39,7 @@ const productPlan = [
}, },
{ {
label: '产品名称', label: '产品名称',
key: 'productLaunchName', key: 'productLaunchMainName',
domType: 'SearchSelect', domType: 'SearchSelect',
required: true, required: true,
maxLength: 30, maxLength: 30,
......
<template> <template>
<div class="formContainer"> <div class="formContainer">
<div class="formLeft" v-if="showAnchor"> <div class="formLeft" v-if="showAnchor && scrollContainerSelector">
<el-affix :offset="affixOffset"> <el-affix :offset="affixOffset">
<el-anchor <el-anchor
:direction="direction" :direction="direction"
......
...@@ -420,10 +420,14 @@ const handleRemoteSelectChange = async (row, column, father) => { ...@@ -420,10 +420,14 @@ const handleRemoteSelectChange = async (row, column, father) => {
} }
} }
if (column.prop == 'insuranceType' && row.insuranceType) { if (column.prop == 'insuranceType' && row.insuranceType) {
// 改变险种的时候逻辑还未处理
//如果险种选择了重疾险,则显示重疾险的输入框 //如果险种选择了重疾险,则显示重疾险的输入框
row.insuranceTypeOption.forEach(item => { row.insuranceTypeOption.forEach(item => {
if (item.value == row.insuranceType && item.code == 'CI') { if (item.value == row.insuranceType) {
row.showSumInsured = true if (item.code == 'CI') {
row.showSumInsured = true
}
row.insuranceType = item.label
} }
}) })
} }
...@@ -823,13 +827,13 @@ const submitForm = saveType => { ...@@ -823,13 +827,13 @@ const submitForm = saveType => {
} }
}) })
} }
if (item.insuranceType) { // if (item.insuranceType) {
item.insuranceTypeOption.forEach(item2 => { // item.insuranceTypeOption.forEach(item2 => {
if (item2.value == item.insuranceType) { // if (item2.value == item.insuranceType) {
item.insuranceType = item2.label // item.insuranceType = item2.label
} // }
}) // })
} // }
}) })
result[section.key] = section.data result[section.key] = section.data
} }
......
...@@ -131,7 +131,6 @@ import useDictStore from '@/store/modules/dict' ...@@ -131,7 +131,6 @@ import useDictStore from '@/store/modules/dict'
import { addFna, getProcessDetail, updateProcess, getCustomerDetail } from '@/api/sign/fna' import { addFna, getProcessDetail, updateProcess, getCustomerDetail } from '@/api/sign/fna'
import { import {
listTenantUser, listTenantUser,
getInsuranceProductList,
getAdditionalProductList, getAdditionalProductList,
getBankList, getBankList,
getUserSaleExpandList, getUserSaleExpandList,
...@@ -230,17 +229,6 @@ const getDictsData = async () => { ...@@ -230,17 +229,6 @@ const getDictsData = async () => {
pageSize: 10 pageSize: 10
} }
// const response2 = await getInsuranceProductList(params2)
// if (response2.code == 200) {
// response2.data.records = response2.data.records.map(item => {
// return {
// ...item,
// label: item.productName,
// value: item.productBizId
// }
// })
// dictStore.setInsureProductList(response2.data.records)
// }
const params3 = { const params3 = {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
...@@ -399,7 +387,7 @@ const processUpdate = (data, status) => { ...@@ -399,7 +387,7 @@ const processUpdate = (data, status) => {
} }
// 获取流程详情 // 获取流程详情
function getProcessInfo(fnaBizId, changeTab) { function getProcessInfo(fnaBizId, changeTab, currentTab) {
getProcessDetail(fnaBizId).then(res => { getProcessDetail(fnaBizId).then(res => {
if (res.code == 200) { if (res.code == 200) {
processInfo.value = res.data processInfo.value = res.data
...@@ -415,7 +403,9 @@ function getProcessInfo(fnaBizId, changeTab) { ...@@ -415,7 +403,9 @@ function getProcessInfo(fnaBizId, changeTab) {
processInfo.value.status = item.label processInfo.value.status = item.label
} }
}) })
if (changeTab) { if (currentTab == 'appointment' && changeTab == 'appointment') {
router.push({ path: '/sign/appointment' })
} else if (changeTab) {
activeName.value = changeTab activeName.value = changeTab
} }
} }
...@@ -524,7 +514,7 @@ const handleSuccess = info => { ...@@ -524,7 +514,7 @@ const handleSuccess = info => {
break break
case 'appointment': case 'appointment':
if (info.type == 'add') { if (info.type == 'add') {
getProcessInfo(processInfo.value.fnaBizId, 'newpolicy') getProcessInfo(processInfo.value.fnaBizId, 'appointment', 'appointment')
} else { } else {
} }
break break
......
...@@ -290,7 +290,13 @@ function handleAdd() { ...@@ -290,7 +290,13 @@ function handleAdd() {
function handleUpdate(row) { function handleUpdate(row) {
router.push({ router.push({
path: '/sign/FnaList/edit', path: '/sign/FnaList/edit',
query: { fnaBizId: row.fnaBizId, type: 'edit', status: row.status, source: 'fnaList' } query: {
fnaBizId: row.fnaBizId,
type: 'edit',
status: row.status,
source: 'fnaList',
appointmentBizId: row.appointmentBizId
}
}) })
} }
......
<template> <template>
<div class="uploadContainer"> <div class="uploadContainer">
<CardOne title="材料信息"> <CardOne title="材料信息">
<template #headerRight>
<div>
<el-button @click="downloadFile" type="primary" :loading="downLoading"
>下载材料包</el-button
>
</div>
</template>
<template #content> <template #content>
<el-table v-loading="loading" :data="fileTableList" boder> <el-table v-loading="loading" :data="fileTableList" boder>
<el-table-column label="序号" type="index" width="55" /> <el-table-column label="序号" type="index" width="55" />
...@@ -23,8 +30,8 @@ ...@@ -23,8 +30,8 @@
v-if="fileTableList.length > 0 && fileTableList[0].relObjectMaterialBizId" v-if="fileTableList.length > 0 && fileTableList[0].relObjectMaterialBizId"
> >
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.status === 1">已上传</span> <span v-if="scope.row.status === 'YSC'">已上传</span>
<span v-if="scope.row.status === 0" style="color: red">待上传</span> <span v-if="scope.row.status === 'WSC'" style="color: red">待上传</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -35,17 +42,16 @@ ...@@ -35,17 +42,16 @@
fixed="right" fixed="right"
> >
<template #default="scope"> <template #default="scope">
<!-- <el-button type="primary" link @click="downloadFile(scope.row)">下载</el-button> -->
<el-button <el-button
type="primary" type="primary"
link link
@click="handleUploadFile(scope.row)" @click="handleUploadFile(scope.row)"
v-if="scope.row.fileBizIdList.length == 0" v-if="scope.row.status == 'WSC'"
> >
上传 上传
</el-button> </el-button>
<el-button <el-button
v-if="props.pageSource !== 'policyList' && scope.row.fileBizIdList.length > 0" v-if="props.pageSource !== 'policyList' && scope.row.status == 'YSC'"
type="primary" type="primary"
link link
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
...@@ -135,7 +141,10 @@ import { ...@@ -135,7 +141,10 @@ import {
uploadMaterialList, uploadMaterialList,
delUploadFile, delUploadFile,
uploadRelObjectMaterialList, uploadRelObjectMaterialList,
uploadOssFileList uploadOssFileList,
uploadOssFileSubmit,
downloadCompressedFile,
delMaterial
} from '@/api/common' } from '@/api/common'
const props = defineProps({ const props = defineProps({
activeName: { type: String, default: '' }, //tab名称 activeName: { type: String, default: '' }, //tab名称
...@@ -156,7 +165,7 @@ const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + '/oss/api/oss/uploa ...@@ -156,7 +165,7 @@ const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + '/oss/api/oss/uploa
// 图片查看相关状态 // 图片查看相关状态
const imageViewerVisible = ref(false) const imageViewerVisible = ref(false)
const imageUrl = ref('') const imageUrl = ref('')
const tempFileTableList = ref([]) const downLoading = ref(false)
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
...@@ -170,11 +179,35 @@ const uploadedFiles = ref([]) ...@@ -170,11 +179,35 @@ const uploadedFiles = ref([])
const currentUploadRow = ref([]) const currentUploadRow = ref([])
const handleSubmitUpload = () => { const handleSubmitUpload = () => {
if (uploadedFiles.value.length > 0) { if (uploadedFiles.value.length > 0) {
fileTableList.value.forEach(item => { if (currentUploadRow.value.relObjectMaterialBizId) {
if (item.materialBizId == currentUploadRow.value.materialBizId) { try {
item.fileBizIdList = JSON.parse(JSON.stringify(uploadedFiles.value)) uploadOssFileSubmit({
relObjectMaterialBizId: currentUploadRow.value.relObjectMaterialBizId,
fileBizIdList: uploadedFiles.value.map(item => item.fileBizId)
}).then(response => {
getFileList()
// fileTableList.value.forEach(item => {
// if (item.materialBizId == currentUploadRow.value.materialBizId) {
// item.status = 'YSC'
// }
// })
editVisible.value = false
})
} catch (error) {
console.log('error', error)
uploadedFiles.value = []
proxy.$message.error('文件修改失败')
} }
}) } else {
fileTableList.value.forEach(item => {
if (item.materialBizId == currentUploadRow.value.materialBizId) {
item.fileBizIdList = JSON.parse(JSON.stringify(uploadedFiles.value))
item.status = 'YSC'
}
})
console.log('fileTableList.value', fileTableList.value)
}
} }
editVisible.value = false editVisible.value = false
} }
...@@ -212,15 +245,28 @@ const handleDetele = row => { ...@@ -212,15 +245,28 @@ const handleDetele = row => {
.confirm('是否确认删除此行数据?') .confirm('是否确认删除此行数据?')
.then(function () { .then(function () {
if (row.relObjectMaterialBizId) { if (row.relObjectMaterialBizId) {
console.log('远程删除')
return delMaterial(row.relObjectMaterialBizId) return delMaterial(row.relObjectMaterialBizId)
} else { } else {
fileTableList.value.splice(row.index, 1) // 本地临时数据,直接从列表中移除
const index = fileTableList.value.findIndex(
item => item.materialBizId === row.materialBizId
)
if (index !== -1) {
fileTableList.value.splice(index, 1)
}
// 注意:这里不需要 return Promise,因为是同步操作
// 但为了统一 then 链,可以 return 一个成功标识
return { code: 200 } // 模拟成功
} }
}) })
.then(res => { .then(res => {
if (res.code == 200) { if (res && res.code == 200) {
proxy.$modal.msgSuccess('删除成功') proxy.$modal.msgSuccess('删除成功')
getFileList() if (row.relObjectMaterialBizId) {
getFileList()
}
} }
}) })
.catch(() => {}) .catch(() => {})
...@@ -234,7 +280,7 @@ const handleUpdate = row => { ...@@ -234,7 +280,7 @@ const handleUpdate = row => {
if (row.relObjectMaterialBizId) { if (row.relObjectMaterialBizId) {
try { try {
uploadOssFileList({ objectBizId: row.relObjectMaterialBizId }).then(response => { uploadOssFileList({ objectBizId: row.relObjectMaterialBizId }).then(response => {
uploadedFiles.value = response.data uploadedFiles.value = response.data || []
editVisible.value = true editVisible.value = true
}) })
} catch (error) { } catch (error) {
...@@ -250,21 +296,65 @@ const handleView = row => { ...@@ -250,21 +296,65 @@ const handleView = row => {
imageUrl.value = row.fileUrl imageUrl.value = row.fileUrl
imageViewerVisible.value = true imageViewerVisible.value = true
} }
const downloadFile = row => { // 下载材料包
// 创建隐藏的下载链接 const downloadFile = () => {
const link = document.createElement('a') let apiMaterialDtoList = []
link.href = row.fileUrl let params = {
link.target = '_blank' // 新窗口打开 objectName: '预约附件材料包', //对象名(包名)
objectBizId: '' //对象业务ID
}
if (!props.idsObj.appointmentBizId) {
if (fileTableList.value.filter(item => item.fileBizIdList.length > 0).length == 0) {
proxy.$modal.msgError('请先上传文件')
return
}
apiMaterialDtoList = fileTableList.value.map(item => {
return {
dataPerson: item.dataPerson, //资料人(字典)
dataType: item.dataType, //资料类型(字典)
fileUrlList: item.fileBizIdList.map(item2 => item2.url) //文件url
}
})
} else {
if (fileTableList.value.filter(item => item.fileUrlList.length > 0).length == 0) {
proxy.$modal.msgError('请先上传文件')
return
}
apiMaterialDtoList = fileTableList.value.map(item => {
return {
dataPerson: item.dataPerson, //资料人(字典)
dataType: item.dataType, //资料类型(字典)
fileUrlList: item.fileUrlList
}
})
}
params.apiMaterialDtoList = apiMaterialDtoList
try {
downLoading.value = true
downloadCompressedFile(params).then(response => {
downLoading.value = false
// 创建隐藏的下载链接
const link = document.createElement('a')
link.href = response.data.url
link.target = '_blank' // 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const fileName = '预约材料包'
link.download = fileName
// 设置下载文件名(重要) // 触发下载
// 从URL中提取文件名,或者使用返回的文件名 document.body.appendChild(link)
const fileName = row.fileName link.click()
link.download = fileName document.body.removeChild(link)
})
} catch (error) {
console.log('error', error)
// 触发下载 proxy.$message.error('材料包下载失败')
document.body.appendChild(link) } finally {
link.click() downLoading.value = false
document.body.removeChild(link) }
} }
// 上传前loading加载 // 上传前loading加载
...@@ -322,6 +412,7 @@ const getFileList = () => { ...@@ -322,6 +412,7 @@ const getFileList = () => {
if (fileTableList.value.length > 0) { if (fileTableList.value.length > 0) {
fileTableList.value.forEach(item => { fileTableList.value.forEach(item => {
item.fileBizIdList = [] item.fileBizIdList = []
item.status = 'WSC'
}) })
} }
loading.value = false loading.value = false
...@@ -332,13 +423,10 @@ const getFileList = () => { ...@@ -332,13 +423,10 @@ const getFileList = () => {
objectBizId: props.idsObj.appointmentBizId objectBizId: props.idsObj.appointmentBizId
} }
uploadRelObjectMaterialList(obj).then(response => { uploadRelObjectMaterialList(obj).then(response => {
fileTableList.value = response.data fileTableList.value = response.data.records
loading.value = false loading.value = false
}) })
} }
if (tempFileTableList.value.length > 0) {
fileTableList.value = JSON.parse(JSON.stringify(tempFileTableList.value))
}
} catch (error) { } catch (error) {
fileTableList.value = [] fileTableList.value = []
} finally { } finally {
...@@ -348,12 +436,10 @@ const getFileList = () => { ...@@ -348,12 +436,10 @@ const getFileList = () => {
const handleFormValues = () => { const handleFormValues = () => {
let submitData = [] let submitData = []
fileTableList.value.forEach(item => { fileTableList.value.forEach(item => {
if (item.fileBizIdList.length > 0) { submitData.push({
submitData.push({ materialBizId: item.materialBizId,
materialBizId: item.materialBizId, fileBizIdList: item.fileBizIdList.map(item => item.fileBizId)
fileBizIdList: item.fileBizIdList.map(item => item.fileBizId) })
})
}
}) })
return submitData return submitData
} }
...@@ -363,12 +449,15 @@ watch(editVisible, newVal => { ...@@ -363,12 +449,15 @@ watch(editVisible, newVal => {
resetUploadedList() resetUploadedList()
} }
}) })
const hasLoaded = ref(false) // 新增:是否已加载过数据
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
tempFileTableList.value = JSON.parse(JSON.stringify(fileTableList.value))
if (newVal === 'accessories') { if (newVal === 'accessories') {
getFileList() if (!hasLoaded.value) {
getFileList()
hasLoaded.value = true
}
} }
} }
) )
......
...@@ -373,7 +373,7 @@ const getInvalidFields = fields => { ...@@ -373,7 +373,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `健康信息模块-${fields[field][0].message}`
}) })
} }
} }
...@@ -382,80 +382,86 @@ const getInvalidFields = fields => { ...@@ -382,80 +382,86 @@ const getInvalidFields = fields => {
// 处理表单填写得数据 // 处理表单填写得数据
const handleFormValues = () => { const handleFormValues = () => {
let submitObj = []
return new Promise(async resolve => { return new Promise(async resolve => {
proxy.$refs['heathFormRef'].validate((valid, fields) => { if (questionnairesDom.value.length > 0) {
if (valid) { proxy.$refs['heathFormRef'].validate((valid, fields) => {
errorFields.value = [] // 清空错误信息 if (valid) {
let submitObj = [] errorFields.value = [] // 清空错误信息
if (props.activeName == 'questionnaires') {
submitObj = JSON.parse(JSON.stringify(form.value))
console.log('1111', submitObj)
} else {
// submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
// console.log('2222', submitObj)
}
let answerSessionsDtoList = [] if (props.activeName == 'questionnaires') {
// 处理表单数据 submitObj = JSON.parse(JSON.stringify(form.value))
submitObj.forEach(level1 => { } else {
level1.secondCategoryDtoList.forEach(level2 => { submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
// 修正:应该是 questionsDtoList 而不是 questionDtoList }
if (level2.questionsDtoList && level2.questionsDtoList.length > 0) {
level2.questionsDtoList.forEach(level3 => { let answerSessionsDtoList = []
// 检查是否有答案数据和附加问题 if (submitObj.length > 0) {
// // 处理表单数据
if (level3.answerSessionsDto) { submitObj.forEach(level1 => {
// 问题选择了是 level1.secondCategoryDtoList.forEach(level2 => {
if ( // 修正:应该是 questionsDtoList 而不是 questionDtoList
level3.answerSessionsDto.optionJsonDtoList && if (level2.questionsDtoList && level2.questionsDtoList.length > 0) {
level3.answerSessionsDto.optionBizId && level2.questionsDtoList.forEach(level3 => {
level3.answerSessionsDto.optionBizId == 'option_1002' // 检查是否有答案数据和附加问题
) { //
level3.answerSessionsDto.optionJsonDtoList.forEach(level4 => { if (level3.answerSessionsDto) {
level4.addQuestionsJsonDtoList = JSON.parse( // 问题选择了是
JSON.stringify(level3.addQuestionsDtoList) if (
) level3.answerSessionsDto.optionJsonDtoList &&
}) level3.answerSessionsDto.optionBizId &&
} level3.answerSessionsDto.optionBizId == 'option_1002'
answerSessionsDtoList.push({ ) {
questionBizId: level3.questionBizId, level3.answerSessionsDto.optionJsonDtoList.forEach(level4 => {
...level3.answerSessionsDto level4.addQuestionsJsonDtoList = JSON.parse(
JSON.stringify(level3.addQuestionsDtoList)
)
})
}
answerSessionsDtoList.push({
questionBizId: level3.questionBizId,
...level3.answerSessionsDto
})
}
}) })
} }
}) })
} })
}) }
})
let objectBizId = '' let objectBizId = ''
if ( if (
props.idsObj.appointmentBizId && props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList') (props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) { ) {
objectBizId = props.idsObj.appointmentBizId objectBizId = props.idsObj.appointmentBizId
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') { } else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
objectBizId = props.idsObj.policyBizId objectBizId = props.idsObj.policyBizId
} }
resolve( resolve(
errorFields.value.length == 0 errorFields.value.length == 0
? { ? {
questionnaireBizId: 'questionnaires_1001', questionnaireBizId: 'questionnaires_1001',
objectBizId: objectBizId, objectBizId: objectBizId,
answerSessionsDtoList answerSessionsDtoList
} }
: null : null
) )
} else { } else {
// 获取校验失败的字段信息 // 获取校验失败的字段信息
errorFields.value = getInvalidFields(fields) errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) { if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message) proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
} }
} })
}) } else {
resolve(undefined)
}
}) })
} }
const getQuestionnairesInfo = () => { const getQuestionnairesInfo = () => {
loading.value = true loading.value = true
let id = '' let id = ''
...@@ -566,6 +572,7 @@ const getQuestionnairesInfo = () => { ...@@ -566,6 +572,7 @@ const getQuestionnairesInfo = () => {
questionnairesDom.value = form.value = result questionnairesDom.value = form.value = result
loading.value = false loading.value = false
console.log('questionnairesDom.value', questionnairesDom.value) console.log('questionnairesDom.value', questionnairesDom.value)
} }
}) })
...@@ -579,6 +586,7 @@ const anchorList = computed(() => { ...@@ -579,6 +586,7 @@ const anchorList = computed(() => {
} }
return data return data
}) })
const hasLoaded = ref(false) // 新增:是否已加载过数据
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
...@@ -586,14 +594,10 @@ watch( ...@@ -586,14 +594,10 @@ watch(
tempSecondHolderForm.value = { ...form.value } tempSecondHolderForm.value = { ...form.value }
if (newVal === 'questionnaires') { if (newVal === 'questionnaires') {
if ( if (!hasLoaded.value) {
props.idsObj.appointmentBizId && getQuestionnairesInfo()
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList') hasLoaded.value = true
) {
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
} }
getQuestionnairesInfo()
console.log('foldInsurantInfo', props.foldInsurantInfo)
} }
} }
) )
...@@ -603,7 +607,6 @@ defineExpose({ ...@@ -603,7 +607,6 @@ defineExpose({
handleFormValues, handleFormValues,
handleEditStatus, handleEditStatus,
questionLength: computed(() => { questionLength: computed(() => {
return questionnairesDom.value.length return questionnairesDom.value.length
}) })
}) })
......
...@@ -995,7 +995,7 @@ const getInvalidFields = fields => { ...@@ -995,7 +995,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `签约信息模块-${fields[field][0].message}`
}) })
} }
} }
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
v-if="child.domType === 'DatePicker'" v-if="child.domType === 'DatePicker'"
v-model="form[child.key]" v-model="form[child.key]"
type="date" type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
:placeholder="child.placeholder" :placeholder="child.placeholder"
:disabled="editStatus" :disabled="editStatus"
/> />
...@@ -240,6 +242,7 @@ const props = defineProps({ ...@@ -240,6 +242,7 @@ const props = defineProps({
fatherTabName: { type: String, default: '' }, //一级tab名称 fatherTabName: { type: String, default: '' }, //一级tab名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器 anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: false }, //编辑状态 editStatus: { type: Boolean, default: false }, //编辑状态
affixOffset: { type: Number },
tabIndex: { type: [String, Number], default: '' } //tab索引 tabIndex: { type: [String, Number], default: '' } //tab索引
}) })
...@@ -419,10 +422,19 @@ const processFormData = async obj => { ...@@ -419,10 +422,19 @@ const processFormData = async obj => {
form.value = {} form.value = {}
// 深拷贝原始数据 // 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(obj.domdata)) const processedData = JSON.parse(JSON.stringify(obj.domdata))
console.log('obj', obj)
for (const section of processedData) { for (const section of processedData) {
if (section.data) { if (section.data) {
for (const field of section.data) { for (const field of section.data) {
// 编辑状态下回显表单值
if (section.key == 'apiSecondHolderInfoDto' && props.idsObj.appointmentBizId) {
if (obj['detailInfo'] && obj['detailInfo']['isSecond'] == '0') {
section.showMoudle = false
} else {
section.showMoudle = true
}
}
if (field.dictType) { if (field.dictType) {
// 获取字典数据 // 获取字典数据
field.options = fetchDictData(field.dictType) field.options = fetchDictData(field.dictType)
...@@ -455,7 +467,7 @@ const processFormData = async obj => { ...@@ -455,7 +467,7 @@ const processFormData = async obj => {
) { ) {
form.value = { ...tempSecondHolderForm.value } form.value = { ...tempSecondHolderForm.value }
} }
if (props.showSubmitBtn) { if (props.idsObj.appointmentBizId) {
form.value = { ...props.apiSecondHolderInfoDto } form.value = { ...props.apiSecondHolderInfoDto }
} else { } else {
} }
...@@ -651,7 +663,7 @@ const getInvalidFields = fields => { ...@@ -651,7 +663,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `第二持有人模块-${fields[field][0].message}`
}) })
} }
} }
...@@ -661,79 +673,46 @@ const getInvalidFields = fields => { ...@@ -661,79 +673,46 @@ const getInvalidFields = fields => {
// 处理表单填写得数据 // 处理表单填写得数据
const handleFormValues = () => { const handleFormValues = () => {
return new Promise(async resolve => { return new Promise(async resolve => {
let submitObj = {} if (processedSecondHolderData.value.length > 0) {
if (props.activeName == 'secondHolder') { proxy.$refs['secondHolderFormRef'].validate((valid, fields) => {
submitObj = JSON.parse(JSON.stringify(form.value)) let submitObj = { ...form.value }
} else { // debugger
submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
}
proxy.$refs['secondHolderFormRef'].validate((valid, fields) => { console.log('form.value', form.value)
if (valid) { if (valid) {
errorFields.value = [] // 清空错误信息 errorFields.value = [] // 清空错误信息
if (submitObj.isSecond && submitObj.isSecond == '0') { if (form.value.isSecond == '0') {
for (const key in submitObj) { for (const key in submitObj) {
if (key !== 'isSecond') { if (key !== 'isSecond') {
submitObj[key] = '' submitObj[key] = ''
}
} }
} }
} submitObj['isSecond'] = form.value.isSecond
if (submitObj['birthday']) { if (submitObj['birthday']) {
submitObj['birthday'] = proxy.formatToDate(submitObj['birthday']) submitObj['birthday'] = proxy.formatToDateTime(submitObj['birthday'])
}
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
})
})
return submitObj
}
// 表单提交
const submitForm = () => {
proxy.$refs['secondHolderFormRef'].validate((valid, fields) => {
if (valid) {
let submitObj = handleFormValues()
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
editSecondHolderInfo(submitObj).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('第二持有人修改成功')
emit('handleSuccessEdit')
} }
}) if (errorFields.value.length > 0) {
} proxy.$message.error(errorFields.value[0].message)
if (props.idsObj.policyBizId && props.pageSource == 'policyList') { return undefined
// submitObj['policySecondHolderBizId'] = props.apiInsurantInfoDto.policySecondHolderBizId
// submitObj['policyBizId'] = props.apiInsurantInfoDto.policyBizId
// submitObj['id'] = props.apiInsurantInfoDto.id
updatePolicySecondHolder(submitObj).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('新单跟进-受保人修改成功')
emit('policyEditSuccess')
} }
}) if (props.idsObj.appointmentBizId) {
} submitObj['secondHolderBizId'] = props.apiSecondHolderInfoDto.secondHolderBizId
errorFields.value = [] // 清空错误信息 }
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
})
} else { } else {
// 获取校验失败的字段信息 if (props.idsObj.appointmentBizId) {
errorFields.value = getInvalidFields(fields) resolve(props.apiSecondHolderInfoDto)
if (errorFields.value.length > 0) { } else {
proxy.$message.error(errorFields.value[0].message) resolve(undefined)
} }
} }
}) })
...@@ -763,10 +742,19 @@ watch( ...@@ -763,10 +742,19 @@ watch(
if (newVal === 'secondHolder') { if (newVal === 'secondHolder') {
openList.value = false openList.value = false
processFormData({ if (props.idsObj.appointmentBizId) {
domdata: secondHolderDomData, processFormData({
exportValue: null domdata: secondHolderDomData,
}) exportValue: null,
detailInfo: props.apiSecondHolderInfoDto
})
console.log(' props.apiSecondHolderInfoDto', props.apiSecondHolderInfoDto)
} else {
processFormData({
domdata: secondHolderDomData,
exportValue: null
})
}
} }
} }
) )
......
...@@ -118,30 +118,40 @@ ...@@ -118,30 +118,40 @@
<span>{{ formatToDate(scope.row.createTime) }}</span> <span>{{ formatToDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="操作" <el-table-column fixed="right" label="操作" width="80" align="center">
align="left" <template #default="{ row }">
width="250" <el-popover placement="left" :width="160" trigger="click">
class-name="small-padding fixed-width" <template #reference>
fixed="right" <el-button link type="primary" size="small">
> <el-icon><MoreFilled /></el-icon>
<template #default="scope"> </el-button>
<el-button link type="primary" @click="handleUpdate(scope.row)">修改</el-button> </template>
<el-button <el-menu @select="index => handleSelect(index, row)" popper-class="custom-menu">
link <el-menu-item
type="primary" v-for="item in getVisibleDropdownItems(row)"
v-if="scope.row.status == 2 || scope.row.status == 3" :index="item.value"
@click="getAppointmentInfo(scope.row.appointmentBizId)" :key="item.value"
>查看行程单</el-button >
> <el-text class="mx-1" v-if="!item.confirm">{{ item.label }}</el-text>
<el-button link type="primary" @click="handleExprot(scope.row)">导出</el-button> <el-popconfirm
<el-button v-else
link confirm-button-text="Yes"
type="danger" cancel-button-text="No"
v-if="scope.row.status === 0" :icon="InfoFilled"
@click="handleDelete(scope.row)" icon-color="#626AEF"
>删除</el-button :title="item.confirm"
> @confirm="handleMenuConfirm(item.value, row)"
width="300"
placement="left-end"
>
<template #reference>
<el-text class="mx-1">{{ item.label }}</el-text>
</template>
</el-popconfirm>
</el-menu-item>
</el-menu>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -187,6 +197,8 @@ ...@@ -187,6 +197,8 @@
</template> </template>
<script setup name="Appointment"> <script setup name="Appointment">
import { MoreFilled, InfoFilled } from '@element-plus/icons-vue'
import CommonPage from '@/components/commonPage' import CommonPage from '@/components/commonPage'
import DetailPanel from '@/components/DetailPanel' import DetailPanel from '@/components/DetailPanel'
import { onMounted, onActivated, ref } from 'vue' import { onMounted, onActivated, ref } from 'vue'
...@@ -227,6 +239,7 @@ const operationBtnList = ref([ ...@@ -227,6 +239,7 @@ const operationBtnList = ref([
click: handleQuery click: handleQuery
} }
]) ])
const changePageNo = val => { const changePageNo = val => {
queryParams.value.pageNo = val queryParams.value.pageNo = val
getList() getList()
...@@ -251,6 +264,60 @@ const { bx_currency_type, csf_ap_status, csf_ap_meeting_point } = proxy.useDict( ...@@ -251,6 +264,60 @@ const { bx_currency_type, csf_ap_status, csf_ap_meeting_point } = proxy.useDict(
'csf_ap_status', 'csf_ap_status',
'csf_ap_meeting_point' 'csf_ap_meeting_point'
) )
// 基础菜单项配置(不使用 ref,因为它是静态的)
const baseDropdownItems = [
{ label: '修改', value: 'edit', confirm: '' },
{
label: '生成行程单',
value: 'viewItinerary',
confirm: '',
// 只有当 row.status == 1 时才显示
showCondition: row => row.status == 1
}
]
const getVisibleDropdownItems = row => {
return baseDropdownItems.filter(item => {
// 如果有 showCondition,则执行;否则默认显示
return typeof item.showCondition === 'function' ? item.showCondition(row) : true
})
}
// 菜单选择处理(无确认的操作)
const handleSelect = (index, row) => {
// 只处理不需要确认的操作
const item = baseDropdownItems.find(i => i.value === index)
if (item && !item.confirm) {
handleMenuAction(index, row)
}
// 如果有 confirm,则由 el-popconfirm 触发 handleMenuConfirm
}
// 带确认的操作(由 popconfirm 触发)
const handleMenuConfirm = (value, row) => {
handleMenuAction(value, row)
}
// 统一处理菜单动作
const handleMenuAction = (action, row) => {
switch (action) {
case 'edit':
handleUpdate(row)
break
case 'viewItinerary':
if (row.status !== 0) {
handleUpdate(row, 'viewItinerary')
}
break
case 'delete':
if (row.status !== 0) {
proxy.$message.warning('仅“待提交”状态的预约可删除')
return
}
handleDelete(row)
break
default:
proxy.$message.info('功能暂未开放')
}
}
const handleExprotPdf = () => { const handleExprotPdf = () => {
exportLoading.value = true exportLoading.value = true
getItineraryExprot(appointmentSummeryInfo.value.appointmentBizId).then(res => { getItineraryExprot(appointmentSummeryInfo.value.appointmentBizId).then(res => {
...@@ -489,7 +556,7 @@ function handleDelete(row) { ...@@ -489,7 +556,7 @@ function handleDelete(row) {
.catch(() => {}) .catch(() => {})
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
function handleUpdate(row) { function handleUpdate(row, type) {
// 对预约status进行转换,到编辑页面在转换会有时机问题 // 对预约status进行转换,到编辑页面在转换会有时机问题
csf_ap_status._object.csf_ap_status.forEach(element => { csf_ap_status._object.csf_ap_status.forEach(element => {
element.value = Number(element.value) element.value = Number(element.value)
...@@ -506,6 +573,10 @@ function handleUpdate(row) { ...@@ -506,6 +573,10 @@ function handleUpdate(row) {
appointmentBizId: row.appointmentBizId, appointmentBizId: row.appointmentBizId,
source: 'appointmentList' source: 'appointmentList'
} }
// 以生成行程单的方式进入到预约详情
if (type == 'viewItinerary') {
data.appointmentType = '2'
}
router.push({ router.push({
path: '/sign/appointment/appointmentEdit', path: '/sign/appointment/appointmentEdit',
query: data query: data
......
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