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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
53 deletions
+52
-53
src/api/system/goods.js
+9
-0
src/components/SelectGoods/index.vue
+13
-11
src/views/shop/shop/components/commodity.vue
+30
-42
No files found.
src/api/system/goods.js
View file @
edb6be28
...
@@ -62,3 +62,12 @@ export function offShop(params) {
...
@@ -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 @@
...
@@ -2,8 +2,8 @@
<el-dialog
title=
"选择商品"
:visible
.
sync=
"open"
width=
"1000px"
append-to-body
>
<el-dialog
title=
"选择商品"
:visible
.
sync=
"open"
width=
"1000px"
append-to-body
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
label-width=
"68px"
>
<el-form-item
label=
"商品名称"
prop=
"
spu
Name"
>
<el-form-item
label=
"商品名称"
prop=
"
goods
Name"
>
<el-input
v-model=
"queryParams.
spu
Name"
placeholder=
"请输入商品名称"
clearable
<el-input
v-model=
"queryParams.
goods
Name"
placeholder=
"请输入商品名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"分类"
prop=
"category"
>
<el-form-item
label=
"分类"
prop=
"category"
>
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
listSpu
}
from
"@/api/system/goods"
;
import
{
goodslist
}
from
"@/api/system/goods"
;
import
SelectCategory
from
'@/components/SelectCategory'
import
SelectCategory
from
'@/components/SelectCategory'
export
default
{
export
default
{
components
:
{
SelectCategory
},
components
:
{
SelectCategory
},
...
@@ -64,9 +64,10 @@ export default {
...
@@ -64,9 +64,10 @@ export default {
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
,
spu
Name
:
null
,
goods
Name
:
null
,
category
:
null
,
category
:
null
,
state
:
3
,
state
:
3
,
shopId
:
null
},
},
};
};
},
},
...
@@ -85,9 +86,10 @@ export default {
...
@@ -85,9 +86,10 @@ export default {
return
list
;
return
list
;
},
},
/** 查询列表 */
/** 查询列表 */
getList
()
{
getList
(
shopId
)
{
this
.
loading
=
true
;
this
.
loading
=
true
;
listSpu
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
queryParams
.
shopId
=
shopId
goodslist
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
spuList
=
response
.
rows
;
this
.
spuList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
this
.
loading
=
false
;
...
@@ -101,7 +103,7 @@ export default {
...
@@ -101,7 +103,7 @@ export default {
},
},
/** 重置按钮操作 */
/** 重置按钮操作 */
resetQuery
()
{
resetQuery
()
{
this
.
queryParams
.
spu
Name
=
null
;
this
.
queryParams
.
goods
Name
=
null
;
this
.
queryParams
.
category
=
null
;
this
.
queryParams
.
category
=
null
;
this
.
handleQuery
();
this
.
handleQuery
();
},
},
...
@@ -114,13 +116,13 @@ export default {
...
@@ -114,13 +116,13 @@ export default {
this
.
open
=
false
;
this
.
open
=
false
;
//this.reset();
//this.reset();
},
},
openModal
()
{
openModal
(
shopId
)
{
this
.
open
=
true
;
this
.
open
=
true
;
this
.
getList
();
this
.
getList
(
shopId
);
},
},
submit
()
{
submit
()
{
this
.
$emit
(
'callback'
,
this
.
ids
)
this
.
$emit
(
'callback'
,
this
.
ids
)
;
this
.
open
=
false
//
this.open = false
}
}
},
},
};
};
...
...
src/views/shop/shop/components/commodity.vue
View file @
edb6be28
...
@@ -46,13 +46,10 @@
...
@@ -46,13 +46,10 @@
<el-table-column
label=
"总销量"
align=
"center"
prop=
"salesVolume"
/>
<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=
"shelfat"
width=
"150"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"state"
width=
"150"
>
<el-table-column
label=
"状态"
align=
"center"
prop=
"state"
width=
"150"
>
<!-- <template slot-scope="scope">
<
template
slot-scope=
"scope"
>
<span v-if="scope.row.state == 1">已创建</span>
<span
v-if=
"scope.row.state == 1"
>
售卖
</span>
<span v-if="scope.row.state == 2">已完成编程</span>
<span
v-if=
"scope.row.state == 2"
>
告罄
</span>
<span v-if="scope.row.state == 3">已上架</span>
</
template
>
<span v-if="scope.row.state == 4">已下架</span>
<span v-if="scope.row.state == 5">已删除</span>
</template> -->
</el-table-column>
</el-table-column>
<el-table-column
label=
"排序"
align=
"center"
>
<el-table-column
label=
"排序"
align=
"center"
>
</el-table-column>
</el-table-column>
...
@@ -135,61 +132,52 @@ export default {
...
@@ -135,61 +132,52 @@ export default {
this
.
outIds
=
selection
.
map
((
item
)
=>
item
.
id
);
this
.
outIds
=
selection
.
map
((
item
)
=>
item
.
id
);
},
},
soldOutGoos
(){
soldOutGoos
(){
this
.
$confirm
(
'是否确认下架所选商品?'
,
'提示'
,
{
this
.
$confirm
(
'是否确认下架所选商品?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
offGoods
({
"shopId"
:
this
.
shopId
,
"goodsIds"
:
this
.
outIds
}).
then
(({
response
})
=>
{
offGoods
({
"shopId"
:
this
.
shopId
,
"goodsIds"
:
this
.
outIds
}).
then
(
res
=>
{
if
(
response
.
code
==
"200"
){
if
(
res
.
code
==
"200"
){
this
.
getList
();
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'
删除
成功!'
message
:
'
所选商品下架
成功!'
});
});
}
}
})
})
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
$message
({
this
.
$message
({
type
:
'info'
,
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
()
{
openSelectGoos
()
{
this
.
$refs
.
selectGoods
.
openModal
()
this
.
$refs
.
selectGoods
.
openModal
(
this
.
shopId
)
},
},
selectGoos
(
ids
)
{
selectGoos
(
ids
)
{
addGoods
({
shopId
:
this
.
shopId
,
goodsIds
:
ids
.
join
(
','
)
}).
then
(
res
=>
{
this
.
$confirm
(
'是否确认添加所选商品?'
,
'提示'
,
{
this
.
getList
()
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