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 b8b848ed
authored
May 22, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix 自测bug
1 parent
ac15d59a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
35 deletions
src/views/systemConfig/merchant/financialRules/components/financialCalculationDialog.vue
src/views/systemConfig/merchant/financialRules/utils/buildDivisionRuleTestParams.js
tests/unit/financialRules/buildDivisionRuleTestParams.spec.js
src/views/systemConfig/merchant/financialRules/components/financialCalculationDialog.vue
View file @
b8b848e
...
...
@@ -184,6 +184,10 @@ export default {
maxReachedStep
:
this
.
maxReachedStep
,
step1Paid
:
this
.
uiState
.
step1Paid
}
},
/** 与父页财务详情一致,唯一来源(financialRulesEnv) */
divisionRuleId
()
{
return
this
.
financialRulesEnv
.
divisionRuleId
}
},
watch
:
{
...
...
@@ -204,7 +208,7 @@ export default {
deep
:
true
,
handler
()
{
if
(
!
this
.
visible
)
return
this
.
testObj
=
normalizeDivisionTest
Payload
(
this
.
financialCalculationObj
)
this
.
testObj
=
this
.
normalizeTestObj
Payload
(
this
.
financialCalculationObj
)
this
.
applySubProgress
(
this
.
testObj
.
subProgress
,
this
.
testObj
)
}
}
...
...
@@ -220,6 +224,13 @@ export default {
this
.
teardownWs
()
},
methods
:
{
normalizeTestObjPayload
(
payload
=
{})
{
const
id
=
this
.
divisionRuleId
const
merged
=
id
!=
null
&&
id
!==
''
?
{
...
payload
,
divisionRuleId
:
id
}
:
payload
return
normalizeDivisionTestPayload
(
merged
)
},
setViewStep
(
step
)
{
const
target
=
Number
(
step
)
if
(
target
<
1
||
target
>
3
)
return
...
...
@@ -232,12 +243,9 @@ export default {
if
(
p
<
1
||
p
>
3
)
return
if
(
this
.
lastSyncedProgress
===
p
)
return
const
divisionRuleId
=
this
.
testObj
.
divisionRuleId
??
this
.
financialRulesEnv
.
divisionRuleId
const
paymentChannelId
=
this
.
testObj
.
paymentChannelId
const
params
=
buildDivisionRuleTestUpdateMainProgressParams
({
divisionRuleId
,
divisionRuleId
:
this
.
divisionRuleId
,
paymentChannelId
,
progress
:
p
})
...
...
@@ -269,7 +277,7 @@ export default {
this
.
setViewStep
(
viewStep
)
},
bootstrapFromProps
()
{
this
.
testObj
=
normalizeDivisionTest
Payload
(
this
.
financialCalculationObj
)
this
.
testObj
=
this
.
normalizeTestObj
Payload
(
this
.
financialCalculationObj
)
const
sp
=
resolveDivisionTestSubProgress
(
this
.
testObj
,
this
.
testObj
.
subProgress
)
this
.
resetWizardNavigation
(
sp
)
this
.
applySubProgress
(
sp
,
this
.
testObj
)
...
...
@@ -313,23 +321,17 @@ export default {
const
routerInfo
=
this
.
financialRulesEnv
.
routerInfo
||
{}
const
{
merchantId
,
scene
:
sceneType
}
=
routerInfo
const
baseSceneCode
=
resolveBaseSceneCodeFromRouter
(
routerInfo
)
const
divisionRuleId
=
this
.
testObj
.
divisionRuleId
??
this
.
financialRulesEnv
.
divisionRuleId
return
buildDivisionRuleTestParams
({
merchantId
,
sceneType
,
paymentChannelId
:
this
.
testObj
.
paymentChannelId
,
divisionRuleId
,
divisionRuleId
:
this
.
divisionRuleId
,
baseSceneCode
})
},
buildRetestParams
()
{
const
divisionRuleId
=
this
.
testObj
.
divisionRuleId
??
this
.
financialRulesEnv
.
divisionRuleId
return
buildDivisionRuleTestRetestParams
({
divisionRuleId
,
divisionRuleId
:
this
.
divisionRuleId
,
paymentChannelId
:
this
.
testObj
.
paymentChannelId
})
},
...
...
@@ -345,7 +347,7 @@ export default {
}
return
divisionRuleTestGet
(
params
).
then
((
result
)
=>
{
if
(
!
result
)
return
this
.
testObj
=
normalizeDivisionTest
Payload
({
...
this
.
testObj
,
...
result
})
this
.
testObj
=
this
.
normalizeTestObj
Payload
({
...
this
.
testObj
,
...
result
})
this
.
applySubProgress
(
result
.
subProgress
,
this
.
testObj
)
this
.
syncViewStepIfSubProgress36
()
if
(
!
this
.
uiState
.
step1Paid
&&
this
.
testOrderCode
)
{
...
...
@@ -436,7 +438,7 @@ export default {
divisionRuleTestRetest
(
params
)
.
then
((
result
)
=>
{
if
(
result
)
{
this
.
testObj
=
normalizeDivisionTest
Payload
({
...
this
.
testObj
,
...
result
})
this
.
testObj
=
this
.
normalizeTestObj
Payload
({
...
this
.
testObj
,
...
result
})
}
this
.
step2AllocationCache
=
{}
this
.
uiState
.
step1Paid
=
false
...
...
@@ -465,7 +467,7 @@ export default {
this
.
subProgress
=
34
this
.
resetWizardNavigation
(
34
)
const
mockCode
=
this
.
testOrderCode
||
`TEST
${
Date
.
now
()}
`
this
.
testObj
=
normalizeDivisionTest
Payload
({
this
.
testObj
=
this
.
normalizeTestObj
Payload
({
...
this
.
testObj
,
orderCode
:
mockCode
,
divisionRuleTestItem
:
{
...
...
@@ -509,9 +511,7 @@ export default {
const
params
=
buildDivisionRuleTestMoneyValidParams
({
testObj
:
this
.
testObj
,
testMerchantDivisions
,
divisionRuleId
:
this
.
testObj
.
divisionRuleId
??
this
.
financialRulesEnv
.
divisionRuleId
divisionRuleId
:
this
.
divisionRuleId
})
if
(
params
.
divisionRuleId
==
null
||
params
.
divisionRuleId
===
''
)
{
this
.
$message
.
warning
(
'缺少分账规则 ID,请刷新后重试'
)
...
...
src/views/systemConfig/merchant/financialRules/utils/buildDivisionRuleTestParams.js
View file @
b8b848e
...
...
@@ -46,11 +46,8 @@ export function buildDivisionRuleTestRetestParams(ctx = {}) {
export
function
buildDivisionRuleTestMoneyValidParams
({
testObj
=
{},
testMerchantDivisions
,
divisionRuleId
:
divisionRuleIdOverride
divisionRuleId
}
=
{})
{
const
divisionRuleId
=
divisionRuleIdOverride
??
testObj
.
divisionRuleId
const
params
=
{
testMerchantDivisions
:
testMerchantDivisions
||
[]
}
...
...
tests/unit/financialRules/buildDivisionRuleTestParams.spec.js
View file @
b8b848e
...
...
@@ -46,7 +46,7 @@ describe("buildDivisionRuleTestParams", () => {
})
})
it
(
"buildDivisionRuleTestMoneyValidParams
uses divisionRuleId and paymentChannel
Id"
,
()
=>
{
it
(
"buildDivisionRuleTestMoneyValidParams
requires explicit divisionRule
Id"
,
()
=>
{
const
testMerchantDivisions
=
[
{
merchantId
:
"m1"
,
distributionMoney
:
"1.0"
,
confirmDivisionMoney
:
"1.0"
}
]
...
...
@@ -54,22 +54,26 @@ describe("buildDivisionRuleTestParams", () => {
testObj
:
{
paymentChannelId
:
"ch1"
,
divisionRuleId
:
100
},
testMerchantDivisions
})
expect
(
params
).
toEqual
({
divisionRuleId
:
100
,
paymentChannelId
:
"ch1"
,
testMerchantDivisions
})
expect
(
params
.
goodsTypeGroupDivisionId
).
toBeUndefined
()
expect
(
params
.
divisionRuleId
).
toBeUndefined
()
expect
(
params
.
paymentChannelId
).
toBe
(
"ch1"
)
expect
(
params
.
testMerchantDivisions
).
toEqual
(
testMerchantDivisions
)
})
it
(
"buildDivisionRuleTestMoneyValidParams divisionRuleId from override"
,
()
=>
{
it
(
"buildDivisionRuleTestMoneyValidParams uses explicit divisionRuleId and paymentChannelId"
,
()
=>
{
const
testMerchantDivisions
=
[
{
merchantId
:
"m1"
,
distributionMoney
:
"1.0"
,
confirmDivisionMoney
:
"1.0"
}
]
const
params
=
buildDivisionRuleTestMoneyValidParams
({
testObj
:
{
paymentChannelId
:
"ch2"
},
testMerchantDivisions
:
[]
,
testMerchantDivisions
,
divisionRuleId
:
4928
})
expect
(
params
.
divisionRuleId
).
toBe
(
4928
)
expect
(
params
.
paymentChannelId
).
toBe
(
"ch2"
)
expect
(
params
).
toEqual
({
divisionRuleId
:
4928
,
paymentChannelId
:
"ch2"
,
testMerchantDivisions
})
expect
(
params
.
goodsTypeGroupDivisionId
).
toBeUndefined
()
})
it
(
"buildDivisionRuleTestUpdateMainProgressParams three fields"
,
()
=>
{
...
...
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