Commit 49c769cd by 前端

Merge branch 'v3.21.0' into 'master'

V3.21.0

See merge request !4
2 parents 9a03ac94 7a14303c
......@@ -15,6 +15,11 @@
"js-message": "1.0.7"
}
},
"@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
},
"@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
......@@ -1859,6 +1864,7 @@
"thread-loader": "^2.1.3",
"url-loader": "^2.2.0",
"vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0",
......@@ -5036,6 +5042,22 @@
"safer-buffer": "^2.1.0"
}
},
"echarts": {
"version": "5.4.3",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.4.3.tgz",
"integrity": "sha512-mYKxLxhzy6zyTi/FaEbJMOZU1ULGEQHaeIeuMR5L+JnJTpz+YR03mnnpBhbR4+UYJAgiXgpyTVLffPAjOTLkZA==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.4.4"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
......@@ -14244,6 +14266,21 @@
"dev": true
}
}
},
"zrender": {
"version": "5.4.4",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.4.4.tgz",
"integrity": "sha512-0VxCNJ7AGOMCWeHVyTrGzUgrK4asT4ml9PEkeGirAkKNYXYzoPJCLvmyfdoOXcjTHPs10OZVMfD1Rwg16AZyYw==",
"requires": {
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
}
}
}
......@@ -9,8 +9,10 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.4.4",
"dayjs": "^1.10.7",
"echarts": "^5.4.3",
"el-tree-transfer": "^2.2.6",
"glsx-common": "^2.0.4",
"glsx-components": "^1.2.5"
......
import { http } from '@/main'
// http 对应的域名http://ismv.branch.glsx.com.cn
const URL = '/rop-scrm-clue/router'
// 送修列表
const getSendRepairListApi = params => {
params.method = 'clue.api.collision.info.listCollisionInfoByPage'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const exportSendRepairListApi = params => {
params.method = 'clue.api.collision.info.exportCollisionInfo'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const setNoticeApi = params => {
params.method = 'clue.api.collision.config.addOrUpdatePushConfig'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getNoticeDetailApi = params => {
params.method = 'clue.api.collision.config.getDetail'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getCollisionDetailApi = params => {
params.method = 'clue.api.collision.info.getDetail'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const setFollowInfoApi = params => {
params.method = 'clue.api.collision.info.follow'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getDeviceListApi = params => {
params.method = 'clue.api.collision.customer.device.list'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const exportDeviceListApi = params => {
params.method = 'clue.api.collision.customer.device.list.export'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const importDeviceInfoApi = params => {
params.method = 'clue.api.collision.device.import'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const editDeviceInfoApi = params => {
params.method = 'clue.api.collision.customer.device.edit'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getDeviceDetailApi = params => {
params.method = 'clue.api.collision.customer.device.detail'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const uploadFileApi = params => {
params.method = `scrm.api.equity.service.claims.code.batchGenerateCodeByExcel`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const getCarBrandListApi = params => {
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http({
url: '/rop-scrm-carlife/router',
method: 'post',
data: params,
sign: true
})
}
const getVehicleSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http({
url: '/rop-scrm-carlife/router',
method: 'post',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http({
url: '/rop-scrm-carlife/router',
method: 'post',
data: params,
sign: true
})
}
export default {
getSendRepairListApi,
exportSendRepairListApi,
setNoticeApi,
getNoticeDetailApi,
getCollisionDetailApi,
setFollowInfoApi,
getDeviceListApi,
exportDeviceListApi,
importDeviceInfoApi,
editDeviceInfoApi,
getDeviceDetailApi,
uploadFileApi,
getCarBrandListApi,
getVehicleSeriesListApi,
getCarTypeListApi
}
......@@ -150,3 +150,7 @@ img {
overflow: hidden;
text-overflow: ellipsis;
}
.customMessageClass {
z-index: 9999 !important;
}
\ No newline at end of file
<template>
<div class="view-panel">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</div>
</template>
<script>
export default {
name: 'view',
data() {
return {
dialogVisibleImg: true
}
},
props: {
dialogType: String,
dialogSrc: String
},
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
\ No newline at end of file
......@@ -4,9 +4,10 @@
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span v-if="!item.isHide && (item.tips || item.tipsHtml)" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-popover placement="top" width="200" trigger="hover" :content="item.tips">
<el-popover placement="top" :width="item.tipsWidth || 200" trigger="hover" :content="item.tips">
<div v-if="item.tipsHtml" v-html="item.tipsHtml"></div>
<img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
</el-popover>
:
......
......@@ -24,7 +24,8 @@ let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, sign_common, request_common, response_sop, request_sop, request_merchant } = await fetchConfig(common)
const { response, request, sign, secret, sign_common, request_common, response_sop, request_sop, request_merchant, tmplUrl } = await fetchConfig(common)
Vue.prototype.$tmplUrl = tmplUrl
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......
......@@ -111,4 +111,39 @@ util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
}
image.src = imgsrc
}
function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
util.exportFn = function(url) {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
}
export default util
......@@ -25,11 +25,12 @@
<div
:key="cindex"
class="group"
v-loading="c.loading"
>
<div class="title">
<div class="text flex">
<div class="icon">
<img :src="`https://img01.glsx.com.cn/weapp/resource/saas/scrm/data-view-sop-${cindex}.png`">
<img :src="`https://img01.glsx.com.cn/weapp/resource/saas/scrm/data-view-sop-${cindex}.png`" />
</div>
{{ c.title }}
</div>
......@@ -40,7 +41,14 @@
></div>
</div>
</div>
<el-scrollbar class="content">
<div
class="content"
v-infinite-scroll="
() => {
infiniteLoad(cindex, index)
}
"
>
<template v-if="c.list.length">
<template v-for="(item, ind) in c.list">
<template>
......@@ -59,10 +67,8 @@
</div>
<div class="text">
<div class="name">
{{item.customerName || ''}}
<template v-if="item.wechatNickname">
@{{item.wechatNickname}}
</template>
{{ item.customerName || '' }}
<template v-if="item.wechatNickname">@{{ item.wechatNickname }}</template>
</div>
{{ item.customerPhone }}
</div>
......@@ -80,7 +86,7 @@
<img src="@/assets/icon/nodata.png" />
</div>
</template>
</el-scrollbar>
</div>
</div>
</template>
</template>
......@@ -103,7 +109,7 @@
</template>
<template v-else>
<div class="nothing">
<img :src="nothing">
<img :src="nothing" />
暂无数据
</div>
</template>
......@@ -136,19 +142,50 @@ export default {
leftActiveIcon: require('@/assets/icon/left-active.png'),
rightIcon: require('@/assets/icon/right.png'),
rightActiveIcon: require('@/assets/icon/right-active.png'),
pageNumber: 1,
pageNumber: [11],
pageCount: [],
nothing,
}
},
watch: {
// stageList: {
// handler() {
// this.pageNumber = new Array(this.stageList.length).fill(1);
// this.pageCount = new Array(this.stageList.length).fill(0)
// },
// deep:true,
// immediate:true
// }
},
mounted () {
this.refreshTable()
},
methods: {
// 下拉加载
async infiniteLoad (cindex, index) {
// console.log(this.pageCount, this.pageNumber)
if (this.viewList[index][cindex].list.length == 0) return
if (this.viewList[index][cindex].list.length == this.pageCount[cindex]) return
this.pageNumber[cindex]++
const params = {
...JSON.parse(JSON.stringify(this.params)),
pageSize: 10,
pageNumber: this.pageNumber[cindex],
sopJourneyStage: this.stageList[cindex].value
}
let { list } = await this.$apis.journey.getCustomersList(params)
list.length &&
list.forEach((e) => {
e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day')
})
this.viewList[index][cindex].list = this.viewList[index][cindex].list.concat(list)
},
async refreshTable () {
function splitArrayIntoChunks (arr, chunkSize) {
const weight = 1 / arr.length
return arr.reduce((result, item, index) => {
const chunkIndex = Math.floor(index / chunkSize)
// console.log(index, chunkIndex)
item.width = `${(weight * index + weight) * 100}%`
result[chunkIndex] = result[chunkIndex] || []
result[chunkIndex].push(item)
......@@ -157,34 +194,49 @@ export default {
}
const params = {
...JSON.parse(JSON.stringify(this.params)),
pageSize: 9999,
pageNumber: this.pageNumber
pageSize: 10,
pageNumber: 1
}
const stageList = this.stageList,
arr = [],
{ sopJourneyStage } = params
for (let k of stageList) {
if (k.value) {
params.sopJourneyStage = k.value
this.dataViewLoading = false
for (let k in stageList) {
if (stageList[k].value) {
arr.push({
title: stageList[k].label,
list: [],
loading: true
})
this.viewList = splitArrayIntoChunks(arr, 4)
this.dataViewLoading = true
}
}
for (let k in stageList) {
if (stageList[k].value) {
params.sopJourneyStage = stageList[k].value
let list = []
if (!sopJourneyStage || sopJourneyStage == stageList[k].value) {
k != 0 && this.$set(this.pageNumber, k - 1, 1)
if (!sopJourneyStage || sopJourneyStage == k.value) {
this.dataViewLoading = false
const { list: apiList } = await this.$apis.journey.getCustomersList(params)
const { list: apiList, total } = await this.$apis.journey.getCustomersList(params)
list = apiList
k != 0 && this.$set(this.pageCount, k - 1, total)
}
list.length &&
list.forEach((e) => {
e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day')
})
arr.push({
title: k.label,
list
this.viewList.forEach(item => {
item.forEach(e => {
if (!e.list.length && e.title === stageList[k].label) {
e.list = list || []
e.loading = false
}
})
})
}
}
this.viewList = splitArrayIntoChunks(arr, 4)
this.dataViewLoading = true
},
}
}
......@@ -247,7 +299,7 @@ export default {
}
.content {
height: calc(100% - 60px);
overflow-y: scroll;
overflow-y: auto;
box-sizing: border-box;
padding: 16px 16px 8px;
position: relative;
......
const PHONE_MAX_NUM = 5
const FOLLOW_STATUS = [
{
label: '未回访',
value: 0
},
{
label: '已回访',
value: 1
}
]
const FOLLOW_RESULT = [
{
label: '真实事故',
value: 0
},
{
label: '非真实事故',
value: 1
},
{
label: '无法处理',
value: 2
}
]
const SN_TYPE = [
{
label: 'OBD',
value: 1
},
{
label: '记录仪',
value: 6
},
{
label: '云导航',
value: 2
},
{
label: 'GPS',
value: 8
},
{
label: '智能蓝牙耳机车充',
value: 12501
}
]
const CHANGE_DEVICE = [
{
label: '保修更换-免费更换',
value: 0
},
{
label: '维修更换',
value: 1
},
{
label: '购买',
value: 2
}
]
export {PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE, CHANGE_DEVICE}
\ No newline at end of file
<template>
<GLDialog mode="small" title="设备录入" cancelText="确定" :okText="curStatus == 1 ? '确认导入' : '导出失败记录'" :before-close="handleCancel" @onCancel="handleCancel" @onOk="handleOk" :visible.sync="showFuncIntro" :hasFooter="true">
<div v-if="curStatus == 1" class="file-wrap">
<p class="tip">
<span v-if="showTip">
正在批量导入数据,请勿关闭!
</span>
</p>
<div class="upload-box">
<label class="label" for="">Excel文件:</label>
<el-button size="small" icon="el-icon-plus" @click="selectFile">上传文件</el-button>
<input type="file" style="opacity: 0;width: 0;height: 0;" ref="file" accept="*" @change="uploadFile" />
<span class="download-text" @click="downLoadTmpl">下载模板</span>
</div>
<span class="file-name" v-if="fileUrl">{{ fileName }}</span>
</div>
<div v-if="curStatus == 2" class="data-wrap">
<div class="data-box">
<p class="num">{{ checkInfo.success || 0 }}</p>
<p class="title">有效数据</p>
</div>
<div class="line"></div>
<div class="data-box">
<p class="num fail">{{ checkInfo.error || 0 }}</p>
<p class="title">异常数据</p>
</div>
</div>
</GLDialog>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'leadManage',
data() {
return {
showTip: false,
showFuncIntro: true,
fileUrl: '',
fileName: '',
curStatus: 1,
checkInfo: {}
}
},
created() {},
mounted() {},
methods: {
handleOk() {
if (this.curStatus == 1) {
if (!this.fileUrl) return this.$message.error('请上传文件')
this.$apis.sendRepair.importDeviceInfoApi({ url: this.fileUrl }).then(res => {
if (res) {
this.checkInfo = res
this.curStatus = 2
}
})
} else {
if (this.checkInfo.checkFlag) return this.$message.warn('无失败记录')
util.exportFn(this.checkInfo.errUrl)
}
},
downLoadTmpl() {
const url = this.$tmplUrl
if (!url) return this.$message.error('请配置模板链接')
util.exportFn(url)
},
handleCancel() {
this.fileUrl = ''
this.fileName = ''
this.curStatus = 1
this.checkInfo = {}
this.$emit('closeDialogFn')
},
selectFile() {
this.$refs.file.click()
},
uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xlsx|.xls' //文件格式判断
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) < 0) {
this.$message({
type: 'error',
message: '请选择xlsx、xls文件',
customClass: 'customMessageClass'
})
this.$refs.file.value = ''
return false
}
this.showTip = true
const reader = new FileReader()
reader.readAsDataURL(file)
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileName = file.name.split('.')
//fileUrl: 文件名 + @ + base64拼接
const fileUrl = fileName.pop() + '@' + arrBase64[1]
this.$apis.common
.pictureUpload({ file: fileUrl })
.then(res => {
loading.close()
this.showTip = false
if (res) {
this.fileName = file.name
this.fileUrl = res
}
})
.catch(err => {
loading.close()
this.showTip = false
})
}
}
}
}
</script>
<style lang="scss" scoped>
.file-wrap {
.tip {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 16px;
color: #ff4d4f;
line-height: 22px;
text-align: center;
display: block;
height: 30px;
margin: 12px 0 20px;
}
.upload-box {
display: flex;
align-items: center;
margin-bottom: 4px;
.label {
font-size: 14px;
width: 154px;
text-align: right;
color: #333333;
text-align: right;
display: inline-block;
}
.download-text {
color: #5850ff;
cursor: pointer;
margin-left: 7px;
}
}
.file-name {
margin-left: 154px;
font-size: 12px;
color: #333;
}
}
.data-wrap {
display: flex;
justify-content: center;
margin-top: 50px;
.line {
width: 1px;
height: 56px;
background: #e8e8ea;
}
.data-box {
width: 200px;
height: 56px;
.num {
font-family: Helvetica-Bold;
font-weight: 700;
font-size: 26px;
color: #2cca74;
text-align: center;
line-height: 32px;
}
.fail {
color: #eb4e4e;
}
.title {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
margin-top: 4px;
line-height: 20px;
color: #333333;
text-align: center;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!