Commit 8e8679ca by 杨明

fixed

1 parent 73271294
......@@ -16,7 +16,8 @@
"glsx-components": "^1.3.7",
"glsx-table": "^1.0.9",
"vue-draggable-resizable": "^2.3.0",
"vuedraggable": "^2.24.3"
"vuedraggable": "^2.24.3",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
......
......@@ -40,7 +40,7 @@ export default {
}
#app {
background: #f4f5fa;
padding: 0px 20px 20px 40px;
padding: 0px 20px 20px 20px;
position: absolute;
box-sizing: border-box;
width: 100%;
......
......@@ -9,69 +9,93 @@
import { http } from '@/main'
let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop'
const importsUpload = params => {
params.method = 'entmicro.api.imports.upload'
params.sessionId = session
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'entmicro.api.imports.upload'
params.sessionId = session
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const downloadModel = params => {
params.method = 'entmicro.api.imports.download.model'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'entmicro.api.imports.download.model'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantConfig = params => {
params.method = 'entmicro.api.datacube.merchant.config'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const datacubeUpload = params => {
params.method = 'entmicro.api.datacube.upload'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsRecord = params => {
params.method = 'entmicro.api.imports.record.page'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'entmicro.api.datacube.log.page'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsCount = params => {
params.method = 'entmicro.api.imports.count'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'entmicro.api.imports.count'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsKey = params => {
params.method = 'entmicro.api.imports.record.key'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'entmicro.api.imports.record.key'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const findLoginCount = params => {
params.method = 'entmicro.api.common.findLoginCount'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'entmicro.api.common.findLoginCount'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
importsUpload,
downloadModel,
importsRecord,
importsCount,
importsKey,
findLoginCount
}
\ No newline at end of file
importsUpload,
downloadModel,
importsRecord,
importsCount,
importsKey,
findLoginCount,
datacubeUpload,
merchantConfig
}

644 Bytes | W: | H:

527 Bytes | W: | H:

src/assets/img/question.png
src/assets/img/question.png
src/assets/img/question.png
src/assets/img/question.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -151,7 +151,7 @@ export default {
// IE < 9
document.selection.createRange().pasteHTML(html)
}
this.currentText = document.querySelector('.w-textarea_input').innerHTML.replaceAll('<wise id="1">@昵称</wise>', '@昵称').replaceAll('<br>', '\n')
this.currentText = document.querySelector('.w-textarea_input').innerHTML
this.$emit('updateText', this.currentText)
},
addTag(text) {
......
......@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
return new Http({ request: { timeout: 100000 } }).get('https://oss-config.test.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
// return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
}
export const config = {
......
......@@ -11,10 +11,15 @@ import Vue from 'vue'
import apis from './api'
import './public-path'
import './components'
import filters from './utils/filters'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
//过滤器统一处理预加载
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
......
......@@ -24,7 +24,7 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: 'scrm-base-dae97168-46da-4484-8386-f33fb5844878-rop' } })
Vue.prototype.$http_tag = new common.Http({ response, request: request_tag, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
const routesData = common.utils.deepClone(globalState.routers)
......
export default {
namespaced: true,
state: {
importData: {
}
importData: {},
uploadInfo: null
},
mutations: {
SET_IMPORT(state, data) {
state.importData = data
},
SET_UPLOAD_INFO(state, data) {
state.uploadInfo = data
}
},
actions: {
setImport({ commit }, data) {
commit('SET_IMPORT', data)
},
setUploadInfo({ commit }, data) {
commit('SET_UPLOAD_INFO', data)
}
}
}
//过滤器
/* eslint-disable */
const overThousandFilter = val => {
if (typeof val != 'number') {
return 0
}
if (val < 1000) return val
let a = val + ''
let b = a.split('')
b.splice(-3, 0, ',')
return b.join('')
}
export default {
overThousandFilter
}
......@@ -79,6 +79,18 @@ util.openUrl = function(url) {
link.rel = 'opener'
link.click()
}
util.downloadUrl = function(url) {
const link = document.createElement('a')
link.href = url
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
util.getArrayIsSubset = (arr1, arr2) => {
return arr1.every(item => {
return arr2.includes(item)
})
}
util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
......
<template>
<div>
<div class="form-header">
{{aaaa}}
<GLButton type="primary" size="small" icon="el-icon-add" @click="handleAddCode" fn="新增活码">新建渠道活码</GLButton>
</div>
<div class="form-panel scrm-box-f">
......
......@@ -192,7 +192,7 @@ export default {
},
methods: {
jumpUrl() {
this.$history.push('/settings/followUp/index')
this.$history.push('/home/followUp/index')
},
getFollower() {
var params = {
......
......@@ -7,7 +7,7 @@
<div class="drainage-config-wrap">
<div class="drainage-item-label" v-if="configType">平台将识别尚未补充联系方式的企微客户,并自动发送消息提醒对应员工跟进。</div>
<div class="drainage-item-label" v-else>通过企微魔方导入客户数据后,平台将识别尚未添加企微的客户,并自动发送消息提醒对应员工跟进。</div>
<div class="drainage-item-label" v-else>通过数据魔方导入客户数据后,平台将识别尚未添加企微的客户,并自动发送消息提醒对应员工跟进。</div>
<div class="drainage-item-switch">
<el-switch v-model="addValue" @change="handleAddSwitch" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div>
......@@ -337,7 +337,7 @@ export default {
})
}
}
</script>
</script>
<style lang="scss" scoped>
.footer-panel {
......@@ -539,4 +539,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -2,7 +2,7 @@
<div class="overview-main">
<div class="overview-header">
<span>引流获客概览</span>
<el-popover placement="top" width="400" trigger="hover" content="引流获客通过整合活码营销、企微魔方,可分别针对到店用户及离店用户提供企微线上化方案。帮助门店迅速的形成企微客户池,为后续营销活动搭建起稳定高频的触达通道。">
<el-popover placement="top" width="400" trigger="hover" content="引流获客通过整合活码营销、数据魔方,可分别针对到店用户及离店用户提供企微线上化方案。帮助门店迅速的形成企微客户池,为后续营销活动搭建起稳定高频的触达通道。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</div>
......@@ -41,7 +41,7 @@
<div class="store-item">
<div class="store-item-s">
<div class="store-item-title">离店用户线上化</div>
<el-button type="primary" size="small" @click="jumpSquare">企微魔方</el-button>
<el-button type="primary" size="small" @click="jumpSquare">数据魔方</el-button>
</div>
<div class="store-item-s">
<div class="store-item-icon">
......@@ -115,7 +115,7 @@ export default {
},
methods: {
jumpUrl() {
this.$router.push('/square/import')
this.$router.push('/square/import')
},
jumpChannel() {
this.$router.push('/channel/index')
......@@ -124,9 +124,9 @@ export default {
this.$router.push('/square/import')
},
viewChart() {
this.loading = true;
this.loading = true
this.$apis.overview.viewChart({}).then(res => {
this.loading = false;
this.loading = false
this.entMicroCount = res.entMicroCount
this.totalCount = res.totalCount
this.$refs.customerForm.getChart(res.trendItemList)
......@@ -138,7 +138,7 @@ export default {
this.viewChart()
}
}
</script>
</script>
<style lang="scss" scoped>
.overview-header {
......@@ -284,4 +284,4 @@ export default {
font-size: 15px !important;
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="import-main">
<div class="upload-container">
<div class="upload-item" v-for="(item, index) in fileList" :key="item">
<div class="upload-label">
<label v-if="item.flag">*</label>
{{ item.templateName }}:
</div>
<div class="upload-desc">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
{{ item.fileName ? '上传文件' : '更换文件' }}
</el-button>
<input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile($event, item, index)" />
</div>
<a :href="item.templateUrl">下载模板</a>
<div class="upload-tips" v-if="!item.fileName && !item.fileUrl">支持扩展名:xlsx、xls</div>
<div class="upload-tips" v-if="item.fileUrl">
<i class="el-icon-success"></i>
文件格式正确({{ item.fileName }})
</div>
<div class="upload-tips" v-if="item.fileName && !item.fileUrl">
<i class="el-icon-error"></i>
文件格式错误,请更换文件({{ item.fileName }})
</div>
</div>
</div>
<div class="upload-item">
<div class="upload-label">
备注:
</div>
<div class="upload-desc">
<el-input type="textarea" maxlength="50" :rows="6" placeholder="为本次导入的数据添加备注" v-model="remarks"></el-input>
</div>
</div>
<div class="upload-item">
<div class="upload-label">
跟进人
<el-popover placement="top" width="400" trigger="hover" content="用户点击短信中的链接后,将自动分配以下某位员工的企微名片,客户添加好友将自动回复后台所配置的欢迎语。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
:
</div>
<div class="upload-desc">
<div style="position: relative">
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<div class="el-input-tag input-tag-wrapper" v-show="staffIdList.length">
<el-tag effect="plain" type="info" v-for="(tag, idx) in staffIdList" :key="idx" closable :disable-transitions="false" @close="remove(idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</div>
<select-emp ref="selectEmpForm" @selectTable="selectTable"></select-emp>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import util from '@/utils/util'
import selectEmp from '@/components/selectEmp'
export default {
name: 'step-first',
props: {},
components: {
selectEmp
},
data() {
return {
staffIdList: [],
tabelHeader: [],
tabelHeaderModel: [],
fileList: [],
remarks: ''
}
},
mounted() {
this.merchantConfig()
},
methods: {
async merchantConfig() {
const fileList = await this.$apis.square.merchantConfig({})
this.fileList = fileList.map(item => {
return {
size: '',
flag: parseInt(item.mustUpload),
fileName: '',
templateName: item.templateName,
fileUrl: '',
templateUrl: item.templateUrl,
BusinessTypeId: item.businessType,
businessTypeName: item.businessName
}
})
console.log(fileList)
this.readWorkbookFromRemoteFile()
},
getUploadInfo() {
for (let f of this.fileList) {
if (!f.fileName && f.flag) {
this.$message.error('请上传' + f.templateName)
return false
}
if (!f.fileUrl && f.fileName) {
this.$message.error(f.templateName + '文件格式错误,请更换文件')
return false
}
}
const staffIdList = this.staffIdList.map(item => {
return item.staffId
})
return {
fileList: this.fileList,
remarks: this.remarks,
staffIdList
}
},
getDownloadModel() {
this.$apis.square.downloadModel({}).then(res => {
console.log(res)
})
},
// 从网络上读取某个excel文件,url必须同域,否则报错
async readWorkbookFromRemoteFile() {
for (let f of this.fileList) {
try {
let tabelHeaderArr = await this.getTabelHeaderModel(f.templateUrl)
this.tabelHeaderModel.push(tabelHeaderArr)
} catch (error) {
this.$message.error('读取失败')
}
}
},
getTabelHeaderModel(model_url) {
const _this = this
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest()
xhr.open('get', model_url, true)
xhr.responseType = 'arraybuffer'
xhr.onload = function(e) {
if (xhr.status == 200) {
var datat = new Uint8Array(xhr.response)
var workbook = XLSX.read(datat, { type: 'array' })
const wsname = workbook.SheetNames[0]
const ws = workbook.Sheets[wsname]
/* 数组转换 */
const data = _this.getHeaderRow(ws)
resolve(data)
} else {
reject()
}
}
xhr.send()
})
},
getHeaderRow(sheet) {
const headers = []
/* sheet['!ref']表示所有单元格的范围,例如从A1到F8则记录为 A1:F8*/
const range = XLSX.utils.decode_range(sheet['!ref'])
let C,
R = range.s.r /* 从第一行开始 */
/* 按列进行数据遍历 */
for (C = range.s.c; C <= range.e.c; ++C) {
/* 查找第一行中的单元格 */
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
let hdr = 'UNKNOWN ' + C // <-- 进行默认值设置
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
if (!hdr.includes('UNKNOWN')) {
headers.push(hdr)
}
}
return headers
},
compareHeader(file) {
return new Promise(resolve => {
const reader = new FileReader()
reader.onload = event => {
/* 解析数据 */
const bstr = event.target.result
const wb = XLSX.read(bstr, { type: 'binary' })
/* 获取文件的第一个工作表(WorkSheet) */
const wsname = wb.SheetNames[0]
const ws = wb.Sheets[wsname]
const data = this.getHeaderRow(ws)
resolve(data)
}
reader.readAsBinaryString(file)
})
},
async uploadFile(e, uploadItem, index) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
console.log(extName)
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = file.size / 1024 / 1024
if (size > 30) {
this.$message.error('单文件体积需小于30M')
return
}
const header = await this.compareHeader(file)
console.log(header, this.tabelHeaderModel[index])
if (util.getArrayIsSubset(header, this.tabelHeaderModel[index])) {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileInfo = file.name.split('.')[1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
uploadItem.fileUrl = res
uploadItem.size = size
uploadItem.fileName = file.name
this.$refs.file.value = ''
})
}
} else {
uploadItem.fileName = file.name
}
// // 转码base64
},
// uploadFile(e, uploadItem, index) {
// const file = e.srcElement.files[0]
// let AllImgExt = '.xls|.xlsx'
// let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
// console.log(extName)
// if (AllImgExt.indexOf(extName) === -1) {
// this.$message.error('上传格式不正确')
// return false
// }
// const size = file.size / 1024 / 1024
// if (size > 30) {
// this.$message.error('单文件体积需小于30M')
// return
// }
// const reader = new FileReader(file)
// reader.onload = event => {
// /* 解析数据 */
// const bstr = event.target.result
// const wb = XLSX.read(bstr, { type: 'binary' })
// /* 获取文件的第一个工作表(WorkSheet) */
// const wsname = wb.SheetNames[0]
// const ws = wb.Sheets[wsname]
// /* 数组转换 */
// const data = XLSX.utils.sheet_to_json(ws, { header: 1 })
// /* 进行表格数据更新 */
// uploadItem.fileName = file.name
// if (data && data.length > 0 && util.getArrayIsSubset(data[0], this.tabelHeaderModel[index])) {
// const arrBase64 = bstr.split(',')
// const fileInfo = file.name.split('.')[1] + '@' + arrBase64[1]
// this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
// uploadItem.fileUrl = res
// uploadItem.size = size
// this.$refs.file.value = ''
// })
// }
// /* 进行表格表头数据更新 */
// this.getHeaderRow(ws)
// }
// reader.readAsBinaryString(file)
// },
uploadFileSuccess(e) {
let AllImgExt = '.xls|.xlsx'
let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
console.log(extName)
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = e.size / 1024 / 1024
if (size < 9) {
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileInfo = e.name.split('.')[1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
this.fileInfo = res
this.importName = e.name
this.$refs.file.value = ''
})
}
} else {
this.$message.error('上传文件不可超过9M')
}
},
//选择员工
handleAddEmp() {
this.$refs.selectEmpForm.init(this.staffIdList)
},
selectTable(item) {
this.staffIdList = item.map(item => {
return {
staffId: item.relationId,
staffName: item.staffName
}
})
},
remove(index) {
this.staffIdList.splice(index, 1)
}
}
}
</script>
<style lang="scss" scoped>
.import-main {
margin: 60px auto 0px;
width: 92%;
.upload-item {
display: flex;
margin-top: 30px;
.upload-label {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
min-width: 100px;
text-align: right;
label {
color: #eb4e4e;
}
img {
width: 14px;
height: 14px;
vertical-align: middle;
}
}
.upload-desc {
margin-top: -6px;
.upload-btn {
position: relative;
display: inline-block;
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
/deep/ .el-textarea {
width: 500px;
}
a {
color: #5850ff;
margin-left: 10px;
vertical-align: text-bottom;
}
.upload-tips {
margin-top: 6px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
i {
color: #2cca74;
&.el-icon-error {
color: #eb4e4e;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 500px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
}
}
}
</style>
<template>
<div class="import-main">
<div class="upload-process">
<div class="upload-process-item" v-for="item in process" :key="item">
<div class="process-item-label">
<label>*</label>
{{ item.templateName }}:
</div>
<div class="process-item-info">
<div class="process-item-size">
<img src="@/assets/img/Excel.png" alt="" />
文件大小:{{ item.size }}M
</div>
<div class="process-item-name">{{ item.fileName }}</div>
<div class="process-item-num">
<el-progress :show-text="false" :stroke-width="6" :percentage="item.percentage" :color="item.percentage != 100 ? '#5850FF' : '#2CCA74'"></el-progress>
<div class="process-num-status" v-if="item.percentage > 0">上传中</div>
<div class="process-num-status process-refresh" v-if="item.percentage == 0">
重试
<i class="el-icon-refresh-right"></i>
</div>
<div class="process-num-status" v-if="item.percentage == 100"><i class="el-icon-success"></i></div>
</div>
</div>
</div>
</div>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
<div class="dialog-body">
<div class="dialog-tips-icon"><i class="el-icon-warning"></i></div>
<div class="dialog-tips-text">点击继续将开始上传数据文件</div>
<div class="dialog-tips-text">
<span>期间请勿关闭页面</span>
,是否继续吗?
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">
取 消
</el-button>
<el-button size="small" type="primary" @click="handleSure">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'step-second',
props: {},
data() {
return {
dialogVisible: false,
setInter: null,
process: [{ percentage: 0 }, { percentage: 0 }, { percentage: 0 }],
uploadItem: ''
}
},
mounted() {},
beforeDestroy() {
clearInterval(this.setInter)
},
methods: {
handleSure() {
this.datacubeUpload()
this.dialogVisible = false
},
startUpload(item, info) {
this.uploadItem = info
this.process = item.map(p => {
return {
percentage: 0,
fileName: p.fileName,
templateName: p.templateName,
size: p.size.toFixed(2)
}
})
this.dialogVisible = true
},
datacubeUpload() {
this.uploadItem.fileList = this.uploadItem.fileList.filter(item => item.fileUrl)
this.uploadItem.createdStaffId = this.$globalState.session.id
this.$apis.square.datacubeUpload(this.uploadItem).then(res => {
if (res) {
const result = res.failFile
this.process.forEach(p => {
p.percentage = Math.random() * 30
})
this.setInter = setInterval(this.addProcess, 1000)
let resultNum = 0
result.forEach((item, index) => {
if (item.uploadSuccess == 0) {
this.process[index].percentage = 100
resultNum++
} else {
this.process[index].percentage = 0
}
if (resultNum == result.length) {
this.$emit('handleSuccess')
}
})
}
clearInterval(this.setInter)
})
},
addProcess() {
this.process.forEach(p => {
p.percentage = p.percentage > 90 ? p.percentage : p.percentage + Math.random() * 5
})
}
}
}
</script>
<style lang="scss" scoped>
.import-main {
margin: 60px auto 0px;
width: 92%;
.upload-process {
&-item {
display: flex;
margin-bottom: 20px;
width: 40vw;
.process-item-label {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
label {
color: #eb4e4e;
}
}
.process-item-info {
flex: 1;
}
.process-item-size {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
img {
width: 24px;
}
}
.process-item-name {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 22px;
margin-top: 6px;
}
.process-item-num {
margin-top: 8px;
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
line-height: 22px;
/deep/ .el-progress {
flex: 1;
margin-right: 6px;
}
.process-num-status {
width: 60px;
&.process-refresh {
cursor: pointer;
}
i {
color: #2cca74;
font-size: 14px;
&.el-icon-refresh-right {
color: #8c8c8c;
}
}
}
}
}
}
.dialog-body {
text-align: center;
margin: 10px 0px;
.dialog-tips-icon {
margin-bottom: 12px;
i {
color: #5850ff;
font-size: 32px;
}
}
.dialog-tips-text {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
span {
color: #eb4e4e;
}
}
}
.dialog-footer {
text-align: center;
}
}
</style>
<template>
<div class="import-main">
<div class="import-success">
<div class="import-success-image">
<i class="el-icon-success"></i>
</div>
<div class="import-success-desc">上传完成</div>
<div class="import-success-content">数据中心已成功接收到数据,数据处理完毕后将发送企微通知。</div>
<div class="import-success-content">届时请回到【引流获客】-【企微魔方】查看分析结果</div>
</div>
</div>
</template>
<script>
export default {
name: 'step-third',
props: {},
data() {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.import-main {
padding: 30px;
width: 80%;
margin: 0 auto;
border: 1px solid #e8e8ea;
}
.import-success {
text-align: center;
.el-icon-success {
font-size: 60px;
color: #2cca74;
}
&-desc {
font-size: 24px;
font-weight: 500;
color: #333333;
line-height: 32px;
margin: 20px 0px 10px;
}
&-content {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
opacity: 0.45;
}
}
</style>
......@@ -207,8 +207,7 @@
</div>
</div>
</div>
<GLFooter
>
<GLFooter>
<el-button type="primary" @click="handleSave" v-if="editStatus">提交</el-button>
<el-button @click="goback">取消</el-button>
</GLFooter>
......@@ -339,7 +338,7 @@ export default {
},
watch: {
'addForm.content': {
handler: function () {
handler: function() {
this.content = []
if (this.addForm.content) {
let str = this.addForm.content
......@@ -353,7 +352,7 @@ export default {
}
},
'addForm.tagging': {
handler: function () {
handler: function() {
this.taggingLength = 0
if (this.addForm.tagging) {
this.addForm.tagging.forEach(item => {
......@@ -589,13 +588,13 @@ export default {
})
}
})
},
}
},
mounted() {
this.findConfig()
}
}
</script>
</script>
<style lang="scss" scoped>
.channel-main-welcome {
......@@ -1061,4 +1060,4 @@ export default {
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
\ No newline at end of file
</style>
<template>
<div class="squre-main">
<el-button type="primary" size="small" @click="goBack">返回</el-button>
<div class="squre-title">
企微魔方
数据魔方
<span>智能分析客户数据,自动人群分类,推荐策略。</span>
</div>
<div class="squre-safe-panel scrm-box-f" v-loading="loading">
<div class="squre-safe-panel scrm-box-f" v-loading="loading" :style="{ 'min-height': boxHeight + 'px' }">
<div class="dialog-step">
<div class="el-steps el-steps--horizontal">
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div class="el-step__head is-finish">
<div class="el-step__line" style="margin-right: 0px">
<div :class="['el-step__line', activeIndex > 1 ? 'is-finish' : '']" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: 0ms; border-width: 0px; width: 0%"></i>
</div>
<div class="el-step__icon is-text">
<div class="el-step__icon-inner"><i class="el-icon-check"></i></div>
<div :class="['el-step__icon', activeIndex == 1 ? 'is-text' : '']">
<div class="el-step__icon-inner" v-if="activeIndex > 1"><i class="el-icon-check"></i></div>
<div class="el-step__icon-inner" v-else>1</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title">导入信息</div>
<div class="el-step__title">数据脱敏</div>
<div :class="['el-step__title', activeIndex == 1 ? 'is-finish' : '']">第一步</div>
<div :class="['el-step__sub', activeIndex == 1 ? 'is-finish' : '']">选择数据文件</div>
</div>
</div>
</div>
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div class="el-step__head is-finish">
<div class="el-step__line" style="margin-right: 0px">
<div :class="['el-step__head', activeIndex > 1 ? 'is-finish' : '']">
<div :class="['el-step__line', activeIndex > 2 ? 'is-finish' : '']" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: -150ms; border-width: 0px; width: 0%"></i>
</div>
<div class="el-step__icon is-text">
<div :class="['el-step__icon', activeIndex == 2 ? 'is-text' : '']">
<!---->
<div class="el-step__icon-inner">2</div>
<div class="el-step__icon-inner" v-if="activeIndex > 2"><i class="el-icon-check"></i></div>
<div class="el-step__icon-inner" v-else>2</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title">智能识别</div>
<div class="el-step__title">自动归类</div>
<div :class="['el-step__title', activeIndex == 2 ? 'is-finish' : '']">第二步</div>
<div :class="['el-step__sub', activeIndex == 2 ? 'is-finish' : '']">上传数据文件</div>
</div>
</div>
</div>
<div class="el-step is-horizontal is-flex" style="flex-basis: 50%; max-width: 33.3333%">
<div class="el-step__head">
<div :class="['el-step__head', activeIndex > 2 ? 'is-finish' : '']">
<div class="el-step__line"><i class="el-step__line-inner"></i></div>
<div class="el-step__icon is-text">
<div :class="['el-step__icon', activeIndex == 3 ? 'is-text' : '']">
<!---->
<div class="el-step__icon-inner">3</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title is-wait">集客引流</div>
<div class="el-step__title is-wait">策略推荐</div>
<div :class="['el-step__title', activeIndex == 3 ? 'is-finish' : '']">第三步</div>
<div :class="['el-step__sub', activeIndex == 3 ? 'is-finish' : '']">完成</div>
</div>
</div>
</div>
</div>
</div>
<div class="safe-upload-panel" id="drop_area">
<div class="image-uploader">
<input type="file" style="opacity: 0" ref="file" accept="*" @change="changeInput" />
<div class="safe-upload-icon"><i class="el-icon-tickets"></i></div>
</div>
<div class="safe-upload-tips">点击或将文件拖拽到这里{{ importName ? '重新' : '' }}上传</div>
<div class="safe-upload-xl" v-if="importName">{{ importName }}</div>
<div class="safe-upload-xl">支持扩展名:.xls .xlsx</div>
<div class="safe-upload-link" @click="downloadModel">下载模版</div>
</div>
<div class="safe-upload-footer">
<el-button type="primary" size="small" @click="handleSubmit">提交</el-button>
</div>
</div>
<div class="squre-safe-panel scrm-box-f">
<div class="squre-safe-title">数据隐私&安全</div>
<div class="swiper-container">
<div class="swiper-wrap">
<div class="swiper-wrap-item" :class="{ checked: active == index + 1 }" :key="index" v-for="(item, index) in swiperList" @mouseenter="setActiveItem(index)" @mouseleave="autoplay = true">{{ item }}</div>
</div>
<el-carousel @change="changeItem" ref="carousel" @mouseenter.native="delHandleMouseEnter" :autoplay="autoplay">
<el-carousel-item>
<div class="swiper-container-panel">
<div class="swiper-container-content">数据传输阶段是数据从一个实体传输到另一个实体的阶段。平台使用企业级安全证书来加密通讯数据,防止发生中间人攻击。</div>
<div class="swiper-container-image">
<img src="@/assets/img/square/safe1.png" />
</div>
</div>
</el-carousel-item>
<el-carousel-item>
<div class="swiper-container-panel">
<div class="swiper-container-content">从海量数据中发现、分类和保护敏感数据,分析使用情况并进行风险预警,帮助用户防止数据泄漏和满足GDPR等合规要求</div>
<div class="swiper-container-image">
<img src="@/assets/img/square/safe2.png" />
</div>
</div>
</el-carousel-item>
<el-carousel-item>
<div class="swiper-container-panel">
<div class="swiper-container-content">对核心业务数据中敏感的信息,进行变形、转换、混淆,使得对业务数据中的身份、组织等隐私敏感信息进行去除或掩盖,以保护数据能被合理、安全地利用。</div>
<div class="swiper-container-image">
<img src="@/assets/img/square/safe3.png" />
</div>
</div>
</el-carousel-item>
<el-carousel-item>
<div class="swiper-container-panel">
<div class="swiper-container-content">通过基于组织的数据安全需求和合规性要求建立身份鉴别和数据访问控制机制,防止对数据的未授权访问风险。</div>
<div class="swiper-container-image">
<img src="@/assets/img/square/safe4.png" />
</div>
</div>
</el-carousel-item>
</el-carousel>
<div class="upload-list">
<!-- <component :is="stepName"></component> -->
<step-first v-show="stepName == 'stepFirst'" ref="firstForm"></step-first>
<step-second v-show="stepName == 'stepSecond'" ref="secondForm" @handleSuccess="handleSuccess"></step-second>
<step-third v-show="stepName == 'stepThird'" ref="thirdForm"></step-third>
</div>
</div>
<GLFooter>
<el-button type="primary" @click="handleNext" v-show="activeIndex == 1">下一步</el-button>
<el-button type="primary" @click="$router.go(-1)" v-show="activeIndex == 3">返回魔方</el-button>
</GLFooter>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import stepFirst from './components/step-first.vue'
import stepSecond from './components/step-second.vue'
import stepThird from './components/step-third.vue'
export default {
components: { stepFirst, stepSecond, stepThird },
name: 'import',
data() {
return {
boxHeight: 0,
swiperList: ['加密传输', '脱敏传输', '去标识化', '限制访问'],
autoplay: true,
loading: false,
......@@ -126,10 +86,56 @@ export default {
imgArr: [],
fileData: [],
fileInfo: '',
activeIndex: 1,
staffIds: [],
active: 1
}
},
computed: {
stepName() {
let status = ''
switch (this.activeIndex) {
case 1:
status = 'stepFirst'
break
case 2:
status = 'stepSecond'
break
case 3:
status = 'stepThird'
break
}
return status
}
},
methods: {
// 从网络上读取某个excel文件,url必须同域,否则报错
readWorkbookFromRemoteFile() {
var xhr = new XMLHttpRequest()
xhr.open('get', 'https://img01.glsx.com.cn/upload/biz/魔方导入模板v1_0_2_20210117_1.xlsx', true)
xhr.responseType = 'arraybuffer'
xhr.onload = function(e) {
if (xhr.status == 200) {
var data = new Uint8Array(xhr.response)
var workbook = XLSX.read(data, { type: 'array' })
var tabelHeader = ''
for (var sheet in workbook.Sheets) {
if (workbook.Sheets.hasOwnProperty(sheet)) {
tabelHeader = XLSX.utils.sheet_to_json(workbook.Sheets[sheet])
// break; // 若是只取第一张表,就取消注释这行
}
}
if (tabelHeader && tabelHeader.length > 0) {
this.tabelHeaderTwo = Object.keys(tabelHeader[0])
}
console.log(this.tabelHeaderTwo)
}
}
xhr.send()
},
handleSuccess() {
this.activeIndex = 3
},
changeItem(e) {
this.active = e + 1
},
......@@ -141,60 +147,121 @@ export default {
delHandleMouseEnter() {
this.$refs.carousel.handleMouseEnter = () => {}
},
goBack() {
this.$router.go(-1)
},
downloadModel() {
this.$apis.square.downloadModel({}).then(res => {
if (res) {
const link = document.createElement('a')
link.setAttribute('href', res) //设置下载文件的url地址
//link.setAttribute('download', 'download'); //用于设置下载文件的文件名
link.click()
}
})
},
enentDrop(e) {
this.borderhover = false
e.stopPropagation()
e.preventDefault() //必填字段
let fileData = e.dataTransfer.files
if (fileData && fileData[1]) {
this.$message.error('只能上次一个文件')
return
handleNext() {
const uploadInfo = this.$refs.firstForm.getUploadInfo()
if (uploadInfo) {
this.activeIndex++
const fileList = uploadInfo.fileList.filter(item => item.fileUrl)
this.$refs.secondForm.startUpload(fileList, uploadInfo)
}
console.log(fileData[1])
this.uploadFile(fileData[0])
},
changeInput(e) {
this.uploadFile(e.target.files[0])
},
uploadFile(e) {
let AllImgExt = '.xls|.xlsx'
let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
console.log(extName)
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = e.size / 1024 / 1024
if (size < 9) {
// // 转码base64
readExcel(file) {
// 解析Excel
let _this = this
return new Promise(function(resolve, reject) {
// 返回Promise对象
const reader = new FileReader()
reader.readAsDataURL(e)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileInfo = e.name.split('.')[1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
this.fileInfo = res
this.importName = e.name
this.$refs.file.value = ''
})
reader.onload = e => {
// 异步执行
try {
// 以二进制流方式读取获得整份excel表格对象
var data = e.target.result,
workbook = XLSX.read(data, { type: 'binary' })
} catch (e) {
reject(e.message)
}
// 表格的表格范围,可用于判断表头是否数量是否正确
var fromTo = ''
// 遍历每张表读取
for (var sheet in workbook.Sheets) {
let sheetInfos = workbook.Sheets[sheet]
let locations = [] // A1,B1,C1...
if (workbook.Sheets.hasOwnProperty(sheet)) {
fromTo = sheetInfos['!ref'] // A1:B5
locations = _this.getLocationsKeys(fromTo)
}
for (let i = 0; i < locations.length; i++) {
let value = sheetInfos[locations[i]].v
if (value != i) {
// 自定的校验规则,自由实现便可
// 校验失败reject
reject(locations[i] + "'s parameter isn't " + i)
}
}
// 校验成功resolve
resolve(true)
}
}
reader.readAsBinaryString(file)
})
},
getHeaderRow(sheet) {
const headers = []
/* sheet['!ref']表示所有单元格的范围,例如从A1到F8则记录为 A1:F8*/
const range = XLSX.utils.decode_range(sheet['!ref'])
let C,
R = range.s.r /* 从第一行开始 */
/* 按列进行数据遍历 */
for (C = range.s.c; C <= range.e.c; ++C) {
/* 查找第一行中的单元格 */
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
let hdr = 'UNKNOWN ' + C // <-- 进行默认值设置
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
headers.push(hdr)
}
return headers
},
uploadFile(file) {
const reader = new FileReader()
reader.onload = e => {
/* 解析数据 */
const bstr = e.target.result
const wb = XLSX.read(bstr, { type: 'binary' })
/* 获取文件的第一个工作表(WorkSheet) */
const wsname = wb.SheetNames[0]
const ws = wb.Sheets[wsname]
/* 数组转换 */
const data = XLSX.utils.sheet_to_json(ws, { header: 1 })
/* 进行表格数据更新 */
if (data && data.length > 0) {
this.tabelHeader = data[0]
}
} else {
this.$message.error('上传文件不可超过9M')
/* 进行表格表头数据更新 */
this.getHeaderRow(ws)
}
reader.readAsBinaryString(file)
// let AllImgExt = '.xls|.xlsx'
// let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
// console.log(extName)
// if (AllImgExt.indexOf(extName) === -1) {
// this.$message.error('上传格式不正确')
// return false
// }
// const size = e.size / 1024 / 1024
// if (size < 9) {
// // // 转码base64
// const reader = new FileReader()
// reader.readAsDataURL(e)
// reader.onload = event => {
// const imgFile = event.target.result
// const arrBase64 = imgFile.split(',')
// const fileInfo = e.name.split('.')[1] + '@' + arrBase64[1]
// this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
// this.fileInfo = res
// this.importName = e.name
// this.$refs.file.value = ''
// })
// }
// } else {
// this.$message.error('上传文件不可超过9M')
// }
},
handleSubmit() {
if (!this.fileInfo) {
......@@ -212,27 +279,12 @@ export default {
}
},
mounted() {
let _this = this
var dropbox = document.getElementById('drop_area')
dropbox.addEventListener('drop', this.enentDrop, false)
dropbox.addEventListener('dragleave', function (e) {
e.stopPropagation()
e.preventDefault()
_this.borderhover = false
})
dropbox.addEventListener('dragenter', function (e) {
e.stopPropagation()
e.preventDefault()
_this.borderhover = true
})
dropbox.addEventListener('dragover', function (e) {
e.stopPropagation()
e.preventDefault()
_this.borderhover = true
})
let clientHeight = document.documentElement.clientHeight
this.boxHeight = clientHeight - 280
// this.readWorkbookFromRemoteFile()
}
}
</script>
</script>
<style lang="scss" scoped>
.squre-title {
......@@ -252,8 +304,9 @@ export default {
}
.dialog-step {
width: 80%;
margin: 0 auto 40px;
margin: 0 auto 80px;
}
.el-steps {
transform: translateX(-30px);
}
......@@ -267,6 +320,7 @@ export default {
width: 32px;
height: 32px;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 50%;
}
.el-step.is-horizontal .el-step__line {
top: 14px;
......@@ -274,7 +328,7 @@ export default {
right: 4%;
}
.el-step__icon-inner {
color: rgba(0, 0, 0, 0.25);
color: #c6c6c6;
}
.el-step__head.is-finish {
color: #ffffff;
......@@ -284,7 +338,7 @@ export default {
position: absolute;
display: inline-block;
top: -5px;
left: 36px;
left: 42px;
width: 134px;
font-size: 16px;
font-weight: 500;
......@@ -292,19 +346,35 @@ export default {
line-height: 24px;
}
.el-step__head.is-finish .el-step__icon-inner {
color: #ffffff;
color: #5850ff;
}
.el-step__head.is-finish .el-step__line {
.el-step__head.is-finish .el-step__line.is-finish {
background: #5850ff;
}
.el-step__head.is-finish .el-step__icon {
border-color: #5850ff;
border-radius: 50%;
// background: #5850ff;
}
.el-step__head.is-finish .el-step__icon.is-text {
background-color: #5850ff;
border-color: #5850ff;
background: #5850ff;
}
.el-step__icon.is-text .el-step__icon-inner {
color: #ffffff;
}
.el-step__title {
font-size: 16px;
line-height: 24px;
font-weight: 600;
color: #000000;
font-weight: 500;
color: rgba(0, 0, 0, 0.65);
}
.el-step__sub {
font-size: 14px;
line-height: 24px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.45);
}
.el-step__description {
font-size: 13px;
......@@ -313,8 +383,12 @@ export default {
font-weight: 400;
}
.el-step__title.is-finish {
color: #333333;
font-weight: 700;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.el-step__sub.is-finish {
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.image-uploader {
position: relative;
......@@ -391,7 +465,7 @@ export default {
.squre-safe-title {
text-align: center;
font-size: 32px;
font-weight: 500;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
line-height: 40px;
}
......@@ -443,4 +517,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="square-main">
<div class="square-title">
<span>企微魔方</span>
<span>数据魔方</span>
<el-popover placement="top" width="400" trigger="hover" content="通过导入的客户基础信息,过滤出系统策略所匹配的目标营销人群,从而引导门店分门别类的配置营销方案,并监控实施效果。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</div>
<div class="square-num-box">
<div class="square-num-item">
<div class="square-num-title">客户总数</div>
<div class="square-num-count">
<span class="detail-content">
{{ countAll.totalCount }}
<GLButton @click="jumpDetail" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
</div>
</div>
<div class="square-num-item">
<div class="square-num-title">企微客户数</div>
<div class="square-num-title">魔方导入客户数</div>
<div class="square-num-count">
<span class="detail-content">
{{ countAll.qyCount }}
<GLButton @click="jumpDetail" class="detail-btn" fn="客户明细" mode="label"></GLButton>
{{ countAll.magicCount | overThousandFilter }}
<GLButton @click="jumpDetail(0)" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
</div>
</div>
<div class="square-num-item">
<div class="square-num-title">魔方导入客户数</div>
<div class="square-num-title">魔方客户匹配企微数</div>
<div class="square-num-count">
<span class="detail-content">
{{ countAll.magicCount }}
<GLButton @click="jumpDetail" class="detail-btn" fn="客户明细" mode="label"></GLButton>
{{ countAll.qyCount | overThousandFilter }}
<GLButton @click="jumpDetail(1)" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
</div>
</div>
</div>
<div class="square-title">客户分群营销</div>
<div class="coustom-box">
<div class="coustom-box-item">
<div class="coustom-box-title">待添加企微客户</div>
<div class="coustom-echart">
<echart-circle bgColor="#6395FA" coustomId="coustomId_1" :lineData="[countAll.unQyCount, countAll.totalCount - countAll.unQyCount]"></echart-circle>
<div class="coustom-echart-desc">
<div class="coustom-echart-title">人群占比</div>
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unQyCount }}/{{ countAll.totalCount }}
<GLButton @click="jumpDetail" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
<div class="coustom-box-container">
<div class="square-title">客户分群营销</div>
<div class="coustom-box">
<div class="coustom-box-item">
<div class="coustom-box-title">待添加企微客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unQyCount | overThousandFilter }}
<label>人</label>
<GLButton @click="jumpDetailGroup" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">当前客户池中,尚未匹配到企微账号的数量。推荐使用以下营销策略,吸引用户添加企微。</div>
<div class="coustom-box-config">
<GLButton class="coustom-box-btn" @click="jumpDrainage" fn="客户引流企微" mode="div">营销配置</GLButton>
</div>
</div>
<div class="coustom-box-content">当前客户池中,尚未匹配到企微账号的数量。推荐使用以下营销策略,吸引用户添加企微。</div>
<GLButton class="coustom-box-config" @click="jumpDrainage" fn="客户引流企微" mode="div">营销配置</GLButton>
</div>
<div class="coustom-box-item">
<div class="coustom-box-title">信息待完善客户</div>
<div class="coustom-echart">
<echart-circle bgColor="#5AD8A6" coustomId="coustomId_2" :lineData="[countAll.unInfoCount, countAll.totalCount - countAll.unInfoCount]"></echart-circle>
<div class="coustom-echart-desc">
<div class="coustom-echart-title">人群占比</div>
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unInfoCount }}/{{ countAll.totalCount }}
<GLButton @click="jumpDetail" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
<div class="coustom-box-item">
<div class="coustom-box-title">信息待完善客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unInfoCount | overThousandFilter }}
<label>人</label>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">当前客户池中,有企微客户尚未维护手机号码。建议批量通知对应的销售顾问维护此类客户信息。</div>
<div class="coustom-box-config">
<GLButton class="coustom-box-btn" @click="jumpFriend" fn="客户资料跟进" mode="div">营销配置</GLButton>
</div>
</div>
<div class="coustom-box-content">当前客户池中,有企微客户尚未维护手机号码。建议批量通知对应的销售顾问维护此类客户信息。</div>
<GLButton class="coustom-box-config" @click="jumpFriend" fn="客户资料跟进" mode="div">营销配置</GLButton>
</div>
<div class="coustom-box-item">
<div class="coustom-box-title">待续保客户</div>
<div class="coustom-echart">
<echart-circle bgColor="#5D7092" coustomId="coustomId_3" :lineData="[countAll.unRenewCount, countAll.totalCount - countAll.unRenewCount]"></echart-circle>
<div class="coustom-echart-desc">
<div class="coustom-echart-title">人群占比</div>
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unRenewCount }}/{{ countAll.totalCount }}
<GLButton @click="jumpDetail" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
<div class="coustom-box-item">
<div class="coustom-box-title">待续保客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unRenewCount | overThousandFilter }}
<label>人</label>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">提前给车险快到期的用户自动推荐适合该客户的优惠服务,提高客户续保率。</div>
<div class="coustom-box-config"><div class="coustom-box-btn coustom-box-wait">敬请期待</div></div>
</div>
<div class="coustom-box-content">提前给车险快到期的用户自动推荐适合该客户的优惠服务,提高客户续保率。</div>
<div class="coustom-box-config">敬请期待</div>
</div>
<div class="coustom-box-item">
<div class="coustom-box-title">待首保客户</div>
<div class="coustom-echart">
<echart-circle bgColor="#5B8FF9" coustomId="coustomId_4" :lineData="[countAll.unRegularCount, countAll.totalCount - countAll.unRegularCount]"></echart-circle>
<div class="coustom-echart-desc">
<div class="coustom-echart-title">人群占比</div>
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unRegularCount }}/{{ countAll.totalCount }}
<GLButton @click="jumpDetail" class="detail-btn" fn="客户明细" mode="label"></GLButton>
</span>
<div class="coustom-box-item">
<div class="coustom-box-title">待首保客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unRegularCount | overThousandFilter }}
<label>人</label>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">智能提醒用户回店首保,提高用户返店率。</div>
<div class="coustom-box-config"><div class="coustom-box-btn coustom-box-wait">敬请期待</div></div>
</div>
<div class="coustom-box-content">智能提醒用户回店首保,提高用户返店率。</div>
<div class="coustom-box-config">敬请期待</div>
</div>
</div>
<div class="square-tabel scrm-box-f">
<div class="square-tabel-form">
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item" label-width="120px">
<GLButton size="small" type="primary" @click="handleImport" fn="魔方导入">
<i class="el-icon-plus"></i>
导入魔方
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="tabel-container-tips">
<div class="tabel-tips">
<span>数据列表</span>
<i class="el-icon-warning-outline"></i>
数据已处理: 表示所导出的数据已进入系统。由于每个系统标签的统计规则不同,具体更新时间有所差异。
</div>
<GLButton plain size="small" @click="handleImport" fn="魔方导入">
导入数据
</GLButton>
<el-form-item size="small" label="导入时间">
<el-date-picker :picker-options="pickerOptions" v-model="createTime" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始时间" end-placeholder="结束时间"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="importNumber" slot-scope="scope">
<div class="number-form">
......@@ -137,7 +125,7 @@
</div>
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="魔方导入结果">详情</GLButton>
<a type="text" :href="scope.scope" v-if="scope.scope.state">异常数据</a>
</div>
</GLTable>
</div>
......@@ -174,12 +162,9 @@
</template>
<script>
import echartCircle from './components/echartCircle'
// import echartCircle from './components/echartCircle'
export default {
name: 'square',
components: {
echartCircle
},
data() {
return {
pickerOptions: {
......@@ -190,7 +175,51 @@ export default {
createTime: '',
countAll: {},
dialogVisible: false,
tableSearchForm: {},
tableSearchForm: {
createTime: '',
state: ''
},
searchFormData: [
{
label: '导入时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
},
{
label: '数据处理状态',
name: 'state',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '1',
label: '已处理'
},
{
value: '0',
label: '处理中'
}
]
}
],
// pickerOptions: {
// disabledDate: time => {
// return time.getTime() > Date.now()
// }
// },
getListApi: this.$apis.square.importsRecord,
tableParams: {
listName: 'data',
......@@ -200,23 +229,30 @@ export default {
},
tableColumns: [
{
label: '导入时间',
prop: 'createdTime'
label: '导入批次',
prop: 'batchNumber'
},
{
label: '企微客户数 | 导入客户数',
prop: 'importNumber',
minWidth: '100px',
addHtml: 'importNumber'
label: '导入时间',
prop: 'createdTime',
formatter: cellValue => {
return new Date(cellValue.createdTime).toLocaleDateString() + ' ' + new Date(cellValue.createdTime).toLocaleTimeString()
}
},
{
label: '新增客户数 | 导入客户数',
prop: 'newCostomerNumber',
addHtml: 'newCostomerNumber'
label: '事件处理状态',
prop: 'state',
formatter: cellValue => {
return cellValue.state == 1 ? '已处理' : '处理中'
}
},
{
label: '导入人员',
prop: 'importStaffName'
prop: 'createdStaff'
},
{
label: '备注',
prop: 'remarks'
},
{
label: '操作',
......@@ -235,17 +271,6 @@ export default {
}
}
},
watch: {
createTime(value) {
if (value) {
this.tableSearchForm.startTime = value[0] + ' 00:00:00'
this.tableSearchForm.endTime = value[1] + ' 23:59:59'
} else {
delete this.tableSearchForm.startTime
delete this.tableSearchForm.endTime
}
}
},
methods: {
importsCount() {
this.$apis.square.importsCount({}).then(res => {
......@@ -273,8 +298,26 @@ export default {
handleImport() {
this.$router.push('/square/import')
},
jumpDetail() {
// this.$router.push('/square/customDetail')
jumpDetail(status) {
let url
if (status) {
url = `/custom/clientManage/index?isJoin=${status}&addWay=企微魔方`
} else {
url = `/custom/clientManage/index?addWay=企微魔方`
}
this.$history.push(url)
},
jumpDetailGroup() {
this.$history.push(`/custom/clientDataOverview/group/12/1`)
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.tableSearchForm.createTime) {
this.tableSearchForm.startTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
resolve()
})
},
findLogin() {
this.$apis.square.findLoginCount({ loginType: 1005 }).then(res => {
......@@ -285,8 +328,17 @@ export default {
}
},
mounted() {
this.$notify({
title: '数据魔方已处理完成',
message: '批次 202201005',
type: 'success',
duration: 5000
})
this.importsCount()
this.findLogin()
},
beforeDestroy() {
this.$notify.closeAll()
}
}
</script>
......@@ -406,8 +458,21 @@ export default {
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
display: flex;
.square-num-item {
width: 33.33%;
width: 50%;
padding-left: 20px;
text-align: center;
&:first-child {
position: relative;
&::after {
content: '';
position: absolute;
top: 18px;
right: 0px;
width: 1px;
height: 62px;
background: #f0f0f0;
}
}
.square-num-title {
margin-top: 20px;
font-size: 14px;
......@@ -423,64 +488,119 @@ export default {
}
}
}
.coustom-box {
.coustom-box-container {
margin-top: 20px;
display: flex;
&-item {
box-sizing: border-box;
width: 25%;
margin-right: 20px;
background: #ffffff;
.square-title {
height: 55px;
border-bottom: 1px solid #e8e8ea;
line-height: 55px;
padding-left: 20px;
}
.coustom-box {
display: flex;
padding: 20px;
height: 334px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
text-align: center;
&:last-child {
margin-right: 0px;
}
.coustom-box-title {
font-size: 20px;
font-weight: 500;
color: #424242;
line-height: 28px;
letter-spacing: 1px;
margin: 10px;
}
.coustom-echart {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
.coustom-echart-desc {
margin-left: 10px;
&-item {
box-sizing: border-box;
width: 25%;
margin-right: 20px;
height: 271px;
border-radius: 4px;
border: 1px solid #e9e6f5;
&:last-child {
margin-right: 0px;
}
.coustom-box-title {
font-size: 16px;
font-weight: 600;
color: #333;
line-height: 28px;
letter-spacing: 1px;
height: 56px;
line-height: 56px;
background: #f4f4fc;
border-radius: 4px;
padding-left: 24px;
}
.coustom-echart {
margin-top: 30px;
padding-left: 24px;
.coustom-echart-desc {
margin-left: 10px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
.coustom-echart-num {
font-size: 26px;
font-weight: bold;
color: rgba(0, 0, 0, 0.85);
line-height: 32px;
label {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
}
.coustom-box-content {
margin-top: 20px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
.coustom-echart-num {
font-size: 20px;
font-weight: 500;
color: #a3a3a3;
line-height: 20px;
text-align: left;
padding: 0px 24px;
height: 72px;
box-sizing: border-box;
}
.coustom-box-config {
text-align: center;
.coustom-box-btn {
cursor: pointer;
margin: 10px auto;
display: inline-block;
border-radius: 4px;
border: 1px solid #5850ff;
padding: 7px 0px;
width: calc(100% - 46px);
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 14px;
&.coustom-box-wait {
color: #999999;
border: 1px solid #e5e5e5;
}
}
}
}
.coustom-box-content {
font-size: 14px;
font-weight: 500;
color: #a3a3a3;
line-height: 20px;
text-align: left;
height: 110px;
}
}
.tabel-container-tips {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
/deep/ .el-button--small {
border: 1px solid #5850ff;
color: #5850ff;
}
.tabel-tips {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 20px;
span {
color: #333333;
font-size: 18px;
font-weight: 600;
}
.coustom-box-config {
cursor: pointer;
margin: 10px auto;
display: inline-block;
border-radius: 4px;
border: 1px solid #5850ff;
padding: 7px 28px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 14px;
i {
color: #999999;
margin-left: 5px;
}
}
}
......@@ -488,4 +608,7 @@ export default {
padding: 20px;
margin-top: 20px;
}
.table-btns a {
color: #5850ff;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!