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
2ddb6050
authored
May 31, 2023
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 完善 SPU 选择快递模版的功能
parent
39c92cb9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
8 deletions
+28
-8
src/api/mall/trade/delivery/expressTemplate/index.ts
+5
-0
src/views/mall/product/spu/addForm.vue
+6
-2
src/views/mall/product/spu/components/BasicInfoForm.vue
+16
-5
src/views/mall/product/spu/index.vue
+1
-1
No files found.
src/api/mall/trade/delivery/expressTemplate/index.ts
View file @
2ddb6050
...
@@ -33,6 +33,11 @@ export const getDeliveryExpressTemplate = async (id: number) => {
...
@@ -33,6 +33,11 @@ export const getDeliveryExpressTemplate = async (id: number) => {
return
await
request
.
get
({
url
:
'/trade/delivery/express-template/get?id='
+
id
})
return
await
request
.
get
({
url
:
'/trade/delivery/express-template/get?id='
+
id
})
}
}
// 查询快递运费模板详情
export
const
getSimpleTemplateList
=
async
()
=>
{
return
await
request
.
get
({
url
:
'/trade/delivery/express-template/list-all-simple'
})
}
// 新增快递运费模板
// 新增快递运费模板
export
const
createDeliveryExpressTemplate
=
async
(
data
:
DeliveryExpressTemplateVO
)
=>
{
export
const
createDeliveryExpressTemplate
=
async
(
data
:
DeliveryExpressTemplateVO
)
=>
{
return
await
request
.
post
({
url
:
'/trade/delivery/express-template/create'
,
data
})
return
await
request
.
post
({
url
:
'/trade/delivery/express-template/create'
,
data
})
...
...
src/views/mall/product/spu/addForm.vue
View file @
2ddb6050
...
@@ -28,7 +28,9 @@
...
@@ -28,7 +28,9 @@
</el-tabs>
</el-tabs>
<el-form>
<el-form>
<el-form-item
style=
"float: right"
>
<el-form-item
style=
"float: right"
>
<el-button
:loading=
"formLoading"
type=
"primary"
@
click=
"submitForm"
>
保存
</el-button>
<el-button
v-if=
"!isDetail"
:loading=
"formLoading"
type=
"primary"
@
click=
"submitForm"
>
保存
</el-button>
<el-button
@
click=
"close"
>
返回
</el-button>
<el-button
@
click=
"close"
>
返回
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -94,7 +96,9 @@ const formData = ref<ProductSpuApi.Spu>({
...
@@ -94,7 +96,9 @@ const formData = ref<ProductSpuApi.Spu>({
/** 获得详情 */
/** 获得详情 */
const
getDetail
=
async
()
=>
{
const
getDetail
=
async
()
=>
{
console
.
log
(
name
)
if
(
'productSpuDetail'
===
name
)
{
isDetail
.
value
=
true
}
const
id
=
params
.
spuId
as
number
const
id
=
params
.
spuId
as
number
if
(
id
)
{
if
(
id
)
{
formLoading
.
value
=
true
formLoading
.
value
=
true
...
...
src/views/mall/product/spu/components/BasicInfoForm.vue
View file @
2ddb6050
...
@@ -67,7 +67,12 @@
...
@@ -67,7 +67,12 @@
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"运费模板"
prop=
"deliveryTemplateId"
>
<el-form-item
label=
"运费模板"
prop=
"deliveryTemplateId"
>
<el-select
v-model=
"formData.deliveryTemplateId"
placeholder=
"请选择"
>
<el-select
v-model=
"formData.deliveryTemplateId"
placeholder=
"请选择"
>
<el-option
v-for=
"item in []"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
<el-option
v-for=
"item in deliveryTemplateList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-select>
<el-button
class=
"ml-20px"
>
运费模板
</el-button>
<el-button
class=
"ml-20px"
>
运费模板
</el-button>
</el-form-item>
</el-form-item>
...
@@ -127,6 +132,9 @@
...
@@ -127,6 +132,9 @@
<
template
#
brandId=
"{ row }"
>
<
template
#
brandId=
"{ row }"
>
{{
brandList
.
find
((
item
)
=>
item
.
id
===
row
.
brandId
)?.
name
}}
{{
brandList
.
find
((
item
)
=>
item
.
id
===
row
.
brandId
)?.
name
}}
</
template
>
</
template
>
<
template
#
deliveryTemplateId=
"{ row }"
>
{{
deliveryTemplateList
.
find
((
item
)
=>
item
.
id
===
row
.
deliveryTemplateId
)?.
name
}}
</
template
>
<
template
#
specType=
"{ row }"
>
<
template
#
specType=
"{ row }"
>
{{
row
.
specType
?
'多规格'
:
'单规格'
}}
{{
row
.
specType
?
'多规格'
:
'单规格'
}}
</
template
>
</
template
>
...
@@ -157,19 +165,19 @@
...
@@ -157,19 +165,19 @@
</template>
</template>
<
script
lang=
"ts"
name=
"ProductSpuBasicInfoForm"
setup
>
<
script
lang=
"ts"
name=
"ProductSpuBasicInfoForm"
setup
>
import
{
PropType
}
from
'vue'
import
{
PropType
}
from
'vue'
import
{
isArray
}
from
'@/utils/is'
import
{
copyValueToTarget
}
from
'@/utils'
import
{
copyValueToTarget
}
from
'@/utils'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
checkSelectedNode
,
defaultProps
,
handleTree
,
treeToString
}
from
'@/utils/tree'
import
{
checkSelectedNode
,
defaultProps
,
handleTree
,
treeToString
}
from
'@/utils/tree'
import
{
createImageViewer
}
from
'@/components/ImageViewer'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
type
{
Spu
}
from
'@/api/mall/product/spu'
import
{
UploadImg
,
UploadImgs
}
from
'@/components/UploadFile'
import
{
UploadImg
,
UploadImgs
}
from
'@/components/UploadFile'
import
{
ProductAttributes
,
ProductAttributesAddForm
,
SkuList
}
from
'./index'
import
{
ProductAttributes
,
ProductAttributesAddForm
,
SkuList
}
from
'./index'
import
{
basicInfoSchema
}
from
'./spu.data'
import
{
basicInfoSchema
}
from
'./spu.data'
import
{
createImageViewer
}
from
'@/components/ImageViewer
'
import
type
{
Spu
}
from
'@/api/mall/product/spu
'
import
*
as
ProductCategoryApi
from
'@/api/mall/product/category'
import
*
as
ProductCategoryApi
from
'@/api/mall/product/category'
import
{
getSimpleBrandList
}
from
'@/api/mall/product/brand'
import
{
getSimpleBrandList
}
from
'@/api/mall/product/brand'
import
{
isArray
}
from
'@/utils/is'
import
{
getSimpleTemplateList
}
from
'@/api/mall/trade/delivery/expressTemplate/index'
// ====== 商品详情相关操作 ======
// ====== 商品详情相关操作 ======
const
{
allSchemas
}
=
useCrudSchemas
(
basicInfoSchema
)
const
{
allSchemas
}
=
useCrudSchemas
(
basicInfoSchema
)
/** 商品图预览 */
/** 商品图预览 */
...
@@ -345,11 +353,14 @@ const categoryString = (categoryId) => {
...
@@ -345,11 +353,14 @@ const categoryString = (categoryId) => {
return
treeToString
(
categoryList
.
value
,
categoryId
)
return
treeToString
(
categoryList
.
value
,
categoryId
)
}
}
const
brandList
=
ref
([])
// 精简商品品牌列表
const
brandList
=
ref
([])
// 精简商品品牌列表
const
deliveryTemplateList
=
ref
([])
// 运费模版
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
// 获得分类树
// 获得分类树
const
data
=
await
ProductCategoryApi
.
getCategoryList
({})
const
data
=
await
ProductCategoryApi
.
getCategoryList
({})
categoryList
.
value
=
handleTree
(
data
,
'id'
,
'parentId'
)
categoryList
.
value
=
handleTree
(
data
,
'id'
,
'parentId'
)
// 获取商品品牌列表
// 获取商品品牌列表
brandList
.
value
=
await
getSimpleBrandList
()
brandList
.
value
=
await
getSimpleBrandList
()
// 获取运费模版
deliveryTemplateList
.
value
=
await
getSimpleTemplateList
()
})
})
</
script
>
</
script
>
src/views/mall/product/spu/index.vue
View file @
2ddb6050
...
@@ -408,7 +408,7 @@ const openForm = (id?: number) => {
...
@@ -408,7 +408,7 @@ const openForm = (id?: number) => {
* 查看商品详情
* 查看商品详情
*/
*/
const
openDetail
=
(
id
?:
number
)
=>
{
const
openDetail
=
(
id
?:
number
)
=>
{
push
(
'/product/productSpuDetail'
+
id
)
push
(
'/product/productSpuDetail
/
'
+
id
)
}
}
/** 导出按钮操作 */
/** 导出按钮操作 */
...
...
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