Commit 17384168 by yuzhenWang

做到了预约列表发布测试

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