Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
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
bp
op-web-service
Commits
1b729564
Commit
1b729564
authored
Jul 12, 2021
by
mengwenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:商品-下架按钮显示/商品价格复显
parent
e09d6425
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
57 deletions
+42
-57
index.vue
src/pages/Goods/Detail/index.vue
+38
-27
index.css
src/pages/Goods/List/index.css
+0
-26
index.vue
src/pages/Goods/List/index.vue
+4
-4
No files found.
src/pages/Goods/Detail/index.vue
View file @
1b729564
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
show-word-limit
show-word-limit
v-if=
"$route.params.operation === 'EDIT'"
v-if=
"$route.params.operation === 'EDIT'"
v-model=
"goodsObj.goods_name"
v-model=
"goodsObj.goods_name"
@
blur=
"
()=>
{this.checkSameName();}
"
@
blur=
"
checkSameName
"
></el-input>
></el-input>
<span
v-else
>
{{
goodsObj
.
goods_name
}}
</span>
<span
v-else
>
{{
goodsObj
.
goods_name
}}
</span>
</el-form-item>
</el-form-item>
...
@@ -402,6 +402,7 @@
...
@@ -402,6 +402,7 @@
<el-input-number
<el-input-number
v-if=
"$route.params.operation === 'EDIT'"
v-if=
"$route.params.operation === 'EDIT'"
:min=
"0"
:min=
"0"
:precision=
"0"
v-model=
"goodsObj.rule_limit"
v-model=
"goodsObj.rule_limit"
></el-input-number>
></el-input-number>
<span
v-else
>
{{ goodsObj.rule_limit }}
</span>
<span
v-else
>
{{ goodsObj.rule_limit }}
</span>
...
@@ -682,9 +683,10 @@ export default {
...
@@ -682,9 +683,10 @@ export default {
optionsValue
:
[],
// 商品分类的值
optionsValue
:
[],
// 商品分类的值
// 商品回显信息
// 商品回显信息
goodsObj
:
{
goodsObj
:
{
introduce
:
""
,
// 商品介绍
introduce
:
""
// 商品介绍
},
},
originalGoodsName
:
""
,
// 原商品名
isGoodsNameRepeat
:
false
,
// 商品名称是否重复
isGoodsNameRepeat
:
false
,
// 商品名称是否重复
descPicUrlList
:
[],
// 商品详情图回显列表
descPicUrlList
:
[],
// 商品详情图回显列表
...
@@ -757,7 +759,6 @@ export default {
...
@@ -757,7 +759,6 @@ export default {
const
res
=
await
getGoodsList
();
const
res
=
await
getGoodsList
();
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
this
.
optionList
=
res
.
result
;
this
.
optionList
=
res
.
result
;
console
.
log
(
res
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
error
);
console
.
error
(
error
);
}
}
...
@@ -774,6 +775,8 @@ export default {
...
@@ -774,6 +775,8 @@ export default {
const
{
goods_info
,
record_list
}
=
res
.
result
;
const
{
goods_info
,
record_list
}
=
res
.
result
;
this
.
goodsObj
=
goods_info
;
this
.
goodsObj
=
goods_info
;
this
.
recordLits
=
record_list
;
this
.
recordLits
=
record_list
;
// 初始商品名称
this
.
originalGoodsName
=
goods_info
.
goods_name
;
// 渲染过期时间
// 渲染过期时间
this
.
expirationTime
=
goods_info
.
expiration_time
;
this
.
expirationTime
=
goods_info
.
expiration_time
;
// 初始化门店id
// 初始化门店id
...
@@ -815,7 +818,6 @@ export default {
...
@@ -815,7 +818,6 @@ export default {
uploadPicture
(
response
,
storageList
)
{
uploadPicture
(
response
,
storageList
)
{
const
responseURL
=
`
${
response
.
result
.
bucket
}
/
${
response
.
result
.
object_id
}
`
;
const
responseURL
=
`
${
response
.
result
.
bucket
}
/
${
response
.
result
.
object_id
}
`
;
storageList
.
push
(
responseURL
);
storageList
.
push
(
responseURL
);
console
.
log
(
"已上传的列表"
,
storageList
);
},
},
// 删除图片的公共方法
// 删除图片的公共方法
deletePicture
(
file
,
fileList
,
storageList
)
{
deletePicture
(
file
,
fileList
,
storageList
)
{
...
@@ -824,7 +826,6 @@ export default {
...
@@ -824,7 +826,6 @@ export default {
storageList
.
splice
(
i
,
1
);
storageList
.
splice
(
i
,
1
);
}
}
}
}
console
.
log
(
storageList
);
},
},
// 格式化日期
// 格式化日期
...
@@ -862,7 +863,6 @@ export default {
...
@@ -862,7 +863,6 @@ export default {
page_size
:
5
page_size
:
5
};
};
const
res
=
await
getShopsList
(
query
);
const
res
=
await
getShopsList
(
query
);
console
.
log
(
res
);
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
this
.
shopsList
=
res
.
result
;
this
.
shopsList
=
res
.
result
;
this
.
shopsCount
=
res
.
count
;
this
.
shopsCount
=
res
.
count
;
...
@@ -876,7 +876,6 @@ export default {
...
@@ -876,7 +876,6 @@ export default {
});
});
this
.
shopIds
=
""
;
this
.
shopIds
=
""
;
this
.
shopIds
=
shopList
.
join
(
","
);
this
.
shopIds
=
shopList
.
join
(
","
);
console
.
log
(
this
.
shopIds
);
},
},
// 添加新门店
// 添加新门店
...
@@ -915,7 +914,6 @@ export default {
...
@@ -915,7 +914,6 @@ export default {
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
this
.
$message
.
success
(
"添加门店成功!"
);
this
.
$message
.
success
(
"添加门店成功!"
);
this
.
addShopShow
=
false
;
this
.
addShopShow
=
false
;
console
.
log
(
res
);
},
},
// 删除已选择门店
// 删除已选择门店
...
@@ -927,7 +925,6 @@ export default {
...
@@ -927,7 +925,6 @@ export default {
return
item
.
sub_shop_id
;
return
item
.
sub_shop_id
;
});
});
this
.
shopIds
=
shopIdsList
.
join
(
","
);
this
.
shopIds
=
shopIdsList
.
join
(
","
);
console
.
log
(
this
.
shopIds
);
},
},
// 商品列表换页
// 商品列表换页
...
@@ -948,12 +945,10 @@ export default {
...
@@ -948,12 +945,10 @@ export default {
// 商品分类列表变化
// 商品分类列表变化
optionsChange
(
value
)
{
optionsChange
(
value
)
{
this
.
optionsValue
=
value
;
this
.
optionsValue
=
value
;
console
.
log
(
"商品分类id"
,
this
.
optionsValue
);
},
},
// 检查商品名称是否重复
// 检查商品名称是否重复
async
checkSameName
()
{
async
checkSameName
()
{
console
.
log
(
1
);
const
res
=
await
checkGoodsName
({
const
res
=
await
checkGoodsName
({
life_account_id
:
this
.
goodsObj
.
life_account_id
,
life_account_id
:
this
.
goodsObj
.
life_account_id
,
goods_name
:
this
.
goodsObj
.
goods_name
,
goods_name
:
this
.
goodsObj
.
goods_name
,
...
@@ -963,9 +958,12 @@ export default {
...
@@ -963,9 +958,12 @@ export default {
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
if
(
res
.
result
.
can_use
)
{
if
(
res
.
result
.
can_use
)
{
this
.
isGoodsNameRepeat
=
true
;
this
.
isGoodsNameRepeat
=
true
;
}
else
if
(
this
.
originalGoodsName
===
this
.
goodsObj
.
goods_name
)
{
this
.
isGoodsNameRepeat
=
true
;
}
else
{
}
else
{
this
.
isGoodsNameRepeat
=
false
;
this
.
isGoodsNameRepeat
=
false
;
}
}
console
.
log
(
"商品名称是否可用"
,
this
.
isGoodsNameRepeat
);
},
},
// 商品详情图上传成功时
// 商品详情图上传成功时
...
@@ -1070,20 +1068,30 @@ export default {
...
@@ -1070,20 +1068,30 @@ export default {
// 更改售价
// 更改售价
salePrice
()
{
salePrice
()
{
const
parsePrice
=
parseFloat
(
this
.
goodsObj
.
price
).
toFixed
(
2
);
if
(
this
.
goodsObj
.
price
.
length
===
0
)
{
if
(
this
.
goodsObj
.
price
.
length
===
0
)
{
this
.
goodsObj
.
price
=
0
;
this
.
goodsObj
.
price
=
0
;
}
}
this
.
goodsObj
.
price
=
parseFloat
(
this
.
goodsObj
.
price
).
toFixed
(
2
);
if
(
typeof
parsePrice
!==
"number"
)
{
this
.
goodsObj
.
price
=
0
;
return
this
.
$message
.
error
(
"售价必为数字"
);
}
this
.
goodsObj
.
price
=
parsePrice
;
},
},
// 更改原价
// 更改原价
perPrice
()
{
perPrice
()
{
const
parseOriginalPrice
=
parseFloat
(
this
.
goodsObj
.
original_price
).
toFixed
(
2
);
if
(
this
.
goodsObj
.
original_price
.
length
===
0
)
{
if
(
this
.
goodsObj
.
original_price
.
length
===
0
)
{
this
.
goodsObj
.
original_price
=
0
;
this
.
goodsObj
.
original_price
=
0
;
}
}
this
.
goodsObj
.
original_price
=
parseFloat
(
if
(
typeof
parseOriginalPrice
!==
"number"
)
{
this
.
goodsObj
.
original_price
this
.
goodsObj
.
original_price
=
0
;
).
toFixed
(
2
);
return
this
.
$message
.
error
(
"原价必为数字"
);
}
this
.
goodsObj
.
original_price
=
parseOriginalPrice
;
},
},
// 审核通过
// 审核通过
...
@@ -1115,6 +1123,7 @@ export default {
...
@@ -1115,6 +1123,7 @@ export default {
// 保存修改信息
// 保存修改信息
async
saveDetailMessage
()
{
async
saveDetailMessage
()
{
await
this
.
checkSameName
();
// 检验商品名称是否可用
const
query
=
{
const
query
=
{
goods_spu_id
:
this
.
goodsObj
.
goods_spu_id
,
// 商品id
goods_spu_id
:
this
.
goodsObj
.
goods_spu_id
,
// 商品id
category_1_id
:
this
.
optionsValue
[
0
],
// 商品一级分类id
category_1_id
:
this
.
optionsValue
[
0
],
// 商品一级分类id
...
@@ -1140,28 +1149,31 @@ export default {
...
@@ -1140,28 +1149,31 @@ export default {
// 必填校验
// 必填校验
if
(
!
this
.
goodsObj
.
goods_spu_id
)
{
if
(
!
this
.
goodsObj
.
goods_spu_id
)
{
return
this
.
$message
.
error
(
"未传入商品id"
);
return
this
.
$message
.
error
(
"未传入商品id"
);
}
;
}
if
(
!
query
.
category_1_id
||
!
query
.
category_2_id
)
{
if
(
!
query
.
category_1_id
||
!
query
.
category_2_id
)
{
return
this
.
$message
.
error
(
"请选择商品分类"
);
return
this
.
$message
.
error
(
"请选择商品分类"
);
}
;
}
if
(
!
query
.
goods_name
)
{
if
(
!
query
.
goods_name
)
{
return
this
.
$message
.
error
(
"请填写商品名称"
);
return
this
.
$message
.
error
(
"请填写商品名称"
);
}
;
}
if
(
!
this
.
isGoodsNameRepeat
)
{
if
(
!
this
.
isGoodsNameRepeat
)
{
return
this
.
$message
.
error
(
"商品名称被占用,请重新更换商品名称"
);
return
this
.
$message
.
error
(
"商品名称被占用,请重新更换商品名称"
);
}
;
}
if
(
!
query
.
expiration_time
)
{
if
(
!
query
.
expiration_time
)
{
return
this
.
$message
.
error
(
"过期时间未填写,请填写后再提交"
);
return
this
.
$message
.
error
(
"过期时间未填写,请填写后再提交"
);
}
;
}
if
(
query
.
rule_limit
===
""
)
{
if
(
query
.
rule_limit
===
""
)
{
return
this
.
$message
.
error
(
"请填写单人可购买上限"
);
return
this
.
$message
.
error
(
"请填写单人可购买上限"
);
};
}
if
(
typeof
parseInt
(
query
.
rule_limit
)
!==
"number"
)
{
if
(
typeof
this
.
goodsObj
.
rule_limit
!==
"number"
)
{
return
this
.
$message
.
error
(
"单人可购买上限只能为数字格式"
);
}
if
(
typeof
query
.
rule_limit
!==
"number"
)
{
return
this
.
$message
.
error
(
"单人可购上线只可为数值"
);
return
this
.
$message
.
error
(
"单人可购上线只可为数值"
);
}
;
}
if
(
!
query
.
rule_desc
)
{
if
(
!
query
.
rule_desc
)
{
return
this
.
$message
.
error
(
"请填写使用规则描述"
);
return
this
.
$message
.
error
(
"请填写使用规则描述"
);
}
;
}
if
(
!
query
.
rule_refund
)
{
if
(
!
query
.
rule_refund
)
{
return
this
.
$message
.
error
(
"请填写退款规则"
);
return
this
.
$message
.
error
(
"请填写退款规则"
);
}
}
...
@@ -1174,11 +1186,10 @@ export default {
...
@@ -1174,11 +1186,10 @@ export default {
if
(
query
.
price
.
length
===
0
)
{
if
(
query
.
price
.
length
===
0
)
{
return
this
.
$message
.
error
(
"请填写售价(保留两位小数)"
);
return
this
.
$message
.
error
(
"请填写售价(保留两位小数)"
);
}
}
console
.
log
(
typeof
parseInt
(
query
.
original_price
));
if
(
typeof
query
.
original_price
!==
"number"
)
{
if
(
typeof
parseInt
(
query
.
original_price
)
!==
"number"
)
{
return
this
.
$message
.
error
(
"原价价格必须为数字"
);
return
this
.
$message
.
error
(
"原价价格必须为数字"
);
}
}
if
(
typeof
parseInt
(
query
.
price
)
!==
"number"
)
{
if
(
typeof
query
.
price
!==
"number"
)
{
return
this
.
$message
.
error
(
"售价价格必须为数字格式"
);
return
this
.
$message
.
error
(
"售价价格必须为数字格式"
);
}
}
...
...
src/pages/Goods/List/index.css
deleted
100644 → 0
View file @
e09d6425
.goods
{
width
:
100%
;
height
:
100%
;
padding
:
0
30px
;
}
.goods
.search_condition
{
display
:
flex
;
justify-content
:
space-between
;
flex-wrap
:
wrap
;
align-items
:
center
;
}
.goods
.search_condition
.search_button
{
display
:
flex
;
align-items
:
center
;
justify-self
:
flex-end
;
}
.goods
.search_condition
.search_button
.el-form-item__content
{
display
:
flex
;
justify-content
:
space-around
;
}
.goods
.commodity_list
{
margin-top
:
30px
;
}
.goods
.pagination
{
margin-top
:
30px
;
}
src/pages/Goods/List/index.vue
View file @
1b729564
...
@@ -135,15 +135,15 @@
...
@@ -135,15 +135,15 @@
>
审核驳回
</span>
>
审核驳回
</span>
<span
<span
v-if=
"scope.row.online_status == 0"
v-if=
"scope.row.online_status == 0
&& scope.row.audit_status != 2
"
style=
"color:#FF982C;"
style=
"color:#FF982C;"
>
未上架
</span>
>
未上架
</span>
<span
<span
v-if=
"scope.row.online_status == 1"
v-if=
"scope.row.online_status == 1
&& scope.row.audit_status != 2
"
style=
"color:#5CC247;"
style=
"color:#5CC247;"
>
已上架
</span>
>
已上架
</span>
<span
<span
v-if=
"scope.row.online_status == 2"
v-if=
"scope.row.online_status == 2
&& scope.row.audit_status != 2
"
style=
"color:#FD6B6F;"
style=
"color:#FD6B6F;"
>
已下架
</span>
>
已下架
</span>
</
template
>
</
template
>
...
@@ -189,7 +189,7 @@
...
@@ -189,7 +189,7 @@
</el-popconfirm>
</el-popconfirm>
<el-popconfirm
<el-popconfirm
v-if=
"
scope.row.audit_status == 1 || scope.row.online_status == 1
"
v-if=
"
scope.row.online_status != 2 && (scope.row.audit_status == 1 || scope.row.online_status == 1)
"
title=
"您确定要下架该商品吗?"
title=
"您确定要下架该商品吗?"
cancelButtonType=
"default"
cancelButtonType=
"default"
@
confirm=
"
@
confirm=
"
...
...
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