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 d2e86073
authored
Jun 26, 2026
by
张晓玮
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V5.8.3-zxw' into 'SAAS+V5.8.3'
交互优化修改 See merge request
!783
2 parents
bb9e9a49
92ffd96e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
10 deletions
src/views/marketingManagement/marketingActivity/components/packageList.vue
src/views/marketingManagement/marketingActivity/viewMarketingActivity.vue
src/views/marketingManagement/marketingActivity/components/packageList.vue
View file @
d2e8607
...
...
@@ -223,7 +223,8 @@
</
template
>
<!-- 展开内容:子商品 div 模拟表格 -->
<div
class=
"collapse-content"
>
<div
v-loading=
"packageLoadingMap[pkg.packageId]"
class=
"collapse-content"
>
<!-- 子商品表头 -->
<div
class=
"sub-table-header"
>
<span
class=
"sh-col sh-col-name"
>
产品名称
</span>
...
...
@@ -274,6 +275,7 @@ export default {
sortableInstance
:
null
,
localList
:
[],
activeNames
:
[],
// 手风琴展开的项 id 列表
packageLoadingMap
:
{},
// 每个套餐子商品加载状态
};
},
...
...
@@ -335,26 +337,55 @@ export default {
},
/**
* 加载套餐子商品数据(
首次展开时调用,已加载过不重复请求
)
* 加载套餐子商品数据(
每次展开时调用,合并新旧数据保留用户输入
)
*/
loadPackageProducts
(
packageId
)
{
const
idx
=
this
.
localList
.
findIndex
(
p
=>
p
.
packageId
===
packageId
);
if
(
idx
<
0
)
return
;
const
pkg
=
this
.
localList
[
idx
];
// 已有子商品数据则不再请求
if
((
pkg
.
packageItems
||
[]).
length
)
return
;
if
(
!
pkg
.
packageId
)
return
;
// 设置loading状态
this
.
$set
(
this
.
packageLoadingMap
,
packageId
,
true
);
// 保存旧的子商品数据(用于合并)
const
oldItems
=
pkg
.
packageItems
||
[];
getGoodsDataByPackage
({
packageId
:
pkg
.
packageId
}).
then
((
res
)
=>
{
if
(
!
res
||
!
res
.
length
)
if
(
!
res
||
!
res
.
length
)
{
// 如果新数据为空,清空子商品列表
pkg
.
packageItems
=
[];
return
;
res
?.
forEach
((
val
)
=>
{
val
.
discountPrice
=
""
;
}
// 合并新旧数据:新数据覆盖基础信息,保留用户输入字段(discountPrice)
const
mergedItems
=
res
.
map
((
newItem
)
=>
{
// 在旧数据中查找匹配项(通过goodsCode匹配)
const
oldItem
=
oldItems
.
find
(
old
=>
old
.
goodsCode
===
newItem
.
goodsCode
);
// 如果找到匹配项,保留用户输入的优惠价
if
(
oldItem
&&
oldItem
.
discountPrice
!==
""
&&
oldItem
.
discountPrice
!=
null
)
{
return
{
...
newItem
,
discountPrice
:
oldItem
.
discountPrice
,
// 保留用户输入的优惠价
discountPriceError
:
oldItem
.
discountPriceError
||
false
,
// 保留错误状态
};
}
// 新商品或之前未输入优惠价,使用默认值
return
{
...
newItem
,
discountPrice
:
""
,
discountPriceError
:
false
,
};
});
pkg
.
packageItems
=
res
||
[];
pkg
.
packageItems
=
mergedItems
;
}).
finally
(()
=>
{
// 清除loading状态
this
.
$set
(
this
.
packageLoadingMap
,
packageId
,
false
);
});
},
...
...
src/views/marketingManagement/marketingActivity/viewMarketingActivity.vue
View file @
d2e8607
...
...
@@ -150,7 +150,7 @@
<!-- 该车系只有套餐或只有商品:单表展示 -->
<
template
v-else
>
<MixedDetailTable
:list=
"series.packageList.length ? packageList : series.goodsList.length ? series.goodsList : []"
/>
<MixedDetailTable
:list=
"series.packageList.length ?
series.
packageList : series.goodsList.length ? series.goodsList : []"
/>
</
template
>
</el-tab-pane>
</el-tabs>
...
...
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