Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
5a253d46
提交
5a253d46
authored
7月 07, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 更新运费模板和售后政策的处理逻辑,支持多选和新选项
上级
904bb383
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
4 行删除
+24
-4
FormService.vue
...odules/live/product/management/components/FormService.vue
+1
-1
Update.vue
src/modules/live/product/management/views/Update.vue
+15
-2
dictionary.ts
src/utils/dictionary.ts
+8
-1
没有找到文件。
src/modules/live/product/management/components/FormService.vue
浏览文件 @
5a253d46
...
@@ -6,7 +6,7 @@ const form = inject('form')
...
@@ -6,7 +6,7 @@ const form = inject('form')
<
template
>
<
template
>
<div>
<div>
<el-form-item
label=
"运费模板"
prop=
"info.shipping_template"
:rules=
"[
{ required: true, message: '请选择' }]">
<el-form-item
label=
"运费模板"
prop=
"info.shipping_template"
:rules=
"[
{ required: true, message: '请选择' }]">
<el-select
v-model=
"form.info.shipping_template"
style=
"width: 300px; max-width: 100%"
>
<el-select
v-model=
"form.info.shipping_template"
style=
"width: 300px; max-width: 100%"
multiple
>
<el-option
v-for=
"item in shippingTemplate"
:key=
"item.value"
v-bind=
"item"
></el-option>
<el-option
v-for=
"item in shippingTemplate"
:key=
"item.value"
v-bind=
"item"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
...
src/modules/live/product/management/views/Update.vue
浏览文件 @
5a253d46
...
@@ -32,7 +32,7 @@ const form = reactive({
...
@@ -32,7 +32,7 @@ const form = reactive({
delivery_time
:
'1'
,
// 发货时间
delivery_time
:
'1'
,
// 发货时间
reference_price
:
''
,
// 参考价格
reference_price
:
''
,
// 参考价格
order_stock_count
:
'1'
,
order_stock_count
:
'1'
,
shipping_template
:
''
,
// 运费模板
shipping_template
:
[]
,
// 运费模板
after_sales_policy
:
[],
// 售后政策
after_sales_policy
:
[],
// 售后政策
specs
:
[],
// 规格列表
specs
:
[],
// 规格列表
sku
:
[],
// SKU列表(通过规格笛卡尔积生成)
sku
:
[],
// SKU列表(通过规格笛卡尔积生成)
...
@@ -44,6 +44,7 @@ async function fetchInfo() {
...
@@ -44,6 +44,7 @@ async function fetchInfo() {
const
res
=
await
getProduct
({
id
:
route
.
query
.
id
})
const
res
=
await
getProduct
({
id
:
route
.
query
.
id
})
const
detail
=
res
.
data
.
detail
const
detail
=
res
.
data
.
detail
const
attrs
=
JSON
.
parse
(
detail
.
live_commodity_attrs
)
const
attrs
=
JSON
.
parse
(
detail
.
live_commodity_attrs
)
const
info
=
JSON
.
parse
(
detail
.
info
)
Object
.
assign
(
form
,
detail
,
{
Object
.
assign
(
form
,
detail
,
{
live_commodity_attrs
:
{
live_commodity_attrs
:
{
importance_attrs
:
Array
.
isArray
(
attrs
.
importance_attrs
)
importance_attrs
:
Array
.
isArray
(
attrs
.
importance_attrs
)
...
@@ -55,7 +56,19 @@ async function fetchInfo() {
...
@@ -55,7 +56,19 @@ async function fetchInfo() {
},
},
picture_addreses
:
JSON
.
parse
(
detail
.
picture_addreses
),
picture_addreses
:
JSON
.
parse
(
detail
.
picture_addreses
),
picture_34_addreses
:
JSON
.
parse
(
detail
.
picture_34_addreses
),
picture_34_addreses
:
JSON
.
parse
(
detail
.
picture_34_addreses
),
info
:
JSON
.
parse
(
detail
.
info
),
info
:
{
...
info
,
shipping_template
:
Array
.
isArray
(
info
.
shipping_template
)
?
info
.
shipping_template
:
info
.
shipping_template
?
[
info
.
shipping_template
]
:
[],
after_sales_policy
:
Array
.
isArray
(
info
.
after_sales_policy
)
?
info
.
after_sales_policy
:
info
.
after_sales_policy
?
[
info
.
after_sales_policy
]
:
[],
},
})
})
}
}
watchEffect
(()
=>
{
watchEffect
(()
=>
{
...
...
src/utils/dictionary.ts
浏览文件 @
5a253d46
...
@@ -3,7 +3,10 @@ export interface Dictionary {
...
@@ -3,7 +3,10 @@ export interface Dictionary {
value
:
string
|
number
value
:
string
|
number
}
}
export
function
getNameByValue
(
value
:
string
|
number
,
list
:
Dictionary
[])
{
export
function
getNameByValue
(
value
:
string
|
number
|
Array
<
string
|
number
>
,
list
:
Dictionary
[])
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
((
item
)
=>
getNameByValue
(
item
,
list
)).
filter
(
Boolean
).
join
(
'、'
)
}
return
list
.
find
((
item
)
=>
item
.
value
==
value
)?.
label
||
value
return
list
.
find
((
item
)
=>
item
.
value
==
value
)?.
label
||
value
}
}
...
@@ -245,6 +248,7 @@ export const shippingTemplate = [
...
@@ -245,6 +248,7 @@ export const shippingTemplate = [
{
label
:
'自选快递运费模板'
,
value
:
'11'
},
{
label
:
'自选快递运费模板'
,
value
:
'11'
},
{
label
:
'满99元包邮'
,
value
:
'12'
},
{
label
:
'满99元包邮'
,
value
:
'12'
},
{
label
:
'全国包邮(偏远地区除外)'
,
value
:
'13'
},
{
label
:
'全国包邮(偏远地区除外)'
,
value
:
'13'
},
{
label
:
'未满99元统一运费12元'
,
value
:
'14'
},
]
]
// 售后政策
// 售后政策
...
@@ -258,4 +262,7 @@ export const afterSalesPolicy = [
...
@@ -258,4 +262,7 @@ export const afterSalesPolicy = [
{
label
:
'闪电退货'
,
value
:
'7'
},
{
label
:
'闪电退货'
,
value
:
'7'
},
{
label
:
'售后补寄'
,
value
:
'8'
},
{
label
:
'售后补寄'
,
value
:
'8'
},
{
label
:
'坏果包赔'
,
value
:
'9'
},
{
label
:
'坏果包赔'
,
value
:
'9'
},
{
label
:
'坏果按颗包赔'
,
value
:
'10'
},
{
label
:
'腐烂全额退款'
,
value
:
'11'
},
{
label
:
'破损拍照理赔'
,
value
:
'12'
},
]
]
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论