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 bceda4f7
authored
Oct 26, 2023
by
徐忆琳
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v3.21.1_10' into 'v3.21.1'
提交紧急版本代码 See merge request
!15
2 parents
e64f95c9
dd469526
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
449 additions
and
37 deletions
src/views/redEnvelope/components/RedEnvelopeConfig/index.vue
src/views/redEnvelope/components/RedEnvelopeConfig/whiteList.vue
src/views/redEnvelope/components/RedEnvelopeConfig/whiteListImport.vue
src/views/redEnvelope/components/RedEnvelopeConfig/whiteListSearch.vue
src/views/redEnvelope/components/RedEnvelopeConfig/index.vue
View file @
bceda4f
...
...
@@ -2,51 +2,55 @@
<div
class=
"container"
>
<div
class=
"sticky"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
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>
type=
"default"
plain
@
click=
"showEditFun"
>
新建
</el-button>
<el-button
type=
"default"
@
click=
"handleExport"
>
导出
</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=
"tableSearchForm"
:noDataImg=
"url"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
ref=
"listRef"
:getListApi=
"getListApi"
:searchForm=
"tableSearchForm"
:noDataImg=
"url"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
>
<span
slot=
"auth-button"
slot-scope=
"scope"
slot=
"auth-button"
slot-scope=
"scope"
>
<GLTableButton
:buttonList=
"tableButtonList"
:buttonItem=
"scope.scope"
:buttonNum=
"3"
:buttonList=
"tableButtonList"
:buttonItem=
"scope.scope"
:buttonNum=
"3"
></GLTableButton>
</span>
</GLTable>
</div>
<link-detail
:linkDetailObj
.
sync=
"linkDetailObj"
></link-detail>
<edit
:editObj
.
sync=
"editObj"
></edit>
<whiteList
:linkDetailObj
.
sync=
"whiteListObj"
>
</whiteList>
</div>
</
template
>
...
...
@@ -55,14 +59,16 @@ import url from '@/assets/empty.png'
import
*
as
dayjs
from
'dayjs'
import
linkDetail
from
'./linkDetail.vue'
import
edit
from
'./edit.vue'
import
{
exportFn
,
activityStatusList
}
from
'@/common/constant'
import
whiteList
from
'./whiteList'
import
{
exportFn
,
activityStatusList
}
from
'@/common/constant'
export
default
{
components
:
{
linkDetail
,
edit
},
components
:
{
linkDetail
,
edit
,
whiteList
},
name
:
'RedEnvelopeConfig'
,
data
()
{
data
()
{
return
{
url
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
searchForm
:
{
activityName
:
''
,
merchantId
:
''
,
...
...
@@ -117,7 +123,7 @@ export default {
prop
:
'questionCount'
,
minWidth
:
100
,
formatter
:
cell
=>
{
return
`
${
dayjs
(
cell
.
activityStartTime
).
format
(
'YYYY/MM/DD'
)}
-
${
dayjs
(
cell
.
activityEndTime
).
format
(
'YYYY/MM/DD'
)}
`
return
cell
.
activityStartTime
?
`
${
dayjs
(
cell
.
activityStartTime
).
format
(
'YYYY/MM/DD'
)}
-
${
dayjs
(
cell
.
activityEndTime
).
format
(
'YYYY/MM/DD'
)}
`
:
''
}
},
{
...
...
@@ -170,18 +176,30 @@ export default {
listeners
:
{
click
:
row
=>
this
.
jumpDetail
(
row
)
}
},
{
type
:
'el-button'
,
name
:
'白名单'
,
attrs
:
{
type
:
'text'
,
},
listeners
:
{
click
:
row
=>
this
.
whiteList
(
row
)
}
}
],
editObj
:
{},
linkDetailObj
:
{},
whiteListObj
:
{},
tableSearchForm
:
{}
}
},
mounted
()
{
mounted
()
{
},
methods
:
{
getParams
()
{
getParams
()
{
const
searchForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
searchForm
))
if
(
searchForm
.
activityTime
)
{
searchForm
.
activityStartTime
=
dayjs
(
this
.
searchForm
.
activityTime
[
0
]).
format
(
'YYYY-MM-DD'
)
...
...
@@ -190,28 +208,34 @@ export default {
delete
searchForm
.
activityTime
return
searchForm
},
handleSearch
()
{
handleSearch
()
{
this
.
tableSearchForm
=
this
.
getParams
()
this
.
$refs
.
listRef
.
refreshTable
()
},
handleReset
()
{
handleReset
()
{
this
.
searchForm
=
this
.
$options
.
data
.
call
(
this
).
searchForm
this
.
handleSearch
()
},
jumpDetail
(
e
)
{
jumpDetail
(
e
)
{
this
.
linkDetailObj
=
{
show
:
true
,
id
:
e
.
id
}
},
showEditFun
(
e
)
{
whiteList
(
e
)
{
this
.
whiteListObj
=
{
show
:
true
,
id
:
e
.
id
}
},
showEditFun
(
e
)
{
this
.
editObj
=
{
show
:
true
,
title
:
e
.
id
?
'编辑'
:
'新建'
,
id
:
e
.
id
||
''
}
},
handleExport
(
row
)
{
handleExport
(
row
)
{
this
.
$apis
.
redenvelope
.
exportActivityRedEnvelope
(
this
.
getParams
()).
then
(
res
=>
{
exportFn
(
res
)
})
...
...
@@ -227,25 +251,31 @@ export default {
-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
;
...
...
@@ -254,4 +284,4 @@ export default {
}
}
}
</
style
>
\ No newline at end of file
</
style
>
src/views/redEnvelope/components/RedEnvelopeConfig/whiteList.vue
0 → 100644
View file @
bceda4f
<
template
>
<GLDialog
mode=
"big"
class=
"muti link"
bigTitle=
"白名单"
:hasFooter=
"true"
:before-close=
"handleClose"
:visible
.
sync=
"linkDetailObj.show"
@
onOk=
"handleConfirm"
@
onCancel=
"handleClose"
>
<div
class=
"tabs"
>
<GLTabs
v-model=
"currentComponent"
:tabPaneList=
"tabPaneList"
@
tab-click=
"handleClick"
></GLTabs>
</div>
<div
class=
"component"
>
<component
:is=
"currentComponent"
ref=
"componentRef"
></component>
</div>
</GLDialog>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
WhiteListImport
from
"./whiteListImport"
;
import
WhiteListSearch
from
"./whiteListSearch"
;
export
default
{
name
:
''
,
components
:
{
WhiteListSearch
,
WhiteListImport
},
props
:
{
linkDetailObj
:
{
type
:
Object
,
default
:
()
=>
{
}
}
},
data
()
{
return
{
currentComponent
:
'WhiteListSearch'
,
tabPaneList
:
[
{
label
:
'白名单列表'
,
name
:
'WhiteListSearch'
},
{
label
:
'导入白名单'
,
name
:
'WhiteListImport'
},
],
}
},
mounted
()
{
},
methods
:
{
handleConfirm
(){
if
(
this
.
currentComponent
==
'WhiteListImport'
){
this
.
$refs
.
componentRef
.
handleConfirm
()
}
},
handleClose
()
{
this
.
$emit
(
'update:linkDetailObj'
,
{})
},
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.link
{
/deep/.el-form-item--small
{
width
:
fit-content
;
}
}
</
style
>
src/views/redEnvelope/components/RedEnvelopeConfig/whiteListImport.vue
0 → 100644
View file @
bceda4f
<
template
>
<div
class=
"whiteListImport"
>
<el-form
ref=
"recordRef"
label-width=
"154px"
:rules=
"configRules"
:model=
"recordForm"
>
<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>
<template
v-if=
"recordForm.exportUrl"
>
<div
class=
"file-info flex"
>
{{
fileName
}}
<div
class=
"el-icon-success"
></div>
</div>
</
template
>
<
template
v-if=
"fileError"
>
<div
class=
"file-info flex error"
>
<a
:href=
"fileError"
target=
"_blank"
>
下载失败列表
</a>
<div
class=
"el-icon-error"
></div>
</div>
</
template
>
</div>
</el-form-item>
</el-form>
</div>
</template>
<
script
>
import
commonFun
from
"../common/fun"
;
export
default
{
name
:
"whiteListImport"
,
data
(){
return
{
recordForm
:
{
importType
:
5
,
exportUrl
:
''
},
configRules
:
{
exportUrl
:
[
{
required
:
true
,
message
:
'请导入白名单'
,
}
],
},
fileName
:
''
,
fileError
:
''
}
},
methods
:{
handleClose
()
{
this
.
recordForm
=
this
.
$options
.
data
.
call
(
this
).
recordForm
this
.
fileError
=
''
this
.
$refs
.
recordRef
.
resetFields
()
this
.
$emit
(
'update:show'
,
false
)
},
handleConfirm
()
{
this
.
$refs
.
recordRef
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
try
{
const
{
recordForm
}
=
this
,
res
=
await
this
.
$apis
.
redenvelope
.
importRedEnvelopeRecord
(
recordForm
)
if
(
res
)
{
this
.
$message
({
message
:
'导入成功'
,
type
:
'success'
})
this
.
handleClose
()
this
.
$parent
.
handleSearch
()
}
else
throw
'导入成功'
}
catch
(
error
)
{
this
.
$message
.
error
(
error
)
}
}
})
},
async
uploadFile
(
e
)
{
try
{
const
{
url
,
name
}
=
await
commonFun
.
uploadFile
(
e
,
this
),
{
importType
}
=
this
.
recordForm
this
.
$refs
.
file
.
value
=
''
const
res
=
await
this
.
$apis
.
redenvelope
.
checkImport
({
importType
,
exportUrl
:
url
})
if
(
res
)
{
if
(
res
.
totalCount
==
0
||
res
.
failCount
>
0
)
{
this
.
fileError
=
res
.
errorUrl
this
.
$message
.
error
(
'红包记录导入失败'
)
this
.
recordForm
.
exportUrl
=
''
return
}
this
.
$message
({
message
:
'导入成功'
,
type
:
'success'
})
this
.
fileError
=
''
this
.
recordForm
.
exportUrl
=
url
this
.
fileName
=
name
}
}
catch
(
error
)
{
console
.
log
(
error
)
if
(
error
)
this
.
$message
.
error
(
error
)
}
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.whiteListImport
{
margin-top
:
20px
;
}
.activity-link
{
display
:
flex
;
width
:
500px
;
.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
,
.error
{
margin-left
:
8px
;
color
:
#5850ff
;
font-size
:
14px
;
cursor
:
pointer
;
}
.file-info
{
margin-left
:
8px
;
.el-icon-success
{
margin-left
:
8px
;
color
:
#67c23a
;
}
.el-icon-error
{
margin-left
:
8px
;
color
:
red
;
}
}
}
</
style
>
src/views/redEnvelope/components/RedEnvelopeConfig/whiteListSearch.vue
0 → 100644
View file @
bceda4f
<
template
>
<div
class=
"whiteListSearch"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<GLTable
ref=
"listRef"
:getListApi=
"getListApi"
:tableData=
"tableData"
:noDataImg=
"url"
:tableParams=
"tableParams"
@
refreshTable=
"refreshTable"
:tableTotal=
"tableTotal"
:pageConf=
"pageConf"
>
<span
slot=
"auth-button"
slot-scope=
"scope"
>
<GLTableButton
:buttonList=
"tableButtonList"
:buttonItem=
"scope.scope"
:buttonNum=
"3"
></GLTableButton>
</span>
</GLTable>
</div>
</
template
>
<
script
>
import
url
from
'@/assets/empty.png'
import
*
as
dayjs
from
"dayjs"
;
export
default
{
name
:
"whiteListSearch"
,
data
()
{
return
{
url
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
searchForm
:
{
status
:
''
,
wechatName
:
''
,
userPhone
:
''
},
getListApi
:
this
.
$apis
.
redenvelope
.
getRedEnvelopeRecordList
,
searchFormData
:
[
{
label
:
'手机号码'
,
name
:
'userPhone'
,
type
:
'input'
,
maxlength
:
11
}
],
tableParams
:
{
listName
:
'list'
,
tableOption
:
true
,
tableColumns
:
[
{
label
:
'手机号'
,
prop
:
'userPhone'
,
minWidth
:
100
},
{
label
:
'导入时间'
,
prop
:
'exportTime'
,
minWidth
:
180
},
]
},
// 表格按钮
tableButtonList
:
[
{
type
:
'el-button'
,
name
:
'删除'
,
attrs
:
{
type
:
'text'
,
},
listeners
:
{
click
:
row
=>
this
.
showDelFun
(
row
)
}
}
],
tableData
:
[],
tableTotal
:
0
}
},
methods
:
{
handleSearch
()
{
this
.
$refs
.
listRef
.
refreshTable
()
},
handleReset
()
{
this
.
searchForm
=
this
.
$options
.
data
.
call
(
this
).
searchForm
this
.
handleSearch
()
},
showDelFun
({
id
}){
const
params
=
{
id
}
this
.
$apis
.
redenvelope
.
deleteWhiteList
(
params
).
then
(
res
=>
{
if
(
res
){
this
.
$message
.
success
(
'删除成功'
)
this
.
handleSearch
()
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.whiteListSearch
{
margin-top
:
20px
;
}
</
style
>
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