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 d987441b
authored
May 01, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat 功能联调
1 parent
fcb54e2d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
29 deletions
src/views/systemConfig/merchant/financialRules/index.vue
src/views/systemConfig/merchant/financialRules/utils/buildGoodsTypeGroupIncrementalRules.js
src/views/systemConfig/merchant/financialRules/utils/calculateModeConflict.js
src/views/systemConfig/merchant/financialRules/utils/classificationRuleCache.js
src/views/systemConfig/merchant/merchantManage.vue
src/views/systemConfig/merchant/merchantStep/merchantCheck.vue
src/views/systemConfig/merchant/financialRules/index.vue
View file @
d987441
...
@@ -185,6 +185,7 @@ import {
...
@@ -185,6 +185,7 @@ import {
rebuildFinancialCrossTabGoodsSelections
rebuildFinancialCrossTabGoodsSelections
}
from
"../merchantStep/utils/reconciliationShared"
}
from
"../merchantStep/utils/reconciliationShared"
import
{
import
{
appendDeleteOpsToIncremental
,
buildGoodsTypeGroupIncrementalRules
,
buildGoodsTypeGroupIncrementalRules
,
mergeChildClassificationPayload
mergeChildClassificationPayload
}
from
"./utils/classificationRuleCache"
}
from
"./utils/classificationRuleCache"
...
@@ -278,7 +279,7 @@ export default {
...
@@ -278,7 +279,7 @@ export default {
djzhySubMerchantName
:
""
djzhySubMerchantName
:
""
},
},
effectStartDate
:
false
,
// 规则时间 true 表示可以立即生效 是否立即生效
effectStartDate
:
false
,
// 规则时间 true 表示可以立即生效 是否立即生效
/**
会话内删除的已落库分账品类规则 id,随 save 一并提交给后端
*/
/**
本会话删除的已落库分账品类规则 id;提交前合并进 goodsTypeGroupRules 增量(type=DELETE),不向接口单独字段传
*/
pendingDeletedGroupDivisionRuleIds
:
[],
pendingDeletedGroupDivisionRuleIds
:
[],
/** 费用类目冲突检测用:与 editableTabs 下标对齐的全量规则视图 */
/** 费用类目冲突检测用:与 editableTabs 下标对齐的全量规则视图 */
_fullMergedGoodsTypeGroupRulesForConflict
:
null
,
_fullMergedGoodsTypeGroupRulesForConflict
:
null
,
...
@@ -1310,8 +1311,7 @@ export default {
...
@@ -1310,8 +1311,7 @@ export default {
delete
restPayload
.
goodsTypeGroupRules
delete
restPayload
.
goodsTypeGroupRules
this
.
submitParams
=
{
this
.
submitParams
=
{
...
restPayload
,
...
restPayload
,
goodsTypeGroupRules
:
ruleResult
.
incrementalRules
,
goodsTypeGroupRules
:
ruleResult
.
incrementalRules
deletedGroupDivisionRuleIds
:
ruleResult
.
deletedGroupDivisionRuleIds
||
[]
}
}
if
(
!
this
.
checkCalculateType
())
return
if
(
!
this
.
checkCalculateType
())
return
this
.
verificationCodeVisible
=
true
this
.
verificationCodeVisible
=
true
...
@@ -1434,15 +1434,15 @@ export default {
...
@@ -1434,15 +1434,15 @@ export default {
/**
/**
* 收集分账品类规则:对每个规则 Tab 槽位做纯数据校验(含接口回填未改动的行),失败即停并仅在该 Tab 调用 el-form 标红。
* 收集分账品类规则:对每个规则 Tab 槽位做纯数据校验(含接口回填未改动的行),失败即停并仅在该 Tab 调用 el-form 标红。
* 全量保存(onlyActiveTab 为 false):参与增量提交的下标(indicesForIncremental)仍为「曾触碰」或「本会话新增未落库」的 Tab,与提交流程一致;
* 全量保存(onlyActiveTab 为 false):参与增量提交的下标(indicesForIncremental)仍为「曾触碰」或「本会话新增未落库」的 Tab,与提交流程一致;
* 全量/测算均对 allRuleTabIndices 做校验。增量 goodsTypeGroupRules 带 type(ADD/UPDATE
);删除 id 见 pendingDeletedGroupDivisionRuleIds
。
* 全量/测算均对 allRuleTabIndices 做校验。增量 goodsTypeGroupRules 带 type(ADD/UPDATE
/DELETE);DELETE 来自 pendingDeletedGroupDivisionRuleIds 合并入库
。
* 冲突检测:返回 fullMergedRules(与 Tab 下标对齐的全量视图)。
* 冲突检测:返回 fullMergedRules(与 Tab 下标对齐的全量视图)。
*
*
* @returns {Promise<{ ok: boolean, incrementalRules: Array, fullMergedRules: Array|null,
deletedGroupDivisionRuleIds: Array,
firstErrorTabIndex?: number }>}
* @returns {Promise<{ ok: boolean, incrementalRules: Array, fullMergedRules: Array|null, firstErrorTabIndex?: number }>}
*/
*/
async
getGoodsTypeGroupRules
(
_list
,
options
=
{})
{
async
getGoodsTypeGroupRules
(
_list
,
options
=
{})
{
const
onlyActiveTab
=
options
.
onlyActiveTab
===
true
const
onlyActiveTab
=
options
.
onlyActiveTab
===
true
const
startTabName
=
this
.
editableTabsValue
const
startTabName
=
this
.
editableTabsValue
const
deletedGroupDivisionRul
eIds
=
[...
this
.
pendingDeletedGroupDivisionRuleIds
]
const
pendingDelet
eIds
=
[...
this
.
pendingDeletedGroupDivisionRuleIds
]
const
allRuleTabIndices
=
[]
const
allRuleTabIndices
=
[]
for
(
let
ti
=
0
;
ti
<
this
.
editableTabs
.
length
;
ti
++
)
{
for
(
let
ti
=
0
;
ti
<
this
.
editableTabs
.
length
;
ti
++
)
{
...
@@ -1466,8 +1466,7 @@ export default {
...
@@ -1466,8 +1466,7 @@ export default {
return
{
return
{
ok
:
false
,
ok
:
false
,
incrementalRules
:
[],
incrementalRules
:
[],
fullMergedRules
:
null
,
fullMergedRules
:
null
deletedGroupDivisionRuleIds
}
}
}
}
}
else
{
}
else
{
...
@@ -1504,9 +1503,8 @@ export default {
...
@@ -1504,9 +1503,8 @@ export default {
const
fullMerged
=
this
.
buildFullMergedGoodsTypeGroupRules
(
validatedByIndex
)
const
fullMerged
=
this
.
buildFullMergedGoodsTypeGroupRules
(
validatedByIndex
)
return
{
return
{
ok
:
true
,
ok
:
true
,
incrementalRules
:
[],
incrementalRules
:
appendDeleteOpsToIncremental
([],
pendingDeleteIds
),
fullMergedRules
:
fullMerged
,
fullMergedRules
:
fullMerged
deletedGroupDivisionRuleIds
}
}
}
}
...
@@ -1550,7 +1548,6 @@ export default {
...
@@ -1550,7 +1548,6 @@ export default {
ok
:
false
,
ok
:
false
,
incrementalRules
:
[],
incrementalRules
:
[],
fullMergedRules
:
null
,
fullMergedRules
:
null
,
deletedGroupDivisionRuleIds
,
firstErrorTabIndex
:
tabindex
firstErrorTabIndex
:
tabindex
}
}
}
}
...
@@ -1564,10 +1561,13 @@ export default {
...
@@ -1564,10 +1561,13 @@ export default {
this
.
syncTabConfirmedRuleRevisionByIndex
(
tabindex
)
this
.
syncTabConfirmedRuleRevisionByIndex
(
tabindex
)
}
}
const
incrementalRules
=
buildGoodsTypeGroupIncrementalRules
(
const
incrementalRules
=
appendDeleteOpsToIncremental
(
validatedByIndex
,
buildGoodsTypeGroupIncrementalRules
(
indicesForIncremental
,
validatedByIndex
,
onlyActiveTab
indicesForIncremental
,
onlyActiveTab
),
pendingDeleteIds
)
)
const
fullMerged
=
this
.
buildFullMergedGoodsTypeGroupRules
(
validatedByIndex
)
const
fullMerged
=
this
.
buildFullMergedGoodsTypeGroupRules
(
validatedByIndex
)
...
@@ -1587,8 +1587,7 @@ export default {
...
@@ -1587,8 +1587,7 @@ export default {
return
{
return
{
ok
:
true
,
ok
:
true
,
incrementalRules
,
incrementalRules
,
fullMergedRules
:
fullMerged
,
fullMergedRules
:
fullMerged
deletedGroupDivisionRuleIds
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
"[FinancialRules] getGoodsTypeGroupRules"
,
e
)
console
.
error
(
"[FinancialRules] getGoodsTypeGroupRules"
,
e
)
...
...
src/views/systemConfig/merchant/financialRules/utils/buildGoodsTypeGroupIncrementalRules.js
View file @
d987441
...
@@ -48,3 +48,21 @@ export function buildGoodsTypeGroupIncrementalRules(
...
@@ -48,3 +48,21 @@ export function buildGoodsTypeGroupIncrementalRules(
}
}
return
incrementalRules
return
incrementalRules
}
}
/**
* 会话内删除的已落库规则 id:与 ADD/UPDATE 一并放入 goodsTypeGroupRules 增量(type=DELETE),不再单独字段提交。
* @param {Array<object>} incrementalRules
* @param {Array<string|number>} deletedIds pendingDeletedGroupDivisionRuleIds
* @returns {Array<object>}
*/
export
function
appendDeleteOpsToIncremental
(
incrementalRules
,
deletedIds
)
{
const
base
=
Array
.
isArray
(
incrementalRules
)
?
incrementalRules
:
[]
const
dels
=
[...
new
Set
(
deletedIds
||
[])]
.
map
((
id
)
=>
(
id
!=
null
?
String
(
id
).
trim
()
:
""
))
.
filter
((
id
)
=>
id
!==
""
)
.
map
((
id
)
=>
({
type
:
GOODS_TYPE_GROUP_RULE_OP
.
DELETE
,
groupDivisionRuleId
:
id
}))
return
[...
base
,
...
dels
]
}
src/views/systemConfig/merchant/financialRules/utils/calculateModeConflict.js
View file @
d987441
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
* 财务规则:费用类目「整单 / 按品类」与其它分润类型组合冲突检测(纯函数,便于单测)。
* 财务规则:费用类目「整单 / 按品类」与其它分润类型组合冲突检测(纯函数,便于单测)。
*/
*/
import
{
GOODS_TYPE_GROUP_RULE_OP
}
from
"./goodsTypeGroupRuleOpType"
export
function
splitExpenseRulesByTarget
(
expenseCategoryRules
)
{
export
function
splitExpenseRulesByTarget
(
expenseCategoryRules
)
{
const
trafficSide
=
[]
const
trafficSide
=
[]
const
serviceProvider
=
[]
const
serviceProvider
=
[]
...
@@ -91,7 +93,8 @@ function runServiceConflict(
...
@@ -91,7 +93,8 @@ function runServiceConflict(
* @returns {{ errorTips: number, ops: Array<{tabIndex:number, side:string, rowIndex:number, flag:boolean}>, tabErrors: boolean[] }}
* @returns {{ errorTips: number, ops: Array<{tabIndex:number, side:string, rowIndex:number, flag:boolean}>, tabErrors: boolean[] }}
*/
*/
export
function
computeCalculateModeConflicts
(
goodsTypeGroupRules
)
{
export
function
computeCalculateModeConflicts
(
goodsTypeGroupRules
)
{
const
rules
=
Array
.
isArray
(
goodsTypeGroupRules
)
?
goodsTypeGroupRules
:
[]
const
rules
=
(
Array
.
isArray
(
goodsTypeGroupRules
)
?
goodsTypeGroupRules
:
[])
.
filter
((
r
)
=>
r
&&
r
.
type
!==
GOODS_TYPE_GROUP_RULE_OP
.
DELETE
)
const
tabErrors
=
rules
.
map
(()
=>
false
)
const
tabErrors
=
rules
.
map
(()
=>
false
)
const
ops
=
[]
const
ops
=
[]
let
errorTips
=
0
let
errorTips
=
0
...
...
src/views/systemConfig/merchant/financialRules/utils/classificationRuleCache.js
View file @
d987441
...
@@ -2,4 +2,7 @@
...
@@ -2,4 +2,7 @@
* 分账品类:子组件 payload 与 financialObj 槽位合并、增量规则构建(供 index.vue 引用)。
* 分账品类:子组件 payload 与 financialObj 槽位合并、增量规则构建(供 index.vue 引用)。
*/
*/
export
{
mergeChildClassificationPayload
}
from
"./mergeClassificationPayload"
export
{
mergeChildClassificationPayload
}
from
"./mergeClassificationPayload"
export
{
buildGoodsTypeGroupIncrementalRules
}
from
"./buildGoodsTypeGroupIncrementalRules"
export
{
appendDeleteOpsToIncremental
,
buildGoodsTypeGroupIncrementalRules
}
from
"./buildGoodsTypeGroupIncrementalRules"
src/views/systemConfig/merchant/merchantManage.vue
View file @
d987441
This diff is collapsed.
Click to expand it.
src/views/systemConfig/merchant/merchantStep/merchantCheck.vue
View file @
d987441
...
@@ -70,8 +70,8 @@
...
@@ -70,8 +70,8 @@
* - checkParamsType 通过后打开验证码弹窗;失败 focusTabByErrorIndex
* - checkParamsType 通过后打开验证码弹窗;失败 focusTabByErrorIndex
*
*
* 提交
* 提交
* - codeHandleConfirm → submitFormData:若自打开验证码前无新的对账相关交互则跳过第二次 verify;saveRuleApi 传 goodsTypeGroupRules(增量
)、deletedGroupDivisionRuleIds
、
* - codeHandleConfirm → submitFormData:若自打开验证码前无新的对账相关交互则跳过第二次 verify;saveRuleApi 传 goodsTypeGroupRules(增量
,含 type=DELETE 的删除项)
、
* smsCode/effectStartDate、formObj 四项费用字段、merchantId/sceneType
* smsCode/effectStartDate、formObj 四项费用字段、merchantId/sceneType
(不再单独传 deletedGroupDivisionRuleIds)
*
*
* 后续优化要点(A 段):sceneLabel、productType 浅监听、allSettled、费用 Promise.all、getAllReconciliationParams、
* 后续优化要点(A 段):sceneLabel、productType 浅监听、allSettled、费用 Promise.all、getAllReconciliationParams、
* persist 深拷贝、uniqueBy、errorIndex;子组件见 merchantStep/components/classificationCpt.vue(B 段)。
* persist 深拷贝、uniqueBy、errorIndex;子组件见 merchantStep/components/classificationCpt.vue(B 段)。
...
@@ -143,6 +143,7 @@ import {
...
@@ -143,6 +143,7 @@ import {
import
{
normalizeReconciliationRuleForCompare
}
from
"./utils/normalizeReconciliationRuleForCompare"
import
{
normalizeReconciliationRuleForCompare
}
from
"./utils/normalizeReconciliationRuleForCompare"
import
{
getEffectivePhantomFullCategoryRuleRaw
as
resolveEffectivePhantomRaw
}
from
"./utils/effectivePhantomReconciliationRule"
import
{
getEffectivePhantomFullCategoryRuleRaw
as
resolveEffectivePhantomRaw
}
from
"./utils/effectivePhantomReconciliationRule"
import
{
prepareRuleForValidation
}
from
"../financialRules/utils/validateGoodsTypeGroupRulePayload"
import
{
prepareRuleForValidation
}
from
"../financialRules/utils/validateGoodsTypeGroupRulePayload"
import
{
GOODS_TYPE_GROUP_RULE_OP
}
from
"../financialRules/utils/goodsTypeGroupRuleOpType"
import
{
shouldIncludeReconciliationTabForProcess
}
from
"./utils/reconciliationSubmitTabGate"
import
{
shouldIncludeReconciliationTabForProcess
}
from
"./utils/reconciliationSubmitTabGate"
/** 提交前与基线比对时剥离 buildReconciliationIncrementalRules 注入的 type / tabPaneIndex */
/** 提交前与基线比对时剥离 buildReconciliationIncrementalRules 注入的 type / tabPaneIndex */
...
@@ -172,7 +173,7 @@ export default {
...
@@ -172,7 +173,7 @@ export default {
* submitFormData 会在请求前经 shapeGoodsTypeGroupRulesForApi 写入此处,与实际上报一致。
* submitFormData 会在请求前经 shapeGoodsTypeGroupRulesForApi 写入此处,与实际上报一致。
*/
*/
reconciliationLastVerifyResult
:
null
,
reconciliationLastVerifyResult
:
null
,
/** 本会话删除的已落库对账规则 id
(与 reconciliation.saveRule 的 deletedGroupDivisionRuleIds 对齐)
*/
/** 本会话删除的已落库对账规则 id
;提交前并入 goodsTypeGroupRules(type=DELETE),不向接口单独字段传
*/
pendingDeletedGroupDivisionRuleIds
:
[],
pendingDeletedGroupDivisionRuleIds
:
[],
editableTabsValue
:
"1"
,
editableTabsValue
:
"1"
,
addIndex
:
1
,
addIndex
:
1
,
...
@@ -1450,8 +1451,8 @@ export default {
...
@@ -1450,8 +1451,8 @@ export default {
this
.
submitFormData
(
true
)
this
.
submitFormData
(
true
)
},
},
/**
/**
* 提交对账规则:`goodsTypeGroupRules` 为相对基线仍有变更的增量(含 type
/ tabPaneIndex
),
* 提交对账规则:`goodsTypeGroupRules` 为相对基线仍有变更的增量(含 type
ADD/UPDATE/DELETE
),
* 无变更
则为 [];`deletedGroupDivisionRuleIds` 为本会话删除的已落库 id
。
* 无变更
且无待删 id 时为 []
。
*/
*/
async
submitFormData
(
skipReverifyAfterSms
=
false
)
{
async
submitFormData
(
skipReverifyAfterSms
=
false
)
{
const
canSkipReverify
=
const
canSkipReverify
=
...
@@ -1479,9 +1480,17 @@ export default {
...
@@ -1479,9 +1480,17 @@ export default {
}
=
this
.
formObj
}
=
this
.
formObj
const
rawIncremental
=
const
rawIncremental
=
this
.
reconciliationLastVerifyResult
?.
incrementalRules
??
[]
this
.
reconciliationLastVerifyResult
?.
incrementalRules
??
[]
const
goodsTypeGroupRules
=
this
.
shapeGoodsTypeGroupRulesForApi
(
const
shapedIncremental
=
this
.
shapeGoodsTypeGroupRulesForApi
(
rawIncremental
rawIncremental
)
)
const
deleteOps
=
[...
new
Set
(
this
.
pendingDeletedGroupDivisionRuleIds
||
[])]
.
map
((
id
)
=>
(
id
!=
null
?
String
(
id
).
trim
()
:
""
))
.
filter
((
id
)
=>
id
!==
""
)
.
map
((
id
)
=>
({
type
:
GOODS_TYPE_GROUP_RULE_OP
.
DELETE
,
groupDivisionRuleId
:
id
}))
const
goodsTypeGroupRules
=
[...
shapedIncremental
,
...
deleteOps
]
if
(
this
.
reconciliationLastVerifyResult
?.
ok
)
{
if
(
this
.
reconciliationLastVerifyResult
?.
ok
)
{
this
.
reconciliationLastVerifyResult
.
incrementalRules
=
deepClone
(
this
.
reconciliationLastVerifyResult
.
incrementalRules
=
deepClone
(
goodsTypeGroupRules
goodsTypeGroupRules
...
@@ -1494,9 +1503,6 @@ export default {
...
@@ -1494,9 +1503,6 @@ export default {
sceneType
:
this
.
merchantRow
.
scene
,
sceneType
:
this
.
merchantRow
.
scene
,
baseSceneCode
:
resolveBaseSceneCodeFromRouter
(
this
.
routerInfo
),
baseSceneCode
:
resolveBaseSceneCodeFromRouter
(
this
.
routerInfo
),
goodsTypeGroupRules
,
goodsTypeGroupRules
,
deletedGroupDivisionRuleIds
:
[
...
new
Set
(
this
.
pendingDeletedGroupDivisionRuleIds
)
],
shopMerchantTotalFeeCalculateType
,
shopMerchantTotalFeeCalculateType
,
shopMerchantExpenseCategoryValue
,
shopMerchantExpenseCategoryValue
,
partnerMerchantTotalFeeCalculateType
,
partnerMerchantTotalFeeCalculateType
,
...
...
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