Commit aa0413a3 by Sweet Zhang

快捷复制

parent c8127c83
import { ElMessage } from 'element-plus'
export function copyToClipboard(text) {
// 方案1:使用现代 Clipboard API
if (navigator.clipboard && navigator.clipboard.writeText) {
return navigator.clipboard.writeText(text).catch((err) => {
console.error('Clipboard API 写入失败:', err);
ElMessage.error('复制失败')
// 降级到传统方案
fallbackCopyText(text);
});
}
// 方案2:降级使用传统方法
else {
fallbackCopyText(text);
}
}
// 传统复制方法
function fallbackCopyText(text, typeName = '内容') {
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.opacity = '0';
document.body.appendChild(textarea);
try {
textarea.select();
textarea.setSelectionRange(0, 99999); // 对于移动设备
document.execCommand('copy');
console.log('传统方法复制成功');
ElMessage.success(`${typeName}已复制`)
} catch (err) {
console.error('传统方法复制失败:', err)
ElMessage.error('复制失败');
} finally {
document.body.removeChild(textarea);
}
}
export default {
copyToClipboard
}
......@@ -615,10 +615,10 @@ const addCheckRecordConfig = ref([
prop: 'exchangeRate',
label: '结算汇率(实)',
inputType: 'decimal',
decimalDigits: 2,
decimalDigits: 4,
rules: [
{ required: true, message: '请输入金额', trigger: 'blur' },
{ pattern: /^\d+(\.\d{1,2})?$/, message: '最多两位小数', trigger: 'blur' }
{ pattern: /^\d+(\.\d{1,4})?$/, message: '最多四位小数', trigger: 'blur' }
]
},
])
......
......@@ -353,6 +353,7 @@ import {
getInsuranceCategory
} from '@/api/common'
import useUserStore from '@/store/modules/user'
import {copyToClipboard} from '@/utils/copyToClipboard'
const userStore = useUserStore()
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
......
......@@ -75,9 +75,21 @@
border
max-height="380px"
>
<el-table-column type="index" width="60" label="序号" />
<el-table-column label="客户姓名" align="center" prop="customerName" width="100" />
<el-table-column label="中文姓名" align="center" prop="customerNameCn" width="100" />
<el-table-column type="index" width="100" label="序号" />
<el-table-column label="客户姓名" align="center" prop="customerName" width="180" >
<template #default="scope">
<el-button link size="default">
<span @click="copyToClipboard(scope.row.customerName,'客户姓名')">{{ scope.row.customerName }}</span>
</el-button>
</template>
</el-table-column>
<el-table-column label="中文姓名" align="center" prop="customerNameCn" width="180" >
<template #default="scope">
<el-button link size="default">
<span @click="copyToClipboard(scope.row.customerNameCn,'中文姓名')">{{ scope.row.customerNameCn }}</span>
</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="状态" align="center" prop="status" width="100" :formatter="getDictLabel('csf_fna_status')"/> -->
<el-table-column label="流程状态" sortable align="center" prop="status" width="200">
<template #default="scope">
......@@ -88,18 +100,29 @@
label="流程编号"
align="center"
prop="fnaNo"
width="200"
show-overflow-tooltip
/>
width="240"
show-overflow-tooltip>
<template #default="scope">
<el-button link size="default">
<span @click="copyToClipboard(scope.row.fnaNo,'流程编号')">{{ scope.row.fnaNo }}</span>
</el-button>
</template>
</el-table-column>
<el-table-column
label="预约编号"
align="center"
prop="appointmentNo"
width="200"
width="240"
show-overflow-tooltip
/>
>
<template #default="scope">
<el-button link size="default">
<span @click="copyToClipboard(scope.row.appointmentNo,'预约编号')">{{ scope.row.appointmentNo }}</span>
</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="新单编号" align="center" prop="policyId" /> -->
<el-table-column label="保单号" align="center" prop="policyNo" width="150" />
<el-table-column label="保单号" align="center" prop="policyNo" width="180" />
<el-table-column label="创建时间" sortable align="center" prop="createTime" width="200">
<template #default="scope">
......@@ -107,7 +130,7 @@
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="80" align="center">
<el-table-column fixed="right" label="操作" width="150" align="center">
<template #default="{ row }">
<el-popover placement="left" :width="160" trigger="click">
<template #reference>
......@@ -158,6 +181,7 @@ import { getFnaList, deleteFna, subProcess } from '@/api/sign/fna'
import useUserStore from '@/store/modules/user'
import { MoreFilled, InfoFilled } from '@element-plus/icons-vue'
import useDictStore from '@/store/modules/dict'
import {copyToClipboard} from '@/utils/copyToClipboard'
const dictStore = useDictStore()
const userStore = useUserStore()
const router = useRouter()
......
......@@ -70,7 +70,13 @@
prop="appointmentNo"
width="200"
fixed="left"
/>
>
<template #default="scope">
<el-button link size="default">
<span @click="copyToClipboard(scope.row.appointmentNo,'预约编号')">{{ scope.row.appointmentNo }}</span>
</el-button>
</template>
</el-table-column>
<el-table-column label="预约状态" align="center" prop="status" fixed="left" width="100">
<template #default="scope">
<dict-tag :options="csf_ap_status" :value="scope.row.status" />
......@@ -94,16 +100,11 @@
<el-table-column label="投保人" align="center" prop="policyholder" width="150" />
<el-table-column label="受保人" align="center" prop="insurant" width="150" />
<!-- <el-table-column label="供款频率" align="center" prop="paymentFrequency" width="100">
<!-- <el-table-column label="供款频率" align="center" width="150" prop="paymentFrequency">
<template #default="scope">
<dict-tag :options="csf_ap_frequency" :value="scope.row.paymentFrequency" />
</template>
</el-table-column> -->
<el-table-column label="供款频率" align="center" width="150" prop="paymentFrequency">
<template #default="scope">
<dict-tag :options="csf_ap_frequency" :value="scope.row.paymentFrequency" />
</template>
</el-table-column>
<el-table-column label="供款期数" align="center" prop="paymentTerm" width="100" />
<el-table-column label="每期保费" align="center" prop="eachIssuePremium" width="100" />
......@@ -212,6 +213,7 @@ import {
getItineraryExprot
} from '@/api/sign/appointment'
import useUserStore from '@/store/modules/user'
import {copyToClipboard} from '@/utils/copyToClipboard'
const dictStore = useDictStore()
const userStore = useUserStore()
const router = useRouter()
......
......@@ -96,7 +96,7 @@ import {
policyFollowReport,
saveMailingInfo, updatePolicyfollow, batchSaveBrokers, saveInitialPayment,updatePolicyProduct
} from '@/api/sign/underwritingMain'
import {copyToClipboard} from '@/utils/copyToClipboard'
import PolicyDetail from './policyDetail.vue'
const policyDetailFormRef = ref(null)
const policyDetailFormData = ref({})
......
......@@ -5,7 +5,7 @@
<el-col :sm="12" :lg="12" :xs="24">
<div class="headerLeft">
<div class="top">欢迎!</div>
<div class="bottom">王力群</div>
<div class="bottom">CSF-HK</div>
</div>
</el-col>
<el-col :sm="12" :lg="12" :xs="24" class="right">
......@@ -180,14 +180,14 @@ const headerList = ref([
id: '1',
title: '总保费(HKD)',
icon: 'icon-zongbaofei',
count: '392.52',
count: '--',
url: '/todo'
},
{
id: '2',
title: '有效保单数',
icon: 'icon-youxiaobaodan',
count: '0.00',
count: '--',
url: '/todo'
},
......@@ -195,7 +195,7 @@ const headerList = ref([
id: '3',
title: '待来佣保单',
icon: 'icon-daijiesuan',
count: '10',
count: '--',
url: '/todo'
}
])
......@@ -275,7 +275,7 @@ const staticList = ref([
id: '1',
title: '财务需求分析数',
icon: 'icon-xiexian',
count: '3735',
count: '--',
unit: '条',
url: '/todo',
color: '#F53F3F'
......@@ -284,7 +284,7 @@ const staticList = ref([
id: '2',
title: '预约单数',
icon: 'icon-xiexian',
count: '12',
count: '--',
unit: '单',
url: '/todo',
color: '#0FC6C2'
......@@ -293,7 +293,7 @@ const staticList = ref([
id: '3',
title: '新单数',
icon: 'icon-xiexian',
count: '12',
count: '--',
unit: '单',
url: '/todo',
color: '#165DFF'
......@@ -302,7 +302,7 @@ const staticList = ref([
id: '4',
title: '续期保单数',
icon: 'icon-xiexian',
count: '13',
count: '--',
unit: '份',
url: '/todo',
color: '#0FC6C2'
......@@ -312,22 +312,22 @@ const infoList = ref([
{
id: '1',
title: '产品优惠',
subTitle: 'XXXXX第四季度优惠政策'
subTitle: '暂未开放'
},
{
id: '2',
title: '产品培训',
subTitle: 'XXXXX产品培训回放'
subTitle: '暂未开放'
},
{
id: '3',
title: '重要通知',
subTitle: 'XXXXX保单未续费'
subTitle: '暂未开放'
},
{
id: '4',
title: '系统消息',
subTitle: 'FNA导出成功!'
subTitle: '暂未开放!'
}
])
const timeList = ref([
......@@ -351,21 +351,21 @@ const workList = ref([
{
id: '1',
title: '新单跟进',
subTitle: '张三预约单待录入',
subTitle: '暂未开放',
unit: 'Q',
color: '#7BC616'
},
{
id: '2',
title: '续费提醒',
subTitle: 'bug fix',
subTitle: '暂未开放',
unit: 'Y',
color: '#14C9C9'
},
{
id: '3',
title: '预约单生成',
subTitle: '车险预约单已生成',
subTitle: '暂未开放',
unit: 'N',
color: '#168CFF'
}
......
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