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
3918fab1
authored
Sep 01, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review
parent
135c88a4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
60 deletions
+57
-60
src/views/mall/product/brand/index.vue
+1
-1
src/views/mall/product/category/index.vue
+1
-1
src/views/mall/product/comment/index.vue
+1
-1
src/views/mall/product/property/value/index.vue
+1
-1
src/views/mall/product/spu/components/index.ts
+30
-1
src/views/mall/product/spu/form/BasicInfoForm.vue
+1
-29
src/views/mall/product/spu/form/index.vue
+1
-1
src/views/mall/product/spu/index.vue
+8
-10
src/views/mall/trade/afterSale/detail/index.vue
+13
-15
No files found.
src/views/mall/product/brand/index.vue
View file @
3918fab1
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
<el-table-column
label=
"品牌名称"
prop=
"name"
sortable
/>
<el-table-column
label=
"品牌名称"
prop=
"name"
sortable
/>
<el-table-column
label=
"品牌图片"
align=
"center"
prop=
"picUrl"
>
<el-table-column
label=
"品牌图片"
align=
"center"
prop=
"picUrl"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<img
v-if=
"scope.row.picUrl"
:src=
"scope.row.picUrl"
alt=
"品牌图片"
class=
"h-
10
0px"
/>
<img
v-if=
"scope.row.picUrl"
:src=
"scope.row.picUrl"
alt=
"品牌图片"
class=
"h-
3
0px"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"品牌排序"
align=
"center"
prop=
"sort"
/>
<el-table-column
label=
"品牌排序"
align=
"center"
prop=
"sort"
/>
...
...
src/views/mall/product/category/index.vue
View file @
3918fab1
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<el-table-column
label=
"分类名称"
prop=
"name"
sortable
/>
<el-table-column
label=
"分类名称"
prop=
"name"
sortable
/>
<el-table-column
label=
"移动端分类图"
align=
"center"
prop=
"picUrl"
>
<el-table-column
label=
"移动端分类图"
align=
"center"
prop=
"picUrl"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<img
v-if=
"scope.row.picUrl"
:src=
"scope.row.picUrl"
alt=
"移动端分类图"
class=
"h-
10
0px"
/>
<img
v-if=
"scope.row.picUrl"
:src=
"scope.row.picUrl"
alt=
"移动端分类图"
class=
"h-
3
0px"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"分类排序"
align=
"center"
prop=
"sort"
/>
<el-table-column
label=
"分类排序"
align=
"center"
prop=
"sort"
/>
...
...
src/views/mall/product/comment/index.vue
View file @
3918fab1
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
:formatter=
"dateFormatter"
:formatter=
"dateFormatter"
width=
"170"
width=
"170"
/>
/>
<el-table-column
label=
"
状态"
align=
"center"
width=
"65
px"
>
<el-table-column
label=
"
是否展示"
align=
"center"
width=
"80
px"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-switch
<el-switch
v-model=
"scope.row.visible"
v-model=
"scope.row.visible"
...
...
src/views/mall/product/property/value/index.vue
View file @
3918fab1
...
@@ -147,7 +147,7 @@ const handleDelete = async (id: number) => {
...
@@ -147,7 +147,7 @@ const handleDelete = async (id: number) => {
// 删除的二次确认
// 删除的二次确认
await
message
.
delConfirm
()
await
message
.
delConfirm
()
// 发起删除
// 发起删除
await
PropertyApi
.
deleteProperty
(
id
)
await
PropertyApi
.
deleteProperty
Value
(
id
)
message
.
success
(
t
(
'common.delSuccess'
))
message
.
success
(
t
(
'common.delSuccess'
))
// 刷新列表
// 刷新列表
await
getList
()
await
getList
()
...
...
src/views/mall/product/spu/components/index.ts
View file @
3918fab1
import
SkuList
from
'./SkuList.vue'
import
SkuList
from
'./SkuList.vue'
import
{
Spu
}
from
'@/api/mall/product/spu'
interface
PropertyAndValues
{
interface
PropertyAndValues
{
id
:
number
id
:
number
...
@@ -22,4 +23,32 @@ interface RuleConfig {
...
@@ -22,4 +23,32 @@ interface RuleConfig {
message
:
string
message
:
string
}
}
export
{
SkuList
,
PropertyAndValues
,
RuleConfig
}
/**
* 获得商品的规格列表
*
* @param spu
* @return PropertyAndValues 规格列表
*/
const
getPropertyList
=
(
spu
:
Spu
):
PropertyAndValues
[]
=>
{
// 直接拿返回的 skus 属性逆向生成出 propertyList
const
properties
:
PropertyAndValues
[]
=
[]
// 只有是多规格才处理
if
(
spu
.
specType
)
{
spu
.
skus
?.
forEach
((
sku
)
=>
{
sku
.
properties
?.
forEach
(({
propertyId
,
propertyName
,
valueId
,
valueName
})
=>
{
// 添加属性
if
(
!
properties
?.
some
((
item
)
=>
item
.
id
===
propertyId
))
{
properties
.
push
({
id
:
propertyId
!
,
name
:
propertyName
!
,
values
:
[]
})
}
// 添加属性值
const
index
=
properties
?.
findIndex
((
item
)
=>
item
.
id
===
propertyId
)
if
(
!
properties
[
index
].
values
?.
some
((
value
)
=>
value
.
id
===
valueId
))
{
properties
[
index
].
values
?.
push
({
id
:
valueId
!
,
name
:
valueName
!
})
}
})
})
}
return
properties
}
export
{
SkuList
,
getPropertyList
,
PropertyAndValues
,
RuleConfig
}
src/views/mall/product/spu/form/BasicInfoForm.vue
View file @
3918fab1
...
@@ -175,7 +175,7 @@ import { propTypes } from '@/utils/propTypes'
...
@@ -175,7 +175,7 @@ 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
{
createImageViewer
}
from
'@/components/ImageViewer'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
PropertyAndValues
,
SkuList
}
from
'@/views/mall/product/spu/components/index.ts'
import
{
getPropertyList
,
SkuList
}
from
'@/views/mall/product/spu/components/index.ts'
import
ProductAttributes
from
'./ProductAttributes.vue'
import
ProductAttributes
from
'./ProductAttributes.vue'
import
ProductPropertyAddForm
from
'./ProductPropertyAddForm.vue'
import
ProductPropertyAddForm
from
'./ProductPropertyAddForm.vue'
import
{
basicInfoSchema
}
from
'./spu.data'
import
{
basicInfoSchema
}
from
'./spu.data'
...
@@ -203,34 +203,6 @@ const imagePreview = (args) => {
...
@@ -203,34 +203,6 @@ const imagePreview = (args) => {
})
})
}
}
/**
* 获得商品的规格列表
*
* @param spu
* @return PropertyAndValues 规格列表
*/
const
getPropertyList
=
(
spu
:
Spu
):
PropertyAndValues
[]
=>
{
// 直接拿返回的 skus 属性逆向生成出 propertyList
const
properties
:
PropertyAndValues
[]
=
[]
// 只有是多规格才处理
if
(
spu
.
specType
)
{
spu
.
skus
?.
forEach
((
sku
)
=>
{
sku
.
properties
?.
forEach
(({
propertyId
,
propertyName
,
valueId
,
valueName
})
=>
{
// 添加属性
if
(
!
properties
?.
some
((
item
)
=>
item
.
id
===
propertyId
))
{
properties
.
push
({
id
:
propertyId
!
,
name
:
propertyName
!
,
values
:
[]
})
}
// 添加属性值
const
index
=
properties
?.
findIndex
((
item
)
=>
item
.
id
===
propertyId
)
if
(
!
properties
[
index
].
values
?.
some
((
value
)
=>
value
.
id
===
valueId
))
{
properties
[
index
].
values
?.
push
({
id
:
valueId
!
,
name
:
valueName
!
})
}
})
})
}
return
properties
}
// ====== end ======
// ====== end ======
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
...
...
src/views/mall/product/spu/form/index.vue
View file @
3918fab1
...
@@ -189,7 +189,7 @@ const submitForm = async () => {
...
@@ -189,7 +189,7 @@ const submitForm = async () => {
/** 关闭按钮 */
/** 关闭按钮 */
const
close
=
()
=>
{
const
close
=
()
=>
{
delView
(
unref
(
currentRoute
))
delView
(
unref
(
currentRoute
))
push
(
'/product/product-spu'
)
push
(
{
name
:
'ProductSpu'
}
)
}
}
/** 初始化 */
/** 初始化 */
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
...
...
src/views/mall/product/spu/index.vue
View file @
3918fab1
...
@@ -170,6 +170,14 @@
...
@@ -170,6 +170,14 @@
>
>
详情
详情
</el-button>
</el-button>
<el-button
v-hasPermi=
"['product:spu:update']"
link
type=
"primary"
@
click=
"openForm(row.id)"
>
修改
</el-button>
<template
v-if=
"queryParams.tabType === 4"
>
<template
v-if=
"queryParams.tabType === 4"
>
<el-button
<el-button
v-hasPermi=
"['product:spu:delete']"
v-hasPermi=
"['product:spu:delete']"
...
@@ -189,16 +197,6 @@
...
@@ -189,16 +197,6 @@
</el-button>
</el-button>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<!-- 只有不是上架和回收站的商品可以编辑 -->
<el-button
v-if=
"queryParams.tabType !== 0"
v-hasPermi=
"['product:spu:update']"
link
type=
"primary"
@
click=
"openForm(row.id)"
>
修改
</el-button>
<el-button
<el-button
v-hasPermi=
"['product:spu:update']"
v-hasPermi=
"['product:spu:update']"
link
link
...
...
src/views/mall/trade/afterSale/detail/index.vue
View file @
3918fab1
...
@@ -154,44 +154,41 @@ const getDetail = async () => {
...
@@ -154,44 +154,41 @@ const getDetail = async () => {
formData
.
value
=
await
AfterSaleApi
.
getAfterSale
(
id
)
formData
.
value
=
await
AfterSaleApi
.
getAfterSale
(
id
)
}
}
}
}
/**
* 同意售后
// TODO @puhui999:操作后,需要提示和刷新哈。
*/
/** 同意售后
*/
const
agree
=
()
=>
{
const
agree
=
()
=>
{
message
.
confirm
(
'是否同意售后?'
).
then
(()
=>
{
message
.
confirm
(
'是否同意售后?'
).
then
(()
=>
{
AfterSaleApi
.
agree
(
formData
.
value
.
id
)
AfterSaleApi
.
agree
(
formData
.
value
.
id
)
})
})
}
}
/**
* 拒绝售后
/** 拒绝售后 */
*/
const
disagree
=
()
=>
{
const
disagree
=
()
=>
{
updateAuditReasonFormRef
.
value
?.
open
(
formData
.
value
)
updateAuditReasonFormRef
.
value
?.
open
(
formData
.
value
)
}
}
/**
* 确认收货
/** 确认收货 */
*/
const
receive
=
()
=>
{
const
receive
=
()
=>
{
message
.
confirm
(
'是否确认收货?'
).
then
(()
=>
{
message
.
confirm
(
'是否确认收货?'
).
then
(()
=>
{
AfterSaleApi
.
receive
(
formData
.
value
.
id
)
AfterSaleApi
.
receive
(
formData
.
value
.
id
)
})
})
}
}
/**
* 拒绝收货
/** 拒绝收货 */
*/
const
refuse
=
()
=>
{
const
refuse
=
()
=>
{
message
.
confirm
(
'是否拒绝收货?'
).
then
(()
=>
{
message
.
confirm
(
'是否拒绝收货?'
).
then
(()
=>
{
AfterSaleApi
.
refuse
(
formData
.
value
.
id
)
AfterSaleApi
.
refuse
(
formData
.
value
.
id
)
})
})
}
}
/**
* 确认退款
/** 确认退款 */
*/
const
refund
=
()
=>
{
const
refund
=
()
=>
{
message
.
confirm
(
'是否确认退款?'
).
then
(()
=>
{
message
.
confirm
(
'是否确认退款?'
).
then
(()
=>
{
AfterSaleApi
.
refund
(
formData
.
value
.
id
)
AfterSaleApi
.
refund
(
formData
.
value
.
id
)
})
})
}
}
/** 图片预览 */
/** 图片预览 */
const
imagePreview
=
(
args
)
=>
{
const
imagePreview
=
(
args
)
=>
{
const
urlList
=
[]
const
urlList
=
[]
...
@@ -206,6 +203,7 @@ const imagePreview = (args) => {
...
@@ -206,6 +203,7 @@ const imagePreview = (args) => {
urlList
urlList
})
})
}
}
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
await
getDetail
()
await
getDetail
()
})
})
...
...
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