Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ab1685a7
authored
Apr 26, 2023
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品管理: 完善选择商品分类
parent
5c52c172
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
src/api/mall/product/management/type/index.ts
+1
-1
src/views/mall/product/management/addForm.vue
+1
-1
src/views/mall/product/management/components/BasicInfoForm.vue
+10
-3
src/views/mall/product/management/components/OtherSettingsForm.vue
+3
-3
No files found.
src/api/mall/product/management/type/index.ts
View file @
ab1685a7
export
interface
SpuType
{
export
interface
SpuType
{
name
?:
string
// 商品名称
name
?:
string
// 商品名称
categoryId
?:
number
// 商品分类
categoryId
?:
number
|
undefined
// 商品分类
keyword
?:
string
// 关键字
keyword
?:
string
// 关键字
unit
?:
string
// 单位
unit
?:
string
// 单位
picUrl
?:
string
// 商品封面图
picUrl
?:
string
// 商品封面图
...
...
src/views/mall/product/management/addForm.vue
View file @
ab1685a7
...
@@ -49,7 +49,7 @@ const DescriptionRef = ref<ComponentRef<typeof DescriptionForm>>() // 商品详
...
@@ -49,7 +49,7 @@ const DescriptionRef = ref<ComponentRef<typeof DescriptionForm>>() // 商品详
const
OtherSettingsRef
=
ref
<
ComponentRef
<
typeof
OtherSettingsForm
>>
()
// 其他设置Ref
const
OtherSettingsRef
=
ref
<
ComponentRef
<
typeof
OtherSettingsForm
>>
()
// 其他设置Ref
const
formData
=
ref
<
SpuType
>
({
const
formData
=
ref
<
SpuType
>
({
name
:
''
,
// 商品名称
name
:
''
,
// 商品名称
categoryId
:
0
,
// 商品分类
categoryId
:
undefined
,
// 商品分类
keyword
:
''
,
// 关键字
keyword
:
''
,
// 关键字
unit
:
''
,
// 单位
unit
:
''
,
// 单位
picUrl
:
''
,
// 商品封面图
picUrl
:
''
,
// 商品封面图
...
...
src/views/mall/product/management/components/BasicInfoForm.vue
View file @
ab1685a7
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<el-form-item
label=
"商品分类"
prop=
"categoryId"
>
<el-form-item
label=
"商品分类"
prop=
"categoryId"
>
<el-tree-select
<el-tree-select
v-model=
"formData.categoryId"
v-model=
"formData.categoryId"
:data=
"
[]
"
:data=
"
categoryList
"
:props=
"defaultProps"
:props=
"defaultProps"
check-strictly
check-strictly
node-key=
"id"
node-key=
"id"
...
@@ -101,10 +101,11 @@
...
@@ -101,10 +101,11 @@
</
template
>
</
template
>
<
script
lang=
"ts"
name=
"ProductManagementBasicInfoForm"
setup
>
<
script
lang=
"ts"
name=
"ProductManagementBasicInfoForm"
setup
>
import
{
PropType
}
from
'vue'
import
{
PropType
}
from
'vue'
import
{
defaultProps
}
from
'@/utils/tree'
import
type
{
SpuType
}
from
'@/api/mall/product/management/type'
import
type
{
SpuType
}
from
'@/api/mall/product/management/type'
import
{
UploadImg
,
UploadImgs
}
from
'@/components/UploadFile'
import
{
UploadImg
,
UploadImgs
}
from
'@/components/UploadFile'
import
{
copyValueToTarget
}
from
'@/utils/object'
import
{
copyValueToTarget
}
from
'@/utils/object'
import
*
as
ProductCategoryApi
from
'@/api/mall/product/category'
import
{
defaultProps
,
handleTree
}
from
'@/utils/tree'
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
const
props
=
defineProps
({
const
props
=
defineProps
({
...
@@ -117,7 +118,7 @@ const props = defineProps({
...
@@ -117,7 +118,7 @@ const props = defineProps({
const
ProductManagementBasicInfoRef
=
ref
()
// 表单Ref
const
ProductManagementBasicInfoRef
=
ref
()
// 表单Ref
const
formData
=
ref
<
SpuType
>
({
const
formData
=
ref
<
SpuType
>
({
name
:
''
,
// 商品名称
name
:
''
,
// 商品名称
categoryId
:
155415
,
// 商品分类
categoryId
:
undefined
,
// 商品分类
keyword
:
''
,
// 关键字
keyword
:
''
,
// 关键字
unit
:
''
,
// 单位
unit
:
''
,
// 单位
picUrl
:
''
,
// 商品封面图
picUrl
:
''
,
// 商品封面图
...
@@ -186,4 +187,10 @@ const changeSubCommissionType = (subCommissionType) => {
...
@@ -186,4 +187,10 @@ const changeSubCommissionType = (subCommissionType) => {
const
confirm
=
()
=>
{}
const
confirm
=
()
=>
{}
// 添加规格
// 添加规格
const
addRule
=
()
=>
{}
const
addRule
=
()
=>
{}
const
categoryList
=
ref
()
// 分类树
onMounted
(
async
()
=>
{
// 获得分类树
const
data
=
await
ProductCategoryApi
.
getCategoryList
({})
categoryList
.
value
=
handleTree
(
data
,
'id'
,
'parentId'
)
})
</
script
>
</
script
>
src/views/mall/product/management/components/OtherSettingsForm.vue
View file @
ab1685a7
...
@@ -92,9 +92,9 @@ const onChangeGroup = () => {
...
@@ -92,9 +92,9 @@ const onChangeGroup = () => {
const
OtherSettingsFormRef
=
ref
()
// 表单Ref
const
OtherSettingsFormRef
=
ref
()
// 表单Ref
// 表单数据
// 表单数据
const
formData
=
ref
<
SpuType
>
({
const
formData
=
ref
<
SpuType
>
({
sort
:
1
2
,
// 商品排序
sort
:
1
,
// 商品排序
giveIntegral
:
666
,
// 赠送积分
giveIntegral
:
1
,
// 赠送积分
virtualSalesCount
:
565656
,
// 虚拟销量
virtualSalesCount
:
1
,
// 虚拟销量
recommendHot
:
false
,
// 是否热卖
recommendHot
:
false
,
// 是否热卖
recommendBenefit
:
false
,
// 是否优惠
recommendBenefit
:
false
,
// 是否优惠
recommendBest
:
false
,
// 是否精品
recommendBest
:
false
,
// 是否精品
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment