Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2277962c
authored
Jun 03, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 更新市场转账提交参数,添加费用类型选择验证
1 parent
d37f0935
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
src/views/financeManage/accountStateManage/marketTransfer.js
src/views/financeManage/components/MarketTransferDialog.vue
tests/unit/accountStateManage/marketTransfer.spec.js
src/views/financeManage/accountStateManage/marketTransfer.js
View file @
2277962
...
@@ -79,9 +79,11 @@ export function buildMarketTransferFormData() {
...
@@ -79,9 +79,11 @@ export function buildMarketTransferFormData() {
];
];
}
}
export
function
buildMarketTransferSubmitParams
(
form
=
{})
{
export
function
buildMarketTransferSubmitParams
(
form
=
{}
,
excludeExpenseCategoryIds
=
[]
)
{
const
params
=
{
...
form
};
const
params
=
{
...
form
};
const
fileUrlList
=
Array
.
isArray
(
params
.
fileUrlList
)
?
params
.
fileUrlList
:
[];
const
fileUrlList
=
Array
.
isArray
(
params
.
fileUrlList
)
?
params
.
fileUrlList
:
[];
const
expenseCategoryIds
=
Array
.
isArray
(
params
.
expenseCategoryIds
)
?
params
.
expenseCategoryIds
:
[];
params
.
expenseCategoryIds
=
expenseCategoryIds
.
filter
(
id
=>
!
excludeExpenseCategoryIds
.
includes
(
id
));
params
.
fileUrlList
=
fileUrlList
params
.
fileUrlList
=
fileUrlList
.
map
(
item
=>
item
&&
item
.
fileUrl
)
.
map
(
item
=>
item
&&
item
.
fileUrl
)
.
filter
(
Boolean
);
.
filter
(
Boolean
);
...
...
src/views/financeManage/components/MarketTransferDialog.vue
View file @
2277962
...
@@ -403,7 +403,11 @@ export default {
...
@@ -403,7 +403,11 @@ export default {
this
.
transferForm
.
payName
=
this
.
transferForm
.
platformMerchantName
;
this
.
transferForm
.
payName
=
this
.
transferForm
.
platformMerchantName
;
if
(
!
valid
)
if
(
!
valid
)
return
;
return
;
const
params
=
buildMarketTransferSubmitParams
(
deepClone
(
this
.
transferForm
));
const
params
=
buildMarketTransferSubmitParams
(
deepClone
(
this
.
transferForm
),
this
.
lockedExpenseCategoryIds
);
if
(
!
params
.
expenseCategoryIds
.
length
)
{
this
.
$message
.
error
(
"请选择新的费用类型"
);
return
;
}
if
(
!
params
.
fileUrlList
.
length
)
{
if
(
!
params
.
fileUrlList
.
length
)
{
this
.
$message
.
error
(
"请等待转账凭证上传完成"
);
this
.
$message
.
error
(
"请等待转账凭证上传完成"
);
return
;
return
;
...
...
tests/unit/accountStateManage/marketTransfer.spec.js
View file @
2277962
...
@@ -84,13 +84,15 @@ describe("marketTransfer helpers", () => {
...
@@ -84,13 +84,15 @@ describe("marketTransfer helpers", () => {
const
params
=
buildMarketTransferSubmitParams
({
const
params
=
buildMarketTransferSubmitParams
({
id
:
"bill-1"
,
id
:
"bill-1"
,
remark
:
"ok"
,
remark
:
"ok"
,
expenseCategoryIds
:
[
706
,
808
,
900
],
fileUrlList
:
[
fileUrlList
:
[
{
fileUrl
:
"https://example.com/a.png"
},
{
fileUrl
:
"https://example.com/a.png"
},
{
fileUrl
:
""
},
{
fileUrl
:
""
},
{
fileUrl
:
"https://example.com/b.jpg"
}
{
fileUrl
:
"https://example.com/b.jpg"
}
]
]
})
}
,
[
706
,
900
]
)
expect
(
params
.
expenseCategoryIds
).
toEqual
([
808
])
expect
(
params
.
fileUrlList
).
toEqual
([
"https://example.com/a.png"
,
"https://example.com/b.jpg"
])
expect
(
params
.
fileUrlList
).
toEqual
([
"https://example.com/a.png"
,
"https://example.com/b.jpg"
])
expect
(
params
.
fileUrl
).
toBeUndefined
()
expect
(
params
.
fileUrl
).
toBeUndefined
()
expect
(
params
.
id
).
toBe
(
"bill-1"
)
expect
(
params
.
id
).
toBe
(
"bill-1"
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment