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
88349b33
Commit
88349b33
authored
Jul 09, 2021
by
mengwenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:商品详情-门店表单更改
parent
2d942d83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
161 additions
and
88 deletions
+161
-88
index.vue
src/pages/Goods/Detail/index.vue
+46
-22
index.vue
src/pages/Goods/List/index.vue
+18
-14
index.vue
src/pages/Goods/Retail/index.vue
+97
-52
No files found.
src/pages/Goods/Detail/index.vue
View file @
88349b33
...
@@ -63,7 +63,6 @@
...
@@ -63,7 +63,6 @@
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=
"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>
...
@@ -620,9 +619,9 @@ export default {
...
@@ -620,9 +619,9 @@ export default {
computed
:
{
computed
:
{
// 审核状态
// 审核状态
status
()
{
status
()
{
if
(
this
.
goodsObj
.
status
===
0
)
{
if
(
this
.
goodsObj
.
audit_
status
===
0
)
{
return
"待审核"
;
return
"待审核"
;
}
else
if
(
this
.
goodsObj
.
status
===
1
)
{
}
else
if
(
this
.
goodsObj
.
audit_
status
===
1
)
{
return
"审核通过"
;
return
"审核通过"
;
}
else
{
}
else
{
return
"审核驳回"
;
return
"审核驳回"
;
...
@@ -648,6 +647,11 @@ export default {
...
@@ -648,6 +647,11 @@ export default {
val
.
rule_start_time
,
val
.
rule_start_time
,
val
.
rule_end_time
val
.
rule_end_time
);
);
},
rejectVisible
(
val
)
{
if
(
!
val
)
{
this
.
rejectReason
.
reason
=
""
;
}
}
}
},
},
...
@@ -809,13 +813,11 @@ export default {
...
@@ -809,13 +813,11 @@ export default {
for
(
let
i
=
0
;
i
<
fileList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
fileList
.
length
;
i
++
)
{
if
(
fileList
[
i
].
uid
==
file
.
uid
)
{
if
(
fileList
[
i
].
uid
==
file
.
uid
)
{
storageList
.
splice
(
i
,
1
);
storageList
.
splice
(
i
,
1
);
}
;
}
}
;
}
console
.
log
(
storageList
);
console
.
log
(
storageList
);
},
},
// 格式化日期
// 格式化日期
formatDate
(
startTime
,
endTime
)
{
formatDate
(
startTime
,
endTime
)
{
const
nowTime
=
new
Date
();
const
nowTime
=
new
Date
();
...
@@ -881,6 +883,23 @@ export default {
...
@@ -881,6 +883,23 @@ export default {
latitude
,
// 纬度
latitude
,
// 纬度
address
:
this
.
shopForm
.
address
address
:
this
.
shopForm
.
address
};
};
if
(
!
query
.
shop_name
)
{
return
this
.
$message
.
error
(
"请填写门店名称"
);
};
if
(
!
query
.
address
)
{
return
this
.
$message
.
error
(
"请填写门店地址"
);
};
if
(
!
query
.
phone
)
{
return
this
.
$message
.
error
(
"请填写联系电话"
);
}
if
(
!
query
.
longitude
||
!
query
.
latitude
)
{
return
this
.
$message
.
error
(
"请填写地理定位"
);
};
if
(
!
/
([
0-9
]{3,4}
-
)?[
0-9
]{7,8}
/
.
test
(
query
.
phone
)
&&
!
/^
[
1
][
3,4,5,7,8,9
][
0-9
]{9}
$/
.
test
(
query
.
phone
))
{
return
this
.
$message
.
error
(
"联系电话格式不正确"
);
};
const
res
=
await
postAddShop
(
query
);
const
res
=
await
postAddShop
(
query
);
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
(
"添加门店成功!"
);
...
@@ -923,10 +942,9 @@ export default {
...
@@ -923,10 +942,9 @@ 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
;
this
.
$message
.
success
(
"名称未被占用,请继续填写表单"
);
}
else
{
}
else
{
this
.
isGoodsNameRepeat
=
false
;
this
.
isGoodsNameRepeat
=
false
;
return
this
.
$message
.
error
(
"
名称被占用,换个名称试试吧~~~
"
);
return
this
.
$message
.
error
(
"
商品名称被占用
"
);
}
}
},
},
...
@@ -942,7 +960,6 @@ export default {
...
@@ -942,7 +960,6 @@ export default {
introduceSuccess
(
res
)
{
introduceSuccess
(
res
)
{
this
.
uploadPicture
(
res
,
this
.
introduceUploadList
);
this
.
uploadPicture
(
res
,
this
.
introduceUploadList
);
},
},
// 商品介绍图删除后的钩子
// 商品介绍图删除后的钩子
intrRemove
(
file
,
fileList
)
{
intrRemove
(
file
,
fileList
)
{
this
.
deletePicture
(
file
,
fileList
,
this
.
introduceUploadList
);
this
.
deletePicture
(
file
,
fileList
,
this
.
introduceUploadList
);
...
@@ -1090,43 +1107,50 @@ export default {
...
@@ -1090,43 +1107,50 @@ export default {
};
};
console
.
log
(
query
);
console
.
log
(
query
);
this
.
checkSameName
();
// 必填校验
// 必填校验
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
(
!
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
(
"请填写退款规则"
);
}
}
;
if
(
!
query
.
inventory_add
)
{
if
(
!
query
.
inventory_add
)
{
return
this
.
$message
.
error
(
"请填写库存剩余量"
);
return
this
.
$message
.
error
(
"请填写库存剩余量"
);
}
}
;
if
(
!
query
.
original_price
)
{
if
(
!
query
.
original_price
)
{
return
this
.
$message
.
error
(
"请填写原价(保留两位小数)"
);
return
this
.
$message
.
error
(
"请填写原价(保留两位小数)"
);
}
};
if
(
typeof
query
.
original_price
!==
"number"
)
{
return
this
.
$message
.
error
(
"原价价格必须为数字"
);
};
if
(
typeof
query
.
price
!==
"number"
)
{
return
this
.
$message
.
error
(
"售价价格必须为数字格式"
);
};
if
(
!
query
.
price
)
{
if
(
!
query
.
price
)
{
return
this
.
$message
.
error
(
"请填写现价(保留两位小数)"
);
return
this
.
$message
.
error
(
"请填写现价(保留两位小数)"
);
}
}
;
if
(
!
query
.
sub_shop_ids
)
{
if
(
!
query
.
sub_shop_ids
)
{
return
this
.
$message
.
error
(
"请填写门店id"
);
return
this
.
$message
.
error
(
"请填写门店id"
);
}
}
;
const
res
=
await
editGoods
(
query
);
const
res
=
await
editGoods
(
query
);
if
(
res
.
code
!==
0
)
{
if
(
res
.
code
!==
0
)
{
...
...
src/pages/Goods/List/index.vue
View file @
88349b33
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<!-- 所属分类 -->
<!-- 所属分类 -->
<el-form-item
label=
"所属分类"
>
<el-form-item
label=
"所属分类"
>
<el-cascader
<el-cascader
v-model=
"searchProps.classValue"
@
change=
"handleTypeChange"
@
change=
"handleTypeChange"
:options=
"labelOptions"
:options=
"labelOptions"
:props=
"cascaderProps"
:props=
"cascaderProps"
...
@@ -32,8 +33,8 @@
...
@@ -32,8 +33,8 @@
<el-form-item
label=
"生活号名称"
>
<el-form-item
label=
"生活号名称"
>
<el-input
v-model=
"searchProps.life_account_name"
></el-input>
<el-input
v-model=
"searchProps.life_account_name"
></el-input>
</el-form-item>
</el-form-item>
<!--
商品
状态 -->
<!--
审核
状态 -->
<el-form-item
label=
"
商品
状态"
>
<el-form-item
label=
"
审核
状态"
>
<el-select
<el-select
v-model=
"audit_status"
v-model=
"audit_status"
multiple
multiple
...
@@ -166,7 +167,6 @@
...
@@ -166,7 +167,6 @@
>
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
<el-button
v-if=
"scope.row.audit_status == 2 || scope.row.online_status == 2 || scope.row.online_status == 1"
type=
"text"
type=
"text"
@
click=
"goDetail(`EDIT`, scope.row.goods_spu_id)"
@
click=
"goDetail(`EDIT`, scope.row.goods_spu_id)"
>
编辑
</el-button>
>
编辑
</el-button>
...
@@ -178,7 +178,7 @@
...
@@ -178,7 +178,7 @@
>
审核
</el-button>
>
审核
</el-button>
<el-popconfirm
<el-popconfirm
v-if=
"scope.row.
audit_status != 2 && scope.row.audit_status != 0 && (scope.row.online_status == 2 || scope.row.online_status == 0)
"
v-if=
"scope.row.
online_status == 2
"
title=
"您确定要上架该商品吗?"
title=
"您确定要上架该商品吗?"
cancelButtonType=
"default"
cancelButtonType=
"default"
@
confirm=
"changeGoodsState('GROUNDING', scope.row.goods_spu_id)"
@
confirm=
"changeGoodsState('GROUNDING', scope.row.goods_spu_id)"
...
@@ -189,7 +189,7 @@
...
@@ -189,7 +189,7 @@
</el-popconfirm>
</el-popconfirm>
<el-popconfirm
<el-popconfirm
v-if=
"scope.row.online_status == 1"
v-if=
"scope.row.
audit_status == 1 || scope.row.
online_status == 1"
title=
"您确定要下架该商品吗?"
title=
"您确定要下架该商品吗?"
cancelButtonType=
"default"
cancelButtonType=
"default"
@
confirm=
"
@
confirm=
"
...
@@ -262,14 +262,15 @@ export default {
...
@@ -262,14 +262,15 @@ export default {
category_2_id
:
""
,
// 二级分类id
category_2_id
:
""
,
// 二级分类id
life_account_id
:
""
,
life_account_id
:
""
,
life_account_name
:
""
,
life_account_name
:
""
,
audit_status
:
""
,
// 商品状态
audit_status
:
""
,
// 审核状态
online_status
:
""
// 上架状态
online_status
:
""
,
// 上架状态
classValue
:
""
},
},
// 级联选择器
// 级联选择器
labelOptions
:
[],
labelOptions
:
[],
//
商品
状态
//
审核
状态
stateOption
:
[
stateOption
:
[
{
value
:
0
,
label
:
"待审核"
},
{
value
:
0
,
label
:
"待审核"
},
{
value
:
1
,
label
:
"审核通过"
},
{
value
:
1
,
label
:
"审核通过"
},
...
@@ -333,7 +334,7 @@ export default {
...
@@ -333,7 +334,7 @@ export default {
this
.
searchProps
.
category_1_id
=
this
.
getVal
(
val
,
0
);
this
.
searchProps
.
category_1_id
=
this
.
getVal
(
val
,
0
);
this
.
searchProps
.
category_2_id
=
this
.
getVal
(
val
,
1
);
this
.
searchProps
.
category_2_id
=
this
.
getVal
(
val
,
1
);
},
},
//
商品
状态赋值
//
审核
状态赋值
handleStatusChange
(
val
)
{
handleStatusChange
(
val
)
{
this
.
searchProps
.
audit_status
=
this
.
getValue
(
val
);
this
.
searchProps
.
audit_status
=
this
.
getValue
(
val
);
},
},
...
@@ -348,7 +349,7 @@ export default {
...
@@ -348,7 +349,7 @@ export default {
},
},
// 重置表单
// 重置表单
resetList
()
{
resetList
()
{
(
this
.
searchProps
=
{
this
.
searchProps
=
{
page
:
1
,
// 页码
page
:
1
,
// 页码
page_size
:
20
,
// 页数大小
page_size
:
20
,
// 页数大小
goods_spu_id
:
""
,
// 后台商品id
goods_spu_id
:
""
,
// 后台商品id
...
@@ -357,10 +358,13 @@ export default {
...
@@ -357,10 +358,13 @@ export default {
category_2_id
:
""
,
// 二级分类id
category_2_id
:
""
,
// 二级分类id
life_account_id
:
""
,
life_account_id
:
""
,
life_account_name
:
""
,
life_account_name
:
""
,
audit_status
:
""
,
// 商品状态
audit_status
:
""
,
// 审核状态
online_status
:
""
// 上架状态
online_status
:
""
,
// 上架状态
}),
classValue
:
""
this
.
getCommodityList
();
};
this
.
audit_status
=
[];
this
.
onlineStatus
=
[];
this
.
getCommodityList
();
},
},
// 上架/下架操作
// 上架/下架操作
async
changeGoodsState
(
state
,
spuId
)
{
async
changeGoodsState
(
state
,
spuId
)
{
...
...
src/pages/Goods/Retail/index.vue
View file @
88349b33
<
template
>
<
template
>
<layout>
<layout>
<el-card
class=
"container"
style=
"width: 100%; height: 100%"
>
<el-card
class=
"container"
style=
"width: 100%; height: 100%"
>
<div
class=
"retail"
>
<div
class=
"retail"
>
<el-form
inline
:model=
"retailActivitie"
ref=
"retailActivitie"
>
<el-form
inline
:model=
"retailActivitie"
ref=
"retailActivitie"
>
<!-- 查询 -->
<!-- 查询 -->
<el-row>
<el-row>
<el-form-item
label=
"分销活动id"
prop=
"marketing_id"
>
<el-form-item
label=
"分销活动id"
prop=
"marketing_id"
>
<!-- :rules="[
{ type: 'number', message: '活动id必须为数字值' }]" -->
<!-- :rules="[
{ type: 'number', message: '活动id必须为数字值' }]" -->
<el-input
<el-input
onkeyup=
"value=value.replace(/[^\d]/g,'')"
onkeyup=
"value=value.replace(/[^\d]/g,'')"
...
@@ -34,7 +44,10 @@
...
@@ -34,7 +44,10 @@
</el-form-item>
</el-form-item>
<!-- 按钮操作 -->
<!-- 按钮操作 -->
<el-form-item
class=
"search_button"
>
<el-form-item
class=
"search_button"
>
<el-button
type=
"primary"
@
click=
"toSearch"
>
搜索
</el-button>
<el-button
type=
"primary"
@
click=
"toSearch"
>
搜索
</el-button>
<el-button
@
click=
"reset('retailActivitie')"
>
重置
</el-button>
<el-button
@
click=
"reset('retailActivitie')"
>
重置
</el-button>
</el-form-item>
</el-form-item>
</el-row>
</el-row>
...
@@ -42,10 +55,14 @@
...
@@ -42,10 +55,14 @@
type=
"primary"
type=
"primary"
style=
"margin-bottom: 10px"
style=
"margin-bottom: 10px"
@
click=
"createDtb"
@
click=
"createDtb"
>
创建分销活动
</el-button
>
创建分销活动
</el-button>
>
<!-- Tab -->
<!-- Tab -->
<el-table
:data=
"tableData"
type=
"index"
align=
"center"
border
>
<el-table
:data=
"tableData"
type=
"index"
align=
"center"
border
>
<el-table-column
<el-table-column
align=
"center"
align=
"center"
prop=
"marketing_id"
prop=
"marketing_id"
...
@@ -77,11 +94,13 @@
...
@@ -77,11 +94,13 @@
label=
"二级分销金额"
label=
"二级分销金额"
>
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
prop=
"online_status"
label=
"状态"
>
<el-table-column
align=
"center"
prop=
"online_status"
label=
"状态"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<span
<span
:style=
"
{ color: scope.row.online_status == 3 ? 'red' : '' }">
:style=
"
{ color: scope.row.online_status == 3 ? 'red' : '' }"
>
{{
{{
scope
.
row
.
online_status
==
2
scope
.
row
.
online_status
==
2
?
"关闭"
?
"关闭"
...
@@ -98,9 +117,17 @@
...
@@ -98,9 +117,17 @@
label=
"创建人"
label=
"创建人"
>
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
prop=
"create_time"
label=
"创建时间"
>
<el-table-column
align=
"center"
prop=
"create_time"
label=
"创建时间"
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
prop=
"update_time"
label=
"更新时间"
>
<el-table-column
align=
"center"
prop=
"update_time"
label=
"更新时间"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
align=
"center"
align=
"center"
...
@@ -108,14 +135,17 @@
...
@@ -108,14 +135,17 @@
label=
"分销到期时间"
label=
"分销到期时间"
>
>
</el-table-column>
</el-table-column>
<el-table-column
fixed=
"right"
align=
"center"
label=
"操作"
>
<el-table-column
fixed=
"right"
align=
"center"
label=
"操作"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
<el-button
@
click=
"handleClick(scope.row)"
@
click=
"handleClick(scope.row)"
type=
"text"
type=
"text"
size=
"mini"
size=
"mini"
>
查看
</el-button
>
查看
</el-button>
>
<el-button
<el-button
type=
"text"
type=
"text"
size=
"mini"
size=
"mini"
...
@@ -135,8 +165,7 @@
...
@@ -135,8 +165,7 @@
scope.row.online_status !== 3
scope.row.online_status !== 3
"
"
@
click
.
stop=
"handelEnable(scope.row, 1)"
@
click
.
stop=
"handelEnable(scope.row, 1)"
>
启用
</el-button
>
启用
</el-button>
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -183,7 +212,10 @@
...
@@ -183,7 +212,10 @@
:disabled=
"shopStart !== 0"
:disabled=
"shopStart !== 0"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"一级佣金:"
prop=
"first_commission_value"
>
<el-form-item
label=
"一级佣金:"
prop=
"first_commission_value"
>
<el-input
<el-input
v-model
.
number=
"ruleForm.first_commission_value"
v-model
.
number=
"ruleForm.first_commission_value"
:disabled=
"shopStart !== 0"
:disabled=
"shopStart !== 0"
...
@@ -191,7 +223,10 @@
...
@@ -191,7 +223,10 @@
<
template
#
append
>
%
</
template
>
<
template
#
append
>
%
</
template
>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"二级佣金: "
prop=
"second_commission_value"
>
<el-form-item
label=
"二级佣金: "
prop=
"second_commission_value"
>
<el-input
<el-input
v-model
.
number=
"ruleForm.second_commission_value"
v-model
.
number=
"ruleForm.second_commission_value"
:disabled=
"shopStart !== 0"
:disabled=
"shopStart !== 0"
...
@@ -222,7 +257,10 @@
...
@@ -222,7 +257,10 @@
ref=
"ruleIdForm"
ref=
"ruleIdForm"
size=
"mini"
size=
"mini"
>
>
<div
class=
"queryBox"
v-show=
"shopStart == 0"
>
<div
class=
"queryBox"
v-show=
"shopStart == 0"
>
<el-form-item
label=
"关联商品:"
>
</el-form-item>
<el-form-item
label=
"关联商品:"
>
</el-form-item>
<el-form-item
label=
"商品id:"
>
<el-form-item
label=
"商品id:"
>
<el-input
<el-input
...
@@ -241,8 +279,7 @@
...
@@ -241,8 +279,7 @@
size=
"mini"
size=
"mini"
style=
"margin-bottom: 30px"
style=
"margin-bottom: 30px"
@
click=
"findProducts"
@
click=
"findProducts"
>
查询
</el-button
>
查询
</el-button>
>
</div>
</div>
<div
:class=
"shopStart == 0 ? 'newTab' : 'readTab'"
>
<div
:class=
"shopStart == 0 ? 'newTab' : 'readTab'"
>
<el-table
<el-table
...
@@ -255,7 +292,10 @@
...
@@ -255,7 +292,10 @@
style=
"width: 100%"
style=
"width: 100%"
@
selection-change=
"selectGoodsChange"
@
selection-change=
"selectGoodsChange"
>
>
<el-table-column
align=
"center"
type=
"selection"
>
<el-table-column
align=
"center"
type=
"selection"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
align=
"center"
align=
"center"
...
@@ -289,7 +329,11 @@
...
@@ -289,7 +329,11 @@
</div>
</div>
<
template
#
footer
>
<
template
#
footer
>
<span
class=
"dialog-footer"
>
<span
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"cancel"
style=
"width: 150px"
>
{{
<el-button
type=
"primary"
@
click=
"cancel"
style=
"width: 150px"
>
{{
shopStart
==
0
?
"取消"
:
"返回"
shopStart
==
0
?
"取消"
:
"返回"
}}
</el-button>
}}
</el-button>
<el-button
<el-button
...
@@ -297,13 +341,13 @@
...
@@ -297,13 +341,13 @@
@
click=
"addList"
@
click=
"addList"
style=
"width: 150px"
style=
"width: 150px"
v-if=
"shopStart == 0"
v-if=
"shopStart == 0"
>
确 定
</el-button
>
确 定
</el-button>
>
</span>
</span>
</
template
>
</
template
>
</el-dialog>
</el-dialog>
</template>
</template>
<
script
>
<
script
>
import
Layout
from
"../layout/index.vue"
import
{
import
{
getMarketingList
,
getMarketingList
,
getFindGoodsList
,
getFindGoodsList
,
...
@@ -313,7 +357,7 @@ import {
...
@@ -313,7 +357,7 @@ import {
}
from
"@/service/Goods/goods"
;
}
from
"@/service/Goods/goods"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
ElMessage
}
from
"element-plus"
;
// 开启关闭防抖
// 开启关闭防抖
function
debounce
(
callback
,
delay
)
{
function
debounce
(
callback
,
delay
)
{
let
timer
=
null
;
let
timer
=
null
;
return
function
(...
args
)
{
return
function
(...
args
)
{
if
(
timer
)
{
if
(
timer
)
{
...
@@ -327,13 +371,16 @@ function debounce(callback, delay) {
...
@@ -327,13 +371,16 @@ function debounce(callback, delay) {
}
}
export
default
{
export
default
{
name
:
"GoodsRetail"
,
name
:
"GoodsRetail"
,
data
()
{
components
:
{
Layout
},
data
()
{
var
commission
=
(
rule
,
value
,
callback
)
=>
{
var
commission
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
ruleForm
.
first_commission_value
+
this
.
ruleForm
.
second_commission_value
>
50
||
value
>
50
)
{
if
(
this
.
ruleForm
.
first_commission_value
+
this
.
ruleForm
.
second_commission_value
>
50
||
value
>
50
)
{
callback
(
new
Error
(
"一级佣金与二级佣金之和不可大于50%"
));
callback
(
new
Error
(
"一级佣金与二级佣金之和不可大于50%"
));
}
else
{
}
else
{
callback
();
callback
();
}
}
};
};
return
{
return
{
tableData
:
[],
tableData
:
[],
...
@@ -409,7 +456,7 @@ export default {
...
@@ -409,7 +456,7 @@ export default {
},
},
methods
:
{
methods
:
{
// 查看详情列表
// 查看详情列表
async
handleClick
(
row
)
{
async
handleClick
(
row
)
{
this
.
dialogFormVisible
=
true
;
this
.
dialogFormVisible
=
true
;
this
.
shopStart
=
1
;
this
.
shopStart
=
1
;
this
.
disabled
=
true
;
this
.
disabled
=
true
;
...
@@ -425,13 +472,13 @@ export default {
...
@@ -425,13 +472,13 @@ export default {
}
}
},
},
// 页码变化
// 页码变化
handleCurrentChange
(
e
)
{
handleCurrentChange
(
e
)
{
this
.
retailActivitie
.
page
=
e
;
this
.
retailActivitie
.
page
=
e
;
this
.
getMarketingList
();
this
.
getMarketingList
();
},
},
// 营销活动列表
// 营销活动列表
async
getMarketingList
()
{
async
getMarketingList
()
{
try
{
try
{
const
res
=
await
getMarketingList
(
this
.
retailActivitie
);
const
res
=
await
getMarketingList
(
this
.
retailActivitie
);
this
.
tableData
=
res
.
result
;
this
.
tableData
=
res
.
result
;
...
@@ -459,12 +506,12 @@ export default {
...
@@ -459,12 +506,12 @@ export default {
}
}
},
300
),
},
300
),
// 创建分销活动
// 创建分销活动
createDtb
()
{
createDtb
()
{
this
.
dialogFormVisible
=
true
;
this
.
dialogFormVisible
=
true
;
this
.
shopStart
=
0
;
this
.
shopStart
=
0
;
},
},
// 重置
// 重置
reset
(
retailActivitie
)
{
reset
(
retailActivitie
)
{
(
this
.
retailActivitie
=
{
(
this
.
retailActivitie
=
{
marketing_id
:
""
,
marketing_id
:
""
,
marketing_name
:
""
,
marketing_name
:
""
,
...
@@ -477,11 +524,11 @@ export default {
...
@@ -477,11 +524,11 @@ export default {
this
.
getMarketingList
({});
this
.
getMarketingList
({});
},
},
// 搜索
// 搜索
toSearch
()
{
toSearch
()
{
this
.
getMarketingList
();
this
.
getMarketingList
();
console
.
log
(
this
.
retailActivitie
);
console
.
log
(
this
.
retailActivitie
);
},
},
selectTime
(
e
)
{
selectTime
(
e
)
{
let
date
=
new
Date
();
let
date
=
new
Date
();
if
(
e
&&
e
[
1
]
<
date
)
{
if
(
e
&&
e
[
1
]
<
date
)
{
ElMessage
(
`'活动结束时间不能早于当前时间'`
);
ElMessage
(
`'活动结束时间不能早于当前时间'`
);
...
@@ -489,9 +536,9 @@ export default {
...
@@ -489,9 +536,9 @@ export default {
}
}
},
},
// 获取时间格式
// 获取时间格式
formatTime
(
date
)
{
formatTime
(
date
)
{
// 封装函数判断是否要在目标前边加 ’0‘
// 封装函数判断是否要在目标前边加 ’0‘
function
getStr
(
target
)
{
function
getStr
(
target
)
{
return
(
""
+
target
).
length
===
1
?
"0"
+
target
:
target
;
return
(
""
+
target
).
length
===
1
?
"0"
+
target
:
target
;
}
}
// 获取月
// 获取月
...
@@ -512,7 +559,7 @@ export default {
...
@@ -512,7 +559,7 @@ export default {
return
timeStr
;
return
timeStr
;
},
},
// 查询商品列表
// 查询商品列表
async
findProducts
()
{
async
findProducts
()
{
// 获取参数
// 获取参数
const
{
goods_sku_id
,
life_account_id
}
=
this
.
ruleIdForm
;
const
{
goods_sku_id
,
life_account_id
}
=
this
.
ruleIdForm
;
let
[
start_time
,
end_time
]
=
this
.
timeSelect
;
let
[
start_time
,
end_time
]
=
this
.
timeSelect
;
...
@@ -541,10 +588,10 @@ export default {
...
@@ -541,10 +588,10 @@ export default {
ElMessage
.
error
(
"请求查询商品列表失败"
);
ElMessage
.
error
(
"请求查询商品列表失败"
);
}
}
},
},
selectGoodsChange
(
e
)
{
selectGoodsChange
(
e
)
{
this
.
ruleForm
.
goods_sku_id
=
e
.
map
((
item
)
=>
item
.
goods_sku_id
);
this
.
ruleForm
.
goods_sku_id
=
e
.
map
((
item
)
=>
item
.
goods_sku_id
);
},
},
async
getAllList
()
{
async
getAllList
()
{
let
all
=
await
getMarketingList
({
let
all
=
await
getMarketingList
({
page
:
1
,
page
:
1
,
page_size
:
this
.
retailActivitie
.
count
page_size
:
this
.
retailActivitie
.
count
...
@@ -552,7 +599,7 @@ export default {
...
@@ -552,7 +599,7 @@ export default {
this
.
allList
=
all
.
result
;
this
.
allList
=
all
.
result
;
},
},
// 添加活动列表
// 添加活动列表
async
addList
()
{
async
addList
()
{
this
.
$refs
.
ruleForm
.
validate
(
async
(
valid
)
=>
{
this
.
$refs
.
ruleForm
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
console
.
log
(
this
.
ruleForm
.
goods_sku_id
);
console
.
log
(
this
.
ruleForm
.
goods_sku_id
);
...
@@ -604,9 +651,9 @@ export default {
...
@@ -604,9 +651,9 @@ export default {
}
}
});
});
},
},
// 清空
// 清空
resetDate
()
{
resetDate
()
{
(
this
.
ruleForm
=
{
(
this
.
ruleForm
=
{
marketing_name
:
""
,
marketing_name
:
""
,
first_commission_value
:
""
,
first_commission_value
:
""
,
...
@@ -625,13 +672,13 @@ export default {
...
@@ -625,13 +672,13 @@ export default {
});
});
},
},
// 取消
// 取消
cancel
()
{
cancel
()
{
this
.
dialogFormVisible
=
false
;
this
.
dialogFormVisible
=
false
;
this
.
resetDate
();
this
.
resetDate
();
this
.
getMarketingList
();
this
.
getMarketingList
();
}
}
},
},
created
()
{
created
()
{
this
.
getMarketingList
();
this
.
getMarketingList
();
this
.
getAllList
();
this
.
getAllList
();
}
}
...
@@ -642,8 +689,6 @@ export default {
...
@@ -642,8 +689,6 @@ export default {
display: flex;
display: flex;
width: 100%;
width: 100%;
height: 100%;
height: 100%;
.retail {
}
.but_one {
.but_one {
margin-left: 10px;
margin-left: 10px;
}
}
...
...
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