Commit a71deae6 by 前端

Merge branch 'saas+v4.22.1' into 'master'

合并Saas+v4.22.1

See merge request !64
2 parents 8fe502e6 0a2a7f56
......@@ -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 }
......@@ -879,4 +879,8 @@ ul li {
margin: 0;
list-style: none;
}
.loading-class{
font-size: 50px;
color: #5850ff !important;
}
\ No newline at end of file
......@@ -5,40 +5,96 @@
<p class="edit-title">{{ routeInfo.activityName }}</p>
<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="table-title">
已累计
<template v-if="routeInfo.type != 2">{{ decodeURI(routeInfo.name) }}</template>
<span>{{ routeInfo.count || 0 }}</span>
<span>{{total || routeInfo.count }}</span>
{{ routeInfo.type == 2 ? '位访客' : '次' }}
</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>
<!-- 表格区域 开始 -->
<GLTable 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">
<GLTable
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">
<el-popover placement="top" 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
placement="top"
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>
</template>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</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">
<el-popover placement="top" 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
placement="top"
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>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone }}</span>
</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>
{{
......@@ -53,8 +109,14 @@
<!-- 表格区域 end -->
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleJump">返回</el-button>
<div
class="footer"
:style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type="default"
@click="handleJump"
>返回</el-button>
</div>
</div>
</template>
......@@ -65,7 +127,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -122,49 +184,50 @@ export default {
width: 230
}
]
}
},
total: 0
}
},
created() {
created () {
const lastTableColumns = [
{
label: '浏览时长',
prop: 'browserTime'
},
{
label: '进入页面时间',
prop: 'operationDate',
width: '180'
},
{
label: '离开页面时间',
prop: 'leaveDate',
width: '180'
},
{
label: '订单状态',
prop: 'isBuy',
addHtml: 'isBuy'
}
],
{
label: '浏览时长',
prop: 'browserTime'
},
{
label: '进入页面时间',
prop: 'operationDate',
width: '180'
},
{
label: '离开页面时间',
prop: 'leaveDate',
width: '180'
},
{
label: '订单状态',
prop: 'isBuy',
addHtml: 'isBuy'
}
],
{ query } = this.$route,
name = {
1: '浏览',
2: '访客',
3: '分享'
}[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
this.routeInfo = query
this.getListApi = this.$apis.seckillActivity[
{
1: 'getBrowseListApi',
2: 'getVisitorListApi',
3: 'getSharedListApi'
}[query.type]
]
this.getListApi = apiName
if (query.type == 1) this.getTotal(apiName, query.id)
history.replaceState(null, null, `${url}&$title=${name}明细`)
// listName:
//1 浏览 2 访客 3 分享
......@@ -211,19 +274,19 @@ export default {
]
},
mounted() {
mounted () {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id
resolve()
})
},
handleExport() {
handleExport () {
var params = this.$common.utils.deepClone(this.searchForm)
let { type } = this.routeInfo
params.pageNum = 1
......@@ -233,28 +296,36 @@ export default {
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch() {
handleSearch () {
this.$refs.browserRef.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
mobile: ''
}
this.handleSearch()
},
async getTotal (apiName, activityId) {
const { total } = await apiName({
pageSize: 10,
pageNum: 1,
activityId
})
this.total = total
}
}
}
......
......@@ -2,55 +2,216 @@
<template>
<div class="marketing">
<div class="m-b-20">
<GLButton :size="size" class="default-blue-btn el-icon-plus" type="default" @click="handleEdit('add')" fn="新增众筹"
mode="el-button">新建众筹</GLButton>
<GLButton
:size="size"
class="default-blue-btn el-icon-plus"
type="default"
@click="handleEdit('add')"
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton>
<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>
<el-button
class="default-blue-btn"
:size="size"
type="default"
@click="visibleImportDialog(true)"
>批量导入活动</el-button>
</div>
<div class="container">
<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">
<span class="table-title"></span>
<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>
</div>
<!-- 表格区域 开始 -->
<single-gltable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm"
:tableParams="tableParams" :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" />
<single-gltable
ref="activity"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
: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>
</div>
<div slot="linkText" slot-scope="scope">
<div
slot="linkText"
slot-scope="scope"
>
<template v-if="scope.scope.incrementFlag == 'Y' || hideStatus">
{{ scope.scope[scope.prop] || 0 }}
</template>
<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>
</div>
<div slot="joinText" slot-scope="scope">
<el-tooltip effect="dark" :content="formatterNumber(scope.scope, scope.prop)" placement="top">
<div
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>
</el-tooltip>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div>
</single-gltable>
<!-- 表格区域 end -->
</div>
<!-- 众筹分享 -->
<crowdFundingShare :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"
:hideStatus="hideStatus"></crowdFundingShare>
<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>
</template>
......@@ -265,7 +426,14 @@ export default {
}
]
},
hideStatus: true
hideStatus: true,
importVisible: false,
file: {
fileName: '',
fileUrl: ''
},
afterImportVisible: false,
fileResponse: {}
}
},
......@@ -538,9 +706,6 @@ export default {
query: params
})
},
test (option) {
console.log(JSON.parse(JSON.stringify(option)))
},
// 明细
handleDetail ({ prop, scope }) {
let data = {
......@@ -671,13 +836,101 @@ export default {
str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key])
})
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>
<style>
.el-select .el-select__tags>span {
<style lang="scss" scoped>
.el-select .el-select__tags > span {
display: flex !important;
width: 80%;
}
......@@ -691,4 +944,51 @@ export default {
overflow: hidden;
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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!