Commit 8efb61d3 by yuzhenWang

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

提交新单跟进详情到测试

See merge request !17
parents 6ee0c7fe ec72c02e
......@@ -79,3 +79,19 @@ export function getAdditionalProductList(data) {
data: data
})
}
//获取保险公司列表
export function getAllCompanys(data) {
return request({
url: '/user/api/sysDept/company/page',
method: 'post',
data: data
})
}
//获取转介人列表
export function getClientUser(data) {
return request({
url: '/user/api/clientUser/page',
method: 'post',
data: data
})
}
......@@ -26,4 +26,50 @@ export function updateToPolicyLib(data) {
method: 'post',
data: data
})
}
\ No newline at end of file
}
// 更新新单跟进
export function updatePolicyfollow(data) {
return request({
url: '/csf/api/policy_follow/update',
method: 'post',
data: data
})
}
// 获取新单跟进详情
export function getPolicyfollow(policyBizId) {
return request({
url: `/csf/api/policy_follow/get/vo?policyBizId=${policyBizId}`,
method: 'get'
})
}
// 获取新单跟进状态
export function getPolicyStatus(policyBizId) {
return request({
url: `/csf/api/policy_follow/status/list?policyBizId=${policyBizId}`,
method: 'get'
})
}
// 新单跟进附件列表
export function getAttachmentList(data) {
return request({
url: '/csf/api/policy_follow/attachment/list/page',
method: 'post',
data: data
})
}
// 删除单个新单跟进附件
export function delAttachmentFile(fileId) {
return request({
url: '/csf/api/policy_follow/attachment/delete?fileId=' + fileId,
method: 'delete'
})
}
// 上传新单跟进附件
export function uploadPolicyfollow(data) {
return request({
url: '/csf/api/policy_follow/attachment/upload',
method: 'post',
data: data
})
}
......@@ -161,7 +161,7 @@ const appointmentInfo = [
},
{
label: '顾问是否陪同',
label: '转介人是否陪同',
key: 'isAccompany',
domType: 'Select',
required: false,
......@@ -192,7 +192,7 @@ const appointmentInfo = [
},
// 陪同顾问信息
{
fatherTitle: '陪同顾问信息',
fatherTitle: '转介人信息',
type: 'object',
key: 'consult',
showMoudle: false, //模块是否展示
......@@ -394,9 +394,9 @@ const appointmentInfo = [
label: '开户时间段(开始)',
key: 'openAccountStartTime',
domType: 'datetimePicker',
timeType:'date',
timeType: 'date',
required: false,
disabled: true,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
......@@ -409,7 +409,7 @@ const appointmentInfo = [
key: 'openAccountEndTime',
domType: 'datetimePicker',
required: false,
disabled: true,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
......
const brokerInfo = [
// 转介人信息
{
fatherTitle: '转介人信息',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
showTable: true, //以table的形式展示
key: 'brokerList',
addFamilyChildren: true, //是否可以新增子级dom
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
// {
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// brokerName: '',
// team: '',
// brokerRatio: '',
// remark: ''
// }
]
}
]
export default brokerInfo
const policyInfo = [
// 保单信息
{
fatherTitle: '保单信息',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'policyFollowUpdateDto',
child: 'no', //没有子级dom,直接展示
fatherrequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '客户姓名',
key: 'customerName',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '客户编号',
key: 'customerBizId',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '140px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保单号',
key: 'policyNo',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '130px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '签单日期',
key: 'signDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '签单人',
key: 'signer',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '130px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '生效日期',
key: 'effectiveDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '续保日期',
key: 'renewalDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '产品名称',
key: 'productName',
domType: 'SearchSelect',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
labelPosition: 'top', //标签的位置
lg: 8 //栅格布局份数
},
{
label: '产品类别',
key: 'productCate',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '130px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '供款年期',
key: 'paymentTerm',
domType: 'Select',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'paymentTerm',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '期交保费',
key: 'paymentPremium',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否预缴',
key: 'isPrepaid',
domType: 'Select',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
dictType: 'sys_no_yes',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '预缴年期',
key: 'prepaidTerm',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保险公司',
key: 'insurer',
domType: 'SearchSelect',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
labelPosition: 'top', //标签的位置
lg: 8 //栅格布局份数
},
{
label: '对账公司',
key: 'reconciliationCompany',
domType: 'SearchSelect',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
labelPosition: 'top', //标签的位置
lg: 8 //栅格布局份数
},
{
label: '保单持有人',
key: 'policyHolder',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '受保人',
key: 'insured',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '币种',
key: 'currency',
domType: 'Select',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'bx_currency_type',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '首期保费',
key: 'initialPremium',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '备注',
key: 'remark',
domType: 'Input',
inputType: 'textarea',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 24, //栅格布局份数
lg: 24 //栅格布局份数
}
]
}
]
export default policyInfo
const policyMailing = [
// 保单邮寄
{
fatherTitle: '保单邮寄',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'policyMailing',
child: 'no', //没有子级dom,直接展示
fatherrequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '寄送方式',
key: 'productCate',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '经纪公司签收日期',
key: 'brokerSignDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保险公司寄出日期',
key: 'insurerMailingDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '客户签收日期',
key: 'customerSignDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
}
]
export default policyMailing
const verifyPolicyInfo = [
// 核保信息
{
fatherTitle: '核保信息',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'verifyPolicyInfo',
child: 'no', //没有子级dom,直接展示
fatherrequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '保险种类',
key: 'productCate',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '签单日期',
key: 'signDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '递交日期',
key: 'submitDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '缮发日期',
key: 'issueDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保单生效日',
key: 'effectiveDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保单截止日期',
key: 'policyExpirationDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否预缴',
key: 'isPrepaid',
domType: 'Select',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '预付额',
key: 'prepaidAmount',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '140px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '折扣后预付额',
key: 'prepaidAmountAfterDiscount',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '130px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '缴费编号',
key: 'paymentNumber',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '130px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
}
]
export default verifyPolicyInfo
......@@ -4,6 +4,8 @@ const useDictStore = defineStore('dict', {
tenantUserList: [], //租户用户数据
insureProductList: [], //保险产品数据
additionalProductList: [], //附加险产品数据
insureCompanyList: [], //保险公司数据
clientUserList: [], //用户数据,转介人
dictTypeLists: [] //字典列表,根据请求得不同会变化,所以使用之前需要使用useDictLists请求数据
}),
actions: {
......@@ -64,6 +66,14 @@ const useDictStore = defineStore('dict', {
setAdditionalProductList(product) {
this.additionalProductList = product
},
// 设置保险公司列表
setInsureCompanyList(company) {
this.insureCompanyList = company
},
// 设置用户列表
setClientUserList(user) {
this.clientUserList = user
},
// 设置字典列表
setDictTypeLists(typeList) {
this.dictTypeLists = typeList
......
......@@ -117,6 +117,7 @@
:tabName="activeName"
:processDetail="processInfo"
@handleSuccess="handleSuccess"
source="fnaList"
/>
</div>
<div v-if="tab.name === 'newpolicy'">关联新单内容</div>
......
......@@ -291,7 +291,7 @@ function handleAdd() {
function handleUpdate(row) {
router.push({
path: '/sign/FnaList/edit',
query: { fnaBizId: row.fnaBizId, type: 'edit', status: row.status }
query: { fnaBizId: row.fnaBizId, type: 'edit', status: row.status, source:'fnaList'}
})
}
......
......@@ -1069,7 +1069,7 @@ watch(
tempAddressQuickList.value = JSON.parse(JSON.stringify(addressQuickList.value))
tempPhoneQuickList.value = JSON.parse(JSON.stringify(phoneQuickList.value))
tempBeneficiaryDomData.value = JSON.parse(JSON.stringify(processedBeneficiaryData.value))
console.log('tempBeneficiaryDomData.value', tempBeneficiaryDomData.value)
if (newVal === 'beneficiary') {
openList.value = false
setTimeout(() => {
......
......@@ -199,17 +199,9 @@
</div>
</el-row>
<el-row v-if="props.idsObj.appointmentBizId">
<el-row v-if="props.showSubmitBtn">
<el-col>
<div class="tabButton">
<!-- <el-button
type="primary"
icon="RefreshRight"
size="large"
@click="resetForm()"
:disabled="editStatus"
>重置</el-button
> -->
<el-button
type="success"
icon="Check"
......@@ -242,6 +234,8 @@ const props = defineProps({
customerBizId: { type: String, default: '' }, //提交状态,新增、修改
dictTypeLists: { type: Array, default: () => [] }, //多个字典值数据
formStatus: { type: String, default: '' }, //父组件状态,新增、修改
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
pageSource: { type: String, default: false }, //页面来源
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
apiProductPlanInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情
appointmentStatus: { type: Number } //父组件传递过来的预约的状态
......@@ -439,7 +433,7 @@ const processFormData = async () => {
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
if (props.idsObj.appointmentBizId) {
if (props.showSubmitBtn) {
field.disabled = true
} else {
field.disabled = false
......@@ -471,9 +465,12 @@ const processFormData = async () => {
}
}
}
if (props.idsObj.appointmentBizId) {
// idsObj.appointmentBizId
// 证明是修改
if (props.showSubmitBtn) {
editStatus.value = true
setFormValue(props.apiProductPlanInfoDto, processedData)
processedProductData.value = processedData
// setFormValue(props.apiProductPlanInfoDto, processedData)
} else {
editStatus.value = false
processedProductData.value = processedData
......@@ -1018,7 +1015,10 @@ const submitForm = saveType => {
console.log('提交的数据', result)
console.log('====================================')
// return
if (props.idsObj.appointmentBizId) {
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
editProductPlanInfo(result).then(res => {
if (res.code == 200) {
handleEditStatus(true)
......@@ -1117,7 +1117,7 @@ defineExpose({
}
}
.tabButton {
box-shadow: 0 -1px 14px #00000014;
/* box-shadow: 0 -1px 14px #00000014; */
width: 100%;
display: flex;
align-items: center;
......
<template>
<!-- :limit="limit" :on-exceed="handleExceed"-->
<div>
<div class="fileUploadBox">
<el-upload
:action="uploadImgUrl"
:headers="headers"
:show-file-list="false"
:on-success="uploadSuccess"
:before-upload="handleBeforeUpload"
>
<div class="uploadBox">
<el-icon size="20"><DocumentAdd /></el-icon>
<div class="file">选择文件</div>
</div>
</el-upload>
</div>
<div class="tip">(支持Word,Excel,PDF,图片格式)</div>
<el-table v-loading="loading" :data="fileTableList">
<el-table-column label="序号" type="index" width="50" />
<el-table-column label="文件名" align="center" prop="fileName" width="200" />
<!-- sortable -->
<el-table-column label="上传时间" align="center" prop="createTime" width="200">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="上传人" align="center" prop="creatorName" />
<el-table-column label="文件类型" align="center" prop="fileType" />
<el-table-column
label="操作"
align="center"
width="250"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button type="primary" link @click="downloadFile(scope.row)">下载</el-button>
<el-button
v-if="isImageFile(scope.row.fileName)"
type="primary"
link
@click="handleView(scope.row)"
>
查看
</el-button>
<!-- <el-button type="primary" link @click="handleUpdate(scope.row)">修改</el-button> -->
<el-button type="danger" link @click="handleDetele(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total >= 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getFileList"
/>
<el-dialog title="重命名文件" v-model="editVisible" width="800px" append-to-body>
<el-form>
<el-row>
<el-col :span="12">
<el-form-item label="文件名">
<el-input v-model="form.fileName" placeholder="请输入文件名" maxlength="300" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="canelEdit">取 消</el-button>
</div>
</template>
</el-dialog>
<!-- 图片查看器 -->
<el-dialog v-model="imageViewerVisible" title="图片预览" width="60%">
<div style="text-align: center">
<el-image :src="imageUrl" fit="contain" />
</div>
</el-dialog>
</div>
</template>
<script setup name="FileUpload">
import { getToken } from '@/utils/auth'
import { addFile, getAppointmentFile, delFile, editAppointmentFile } from '@/api/sign/appointment'
import {
getAttachmentList,
uploadPolicyfollow,
delAttachmentFile
} from '@/api/sign/underwritingMain'
const props = defineProps({
activeName: { type: String, default: '' }, //tab名称
policyBizId: { type: String, default: '' } //父组件状态,新增、修改
})
const { proxy } = getCurrentInstance()
const editVisible = ref(false)
const loading = ref(true)
const total = ref(0)
const fileTableList = ref([])
const limit = ref(2)
const fileSize = ref(10)
const headers = ref({ Authorization: 'Bearer ' + getToken() })
const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + '/oss/api/oss/upload') // 上传的服务器地址
// 图片查看相关状态
const imageViewerVisible = ref(false)
const imageUrl = ref('')
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 4,
policyBizId: props.policyBizId
}
})
const { queryParams, form } = toRefs(data)
const canelEdit = () => {
editVisible.value = false
form.value = {}
console.log('fileTableList', fileTableList.value)
}
const submitForm = () => {
let obj = {
appointmentFileBizId: form.value.appointmentFileBizId,
fileName: form.value.fileName
}
editAppointmentFile(obj).then(response => {
if (response.code == 200) {
proxy.$modal.msgSuccess('文件名修改成功')
editVisible.value = false
getFileList()
}
})
}
const handleDetele = row => {
proxy.$modal
.confirm('是否确认删除名称为"' + row.fileName + '"的文件?')
.then(function () {
return delAttachmentFile(row.id)
})
.then(res => {
if (res.code == 200) {
proxy.$modal.msgSuccess('删除成功')
getFileList()
}
})
.catch(() => {})
}
const isImageFile = fileName => {
return /\.(jpg|jpeg|png|gif|bmp|webp|svg|ico)$/i.test(fileName || '')
}
const handleUpdate = row => {
editVisible.value = true
form.value = JSON.parse(JSON.stringify(row))
}
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' // 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const fileName = row.fileName
link.download = fileName
// 触发下载
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
// 上传前loading加载
function handleBeforeUpload(file) {
// if (file.name.includes(',')) {
// proxy.$modal.msgError('文件名不正确,不能包含英文逗号!')
// return false
// }
const isLt = file.size / 1024 / 1024 < fileSize.value
if (!isLt) {
proxy.$modal.msgError(`上传文件大小不能超过 ${fileSize.value} MB!`)
return false
}
}
// 文件个数超出
function handleExceed() {
proxy.$modal.msgError(`一次只能上传${limit.value}个文件!`)
}
const uploadSuccess = res => {
console.log('上传成功', res)
if (res.code == 200) {
if (props.policyBizId) {
let submitObj = {
policyBizId: props.policyBizId,
fileUrl: res.data.url,
fileName: res.data.originalName,
ossFileBizId: res.data.fileBizId
}
uploadPolicyfollow(submitObj).then(res => {
if (res.code == 200) {
proxy.$message.success('文件上传成功')
queryParams.value.pageNo = 1
getFileList()
}
})
}
}
}
const getFileList = () => {
loading.value = true
try {
getAttachmentList(queryParams.value).then(response => {
total.value = response.data.total
fileTableList.value = response.data.records
if (fileTableList.value.length > 0) {
for (const item of fileTableList.value) {
item.fileType = '保单文件'
}
}
loading.value = false
})
} catch (error) {
fileTableList.value = []
} finally {
loading.value = false
}
}
watch(
() => props.activeName,
newVal => {
if (newVal === 'policyAccessories') {
queryParams.value.pageNo = 1
getFileList()
}
}
)
</script>
<style lang="scss" scoped>
.fileUploadBox {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
padding: 20px 0;
border: 1px dashed #dcdfe6;
}
.uploadBox {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.file {
font-size: 14px;
margin-top: 10px;
color: #409eff;
}
}
.tip {
font-size: 14px;
color: #909399;
margin: 10px 0 20px 0;
}
</style>
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