Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
0226dc4c
提交
0226dc4c
编写于
8月 20, 2020
作者:
chendeli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
接口调试
上级
e3e42d99
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
127 行增加
和
34 行删除
+127
-34
create-good.vue
src/views/goods/create-good.vue
+4
-1
goods-manage.vue
src/views/goods/goods-manage.vue
+123
-33
未找到文件。
src/views/goods/create-good.vue
浏览文件 @
0226dc4c
...
...
@@ -69,7 +69,7 @@
<i
class=
"el-icon-delete"
></i>
</div>
</div>
<img
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
<img
class=
"bg-img"
src=
"../../assets/image/small.png"
v-if=
"fileGoodsList.length
<10
"
/>
<div
class=
"limit-text"
>
<p>
限制大小: 200kb
</p>
<p>
建议尺寸:750*420
</p>
...
...
@@ -781,6 +781,9 @@
},
beforeUploadPic(file) {
if(this.fileGoodsList.length > 10){
return ;
}
let vm = this;
let picTypes = ['image/jpeg','image/png']
...
...
src/views/goods/goods-manage.vue
浏览文件 @
0226dc4c
...
...
@@ -51,39 +51,57 @@
fixed
width=
"55"
>
</el-table-column>
<el-table-column
prop=
"id"
label=
"商品ID"
width=
"120"
align=
"center"
></el-table-column>
<el-table-column
prop=
"name"
label=
"商品名称"
min-width=
"140"
align=
"center"
></el-table-column>
<el-table-column
prop=
"goodsId"
label=
"商品ID"
width=
"120"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"goodsName"
label=
"商品名称"
width=
"140"
align=
"center"
></el-table-column>
<el-table-column
prop=
"type"
label=
"商品类型"
width=
"100"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
type
|
dynamicFlagStatus
}}
</span>
<span>
{{
scope
.
row
.
goodsType
|
rangeType
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"商品状态"
width=
"100"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
s
tatus
|
rangeStatus
}}
</span>
<span>
{{
scope
.
row
.
goodsS
tatus
|
rangeStatus
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"num"
label=
"销量"
width=
"120"
align=
"center"
>
111
</el-table-column>
<el-table-column
prop=
"num"
label=
"规格"
width=
"120"
align=
"center"
>
111
<el-table-column
prop=
"quantityOfSale"
label=
"销量"
width=
"120"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"
num"
label=
"价格"
width=
"12
0"
align=
"center"
>
111
<el-table-column
prop=
"
size"
label=
"规格"
width=
"10
0"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"c
reatedTime"
label=
"发布时间"
width=
"15
0"
align=
"center"
>
<el-table-column
prop=
"c
ostPrice"
label=
"价格"
width=
"12
0"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createdTime
|
liveDateFilter
}}
</span>
<span>
{{
scope
.
row
.
costPrice
|
rangePrice
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
min-width=
"370"
align=
"center"
fixed=
"right"
>
<el-table-column
prop=
"createTime"
label=
"发布时间"
width=
"150"
align=
"center"
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"200"
align=
"center"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<div>
<div
v-if=
"scope.row.goodsStatus == 0"
>
<el-button
@
click=
"edit(scope.row)"
type=
"text"
size=
"small"
>
编辑
</el-button>
<el-button
@
click=
"shelfOpt(scope.row,2)"
type=
"text"
size=
"small"
>
上架销售
</el-button>
<!--
<el-button
@
click=
"shelfOpt(scope.row,3)"
type=
"text"
size=
"small"
>
删除
</el-button>
-->
</div>
<div
v-if=
"scope.row.goodsStatus == 1"
>
<el-button
@
click=
"shelfOpt(scope.row,1)"
type=
"text"
size=
"small"
>
下架
</el-button>
</div>
<div
v-if=
"scope.row.goodsStatus == 2"
>
<!--
<el-button
@
click=
"edit(scope.row)"
type=
"text"
size=
"small"
>
编辑
</el-button>
-->
<el-button
@
click=
"shelfOpt(scope.row,2)"
type=
"text"
size=
"small"
>
上架销售
</el-button>
<!--
<el-button
@
click=
"shelfOpt(scope.row,3)"
type=
"text"
size=
"small"
>
删除
</el-button>
-->
</div>
<div
v-if=
"scope.row.goodsStatus == 3"
>
<!--
<el-button
@
click=
"edit(scope.row)"
type=
"text"
size=
"small"
>
编辑
</el-button>
<el-button
@
click=
"shelfOpt(scope.row,1)"
type=
"text"
size=
"small"
>
下架
</el-button>
<el-button
@
click=
"shelfOpt(scope.row,2)"
type=
"text"
size=
"small"
>
上架销售
</el-button>
<el-button
@
click=
"shelfOpt(scope.row,3)"
type=
"text"
size=
"small"
>
删除
</el-button>
<el-button
@
click=
"shelfOpt(scope.row,3)"
type=
"text"
size=
"small"
>
删除
</el-button>
-->
</div>
</
template
>
</el-table-column>
...
...
@@ -145,6 +163,22 @@
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
{
getRangeList
,
updateRangeStatus
}
from
"../../utils/yqrange/yqrangeApi"
;
import
{
getGoodsList
,
batchOnOff
}
from
'@/utils/goods'
;
var
typeList
=
[{
categoryName
:
"短信额度"
,
id
:
1
,
},
{
categoryName
:
"学习卡"
,
id
:
2
,
},
{
categoryName
:
"职称考卡"
,
id
:
3
,
},{
categoryName
:
"医疗器械"
,
id
:
4
,
},{
categoryName
:
"药品"
,
id
:
5
,
}]
export
default
{
components
:
{
BreadCrumb
...
...
@@ -158,7 +192,7 @@
searchForm
:
{
goodsIdList
:[],
goodsName
:
''
,
goodsType
:
0
,
goodsType
:
''
,
pageNo
:
1
,
pageSize
:
10
,
...
...
@@ -173,26 +207,45 @@
},
fileList
:[],
totalRows
:
0
,
tableData
:
[
{}
],
tableData
:
[],
goodsTypes
:[],
typeList
:
[{
label
:
'药品'
,
value
:
'1'
,
},
{
label
:
'药品器械'
,
value
:
'2'
,
},
{
label
:
'其他'
,
value
:
'3'
,
}]
typeList
:
[]
}
},
created
()
{
this
.
getLists
()
this
.
getLever
()
},
filters
:{
rangeType
(
type
){
let
name
=
''
for
(
let
i
=
0
;
i
<
typeList
.
length
;
i
++
){
if
(
type
==
typeList
[
i
].
id
){
name
=
typeList
[
i
].
categoryName
;
break
;
}
}
return
name
},
rangeStatus
(
status
){
let
str
=
''
//0待上架,1已上架,2已下架,3定时上架
if
(
status
==
1
){
str
=
'已上架'
}
else
if
(
status
==
0
){
str
=
'待上架'
}
else
if
(
status
==
2
){
str
=
'已下架'
}
else
if
(
status
==
3
){
str
=
'定时上架'
}
return
str
},
rangePrice
(
price
){
let
str
=
'¥'
str
+=
price
/
100
return
str
}
},
methods
:
{
handlePreview
(){},
handleRemove
(){},
...
...
@@ -209,10 +262,34 @@
});
},
getLists
(){
openLoading
(
this
);
getGoodsList
(
this
.
searchForm
).
then
((
res
)
=>
{
if
(
res
.
code
!=
'000000'
){
return
this
.
$message
({
message
:
res
.
message
,
type
:
'error'
});
}
closeLoading
(
this
);
if
(
res
.
data
==
null
){
return
this
.
$message
({
message
:
'分页数据加载失败'
,
type
:
'error'
});
}
this
.
tableData
=
res
.
data
.
goodsList
this
.
totalRows
=
res
.
data
.
totalCount
})
},
//获取商品id
getIdsByArr
(
d
){
let
a
=
[]
for
(
let
i
=
0
;
i
<
d
.
length
;
i
++
){
a
.
push
(
d
[
i
].
goodsId
)
}
return
a
;
},
//批量 上下架操作
batchOpt
(
type
){
if
(
type
==
3
){
//批量导入
...
...
@@ -225,7 +302,7 @@
});
}
this
.
batchParm
.
onOff
=
type
this
.
batchParm
.
batchUpdateSaleStatusReq
.
goodsIdList
=
[
1
]
||
this
.
selectList
this
.
batchParm
.
batchUpdateSaleStatusReq
.
goodsIdList
=
this
.
getIdsByArr
(
this
.
selectList
)
batchOnOff
(
this
.
batchParm
).
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
){
this
.
selectList
=
[]
...
...
@@ -255,9 +332,11 @@
if
(
type
==
1
){
str
=
`确定下架商品吗?<br/>下架后将不再出售`
btn1
=
'下架'
}
else
if
(
type
==
2
){
str
=
`确定上架商品吗?<br/>上架后将开始出售`
btn1
=
'上架'
}
else
if
(
type
==
3
){
str
=
`确定删除商品吗?<br/>删除后商品信息将都不保留`
btn1
=
'删除'
...
...
@@ -271,6 +350,17 @@
}).
then
(()
=>
{
// confirm
// this.updateStatus(row.id, "30");
if
(
type
!=
3
){
this
.
batchParm
.
onOff
=
type
==
1
?
'off'
:
'on'
this
.
batchParm
.
batchUpdateSaleStatusReq
.
goodsIdList
=
[
row
.
goodsId
]
batchOnOff
(
this
.
batchParm
).
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
){
this
.
getLists
()
}
})
}
}).
catch
(()
=>
{
// cancel
// this.$message.error("上线失败");
...
...
@@ -331,7 +421,7 @@
},
handleNumChange
(
val
)
{
this
.
searchForm
.
pageNo
=
val
;
this
.
searchList
();
this
.
getLists
();
},
},
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录