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 db4c878c
authored
Apr 02, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix 自测bug修复
1 parent
51047b64
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
223 additions
and
61 deletions
src/views/systemConfig/merchant/financialRules/index.vue
src/views/systemConfig/merchant/merchantStep/components/classificationCpt.vue
src/views/systemConfig/merchant/merchantStep/merchantCheck.vue
src/views/systemConfig/merchant/merchantStep/utils/reconciliationRuleBranches.js
src/views/systemConfig/merchant/financialRules/index.vue
View file @
db4c878
...
@@ -535,6 +535,80 @@ export default {
...
@@ -535,6 +535,80 @@ export default {
this
.
persistClassificationTabByPaneName
(
this
.
editableTabsValue
)
this
.
persistClassificationTabByPaneName
(
this
.
editableTabsValue
)
},
},
/**
/**
* 虚拟 Tab 下仅当前页挂载 classificationCpt,其它页的勾选不会触发 assign* emit,
* goodsSelectList 等与跨 Tab 禁用不同步。从 goodsTypeGroupRules 全量聚合已选品类/商品/套餐,
* 供「分账品类」下拉的禁用逻辑使用。
*/
rebuildCrossTabGoodsSelectionsFromRules
()
{
const
rules
=
this
.
financialObj
&&
this
.
financialObj
.
goodsTypeGroupRules
if
(
!
Array
.
isArray
(
rules
)
||
!
rules
.
length
)
{
this
.
goodsSelectList
=
[]
this
.
selectUpgradeGoodsList
=
[]
this
.
selectPackageGoodsList
=
[]
return
}
const
hashG
=
{}
const
hashU
=
{}
const
hashP
=
{}
const
goodsAgg
=
[]
const
upgradeAgg
=
[]
const
packageAgg
=
[]
const
pushG
=
(
item
)
=>
{
if
(
!
item
||
item
.
goodsType
==
null
)
return
const
k
=
item
.
goodsType
if
(
!
hashG
[
k
])
{
hashG
[
k
]
=
true
goodsAgg
.
push
(
deepClone
(
item
))
}
}
const
pushU
=
(
item
)
=>
{
if
(
!
item
||
item
.
upgradeGoodsId
==
null
)
return
const
k
=
item
.
upgradeGoodsId
if
(
!
hashU
[
k
])
{
hashU
[
k
]
=
true
upgradeAgg
.
push
(
deepClone
(
item
))
}
}
const
pushP
=
(
item
)
=>
{
if
(
!
item
||
item
.
packageCode
==
null
)
return
const
k
=
item
.
packageCode
if
(
!
hashP
[
k
])
{
hashP
[
k
]
=
true
packageAgg
.
push
(
deepClone
(
item
))
}
}
for
(
let
i
=
0
;
i
<
rules
.
length
;
i
++
)
{
const
rule
=
rules
[
i
]
if
(
!
rule
||
typeof
rule
!==
"object"
)
continue
let
g
=
Array
.
isArray
(
rule
.
goodsTypes
)
?
rule
.
goodsTypes
:
[]
let
u
=
Array
.
isArray
(
rule
.
upgradeGoods
)
?
rule
.
upgradeGoods
:
[]
let
pRaw
=
rule
.
packageGoods
let
pList
=
[]
if
(
Array
.
isArray
(
pRaw
))
pList
=
pRaw
else
if
(
pRaw
&&
typeof
pRaw
===
"object"
)
pList
=
[
pRaw
]
const
rel
=
rule
.
goodsTypeGroupRelations
if
(
Array
.
isArray
(
rel
)
&&
rel
.
length
&&
!
g
.
length
&&
!
u
.
length
&&
!
pList
.
length
)
{
const
inferred
=
rel
[
0
]
&&
rel
[
0
].
categoryType
const
ct
=
inferred
!=
null
?
inferred
:
rule
.
categoryType
if
(
ct
===
2
)
u
=
rel
else
if
(
ct
===
3
)
pList
=
rel
else
g
=
rel
}
g
.
forEach
(
pushG
)
u
.
forEach
(
pushU
)
pList
.
forEach
(
pushP
)
}
this
.
goodsSelectList
=
goodsAgg
this
.
selectUpgradeGoodsList
=
upgradeAgg
this
.
selectPackageGoodsList
=
packageAgg
},
/**
* 判断 goodsTypeGroupRules 中单条规则是否像「已落库/接口回显」的完整数据(而非新增 tab 的空壳)。
* 判断 goodsTypeGroupRules 中单条规则是否像「已落库/接口回显」的完整数据(而非新增 tab 的空壳)。
* 用于编辑态下:非激活 tab 无法走子组件 handleConfirm,但 testFlag 可能仍为 N(未做分账测试等),
* 用于编辑态下:非激活 tab 无法走子组件 handleConfirm,但 testFlag 可能仍为 N(未做分账测试等),
* 此时仍需允许用 financialObj 缓存提交,否则会出现「页面上已回显完整规则却提示请完善分账规则」。
* 此时仍需允许用 financialObj 缓存提交,否则会出现「页面上已回显完整规则却提示请完善分账规则」。
...
@@ -834,6 +908,7 @@ export default {
...
@@ -834,6 +908,7 @@ export default {
this
.
editableTabsValue
=
this
.
editableTabs
[
0
].
name
this
.
editableTabsValue
=
this
.
editableTabs
[
0
].
name
this
.
currentIndex
=
this
.
editableTabsValue
this
.
currentIndex
=
this
.
editableTabsValue
}
}
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
resolve
()
resolve
()
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
@@ -1199,6 +1274,7 @@ export default {
...
@@ -1199,6 +1274,7 @@ export default {
await
this
.
$nextTick
()
await
this
.
$nextTick
()
}
}
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
resolve
(
goodsTypeGroupRules
)
resolve
(
goodsTypeGroupRules
)
}
catch
(
e
)
{
}
catch
(
e
)
{
reject
(
e
)
reject
(
e
)
...
@@ -1441,6 +1517,7 @@ export default {
...
@@ -1441,6 +1517,7 @@ export default {
.
then
(()
=>
this
.
$nextTick
())
.
then
(()
=>
this
.
$nextTick
())
.
then
(()
=>
{
.
then
(()
=>
{
this
.
persistClassificationTabByPaneName
(
oldName
)
this
.
persistClassificationTabByPaneName
(
oldName
)
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
finish
()
finish
()
})
})
}
}
...
@@ -1543,19 +1620,13 @@ export default {
...
@@ -1543,19 +1620,13 @@ export default {
const
packageArr
=
[]
const
packageArr
=
[]
this
.
editableTabs
=
[]
this
.
editableTabs
=
[]
// console.log(goodsTypeGroupRules, "goodsTypeGroupRules")
// console.log(goodsTypeGroupRules, "goodsTypeGroupRules")
const
childParams
=
goodsTypeGroupRules
.
splice
(
tabIndex
,
1
)
goodsTypeGroupRules
.
splice
(
tabIndex
,
1
)
// console.log(goodsTypeGroupRules, this.financialObj, "goodsTypeGroupRules")
// console.log(goodsTypeGroupRules, this.financialObj, "goodsTypeGroupRules")
// console.log(childParams, "packageArr")
// return
// return
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
// const { autoFlag } = this.financialObj
// const { autoFlag } = this.financialObj
this
.
$set
(
this
.
financialObj
,
"goodsTypeGroupRules"
,
goodsTypeGroupRules
)
this
.
$set
(
this
.
financialObj
,
"goodsTypeGroupRules"
,
goodsTypeGroupRules
)
this
.
deleteSelectGoodsTypeList
(
childParams
[
0
].
goodsTypes
)
this
.
deleteSelectUpgradeGoodsList
(
childParams
[
0
].
goodsTypeGroupRelations
)
this
.
deleteSelectPackageGoodsList
(
childParams
[
0
].
packageGoods
)
goodsTypeGroupRules
&&
goodsTypeGroupRules
&&
goodsTypeGroupRules
.
forEach
((
item
,
index
)
=>
{
goodsTypeGroupRules
.
forEach
((
item
,
index
)
=>
{
this
.
editableTabs
[
index
]
=
{
this
.
editableTabs
[
index
]
=
{
...
@@ -1615,6 +1686,7 @@ export default {
...
@@ -1615,6 +1686,7 @@ export default {
// 获取商品
// 获取商品
this
.
getSelectingList
(
upgradeArr
)
this
.
getSelectingList
(
upgradeArr
)
this
.
getSelectingListPackage
(
packageArr
)
this
.
getSelectingListPackage
(
packageArr
)
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
// this.$forceUpdate()
// this.$forceUpdate()
this
.
$message
({
this
.
$message
({
type
:
"success"
,
type
:
"success"
,
...
...
src/views/systemConfig/merchant/merchantStep/components/classificationCpt.vue
View file @
db4c878
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
]"
label-width=
"260px"
>
]"
label-width=
"260px"
>
<el-select
class=
"w432"
v-model=
"classificationObj.flowCostArr[floweIdx]
<el-select
class=
"w432"
v-model=
"classificationObj.flowCostArr[floweIdx]
.expenseCategoryCalculateType
.expenseCategoryCalculateType
"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
forceUpdat
e($event, 'flowCostArr', floweIdx)
"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
onExpenseCategoryCalculateTypeChang
e($event, 'flowCostArr', floweIdx)
"
>
"
>
<el-option
v-for=
"(item, index) in flowFeeList"
:key=
"index + 'flowFeeList'"
:label=
"item.label"
<el-option
v-for=
"(item, index) in flowFeeList"
:key=
"index + 'flowFeeList'"
:label=
"item.label"
:value=
"item.expenseCategoryCalculateType"
></el-option>
:value=
"item.expenseCategoryCalculateType"
></el-option>
...
@@ -224,7 +224,7 @@
...
@@ -224,7 +224,7 @@
}
}
]">
]">
<el-select
v-model=
"scope.row.expenseCategoryCalculateType"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
<el-select
v-model=
"scope.row.expenseCategoryCalculateType"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
forceUpdat
e(
onExpenseCategoryCalculateTypeChang
e(
$event,
$event,
'flowCostArr',
'flowCostArr',
floweIdx,
floweIdx,
...
@@ -374,7 +374,7 @@
...
@@ -374,7 +374,7 @@
<el-select
class=
"w432"
v-model=
"classificationObj.serviceCostArr[serveIdx]
<el-select
class=
"w432"
v-model=
"classificationObj.serviceCostArr[serveIdx]
.expenseCategoryCalculateType
.expenseCategoryCalculateType
"
@
change=
"($event) =>
"
@
change=
"($event) =>
forceUpdat
e($event, 'serviceCostArr', serveIdx)
onExpenseCategoryCalculateTypeChang
e($event, 'serviceCostArr', serveIdx)
"
placeholder=
"请选择对账模式"
>
"
placeholder=
"请选择对账模式"
>
<el-option
v-for=
"(item, index) in serveFeeList"
:key=
"index + 'serveFeeList'"
:label=
"item.label"
<el-option
v-for=
"(item, index) in serveFeeList"
:key=
"index + 'serveFeeList'"
:label=
"item.label"
:value=
"item.expenseCategoryCalculateType"
></el-option>
:value=
"item.expenseCategoryCalculateType"
></el-option>
...
@@ -458,7 +458,7 @@
...
@@ -458,7 +458,7 @@
}
}
]">
]">
<el-select
v-model=
"scope.row.expenseCategoryCalculateType"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
<el-select
v-model=
"scope.row.expenseCategoryCalculateType"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
forceUpdat
e(
onExpenseCategoryCalculateTypeChang
e(
$event,
$event,
'serviceCostArr',
'serviceCostArr',
serveIdx,
serveIdx,
...
@@ -601,7 +601,7 @@
...
@@ -601,7 +601,7 @@
<el-select
class=
"w432"
v-model=
"classificationObj.platformCostArr[platformIdx]
<el-select
class=
"w432"
v-model=
"classificationObj.platformCostArr[platformIdx]
.expenseCategoryCalculateType
.expenseCategoryCalculateType
"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
forceUpdat
e($event, 'platformCostArr', platformIdx)
onExpenseCategoryCalculateTypeChang
e($event, 'platformCostArr', platformIdx)
"
>
"
>
<el-option
v-for=
"(item, index) in platformFeeList"
:key=
"index + 'platformFeeList'"
<el-option
v-for=
"(item, index) in platformFeeList"
:key=
"index + 'platformFeeList'"
:label=
"item.label"
:value=
"item.expenseCategoryCalculateType"
></el-option>
:label=
"item.label"
:value=
"item.expenseCategoryCalculateType"
></el-option>
...
@@ -686,7 +686,7 @@
...
@@ -686,7 +686,7 @@
}
}
]">
]">
<el-select
v-model=
"scope.row.expenseCategoryCalculateType"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
<el-select
v-model=
"scope.row.expenseCategoryCalculateType"
placeholder=
"请选择对账模式"
@
change=
"($event) =>
forceUpdat
e(
onExpenseCategoryCalculateTypeChang
e(
$event,
$event,
'platformCostArr',
'platformCostArr',
platformIdx,
platformIdx,
...
@@ -1173,16 +1173,14 @@ export default {
...
@@ -1173,16 +1173,14 @@ export default {
filterEmpty
(
data
)
{
filterEmpty
(
data
)
{
return
(
data
??
""
)
===
""
return
(
data
??
""
)
===
""
},
},
forceUpdate
(
e
,
name
,
index
,
subIndex
)
{
/**
// e 分润模式, name 分润方, index 主类目下标, subIndex 子类目下标
* B2:切换「对账模式」时清空已填费用值;用 $set 保证嵌套字段响应式。
if
(
e
)
{
* (勿与下方 flushNestedFormView 混淆:曾误命名为 forceUpdate,导致无参 this.forceUpdate() 完全不执行。)
*/
onExpenseCategoryCalculateTypeChange
(
e
,
name
,
index
,
subIndex
)
{
if
(
!
e
)
return
if
(
this
.
filterEmpty
(
subIndex
))
{
if
(
this
.
filterEmpty
(
subIndex
))
{
// B2:用 $set 保证嵌套路径响应式,替代整组件 $forceUpdate
this
.
$set
(
this
.
classificationObj
[
name
][
index
],
"expenseCategoryValue"
,
""
)
this
.
$set
(
this
.
classificationObj
[
name
][
index
],
"expenseCategoryValue"
,
""
)
}
else
{
}
else
{
this
.
$set
(
this
.
$set
(
this
.
classificationObj
[
name
][
index
].
children
[
subIndex
],
this
.
classificationObj
[
name
][
index
].
children
[
subIndex
],
...
@@ -1190,7 +1188,13 @@ export default {
...
@@ -1190,7 +1188,13 @@ export default {
""
""
)
)
}
}
}
},
/**
* B2:从父级 goodsTypeGroupReconciliationRules 批量合并进大表单后,深层 el-form-item 偶发不同步;
* 暂保留一次整树刷新。长期应改为逐路径 $set / 替换数组引用以去掉 $forceUpdate。
*/
flushNestedFormView
()
{
this
.
$forceUpdate
()
},
},
handleInput
(
newValue
,
name
,
type
,
index
,
ChildrenIndex
)
{
handleInput
(
newValue
,
name
,
type
,
index
,
ChildrenIndex
)
{
let
valueName
let
valueName
...
@@ -1225,7 +1229,7 @@ export default {
...
@@ -1225,7 +1229,7 @@ export default {
if
(
newValue
<
0
)
newValue
=
0
if
(
newValue
<
0
)
newValue
=
0
valueName
.
expenseCategoryValue
=
newValue
valueName
.
expenseCategoryValue
=
newValue
}
}
this
.
forceUpdate
()
// 直接改嵌套字段已可驱动视图,无需整组件刷新
},
},
// 获取商品数据
// 获取商品数据
remoteMethod
(
query
)
{
remoteMethod
(
query
)
{
...
@@ -1465,14 +1469,11 @@ export default {
...
@@ -1465,14 +1469,11 @@ export default {
// 计算模式修改
// 计算模式修改
updateCalculateModeType
(
event
,
name
,
index
)
{
updateCalculateModeType
(
event
,
name
,
index
)
{
const
obj
=
this
.
classificationObj
[
name
][
index
]
const
obj
=
this
.
classificationObj
[
name
][
index
]
this
.
classificationObj
[
name
][
index
].
children
=
obj
.
children
.
map
(
const
nextChildren
=
obj
.
children
.
map
((
item
)
=>
{
(
item
)
=>
{
// 最后一个子类目不赋值 item.nodeType == 4 ? '' :
item
.
calculateMode
=
event
item
.
calculateMode
=
event
return
item
return
item
}
})
)
this
.
$set
(
this
.
classificationObj
[
name
][
index
],
"children"
,
nextChildren
)
this
.
forceUpdate
()
},
},
/* 合并表头最后两项*/
/* 合并表头最后两项*/
headerCellStyle
({
row
,
columnIndex
})
{
headerCellStyle
({
row
,
columnIndex
})
{
...
@@ -1756,35 +1757,40 @@ export default {
...
@@ -1756,35 +1757,40 @@ export default {
this
.
getEffectRule
()
this
.
getEffectRule
()
})
})
},
},
// 对账item的详情 更新和初始化 classificationObj;返回 Promise,供提交前等待回写完成(避免校验跑在合并之前)
/**
getEffectRule
(
name
,
value
)
{
* 对账规则回显:合并父级 goodsTypeGroupReconciliationRules 到本 Tab 的 classificationObj。
const
promiseArr
=
[
* B1:async + await,错误栈与调试体验优于 .then 链。
*/
async
getEffectRule
(
name
,
value
)
{
await
Promise
.
all
([
this
.
getListPartnerMerchant
(),
this
.
getListPartnerMerchant
(),
this
.
getMerchantLevelList
(),
this
.
getMerchantLevelList
(),
this
.
getListPlatformMerchant
()
this
.
getListPlatformMerchant
()
]
])
return
Promise
.
all
(
promiseArr
).
then
(()
=>
{
const
res
=
deepClone
(
value
||
this
.
goodsTypeGroupReconciliationRules
)
const
res
=
deepClone
(
value
||
this
.
goodsTypeGroupReconciliationRules
)
const
that
=
this
const
that
=
this
if
(
!
res
||
!
res
.
length
||
!
res
[
0
])
{
if
(
!
res
||
!
res
.
length
||
!
res
[
0
])
{
this
.
forceUpdate
()
this
.
flushNestedFormView
()
return
return
}
}
const
checkType
=
res
[
0
].
groupType
==
1
// 是全部品类
const
checkType
=
res
[
0
].
groupType
==
1
if
(
that
.
tabindex
==
0
&&
res
[
0
].
groupType
==
2
)
{
if
(
that
.
tabindex
==
0
&&
res
[
0
].
groupType
==
2
)
{
this
.
forceUpdate
()
this
.
flushNestedFormView
()
return
return
}
}
const
checkRecordItem
=
res
[(
+
that
.
tabindex
)
-
(
checkType
?
0
:
1
)]
const
checkRecordItem
=
res
[
+
that
.
tabindex
-
(
checkType
?
0
:
1
)]
if
(
checkRecordItem
)
{
if
(
checkRecordItem
)
{
this
.
_suppressSelectionSync
=
true
this
.
_suppressSelectionSync
=
true
try
{
try
{
that
.
classificationObj
.
categoryType
=
checkRecordItem
?.
categoryType
||
''
that
.
classificationObj
.
categoryType
=
checkRecordItem
?.
categoryType
||
""
that
.
classificationObj
.
goodsTypeGroupRelations
=
that
.
classificationObj
.
goodsTypeGroupRelations
=
checkRecordItem
?.
goodsTypeGroupRelations
||
[]
checkRecordItem
?.
goodsTypeGroupRelations
||
[]
that
.
classificationObj
.
upgradeGoods
=
checkRecordItem
?.
upgradeGoods
||
[]
that
.
classificationObj
.
upgradeGoods
=
that
.
classificationObj
.
packageGoods
=
checkRecordItem
?.
packageGoods
||
[]
checkRecordItem
?.
upgradeGoods
||
[]
that
.
classificationObj
.
packageGoods
=
checkRecordItem
?.
packageGoods
||
[]
that
.
classificationObj
.
flowCostArr
=
that
.
getClassificationObjFormat
(
that
.
classificationObj
.
flowCostArr
=
that
.
getClassificationObjFormat
(
that
.
classificationObj
.
flowCostArr
,
that
.
classificationObj
.
flowCostArr
,
checkRecordItem
?.
expenseCategoryRules
||
[],
checkRecordItem
?.
expenseCategoryRules
||
[],
...
@@ -1796,8 +1802,9 @@ export default {
...
@@ -1796,8 +1802,9 @@ export default {
checkRecordItem
?.
expenseCategoryRules
||
[],
checkRecordItem
?.
expenseCategoryRules
||
[],
"serviceCost"
"serviceCost"
)
)
that
.
classificationObj
.
goodsSource
=
checkRecordItem
?.
goodsSource
||
1
that
.
classificationObj
.
goodsSource
=
that
.
classificationObj
.
formType
=
checkRecordItem
?.
formType
||
''
checkRecordItem
?.
goodsSource
||
1
that
.
classificationObj
.
formType
=
checkRecordItem
?.
formType
||
""
that
.
classificationObj
.
groupType
=
checkRecordItem
?.
groupType
||
2
that
.
classificationObj
.
groupType
=
checkRecordItem
?.
groupType
||
2
that
.
classificationObj
.
platformCostArr
=
that
.
classificationObj
.
platformCostArr
=
that
.
getClassificationObjFormat
(
that
.
getClassificationObjFormat
(
...
@@ -1805,16 +1812,15 @@ export default {
...
@@ -1805,16 +1812,15 @@ export default {
checkRecordItem
?.
expenseCategoryRules
||
[],
checkRecordItem
?.
expenseCategoryRules
||
[],
"platformCost"
"platformCost"
)
)
this
.
forceUpdate
()
this
.
flushNestedFormView
()
}
finally
{
}
finally
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
_suppressSelectionSync
=
false
this
.
_suppressSelectionSync
=
false
})
})
}
}
}
else
{
}
else
{
this
.
forceUpdate
()
this
.
flushNestedFormView
()
}
}
})
},
},
/**
/**
* 与 getEffectRule 一致:从父级下发的 goodsTypeGroupReconciliationRules 中取「当前 Tab」对应的一条规则。
* 与 getEffectRule 一致:从父级下发的 goodsTypeGroupReconciliationRules 中取「当前 Tab」对应的一条规则。
...
@@ -1998,19 +2004,15 @@ export default {
...
@@ -1998,19 +2004,15 @@ export default {
packageGoods
:
deepClone
(
this
.
classificationObj
.
packageGoods
||
[])
packageGoods
:
deepClone
(
this
.
classificationObj
.
packageGoods
||
[])
}
}
},
},
// 确定
按钮:先等待 getEffectRule 把缓存合并进 classificationObj,再校验(解决切 Tab / 懒加载时校验早于 Promise.all 的问题
)
// 确定
:先 await getEffectRule 合并回显,再校验(切 Tab / 懒加载时避免校验跑在合并前
)
async
handleConfirm
()
{
async
handleConfirm
()
{
await
this
.
getEffectRule
()
await
this
.
getEffectRule
()
await
this
.
$nextTick
()
await
this
.
$nextTick
()
const
form
=
this
.
$refs
.
classification
const
form
=
this
.
$refs
.
classification
if
(
!
form
)
return
false
if
(
!
form
)
return
false
return
new
Promise
((
resolve
)
=>
{
return
await
new
Promise
((
resolve
)
=>
{
form
.
validate
((
valid
)
=>
{
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
resolve
(
valid
?
this
.
getBackendFormat
()
:
false
)
resolve
(
this
.
getBackendFormat
())
}
else
{
resolve
(
false
)
}
})
})
})
})
},
},
...
...
src/views/systemConfig/merchant/merchantStep/merchantCheck.vue
View file @
db4c878
...
@@ -59,6 +59,12 @@
...
@@ -59,6 +59,12 @@
</template>
</template>
<
script
>
<
script
>
/**
* 商户对账编辑页(merchantCheck)
* 后续优化要点(对应规划 A 段):sceneLabel 计算属性、productType 浅监听、allSettled 并行加载、
* 费用类别 Promise.all、getAllReconciliationParams 免克隆 Tab 元数据、persist 单次深拷贝合并、
* uniqueBy 去重、errorIndex + focusTabByErrorIndex、子组件见 merchantStep/components/classificationCpt.vue(B 段)。
*/
import
{
deepClone
}
from
"@/common/util"
import
{
deepClone
}
from
"@/common/util"
import
{
sceneList
}
from
"@/common/constants"
import
{
sceneList
}
from
"@/common/constants"
import
{
import
{
...
@@ -155,7 +161,8 @@ export default {
...
@@ -155,7 +161,8 @@ export default {
},
},
created
()
{
created
()
{
this
.
getRowItem
()
this
.
getRowItem
()
this
.
getQueryFeeCategoryByType
()
// 获取费用类别
// A4:异步方法,不 await,与 mounted 数据加载并行;内部已 try/catch 三路费用接口
void
this
.
getQueryFeeCategoryByType
()
},
},
async
mounted
()
{
async
mounted
()
{
this
.
addContactgetReconciliationHistoryRecordApi
()
this
.
addContactgetReconciliationHistoryRecordApi
()
...
@@ -226,6 +233,82 @@ export default {
...
@@ -226,6 +233,82 @@ export default {
this
.
persistClassificationTabByPaneName
(
this
.
editableTabsValue
)
this
.
persistClassificationTabByPaneName
(
this
.
editableTabsValue
)
},
},
/**
/**
* 虚拟 Tab 下仅当前页挂载 classificationCpt,其它页的勾选不会触发 assign* emit,
* goodsSelectList 等与跨 Tab 禁用不同步。从 goodsTypeGroupReconciliationRules 聚合已选品类/商品/套餐
* (对账侧品类存在 goodsTypeGroupRelations,须按 categoryType 取值,避免与 upgradeGoods 重复计数)。
*/
rebuildCrossTabGoodsSelectionsFromRules
()
{
const
rules
=
this
.
goodsTypeGroupReconciliationRules
if
(
!
Array
.
isArray
(
rules
)
||
!
rules
.
length
)
{
this
.
goodsSelectList
=
[]
this
.
selectUpgradeGoodsList
=
[]
this
.
selectPackageGoodsList
=
[]
return
}
const
goodsAgg
=
[]
const
upgradeAgg
=
[]
const
packageAgg
=
[]
const
pushG
=
(
item
)
=>
{
if
(
!
item
||
item
.
goodsType
==
null
)
return
goodsAgg
.
push
(
deepClone
(
item
))
}
const
pushU
=
(
item
)
=>
{
if
(
!
item
||
item
.
upgradeGoodsId
==
null
)
return
upgradeAgg
.
push
(
deepClone
(
item
))
}
const
pushP
=
(
item
)
=>
{
if
(
!
item
||
item
.
packageCode
==
null
)
return
packageAgg
.
push
(
deepClone
(
item
))
}
for
(
let
i
=
0
;
i
<
rules
.
length
;
i
++
)
{
const
rule
=
rules
[
i
]
if
(
!
rule
||
typeof
rule
!==
"object"
)
continue
const
ct
=
rule
.
categoryType
const
rel
=
Array
.
isArray
(
rule
.
goodsTypeGroupRelations
)
?
rule
.
goodsTypeGroupRelations
:
[]
const
ug
=
Array
.
isArray
(
rule
.
upgradeGoods
)
?
rule
.
upgradeGoods
:
[]
const
pRaw
=
rule
.
packageGoods
const
pg
=
Array
.
isArray
(
pRaw
)
?
pRaw
:
pRaw
&&
typeof
pRaw
===
"object"
?
[
pRaw
]
:
[]
const
gt
=
Array
.
isArray
(
rule
.
goodsTypes
)
?
rule
.
goodsTypes
:
[]
if
(
ct
===
1
)
{
;(
rel
.
length
?
rel
:
gt
).
forEach
(
pushG
)
}
else
if
(
ct
===
2
)
{
;(
ug
.
length
?
ug
:
rel
).
forEach
(
pushU
)
}
else
if
(
ct
===
3
)
{
;(
pg
.
length
?
pg
:
rel
).
forEach
(
pushP
)
}
else
{
if
(
ug
.
length
)
ug
.
forEach
(
pushU
)
else
if
(
pg
.
length
)
pg
.
forEach
(
pushP
)
else
if
(
rel
.
length
)
{
const
inf
=
rel
[
0
]
&&
rel
[
0
].
categoryType
if
(
inf
===
2
)
rel
.
forEach
(
pushU
)
else
if
(
inf
===
3
)
rel
.
forEach
(
pushP
)
else
rel
.
forEach
(
pushG
)
}
else
if
(
gt
.
length
)
{
gt
.
forEach
(
pushG
)
}
}
}
this
.
goodsSelectList
=
uniqueBy
(
goodsAgg
,
(
x
)
=>
x
.
goodsType
)
this
.
selectUpgradeGoodsList
=
uniqueBy
(
upgradeAgg
,
(
x
)
=>
x
&&
x
.
upgradeGoodsId
)
this
.
selectPackageGoodsList
=
uniqueBy
(
packageAgg
,
(
x
)
=>
x
&&
x
.
packageCode
)
},
/**
* 嘀加商品来源 + 特殊品类(groupType===2):缓存里可能仅有 goodsTypes/upgradeGoods/packageGoods,
* 嘀加商品来源 + 特殊品类(groupType===2):缓存里可能仅有 goodsTypes/upgradeGoods/packageGoods,
* 没有 goodsTypeGroupRelations;非激活 Tab 走缓存提交时补齐,与财务分账页 fillDjGoodsTypeGroupRelations 一致。
* 没有 goodsTypeGroupRelations;非激活 Tab 走缓存提交时补齐,与财务分账页 fillDjGoodsTypeGroupRelations 一致。
*/
*/
...
@@ -398,6 +481,7 @@ export default {
...
@@ -398,6 +481,7 @@ export default {
await
this
.
$nextTick
()
await
this
.
$nextTick
()
}
}
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
return
goodsTypeGroupRules
return
goodsTypeGroupRules
},
},
// 是否在选择时添加 %号
// 是否在选择时添加 %号
...
@@ -512,7 +596,8 @@ export default {
...
@@ -512,7 +596,8 @@ export default {
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
this
.
allPages
=
res
.
pages
this
.
allPages
=
res
.
pages
const
resArr
=
res
.
list
.
reduce
((
arr
,
val
)
=>
{
// A3:list / upgradeGoodsList 缺省时兜底,避免单条脏数据打断整页
const
resArr
=
(
res
.
list
||
[]).
reduce
((
arr
,
val
)
=>
{
;(
val
.
upgradeGoodsList
||
[]).
forEach
((
el
)
=>
{
;(
val
.
upgradeGoodsList
||
[]).
forEach
((
el
)
=>
{
const
item
=
{}
const
item
=
{}
const
{
upgradeGoodsName
,
id
,
commodityCode
}
=
el
const
{
upgradeGoodsName
,
id
,
commodityCode
}
=
el
...
@@ -586,6 +671,7 @@ export default {
...
@@ -586,6 +671,7 @@ export default {
.
then
(()
=>
this
.
$nextTick
())
.
then
(()
=>
this
.
$nextTick
())
.
then
(()
=>
{
.
then
(()
=>
{
this
.
persistClassificationTabByPaneName
(
oldName
)
this
.
persistClassificationTabByPaneName
(
oldName
)
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
finish
()
finish
()
})
})
}
}
...
@@ -670,14 +756,10 @@ export default {
...
@@ -670,14 +756,10 @@ export default {
const
upgradeArr
=
[]
const
upgradeArr
=
[]
const
packageArr
=
[]
const
packageArr
=
[]
this
.
editableTabs
=
[]
this
.
editableTabs
=
[]
const
childParams
=
goodsTypeGroupRules
.
splice
(
removeIdx
,
1
)
goodsTypeGroupRules
.
splice
(
removeIdx
,
1
)
// this.$set(this.goodsTypeGroupReconciliationRules, goodsTypeGroupRules)
// this.$set(this.goodsTypeGroupReconciliationRules, goodsTypeGroupRules)
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
goodsTypeGroupReconciliationRules
=
goodsTypeGroupRules
this
.
goodsTypeGroupReconciliationRules
=
goodsTypeGroupRules
const
removed
=
childParams
[
0
]
||
{}
this
.
deleteSelectGoodsList
(
removed
.
goodsTypeGroupRelations
)
this
.
deleteSelectUpgradeGoodsList
(
removed
.
upgradeGoods
)
this
.
deleteSelectPackageGoodsList
(
removed
.
packageGoods
)
const
typeList
=
goodsTypeGroupRules
const
typeList
=
goodsTypeGroupRules
const
newLen
=
typeList
.
length
const
newLen
=
typeList
.
length
...
@@ -698,6 +780,7 @@ export default {
...
@@ -698,6 +780,7 @@ export default {
})
})
this
.
getSelectingList
(
upgradeArr
)
this
.
getSelectingList
(
upgradeArr
)
this
.
getSelectingListPackage
(
packageArr
)
this
.
getSelectingListPackage
(
packageArr
)
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
// this.queryFeeCategoryByTypeFlow = deepClone(this.queryFeeCategoryByTypeFlow)
// this.queryFeeCategoryByTypeFlow = deepClone(this.queryFeeCategoryByTypeFlow)
this
.
$message
({
this
.
$message
({
type
:
"success"
,
type
:
"success"
,
...
@@ -815,9 +898,11 @@ export default {
...
@@ -815,9 +898,11 @@ export default {
this
.
getSelectingList
(
upgradeArr
)
this
.
getSelectingList
(
upgradeArr
)
this
.
getSelectingListPackage
(
packageArr
)
this
.
getSelectingListPackage
(
packageArr
)
}
}
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
}
else
{
}
else
{
this
.
getSelectingList
()
this
.
getSelectingList
()
this
.
getSelectingListPackage
()
this
.
getSelectingListPackage
()
this
.
rebuildCrossTabGoodsSelectionsFromRules
()
}
}
},
},
checkParamsType
(
array
)
{
checkParamsType
(
array
)
{
...
...
src/views/systemConfig/merchant/merchantStep/utils/reconciliationRuleBranches.js
View file @
db4c878
/**
* B4(长期):与 financialRules 等页的同类归一逻辑可逐步迁入本目录或 merchant/shared,避免多处拷贝。
*/
import
{
deepClone
}
from
"@/common/util"
import
{
deepClone
}
from
"@/common/util"
/**
/**
...
...
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