Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-outbound
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bc284cd2
authored
Sep 26, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交红包需求
1 parent
70fabf14
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1291 additions
and
90 deletions
package-lock.json
src/api/modules/redenvelope.js
src/assets/css/public.scss
src/common/constant.js
src/views/redEnvelope/components/RedEnvelopeConfig/edit.vue
src/views/redEnvelope/components/RedEnvelopeConfig/index.vue
src/views/redEnvelope/components/RedEnvelopeConfig/linkDetail.vue
src/views/redEnvelope/components/RedEnvelopeRecord/importRecord.vue
src/views/redEnvelope/components/RedEnvelopeRecord/index.vue
src/views/redEnvelope/components/common/fun.js
src/views/redEnvelope/index.vue
package-lock.json
View file @
bc284cd
...
@@ -1837,7 +1837,6 @@
...
@@ -1837,7 +1837,6 @@
"thread-loader"
:
"^2.1.3"
,
"thread-loader"
:
"^2.1.3"
,
"url-loader"
:
"^2.2.0"
,
"url-loader"
:
"^2.2.0"
,
"vue-loader"
:
"^15.9.2"
,
"vue-loader"
:
"^15.9.2"
,
"vue-loader-v16"
:
"npm:vue-loader@^16.1.0"
,
"vue-style-loader"
:
"^4.1.2"
,
"vue-style-loader"
:
"^4.1.2"
,
"webpack"
:
"^4.0.0"
,
"webpack"
:
"^4.0.0"
,
"webpack-bundle-analyzer"
:
"^3.8.0"
,
"webpack-bundle-analyzer"
:
"^3.8.0"
,
...
@@ -12674,75 +12673,6 @@
...
@@ -12674,75 +12673,6 @@
}
}
}
}
},
},
"vue-loader-v16"
:
{
"version"
:
"npm:vue-loader@16.8.3"
,
"resolved"
:
"https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz"
,
"integrity"
:
"sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"chalk"
:
"^4.1.0"
,
"hash-sum"
:
"^2.0.0"
,
"loader-utils"
:
"^2.0.0"
},
"dependencies"
:
{
"ansi-styles"
:
{
"version"
:
"4.3.0"
,
"resolved"
:
"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
,
"integrity"
:
"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-convert"
:
"^2.0.1"
}
},
"chalk"
:
{
"version"
:
"4.1.2"
,
"resolved"
:
"https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
,
"integrity"
:
"sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"ansi-styles"
:
"^4.1.0"
,
"supports-color"
:
"^7.1.0"
}
},
"color-convert"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
,
"integrity"
:
"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-name"
:
"~1.1.4"
}
},
"color-name"
:
{
"version"
:
"1.1.4"
,
"resolved"
:
"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
,
"integrity"
:
"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
,
"dev"
:
true
,
"optional"
:
true
},
"has-flag"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz"
,
"integrity"
:
"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
,
"dev"
:
true
,
"optional"
:
true
},
"supports-color"
:
{
"version"
:
"7.2.0"
,
"resolved"
:
"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz"
,
"integrity"
:
"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"has-flag"
:
"^4.0.0"
}
}
}
},
"vue-router"
:
{
"vue-router"
:
{
"version"
:
"3.5.4"
,
"version"
:
"3.5.4"
,
"resolved"
:
"https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz"
,
"resolved"
:
"https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz"
,
...
...
src/api/modules/redenvelope.js
0 → 100644
View file @
bc284cd
import
{
http
}
from
'@/main'
const
url
=
'/rop-scrm-marketing/router'
export
default
{
/**获取红包配置列表 */
getRedEnvelopeConfigList
(
params
)
{
params
.
method
=
'marketing.api.activityRedEnvelope.page'
return
http
({
url
,
data
:
params
})
},
/**获取红包活动列表 */
getRedEnvelopeActivityList
(
params
)
{
params
.
method
=
'marketing.api.activityRedEnvelope.merchant.list'
return
http
({
url
,
data
:
params
})
},
/**获取所属渠道列表 */
getRedEnvelopeMerchantList
(
params
)
{
params
.
method
=
'scrm.api.carlife.merchant.listWithPageByCurMerchant'
params
.
pageSize
=
999999
params
.
currentPage
=
1
return
http
({
url
:
'/rop-scrm-carlife/router'
,
data
:
params
})
},
/**查询红包活动详情 */
getRedEnvelopeActivityDetail
(
params
)
{
params
.
method
=
'marketing.api.activityRedEnvelope.findOne'
return
http
({
url
,
data
:
params
})
},
/** 新建红包活动接口 */
createActivityRedEnvelope
(
params
)
{
params
.
method
=
'marketing.api.activityRedEnvelope.create'
return
http
({
url
,
data
:
params
})
},
/** 更新红包活动 */
updateActivityRedEnvelope
(
params
)
{
params
.
method
=
'marketing.api.activityRedEnvelope.update'
return
http
({
url
,
data
:
params
})
},
}
\ No newline at end of file
\ No newline at end of file
src/assets/css/public.scss
View file @
bc284cd
...
@@ -7,6 +7,9 @@ html {
...
@@ -7,6 +7,9 @@ html {
overflow
:
hidden
;
overflow
:
hidden
;
background-color
:
#f4f5fa
;
background-color
:
#f4f5fa
;
}
}
.el-message
{
z-index
:
3000
!
important
;
}
.el-form-item__content
{
.el-form-item__content
{
width
:
284px
;
width
:
284px
;
.el-input__inner
{
.el-input__inner
{
...
...
src/common/constant.js
View file @
bc284cd
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
function
limitPrice
(
newValue
,
oldValue
,
intergerDigit
,
pointDigit
,
minValue
,
maxValue
,
regRule
)
{
function
limitPrice
(
newValue
,
oldValue
,
intergerDigit
,
pointDigit
,
minValue
,
maxValue
,
regRule
)
{
/* eslint-disable */
/* eslint-disable */
var
reg
=
{
var
reg
=
{
priceReg
:
/^
\d[\d\.]
*$/
,
priceReg
:
/^
\d[\d\.]
*$/
,
...
@@ -74,16 +74,16 @@ const statusList = [
...
@@ -74,16 +74,16 @@ const statusList = [
confId
:
2
,
confId
:
2
,
confName
:
'已失效'
confName
:
'已失效'
}
}
]
]
//会员订单类型字典
//会员订单类型字典
const
orderTypesList
=
[{
const
orderTypesList
=
[{
confId
:
1
,
confId
:
1
,
confName
:
'套餐'
confName
:
'套餐'
},
},
{
{
confId
:
2
,
confId
:
2
,
confName
:
'会员卡'
confName
:
'会员卡'
}
}
]
]
const
orderStatusList
=
[
const
orderStatusList
=
[
// 2: '待收货',
// 2: '待收货',
...
@@ -115,40 +115,75 @@ const orderStatusList = [
...
@@ -115,40 +115,75 @@ const orderStatusList = [
const
serviceStatusList
=
[{
const
serviceStatusList
=
[{
confId
:
1
,
confId
:
1
,
confName
:
'未生效'
confName
:
'未生效'
},
},
{
{
confId
:
2
,
confId
:
2
,
confName
:
'生效中'
confName
:
'生效中'
},
},
{
{
confId
:
3
,
confId
:
3
,
confName
:
'已失效'
confName
:
'已失效'
}
}
]
]
const
memberTypeList
=
[{
const
memberTypeList
=
[{
confId
:
1
,
confId
:
1
,
confName
:
'正式会员'
confName
:
'正式会员'
},
},
{
{
confId
:
2
,
confId
:
2
,
confName
:
'试用会员'
confName
:
'试用会员'
}
}
]
]
const
stateList
=
[{
const
stateList
=
[{
confId
:
0
,
confId
:
0
,
confName
:
'待上架'
confName
:
'待上架'
},
},
{
{
confId
:
1
,
confId
:
1
,
confName
:
'在售中'
confName
:
'在售中'
},
},
{
{
confId
:
2
,
confId
:
2
,
confName
:
'已下架'
confName
:
'已下架'
},
},
]
]
function
getExplorer
()
{
var
ua
=
navigator
.
userAgent
.
toLocaleLowerCase
()
var
browserType
=
null
if
(
ua
.
match
(
/msie/
)
!=
null
||
ua
.
match
(
/trident/
)
!=
null
)
{
browserType
=
'IE'
}
else
if
(
ua
.
match
(
/firefox/
)
!=
null
)
{
browserType
=
'火狐'
}
else
if
(
ua
.
match
(
/ubrowser/
)
!=
null
)
{
browserType
=
'UC'
}
else
if
(
ua
.
match
(
/opera/
)
!=
null
)
{
browserType
=
'欧朋'
}
else
if
(
ua
.
match
(
/bidubrowser/
)
!=
null
)
{
browserType
=
'百度'
}
else
if
(
ua
.
match
(
/metasr/
)
!=
null
)
{
browserType
=
'搜狗'
}
else
if
(
ua
.
match
(
/tencenttraveler/
)
!=
null
||
ua
.
match
(
/qqbrowse/
)
!=
null
)
{
browserType
=
'QQ'
}
else
if
(
ua
.
match
(
/maxthon/
)
!=
null
)
{
browserType
=
'遨游'
}
else
{
browserType
=
'谷歌'
}
return
browserType
}
function
exportFn
(
url
)
{
let
browserType
=
getExplorer
()
if
(
browserType
==
'QQ'
)
{
window
.
open
(
url
)
return
}
let
iframe
=
document
.
createElement
(
'iframe'
)
iframe
.
style
.
display
=
'none'
iframe
.
src
=
url
document
.
body
.
appendChild
(
iframe
)
}
export
{
export
{
limitPrice
,
limitPrice
,
orderManageStatusList
,
orderManageStatusList
,
...
@@ -159,5 +194,7 @@ export {
...
@@ -159,5 +194,7 @@ export {
memberTypeList
,
memberTypeList
,
stateList
,
stateList
,
orderTypesList
,
orderTypesList
,
orderStatusList
orderStatusList
,
exportFn
,
getExplorer
}
}
\ No newline at end of file
\ No newline at end of file
src/views/redEnvelope/components/RedEnvelopeConfig/edit.vue
0 → 100644
View file @
bc284cd
<
template
>
<GLDialog
mode=
"mid"
class=
"muti"
:title=
"editObj.title"
:before-close=
"handleClose"
@
onOk=
"handleConfirm"
@
onCancel=
"handleClose"
:visible
.
sync=
"editObj.show"
append-to-body
>
<el-form
ref=
"configRef"
label-width=
"154px"
:rules=
"configRules"
:model=
"configForm"
>
<el-form-item
label=
"活动名称:"
prop=
"activityName"
class=
"m-t-20"
>
<el-input
:style=
"formItemWidth"
:size=
"size"
v-model=
"configForm.activityName"
placeholder=
"请输入"
maxlength=
"50"
:disabled=
"disabled"
></el-input>
</el-form-item>
<el-form-item
label=
"所属渠道:"
prop=
"merchantId"
class=
"m-t-20"
>
<el-select
:size=
"size"
:style=
"formItemWidth"
v-model=
"configForm.merchantId"
placeholder=
"请选择"
:disabled=
"disabled"
>
<el-option
v-for=
"item in merchantList"
:key=
"item.confId"
:label=
"item.confName"
:value=
"item.confId"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"活动时间:"
prop=
"activityTime"
class=
"m-t-20"
>
<el-date-picker
:size=
"size"
:style=
"formItemWidth"
v-model=
"configForm.activityTime"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:picker-options=
"afterRangePickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"活动形式:"
prop=
"activityType"
class=
"m-t-20"
>
<el-radio-group
:size=
"size"
v-model=
"configForm.activityType"
style=
"width: 400px;"
>
<el-radio
:label=
"0"
>
随机红包
</el-radio>
<el-radio
:label=
"1"
>
九宫格
</el-radio>
<el-radio
:label=
"2"
>
翻牌
</el-radio>
<el-radio
:label=
"3"
>
大转盘
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"导入链接:"
prop=
"exportUrl"
class=
"m-t-20"
>
<div
class=
"activity-link"
>
<div
class=
"upload-btn"
>
<el-button
size=
"small"
>
<i
class=
"el-icon-plus"
></i>
上传文件
</el-button>
<input
type=
"file"
style=
"opacity: 0"
ref=
"file"
accept=
"*"
@
change=
"uploadFile"
/>
</div>
<a
href=
"https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/红包链接.xlsx"
target=
"_blank"
>
下载导入模板
</a>
</div>
</el-form-item>
</el-form>
</GLDialog>
</
template
>
<
script
type=
'text/ecmascript-6'
>
export
const
afterRangePickerOptions
=
{
disabledDate
(
date
)
{
const
yesterday
=
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()
-
1
))
if
(
date
<
yesterday
)
{
return
true
}
return
false
}
}
import
commonFun
from
'../common/fun.js'
import
*
as
dayjs
from
'dayjs'
export
default
{
name
:
''
,
props
:
{
editObj
:
{
type
:
Object
,
default
:
()
=>
{
}
}
},
data
()
{
return
{
afterRangePickerOptions
,
formItemWidth
:
'width: 284px;'
,
size
:
'small'
,
disabled
:
false
,
configForm
:
{
activityName
:
''
,
merchantId
:
''
,
activityTime
:
''
,
activityType
:
0
,
exportUrl
:
''
,
},
configRules
:
{
activityName
:
[
{
required
:
true
,
message
:
'请输入活动名称'
,
trigger
:
'blur'
}
],
merchantId
:
[
{
required
:
true
,
message
:
'请选择所属渠道'
,
trigger
:
'blur'
}
],
activityTime
:
[
{
required
:
true
,
message
:
'请输入活动时间'
,
trigger
:
'blur'
}
],
activityType
:
[
{
required
:
true
,
}
],
exportUrl
:
[
{
required
:
true
,
message
:
'请导入链接'
,
}
],
},
merchantList
:
[]
}
},
mounted
()
{
this
.
getMerchantList
()
},
watch
:
{
'editObj'
(
n
)
{
if
(
n
.
id
)
this
.
getRedEnvelopeActivityDetail
(
n
.
id
)
}
},
methods
:
{
async
getRedEnvelopeActivityDetail
(
id
)
{
try
{
const
{
configForm
}
=
this
,
res
=
await
this
.
$apis
.
redenvelope
.
getRedEnvelopeActivityDetail
({
id
})
this
.
configForm
=
{
...
configForm
,
activityName
:
res
.
activityName
,
activityType
:
res
.
activityType
,
merchantId
:
String
(
res
.
merchantId
),
activityTime
:
[
dayjs
(
res
.
activityStartTime
),
dayjs
(
res
.
activityEndTime
)],
id
}
this
.
disabled
=
true
console
.
log
(
res
)
}
catch
(
error
)
{
this
.
$message
.
error
(
error
)
}
},
async
getMerchantList
()
{
const
{
merchantId
}
=
this
.
$globalState
.
session
,
{
list
}
=
await
this
.
$apis
.
redenvelope
.
getRedEnvelopeMerchantList
({
merchantId
})
let
merchantList
=
[]
list
&&
list
.
map
(
e
=>
{
merchantList
.
push
({
confId
:
e
.
merchantNo
,
confName
:
e
.
merchantName
,
})
})
this
.
merchantList
=
merchantList
},
handleClose
()
{
this
.
configForm
=
this
.
$options
.
data
.
call
(
this
).
configForm
this
.
disabled
=
false
this
.
$emit
(
'update:editObj'
,
{})
},
handleConfirm
()
{
this
.
$refs
.
configRef
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
const
{
configForm
,
merchantList
,
disabled
}
=
this
let
params
=
this
.
$common
.
utils
.
deepClone
(
configForm
),
targetName
=
params
.
id
?
'updateActivityRedEnvelope'
:
'createActivityRedEnvelope'
params
.
activityStartTime
=
dayjs
(
params
.
activityTime
[
0
]).
format
(
'YYYY-MM-DD'
)
params
.
activityEndTime
=
dayjs
(
params
.
activityTime
[
1
]).
format
(
'YYYY-MM-DD'
)
params
.
merchantName
=
merchantList
.
find
(
e
=>
e
.
confId
==
params
.
merchantId
).
confName
delete
params
.
activityTime
console
.
log
(
JSON
.
parse
(
JSON
.
stringify
(
params
)))
const
res
=
await
this
.
$apis
.
redenvelope
[
targetName
](
params
)
console
.
log
(
res
)
try
{
}
catch
(
error
)
{
this
.
$message
.
error
(
error
)
}
}
else
{
return
false
}
})
},
async
uploadFile
(
e
)
{
try
{
const
res
=
await
commonFun
.
uploadFile
(
e
,
this
)
this
.
configForm
.
exportUrl
=
res
this
.
$refs
.
file
.
value
=
''
}
catch
(
error
)
{
console
.
log
(
error
)
if
(
error
)
this
.
$message
.
error
(
error
)
this
.
$refs
.
file
.
value
=
''
}
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.activity-link
{
display
:
flex
;
cursor
:
pointer
;
.upload-btn
{
position
:
relative
;
width
:
110px
;
height
:
32px
;
.el-button--small
{
width
:
100%
;
height
:
100%
;
}
input
{
cursor
:
pointer
;
position
:
absolute
;
height
:
100%
;
width
:
100%
;
top
:
0px
;
left
:
0px
;
font-size
:
0px
;
}
}
a
{
margin-left
:
8px
;
color
:
#5850ff
;
font-size
:
14px
;
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/redEnvelope/components/RedEnvelopeConfig/index.vue
0 → 100644
View file @
bc284cd
<
template
>
<div
class=
"container"
>
<div
class=
"sticky"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<div
class=
"sticky-btns"
>
<div
class=
"btns"
>
<el-button
type=
"default"
plain
@
click=
"showEditFun"
>
新建
</el-button>
<el-button
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
</div>
</div>
</div>
<div
class=
"tabelList"
>
<div
class=
"table-title"
>
红包配置列表
</div>
<GLTable
ref=
"listRef"
:getListApi=
"getListApi"
:searchForm=
"searchForm"
:noDataImg=
"url"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
>
<div
slot-scope=
"scope"
slot=
"activityStatus"
>
{{
activityStatusList
.
find
(
e
=>
e
.
id
===
scope
.
scope
.
activityStatus
).
text
||
'--'
}}
</div>
<span
slot=
"auth-button"
slot-scope=
"scope"
>
<GLTableButton
:buttonList=
"tableButtonList"
:buttonItem=
"scope.scope"
:buttonNum=
"3"
></GLTableButton>
</span>
</GLTable>
</div>
<link-detail
:show
.
sync=
"showLinkDetail"
></link-detail>
<edit
:editObj
.
sync=
"editObj"
></edit>
<!--
:title="editObj.title"
:edit="editObj.edit" -->
</div>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
url
from
'@/assets/empty.png'
import
*
as
dayjs
from
'dayjs'
import
linkDetail
from
'./linkDetail.vue'
import
edit
from
'./edit.vue'
import
{
exportFn
}
from
'@/common/constant'
const
activityStatusList
=
[
// 0:活动待进行;1:活动进行中;2:红包已用完;3:活动已结束
{
text
:
'全部'
,
id
:
''
},
{
text
:
'活动待开始'
,
id
:
0
},
{
text
:
'活动进行中'
,
id
:
1
},
{
text
:
'红包已用完'
,
id
:
2
},
{
text
:
'活动已结束'
,
id
:
3
}
]
export
default
{
components
:
{
linkDetail
,
edit
},
name
:
'RedEnvelopeConfig'
,
data
()
{
return
{
activityStatusList
,
url
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
searchForm
:
{
activityName
:
''
,
merchantId
:
''
,
activityStatus
:
''
,
activityTime
:
''
},
searchFormData
:
[
{
label
:
'活动名称'
,
name
:
'activityName'
,
type
:
'input'
,
maxlength
:
40
},
{
label
:
'所属渠道'
,
name
:
'merchantName'
,
type
:
'input'
,
maxlength
:
40
},
{
label
:
'状态'
,
name
:
'activityStatus'
,
type
:
'select'
,
optionList
:
activityStatusList
,
optionId
:
'id'
,
optionLabel
:
'text'
},
{
label
:
'活动时间'
,
name
:
'activityTime'
,
type
:
'datePicker'
,
isClear
:
true
},
],
getListApi
:
this
.
$apis
.
redenvelope
.
getRedEnvelopeConfigList
,
tableParams
:
{
listName
:
'data'
,
tableOption
:
true
,
tableColumns
:
[
{
label
:
'活动名称'
,
prop
:
'activityName'
,
minWidth
:
100
},
{
label
:
'所属渠道'
,
prop
:
'merchantName'
,
minWidth
:
100
},
{
label
:
'活动时间'
,
prop
:
'questionCount'
,
minWidth
:
100
,
formatter
:
cell
=>
{
return
`
${
dayjs
(
cell
.
activityStartTime
).
format
(
'YYYY/MM/DD'
)}
-
${
dayjs
(
cell
.
activityEndTime
).
format
(
'YYYY/MM/DD'
)}
`
}
},
{
label
:
'活动形式'
,
prop
:
'activityType'
,
minWidth
:
100
},
{
label
:
'红包链接总数'
,
prop
:
'amount'
,
minWidth
:
150
},
{
label
:
'已用总数'
,
prop
:
'usedAmount'
,
minWidth
:
100
},
{
label
:
'可用总数'
,
prop
:
'usableAmount'
,
minWidth
:
100
},
{
label
:
'状态'
,
addHtml
:
'activityStatus'
,
minWidth
:
100
},
]
},
// 表格按钮
tableButtonList
:
[
{
type
:
'el-button'
,
name
:
'编辑'
,
attrs
:
{
type
:
'text'
,
},
listeners
:
{
click
:
row
=>
this
.
showEditFun
(
row
)
}
},
{
type
:
'el-button'
,
name
:
'链接详情'
,
attrs
:
{
type
:
'text'
,
},
listeners
:
{
click
:
row
=>
this
.
jumpDetail
(
row
.
staffUuid
)
}
}
],
editObj
:
{},
showLinkDetail
:
false
}
},
mounted
()
{
},
methods
:
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
if
(
this
.
searchForm
.
activityTime
)
{
this
.
searchForm
.
activityStartTime
=
new
Date
(
this
.
searchForm
.
activityTime
[
0
]).
toLocaleDateString
().
replace
(
/-/g
,
'/'
)
this
.
searchForm
.
activityEndTime
=
new
Date
(
this
.
searchForm
.
activityTime
[
1
]).
toLocaleDateString
().
replace
(
/-/g
,
'/'
)
}
else
{
delete
this
.
searchForm
.
activityStartTime
delete
this
.
searchForm
.
activityEndTime
}
delete
this
.
searchForm
.
activityTime
resolve
()
})
},
handleSearch
()
{
this
.
$refs
.
listRef
.
refreshTable
()
},
handleReset
()
{
this
.
searchForm
=
this
.
$options
.
data
.
call
(
this
).
searchForm
this
.
handleSearch
()
},
jumpDetail
(
id
)
{
},
showEditFun
(
e
)
{
this
.
editObj
=
{
show
:
true
,
title
:
e
.
id
?
'编辑'
:
'新建'
,
id
:
e
.
id
||
''
}
},
handleExport
(
row
)
{
// var params = this.getParams()
// var apiName = this.$isGroupUp ? 'couponGroupExportApi' : 'couponStoreExportApi'
// this.$apis.couponManage[apiName](params).then(res => {
// exportFn(res)
// })
},
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.container
{
height
:
100%
;
background-color
:
#fff
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
20px
;
.table-title
{
font-weight
:
700
;
font-size
:
16px
;
color
:
#333333
;
padding-bottom
:
18px
;
}
.sticky
{
position
:
relative
;
z-index
:
2
;
&-btns
{
position
:
absolute
;
right
:
0
;
bottom
:
-23px
;
overflow
:
hidden
;
.el-button
+
.el-button
{
margin-left
:
8px
;
}
.btns
{
transition
:
all
0.25s
;
.el-button
{
padding
:
8px
15px
;
min-width
:
60px
;
}
}
}
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/redEnvelope/components/RedEnvelopeConfig/linkDetail.vue
0 → 100644
View file @
bc284cd
<
template
>
<GLDialog
mode=
"big"
class=
"muti"
bigTitle=
"链接详情"
:hasFooter=
"false"
:before-close=
"handleClose"
:visible
.
sync=
"show"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"2"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<GLTable
ref=
"listRef"
:getListApi=
"getListApi"
:searchForm=
"searchForm"
:noDataImg=
"url"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
>
</GLTable>
</GLDialog>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
url
from
'@/assets/empty.png'
import
*
as
dayjs
from
'dayjs'
export
default
{
name
:
''
,
props
:
{
show
:
Boolean
,
},
data
()
{
return
{
url
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
searchForm
:
{
merchantName
:
''
,
merchantId
:
''
,
staffName
:
''
},
searchFormData
:
[
{
label
:
'状态'
,
name
:
'status'
,
type
:
'select'
,
optionList
:
[
{
text
:
'全部'
,
id
:
''
},
{
text
:
'活动待开始'
,
id
:
0
},
{
text
:
'活动进行中'
,
id
:
1
},
{
text
:
'红包已用完'
,
id
:
2
},
{
text
:
'活动已结束'
,
id
:
3
}
],
optionId
:
'id'
,
optionLabel
:
'text'
},
{
label
:
'手机号码'
,
name
:
'merchantName'
,
type
:
'input'
,
maxlength
:
100
},
{
label
:
'微信昵称'
,
name
:
'merchantId'
,
type
:
'input'
,
maxlength
:
100
},
],
getListApi
:
this
.
$apis
.
outbound
.
getTaskList
,
tableParams
:
{
listName
:
'data'
,
tableOption
:
false
,
tableColumns
:
[
{
label
:
'红包链接'
,
prop
:
'merchantName'
,
addHtml
:
'merchantName'
,
minWidth
:
100
},
{
label
:
'导入时间'
,
prop
:
'staffName'
,
minWidth
:
100
},
{
label
:
'状态'
,
prop
:
'questionCount'
,
minWidth
:
100
},
{
label
:
'微信昵称'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
100
},
{
label
:
'手机号'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
100
},
{
label
:
'绑定时间'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
100
},
{
label
:
'来源'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
100
},
]
},
}
},
mounted
()
{
},
methods
:
{
handleClose
()
{
this
.
$emit
(
'update:show'
,
false
)
},
handleConfirm
()
{
},
handleSearch
()
{
this
.
$refs
.
listRef
.
refreshTable
()
},
handleReset
()
{
this
.
searchForm
=
this
.
$options
.
data
.
call
(
this
).
searchForm
this
.
handleSearch
()
},
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/redEnvelope/components/RedEnvelopeRecord/importRecord.vue
0 → 100644
View file @
bc284cd
<
template
>
<GLDialog
mode=
"mid"
class=
"muti"
:bigTitle=
"title"
:before-close=
"handleClose"
@
onOk=
"handleConfirm"
@
onCancel=
"handleClose"
:visible
.
sync=
"show"
:modal-append-to-body=
"true"
>
<el-form
ref=
"configRef"
label-width=
"154px"
:rules=
"configRules"
:model=
"configForm"
>
<el-form-item
label=
"活动形式:"
prop=
"d"
class=
"m-t-20"
>
<el-radio-group
:size=
"size"
v-model=
"configForm.d"
>
<el-radio
:label=
"1"
>
中奖记录
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"导入链接:"
prop=
"e"
class=
"m-t-20"
>
<div
class=
"activity-link"
>
<div
class=
"upload-btn"
>
<el-button
size=
"small"
>
<i
class=
"el-icon-plus"
></i>
上传文件
</el-button>
<input
type=
"file"
style=
"opacity: 0"
ref=
"file"
accept=
"*"
@
change=
"uploadFile"
/>
</div>
<a
href=
"https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/中奖记录.xlsx"
target=
"_blank"
>
下载中奖记录模板
</a>
</div>
</el-form-item>
</el-form>
</GLDialog>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
commonFun
from
'../common/fun.js'
export
default
{
name
:
''
,
props
:
{
show
:
Boolean
,
title
:
String
},
data
()
{
return
{
formItemWidth
:
'width: 284px;'
,
size
:
'small'
,
channelList
:
[],
configForm
:
{
d
:
1
},
configRules
:
{
d
:
[
{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
||
(
value
&&
!
value
.
trim
()))
{
return
callback
(
new
Error
(
'请选择活动形式'
))
}
else
{
return
callback
()
}
},
trigger
:
'change'
}
]
},
}
},
mounted
()
{
},
methods
:
{
handleClose
()
{
this
.
$emit
(
'update:show'
,
false
)
},
handleConfirm
()
{
},
async
uploadFile
(
e
)
{
try
{
const
res
=
await
commonFun
.
uploadFile
(
e
,
this
)
console
.
log
(
res
)
this
.
$refs
.
file
.
value
=
''
}
catch
(
error
)
{
console
.
log
(
error
)
if
(
error
)
this
.
$message
.
error
(
error
)
}
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.activity-link
{
display
:
flex
;
cursor
:
pointer
;
.upload-btn
{
position
:
relative
;
width
:
110px
;
height
:
32px
;
.el-button--small
{
width
:
100%
;
height
:
100%
;
}
input
{
cursor
:
pointer
;
position
:
absolute
;
height
:
100%
;
width
:
100%
;
top
:
0px
;
left
:
0px
;
font-size
:
0px
;
}
}
a
{
margin-left
:
8px
;
color
:
#5850ff
;
font-size
:
14px
;
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/redEnvelope/components/RedEnvelopeRecord/index.vue
0 → 100644
View file @
bc284cd
<
template
>
<div
class=
"container"
>
<div
class=
"sticky"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<div
class=
"sticky-btns"
>
<div
class=
"btns"
>
<el-button
type=
"default"
plain
@
click=
"showEditFun"
>
导入记录
</el-button>
</div>
</div>
</div>
<div
class=
"tabelList"
>
<div
class=
"table-title"
>
红包记录列表
</div>
<GLTable
ref=
"listRef"
:getListApi=
"getListApi"
:searchForm=
"searchForm"
:noDataImg=
"url"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
>
<div
slot-scope=
"scope"
slot=
"zt"
>
{{
scope
}}
状态
</div>
<span
slot=
"auth-button"
slot-scope=
"scope"
>
<GLTableButton
:buttonList=
"tableButtonList"
:buttonItem=
"scope.scope"
:buttonNum=
"3"
></GLTableButton>
</span>
</GLTable>
</div>
<import-record
:show
.
sync=
"showImportRecord"
></import-record>
</div>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
url
from
'@/assets/empty.png'
import
*
as
dayjs
from
'dayjs'
import
{
exportFn
}
from
'@/common/constant'
import
importRecord
from
'./importRecord.vue'
export
default
{
name
:
'RedEnvelopeConfig'
,
components
:
{
importRecord
},
data
()
{
return
{
url
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
searchForm
:
{
merchantName
:
''
,
merchantId
:
''
,
staffName
:
''
},
searchFormData
:
[
{
label
:
'活动名称'
,
name
:
'merchantName'
,
type
:
'input'
,
maxlength
:
100
},
{
label
:
'所属渠道'
,
name
:
'merchantId'
,
type
:
'input'
,
maxlength
:
100
},
{
label
:
'微信昵称'
,
name
:
'merchantId'
,
type
:
'input'
,
maxlength
:
100
},
{
label
:
'手机号码'
,
name
:
'merchantId'
,
type
:
'input'
,
maxlength
:
100
},
],
getListApi
:
this
.
$apis
.
outbound
.
getTaskList
,
tableParams
:
{
listName
:
'data'
,
tableOption
:
false
,
tableColumns
:
[
{
label
:
'手机号码'
,
prop
:
'merchantName'
,
addHtml
:
'merchantName'
,
minWidth
:
100
},
{
label
:
'微信昵称'
,
prop
:
'staffName'
,
minWidth
:
100
},
{
label
:
'活动名称'
,
prop
:
'questionCount'
,
minWidth
:
100
},
{
label
:
'所属渠道'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
100
},
{
label
:
'活动时间'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
150
},
{
label
:
'活动形式'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
100
},
{
label
:
'红包链接'
,
prop
:
'questionEffectiveCount'
,
minWidth
:
100
},
{
label
:
'奖品类型'
,
prop
:
'zt'
,
minWidth
:
100
},
{
label
:
'中奖金额'
,
prop
:
'zt'
,
minWidth
:
100
},
]
},
showImportRecord
:
true
}
},
mounted
()
{
},
methods
:
{
handleSearch
()
{
this
.
$refs
.
listRef
.
refreshTable
()
},
handleReset
()
{
this
.
searchForm
=
this
.
$options
.
data
.
call
(
this
).
searchForm
this
.
handleSearch
()
},
jumpDetail
(
id
)
{
},
showEditFun
(
e
)
{
console
.
log
(
e
)
this
.
showEdit
=
true
},
handleExport
(
row
)
{
// var params = this.getParams()
// var apiName = this.$isGroupUp ? 'couponGroupExportApi' : 'couponStoreExportApi'
// this.$apis.couponManage[apiName](params).then(res => {
// exportFn(res)
// })
},
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.container
{
height
:
100%
;
background-color
:
#fff
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
20px
;
.table-title
{
font-weight
:
700
;
font-size
:
16px
;
color
:
#333333
;
padding-bottom
:
18px
;
}
.sticky
{
position
:
relative
;
z-index
:
2
;
&-btns
{
position
:
absolute
;
right
:
0
;
bottom
:
-23px
;
overflow
:
hidden
;
.el-button
+
.el-button
{
margin-left
:
8px
;
}
.btns
{
transition
:
all
0.25s
;
.el-button
{
padding
:
8px
15px
;
min-width
:
60px
;
}
}
}
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/redEnvelope/components/common/fun.js
0 → 100644
View file @
bc284cd
export
default
{
uploadFile
(
e
,
_this
,
maxSize
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
file
=
e
.
srcElement
.
files
[
0
]
let
AllImgExt
=
'.xls|.xlsx'
let
extName
=
file
.
name
.
substring
(
file
.
name
.
lastIndexOf
(
'.'
)).
toLowerCase
()
if
(
AllImgExt
.
indexOf
(
extName
)
===
-
1
)
{
_this
.
$message
.
error
(
'上传格式不正确'
)
return
reject
()
}
const
size
=
file
.
size
/
1024
/
1024
if
(
maxSize
&&
size
>
maxSize
)
{
_this
.
$message
.
error
(
'单文件体积需小于8M'
)
return
reject
()
}
this
.
downloadStatus
=
true
this
.
setInter
=
setInterval
(
this
.
addProcess
,
100
)
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
async
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
const
splitStr
=
file
.
name
.
split
(
'.'
)
const
fileUrl
=
splitStr
[
splitStr
.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
const
res
=
await
_this
.
$apis
.
common
.
pictureUpload
({
file
:
fileUrl
})
console
.
log
(
res
)
if
(
res
)
resolve
(
res
)
else
reject
(
'上传失败'
)
}
})
},
}
\ No newline at end of file
\ No newline at end of file
src/views/redEnvelope/index.vue
0 → 100644
View file @
bc284cd
<
template
>
<div
class=
"layout"
>
<div
class=
"tabs"
>
<GLTabs
v-model=
"currentComponent"
:tabPaneList=
"tabPaneList"
@
tab-click=
"handleClick"
></GLTabs>
</div>
<div
class=
"component"
>
<component
:is=
"currentComponent"
ref=
"componentRef"
></component>
</div>
</div>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
RedEnvelopeConfig
from
'./components/RedEnvelopeConfig/index.vue'
import
RedEnvelopeRecord
from
'./components/RedEnvelopeRecord/index.vue'
export
default
{
components
:
{
RedEnvelopeConfig
,
RedEnvelopeRecord
,
},
name
:
''
,
data
()
{
return
{
currentComponent
:
'RedEnvelopeConfig'
,
tabPaneList
:
[
{
label
:
'红包配置'
,
name
:
'RedEnvelopeConfig'
},
{
label
:
'红包记录'
,
name
:
'RedEnvelopeRecord'
},
]
}
},
mounted
()
{
},
methods
:
{
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.tabs
{
margin-bottom
:
16px
;
}
</
style
>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment