Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
web
soss
Commits
edb6be28
Commit
edb6be28
authored
May 22, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改店铺添加商品列表
parent
a5bb8c8c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
57 deletions
+56
-57
src/api/system/goods.js
+9
-0
src/components/SelectGoods/index.vue
+13
-11
src/views/shop/shop/components/commodity.vue
+34
-46
No files found.
src/api/system/goods.js
View file @
edb6be28
...
...
@@ -62,3 +62,12 @@ export function offShop(params) {
}
// 店铺添加商品查询列表
export
function
goodslist
(
query
)
{
return
request
({
url
:
"/system/shop/goodslist"
,
method
:
"get"
,
params
:
query
,
});
}
src/components/SelectGoods/index.vue
View file @
edb6be28
...
...
@@ -2,8 +2,8 @@
<el-dialog
title=
"选择商品"
:visible
.
sync=
"open"
width=
"1000px"
append-to-body
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"商品名称"
prop=
"
spu
Name"
>
<el-input
v-model=
"queryParams.
spu
Name"
placeholder=
"请输入商品名称"
clearable
<el-form-item
label=
"商品名称"
prop=
"
goods
Name"
>
<el-input
v-model=
"queryParams.
goods
Name"
placeholder=
"请输入商品名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"分类"
prop=
"category"
>
...
...
@@ -42,7 +42,7 @@
</template>
<
script
>
import
{
listSpu
}
from
"@/api/system/goods"
;
import
{
goodslist
}
from
"@/api/system/goods"
;
import
SelectCategory
from
'@/components/SelectCategory'
export
default
{
components
:
{
SelectCategory
},
...
...
@@ -64,9 +64,10 @@ export default {
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
spu
Name
:
null
,
goods
Name
:
null
,
category
:
null
,
state
:
3
,
shopId
:
null
},
};
},
...
...
@@ -85,9 +86,10 @@ export default {
return
list
;
},
/** 查询列表 */
getList
()
{
getList
(
shopId
)
{
this
.
loading
=
true
;
listSpu
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
queryParams
.
shopId
=
shopId
goodslist
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
spuList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
...
...
@@ -101,7 +103,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
queryParams
.
spu
Name
=
null
;
this
.
queryParams
.
goods
Name
=
null
;
this
.
queryParams
.
category
=
null
;
this
.
handleQuery
();
},
...
...
@@ -114,13 +116,13 @@ export default {
this
.
open
=
false
;
//this.reset();
},
openModal
()
{
openModal
(
shopId
)
{
this
.
open
=
true
;
this
.
getList
();
this
.
getList
(
shopId
);
},
submit
()
{
this
.
$emit
(
'callback'
,
this
.
ids
)
this
.
open
=
false
this
.
$emit
(
'callback'
,
this
.
ids
)
;
//
this.open = false
}
},
};
...
...
src/views/shop/shop/components/commodity.vue
View file @
edb6be28
...
...
@@ -46,13 +46,10 @@
<el-table-column
label=
"总销量"
align=
"center"
prop=
"salesVolume"
/>
<el-table-column
label=
"上架时间"
align=
"center"
prop=
"shelfat"
width=
"150"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"state"
width=
"150"
>
<!-- <template slot-scope="scope">
<span v-if="scope.row.state == 1">已创建</span>
<span v-if="scope.row.state == 2">已完成编程</span>
<span v-if="scope.row.state == 3">已上架</span>
<span v-if="scope.row.state == 4">已下架</span>
<span v-if="scope.row.state == 5">已删除</span>
</template> -->
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.state == 1"
>
售卖
</span>
<span
v-if=
"scope.row.state == 2"
>
告罄
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"排序"
align=
"center"
>
</el-table-column>
...
...
@@ -134,62 +131,53 @@ export default {
handleSelectionChange
(
selection
)
{
this
.
outIds
=
selection
.
map
((
item
)
=>
item
.
id
);
},
soldOutGoos
(){
this
.
$confirm
(
'是否确认下架所选商品?'
,
'提示'
,
{
soldOutGoos
(){
this
.
$confirm
(
'是否确认下架所选商品?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
offGoods
({
"shopId"
:
this
.
shopId
,
"goodsIds"
:
this
.
outIds
}).
then
(({
response
})
=>
{
if
(
response
.
code
==
"200"
){
offGoods
({
"shopId"
:
this
.
shopId
,
"goodsIds"
:
this
.
outIds
}).
then
(
res
=>
{
if
(
res
.
code
==
"200"
){
this
.
getList
();
this
.
$message
({
type
:
'success'
,
message
:
'
删除
成功!'
message
:
'
所选商品下架
成功!'
});
}
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消
删除
'
message
:
'已取消
下架所选商品!
'
});
});
// offGoods({"shopId":this.shopId,"goodsIds":this.outIds}).then(({ response }) => {
// console.log("response",response);
// })
// this.$modal
// .confirm('是否确认下架所选商品?')
// .then(function () {
// return offGoods({"shopId":this.shopId,"goodsIds":this.outIds});
// })
// .then((response) => {
// // console.log("response",response);
// // if(response.code=="200"){
// // this.getList();
// //this.$modal.msgSuccess('' + mess + '成功');
// // }
// })
// .catch(() => { });
});
},
openSelectGoos
()
{
this
.
$refs
.
selectGoods
.
openModal
()
this
.
$refs
.
selectGoods
.
openModal
(
this
.
shopId
)
},
selectGoos
(
ids
)
{
addGoods
({
shopId
:
this
.
shopId
,
goodsIds
:
ids
.
join
(
','
)
}).
then
(
res
=>
{
this
.
getList
()
})
this
.
$confirm
(
'是否确认添加所选商品?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
addGoods
({
"shopId"
:
this
.
shopId
,
"goodsIds"
:
ids
.
join
(
','
)}).
then
(
res
=>
{
if
(
res
.
code
==
"200"
){
this
.
$refs
.
selectGoods
.
open
=
false
;
this
.
getList
();
this
.
$message
({
type
:
'success'
,
message
:
'所选商品添加成功!'
});
}
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消所选的商品!'
});
});
}
}
}
...
...
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