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
1972f16f
Commit
1972f16f
authored
Sep 24, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改店铺商品限制
parent
029a3a72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
21 deletions
+38
-21
src/api/system/shop.js
+7
-0
src/views/shop/shop/components/commodity.vue
+31
-21
No files found.
src/api/system/shop.js
View file @
1972f16f
...
...
@@ -167,3 +167,10 @@ export function testStart(shopId){
});
}
// 店铺是否绑定机器
export
function
checkMachine
(
id
)
{
return
request
({
url
:
"/system/machine/bind/check/"
+
id
,
method
:
"get"
,
});
}
src/views/shop/shop/components/commodity.vue
View file @
1972f16f
...
...
@@ -11,7 +11,7 @@
</el-button>
</el-col>
<el-col
:span=
"6"
>
<el-button
type=
"primary"
@
click=
"openSelectGoos"
plain
icon=
"el-icon-plus"
size=
"small"
>
添加商品
<el-button
type=
"primary"
@
click=
"openSelectGoos"
plain
icon=
"el-icon-plus"
size=
"small"
:disabled=
"showButton"
>
添加商品
</el-button>
<el-button
type=
"danger"
@
click=
"soldOutGoos"
plain
icon=
"el-icon-minus"
size=
"small"
>
下架商品
</el-button>
</el-col>
...
...
@@ -88,7 +88,7 @@
</template>
<
script
>
import
{
getCategoryGoods
,
addGoods
,
offGoods
,
turnList
}
from
"@/api/system/shop"
;
import
{
getCategoryGoods
,
addGoods
,
offGoods
,
turnList
,
checkMachine
}
from
"@/api/system/shop"
;
import
SelectGoods
from
'@/components/SelectGoods'
;
import
AddRecommend
from
'./addRecommend.vue'
import
Preferential
from
'./preferential.vue'
;
...
...
@@ -115,7 +115,8 @@ export default {
btnId
:
''
,
outIds
:
''
,
total
:
null
,
goodsList
:[]
goodsList
:[],
showButton
:
true
}
},
mounted
()
{
...
...
@@ -154,27 +155,36 @@ export default {
},
getList
()
{
if
(
!
this
.
shopId
)
return
;
this
.
list
=
[];
getCategoryGoods
(
this
.
shopId
).
then
(({
data
})
=>
{
if
(
data
&&
data
.
length
>
0
)
{
this
.
options
=
data
;
if
(
this
.
btnId
==
''
){
this
.
list
=
data
[
0
].
goodsList
;
this
.
btnId
=
data
[
0
].
id
;
}
else
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
if
(
this
.
btnId
==
data
[
i
].
id
){
this
.
list
=
data
[
i
].
goodsList
;
checkMachine
(
this
.
shopId
).
then
(({
data
})
=>
{
if
(
data
){
this
.
showButton
=
false
;
this
.
list
=
[];
getCategoryGoods
(
this
.
shopId
).
then
(({
data
})
=>
{
if
(
data
&&
data
.
length
>
0
)
{
this
.
options
=
data
;
if
(
this
.
btnId
==
''
){
this
.
list
=
data
[
0
].
goodsList
;
this
.
btnId
=
data
[
0
].
id
;
}
else
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
if
(
this
.
btnId
==
data
[
i
].
id
){
this
.
list
=
data
[
i
].
goodsList
;
}
}
}
this
.
goodsList
=
this
.
list
;
this
.
total
=
this
.
list
.
length
;
this
.
totalNum
=
this
.
list
.
length
;
}
else
{
this
.
options
=
[];
}
}
this
.
goodsList
=
this
.
list
;
this
.
total
=
this
.
list
.
length
;
this
.
totalNum
=
this
.
list
.
length
;
}
else
{
this
.
options
=
[];
})
}
else
{
this
.
$message
.
error
(
'请先绑定店铺机器!'
);
this
.
showButton
=
true
;
}
})
})
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
...
...
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