Commit 6725ee0a by yuzhenWang

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

更改数字框显示格式与输入格式,增加登录过期提示

See merge request !83
parents bb98a375 b124e29b
......@@ -24,6 +24,10 @@
:disabled="item.disabled"
@input="val => handleNumberInput(val, item)"
@change="val => handleModelChange(val, item)"
:formatter="
value => (item.inputType ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',') : value)
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
/>
<!-- Select (支持 dictType / api / options) -->
......
......@@ -108,6 +108,7 @@ const beneficiary = [
unit: '历史客户',
unitColor: 'rgba(0, 82, 217, 1)',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 15,
disabled: false,
......@@ -124,6 +125,7 @@ const beneficiary = [
key: 'namePyEn',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 30,
disabled: false,
......@@ -153,6 +155,7 @@ const beneficiary = [
key: 'idNumber',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 20,
disabled: false,
......@@ -209,7 +212,10 @@ const beneficiary = [
label: '受益比例',
key: 'benefitRatio',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......
......@@ -54,7 +54,8 @@ const customer = [
prop: 'idNumber',
type: 'input',
placeholder: '请输入证件号码',
required: true
required: true,
isFormatter: false //是否需要数字分位符
},
{
label: '是否长期有效',
......@@ -151,7 +152,7 @@ const customer = [
domType: 'Input',
inputType: 'text',
valueType: 'decimal', //输入值的格式
valueType: '',
isFormatter: false, //是否需要数字分位符
maxLength: 30,
required: true,
disabled: true,
......@@ -268,6 +269,7 @@ const customer = [
domType: 'Input',
inputType: 'text',
valueType: 'decimal', //输入值的格式
isFormatter: false, //是否需要数字分位符
maxLength: 30,
required: false,
disabled: false,
......@@ -378,13 +380,15 @@ const customer = [
label: '税务国家',
prop: 'taxCountry',
type: 'Input',
placeholder: '请输入税务国家'
placeholder: '请输入税务国家',
isFormatter: false //是否需要数字分位符
},
{
label: '税务编号',
prop: 'taxId',
type: 'Input',
placeholder: '请税务编号'
placeholder: '请税务编号',
isFormatter: false //是否需要数字分位符
}
],
data: [
......@@ -445,6 +449,7 @@ const customer = [
key: 'landline',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
disabled: false,
placeholder: '请填写',
......@@ -460,6 +465,7 @@ const customer = [
key: 'email',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
maxLength: 30,
required: false,
disabled: false,
......@@ -505,6 +511,8 @@ const customer = [
label: '住宅地址',
key: 'residentialAddress',
domType: 'arrowRight',
customLabel: true, //自定义label
customAddress: true,
required: false,
disabled: false,
placeholder: '请填写',
......@@ -521,6 +529,7 @@ const customer = [
key: 'mailingAddressCode',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -562,6 +571,7 @@ const customer = [
key: 'csName',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -577,6 +587,7 @@ const customer = [
key: 'industry',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
maxLength: 300,
required: false,
disabled: false,
......@@ -592,8 +603,10 @@ const customer = [
key: 'currentMonthlyIncome',
domType: 'Input',
unit: 'HKD',
inputType: 'text',
inputType: 'text', //使用千位符,type为text
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -610,6 +623,7 @@ const customer = [
domType: 'Input',
inputType: 'text',
valueType: 'decimal', //输入值的格式
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -626,6 +640,7 @@ const customer = [
domType: 'Input',
inputType: 'text',
valueType: 'decimal', //输入值的格式
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -641,6 +656,7 @@ const customer = [
key: 'position',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -692,6 +708,7 @@ const customer = [
key: 'companyAddressCode',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 50,
disabled: false,
......@@ -718,8 +735,10 @@ const customer = [
key: 'monthIncome',
domType: 'Input',
unit: 'HKD',
inputType: 'text',
inputType: 'text', //使用千位符,type为text
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -735,8 +754,10 @@ const customer = [
key: 'monthExpenditure',
domType: 'Input',
unit: 'HKD',
inputType: 'text',
inputType: 'text', //使用千位符,type为text
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -752,8 +773,10 @@ const customer = [
key: 'totalCurrentAssets',
domType: 'Input',
unit: 'HKD',
inputType: 'text',
inputType: 'text', //使用千位符,type为text
valueType: 'decimalNumber', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -769,8 +792,10 @@ const customer = [
key: 'totalDebt',
domType: 'Input',
unit: 'HKD',
inputType: 'text',
inputType: 'text', //使用千位符,type为text
valueType: 'decimalNumber', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -797,6 +822,7 @@ const customer = [
key: 'travel',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......@@ -855,6 +881,7 @@ const customer = [
key: 'delicacy',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......
const fnaForm = [
// 介绍人信息
{
fatherTitle: '转介人信息',
keyType: 'Array',
key: 'brokerList',
anchorKey: 'brokerList',
moudleType: 'brokerList',
dataLength: 1,
showMoudle: false, //是否展示此模块
showTable: true,
addChildren: true,
addChildrenTxt: '转介人',
fatherRequired: false,
isOpen: false,
// 新增表格列配置
columns: [
{
label: '姓名',
prop: 'brokerName',
type: 'remoteSelect',
searchType: 'brokerName',
placeholder: '请输入关键词搜索',
required: false
},
{
label: '性别',
prop: 'brokerGender',
type: 'select',
dictType: 'sys_gender',
placeholder: '请选择',
required: false
},
{
label: '内部编号',
prop: 'brokerNumber',
type: 'input',
placeholder: '请输入',
required: false
},
{
label: '所属团队',
prop: 'brokerTeam',
type: 'remoteSelect',
searchType: 'brokerTeam',
placeholder: '请输入关键词搜索',
required: false
},
{
label: '分配比例',
prop: 'brokerRatio',
type: 'inputNumber',
placeholder: '请输入',
required: true
},
{
label: '备注',
prop: 'remark',
type: 'input',
placeholder: '请输入',
required: false
}
],
data: [
// {
// fatherTitle: '转介人信息',
// keyType: 'Array',
// key: 'brokerList',
// anchorKey: 'brokerList',
// moudleType: 'brokerList',
// dataLength: 1,
// showMoudle: true,
// showTable: true,
// addChildren: true,
// addChildrenTxt: '转介人',
// fatherRequired: false,
// isOpen: false,
// // 新增表格列配置
// columns: [
// {
// label: '姓名',
// prop: 'brokerName',
// type: 'remoteSelect',
// searchType: 'brokerName',
// placeholder: '请输入关键词搜索',
// required: false
// },
// {
// label: '性别',
// prop: 'brokerGender',
// type: 'select',
// dictType: 'sys_gender',
// placeholder: '请选择',
// required: false
// },
// {
// label: '内部编号',
// prop: 'brokerNumber',
// type: 'input',
// placeholder: '请输入',
// required: false
// },
// {
// label: '所属团队',
// prop: 'brokerTeam',
// type: 'remoteSelect',
// searchType: 'brokerTeam',
// placeholder: '请输入关键词搜索',
// required: false
// },
// {
// label: '分配比例',
// prop: 'brokerRatio',
// type: 'inputNumber',
// placeholder: '请输入',
// required: true
// },
// {
// label: '备注',
// prop: 'remark',
// type: 'input',
// placeholder: '请输入',
// required: false
// brokerName: '',
// brokerGender: '',
// brokerNumber: '',
// brokerTeam: '',
// brokerRatio: '',
// remark: ''
// }
// ],
// data: [
// // {
// // brokerName: '',
// // brokerGender: '',
// // brokerNumber: '',
// // brokerTeam: '',
// // brokerRatio: '',
// // remark: ''
// // }
// ]
// },
]
},
// 受供养人信息
{
fatherTitle: '受供养人信息',
......@@ -101,7 +101,9 @@ const fnaForm = [
prop: 'dependantAge',
type: 'inputNumber',
placeholder: '请输入年龄',
required: false
required: false,
valueType: 'decimal', //输入值的格式
isFormatter: false //是否需要数字分位符
}
],
data: [
......@@ -164,7 +166,10 @@ const fnaForm = [
prop: 'sumInsured',
type: 'inputNumber',
placeholder: '请输入保额',
required: true
required: true,
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true //是否需要数字分位符
}
],
data: [
......@@ -213,7 +218,10 @@ const fnaForm = [
prop: 'marketValue',
type: 'inputNumber',
placeholder: '请输入市场价值',
required: false
required: false,
decimalDigits: 2, //小数点位数
valueType: 'decimalNumber', //输入值的格式
isFormatter: true //是否需要数字分位符
},
{
label: '币种',
......@@ -250,7 +258,10 @@ const fnaForm = [
domType: 'Input',
unit: 'HKD',
showDes: true, //是否展示描述
inputType: 'number',
inputType: 'text', //使用千位符,type为text
valueType: 'decimal', //输入值的格式
isFormatter: true, //是否需要数字分位符
decimalDigits: 2, //小数点位数
required: true,
maxLength: 300,
disabled: false,
......@@ -270,7 +281,10 @@ const fnaForm = [
domType: 'Input',
unit: 'HKD',
showDes: true, //是否展示描述
inputType: 'number',
inputType: 'text', //使用千位符,type为text
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: true,
maxLength: 300,
disabled: false,
......@@ -288,7 +302,10 @@ const fnaForm = [
value: '',
domType: 'Input',
unit: 'HKD',
inputType: 'number',
inputType: 'text', //使用千位符,type为text
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: true,
maxLength: 300,
disabled: false,
......
......@@ -41,7 +41,6 @@ const productPlan = [
key: 'insuranceTypeName',
domType: 'SearchSelect',
required: true,
maxLength: 30,
disabled: false,
placeholder: '请输入',
......@@ -69,9 +68,12 @@ const productPlan = [
label: '供款期数',
key: 'issueNumber',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 0, //小数点位数
isFormatter: true, //是否需要数字分位符
required: true,
placeholder: '请选择',
placeholder: '请输入',
dictType: 'issueNumber',
show: true,
labelPosition: 'top', //标签的位置
......@@ -83,7 +85,10 @@ const productPlan = [
label: '保障年期',
key: 'guaranteePeriod',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 0, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 20,
disabled: false,
......@@ -127,7 +132,10 @@ const productPlan = [
label: '每期保费',
key: 'eachIssuePremium',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: true,
maxLength: 20,
disabled: false,
......@@ -156,7 +164,10 @@ const productPlan = [
label: '保单征费',
key: 'policyLevy',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: true,
maxLength: 20,
disabled: false,
......@@ -185,7 +196,10 @@ const productPlan = [
label: '预缴年期',
key: 'prepaymentPeriod',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 20,
disabled: false,
......@@ -270,7 +284,10 @@ const productPlan = [
label: '保单额度(重疾)',
key: 'sumInsured',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 20,
disabled: false,
......
......@@ -57,6 +57,7 @@ const secondHolder = [
label: '名字(中文)',
key: 'nameCn',
domType: 'Input',
isFormatter: false, //是否需要数字分位符
unit: '历史客户',
unitColor: 'rgba(0, 82, 217, 1)',
inputType: 'text',
......@@ -76,6 +77,7 @@ const secondHolder = [
key: 'namePyEn',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 30,
disabled: false,
......@@ -105,6 +107,7 @@ const secondHolder = [
key: 'idNumber',
domType: 'Input',
inputType: 'text',
isFormatter: false, //是否需要数字分位符
required: false,
maxLength: 20,
disabled: false,
......@@ -148,7 +151,10 @@ const secondHolder = [
label: '受益比例',
key: 'benefitRatio',
domType: 'Input',
inputType: 'number',
inputType: 'text',
valueType: 'decimal', //输入值的格式
decimalDigits: 2, //小数点位数
isFormatter: true, //是否需要数字分位符
required: false,
maxLength: 300,
disabled: false,
......
......@@ -9,7 +9,7 @@ import useSettingsStore from '@/store/modules/settings' // 使用命名导入
import usePermissionStore from '@/store/modules/permission' // 使用命名导入
import { getToken, setToken, removeToken } from '@/utils/auth'
import { de } from 'element-plus/es/locales.mjs'
console.log('权限11111')
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register', '/workbench']
......
......@@ -3,6 +3,7 @@ export function formatCurrency(value, currency = '') {
if (value === undefined || value === null) return currency + '0.00'
return currency + value.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')
}
// 数字格式化
export function numberFormat(value, item) {
const { valueType = 'text', decimalDigits = 2 } = item
// if (!value) return
......@@ -55,7 +56,6 @@ export function numberFormat(value, item) {
// ✅ 不再删除结尾的 '.'
}
} else if (valueType === 'decimal') {
// 可以输入正整数和小数
// 1. 只保留数字和小数点
result = result.replace(/[^\d.]/g, '')
......@@ -83,8 +83,124 @@ export function numberFormat(value, item) {
return result
}
/**
* 为数字添加千位分隔符(分位符)
* @param {number|string} value - 要格式化的数字
* @param {number} decimalDigits - 小数位数,默认2位
* @param {boolean} keepNegative - 是否保留负号,默认true
* @returns {string} 格式化后的数字字符串
* @example
* formatThousands(1234.56) => '1,234.56'
* formatThousands(-1234.56) => '-1,234.56'
* formatThousands(1000) => '1,000.00'
* formatThousands('1234567.89') => '1,234,567.89'
*/
export function formatThousands(value, decimalDigits = 2, keepNegative = true) {
// 处理空值
if (value === undefined || value === null || value === '') {
return '0.00'
}
// 转换为字符串并去除已有的逗号
let numStr = String(value).replace(/,/g, '').trim()
// 如果字符串为空,返回默认值
if (numStr === '') {
return '0.00'
}
// 检查是否为负数
const isNegative = keepNegative && numStr.startsWith('-')
// 移除负号以便处理数字部分
let absNumStr = isNegative ? numStr.slice(1) : numStr
// 如果移除负号后为空,返回默认值
if (absNumStr === '') {
return isNegative ? '-0.00' : '0.00'
}
// 分割整数和小数部分
let [intPart, decPart] = absNumStr.split('.')
// 处理整数部分:如果为空,设为'0'
intPart = intPart || '0'
// 确保整数部分只包含数字
intPart = intPart.replace(/[^\d]/g, '')
if (intPart === '') {
intPart = '0'
}
// 处理小数部分
if (decPart !== undefined) {
// 只保留数字
decPart = decPart.replace(/[^\d]/g, '')
// 如果小数部分超过指定长度,截断;如果不足,补零
if (decPart.length > decimalDigits) {
decPart = decPart.slice(0, decimalDigits)
} else if (decPart.length < decimalDigits) {
decPart = decPart.padEnd(decimalDigits, '0')
}
} else {
// 如果没有小数部分,创建指定长度的零
decPart = '0'.repeat(decimalDigits)
}
// 为整数部分添加千位分隔符
intPart = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
// 组合结果
let result = decimalDigits > 0 ? `${intPart}.${decPart}` : intPart
// 添加负号
if (isNegative && parseFloat(intPart.replace(/,/g, '')) > 0) {
result = '-' + result
}
return result
}
/**
* 格式化数字为带千位分隔符的字符串(不强制小数位数)
* @param {number|string} value - 要格式化的数字
* @returns {string} 格式化后的数字字符串
* @example
* formatThousandsSimple(1234567.89) => '1,234,567.89'
* formatThousandsSimple(-1234.5) => '-1,234.5'
*/
export function formatThousandsSimple(value) {
if (value === undefined || value === null || value === '') {
return ''
}
let numStr = String(value).replace(/,/g, '').trim()
if (numStr === '') {
return ''
}
// 检查是否为负数
const isNegative = numStr.startsWith('-')
let absNumStr = isNegative ? numStr.slice(1) : numStr
// 分割整数和小数部分
const [intPart, decPart] = absNumStr.split('.')
// 为整数部分添加千位分隔符
const formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
// 组合结果
let result = decPart !== undefined ? `${formattedInt}.${decPart}` : formattedInt
// 添加负号
if (isNegative) {
result = '-' + result
}
return result
}
export default {
formatCurrency,
numberFormat
numberFormat,
formatThousands,
formatThousandsSimple
}
......@@ -6,7 +6,7 @@ import { tansParams, blobValidate } from '@/utils/ruoyi'
import cache from '@/plugins/cache'
import { saveAs } from 'file-saver'
import useUserStore from '@/store/modules/user'
console.log('请求2222')
let downloadLoadingInstance
// 是否显示重新登录
export let isRelogin = { show: false }
......@@ -84,8 +84,12 @@ service.interceptors.request.use(
// 响应拦截器
service.interceptors.response.use(
res => {
console.log('====================================')
console.log('响应拦截器33333', res.data.code)
console.log('====================================')
// 未设置状态码则默认成功状态
const code = res.data.code || 200
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
// 二进制数据则直接返回
......@@ -140,6 +144,31 @@ service.interceptors.response.use(
} else if (message.includes('timeout')) {
message = '系统接口请求超时'
} else if (message.includes('Request failed with status code')) {
console.log('打印系统', message.substr(message.length - 3))
if (message.substr(message.length - 3) == '401' && !isRelogin.show) {
isRelogin.show = true
ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
isRelogin.show = false
useUserStore()
.logOut()
.then(() => {
// location.href = '/index'
//token过期,跳转回中台的登录页
window.open(`${import.meta.env.VITE_APP_BASE_API1}/login?redirect=/workbench`)
// 然后立刻关闭自己
window.close()
})
})
.catch(() => {
isRelogin.show = false
})
}
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
ElMessage({ message: message, type: 'error', duration: 5 * 1000 })
......
......@@ -35,27 +35,18 @@
<el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show">
<div>
<el-form-item
:label="
child.key === 'residentialAddress' && child.domType === 'arrowRight'
? ''
: child.label
"
:label="child.customLabel ? '' : child.label"
:prop="child.key"
:key="child.key"
:label-width="child.labelWidth"
:label-position="child.labelPosition"
>
<!-- 自定义 label 插槽 -->
<template
v-if="
child.key === 'residentialAddress' &&
child.domType === 'arrowRight'
"
#label
>
<template v-if="child.customLabel" #label>
<div class="custom-label">
<span>{{ child.label }}</span>
<el-checkbox-group
v-if="child.customAddress"
v-model="form.isCopyAddress"
size="small"
style="margin-left: 8px"
......@@ -68,13 +59,19 @@
</el-checkbox-group>
</div>
</template>
<!-- -->
<el-input
v-if="child.domType === 'Input'"
v-model="form[child.key]"
:type="child.inputType"
:placeholder="child.placeholder"
:maxlength="child.maxlength"
:formatter="
value =>
child.isFormatter
? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: value
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
:disabled="
child.key == 'age' ||
child.key == 'bmi' ||
......@@ -233,30 +230,6 @@
style="width: calc(50% - 10px)"
/>
</div>
<!-- <el-date-picker
v-else-if="column.type === 'datePicker'"
v-model="scope.row[column.prop]"
:type="getDatePickerType(scope.row, column)"
:placeholder="column.placeholder"
:disabled="editStatus"
unlink-panels
style="width: 100%"
range-separator="至"
start-placeholder="开始"
end-placeholder="结束"
@change="changeDatePicker(father, scope.row, column.prop, $event)"
/> -->
<el-input
v-else-if="column.type === 'inputNumber'"
v-model.number="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus"
type="number"
>
<template v-if="column.unit" #append>
<span>{{ column.unit }}</span>
</template>
</el-input>
<el-radio-group
v-model="scope.row[column.prop]"
v-else-if="column.type === 'radioGroup'"
......@@ -275,6 +248,13 @@
:placeholder="column.placeholder"
:disabled="editStatus"
@blur="tableInputBlur(father, scope.row, column.prop, $event)"
:formatter="
value =>
column.isFormatter
? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: value
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
/>
<!-- 满足一定条件展示得控件 -->
</template>
......@@ -1726,6 +1706,12 @@ defineExpose({
width: 100%;
display: flex;
align-items: center;
.numberTxt {
font-size: 14px;
font-weight: normal;
margin-left: 5px;
color: #a8abb2;
}
}
.topBtn {
width: 100%;
......
......@@ -84,8 +84,15 @@
:type="child.inputType"
v-model="form[father.key][child.key]"
:placeholder="child.placeholder"
maxlength="30"
:maxlength="child.maxlength"
:disabled="editStatus"
:formatter="
value =>
child.isFormatter
? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: value
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
>
<template #append v-if="child.unit">
<span>{{ child.unit }}</span>
......@@ -249,32 +256,43 @@
v-else-if="
column.type === 'inputNumber' && !!scope.row.showSumInsured
"
v-model.number="scope.row[column.prop]"
v-model="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus"
type="number"
@input="val => (scope.row[column.prop] = numberFormat(val, column))"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
>
<template v-if="column.unit" #append>
<span>{{ column.unit }}</span>
</template>
</el-input>
<el-input
<!-- <el-input
v-else-if="column.type === 'inputNumber' && scope.row.showSumInsured"
v-model.number="scope.row[column.prop]"
v-model="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus"
type="number"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
>
<template v-if="column.unit" #append>
<span>{{ column.unit }}</span>
</template>
</el-input>
</el-input> -->
<!-- 普通输入框(默认) -->
<el-input
v-else-if="column.prop !== 'sumInsured'"
v-model="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus"
@input="val => (scope.row[column.prop] = numberFormat(val, column))"
:formatter="
value =>
column.isFormatter
? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: value
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
/>
</template>
</el-table-column>
......@@ -346,6 +364,7 @@ import useDictStore from '@/store/modules/dict'
import fanFormDomData from '@/formJson/fnaForm'
import { watch, nextTick } from 'vue'
import { addfanForm, getfanFormDetail, editFanForm, getCustomerList } from '@/api/sign/fna'
import { numberFormat } from '@/utils/number'
import {
getUserSaleExpandList,
getAllTeam,
......@@ -399,6 +418,7 @@ const {
tempFanFormValue,
tempFanFormData
} = toRefs(data)
const handleRemoteSelectChange = async (row, column, father) => {
console.log(row, column)
// 通过保险公司查保险种类 row中收集了insurer的值
......@@ -803,15 +823,7 @@ const getInvalidFields = fields => {
}
return errors
}
// 判断是否为数组
const isArray = value => {
return Array.isArray(value)
}
// 判断是否为对象
const isObject = value => {
return typeof value === 'object' && value !== null && !Array.isArray(value)
}
// 表单提交
const submitForm = saveType => {
......
......@@ -36,6 +36,7 @@
type="warning"
:icon="Edit"
@click="handleCancel('appoint')"
:disabled="submitLoading"
>取消预约</el-button
>
</div>
......@@ -48,7 +49,12 @@
>编辑</el-button
>
<el-button type="primary" v-if="!editStatus" @click="handleSubmit('editStorage')"
<el-button
type="primary"
v-if="!editStatus"
@click="handleSubmit('editStorage')"
:disabled="submitLoading"
:loading="submitLoading"
>暂存</el-button
>
<el-button
......@@ -56,6 +62,8 @@
type="success"
:icon="Check"
@click="handleSubmit('submit')"
:disabled="submitLoading"
:loading="submitLoading"
>提交</el-button
>
<el-button
......@@ -67,6 +75,7 @@
type="warning"
:icon="Edit"
@click="handleCancel('apply')"
:disabled="submitLoading"
>取消申请</el-button
>
</div>
......@@ -107,6 +116,8 @@
type="success"
:icon="Check"
@click="handleSubmit('submit')"
:disabled="submitLoading"
:loading="submitLoading"
>提交</el-button
>
<el-button
......@@ -114,6 +125,8 @@
plain
v-if="!idsObj.appointmentBizId && source == 'fnaList'"
@click="handleSubmit('storage')"
:disabled="submitLoading"
:loading="submitLoading"
>暂存</el-button
>
<el-button
......@@ -445,7 +458,7 @@ const props = defineProps({
policyDetailInfo: { type: Object, default: () => ({}) }, //新单跟进传递关于保单的详情信息
policyId: { type: Object, default: () => ({}) } //新单跟进传递的Id
})
const submitLoading = ref(false)
const userStore = useUserStore()
const dictStore = useDictStore()
const showStorage = ref(false)
......@@ -960,13 +973,7 @@ const handleSubmit = async type => {
return
}
}
console.log('====================================')
console.log(
'submitAppointmentObj.value.apiProductPlanInfoDto',
submitAppointmentObj.value.apiProductPlanInfoDto
)
console.log('====================================')
// return
// 获取投保人form
if (policyHolderInfoRef.value) {
submitAppointmentObj.value.apiPolicyholderInfoDto =
......@@ -1052,9 +1059,11 @@ const handleSubmit = async type => {
console.log('大提交', submitAppointmentObj.value)
// return
if (type == 'submit') {
submitLoading.value = true
// 新增预约单
addAppointment(submitAppointmentObj.value).then(res => {
if (res.code == 200) {
submitLoading.value = false
proxy.$message.success('预约成功')
editStatus.value = false
emit('handleSuccess', {
......@@ -1071,9 +1080,11 @@ const handleSubmit = async type => {
if (route.query.appointmentType == '2') {
submitAppointmentObj.value.source = 2
}
submitLoading.value = true
// 编辑预约单
editAppointmentDetail(submitAppointmentObj.value).then(res => {
if (res.code == 200) {
submitLoading.value = false
editStatus.value = true
getAppointmentInfo(idsObj.value.appointmentBizId)
proxy.$message.success('修改预约单成功')
......@@ -1086,9 +1097,11 @@ const handleSubmit = async type => {
props.processDetail.customerBizId
submitAppointmentObj.value.apiAppointmentInfoDto.fnaBizId = props.processDetail.fnaBizId
submitAppointmentObj.value.apiAppointmentInfoDto.fnaNo = props.processDetail.fnaNo
submitLoading.value = true
// 暂存预约单
storageAppointment(submitAppointmentObj.value).then(res => {
if (res.code == 200) {
submitLoading.value = false
proxy.$message.success('预约暂存成功')
router.push({ path: '/sign/appointment' })
}
......@@ -1096,9 +1109,11 @@ const handleSubmit = async type => {
}
// 编辑状态下预约暂存
if (type == 'editStorage') {
submitLoading.value = true
// 暂存预约单
appointmentEditStorage(submitAppointmentObj.value).then(res => {
if (res.code == 200) {
submitLoading.value = false
proxy.$message.success('预约暂存提交成功')
editStatus.value = true
getAppointmentInfo(idsObj.value.appointmentBizId)
......
......@@ -73,7 +73,7 @@
:type="child.inputType"
v-model="form[child.key]"
:placeholder="child.placeholder"
maxlength="30"
:maxlength="child.maxlength || 50"
:rows="child.rows"
:disabled="editStatus"
/>
......@@ -964,7 +964,7 @@ const searchSelectList = async (query, key) => {
const params5 = {
pageNo: 1,
pageSize: 10,
queryContent: queryString
realName: queryString
}
const response5 = await getUserSaleExpandList(params5)
if (response5.code == 200) {
......@@ -998,7 +998,7 @@ const searchSelectList = async (query, key) => {
const params5 = {
pageNo: 1,
pageSize: 10,
realName: queryString
name: queryString
}
const response5 = await insuranceReconciliationCompany(params5)
if (response5.code == 200) {
......
......@@ -28,7 +28,7 @@
:type="child.inputType"
v-model="form[child.key]"
:placeholder="child.placeholder"
maxlength="30"
:maxlength="child.maxlength || 50"
:disabled="editStatus"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }"
/>
......@@ -177,8 +177,16 @@
:type="child.inputType"
v-model="dialogForm[child.key]"
:placeholder="child.placeholder"
maxlength="30"
@blur="handleInputBlur(child)"
@input="val => (dialogForm[child.key] = numberFormat(val, child))"
:maxlength="child.maxlength"
:formatter="
value =>
child.isFormatter
? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: value
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
/>
<el-select
......@@ -257,10 +265,8 @@ import Phone from '@/views/components/phone'
import Address from '@/views/components/address'
import { watch, nextTick } from 'vue'
import { updatePolicyBeneficiary, delPolicyBeneficiary } from '@/api/sign/underwritingMain'
import { editBeneficiaryInfo, delBeneficiary } from '@/api/sign/appointment'
import useDictStore from '@/store/modules/dict'
import { numberFormat } from '@/utils/number'
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
activeName: { type: String, default: '' }, //tab名称
......@@ -392,6 +398,7 @@ const {
tempBeneficiaryDomData,
dialogForm
} = toRefs(data)
const deleteChildren = (father, index) => {
if (father.key == 'apiBeneficiaryInfoDtoList') {
father.data.splice(index, 1)
......
......@@ -38,9 +38,17 @@
:type="child.inputType"
v-model="form[father.key][child.key]"
:placeholder="child.placeholder"
maxlength="30"
:maxlength="child.maxlength|| 50"
:disabled="editStatus"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }"
@input="val => handleInputChange(val, child, father)"
:formatter="
value =>
child.isFormatter
? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: value
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
/>
<el-select
v-if="child.domType === 'Select'"
......@@ -255,6 +263,7 @@ import {
import { editProductPlanInfo, delAdditional } from '@/api/sign/appointment'
import { updatePolicyProduct, delPolicyAdditional } from '@/api/sign/underwritingMain'
import useUserStore from '@/store/modules/user'
import { numberFormat } from '@/utils/number'
const userStore = useUserStore()
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
......@@ -307,6 +316,11 @@ const data = reactive({
})
const { form, rules, processedProductData, queryParams, oldProductDomData, tempForm, dialogForm } =
toRefs(data)
//处理数据
const handleInputChange = (val, child, father) => {
let newVal = numberFormat(val, child)
form.value[father.key][child.key] = newVal
}
const deleteChildren = (father, index) => {
if (father.key == 'apiProductPlanAdditionalInfoDtoList') {
father.data.splice(index, 1)
......@@ -442,7 +456,7 @@ const handleSearchSelectChange = (father, key) => {
if (key == 'insuranceTypeName') {
searchOptions.value['insuranceTypeName'].forEach(item => {
if (item.value == form.value['apiProductPlanMainInfoDto']['insuranceTypeName']) {
if (item.code == 'CI') {
if (item.code == 'CATEGORY5934890141') {
resetShow('sumInsured', true)
} else {
resetShow('sumInsured', false)
......
......@@ -28,7 +28,15 @@
:type="child.inputType"
v-model="form[child.key]"
:placeholder="child.placeholder"
maxlength="30"
@input="val => (form[child.key] = numberFormat(val, child))"
:maxlength="child.maxlength || 50"
:formatter="
value =>
child.isFormatter
? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: value
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
:disabled="editStatus"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }"
/>
......@@ -227,10 +235,8 @@ import Address from '@/views/components/address'
import { watch, nextTick } from 'vue'
import { getCustomerList } from '@/api/sign/fna'
import { editSecondHolderInfo } from '@/api/sign/appointment'
import { updatePolicySecondHolder } from '@/api/sign/underwritingMain'
import useDictStore from '@/store/modules/dict'
import { numberFormat } from '@/utils/number'
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
activeName: { type: String, default: '' }, //tab名称
......
......@@ -291,13 +291,13 @@ const introducerConfig = [
},
transform: res => {
return (res?.data.records || []).map(item => ({
value: item.clientUserBizId,
value: item.userSaleBizId,
label: item.realName,
...item
}))
}
},
{
{
type: 'input',
prop: 'brokerName',
label: '转介人姓名',
......@@ -501,10 +501,9 @@ const policyInfoFormConfig = ref([
},
onChangeExtraFields: {
reconciliationCompany: 'name',
reconciliationCode:'code',
reconciliationCode: 'code'
},
rules: [{ required: true, message: '请选择出单经纪公司', trigger: 'blur' }],
rules: [{ required: true, message: '请选择出单经纪公司', trigger: 'blur' }]
},
{
type: 'input',
......@@ -527,9 +526,9 @@ const policyInfoFormConfig = ref([
type: 'select',
prop: 'policyTpye',
label: '保单类型',
options:[
{label:'电子保单',value:'1'},
{label:'纸质保单',value:'2'}
options: [
{ label: '电子保单', value: '1' },
{ label: '纸质保单', value: '2' }
]
},
{
......@@ -677,7 +676,7 @@ const basicPlanFormConfig = ref([
{
type: 'input',
prop: 'issueNumber',
label: '供款期数',
label: '供款期数'
},
{
type: 'input',
......@@ -685,9 +684,7 @@ const basicPlanFormConfig = ref([
label: '保障年期',
inputType: 'decimal',
decimalDigits: 4,
rules: [
{ pattern: /^\d+(\.\d{1,4})?$/, message: '最多四位小数', trigger: 'blur' }
]
rules: [{ pattern: /^\d+(\.\d{1,4})?$/, message: '最多四位小数', trigger: 'blur' }]
},
{
type: 'input',
......@@ -695,9 +692,7 @@ const basicPlanFormConfig = ref([
label: '保额(重疾险)',
inputType: 'decimal',
decimalDigits: 4,
rules: [
{ pattern: /^\d+(\.\d{1,4})?$/, message: '最多四位小数', trigger: 'blur' }
]
rules: [{ pattern: /^\d+(\.\d{1,4})?$/, message: '最多四位小数', trigger: 'blur' }]
},
{
type: 'select',
......@@ -1257,7 +1252,6 @@ const handleSelectChange = async (prop, value, item, type) => {
console.log('✅ 产品列表刷新指令执行完毕')
// ElMessage.success('产品列表已更新')
} catch (err) {
console.error('💥 刷新产品列表出错:', err)
ElMessage.error('产品列表更新失败,请重试')
......
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