Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
e3e42d99
提交
e3e42d99
编写于
8月 20, 2020
作者:
chendeli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
接口联调
上级
ad17dc8a
变更
3
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
486 行增加
和
214 行删除
+486
-214
index.js
src/utils/goods/index.js
+66
-0
create-good.vue
src/views/goods/create-good.vue
+351
-189
goods-manage.vue
src/views/goods/goods-manage.vue
+69
-25
未找到文件。
src/utils/goods/index.js
0 → 100644
浏览文件 @
e3e42d99
import
fetch
from
'../fetch'
;
import
{
getBaseUrl
}
from
'@/utils/index'
let
headers
=
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
token
:
localStorage
.
getItem
(
'storageToken'
),
};
export
const
getGoodsList
=
(
params
)
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`store/goods/query`
),
method
:
'post'
,
data
:
params
,
description
:
'商品列表查询'
,
})
};
//
export
const
batchOnOff
=
(
params
)
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`store/goods/onoff/sale`
),
method
:
'post'
,
data
:
params
,
description
:
'批量上下架'
,
})
};
export
const
updateGoods
=
(
params
)
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`store/goods/upsert`
),
method
:
'post'
,
data
:
params
,
description
:
'创建/更新商品'
,
})
};
///dosage/all
export
const
dosageAll
=
(
parm
)
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`store/dosage/all`
),
method
:
'get'
,
// params: params,
description
:
'剂型'
,
})
};
export
const
getDeparts
=
(
parm
)
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`api-ws/departments/category`
),
method
:
'get'
,
// params: params,
description
:
'科室'
,
})
};
//`basic-data/constants?typeCode=P128`
export
const
updateStock
=
(
parm
)
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`trade/order/admin/query/
${
orderId
}
`
),
method
:
'get'
,
// params: params,
description
:
'增加/减少库存'
,
})
};
src/views/goods/create-good.vue
浏览文件 @
e3e42d99
此差异已折叠。
点击以展开。
src/views/goods/goods-manage.vue
浏览文件 @
e3e42d99
...
@@ -7,22 +7,22 @@
...
@@ -7,22 +7,22 @@
<el-row
:gutter=
"30"
type=
"flex"
style=
"margin-top: 10px"
>
<el-row
:gutter=
"30"
type=
"flex"
style=
"margin-top: 10px"
>
<el-col
:span=
"18"
>
<el-col
:span=
"18"
>
<el-form-item
label=
"商品名称"
>
<el-form-item
label=
"商品名称"
>
<el-input
v-model=
"searchForm.
n
ame"
size=
"small"
placeholder=
"请输入商品名称"
></el-input>
<el-input
v-model=
"searchForm.
goodsN
ame"
size=
"small"
placeholder=
"请输入商品名称"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品ID"
>
<el-form-item
label=
"商品ID"
>
<el-input
v-model=
"searchForm.id"
size=
"small"
placeholder=
"请输入商品ID"
></el-input>
<el-input
v-model=
"searchForm.id"
size=
"small"
placeholder=
"请输入商品ID"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品类型"
>
<el-form-item
label=
"商品类型"
>
<el-select
<el-select
v-model=
"searchForm.
t
ype"
v-model=
"searchForm.
goodsT
ype"
placeholder=
"请选择商品类型"
placeholder=
"请选择商品类型"
size=
"small"
size=
"small"
clearable
>
clearable
>
<el-option
<el-option
v-for=
"(item,index) in
typeList
"
v-for=
"(item,index) in
goodsTypes
"
:key=
"index"
:key=
"index"
:label=
"item.
label
"
:label=
"item.
categoryName
"
:value=
"item.
value
"
:value=
"item.
id
"
></el-option>
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
</el-row>
</el-row>
<el-row
:gutter=
"30"
type=
"flex"
style=
"margin-top: 10px"
>
<el-row
:gutter=
"30"
type=
"flex"
style=
"margin-top: 10px"
>
<el-col
:span=
"18"
>
<el-col
:span=
"18"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"batchOpt(
1
)"
>
批量上架
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"batchOpt(
'on'
)"
>
批量上架
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"batchOpt(
2
)"
>
批量下架
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"batchOpt(
'off'
)"
>
批量下架
</el-button>
</el-col>
</el-col>
<el-col
:span=
"6"
style=
"text-align: right"
>
<el-col
:span=
"6"
style=
"text-align: right"
>
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
</el-row>
</el-row>
</el-form>
</el-form>
<el-table
:data=
"tableData"
class=
"item-table"
style=
"width: 100%;margin-top: 10px;"
@
selection-change=
"handleSelectionChange"
>
<el-table
ref=
"multipleTable"
:data=
"tableData"
class=
"item-table"
style=
"width: 100%;margin-top: 10px;"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
<el-table-column
type=
"selection"
type=
"selection"
fixed
fixed
...
@@ -53,23 +53,23 @@
...
@@ -53,23 +53,23 @@
</el-table-column>
</el-table-column>
<el-table-column
prop=
"id"
label=
"商品ID"
width=
"120"
align=
"center"
></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=
"name"
label=
"商品名称"
min-width=
"140"
align=
"center"
></el-table-column>
<el-table-column
prop=
"type"
label=
"商品类型"
min-
width=
"100"
align=
"center"
>
<el-table-column
prop=
"type"
label=
"商品类型"
width=
"100"
align=
"center"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
type
|
dynamicFlagStatus
}}
</span>
<span>
{{
scope
.
row
.
type
|
dynamicFlagStatus
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"status"
label=
"商品状态"
min-
width=
"100"
align=
"center"
>
<el-table-column
prop=
"status"
label=
"商品状态"
width=
"100"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
status
|
rangeStatus
}}
</span>
<span>
{{
scope
.
row
.
status
|
rangeStatus
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"num"
label=
"销量"
min-
width=
"120"
align=
"center"
>
<el-table-column
prop=
"num"
label=
"销量"
width=
"120"
align=
"center"
>
111
111
</el-table-column>
</el-table-column>
<el-table-column
prop=
"num"
label=
"规格"
min-
width=
"120"
align=
"center"
>
<el-table-column
prop=
"num"
label=
"规格"
width=
"120"
align=
"center"
>
111
111
</el-table-column>
</el-table-column>
<el-table-column
prop=
"num"
label=
"价格"
min-
width=
"120"
align=
"center"
>
<el-table-column
prop=
"num"
label=
"价格"
width=
"120"
align=
"center"
>
111
111
</el-table-column>
</el-table-column>
<el-table-column
prop=
"createdTime"
label=
"发布时间"
width=
"150"
align=
"center"
>
<el-table-column
prop=
"createdTime"
label=
"发布时间"
width=
"150"
align=
"center"
>
...
@@ -144,6 +144,7 @@
...
@@ -144,6 +144,7 @@
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
{
getRangeList
,
updateRangeStatus
}
from
"../../utils/yqrange/yqrangeApi"
;
import
{
getRangeList
,
updateRangeStatus
}
from
"../../utils/yqrange/yqrangeApi"
;
import
{
getGoodsList
,
batchOnOff
}
from
'@/utils/goods'
;
export
default
{
export
default
{
components
:
{
components
:
{
BreadCrumb
BreadCrumb
...
@@ -155,17 +156,27 @@
...
@@ -155,17 +156,27 @@
showNewFlag
:
false
,
showNewFlag
:
false
,
batchDialog
:
false
,
batchDialog
:
false
,
searchForm
:
{
searchForm
:
{
name
:
''
,
goodsIdList
:[],
id
:
''
,
goodsName
:
''
,
type
:
''
,
goodsType
:
0
,
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
},
selectList
:[],
batchParm
:{
batchUpdateSaleStatusReq
:
{
goodsIdList
:
[],
userId
:
0
},
onOff
:
""
},
},
fileList
:[],
fileList
:[],
totalRows
:
0
,
totalRows
:
0
,
tableData
:
[
tableData
:
[
{}
{}
],
],
goodsTypes
:[],
typeList
:
[{
typeList
:
[{
label
:
'药品'
,
label
:
'药品'
,
value
:
'1'
,
value
:
'1'
,
...
@@ -179,20 +190,49 @@
...
@@ -179,20 +190,49 @@
}
}
},
},
created
()
{
created
()
{
// this.initPrivilege();
this
.
getLists
()
// this.searchList();
this
.
getLever
()
},
},
methods
:
{
methods
:
{
handlePreview
(){},
handlePreview
(){},
handleRemove
(){},
handleRemove
(){},
beforeRemove
(){},
beforeRemove
(){},
handleSelectionChange
(){
handleSelectionChange
(
val
){
console
.
log
(
val
)
this
.
selectList
=
val
},
getLever
(
id
=
0
){
this
.
GET
(
"store/category/"
+
id
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
goodsTypes
=
res
.
data
});
},
getLists
(){
getGoodsList
(
this
.
searchForm
).
then
((
res
)
=>
{
})
},
},
//批量 上下架操作
//批量 上下架操作
batchOpt
(
type
){
batchOpt
(
type
){
if
(
type
==
3
){
//批量导入
if
(
type
==
3
){
//批量导入
this
.
batchDialog
=
true
this
.
batchDialog
=
true
}
else
{
if
(
this
.
selectList
.
length
==
0
){
return
this
.
$message
({
message
:
'请选择商品'
,
type
:
'warning'
});
}
this
.
batchParm
.
onOff
=
type
this
.
batchParm
.
batchUpdateSaleStatusReq
.
goodsIdList
=
[
1
]
||
this
.
selectList
batchOnOff
(
this
.
batchParm
).
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
){
this
.
selectList
=
[]
this
.
$refs
.
multipleTable
.
clearSelection
();
this
.
getLists
()
}
})
}
}
},
},
edit
(
row
){
edit
(
row
){
...
@@ -268,15 +308,19 @@
...
@@ -268,15 +308,19 @@
searchList
()
{
searchList
()
{
openLoading
(
this
);
openLoading
(
this
);
let
params
=
this
.
searchForm
;
let
params
=
this
.
searchForm
;
this
.
getLists
()
},
},
resetForm
()
{
resetForm
()
{
this
.
searchForm
=
{
this
.
searchForm
=
{
name
:
''
,
goodsIdList
:[],
id
:
''
,
goodsName
:
''
,
type
:
''
goodsType
:
''
,
pageNo
:
1
,
pageSize
:
10
,
};
};
this
.
searchList
();
this
.
getLists
();
},
},
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录