Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yuzhenWang
yd-csf-front
Commits
eb0cc621
Commit
eb0cc621
authored
Dec 31, 2025
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
searchform xiugai
parent
621b7859
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
952 additions
and
474 deletions
+952
-474
src/api/common.js
+9
-0
src/api/financial/commission.js
+59
-8
src/components/SearchForm/SearchForm.vue
+305
-264
src/views/financialCenter/financialBilling.vue
+19
-13
src/views/financialCenter/financialIncome.vue
+173
-91
src/views/financialCenter/financialSalary.vue
+5
-28
src/views/financialCenter/payables.vue
+212
-26
src/views/financialCenter/receivables.vue
+170
-44
No files found.
src/api/common.js
View file @
eb0cc621
...
...
@@ -143,3 +143,12 @@ export function getInsuranceCompany(data) {
method
:
'post'
})
}
// 通用excel导入
export
function
importExcel
(
data
)
{
return
request
({
url
:
'/oss/api/excel/import'
,
method
:
'post'
,
data
:
data
})
}
src/api/financial/commission.js
View file @
eb0cc621
...
...
@@ -273,14 +273,6 @@ export function commissionEntryEditRecords(data) {
})
}
// 出账记录查询
export
function
payRecordList
(
data
)
{
return
request
({
url
:
'/csf/api/fortune/list/page/fortuneAccount'
,
method
:
'post'
,
data
:
data
})
}
// 获取保单发佣列表
export
function
policyNoCommissionPayRecord
(
data
)
{
...
...
@@ -309,3 +301,62 @@ export function commissionExpectedRecord(data) {
data
:
data
})
}
// 出账记录查询
export
function
payRecordList
(
data
)
{
return
request
({
url
:
'/csf/api/fortune/pageByExpectedFortuneBizId'
,
method
:
'post'
,
data
:
data
})
}
// 更新入账信息
export
function
updateCommissionExpected
(
data
)
{
return
request
({
url
:
'/csf/api/CommissionExpected/update'
,
method
:
'post'
,
data
:
data
})
}
// 修改出账状态
export
function
updataPayrollStatus
(
data
){
return
request
({
url
:
'/csf/api/fortune/update/status'
,
method
:
'post'
,
data
:
data
})
}
// 批量新增检核记录
export
function
addPayrollCheckRecord
(
data
){
return
request
({
url
:
'/csf/api/commission/addBatch'
,
method
:
'post'
,
data
:
data
})
}
// 新增应收款
export
function
addReceivedFortune
(
data
){
return
request
({
url
:
'/csf/api/CommissionExpected/add'
,
method
:
'post'
,
data
:
data
})
}
// 新增出账记录
export
function
addPayRecord
(
data
){
return
request
({
url
:
'/csf/api/expectedFortune/add'
,
method
:
'post'
,
data
:
data
})
}
// 获取销售员详情
export
function
userSaleExpandDetail
(
data
){
return
request
({
url
:
'/insurance/base/api/userSaleExpand/detail?userSaleBizId='
+
data
,
method
:
'get'
,
})
}
src/components/SearchForm/SearchForm.vue
View file @
eb0cc621
<!-- components/SearchForm.vue -->
<
template
>
<el-form
:model=
"formModel"
label-width=
"100px"
size=
"default"
label-position=
"top
"
>
<el-form
ref=
"formRef"
:model=
"localModel"
:rules=
"formRules"
label-width=
"auto"
v-bind=
"$attrs
"
>
<el-row
:gutter=
"20"
>
<template
v-for=
"item in config"
:key=
"item.prop"
>
<el-col
v-for=
"item in visibleConfig"
:key=
"item.prop"
:span=
"item.span || 8"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
:class=
"
{ 'search-form-item': isSearch }">
<!-- Input -->
<el-col
:xs=
"24"
:sm=
"12"
:md=
"6"
:lg=
"6"
v-if=
"item.type === 'input'"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
:rules=
"item.rules"
>
<el-input
:model-value=
"formModel[item.prop]"
@
input=
"(val) => handleNumberInput(val, item)"
:placeholder=
"item.placeholder || `请输入$
{item.label}`" clearable style="width: 100%" />
</el-form-item>
</el-col>
<el-input
v-if=
"item.type === 'input'"
v-model=
"localModel[item.prop]"
:placeholder=
"item.placeholder || `请输入$
{item.label}`" :clearable="true"
@input="(val) => handleNumberInput(val, item)" />
<!-- Remote Select (带 api 的 select) -->
<el-col
:xs=
"24"
:sm=
"12"
:md=
"6"
:lg=
"6"
v-else-if=
"item.type === 'select' && item.api"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
:rules=
"item.rules"
>
<el-select
ref=
"selectRefs[item.prop]"
v-model=
"formModel[item.prop]"
:placeholder=
"item.placeholder || `请选择$
{item.label}`" clearable filterable
:multiple="item.multiple" :loading="item.loading"
:no-match-text="item.noMatchText || '无匹配数据'" @filter="handleSelectFilter(item)"
@visible-change="handleVisibleChange(item)" @change="(val) => handleChange(item, val)"
style="width: 100%">
<el-option
v-for=
"opt in item._allOptions"
:key=
"opt[item.valueKey || 'value']"
:label=
"opt[item.labelKey || 'label']"
:value=
"opt[item.valueKey || 'value']"
/>
<!-- Select (支持 dictType / api / options) -->
<el-select
v-else-if=
"item.type === 'select'"
v-model=
"localModel[item.prop]"
:multiple=
"!!item.multiple"
:placeholder=
"item.placeholder || `请选择$
{item.label}`"
:clearable="true" filterable :loading="remoteLoading[item.prop] || false" @change="() => { }"
@focus="() => loadRemoteOptions(item)"
@filter-change="(keyword) => handleFilterChange(keyword, item)">
<el-option
v-for=
"opt in getSelectOptions(item)"
:key=
"opt.value"
:label=
"opt.label"
:value=
"opt.value"
/>
</el-select>
</el-form-item>
</el-col>
<!-- Static Select / Dict Select -->
<el-col
:xs=
"24"
:sm=
"12"
:md=
"6"
:lg=
"6"
v-else-if=
"item.type === 'select'"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
:rules=
"item.rules"
>
<el-select
v-model=
"formModel[item.prop]"
:placeholder=
"item.placeholder || `请选择$
{item.label}`"
clearable :filterable="item.filterable !== false" :multiple="item.multiple"
:no-match-text="item.noMatchText || '无匹配数据'">
<el-option
v-for=
"opt in item.options"
:key=
"opt[item.valueKey || 'value']"
:label=
"opt[item.labelKey || 'label']"
:value=
"opt[item.valueKey || 'value']"
/>
</el-select>
</el-form-item>
</el-col>
<!-- Date -->
<el-date-picker
v-else-if=
"item.type === 'date'"
v-model=
"localModel[item.prop]"
type=
"date"
:placeholder=
"`选择$
{item.label}`" value-format="YYYY-MM-DD" style="width: 100%"
:disabled-date="getDisabledDateFn(item)" @change="() => { }" />
<!-- Daterange -->
<el-date-picker
v-else-if=
"item.type === 'daterange'"
v-model=
"localModel[item.prop]"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"YYYY-MM-DD"
:disabled-date=
"getDisabledDateFn(item)"
style=
"width: 100%"
@
change=
"() =>
{ }" />
<!-- Checkbox Group -->
<el-col
:xs=
"24"
:sm=
"12"
:md=
"6"
:lg=
"6"
v-else-if=
"item.type === 'checkbox-group'"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
>
<el-checkbox-group
v-model=
"formModel[item.prop]"
>
<el-checkbox
v-for=
"opt in item.options"
:key=
"opt[item.valueKey || 'value']"
:label=
"opt[item.valueKey || 'value']"
>
{{
opt
[
item
.
labelKey
||
'label'
]
}}
<el-checkbox-group
v-else-if=
"item.type === 'checkbox-group'"
v-model=
"localModel[item.prop]"
@
change=
"() =>
{ }">
<el-checkbox
v-for=
"opt in getSelectOptions(item)"
:key=
"opt.value"
:label=
"opt.value"
>
{{
opt
.
label
}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<!-- Date -->
<el-col
:xs=
"24"
:sm=
"12"
:md=
"6"
:lg=
"6"
v-else-if=
"item.type === 'date'"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
>
<el-date-picker
v-model=
"formModel[item.prop]"
type=
"date"
:placeholder=
"item.placeholder || `请选择$
{item.label}`" :format="item.format || 'YYYY-MM-DD'"
:value-format="item.valueFormat || 'YYYY-MM-DD'" style="width: 100%" clearable />
</el-form-item>
</el-col>
<!-- Date Range -->
<el-col
:xs=
"24"
:sm=
"12"
:md=
"6"
:lg=
"6"
v-else-if=
"item.type === 'daterange'"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
>
<el-date-picker
v-model=
"formModel[item.prop]"
type=
"daterange"
:range-separator=
"item.rangeSeparator || '至'"
:start-placeholder=
"item.startPlaceholder || '开始日期'"
:end-placeholder=
"item.endPlaceholder || '结束日期'"
format=
"YYYY-MM-DD"
value-format=
"YYYY-MM-DD"
clearable
/>
<span
v-else
>
Unsupported type:
{{
item
.
type
}}
</span>
</el-form-item>
</el-col>
</
template
>
</el-row>
</el-form>
</
template
>
<
script
setup
>
import
{
reactive
,
onMounted
,
onUnmounted
}
from
'vue'
import
{
ref
,
watch
,
onMounted
,
nextTick
,
computed
}
from
'vue'
import
{
ElMessage
}
from
'element-plus'
// 🔑 引入你的字典方法
import
useDictStore
from
'@/store/modules/dict'
import
{
getDicts
}
from
'@/api/system/dict/data'
import
request
from
'@/utils/request'
import
{
loadDicts
,
getDictOptions
}
from
'@/utils/useDict'
import
dayjs
from
'dayjs'
// ==================== 工具函数:深拷贝配置(保留函数) ====================
function
deepCloneConfig
(
obj
)
{
if
(
obj
===
null
||
typeof
obj
!==
'object'
)
return
obj
if
(
Array
.
isArray
(
obj
))
return
obj
.
map
(
deepCloneConfig
)
const
cloned
=
{}
for
(
const
key
in
obj
)
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
obj
,
key
))
{
const
val
=
obj
[
key
]
cloned
[
key
]
=
typeof
val
===
'function'
?
val
:
deepCloneConfig
(
val
)
}
}
return
cloned
}
function
parseToDate
(
str
)
{
if
(
!
str
)
return
null
if
(
str
===
'today'
)
{
return
dayjs
().
startOf
(
'day'
)
}
if
(
typeof
str
===
'string'
)
{
const
d
=
dayjs
(
str
)
return
d
.
isValid
()
?
d
.
startOf
(
'day'
)
:
null
}
if
(
str
instanceof
Date
)
{
return
dayjs
(
str
).
startOf
(
'day'
)
}
return
null
}
// ==================== 生成 disabledDate 函数 ====================
function
getDisabledDateFn
(
item
)
{
const
{
minDate
,
maxDate
}
=
item
const
selectRefs
=
reactive
({})
// 如果都没有限制,返回 null(不禁用任何日期)
if
(
minDate
==
null
&&
maxDate
==
null
)
{
return
()
=>
false
}
// 新增 handleChange
function
handleChange
(
item
,
value
)
{
// 如果是多选,value 是数组;单选是值
// 这里不需要处理值,因为 v-model 已绑定
return
(
date
)
=>
{
const
currentDate
=
dayjs
(
date
).
startOf
(
'day'
)
let
minD
=
null
let
maxD
=
null
// 清空 filter 输入框
nextTick
(()
=>
{
const
ref
=
selectRefs
[
item
.
prop
]
if
(
ref
&&
typeof
ref
.
inputValue
===
'string'
)
{
ref
.
inputValue
=
''
// 解析最小日期
if
(
minDate
!=
null
)
{
if
(
typeof
minDate
===
'function'
)
{
const
val
=
minDate
(
localModel
.
value
)
minD
=
parseToDate
(
val
)
}
else
{
minD
=
parseToDate
(
minDate
)
}
}
// 解析最大日期
if
(
maxDate
!=
null
)
{
if
(
typeof
maxDate
===
'function'
)
{
const
val
=
maxDate
(
localModel
.
value
)
maxD
=
parseToDate
(
val
)
}
else
{
maxD
=
parseToDate
(
maxDate
)
}
}
// 判断是否被禁用
if
(
minD
&&
currentDate
.
isBefore
(
minD
))
{
return
true
}
if
(
maxD
&&
currentDate
.
isAfter
(
maxD
))
{
return
true
}
return
false
}
})
}
// ========================
// 工具函数
// ========================
const
formModel
=
reactive
({})
// ==================== Props & Emits ====================
const
props
=
defineProps
({
config
:
{
type
:
Array
,
required
:
true
}
modelValue
:
{
type
:
Object
,
default
:
()
=>
({})
},
config
:
{
type
:
Array
,
default
:
()
=>
[]
},
isSearch
:
{
type
:
Boolean
,
default
:
false
}
})
// 防抖定时器 Map
const
debounceMap
=
new
Map
()
// 搜索缓存 Map: key = `${prop}:${keyword}`, value = option list
const
searchCache
=
new
Map
()
const
emit
=
defineEmits
([
'update:modelValue'
])
// ========================
// 数字输入处理
// ========================
function
handleNumberInput
(
value
,
item
)
{
const
{
inputType
=
'text'
,
decimalDigits
=
2
}
=
item
if
(
inputType
===
'text'
)
{
formModel
[
item
.
prop
]
=
value
return
// ==================== Refs ====================
const
formRef
=
ref
(
null
)
const
localModel
=
ref
({})
const
internalConfig
=
ref
([])
const
remoteOptions
=
ref
({})
// { prop: [options] }
const
remoteLoading
=
ref
({})
// { prop: boolean }
// ==================== 条件显隐 & 规则 ====================
const
visibleConfig
=
computed
(()
=>
{
return
internalConfig
.
value
.
filter
(
item
=>
{
if
(
typeof
item
.
visible
===
'function'
)
{
return
item
.
visible
(
localModel
.
value
)
}
return
true
})
})
let
result
=
String
(
value
)
if
(
inputType
===
'integer'
)
{
result
=
result
.
replace
(
/
[^\d]
/g
,
''
)
}
else
if
(
inputType
===
'decimal'
)
{
result
=
result
.
replace
(
/
[^\d
.
]
/g
,
''
).
replace
(
/^
\.
/
,
''
)
const
parts
=
result
.
split
(
'.'
)
if
(
parts
.
length
>
2
)
result
=
parts
[
0
]
+
'.'
+
parts
.
slice
(
1
).
join
(
''
)
}
else
if
(
inputType
===
'signed-decimal'
)
{
result
=
result
.
replace
(
/
[^\d
.-
]
/g
,
''
)
if
(
result
.
startsWith
(
'--'
))
result
=
'-'
+
result
.
slice
(
2
)
if
(
result
.
includes
(
'-'
)
&&
!
result
.
startsWith
(
'-'
))
result
=
result
.
replace
(
/-/g
,
''
)
result
=
result
.
replace
(
/^
\.
/
,
''
)
const
parts
=
result
.
split
(
'.'
)
if
(
parts
.
length
>
2
)
result
=
parts
[
0
]
+
'.'
+
parts
.
slice
(
1
).
join
(
''
)
const
formRules
=
computed
(()
=>
{
const
rules
=
{}
visibleConfig
.
value
.
forEach
(
item
=>
{
if
(
item
.
rules
)
rules
[
item
.
prop
]
=
item
.
rules
})
return
rules
})
// ==================== 双向绑定 ====================
watch
(()
=>
props
.
modelValue
,
(
newVal
)
=>
{
if
(
newVal
&&
typeof
newVal
===
'object'
)
{
localModel
.
value
=
{
...
newVal
}
}
},
{
immediate
:
true
,
deep
:
true
})
if
((
inputType
===
'decimal'
||
inputType
===
'signed-decimal'
)
&&
decimalDigits
>=
0
)
{
const
dotIndex
=
result
.
indexOf
(
'.'
)
if
(
dotIndex
!==
-
1
)
{
const
integerPart
=
result
.
slice
(
0
,
dotIndex
)
let
decimalPart
=
result
.
slice
(
dotIndex
+
1
).
slice
(
0
,
decimalDigits
)
result
=
integerPart
+
(
decimalPart
?
'.'
+
decimalPart
:
''
)
watch
(
localModel
,
(
newVal
)
=>
{
if
(
props
.
modelValue
!==
undefined
)
{
emit
(
'update:modelValue'
,
{
...
newVal
})
}
},
{
deep
:
true
})
// ==================== 加载字典选项 ====================
async
function
loadDictOptions
(
dictType
)
{
const
dictStore
=
useDictStore
()
let
options
=
dictStore
.
getDict
(
dictType
)
if
(
options
&&
options
.
length
>
0
)
{
return
options
}
formModel
[
item
.
prop
]
=
result
try
{
const
resp
=
await
getDicts
(
dictType
)
options
=
resp
.
data
.
map
(
p
=>
({
label
:
p
.
itemLabel
,
value
:
p
.
itemValue
}))
dictStore
.
setDict
(
dictType
,
options
)
return
options
}
catch
(
err
)
{
console
.
error
(
`加载字典
${
dictType
}
失败`
,
err
)
ElMessage
.
error
(
`字典
${
dictType
}
加载失败`
)
return
[]
}
}
// ========================
// 远程选项请求
// ========================
async
function
fetchOptions
(
item
,
keyword
=
''
)
{
const
payload
=
{
...(
item
.
requestParams
||
{}),
pageNo
:
item
.
pageNo
||
1
,
pageSize
:
item
.
pageSize
||
20
// ==================== 初始化 ====================
onMounted
(
async
()
=>
{
internalConfig
.
value
=
deepCloneConfig
(
props
.
config
)
const
initialData
=
{}
const
dictTypePromises
=
[]
for
(
const
item
of
internalConfig
.
value
)
{
const
key
=
item
.
prop
if
(
localModel
.
value
[
key
]
==
null
)
{
if
(
item
.
multiple
)
{
initialData
[
key
]
=
item
.
defaultValue
??
[]
}
else
if
([
'checkbox-group'
,
'daterange'
].
includes
(
item
.
type
))
{
initialData
[
key
]
=
item
.
defaultValue
??
[]
}
else
{
initialData
[
key
]
=
item
.
defaultValue
??
''
}
if
(
keyword
)
{
const
keyField
=
item
.
keywordField
||
'keyword'
payload
[
keyField
]
=
keyword
.
trim
()
}
const
res
=
await
request
({
url
:
item
.
api
,
method
:
item
.
method
||
'POST'
,
data
:
payload
// 预加载 dictType
if
(
item
.
type
===
'select'
&&
item
.
dictType
)
{
dictTypePromises
.
push
(
loadDictOptions
(
item
.
dictType
).
then
(
opts
=>
{
remoteOptions
.
value
[
key
]
=
opts
})
)
}
else
if
(
item
.
type
===
'select'
&&
item
.
options
)
{
remoteOptions
.
value
[
key
]
=
[...
item
.
options
]
}
// api 类型:延迟加载(focus 时)
}
let
list
=
[]
if
(
typeof
item
.
transform
===
'function'
)
{
list
=
item
.
transform
(
res
)
}
else
if
(
res
?.
data
?.
records
)
{
list
=
res
.
data
.
records
}
else
if
(
res
?.
data
?.
list
)
{
list
=
res
.
data
.
list
}
else
if
(
Array
.
isArray
(
res
?.
data
))
{
list
=
res
.
data
}
else
if
(
res
?.
data
?.
data
&&
Array
.
isArray
(
res
.
data
.
data
))
{
list
=
res
.
data
.
data
}
return
list
}
// ========================
// 远程搜索逻辑
// ========================
function
handleSelectFilter
(
item
,
query
)
{
// 清除旧防抖
if
(
debounceMap
.
has
(
item
.
prop
))
{
clearTimeout
(
debounceMap
.
get
(
item
.
prop
))
if
(
Object
.
keys
(
initialData
).
length
>
0
)
{
localModel
.
value
=
{
...
localModel
.
value
,
...
initialData
}
}
const
timer
=
setTimeout
(()
=>
{
doRemoteSearch
(
item
,
query
)
},
item
.
debounceWait
??
300
)
// 等待所有字典加载完成
await
Promise
.
allSettled
(
dictTypePromises
)
}
)
debounceMap
.
set
(
item
.
prop
,
timer
)
// ==================== 获取 select 选项 ====================
function
getSelectOptions
(
item
)
{
return
remoteOptions
.
value
[
item
.
prop
]
||
[]
}
async
function
doRemoteSearch
(
item
,
keyword
)
{
const
cacheKey
=
`
${
item
.
prop
}
:
${
keyword
}
`
if
(
searchCache
.
has
(
cacheKey
))
{
item
.
_allOptions
=
searchCache
.
get
(
cacheKey
)
return
}
// ==================== 加载远程 API 选项(首次 focus 时加载,无搜索词) ====================
async
function
loadRemoteOptions
(
item
)
{
const
{
prop
,
api
,
requestParams
=
{},
keywordField
,
debounceWait
,
...
rest
}
=
item
if
(
!
api
||
remoteOptions
.
value
[
prop
]?.
length
>
0
)
return
item
.
loading
=
true
try
{
let
list
=
[]
if
(
!
keyword
.
trim
())
{
list
=
item
.
_fullOptions
||
[]
}
else
{
list
=
await
fetchOptions
(
item
,
keyword
)
}
item
.
_allOptions
=
list
searchCache
.
set
(
cacheKey
,
list
)
}
catch
(
e
)
{
console
.
error
(
`
${
item
.
label
}
搜索失败`
,
e
)
item
.
_allOptions
=
item
.
_fullOptions
||
[]
}
finally
{
item
.
loading
=
false
remoteLoading
.
value
[
prop
]
=
true
// 构造请求体:合并 requestParams + 分页(默认第一页)
const
payload
=
{
...(
requestParams
||
{})
// 注意:此时无 keyword,所以不加 keywordField
}
}
// ========================
// 下拉展开时懒加载全量
// ========================
function
handleVisibleChange
(
item
,
visible
)
{
if
(
visible
&&
!
item
.
_hasLoadedFull
)
{
item
.
loading
=
true
fetchOptions
(
item
,
''
)
.
then
(
list
=>
{
item
.
_allOptions
=
list
item
.
_fullOptions
=
list
item
.
_hasLoadedFull
=
true
searchCache
.
set
(
`
${
item
.
prop
}
:`
,
list
)
// 缓存空关键词
})
.
catch
(
e
=>
{
console
.
error
(
'加载默认选项失败'
,
e
)
item
.
_allOptions
=
[]
})
.
finally
(()
=>
{
item
.
loading
=
false
const
res
=
await
request
({
url
:
api
,
method
:
'post'
,
// ← 改为 POST
data
:
payload
// ← 参数放 body
})
const
list
=
typeof
item
.
transform
===
'function'
?
item
.
transform
(
res
)
:
res
.
data
?.
records
||
res
.
data
||
[]
remoteOptions
.
value
[
prop
]
=
list
.
map
(
i
=>
({
value
:
i
[
item
.
valueKey
||
'value'
],
label
:
i
[
item
.
labelKey
||
'label'
]
}))
}
catch
(
err
)
{
ElMessage
.
error
(
`加载
${
item
.
label
}
失败`
)
remoteOptions
.
value
[
prop
]
=
[]
}
finally
{
remoteLoading
.
value
[
prop
]
=
false
}
}
// ========================
// 初始化
// ========================
onMounted
(
async
()
=>
{
const
dictTypes
=
[]
const
dictItems
=
[]
// ==================== 远程搜索(带关键词,防抖) ====================
let
searchTimeout
=
null
function
handleFilterChange
(
keyword
,
item
)
{
const
{
prop
,
api
,
requestParams
=
{},
keywordField
=
'keyword'
,
debounceWait
=
300
}
=
item
if
(
!
api
)
return
for
(
const
item
of
props
.
config
)
{
// 初始化表单值
if
([
'checkbox-group'
,
'daterange'
].
includes
(
item
.
type
))
{
formModel
[
item
.
prop
]
=
item
.
defaultValue
??
[]
}
else
{
formModel
[
item
.
prop
]
=
item
.
defaultValue
??
''
}
if
(
item
.
type
===
'select'
&&
item
.
api
)
{
item
.
_allOptions
=
[]
item
.
_fullOptions
=
[]
item
.
loading
=
true
clearTimeout
(
searchTimeout
)
searchTimeout
=
setTimeout
(
async
()
=>
{
try
{
const
list
=
await
fetchOptions
(
item
,
''
)
// 无关键词,加载默认列表
item
.
_allOptions
=
list
item
.
_fullOptions
=
list
item
.
_hasLoadedFull
=
true
searchCache
.
set
(
`
${
item
.
prop
}
:`
,
list
)
// 缓存空关键词结果
}
catch
(
e
)
{
console
.
error
(
`预加载
${
item
.
label
}
默认选项失败`
,
e
)
item
.
_allOptions
=
[]
}
finally
{
item
.
loading
=
false
}
}
// 处理数字输入
if
(
item
.
type
===
'input'
&&
item
.
inputType
&&
item
.
inputType
!==
'text'
)
{
handleNumberInput
(
formModel
[
item
.
prop
],
item
)
}
remoteLoading
.
value
[
prop
]
=
true
// 收集字典项
if
(
item
.
type
===
'select'
&&
item
.
dictType
)
{
dictTypes
.
push
(
item
.
dictType
)
dictItems
.
push
(
item
)
// 构造请求体:requestParams + 分页 + 动态关键词字段
const
payload
=
{
...(
requestParams
||
{}),
[
keywordField
]:
keyword
// ← 动态字段名,如 name / companyName
}
const
res
=
await
request
({
url
:
api
,
method
:
'post'
,
// ← POST 请求
data
:
payload
// ← body 传参
})
const
list
=
typeof
item
.
transform
===
'function'
?
item
.
transform
(
res
)
:
res
.
data
?.
records
||
res
.
data
||
[]
remoteOptions
.
value
[
prop
]
=
list
.
map
(
i
=>
({
value
:
i
[
item
.
valueKey
||
'value'
],
label
:
i
[
item
.
labelKey
||
'label'
]
}))
}
catch
(
err
)
{
ElMessage
.
error
(
`搜索
${
item
.
label
}
失败`
)
}
finally
{
remoteLoading
.
value
[
prop
]
=
false
}
},
debounceWait
)
}
// 加载字典
if
(
dictTypes
.
length
>
0
)
{
await
loadDicts
(
dictTypes
)
for
(
const
item
of
dictItems
)
{
item
.
options
=
getDictOptions
(
item
.
dictType
)
// ==================== 数字输入处理 ====================
function
handleNumberInput
(
value
,
item
)
{
const
{
inputType
=
'text'
,
decimalDigits
=
2
,
prop
}
=
item
if
(
!
prop
)
return
let
result
=
String
(
value
??
''
).
trim
()
if
(
inputType
===
'integer'
)
{
result
=
result
.
replace
(
/
[^\d]
/g
,
''
)
}
else
if
(
inputType
===
'decimal'
)
{
result
=
result
.
replace
(
/
[^\d
.
]
/g
,
''
).
replace
(
/^
\.
/
,
''
)
const
parts
=
result
.
split
(
'.'
)
if
(
parts
.
length
>
2
)
{
result
=
parts
[
0
]
+
'.'
+
parts
.
slice
(
1
).
join
(
''
)
}
if
(
result
.
includes
(
'.'
))
{
const
[
intPart
,
decPart
]
=
result
.
split
(
'.'
)
const
trimmedDec
=
decPart
.
slice
(
0
,
decimalDigits
)
result
=
intPart
+
(
trimmedDec
?
'.'
+
trimmedDec
:
''
)
if
(
result
.
endsWith
(
'.'
))
result
=
result
.
slice
(
0
,
-
1
)
}
}
})
// ========================
// 清理
// ========================
onUnmounted
(()
=>
{
debounceMap
.
forEach
(
timer
=>
clearTimeout
(
timer
))
debounceMap
.
clear
()
searchCache
.
clear
()
})
localModel
.
value
=
{
...
localModel
.
value
,
[
prop
]:
result
}
}
// ========================
// 暴露方法
// ========================
// ==================== 暴露方法 ====================
defineExpose
({
async
validate
()
{
// 如果你有 el-form ref,可加校验;否则直接返回
return
formModel
},
getSearchParams
()
{
const
params
=
{}
for
(
const
key
in
formModel
)
{
const
val
=
formModel
[
key
]
if
(
val
===
''
||
val
===
null
||
val
===
undefined
)
continue
if
(
Array
.
isArray
(
val
)
&&
val
.
length
===
0
)
continue
params
[
key
]
=
val
}
return
params
return
{
...
localModel
.
value
}
},
getFormData
()
{
return
{
...
localModel
.
value
}
},
async
validate
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
formRef
.
value
?.
validate
((
valid
)
=>
{
if
(
valid
)
resolve
(
localModel
.
value
)
else
reject
(
new
Error
(
'Validation failed'
))
})
})
},
resetForm
()
{
props
.
config
.
forEach
(
item
=>
{
const
resetData
=
{}
internalConfig
.
value
.
forEach
(
item
=>
{
const
key
=
item
.
prop
if
([
'checkbox-group'
,
'daterange'
].
includes
(
item
.
type
))
{
formModel
[
item
.
prop
]
=
[]
resetData
[
key
]
=
item
.
defaultValue
??
[]
}
else
{
formModel
[
item
.
prop
]
=
''
resetData
[
key
]
=
item
.
defaultValue
??
''
}
})
},
getRawForm
()
{
return
{
...
formModel
}
localModel
.
value
=
{
...
resetData
}
nextTick
(()
=>
formRef
.
value
?.
clearValidate
())
}
})
</
script
>
<
style
scoped
>
.search-form-item
{
margin-bottom
:
20px
;
}
</
style
>
\ No newline at end of file
src/views/financialCenter/financialBilling.vue
View file @
eb0cc621
...
...
@@ -101,8 +101,8 @@
</el-table>
</template>
</CommonPage>
<!--
弹窗
-->
<CommonDialog
dialogTitle=
'
弹窗
'
dialogWidth=
'80%'
:openDialog=
dialogFlag
:showAction=
'false'
:showClose=
'true'
<!--
新增出账检核页面
-->
<CommonDialog
dialogTitle=
'
新增出账检核
'
dialogWidth=
'80%'
:openDialog=
dialogFlag
:showAction=
'false'
:showClose=
'true'
@
close=
'dialogFlag = false'
>
</CommonDialog>
...
...
@@ -118,7 +118,9 @@ import { ElMessage } from 'element-plus'
import
{
formatCurrency
}
from
'@/utils/number'
// 接口
import
{
getPolicyFortuneList
}
from
'@/api/financial/commission'
import
useUserStore
from
'@/store/modules/user'
const
userStore
=
useUserStore
()
// 分页相关
const
currentPage
=
ref
(
1
)
const
pageSize
=
ref
(
10
)
...
...
@@ -134,10 +136,10 @@ const searchConfig = ref([
},
{
type
:
'select'
,
prop
:
'status'
,
label
:
'
入
账状态'
,
label
:
'
出
账状态'
,
multiple
:
true
,
dictType
:
'csf_
expected_commission
_status'
},
{
dictType
:
'csf_
fortune
_status'
},{
type
:
'select'
,
prop
:
'insuranceCompanyBizIdList'
,
label
:
'保险公司'
,
...
...
@@ -158,7 +160,10 @@ const searchConfig = ref([
label
:
'产品计划'
,
api
:
'/product/api/relProjectProductLaunch/parameter/page'
,
keywordField
:
'productName'
,
requestParams
:
{
fieldBizId
:
'field_olk1qZe81qHHKXbw'
,
fieldValueBizId
:
'field_value_uOfJH5ucA2YwJpbn'
,
pageNo
:
1
,
pageSize
:
20
},
requestParams
:
{
tenantBizId
:
userStore
.
projectInfo
.
tenantBizId
||
''
,
projectBizId
:
userStore
.
projectInfo
.
projectBizId
||
''
,
fieldBizId
:
'field_olk1qZe81qHHKXbw'
,
fieldValueBizId
:
'field_value_uOfJH5ucA2YwJpbn'
,
pageNo
:
1
,
pageSize
:
20
},
placeholder
:
'输入产品计划名称搜索'
,
debounceWait
:
500
,
// 自定义防抖时间
valueKey
:
'productLaunchBizId'
,
...
...
@@ -172,13 +177,14 @@ const searchConfig = ref([
label
:
'出账日(估)'
,
startPlaceholder
:
'开始时间'
,
endPlaceholder
:
'结束时间'
},
{
type
:
'select'
,
prop
:
'status'
,
label
:
'出账状态'
,
multiple
:
true
,
dictType
:
'csf_fortune_status'
},
// {
// type: 'select',
// prop: 'status',
// label: '入账状态',
// multiple: true,
// dictType: 'csf_expected_commission_status'
// },
])
// 表格操作菜单
const
dropdownItems
=
[
...
...
@@ -209,7 +215,7 @@ const handleReset = () => {
console
.
log
(
'表单已重置'
)
}
const
handleQuery
=
async
()
=>
{
const
params
=
searchFormRef
.
value
.
get
SearchParams
()
const
params
=
searchFormRef
.
value
.
get
FormData
()
console
.
log
(
'父组件发起查询:'
,
params
)
loadTableData
(
params
)
}
...
...
src/views/financialCenter/financialIncome.vue
View file @
eb0cc621
...
...
@@ -93,7 +93,7 @@
<el-table-column
prop=
"policyNo"
label=
"保单号"
width=
"120"
sortable
/>
<el-table-column
prop=
"reconciliationCompany"
label=
"对账公司"
width=
"120"
sortable
/>
<el-table-column
prop=
"commissionDate"
label=
"入账日"
width=
"120"
sortable
/>
<el-table-column
prop=
"status"
label=
"
比对状态"
width=
"120"
sortable
/>
<el-table-column
prop=
"status"
label=
"
入账状态"
width=
"120"
sortable
:formatter=
"formatStatus"
/>
<el-table-column
prop=
"currentCommissionRatio"
label=
"本次入账比例"
width=
"130"
sortable
/>
<el-table-column
prop=
"periodPaidRatio"
label=
"累积入账比例"
width=
"130"
sortable
/>
<el-table-column
prop=
"periodPendingRatio"
label=
"待入账比例"
width=
"120"
sortable
/>
...
...
@@ -125,12 +125,13 @@
</el-table>
<!-- 表格操作菜单 -->
<div
class=
"tableOptionContainer"
>
<el-button
type=
"primary"
:icon=
"Select"
>
生成可出账记录
</el-button>
<el-button
type=
"primary"
:icon=
"Select"
:disabled=
"updatePayRollStatusDisable"
@
click=
"generateCommissionRecordapi"
>
生成可出账记录
</el-button>
</div>
</template>
</CommonPage>
<!-- 开始检核弹窗-->
<CommonDialog
dialogTitle=
'开始检核'
dialogWidth=
'80%'
:openDialog=
dialogFlag
:showAction=
'
tru
e'
:showClose=
'true'
<CommonDialog
dialogTitle=
'开始检核'
dialogWidth=
'80%'
:openDialog=
dialogFlag
:showAction=
'
fals
e'
:showClose=
'true'
@
close=
'dialogFlag = false'
>
<el-row>
<el-col
:xs=
"24"
:sm=
"24"
:md=
"24"
:lg=
"24"
>
...
...
@@ -139,12 +140,12 @@
</el-row>
<el-row
:gutter=
"10"
>
<el-col
:xs=
"24"
:sm=
"12"
:md=
"3"
:lg=
"3"
>
<el-button
type=
"primary"
:icon=
"Plus"
:disabled=
"!checkFormRef?.get
SearchParams
().reconciliationYearMonth"
@
click=
"addCheckRecordDialogFlag = true"
>
新增
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
:disabled=
"!checkFormRef?.get
FormData
().reconciliationYearMonth"
@
click=
"addCheckRecordDialogFlag = true
; searchParams = checkFormRef.getFormData()
"
>
新增
</el-button>
</el-col>
<el-col
:xs=
"24"
:sm=
"24"
:md=
"3"
:lg=
"3"
>
<el-button
type=
"primary"
:icon=
"Upload"
:disabled=
"!checkFormRef?.get
SearchParams
().reconciliationYearMonth"
@
click=
"fileUploadDialogFlag = true"
>
导入
</el-button>
<el-button
type=
"primary"
:icon=
"Upload"
:disabled=
"!checkFormRef?.get
FormData
().reconciliationYearMonth"
@
click=
"fileUploadDialogFlag = true
; searchParams = checkFormRef.getFormData()
"
>
导入
</el-button>
</el-col>
<el-col
:xs=
"24"
:sm=
"24"
:md=
"3"
:lg=
"3"
>
<el-button
link
type=
"primary"
>
下载导入模板
</el-button>
...
...
@@ -153,18 +154,18 @@
<el-row
:gutter=
"10"
>
<el-col
:xs=
"24"
:sm=
"24"
:md=
"24"
:lg=
"24"
>
<el-table
:data=
"checkRecordTableData"
style=
"width: 100%"
>
<el-table-column
prop=
"
nam
e"
label=
"应收款类型"
width=
"120"
/>
<el-table-column
prop=
"
state
"
label=
"应收款编号"
width=
"120"
/>
<el-table-column
prop=
"
city
"
label=
"关联保单号"
width=
"120"
/>
<el-table-column
prop=
"
address"
label=
"佣金期数
"
width=
"120"
/>
<el-table-column
prop=
"
zip"
label=
"总
期数"
width=
"120"
/>
<el-table-column
prop=
"
zip"
label=
"入账日(估)
"
width=
"120"
/>
<el-table-column
prop=
"
zip
"
label=
"入账日(实)"
width=
"120"
/>
<el-table-column
prop=
"
zip
"
label=
"入账金额"
width=
"120"
/>
<el-table-column
prop=
"
zip
"
label=
"入账币种"
width=
"120"
/>
<el-table-column
prop=
"
zip
"
label=
"入账项目"
width=
"120"
/>
<el-table-column
prop=
"
zip
"
label=
"对账公司"
width=
"120"
/>
<
el-table-column
prop=
"zip"
label=
"入账状态"
width=
"120"
/
>
<el-table-column
prop=
"
commissionBizTyp
e"
label=
"应收款类型"
width=
"120"
/>
<el-table-column
prop=
"
receivableNo
"
label=
"应收款编号"
width=
"120"
/>
<el-table-column
prop=
"
policyNo
"
label=
"关联保单号"
width=
"120"
/>
<el-table-column
prop=
"
status"
label=
"比对状态
"
width=
"120"
/>
<el-table-column
prop=
"
commissionPeriod"
label=
"佣金
期数"
width=
"120"
/>
<el-table-column
prop=
"
totalPeriod"
label=
"总期数
"
width=
"120"
/>
<el-table-column
prop=
"
commissionDate
"
label=
"入账日(实)"
width=
"120"
/>
<el-table-column
prop=
"
amount
"
label=
"入账金额"
width=
"120"
/>
<el-table-column
prop=
"
currency
"
label=
"入账币种"
width=
"120"
/>
<el-table-column
prop=
"
commissionName
"
label=
"入账项目"
width=
"120"
/>
<el-table-column
prop=
"
reconciliationCompany
"
label=
"对账公司"
width=
"120"
/>
<
!-- <el-table-column prop="zip" label="入账状态" width="120" /> --
>
<el-table-column
fixed=
"right"
label=
"操作"
min-width=
"120"
>
<
template
#
default
>
<el-button
link
type=
"primary"
size=
"small"
@
click=
"checkRecordEdit(row)"
>
...
...
@@ -178,21 +179,10 @@
</el-row>
</CommonDialog>
<!-- 新增检核记录弹窗 -->
<CommonDialog
dialogTitle=
'新增检核记录'
dialogWidth=
'80%'
:openDialog=
addCheckRecordDialogFlag
:showAction=
'true'
:showClose=
'true'
@
close=
'addCheckRecordDialogFlag = false'
>
:showClose=
'true'
@
close=
'addCheckRecordDialogFlag = false'
@
confirm=
'handleAddCheckRecord()'
>
<el-row>
<el-col
:xs=
"24"
:sm=
"24"
:md=
"24"
:lg=
"24"
>
<SearchForm
ref=
"addCheckRecordFormRef"
:config=
"addCheckRecordConfig"
/>
...
...
@@ -201,28 +191,46 @@
</CommonDialog>
<CommonDialog
dialogTitle=
'文件导入'
dialogWidth=
'80%'
:openDialog=
fileUploadDialogFlag
:showAction=
'true'
:showClose=
'true'
@
close=
'fileUploadDialogFlag = false'
>
<FileUpload
v-model=
"files"
:data=
"{ reconciliationYearMonth: checkFormRef?.getSearchParams().reconciliationYearMonth }"
:file-type=
"['xlsx','xls']"
:action=
"'/csf/api/commission/upload/excel'"
:limit=
"1"
/>
:showClose=
'true'
@
close=
'fileUploadDialogFlag = false; files = ""'
>
<FileUpload
v-model=
"files"
:data=
"{ headerRow: 0 }"
:file-type=
"['xlsx', 'xls']"
:action=
"'/oss/api/excel/import'"
:limit=
"1"
:fileSize=
"15"
/>
</CommonDialog>
<!-- 设置比对状态 -->
<CommonDialog
dialogTitle=
'设置比对状态'
dialogWidth=
'80%'
:openDialog=
setCompareStatusDialogFlag
:showAction=
'true'
:showClose=
'true'
@
close=
'setCompareStatusDialogFlag = false;'
>
<SearchForm
ref=
"setCompareStatusFormRef"
:config=
"setCompareStatusConfig"
/>
</CommonDialog>
<!-- 更新数据 -->
<CommonDialog
dialogTitle=
'更新数据'
dialogWidth=
'80%'
:openDialog=
updateDataDialogFlag
:showAction=
'true'
:showClose=
'true'
@
close=
'updateDataDialogFlag = false;'
>
</CommonDialog>
<!-- 查看记录 -->
<CommonDialog
dialogTitle=
'查看记录'
dialogWidth=
'80%'
:openDialog=
viewRecordDialogFlag
:showAction=
'true'
:showClose=
'true'
@
close=
'viewRecordDialogFlag = false;'
>
</CommonDialog>
</div>
</template>
<
script
setup
>
import
{
ref
,
reactive
}
from
'vue'
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
import
CommonPage
from
'@/components/commonPage'
import
CommonDialog
from
'@/components/commonDialog'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
import
{
ElMessage
}
from
'element-plus'
import
{
formatCurrency
}
from
'@/utils/number'
// 接口
import
{
getPolicyCommissionList
}
from
'@/api/financial/commission'
import
{
Plus
,
Upload
}
from
'@element-plus/icons-vue'
import
{
getPolicyCommissionList
,
generateCommissionRecord
,
addPayrollCheckRecord
,
commissionExpectedRecord
}
from
'@/api/financial/commission'
import
{
Plus
,
Upload
,
Select
}
from
'@element-plus/icons-vue'
import
FileUpload
from
'@/components/FileUpload/index.vue'
import
{
loadDicts
,
getDictLabel
}
from
'@/utils/useDict'
const
files
=
ref
(
''
)
// 分页相关
const
currentPage
=
ref
(
1
)
const
pageSize
=
ref
(
10
)
...
...
@@ -270,13 +278,14 @@ const searchConfig = ref([
endPlaceholder
:
'结束时间'
},
{
type
:
'select'
,
prop
:
'insur
erBizId
'
,
prop
:
'insur
anceCompanyBizIdList
'
,
label
:
'保险公司'
,
api
:
'/insurance/base/api/insuranceCompany/page'
,
keywordField
:
'queryContent'
,
requestParams
:
{
pageNo
:
1
,
pageSize
:
20
},
placeholder
:
'输入保险公司名称搜索'
,
debounceWait
:
500
,
// 自定义防抖时间
multiple
:
true
,
valueKey
:
'insuranceCompanyBizId'
,
labelKey
:
'abbreviation'
,
transform
:
(
res
)
=>
{
...
...
@@ -293,6 +302,24 @@ const searchConfig = ref([
}
])
// 设置比对状态
const
setCompareStatusDialogFlag
=
ref
(
false
)
const
setCompareStatusConfig
=
ref
([
{
type
:
'select'
,
prop
:
'status'
,
label
:
'比对状态'
,
dictType
:
'csf_commission_status'
}
])
const
setCompareStatusFormRef
=
ref
(
null
)
// 更新数据
const
updateDataDialogFlag
=
ref
(
false
)
// 查看记录
const
viewRecordDialogFlag
=
ref
(
false
)
const
fileUploadDialogFlag
=
ref
(
false
)
const
checkRecordTableData
=
ref
([])
...
...
@@ -314,6 +341,22 @@ const checkRecordEdit = (row) => {
console
.
log
(
row
)
}
// 生成可出账记录按钮
const
updatePayRollStatusDisable
=
ref
(
true
)
// 获取入账状态,字典值转化方法
onMounted
(
async
()
=>
{
try
{
await
loadDicts
([
'csf_expected_commission_status'
])
}
catch
(
error
)
{
console
.
error
(
'字典加载失败'
,
error
)
}
finally
{
loading
.
value
=
false
}
})
// 格式化函数(每次渲染都会调用,所以能拿到最新字典)
const
formatStatus
=
(
row
,
column
)
=>
{
return
getDictLabel
(
'csf_expected_commission_status'
,
row
.
status
)
// 实时查缓存
}
// 应收单类型
const
commissionBizTypeOptions
=
[
{
value
:
'R'
,
label
:
'关联保单应收单'
},
...
...
@@ -330,7 +373,7 @@ const addCheckRecordFormRef = ref(null)
const
addCheckRecordConfig
=
ref
([
{
type
:
'select'
,
prop
:
'
reconciliationYearMonth
'
,
prop
:
'
commissionBizType
'
,
label
:
'应收单类型'
,
placeholder
:
'应收单类型'
,
options
:
commissionBizTypeOptions
...
...
@@ -342,7 +385,7 @@ const addCheckRecordConfig = ref([
},
{
type
:
'input'
,
prop
:
'
fortune
Period'
,
prop
:
'
commission
Period'
,
label
:
'佣金期数'
,
inputType
:
'decimal'
,
rules
:
[
...
...
@@ -350,7 +393,7 @@ const addCheckRecordConfig = ref([
]
},
{
type
:
'input'
,
prop
:
'
fortune
Period'
,
prop
:
'
total
Period'
,
label
:
'总期数'
,
inputType
:
'decimal'
,
rules
:
[
...
...
@@ -358,17 +401,12 @@ const addCheckRecordConfig = ref([
]
},
{
type
:
'date'
,
prop
:
'expectedDate'
,
label
:
'入账日(估)'
,
placeholder
:
'请选择'
},
{
type
:
'date'
,
prop
:
'expectedDate'
,
prop
:
'commissionDate'
,
label
:
'入账日(实)'
,
placeholder
:
'请选择'
},
{
type
:
'input'
,
prop
:
'
fortunePeriod
'
,
prop
:
'
amount
'
,
label
:
'入账金额'
,
inputType
:
'decimal'
,
rules
:
[
...
...
@@ -376,13 +414,12 @@ const addCheckRecordConfig = ref([
]
},
{
type
:
'select'
,
prop
:
'
statusList
'
,
prop
:
'
currency
'
,
label
:
'入账币种'
,
multiple
:
true
,
dictType
:
'csf_expected_fortune_status'
dictType
:
'bx_currency_type'
},
{
type
:
'select'
,
prop
:
'
fortune
Name'
,
prop
:
'
commission
Name'
,
label
:
'入账项目'
,
dictType
:
'csf_commission_type'
},
{
...
...
@@ -401,46 +438,61 @@ const addCheckRecordConfig = ref([
console
.
log
(
res
)
return
res
?.
data
.
records
||
[]
}
},
{
type
:
'select'
,
prop
:
'statusList'
,
label
:
'入账状态'
,
multiple
:
true
,
dictType
:
'csf_expected_commission_status'
},
}
])
const
addCheckRecordDialogFlag
=
ref
(
false
)
const
handleAddCheckRecord
=
async
()
=>
{
try
{
const
addCheckSearchParams
=
addCheckRecordFormRef
.
value
.
getFormData
()
const
params
=
{
...
addCheckSearchParams
,
reconciliationYearMonth
:
searchParams
.
value
.
reconciliationYearMonth
}
await
addPayrollCheckRecord
([
params
])
ElMessage
.
success
(
'新增检核记录成功'
)
addCheckRecordDialogFlag
.
value
=
false
checkRecordTableData
.
value
=
[]
checkRecordQuery
()
}
catch
(
error
)
{
console
.
error
(
'新增检核记录失败'
,
error
)
ElMessage
.
error
(
'新增检核记录失败'
)
}
}
// 生成可出账记录
const
generateCommissionRecordapi
=
async
()
=>
{
try
{
const
res
=
await
generateCommissionRecord
({
commissionBizIdList
:
multipleSelection
.
value
.
map
(
item
=>
item
.
commissionBizId
)
})
if
(
res
.
code
===
200
)
{
ElMessage
.
success
(
'生成可出账记录成功'
)
}
else
{
ElMessage
.
error
(
res
.
msg
||
'生成可出账记录失败'
)
}
}
catch
(
error
)
{
console
.
error
(
'生成可出账记录失败'
,
error
)
ElMessage
.
error
(
'生成可出账记录失败'
)
}
}
// 表格操作菜单
const
dropdownItems
=
[
{
label
:
'设置比对状态'
,
value
:
'setStatus'
},
{
label
:
'更新'
,
value
:
'editRecord'
},
{
label
:
'查看记录'
,
value
:
'viewRecord'
},
{
label
:
'更新数据'
,
value
:
'updateData'
},
{
label
:
'更新数据'
,
value
:
'editRecord'
},
{
label
:
'查看记录'
,
value
:
'viewRecord'
}
]
// 统计信息
const
statisticsData
=
ref
({
paidAmountRatio
:
0
,
pendingPaidAmount
:
0
,
totalAmount
:
0
,
totalPaidAmount
:
0
,
totalPolicyCount
:
0
})
const
statisticsData
=
ref
({})
// 弹窗相关
const
dialogFlag
=
ref
(
false
)
// 按钮事件处理
const
handleAdd
=
()
=>
{
//
ElMessage.info('点击新增按钮')
//
开始检核
dialogFlag
.
value
=
true
}
const
handleImport
=
()
=>
{
ElMessage
.
info
(
'点击导入按钮'
)
}
const
handleExport
=
()
=>
{
ElMessage
.
info
(
'点击导出按钮'
)
}
...
...
@@ -451,17 +503,34 @@ const handleReset = () => {
console
.
log
(
'表单已重置'
)
}
const
handleQuery
=
async
()
=>
{
const
params
=
searchFormRef
.
value
.
get
SearchParams
()
const
params
=
searchFormRef
.
value
.
get
FormData
()
console
.
log
(
'父组件发起查询:'
,
params
)
loadTableData
(
params
)
}
// 查询检核记录
const
checkRecordQuery
=
async
()
=>
{
try
{
const
params
=
{
reconciliationYearMonth
:
searchParams
.
value
.
reconciliationYearMonth
}
const
res
=
await
commissionExpectedRecord
(
params
)
checkRecordTableData
.
value
=
res
.
data
.
records
||
[]
}
catch
(
error
)
{
console
.
error
(
'查询检核记录失败'
,
error
)
ElMessage
.
error
(
'查询检核记录失败'
)
}
}
const
multipleSelection
=
ref
([])
const
handleSelectionChange
=
(
val
)
=>
{
multipleSelection
.
value
=
val
console
.
log
(
'全选:'
,
val
)
// 生成可出账记录按钮是否禁用
updatePayRollStatusDisable
.
value
=
val
.
length
===
0
}
const
visibleDefaultButtons
=
ref
([
'add'
,
'
export'
,
'
reset'
,
'query'
])
const
visibleDefaultButtons
=
ref
([
'add'
,
'reset'
,
'query'
])
// 按钮配置
const
operationBtnList
=
ref
([
{
...
...
@@ -470,11 +539,11 @@ const operationBtnList = ref([
label
:
'开始检核'
,
click
:
handleAdd
},
{
key
:
'export'
,
direction
:
'right'
,
click
:
handleExport
},
//
{
//
key: 'export',
//
direction: 'right',
//
click: handleExport
//
},
{
key
:
'reset'
,
direction
:
'right'
,
...
...
@@ -496,7 +565,8 @@ const loadTableData = async (searchParams = {}) => {
pageSize
:
pageSize
.
value
,
...
searchParams
,
commissionDateStart
:
searchParams
.
commissionDate
?.[
0
]
||
undefined
,
commissionDateEnd
:
searchParams
.
commissionDate
?.[
1
]
||
undefined
commissionDateEnd
:
searchParams
.
commissionDate
?.[
1
]
||
undefined
,
commissionDate
:
undefined
}
const
res
=
await
getPolicyCommissionList
(
params
)
tableData
.
value
=
res
.
data
.
page
.
records
||
[]
...
...
@@ -524,8 +594,18 @@ const handleCurrentChange = (val) => {
// 表格数据
const
tableData
=
ref
([])
const
handleSelect
=
(
row
)
=>
{
console
.
log
(
'选中行:'
,
row
)
const
handleSelect
=
(
e
,
row
)
=>
{
console
.
log
(
'选中行:'
,
e
,
row
)
if
(
row
===
'setStatus'
)
{
setCompareStatusDialogFlag
.
value
=
true
return
}
else
if
(
row
===
'editRecord'
)
{
updateDataDialogFlag
.
value
=
true
return
}
else
if
(
row
===
'viewRecord'
)
{
viewRecordDialogFlag
.
value
=
true
return
}
}
...
...
@@ -538,7 +618,8 @@ const handleSelect = (row) => {
margin-top
:
10px
;
}
.el-row
{
margin-bottom
:
10px
;
.el-row
,
.el-col
{
margin-bottom
:
5px
;
}
</
style
>
\ No newline at end of file
src/views/financialCenter/financialSalary.vue
View file @
eb0cc621
...
...
@@ -82,10 +82,8 @@ import {
getReferrerFortuneList
,
salaryStatistics
,
}
from
'@/api/financial/commission'
// import { searchIntermediaries } from '@/api/search'
import
{
formatCurrency
}
from
'@/utils/number'
import
{
debounce
}
from
'@/utils/index'
;
import
{
ElMessageBox
}
from
'element-plus'
import
{
ElMessageBox
,
ElMessage
}
from
'element-plus'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
const
searchFormRef
=
ref
(
null
)
const
searchParams
=
ref
({})
...
...
@@ -115,9 +113,10 @@ const searchConfig = ref([
},
{
type
:
'select'
,
prop
:
'status'
,
prop
:
'status
List
'
,
label
:
'出账状态'
,
dictType
:
'csf_fortune_account_status'
dictType
:
'csf_fortune_account_status'
,
multiple
:
true
,
}
])
// 添加表格引用
...
...
@@ -264,7 +263,7 @@ const getStatusType = status => {
// 查询
const
handleQuery
=
()
=>
{
const
params
=
searchFormRef
.
value
.
get
SearchParams
()
const
params
=
searchFormRef
.
value
.
get
FormData
()
console
.
log
(
'父组件发起查询:'
,
params
)
clearAllSelection
()
getList
(
params
)
...
...
@@ -373,29 +372,7 @@ const fetchCompletePolicyFortune = async row => {
}
catch
(
error
)
{
}
}
const
searchLoading
=
ref
(
false
)
const
brokerOptions
=
ref
([])
// 获取转介人列表
const
loadBrokers
=
async
(
query
=
''
)
=>
{
searchLoading
.
value
=
true
const
params
=
{
realName
:
query
,
pageNo
:
1
,
pageSize
:
1000
,
}
try
{
// const res = await searchIntermediaries(params)
// if (res.code === 200) {
// brokerOptions.value = res.data.records || []
// searchLoading.value = false
// } else {
// brokerOptions.value = []
// searchLoading.value = false
// }
}
catch
(
error
)
{
}
}
debounce
(
loadBrokers
,
500
,
false
)
const
visibleDefaultButtons
=
ref
([
'reset'
,
'query'
])
// 按钮配置
const
operationBtnList
=
ref
([
...
...
src/views/financialCenter/payables.vue
View file @
eb0cc621
...
...
@@ -69,8 +69,9 @@
{{
getFortuneBizTypeLabel
(
row
.
fortuneBizType
)
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"payableNo"
label=
"应付款编号"
width=
"120"
sortable
/>
<el-table-column
prop=
"policyNo"
label=
"保单号"
width=
"120"
sortable
/>
<el-table-column
prop=
"payableNo"
label=
"应付款编号"
width=
"120"
sortable
/>
<el-table-column
prop=
"policyNo"
label=
"保单号"
width=
"120"
sortable
/>
<el-table-column
prop=
"broker"
label=
"转介人"
width=
"120"
sortable
/>
<el-table-column
prop=
"status"
label=
"出账状态"
width=
"120"
sortable
>
<
template
#
default=
"{ row }"
>
{{
getDictLabel
(
'csf_expected_fortune_status'
,
row
.
status
)
}}
...
...
@@ -112,6 +113,7 @@
{{
formatCurrency
(
row
.
unpaidAmount
)
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"broker_ratio"
label=
"持有比例"
width=
"120"
sortable
/>
<el-table-column
prop=
"insurerBizId"
label=
"保险公司"
width=
"120"
sortable
/>
<el-table-column
prop=
"productLaunchBizId"
label=
"产品计划"
width=
"120"
sortable
/>
<el-table-column
prop=
"premium"
label=
"期交保费"
width=
"120"
sortable
>
...
...
@@ -119,6 +121,7 @@
{{
formatCurrency
(
row
.
premium
)
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"statusDesc"
label=
"修改理由"
width=
"150"
/>
<el-table-column
prop=
"remark"
label=
"备注"
width=
"150"
/>
<el-table-column
fixed=
"right"
label=
"操作"
min-width=
"120"
>
<
template
#
default=
"{ row }"
>
...
...
@@ -140,13 +143,25 @@
</template>
</CommonPage>
<!-- 出账记录表格弹窗-->
<
!-- <CommonDialog dialogTitle="出账记录" dialogWidth="80%" :openDialog="payRecordDialogTableVisible" :showAction="fals
e"
<
CommonDialog
dialogTitle=
"出账记录"
dialogWidth=
"80%"
:openDialog=
"payRecordDialogTableVisible"
:showAction=
"tru
e"
:showClose=
"true"
@
close=
"payRecordDialogTableVisible = false"
>
<el-table
:data=
"payRecordDialogTableData"
border
style=
"width: 100%"
>
<el-table-column
v-for=
"item in payRecordDialogTableColumns"
:key=
"item.property"
:property=
"item.property"
:label=
"item.label"
:width=
"item.width"
/>
</el-table>
</CommonDialog> -->
</CommonDialog>
<!-- 新增出账记录 -->
<CommonDialog
dialogTitle=
"新增出账记录"
dialogWidth=
"80%"
:openDialog=
"addPayRecordDialogVisible"
:showAction=
"true"
:showClose=
"true"
@
close=
"addPayRecordDialogVisible = false"
@
confirm=
"handleConfirmAddPayRecord"
>
<SearchForm
ref=
"addPayRecordFormRef"
:config=
"addPayRecordFormConfig"
/>
</CommonDialog>
<!-- 设置出账状态 -->
<CommonDialog
dialogTitle=
"设置出账状态"
dialogWidth=
"80%"
:openDialog=
"setPayRecordStatusDialogVisible"
:showAction=
"false"
:showClose=
"true"
@
close=
"setPayRecordStatusDialogVisible = false"
@
confirm=
"handleConfirmSetPayRecordStatus"
>
<SearchForm
ref=
"setPayRecordStatusFormRef"
:config=
"setPayRecordStatusFormConfig"
/>
</CommonDialog>
</div>
</template>
...
...
@@ -155,10 +170,29 @@ import CommonPage from '@/components/commonPage'
import
{
ref
,
reactive
}
from
'vue'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
formatCurrency
}
from
'@/utils/number'
import
{
expectedFortuneList
,
payRecordList
}
from
'@/api/financial/commission'
import
{
expectedFortuneList
,
payRecordList
,
addPayRecord
,
userSaleExpandDetail
}
from
'@/api/financial/commission'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
import
CommonDialog
from
'@/components/commonDialog'
import
{
getDictLabel
}
from
'@/utils/useDict'
;
import
useUserStore
from
'@/store/modules/user'
// 设置出账状态
const
setPayRecordStatusDialogVisible
=
ref
(
false
)
const
selectedRow
=
ref
(
null
)
const
setPayRecordStatusFormRef
=
ref
(
null
)
const
setPayRecordStatusFormConfig
=
ref
([
{
type
:
'select'
,
prop
:
'status'
,
label
:
'出账状态'
,
dictType
:
'csf_expected_fortune_status'
},
{
type
:
'textarea'
,
prop
:
'statusDesc'
,
label
:
'修改理由'
,
},
])
import
{
getDictLabel
}
from
'@/utils/useDict'
;
const
userStore
=
useUserStore
()
// 应收单类型
const
fortuneBizTypeOptions
=
[
{
value
:
'R'
,
label
:
'关联保单应付单'
},
...
...
@@ -227,7 +261,10 @@ const searchConfig = ref([
label
:
'产品计划'
,
api
:
'/product/api/relProjectProductLaunch/parameter/page'
,
keywordField
:
'productName'
,
requestParams
:
{
fieldBizId
:
'field_olk1qZe81qHHKXbw'
,
fieldValueBizId
:
'field_value_uOfJH5ucA2YwJpbn'
,
pageNo
:
1
,
pageSize
:
20
},
requestParams
:
{
tenantBizId
:
userStore
.
projectInfo
.
tenantBizId
||
''
,
projectBizId
:
userStore
.
projectInfo
.
projectBizId
||
''
,
fieldBizId
:
'field_olk1qZe81qHHKXbw'
,
fieldValueBizId
:
'field_value_uOfJH5ucA2YwJpbn'
,
pageNo
:
1
,
pageSize
:
20
},
placeholder
:
'输入产品计划名称搜索'
,
debounceWait
:
500
,
// 自定义防抖时间
valueKey
:
'productLaunchBizId'
,
...
...
@@ -259,6 +296,141 @@ const searchConfig = ref([
}
},
])
const
payRecordDialogTableVisible
=
ref
(
false
)
// 新增出账记录
const
addPayRecordDialogVisible
=
ref
(
false
)
const
addPayRecordFormRef
=
ref
()
const
addPayRecordFormConfig
=
ref
([
{
type
:
'select'
,
prop
:
'fortuneBizType'
,
label
:
'应付单类型'
,
options
:
[
{
value
:
'R'
,
label
:
'关联保单应付单'
},
{
value
:
'U'
,
label
:
'非关联保单应付单'
}
]
},
{
type
:
'input'
,
prop
:
'policyNo'
,
label
:
'关联保单号'
},
{
type
:
'input'
,
prop
:
'fortunePeriod'
,
label
:
'佣金期数'
,
inputType
:
'decimal'
,
rules
:
[
{
pattern
:
/^
\d
+$/
,
message
:
'只能输入正整数'
,
trigger
:
'blur'
}
]
},
{
type
:
'input'
,
prop
:
'fortuneTotalPeriod'
,
label
:
'总期数'
,
inputType
:
'decimal'
,
rules
:
[
{
pattern
:
/^
\d
+$/
,
message
:
'只能输入正整数'
,
trigger
:
'blur'
}
]
},
{
type
:
'date'
,
prop
:
'payoutDate'
,
label
:
'出账日(估)'
,
placeholder
:
'请选择'
},
{
type
:
'date'
,
prop
:
'actualPayoutDate'
,
label
:
'出账日(实)'
,
placeholder
:
'请选择'
},
{
type
:
'input'
,
prop
:
'amount'
,
label
:
'出账金额'
,
inputType
:
'decimal'
,
rules
:
[
{
pattern
:
/^
\d
+$/
,
message
:
'只能输入正整数'
,
trigger
:
'blur'
}
]
},
{
type
:
'select'
,
prop
:
'currency'
,
label
:
'出账币种'
,
dictType
:
'bx_currency_type'
},
{
type
:
'select'
,
prop
:
'fortuneType'
,
label
:
'出账项目'
,
dictType
:
'csf_fortune_type'
},
{
type
:
'select'
,
prop
:
'brokerBizId'
,
label
:
'转介人'
,
api
:
'/insurance/base/api/userSaleExpand/page'
,
keywordField
:
'realName'
,
requestParams
:
{
pageNo
:
1
,
pageSize
:
20
},
placeholder
:
'输入转介人名称搜索'
,
debounceWait
:
500
,
// 自定义防抖时间
valueKey
:
'userSaleBizId'
,
labelKey
:
'realName'
,
transform
:
(
res
)
=>
{
return
res
?.
data
.
records
||
[]
}
},
{
type
:
'select'
,
prop
:
'status'
,
label
:
'出账状态'
,
dictType
:
'csf_expected_fortune_status'
}
])
const
handleConfirmAddPayRecord
=
async
()
=>
{
const
handleConfirmAddPayRecordparams
=
addPayRecordFormRef
.
value
.
getFormData
()
try
{
await
addPayRecord
([
handleConfirmAddPayRecordparams
])
ElMessage
.
success
(
'新增出账记录成功'
)
addPayRecordDialogVisible
.
value
=
false
}
catch
(
error
)
{
ElMessage
.
error
(
error
.
message
)
}
}
// 出账记录
const
payRecordDialogTableData
=
ref
([])
const
payRecordDialogTableColumns
=
ref
([])
const
handleSelect
=
async
(
e
,
row
)
=>
{
selectedRow
.
value
=
row
if
(
e
===
'payRecord'
)
{
payRecordDialogTableVisible
.
value
=
true
loadPayRecordTableData
(
selectedRow
.
value
.
expectedFortuneBizId
);
payRecordDialogTableColumns
.
value
=
[
{
property
:
'broker'
,
label
:
'转介人'
,
width
:
'100'
,
},
{
property
:
'fortuneName'
,
label
:
'出账项目'
,
width
:
'150'
},
{
property
:
'amount'
,
label
:
'出账金额'
,
width
:
'150'
},
{
property
:
'currency'
,
label
:
'出账币种'
,
width
:
'150'
},
{
property
:
'amount'
,
label
:
'出账比例'
,
width
:
'150'
},
{
property
:
'currentCommissionRatio'
,
label
:
'待出账比例'
,
width
:
'150'
},
{
property
:
'fortunePeriod'
,
label
:
'佣金期数'
,
width
:
'150'
},
{
property
:
'fortuneTotalPeriod'
,
label
:
'总期数'
,
width
:
'150'
},
{
property
:
'updaterId'
,
label
:
'操作人'
,
width
:
'150'
},
{
property
:
'updateTime'
,
label
:
'操作时间'
,
width
:
'150'
}
]
}
else
if
(
e
===
'setStatus'
)
{
setPayRecordStatusDialogVisible
.
value
=
true
setPayRecordStatusFormConfig
.
value
=
[
{
type
:
'select'
,
prop
:
'status'
,
label
:
'出账状态'
,
dictType
:
'csf_expected_fortune_status'
,
defaultValue
:
selectedRow
.
value
.
status
||
''
},
{
type
:
'textarea'
,
prop
:
'statusDesc'
,
label
:
'修改理由'
,
defaultValue
:
selectedRow
.
value
.
statusDesc
||
''
},
]
}
}
// 分页相关
const
currentPage
=
ref
(
1
)
...
...
@@ -275,18 +447,12 @@ const dropdownItems = [
const
tableData
=
ref
([])
// 统计信息
const
statisticsData
=
ref
({
totalExpectedAmount
:
0
,
totalPaidAmount
:
0
,
totalUnpaidAmount
:
0
,
paidAmountRatio
:
0
,
totalPolicyCount
:
0
,
totalPremiumAmount
:
0
})
const
statisticsData
=
ref
({})
// 按钮事件处理
const
handleAdd
=
()
=>
{
ElMessage
.
info
(
'点击新增按钮'
)
// ElMessage.info('点击新增按钮')
addPayRecordDialogVisible
.
value
=
true
}
const
handleImport
=
()
=>
{
...
...
@@ -307,9 +473,7 @@ const handleReset = () => {
}
const
handleQuery
=
async
()
=>
{
const
params
=
searchFormRef
.
value
.
getSearchParams
()
console
.
log
(
'父组件发起查询:'
,
params
)
loadTableData
(
params
)
loadTableData
()
}
// 按钮配置
...
...
@@ -353,8 +517,8 @@ const handleCurrentChange = (val) => {
}
// 加载表格数据
const
loadTableData
=
async
(
searchParams
=
{}
)
=>
{
cons
ole
.
log
(
searchFormRef
.
value
)
const
loadTableData
=
async
()
=>
{
cons
t
searchParams
=
searchFormRef
.
value
.
getFormData
()
||
{}
loading
.
value
=
true
try
{
const
params
=
{
...
...
@@ -389,16 +553,14 @@ const loadTableData = async (searchParams = {}) => {
}
// 出账记录查询
const
loadPayRecordTableData
=
async
()
=>
{
const
loadPayRecordTableData
=
async
(
expectedFortuneBizId
)
=>
{
loading
.
value
=
true
try
{
const
params
=
{
expectedFortuneBizId
:
expectedFortuneBizId
}
const
response
=
await
payRecordList
(
params
)
payRecordDialogTableData
.
value
=
response
.
data
.
records
pageTotal
.
value
=
response
.
data
.
total
pageSize
.
value
=
response
.
data
.
size
}
catch
(
error
)
{
console
.
error
(
'加载数据失败:'
,
error
)
...
...
@@ -408,9 +570,33 @@ const loadPayRecordTableData = async () => {
}
}
// 设置出账状态确认
const
handleConfirmSetPayRecordStatus
=
async
()
=>
{
const
formData
=
setPayRecordStatusFormRef
.
value
.
getFormData
()
||
{}
if
(
!
formData
.
status
)
{
ElMessage
.
error
(
'请选择出账状态'
)
return
}
if
(
!
formData
.
statusDesc
)
{
ElMessage
.
error
(
'请输入修改理由'
)
return
}
try
{
const
params
=
{
...
formData
,
fortuneBizIdList
:
[
selectedRow
.
value
.
expectedFortuneBizId
]
}
await
updataPayrollStatus
(
params
)
ElMessage
.
success
(
'设置出账状态成功'
)
setPayRecordStatusDialogVisible
.
value
=
false
loadTableData
()
}
catch
(
error
)
{
console
.
error
(
'设置出账状态失败:'
,
error
)
ElMessage
.
error
(
'设置出账状态失败'
)
}
}
loadTableData
()
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
src/views/financialCenter/receivables.vue
View file @
eb0cc621
...
...
@@ -46,7 +46,7 @@
</el-table-column>
<el-table-column
prop=
"commissionPeriod"
label=
"入账期数"
width=
"120"
sortable
/>
<el-table-column
prop=
"totalPeriod"
label=
"入账总期数"
width=
"120"
sortable
/>
<el-table-column
prop=
"commission
Typ
e"
label=
"入账项目"
width=
"120"
sortable
/>
<el-table-column
prop=
"commission
Nam
e"
label=
"入账项目"
width=
"120"
sortable
/>
<el-table-column
prop=
"commissionDate"
label=
"入账日(估)"
width=
"120"
sortable
/>
<el-table-column
prop=
"commissionRatio"
label=
"入账比例(估)"
width=
"140"
sortable
>
<
template
#
default=
"{ row }"
>
...
...
@@ -60,7 +60,7 @@
</el-table-column>
<el-table-column
prop=
"paidRatio"
label=
"已入账比例"
width=
"120"
sortable
>
<
template
#
default=
"{ row }"
>
{{
(
row
.
r
atio
||
0
)
+
'%'
}}
{{
(
row
.
paidR
atio
||
0
)
+
'%'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"paidAmount"
label=
"已入账金额"
width=
"120"
sortable
>
...
...
@@ -87,6 +87,7 @@
{{
numberWithCommas
(
row
.
premium
)
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"statusDesc"
label=
"入账状态修改理由"
width=
"150"
/>
<el-table-column
prop=
"remark"
label=
"备注"
width=
"150"
/>
<el-table-column
fixed=
"right"
label=
"操作"
min-width=
"120"
>
<
template
#
default=
"{ row }"
>
...
...
@@ -133,26 +134,14 @@
</CommonDialog>
<CommonDialog
dialogTitle=
"设置入账状态"
dialogWidth=
"80%"
:openDialog=
"setStatusDialogTableVisible"
@
close=
"setStatusDialogTableVisible = false"
@
confirm=
"setStatusDialogTableVisible = false"
>
<el-form
:model=
"form"
>
<el-form-item
label=
"入账状态"
label-width=
"120"
>
<el-select
v-model=
"form.status"
placeholder=
"请选择入账状态"
>
<el-option
label=
"待入账"
value=
"0"
/>
<el-option
label=
"完成入账"
value=
"1"
/>
<el-option
label=
"部分入账"
value=
"2"
/>
<el-option
label=
"已失效"
value=
"3"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"修改理由"
:label-width=
"120"
>
<el-input
v-model=
"form.desc"
type=
"textarea"
/>
</el-form-item>
</el-form>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"setStatusDialogTableVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirmSetStatus"
>
确认
</el-button>
</div>
</
template
>
@
close=
"setStatusDialogTableVisible = false"
@
confirm=
"handleConfirmSetStatus"
>
<SearchForm
ref=
"setCommissionRecordStatusFormRef"
:config=
"setCommissionRecordStatusFormConfig"
/>
</CommonDialog>
<!-- 新增应收款管理 -->
<CommonDialog
dialogTitle=
"新增应收款"
dialogWidth=
"80%"
:openDialog=
"addReceivablesDialogVisible"
@
close=
"addReceivablesDialogVisible = false"
@
confirm=
"handleConfirmAddReceivables"
>
<SearchForm
ref=
"addRecordRef"
:config=
"addReceivablesFormConfig"
v-model=
"addReceivablesFormModel"
/>
</CommonDialog>
</div>
</template>
...
...
@@ -160,20 +149,127 @@
<
script
setup
name=
"Receivables"
>
import
CommonPage
from
'@/components/commonPage'
import
CommonDialog
from
'@/components/commonDialog'
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
import
{
ref
,
reactive
,
onMounted
,
computed
}
from
'vue'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
MoreFilled
}
from
'@element-plus/icons-vue'
import
{
receivedFortuneList
,
commissionEntryRecord
,
commissionEntryEditRecords
,
exportReceivedFortune
,
commissionExpectedRecord
}
from
'@/api/financial/commission'
import
{
receivedFortuneList
,
updateCommissionExpected
,
commissionEntryEditRecords
,
exportReceivedFortune
,
commissionExpectedRecord
,
addReceivedFortune
}
from
'@/api/financial/commission'
import
{
numberWithCommas
}
from
'@/utils/index'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
import
{
getDictLabel
}
from
'@/utils/useDict'
;
import
{
safeDownload
}
from
'@/utils/safeDownload'
import
useUserStore
from
'@/store/modules/user'
const
userStore
=
useUserStore
()
// 应收单类型
const
commissionBizTypeOptions
=
[
{
value
:
'R'
,
label
:
'关联保单应收单'
},
{
value
:
'U'
,
label
:
'非关联保单应收单'
}
]
// 新增应收款管理
const
addReceivablesFormModel
=
reactive
({
commissionBizType
:
'U'
,
})
const
addReceivablesDialogVisible
=
ref
(
false
)
const
addRecordRef
=
ref
(
null
)
const
addReceivablesFormConfig
=
[
{
type
:
'select'
,
prop
:
'commissionBizType'
,
label
:
'应收单类型'
,
placeholder
:
'应收单类型'
,
options
:
commissionBizTypeOptions
},
{
type
:
'input'
,
prop
:
'policyNo'
,
label
:
'保单号'
,
visible
:
(
formData
)
=>
formData
.
commissionBizType
==
'R'
},
{
type
:
'input'
,
prop
:
'commissionPeriod'
,
label
:
'佣金期数'
,
inputType
:
'decimal'
,
visible
:
(
formData
)
=>
formData
.
commissionBizType
===
'R'
,
rules
:
[
{
pattern
:
/^
\d
+$/
,
message
:
'只能输入正整数'
,
trigger
:
'blur'
}
]
},
{
type
:
'input'
,
prop
:
'totalPeriod'
,
label
:
'总期数'
,
inputType
:
'decimal'
,
visible
:
(
formData
)
=>
formData
.
commissionBizType
===
'R'
,
rules
:
[
{
pattern
:
/^
\d
+$/
,
message
:
'只能输入正整数'
,
trigger
:
'blur'
}
]
},
{
type
:
'date'
,
prop
:
'commissionDate'
,
label
:
'入账日(估)'
,
placeholder
:
'请选择'
},
{
type
:
'date'
,
prop
:
'actualCommissionDate'
,
label
:
'入账日(实)'
,
placeholder
:
'请选择'
,
maxDate
:
'today'
},
{
type
:
'input'
,
prop
:
'amount'
,
label
:
'入账金额'
,
inputType
:
'decimal'
,
decimalDigits
:
2
,
rules
:
[
{
required
:
true
,
message
:
'请输入金额'
,
trigger
:
'blur'
},
{
pattern
:
/^
\d
+
(\.\d{1,2})?
$/
,
message
:
'最多两位小数'
,
trigger
:
'blur'
}
]
},
{
type
:
'select'
,
prop
:
'currency'
,
label
:
'入账币种'
,
dictType
:
'bx_currency_type'
},
{
type
:
'select'
,
prop
:
'commissionName'
,
label
:
'入账项目'
,
dictType
:
'csf_commission_type'
},
{
type
:
'select'
,
prop
:
'reconciliationCompanyBizId'
,
label
:
'对账公司'
,
api
:
'/insurance/base/api/insuranceReconciliationCompany/page'
,
keywordField
:
'name'
,
requestParams
:
{
pageNo
:
1
,
pageSize
:
20
},
placeholder
:
'输入对账公司名称搜索'
,
debounceWait
:
500
,
// 自定义防抖时间
valueKey
:
'reconciliationCompanyBizId'
,
labelKey
:
'name'
,
transform
:
(
res
)
=>
{
console
.
log
(
'对账公司'
,
res
)
return
res
.
data
.
records
||
[]
}
}
]
const
handleConfirmAddReceivables
=
async
()
=>
{
const
p
=
addRecordRef
.
value
.
getFormData
()
console
.
log
(
'新增应收款'
,
p
)
try
{
await
addReceivedFortune
({
commissionExpectedAddDtoList
:
[
p
]
})
ElMessage
.
success
(
'新增应收款成功'
)
addReceivablesDialogVisible
.
value
=
false
handleSearch
()
}
catch
(
error
)
{
ElMessage
.
error
(
error
.
message
)
}
}
const
searchFormRef
=
ref
(
null
)
const
searchParams
=
ref
({})
const
searchConfig
=
ref
([
...
...
@@ -249,7 +345,14 @@ const searchConfig = ref([
label
:
'产品计划'
,
api
:
'/product/api/relProjectProductLaunch/parameter/page'
,
keywordField
:
'productName'
,
requestParams
:
{
fieldBizId
:
'field_olk1qZe81qHHKXbw'
,
fieldValueBizId
:
'field_value_uOfJH5ucA2YwJpbn'
,
pageNo
:
1
,
pageSize
:
20
},
requestParams
:
{
tenantBizId
:
userStore
.
projectInfo
.
tenantBizId
||
''
,
projectBizId
:
userStore
.
projectInfo
.
projectBizId
||
''
,
fieldBizId
:
'field_olk1qZe81qHHKXbw'
,
fieldValueBizId
:
'field_value_uOfJH5ucA2YwJpbn'
,
pageNo
:
1
,
pageSize
:
20
},
placeholder
:
'输入产品计划名称搜索'
,
debounceWait
:
500
,
// 自定义防抖时间
valueKey
:
'productLaunchBizId'
,
...
...
@@ -310,11 +413,8 @@ const entryRecordDialogTableColumns = ref([])
const
actionRecordsDialogTableColumns
=
ref
([])
// 设置入账状态表单
const
form
=
reactive
({
status
:
''
,
desc
:
''
,
})
const
setCommissionRecordStatusFormRef
=
ref
(
null
)
const
setCommissionRecordStatusFormConfig
=
ref
([])
const
selectedRow
=
ref
(
null
)
// 表格数据
...
...
@@ -330,11 +430,14 @@ const statisticsData = ref({
})
// 按钮事件处理
const
handleAdd
=
()
=>
ElMessage
.
info
(
'点击新增按钮'
)
const
handleAdd
=
()
=>
{
addReceivablesDialogVisible
.
value
=
true
}
const
handleImport
=
()
=>
ElMessage
.
info
(
'点击导入按钮'
)
const
handleExport
=
async
()
=>
{
// 获取搜索参数
const
params
=
searchFormRef
.
value
?.
get
SearchParams
()
||
{}
const
params
=
searchFormRef
.
value
?.
get
FormData
()
||
{}
const
response
=
await
exportReceivedFortune
(
params
)
// 文件名设置为应收款导出_yyyy-MM-dd hh:mm:ss.xlsx,不需要-,用字符串
const
fileName
=
`应收款导出_
${
new
Date
().
toLocaleString
().
replace
(
/
\/
/g
,
''
).
replace
(
/:/g
,
''
).
replace
(
/
\s
/g
,
''
)}
.xlsx`
...
...
@@ -356,8 +459,7 @@ const handleReset = () => {
}
const
handleQuery
=
()
=>
{
const
params
=
searchFormRef
.
value
.
getSearchParams
()
loadTableData
(
params
)
loadTableData
()
}
// 按钮配置
...
...
@@ -381,7 +483,8 @@ const handleCurrentChange = (val) => {
}
// 加载表格数据
const
loadTableData
=
async
(
searchParams
=
{})
=>
{
const
loadTableData
=
async
()
=>
{
const
searchParams
=
searchFormRef
.
value
.
getFormData
()
||
{}
loading
.
value
=
true
try
{
const
params
=
{
...
...
@@ -465,13 +568,26 @@ const handleSelect = async (e, row) => {
const
records
=
await
loadEntryRecordData
(
row
.
commissionExpectedBizId
)
entryRecordDialogTableData
.
value
=
records
.
length
?
records
:
[]
}
else
if
(
e
===
'setStatus'
)
{
// 回显当前行状态
form
.
status
=
row
.
status
form
.
desc
=
''
console
.
log
(
selectedRow
.
value
.
status
)
setCommissionRecordStatusFormConfig
.
value
=
[
{
type
:
'select'
,
prop
:
'status'
,
label
:
'入账状态'
,
dictType
:
'csf_expected_commission_status'
,
defaultValue
:
selectedRow
.
value
.
status
||
''
},
{
type
:
'textarea'
,
prop
:
'statusDesc'
,
label
:
'修改理由'
,
defaultValue
:
selectedRow
.
value
.
statusDesc
||
''
},
]
setStatusDialogTableVisible
.
value
=
true
}
}
// 查看比对记录
const
handleClick
=
async
()
=>
{
actionRecordsDialogVisible
.
value
=
true
...
...
@@ -499,10 +615,11 @@ const handleClick = async () => {
// 新增:设置状态确认事件
const
handleConfirmSetStatus
=
()
=>
{
if
(
!
form
.
status
)
{
const
formData
=
setCommissionRecordStatusFormRef
.
value
.
getFormData
()
if
(
!
formData
.
status
)
{
return
ElMessage
.
warning
(
'请选择入账状态'
)
}
if
(
!
form
.
d
esc
)
{
if
(
!
form
Data
.
statusD
esc
)
{
return
ElMessage
.
warning
(
'请输入修改理由'
)
}
// 调用接口修改状态(示例)
...
...
@@ -511,17 +628,27 @@ const handleConfirmSetStatus = () => {
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
async
()
=>
{
// 此处替换为真实接口调用
try
{
const
res
=
await
updateCommissionExpected
({
commissionExpectedBizId
:
selectedRow
.
value
.
commissionExpectedBizId
,
...
formData
})
if
(
res
.
code
===
200
)
{
ElMessage
.
success
(
'状态修改成功'
)
setStatusDialogTableVisible
.
value
=
false
loadTableData
()
// 重新加载表格
}
else
{
ElMessage
.
error
(
res
.
msg
||
'状态修改失败'
)
}
}
catch
(
error
)
{
console
.
error
(
'修改状态失败:'
,
error
)
ElMessage
.
error
(
'修改状态失败'
)
}
}).
catch
(()
=>
{
ElMessage
.
info
(
'已取消修改'
)
})
}
// 初始化加载数据
loadTableData
()
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment