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
55d3de72
Commit
55d3de72
authored
May 20, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
791f22fb
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
115 additions
and
40 deletions
+115
-40
src/api/system/goods.js
+2
-0
src/api/system/shop.js
+9
-0
src/components/SelectMaterial/index.vue
+7
-9
src/components/SelectSpecs/index.vue
+10
-3
src/views/goods/category/index.vue
+4
-3
src/views/goods/goods/components/Form.vue
+35
-2
src/views/goods/goods/index.vue
+1
-1
src/views/goods/spec/index.vue
+8
-5
src/views/shop/shop/components/commodity.vue
+31
-15
src/views/shop/shop/setShop.vue
+8
-2
No files found.
src/api/system/goods.js
View file @
55d3de72
...
...
@@ -60,3 +60,5 @@ export function offShop(params) {
params
,
});
}
src/api/system/shop.js
View file @
55d3de72
...
...
@@ -112,3 +112,12 @@ export function removeRecommend(params) {
params
,
});
}
// 多选框下架
export
function
offGoods
(
data
)
{
return
request
({
url
:
"/system/shop/offGoods"
,
method
:
"post"
,
data
:
data
});
}
src/components/SelectMaterial/index.vue
View file @
55d3de72
<
template
>
<el-dialog
title=
"选择原料"
:visible
.
sync=
"open"
width=
"
5
00px"
append-to-body
>
<el-dialog
title=
"选择原料"
:visible
.
sync=
"open"
width=
"
7
00px"
append-to-body
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"原料名称"
prop=
"name"
>
<el-input
v-model=
"queryParams.name"
placeholder=
"请输入原料名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
...
...
@@ -15,7 +15,7 @@
<el-table-column
label=
"原料数量"
align=
"center"
prop=
"quantity"
>
<template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center;"
>
<el-input
v-model
.
number
=
"scope.row.quantity"
placeholder=
"请输入原料数量"
/>
<el-input
v-model=
"scope.row.quantity"
placeholder=
"请输入原料数量"
/>
<div
style=
"margin-left: 5px"
>
<span>
{{
scope
.
row
.
unit
}}
</span>
</div>
...
...
@@ -100,20 +100,18 @@ export default {
submitForm
()
{
let
subTag
=
true
;
this
.
ids
.
map
((
item
)
=>
{
if
(
!
item
.
quantity
){
if
(
item
.
quantity
===
""
||
item
.
quantity
==
undefined
){
let
name
=
item
.
name
;
this
.
$modal
.
msgSuccess
(
''
+
name
+
"原料名称的原料数量为空"
);
this
.
$message
.
error
(
''
+
name
+
"原料名称的原料数量不能为空!"
);
subTag
=
false
;
return
;
}
else
{
// const regular = /^[+]{0,1}(\d+)$/ //正数 (不包括小数)
const
regular
=
/^
[
+
]{0,1}(\d
+
)
$|^
[
+
]{0,1}(\d
+
\.\d
+
)
$/
//正数(包括小数)
const
regular
=
/^
[
+
]{0,1}([
1-9
]
+
)
$|^
[
+
]{0,1}(\d
+
\.\d
+
)
$/
//正数(包括小数)
if
(
!
regular
.
test
(
item
.
quantity
))
{
this
.
$modal
.
msgSuccess
(
''
+
item
.
name
+
"原料名称的原料数量不是大于0的数字!"
)
this
.
$message
.
error
(
''
+
item
.
name
+
"原料名称的原料数量不是大于0的数字!"
)
subTag
=
false
;
return
;
}
}
});
if
(
subTag
){
...
...
src/components/SelectSpecs/index.vue
View file @
55d3de72
...
...
@@ -3,7 +3,7 @@
<el-input
readonly=
"readonly"
v-model=
"specNames"
placeholder=
"请选择"
>
<el-button
@
click=
"selectSpecs"
slot=
"append"
icon=
"el-icon-search"
></el-button>
</el-input>
<el-dialog
title=
"请选择
分类"
:visible
.
sync=
"open"
width=
"5
00px"
append-to-body
>
<el-dialog
title=
"请选择
规格"
:visible
.
sync=
"open"
width=
"7
00px"
append-to-body
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"规格名称 "
prop=
"name"
>
<el-input
v-model=
"queryParams.name"
placeholder=
"规格名称 "
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
...
...
@@ -19,8 +19,15 @@
<el-checkbox
@
change=
"x => handleSelectionChange(x, scope.row)"
v-model=
"scope.row.selected"
></el-checkbox>
</
template
>
</el-table-column>
<el-table-column
label=
"规格名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"规格编码"
align=
"center"
prop=
"code"
/>
<el-table-column
label=
"选项"
align=
"center"
prop=
"specRules"
>
<
template
slot-scope=
"scope"
>
<el-tag
style=
"margin-right:10px;"
v-for=
"item in scope.row.specRules"
:key=
"item.id"
>
{{
item
.
name
}}
</el-tag>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
...
...
@@ -49,7 +56,7 @@ export default {
pageNum
:
1
,
pageSize
:
10
,
name
:
null
,
stat
us
:
0
,
stat
e
:
1
,
},
open
:
false
,
specNames
:
""
,
...
...
src/views/goods/category/index.vue
View file @
55d3de72
...
...
@@ -197,15 +197,16 @@ export default {
mess
=
"停用"
;
sta
=
"2"
;
}
row
.
state
=
sta
;
this
.
$modal
.
confirm
(
'是否确认'
+
mess
+
'该数据项?'
)
.
then
(
function
()
{
return
updateClass
(
row
);
return
updateClass
(
{
id
:
row
.
id
,
state
:
sta
}
);
})
.
then
(()
=>
{
.
then
((
response
)
=>
{
if
(
response
.
code
=
"200"
){
this
.
getList
();
this
.
$modal
.
msgSuccess
(
''
+
mess
+
'成功'
);
}
})
.
catch
(()
=>
{
});
},
...
...
src/views/goods/goods/components/Form.vue
View file @
55d3de72
...
...
@@ -160,6 +160,39 @@ export default {
callback
();
}
};
var
validateDiscount
=
(
rule
,
value
,
callback
)
=>
{
let
discountValue
=
this
.
form
.
discount
;
if
(
discountValue
==
undefined
||
discountValue
===
''
)
{
callback
(
new
Error
(
'不能为空'
));
}
else
if
(
!
Number
.
isInteger
(
discountValue
)){
callback
(
new
Error
(
'请输入数字值'
));
}
else
if
(
this
.
form
.
price
){
if
(
discountValue
>=
this
.
form
.
price
){
callback
(
new
Error
(
'折扣价不能大于等于原价'
));
}
else
{
callback
();
}
}
else
{
callback
();
}
};
var
validatePrice
=
(
rule
,
value
,
callback
)
=>
{
let
priceValue
=
this
.
form
.
price
;
if
(
priceValue
==
undefined
||
priceValue
===
''
)
{
callback
(
new
Error
(
'不能为空'
));
}
else
if
(
!
Number
.
isInteger
(
priceValue
)){
callback
(
new
Error
(
'请输入数字值'
));
}
else
if
(
this
.
form
.
discount
){
if
(
priceValue
<=
this
.
form
.
discount
){
callback
(
new
Error
(
'原价不能小于等于折扣价'
));
}
else
{
callback
();
}
}
else
{
callback
();
}
};
return
{
title
:
""
,
specNames
:
""
,
...
...
@@ -175,8 +208,8 @@ export default {
category
:
[{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
}],
spec
:
[{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
}],
takeTime
:
[{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
}],
discount
:
[{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
}],
price
:
[{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
}],
discount
:
[{
required
:
true
,
validator
:
validateDiscount
,
trigger
:
"blur"
}],
price
:
[{
required
:
true
,
validator
:
validatePrice
,
trigger
:
"blur"
}],
thumbnail
:[{
required
:
true
,
validator
:
validateThumbnail
,
trigger
:
'blur'
}],
introImages
:[{
required
:
true
,
validator
:
validateIntroImages
,
trigger
:
"blur"
}],
detailImages
:[{
required
:
true
,
validator
:
validateDetailImages
,
trigger
:
"blur"
}],
...
...
src/views/goods/goods/index.vue
View file @
55d3de72
...
...
@@ -47,7 +47,7 @@
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"商品分类"
align=
"center"
prop=
"category"
width=
"100"
/>
<el-table-column
label=
"商品分类"
align=
"center"
prop=
"category
Name
"
width=
"100"
/>
<el-table-column
label=
"简介"
align=
"center"
prop=
"desc"
width=
"150"
/>
<el-table-column
label=
"售价"
align=
"center"
prop=
"price"
/>
<el-table-column
label=
"总销量"
align=
"center"
prop=
"salesVolume"
width=
"150"
/>
...
...
src/views/goods/spec/index.vue
View file @
55d3de72
...
...
@@ -225,15 +225,18 @@ export default {
mess
=
"停用"
;
sta
=
"2"
;
}
row
.
state
=
sta
;
//let obj = JSON.parse(JSON.stringify(row));
//obj.state=sta;
this
.
$modal
.
confirm
(
'是否确认'
+
mess
+
'该数据项?'
)
.
then
(
function
()
{
return
updateSpecs
(
row
);
return
updateSpecs
(
{
id
:
row
.
id
,
state
:
sta
}
);
})
.
then
(()
=>
{
.
then
((
response
)
=>
{
if
(
response
.
code
=
"200"
){
this
.
getList
();
this
.
$modal
.
msgSuccess
(
''
+
mess
+
'成功'
);
}
})
.
catch
(()
=>
{
});
},
...
...
@@ -248,8 +251,8 @@ export default {
this
.
$modal
.
msgSuccess
(
'选项列表中的第'
+
index
+
'行名称不能为空'
);
return
;
}
if
(
specsSelectList
[
i
].
amount
==
""
){
this
.
$modal
.
msgSuccess
(
'选项列表中的第'
+
index
+
'行价格不能为空'
);
if
(
specsSelectList
[
i
].
amount
==
""
||
specsSelectList
[
i
].
amount
==
0
){
this
.
$modal
.
msgSuccess
(
'选项列表中的第'
+
index
+
'行价格不能为空
或0
'
);
return
;
}
if
(
!
specsSelectList
[
i
].
isRecommend
){
...
...
src/views/shop/shop/components/commodity.vue
View file @
55d3de72
...
...
@@ -18,7 +18,21 @@
</el-row>
<el-table
v-loading=
"loading"
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"商品名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"商品名称"
align=
"center"
prop=
"name"
width=
"200"
>
<template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center"
>
<div>
<span>
{{
scope
.
row
.
name
}}
</span>
</div>
<div
style=
"margin-left: 8px;margin-right: 8px"
>
<el-button
v-show=
"scope.row.recommend=='0'"
type=
"text"
>
荐
</el-button>
</div>
<div>
<el-button
style=
"color:red"
v-show=
"scope.row.preferential=='0'"
type=
"text"
>
惠
</el-button>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"编码"
align=
"center"
prop=
"code"
/>
<el-table-column
label=
"折扣价"
align=
"center"
prop=
"discount"
/>
<el-table-column
label=
"原价"
align=
"center"
prop=
"price"
/>
...
...
@@ -26,7 +40,6 @@
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
/>
<el-table-column
label=
"排序"
align=
"center"
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
@
click=
"addRecommend(scope.row)"
type=
"text"
>
...
...
@@ -42,11 +55,10 @@
</template>
<
script
>
import
{
getCategoryGoods
,
addGoods
}
from
"@/api/system/shop"
;
import
{
getCategoryGoods
,
addGoods
,
offGoods
}
from
"@/api/system/shop"
;
import
SelectGoods
from
'@/components/SelectGoods'
;
import
AddRecommend
from
'./addRecommend.vue'
import
Preferential
from
'./preferential.vue'
;
import
{
offShop
}
from
"@/api/system/goods"
;
export
default
{
props
:
[
'shopId'
],
...
...
@@ -90,8 +102,6 @@ export default {
this
.
list
=
data
[
0
].
goodsList
;
this
.
btnId
=
data
[
0
].
id
}
})
},
// 多选框选中数据
...
...
@@ -99,22 +109,28 @@ export default {
this
.
outIds
=
selection
.
map
((
item
)
=>
item
.
id
);
},
soldOutGoos
(){
// offGoods({"shopId":this.shopId,"goodsIds":this.outIds}).then(({ response }) => {
// console.log("response",response);
// })
this
.
$modal
.
confirm
(
'是否确认下架所选商品?'
)
.
then
(
function
()
{
console
.
log
(
"999"
);
offShop
({
goodsId
:
this
.
outIds
.
join
(
','
),
boo
:
true
}).
then
(
res
=>
{
console
.
log
(
"res"
,
res
);
// this.$modal.msgSuccess("下架成功");
})
return
offGoods
({
"shopId"
:
this
.
shopId
,
"goodsIds"
:
this
.
outIds
});
})
.
then
(()
=>
{
//this.getList();
this
.
$modal
.
msgSuccess
(
''
+
mess
+
'成功'
);
.
then
((
response
)
=>
{
// console.log("response",response);
// if(response.code=="200"){
// this.getList();
//this.$modal.msgSuccess('' + mess + '成功');
// }
})
.
catch
(()
=>
{
});
},
openSelectGoos
()
{
this
.
$refs
.
selectGoods
.
openModal
()
...
...
src/views/shop/shop/setShop.vue
View file @
55d3de72
...
...
@@ -6,10 +6,10 @@
<AddShop
:shopId=
"shopId"
@
setShopId=
"setShopId"
@
closeDialog=
"closeHandle"
/>
</el-tab-pane>
<el-tab-pane
:disabled=
"!shopId"
label=
"机器信息"
name=
"second"
>
<Machine
:shopId=
"shopId"
/>
<Machine
ref=
"Machine"
:shopId=
"shopId"
/>
</el-tab-pane>
<el-tab-pane
:disabled=
"!shopId"
label=
"商品信息"
name=
"third"
>
<Commodity
:shopId=
"shopId"
/>
<Commodity
ref=
"Commodity"
:shopId=
"shopId"
/>
</el-tab-pane>
<el-tab-pane
:disabled=
"!shopId"
label=
"点单屏推荐"
name=
"fourth"
>
<Recommend
ref=
"Recommend"
:shopId=
"shopId"
/>
...
...
@@ -39,6 +39,12 @@ export default {
},
watch
:
{
activeName
(
value
)
{
if
(
value
==
'second'
)
{
this
.
$refs
.
Machine
.
getList
()
}
if
(
value
==
'third'
)
{
this
.
$refs
.
Commodity
.
getList
()
}
if
(
value
==
'fourth'
)
{
this
.
$refs
.
Recommend
.
getList
()
}
...
...
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