Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-activity-center
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 a71deae6
authored
Jun 08, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'saas+v4.22.1' into 'master'
合并Saas+v4.22.1 See merge request
!64
2 parents
8fe502e6
0a2a7f56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
469 additions
and
82 deletions
src/api/modules/seckillActivity.js
src/assets/css/public.scss
src/views/seckillActivity/browseList.vue
src/views/seckillActivity/crowdFundList.vue
src/api/modules/seckillActivity.js
View file @
a71deae
...
@@ -316,4 +316,16 @@ const getTencentcloudmediaList = params => {
...
@@ -316,4 +316,16 @@ const getTencentcloudmediaList = params => {
})
})
}
}
export
default
{
getCrowdGoldParams
,
getPayListApi
,
getPayMerchatListApi
,
liveroomDetailexport
,
liveroomDetailpage
,
liveroomOverview
,
getActivityPageApi
,
getCrowdfundListApi
,
exportCrowdfundApi
,
getBrowseListApi
,
exportBrowseApi
,
toggleStatusApi
,
deleteActivityApi
,
topActivityApi
,
getSharedApi
,
addOrUpdateActivityApi
,
getActivityDetailApi
,
getCrowdSharedApi
,
getLiveListApi
,
getRankListApi
,
exportRankListApi
,
getDataBoardApi
,
getVisitorListApi
,
getSharedListApi
,
getDailyOrderQuantityStatistics
,
exportDailyOrderQuantityStatistics
,
getCrowdfundingParams
,
getTencentcloudmediaList
}
/**
excel批量导入众筹活动 */
const
importCrowdFundingActivity
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.activity.batch.import'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
export
default
{
getCrowdGoldParams
,
getPayListApi
,
getPayMerchatListApi
,
liveroomDetailexport
,
liveroomDetailpage
,
liveroomOverview
,
getActivityPageApi
,
getCrowdfundListApi
,
exportCrowdfundApi
,
getBrowseListApi
,
exportBrowseApi
,
toggleStatusApi
,
deleteActivityApi
,
topActivityApi
,
getSharedApi
,
addOrUpdateActivityApi
,
getActivityDetailApi
,
getCrowdSharedApi
,
getLiveListApi
,
getRankListApi
,
exportRankListApi
,
getDataBoardApi
,
getVisitorListApi
,
getSharedListApi
,
getDailyOrderQuantityStatistics
,
exportDailyOrderQuantityStatistics
,
getCrowdfundingParams
,
getTencentcloudmediaList
,
importCrowdFundingActivity
}
src/assets/css/public.scss
View file @
a71deae
...
@@ -879,4 +879,8 @@ ul li {
...
@@ -879,4 +879,8 @@ ul li {
margin
:
0
;
margin
:
0
;
list-style
:
none
;
list-style
:
none
;
}
.loading-class
{
font-size
:
50px
;
color
:
#5850ff
!
important
;
}
}
\ No newline at end of file
\ No newline at end of file
src/views/seckillActivity/browseList.vue
View file @
a71deae
...
@@ -5,40 +5,96 @@
...
@@ -5,40 +5,96 @@
<p
class=
"edit-title"
>
{{
routeInfo
.
activityName
}}
</p>
<p
class=
"edit-title"
>
{{
routeInfo
.
activityName
}}
</p>
<div
class=
"p-20"
>
<div
class=
"p-20"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<div
class=
"flex m-b-10 w-100-percent"
>
<div
class=
"flex m-b-10 w-100-percent"
>
<div
class=
"table-title"
>
<div
class=
"table-title"
>
已累计
已累计
<template
v-if=
"routeInfo.type != 2"
>
{{
decodeURI
(
routeInfo
.
name
)
}}
</
template
>
<template
v-if=
"routeInfo.type != 2"
>
{{
decodeURI
(
routeInfo
.
name
)
}}
</
template
>
<span>
{{
routeInfo.count || 0
}}
</span>
<span>
{{
total || routeInfo.count
}}
</span>
{{ routeInfo.type == 2 ? '位访客' : '次' }}
{{ routeInfo.type == 2 ? '位访客' : '次' }}
</div>
</div>
<el-button
:size=
"size"
class=
"default-blue-btn"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
<el-button
:size=
"size"
class=
"default-blue-btn"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<!-- 表格区域 开始 -->
<GLTable
ref=
"browserRef"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
@
setTableFinishFun=
"setTableFinishFun"
>
<GLTable
<div
slot=
"customerName"
class=
"flex-align"
slot-scope=
"scope"
>
ref=
"browserRef"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
@
setTableFinishFun=
"setTableFinishFun"
>
<div
slot=
"customerName"
class=
"flex-align"
slot-scope=
"scope"
>
<
template
v-if=
"scope.scope.customerAvatar"
>
<
template
v-if=
"scope.scope.customerAvatar"
>
<el-popover
placement=
"top"
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<el-popover
<img
class=
"table-popover-img"
:src=
"scope.scope.customerAvatar"
/>
placement=
"top"
<img
class=
"img-36 pointer"
slot=
"reference"
:src=
"scope.scope.customerAvatar"
/>
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<img
class=
"table-popover-img"
:src=
"scope.scope.customerAvatar"
/>
<img
class=
"img-36 pointer"
slot=
"reference"
:src=
"scope.scope.customerAvatar"
/>
</el-popover>
</el-popover>
</
template
>
</
template
>
<span
class=
"m-l-10"
>
{{ scope.scope.customerName }}
</span>
<span
class=
"m-l-10"
>
{{ scope.scope.customerName }}
</span>
</div>
</div>
<div
slot=
"shareName"
class=
"flex-align"
slot-scope=
"scope"
>
<div
slot=
"shareName"
class=
"flex-align"
slot-scope=
"scope"
>
<
template
v-if=
"scope.scope.shareAvatar"
>
<
template
v-if=
"scope.scope.shareAvatar"
>
<el-popover
placement=
"top"
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<el-popover
<img
class=
"table-popover-img"
:src=
"scope.scope.shareAvatar"
/>
placement=
"top"
<img
class=
"img-36 pointer"
slot=
"reference"
:src=
"scope.scope.shareAvatar"
/>
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<img
class=
"table-popover-img"
:src=
"scope.scope.shareAvatar"
/>
<img
class=
"img-36 pointer"
slot=
"reference"
:src=
"scope.scope.shareAvatar"
/>
</el-popover>
</el-popover>
</
template
>
</
template
>
<span
class=
"m-l-10"
>
{{ scope.scope.shareName }}
</span>
<span
class=
"m-l-10"
>
{{ scope.scope.shareName }}
</span>
<span
class=
"m-l-10"
>
{{ scope.scope.sharePhone }}
</span>
<span
class=
"m-l-10"
>
{{ scope.scope.sharePhone }}
</span>
</div>
</div>
<div
slot=
"isBuy"
slot-scope=
"scope"
>
<div
slot=
"isBuy"
slot-scope=
"scope"
>
<span
:class=
"['table-circle', 'm-r-8', scope.scope.isBuy == 'Y' ? 'back-green' : 'back-grey']"
></span>
<span
:class=
"['table-circle', 'm-r-8', scope.scope.isBuy == 'Y' ? 'back-green' : 'back-grey']"
></span>
<span>
<span>
{{
{{
...
@@ -53,8 +109,14 @@
...
@@ -53,8 +109,14 @@
<!-- 表格区域 end -->
<!-- 表格区域 end -->
</div>
</div>
</div>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<div
<el-button
type=
"default"
@
click=
"handleJump"
>
返回
</el-button>
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"default"
@
click=
"handleJump"
>
返回
</el-button>
</div>
</div>
</div>
</div>
</template>
</template>
...
@@ -65,7 +127,7 @@ import url from '@/assets/empty.png'
...
@@ -65,7 +127,7 @@ import url from '@/assets/empty.png'
import
{
exportFn
}
from
'@/common/constant'
import
{
exportFn
}
from
'@/common/constant'
export
default
{
export
default
{
name
:
'browseList'
,
name
:
'browseList'
,
data
()
{
data
()
{
return
{
return
{
size
:
'small'
,
size
:
'small'
,
url
:
url
,
url
:
url
,
...
@@ -122,49 +184,50 @@ export default {
...
@@ -122,49 +184,50 @@ export default {
width
:
230
width
:
230
}
}
]
]
}
},
total
:
0
}
}
},
},
created
()
{
created
()
{
const
lastTableColumns
=
[
const
lastTableColumns
=
[
{
{
label
:
'浏览时长'
,
label
:
'浏览时长'
,
prop
:
'browserTime'
prop
:
'browserTime'
},
},
{
{
label
:
'进入页面时间'
,
label
:
'进入页面时间'
,
prop
:
'operationDate'
,
prop
:
'operationDate'
,
width
:
'180'
width
:
'180'
},
},
{
{
label
:
'离开页面时间'
,
label
:
'离开页面时间'
,
prop
:
'leaveDate'
,
prop
:
'leaveDate'
,
width
:
'180'
width
:
'180'
},
},
{
{
label
:
'订单状态'
,
label
:
'订单状态'
,
prop
:
'isBuy'
,
prop
:
'isBuy'
,
addHtml
:
'isBuy'
addHtml
:
'isBuy'
}
}
],
],
{
query
}
=
this
.
$route
,
{
query
}
=
this
.
$route
,
name
=
{
name
=
{
1
:
'浏览'
,
1
:
'浏览'
,
2
:
'访客'
,
2
:
'访客'
,
3
:
'分享'
3
:
'分享'
}[
query
.
type
],
}[
query
.
type
],
[
url
]
=
window
.
location
.
href
.
split
(
'%24title'
)
[
url
]
=
window
.
location
.
href
.
split
(
'%24title'
),
apiName
=
this
.
$apis
.
seckillActivity
[
{
1
:
'getBrowseListApi'
,
2
:
'getVisitorListApi'
,
3
:
'getSharedListApi'
}[
query
.
type
]]
query
.
name
=
name
query
.
name
=
name
this
.
routeInfo
=
query
this
.
routeInfo
=
query
this
.
getListApi
=
this
.
$apis
.
seckillActivity
[
this
.
getListApi
=
apiName
{
if
(
query
.
type
==
1
)
this
.
getTotal
(
apiName
,
query
.
id
)
1
:
'getBrowseListApi'
,
2
:
'getVisitorListApi'
,
3
:
'getSharedListApi'
}[
query
.
type
]
]
history
.
replaceState
(
null
,
null
,
`
${
url
}
&$title=
${
name
}
明细`
)
history
.
replaceState
(
null
,
null
,
`
${
url
}
&$title=
${
name
}
明细`
)
// listName:
// listName:
//1 浏览 2 访客 3 分享
//1 浏览 2 访客 3 分享
...
@@ -211,19 +274,19 @@ export default {
...
@@ -211,19 +274,19 @@ export default {
]
]
},
},
mounted
()
{
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
},
},
methods
:
{
methods
:
{
beforeSearchFn
()
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
this
.
searchForm
.
activityId
=
this
.
routeInfo
.
id
this
.
searchForm
.
activityId
=
this
.
routeInfo
.
id
resolve
()
resolve
()
})
})
},
},
handleExport
()
{
handleExport
()
{
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
searchForm
)
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
searchForm
)
let
{
type
}
=
this
.
routeInfo
let
{
type
}
=
this
.
routeInfo
params
.
pageNum
=
1
params
.
pageNum
=
1
...
@@ -233,28 +296,36 @@ export default {
...
@@ -233,28 +296,36 @@ export default {
})
})
},
},
handleJump
(
path
,
row
=
{})
{
handleJump
(
path
,
row
=
{})
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
'/seckillActivity/crowdFundList'
path
:
'/seckillActivity/crowdFundList'
})
})
},
},
setTableFinishFun
()
{
setTableFinishFun
()
{
//接收到的数据为空
//接收到的数据为空
this
.
$refs
.
browserRef
.
data
.
length
?
(
this
.
$refs
.
browserRef
.
tableHeightValues
=
''
)
:
this
.
$refs
.
browserRef
.
setTableHeightFun
()
this
.
$refs
.
browserRef
.
data
.
length
?
(
this
.
$refs
.
browserRef
.
tableHeightValues
=
''
)
:
this
.
$refs
.
browserRef
.
setTableHeightFun
()
},
},
handleSearch
()
{
handleSearch
()
{
this
.
$refs
.
browserRef
.
refreshTable
()
this
.
$refs
.
browserRef
.
refreshTable
()
},
},
handleReset
()
{
handleReset
()
{
this
.
searchForm
=
{
this
.
searchForm
=
{
activityId
:
this
.
routeInfo
.
id
,
activityId
:
this
.
routeInfo
.
id
,
customerName
:
''
,
customerName
:
''
,
mobile
:
''
mobile
:
''
}
}
this
.
handleSearch
()
this
.
handleSearch
()
},
async
getTotal
(
apiName
,
activityId
)
{
const
{
total
}
=
await
apiName
({
pageSize
:
10
,
pageNum
:
1
,
activityId
})
this
.
total
=
total
}
}
}
}
}
}
...
...
src/views/seckillActivity/crowdFundList.vue
View file @
a71deae
...
@@ -2,55 +2,216 @@
...
@@ -2,55 +2,216 @@
<
template
>
<
template
>
<div
class=
"marketing"
>
<div
class=
"marketing"
>
<div
class=
"m-b-20"
>
<div
class=
"m-b-20"
>
<GLButton
:size=
"size"
class=
"default-blue-btn el-icon-plus"
type=
"default"
@
click=
"handleEdit('add')"
fn=
"新增众筹"
<GLButton
mode=
"el-button"
>
新建众筹
</GLButton>
:size=
"size"
class=
"default-blue-btn el-icon-plus"
type=
"default"
@
click=
"handleEdit('add')"
fn=
"新增众筹"
mode=
"el-button"
>
新建众筹
</GLButton>
<template
v-if=
"!hideStatus"
>
<template
v-if=
"!hideStatus"
>
<el-button
:size=
"size"
type=
"default"
class=
"default-blue-btn"
@
click=
"handleJump"
>
订单管理
</el-button>
<el-button
:size=
"size"
type=
"default"
class=
"default-blue-btn"
@
click=
"handleJump"
>
订单管理
</el-button>
</
template
>
</
template
>
<el-button
class=
"default-blue-btn"
:size=
"size"
type=
"default"
@
click=
"visibleImportDialog(true)"
>
批量导入活动
</el-button>
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
<GLCombiForm
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<div
class=
"flex m-b-10 w-100-percent"
>
<div
class=
"flex m-b-10 w-100-percent"
>
<span
class=
"table-title"
></span>
<span
class=
"table-title"
></span>
<
template
v-if=
"!hideStatus"
>
<
template
v-if=
"!hideStatus"
>
<el-button
:size=
"size"
class=
"default-blue-btn"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
<el-button
:size=
"size"
class=
"default-blue-btn"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
</
template
>
</
template
>
</div>
</div>
<!-- 表格区域 开始 -->
<!-- 表格区域 开始 -->
<single-gltable
ref=
"activity"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"tableSearchForm"
<single-gltable
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
ref=
"activity"
@
setTableFinishFun=
"setTableFinishFun"
>
:getListApi=
"getListApi"
<div
slot=
"activityImg"
class=
"table-image"
slot-scope=
"scope"
>
:noDataImg=
"url"
<el-popover
placement=
"top"
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
:searchForm=
"tableSearchForm"
<img
class=
"table-popover-img"
:src=
"scope.scope.activityImg"
/>
:tableParams=
"tableParams"
<img
class=
"img-60 pointer"
slot=
"reference"
:src=
"scope.scope.activityImg"
/>
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
@
setTableFinishFun=
"setTableFinishFun"
>
<div
slot=
"activityImg"
class=
"table-image"
slot-scope=
"scope"
>
<el-popover
placement=
"top"
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<img
class=
"table-popover-img"
:src=
"scope.scope.activityImg"
/>
<img
class=
"img-60 pointer"
slot=
"reference"
:src=
"scope.scope.activityImg"
/>
</el-popover>
</el-popover>
</div>
</div>
<div
slot=
"linkText"
slot-scope=
"scope"
>
<div
slot=
"linkText"
slot-scope=
"scope"
>
<
template
v-if=
"scope.scope.incrementFlag == 'Y' || hideStatus"
>
<
template
v-if=
"scope.scope.incrementFlag == 'Y' || hideStatus"
>
{{
scope
.
scope
[
scope
.
prop
]
||
0
}}
{{
scope
.
scope
[
scope
.
prop
]
||
0
}}
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<p
class=
"cursor-pointer"
@
click=
"handleDetail(scope)"
>
{{
scope
.
scope
[
scope
.
prop
]
||
0
}}
</p>
<p
class=
"cursor-pointer"
@
click=
"handleDetail(scope)"
>
{{
scope
.
scope
[
scope
.
prop
]
||
0
}}
</p>
</
template
>
</
template
>
</div>
</div>
<div
slot=
"joinText"
slot-scope=
"scope"
>
<div
<el-tooltip
effect=
"dark"
:content=
"formatterNumber(scope.scope, scope.prop)"
placement=
"top"
>
slot=
"joinText"
slot-scope=
"scope"
>
<el-tooltip
effect=
"dark"
:content=
"formatterNumber(scope.scope, scope.prop)"
placement=
"top"
>
<div
class=
"line-ellipsis"
>
{{ formatterNumber(scope.scope, scope.prop) }}
</div>
<div
class=
"line-ellipsis"
>
{{ formatterNumber(scope.scope, scope.prop) }}
</div>
</el-tooltip>
</el-tooltip>
</div>
</div>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<div
<GLTableButton
:buttonList=
"tableButtonList"
:buttonItem=
"scope.scope"
:buttonNum=
"3"
></GLTableButton>
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<GLTableButton
:buttonList=
"tableButtonList"
:buttonItem=
"scope.scope"
:buttonNum=
"3"
></GLTableButton>
</div>
</div>
</single-gltable>
</single-gltable>
<!-- 表格区域 end -->
<!-- 表格区域 end -->
</div>
</div>
<!-- 众筹分享 -->
<!-- 众筹分享 -->
<crowdFundingShare
:isShareVisible=
"isShareVisible"
:shareForm=
"shareForm"
@
handleShareClose=
"handleShareClose"
<crowdFundingShare
:hideStatus=
"hideStatus"
></crowdFundingShare>
:isShareVisible=
"isShareVisible"
:shareForm=
"shareForm"
@
handleShareClose=
"handleShareClose"
:hideStatus=
"hideStatus"
></crowdFundingShare>
<!-- 导入活动 -->
<GLDialog
mode=
"mid"
class=
"import-dialog"
title=
"批量导入活动"
:visible
.
sync=
"importVisible"
@
onCancel=
"importVisible = false"
@
onOk=
"importFun"
okText=
"提交"
>
<div
class=
"gl-form-page gl-form-min"
>
<el-form
ref=
"form"
label-width=
"154px"
>
<el-form-item
label=
"上传文件:"
required
>
<div
class=
"flex "
>
<el-input
v-model=
"file.fileName"
placeholder=
"请选择文件"
readonly
></el-input>
<div
class=
"import-button"
>
<el-button
class=
"default-btn"
:size=
"size"
type=
"default"
>
<i
class=
"el-icon-plus"
></i>
选择文件
<input
type=
"file"
class=
"upload-input"
accept=
".xlsx, .xls"
@
change=
"e => handleXlsxChange(e)"
ref=
"uploadInput"
/>
</el-button>
</div>
</div>
<el-button
type=
"text"
@
click=
"downloadXlsx()"
>
下载模版
</el-button>
</el-form-item>
</el-form>
</div>
</GLDialog>
<GLDialog
mode=
"small"
class=
"import-message-dialog"
title=
"提示"
:visible
.
sync=
"afterImportVisible"
>
<div
class=
"content flex"
>
<i
:class=
"[fileResponse.result?'el-icon-success':'el-icon-error']"
></i>
<
template
>
{{
fileResponse
.
result
?
'批量导入成功'
:
'导入失败'
}}
</
template
>
<div
class=
"text"
>
<
template
v-if=
"fileResponse.result"
>
总共批量创造
{{
fileResponse
.
count
}}
场活动
</
template
>
<
template
v-else
>
共导入失败
{{
fileResponse
.
count
}}
条数据,
<el-button
type=
"text"
@
click=
"downloadFailXlsx"
>
下载失败数据
</el-button>
</
template
>
</div>
</div>
<
template
#
footer
>
<el-button
type=
"primary"
size=
"small"
class=
"footer-btn"
@
click=
"afterImportVisible = false"
>
确定
</el-button>
</
template
>
</GLDialog>
</div>
</div>
</template>
</template>
...
@@ -265,7 +426,14 @@ export default {
...
@@ -265,7 +426,14 @@ export default {
}
}
]
]
},
},
hideStatus
:
true
hideStatus
:
true
,
importVisible
:
false
,
file
:
{
fileName
:
''
,
fileUrl
:
''
},
afterImportVisible
:
false
,
fileResponse
:
{}
}
}
},
},
...
@@ -538,9 +706,6 @@ export default {
...
@@ -538,9 +706,6 @@ export default {
query
:
params
query
:
params
})
})
},
},
test
(
option
)
{
console
.
log
(
JSON
.
parse
(
JSON
.
stringify
(
option
)))
},
// 明细
// 明细
handleDetail
({
prop
,
scope
})
{
handleDetail
({
prop
,
scope
})
{
let
data
=
{
let
data
=
{
...
@@ -671,13 +836,101 @@ export default {
...
@@ -671,13 +836,101 @@ export default {
str
.
push
(
key
!=
'activityGoodsStock'
?
(
e
[
key
]
/
100
).
toFixed
(
2
)
:
e
[
key
])
str
.
push
(
key
!=
'activityGoodsStock'
?
(
e
[
key
]
/
100
).
toFixed
(
2
)
:
e
[
key
])
})
})
return
str
.
length
>
0
?
str
.
join
(
','
)
:
'--'
return
str
.
length
>
0
?
str
.
join
(
','
)
:
'--'
},
handleXlsxChange
(
e
)
{
let
[
file
]
=
e
.
srcElement
.
files
,
reader
=
new
FileReader
()
if
(
!
file
)
return
this
.
$notify
({
title
:
'提示'
,
message
:
'文件上传中,请稍后'
})
// 默认1MB
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
el
=>
{
const
imgFile
=
el
.
target
.
result
,
[,
arrBase64
]
=
imgFile
.
split
(
','
),
splitStr
=
file
.
name
.
split
(
'.'
)
this
.
file
=
{
fileUrl
:
splitStr
.
at
(
-
1
)
+
'@'
+
arrBase64
,
fileName
:
file
.
name
}
this
.
$notify
({
title
:
'提示'
,
message
:
'上传文件成功'
,
type
:
'success'
})
}
},
async
importFun
()
{
let
{
file
:
{
fileUrl
,
fileName
}
}
=
this
,
loading
try
{
if
(
fileUrl
)
{
loading
=
this
.
$loading
({
lock
:
true
,
spinner
:
'el-icon-loading loading-class'
,
background
:
'rgba(255 255 255,.9)'
})
const
res
=
await
this
.
$apis
.
seckillActivity
.
importCrowdFundingActivity
({
file
:
fileUrl
})
if
(
res
)
{
const
{
successCount
,
errorCount
,
errorUrl
}
=
res
this
.
visibleImportDialog
()
this
.
fileResponse
=
{
result
:
errorUrl
?
false
:
true
,
count
:
errorUrl
?
errorCount
:
successCount
,
errorUrl
}
this
.
afterImportVisible
=
true
this
.
handleSearch
()
}
loading
.
close
()
}
else
throw
false
}
catch
(
error
)
{
loading
?.
close
()
this
.
$message
.
error
(
error
?
error
:
(
fileName
?
'文件上传中,请稍后'
:
'请上传文件后,再提交'
))
}
},
/**下载失败 */
downloadFailXlsx
()
{
let
{
errorUrl
}
=
this
.
fileResponse
this
.
downloadXlsx
(
errorUrl
,
'失败数据.xlsx'
)
},
downloadXlsx
(
link
=
''
,
name
=
''
)
{
console
.
log
(
link
,
name
)
var
alink
=
document
.
createElement
(
'a'
)
alink
.
href
=
link
||
'//img02.glsx.com.cn/weapp/resource/saas/scrm/xlsx/批量创建活动模版.xlsx'
alink
.
setAttribute
(
'target'
,
'_blank'
)
alink
.
download
=
name
||
'批量创建活动模版.xlsx'
alink
.
click
()
alink
.
remove
()
},
visibleImportDialog
(
val
=
false
)
{
if
(
this
.
$refs
?.
uploadInput
)
this
.
$refs
.
uploadInput
.
value
=
null
this
.
file
=
{
fileName
:
''
,
fileUrl
:
''
}
this
.
fileResponse
=
{}
this
.
importVisible
=
val
}
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
lang=
"scss"
scoped
>
.el-select
.el-select__tags
>
span
{
.el-select
.el-select__tags
>
span
{
display
:
flex
!important
;
display
:
flex
!important
;
width
:
80%
;
width
:
80%
;
}
}
...
@@ -691,4 +944,51 @@ export default {
...
@@ -691,4 +944,51 @@ export default {
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
}
}
.import-dialog
{
.el-dialog__body
{
height
:
70px
!important
;
min-height
:
70px
!important
;
max-height
:
70px
!important
;
}
.flex
{
width
:
398px
;
}
.import-button
{
position
:
relative
;
margin-left
:
10px
;
cursor
:
pointer
;
.upload-input
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
opacity
:
0
;
z-index
:
1
;
cursor
:
pointer
!important
;
}
}
}
.import-message-dialog
{
.content
{
height
:
100%
;
flex-direction
:
column
;
justify-content
:
center
;
color
:
#333333
;
font-size
:
16px
;
font-weight
:
400
;
line-height
:
24px
;
i
{
font-size
:
48px
;
color
:
rgb
(
233
,
75
,
81
);
margin-bottom
:
4px
;
}
.el-icon-success
{
color
:
rgb
(
53
,
202
,
119
);
}
}
.footer-btn
{
letter-spacing
:
2px
;
}
}
</
style
>
</
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