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 @@ ...@@ -15,6 +15,11 @@
"js-message": "1.0.7" "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": { "@ampproject/remapping": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
...@@ -1859,6 +1864,7 @@ ...@@ -1859,6 +1864,7 @@
"thread-loader": "^2.1.3", "thread-loader": "^2.1.3",
"url-loader": "^2.2.0", "url-loader": "^2.2.0",
"vue-loader": "^15.9.2", "vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2", "vue-style-loader": "^4.1.2",
"webpack": "^4.0.0", "webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0", "webpack-bundle-analyzer": "^3.8.0",
...@@ -5036,6 +5042,22 @@ ...@@ -5036,6 +5042,22 @@
"safer-buffer": "^2.1.0" "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": { "ee-first": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
...@@ -14244,6 +14266,21 @@ ...@@ -14244,6 +14266,21 @@
"dev": true "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 @@ ...@@ -9,8 +9,10 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"echarts": "^5.4.3",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^2.0.4", "glsx-common": "^2.0.4",
"glsx-components": "^1.2.5" "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 { ...@@ -150,3 +150,7 @@ img {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.customMessageClass {
z-index: 9999 !important;
}
\ No newline at end of file \ 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 \ No newline at end of file
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block"> <el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData"> <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"> <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> <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" /> <img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
</el-popover> </el-popover>
: :
......
...@@ -24,7 +24,8 @@ let instance = null ...@@ -24,7 +24,8 @@ let instance = null
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { 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.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -111,4 +111,39 @@ util.downloadIamge = function(imgsrc, name = new Date().getTime()) { ...@@ -111,4 +111,39 @@ util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
} }
image.src = imgsrc 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 export default util
...@@ -25,11 +25,12 @@ ...@@ -25,11 +25,12 @@
<div <div
:key="cindex" :key="cindex"
class="group" class="group"
v-loading="c.loading"
> >
<div class="title"> <div class="title">
<div class="text flex"> <div class="text flex">
<div class="icon"> <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> </div>
{{ c.title }} {{ c.title }}
</div> </div>
...@@ -40,7 +41,14 @@ ...@@ -40,7 +41,14 @@
></div> ></div>
</div> </div>
</div> </div>
<el-scrollbar class="content"> <div
class="content"
v-infinite-scroll="
() => {
infiniteLoad(cindex, index)
}
"
>
<template v-if="c.list.length"> <template v-if="c.list.length">
<template v-for="(item, ind) in c.list"> <template v-for="(item, ind) in c.list">
<template> <template>
...@@ -59,10 +67,8 @@ ...@@ -59,10 +67,8 @@
</div> </div>
<div class="text"> <div class="text">
<div class="name"> <div class="name">
{{item.customerName || ''}} {{ item.customerName || '' }}
<template v-if="item.wechatNickname"> <template v-if="item.wechatNickname">@{{ item.wechatNickname }}</template>
@{{item.wechatNickname}}
</template>
</div> </div>
{{ item.customerPhone }} {{ item.customerPhone }}
</div> </div>
...@@ -80,7 +86,7 @@ ...@@ -80,7 +86,7 @@
<img src="@/assets/icon/nodata.png" /> <img src="@/assets/icon/nodata.png" />
</div> </div>
</template> </template>
</el-scrollbar> </div>
</div> </div>
</template> </template>
</template> </template>
...@@ -103,7 +109,7 @@ ...@@ -103,7 +109,7 @@
</template> </template>
<template v-else> <template v-else>
<div class="nothing"> <div class="nothing">
<img :src="nothing"> <img :src="nothing" />
暂无数据 暂无数据
</div> </div>
</template> </template>
...@@ -136,19 +142,50 @@ export default { ...@@ -136,19 +142,50 @@ export default {
leftActiveIcon: require('@/assets/icon/left-active.png'), leftActiveIcon: require('@/assets/icon/left-active.png'),
rightIcon: require('@/assets/icon/right.png'), rightIcon: require('@/assets/icon/right.png'),
rightActiveIcon: require('@/assets/icon/right-active.png'), rightActiveIcon: require('@/assets/icon/right-active.png'),
pageNumber: 1, pageNumber: [11],
pageCount: [],
nothing, 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 () { mounted () {
this.refreshTable() this.refreshTable()
}, },
methods: { 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 () { async refreshTable () {
function splitArrayIntoChunks (arr, chunkSize) { function splitArrayIntoChunks (arr, chunkSize) {
const weight = 1 / arr.length const weight = 1 / arr.length
return arr.reduce((result, item, index) => { return arr.reduce((result, item, index) => {
const chunkIndex = Math.floor(index / chunkSize) const chunkIndex = Math.floor(index / chunkSize)
// console.log(index, chunkIndex)
item.width = `${(weight * index + weight) * 100}%` item.width = `${(weight * index + weight) * 100}%`
result[chunkIndex] = result[chunkIndex] || [] result[chunkIndex] = result[chunkIndex] || []
result[chunkIndex].push(item) result[chunkIndex].push(item)
...@@ -157,34 +194,49 @@ export default { ...@@ -157,34 +194,49 @@ export default {
} }
const params = { const params = {
...JSON.parse(JSON.stringify(this.params)), ...JSON.parse(JSON.stringify(this.params)),
pageSize: 9999, pageSize: 10,
pageNumber: this.pageNumber pageNumber: 1
} }
const stageList = this.stageList, const stageList = this.stageList,
arr = [], arr = [],
{ sopJourneyStage } = params { sopJourneyStage } = params
for (let k of stageList) { this.dataViewLoading = false
if (k.value) { for (let k in stageList) {
params.sopJourneyStage = k.value 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 = [] let list = []
if (!sopJourneyStage || sopJourneyStage == stageList[k].value) {
k != 0 && this.$set(this.pageNumber, k - 1, 1)
if (!sopJourneyStage || sopJourneyStage == k.value) { const { list: apiList, total } = await this.$apis.journey.getCustomersList(params)
this.dataViewLoading = false
const { list: apiList } = await this.$apis.journey.getCustomersList(params)
list = apiList list = apiList
k != 0 && this.$set(this.pageCount, k - 1, total)
} }
list.length && list.length &&
list.forEach((e) => { list.forEach((e) => {
e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day') e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day')
}) })
arr.push({ this.viewList.forEach(item => {
title: k.label, item.forEach(e => {
list 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 { ...@@ -247,7 +299,7 @@ export default {
} }
.content { .content {
height: calc(100% - 60px); height: calc(100% - 60px);
overflow-y: scroll; overflow-y: auto;
box-sizing: border-box; box-sizing: border-box;
padding: 16px 16px 8px; padding: 16px 16px 8px;
position: relative; position: relative;
......
<template>
<GLDialog mode="big" bigTitle="碰撞位置" :before-close="closeDialogFn" @onCancel="closeDialogFn" :visible.sync="showFuncIntro" :hasFooter="false">
<div class="head-tip" v-if="detailDataObj.collisionTimeOutFlag">
<img class="tip-img" src="@/images/tip.png" alt="">
<span>车辆碰撞后,停留时间超过3分钟,建议去电回访。</span>
<span class="follow-up" @click="openRecordDialog">立即跟进</span>
</div>
<div class="accident-wrap">
<div class="accident-item">
<span class="title">事故情况</span>
<div class="media-box">
<template v-if="detailDataObj.mediaDetailList && detailDataObj.mediaDetailList.length">
<div class="media-item" v-for="(item,index) in detailDataObj.mediaDetailList" :key="index">
<img class="img" v-if="item.mediaType == 'IMAGE'" :src="item.fileUrl" alt="">
<video v-if="item.mediaType == 'VIDEO'" class="video" preload loop muted>
<source :src="item.fileUrl" type="video/mp4"/>
</video>
<div class="mask">
<img class="preview" src="@/images/eyes.png" alt="" @click="previewFile(item)">
</div>
</div>
</template>
<div class="empty-wrap" v-else>
<img class="empty-img" src="@/images/empty-file.png" alt="">
<p>暂无碰撞视频、暂无碰撞图片</p>
</div>
</div>
</div>
<div class="accident-item">
<span class="title">行车速度趋势(Km/h)</span>
<div v-if="showMap" class="eChart-box" id="echarts"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 70px;width: 176px;" src="@/images/empty-speed.png" alt="">
<p>未获取到行车速度趋势</p>
</div>
</div>
</div>
<div v-for="(item,index) in infoData" :key="index">
<span class="title">{{ item.title }}</span>
<div>
<div v-for="(ele, idx) in item.objList" :key="idx" class="obj-item">
<label class="label" for="">{{ele.name}}:</label>
<span class="value">{{detailDataObj[ele.key] || '--'}}</span>
</div>
</div>
</div>
<div >
<span class="title">事故地点</span>
<div v-if="showMap" id="mapContainer"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 120px;width: 100px;" src="@/images/empty-addr.png" alt="">
<p>未获取到设备定位</p>
</div>
</div>
<GLDialog mode="mid" title="新增跟进记录" :modal-append-to-body="true" :append-to-body="true" :visible.sync="recordVisible" :hasFooter="true" :before-close="handleCancel" @onOk="handleOk" @onCancel="handleCancel">
<glsx-combi-form class="record-form" ref="recordRef" :formRules="recordRule" labelWidth="154px" defaultWidth="432px" :formObj="recordForm" :formData="recordFormData">
</glsx-combi-form>
</GLDialog>
<el-dialog class="image-dialog" :modal-append-to-body="true" :append-to-body="true" :visible.sync="previewFileVisible" width="30%">
<big-View ref="viewForm" v-if="previewFileVisible" :dialogSrc="previewObj.previewFileUrl" :dialogType="previewObj.dialogType"></big-View>
</el-dialog>
</GLDialog>
</template>
<script>
import * as echarts from 'echarts';
import * as dayjs from 'dayjs'
import startUrl from '@/images/icon_start.png'
import endUrl from '@/images/endPoint.png'
import accidUrl from '@/images/accidPoint.png'
import AMapLoader from '@amap/amap-jsapi-loader';
import glsxCombiForm from '@/components/glsx-combi-form'
import bigView from '@/components/big-view'
import {PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE} from './constant'
const infoData = [
{
title: '客户信息',
objList: [
{
name: '联系人',
key: 'customerName'
},
{
name: '手机号码',
key: 'customerPhone'
},
]
},
{
title: '基本信息',
objList: [
{
name: '车架',
key: 'standNo'
},
{
name: '子品牌',
key: 'vehicleSubBrandName'
},
{
name: '车系',
key: 'vehicleSeriesName'
},
{
name: '车牌',
key: 'licensePlate'
},
]
},
{
title: '碰撞信息',
objList: [
{
name: '碰撞时间',
key: 'acciTime'
},
{
name: '碰撞点',
key: 'address'
}]
},
{
title: '跟进信息',
objList: [
{
name: '回访状态',
key: 'followUpStatus'
},
{
name: '回访时间',
key: 'followUpTime'
},
{
name: '回访结果',
key: 'followUpResult'
}
]
},
]
export default {
name: 'leadManage',
components: {
glsxCombiForm,
bigView
},
props:{
curCollId: String
},
data() {
return {
showMap: true,
previewFileVisible: false,
previewObj: {
previewFileUrl: '',
dialogType: 'video'
},
showFuncIntro: true,
recordVisible: false,
infoData,
detailDataObj: {},
recordRule: {
followResult: [{ required: true, message: '请选择跟进结果', trigger: 'change' }]
},
recordForm: {
followResult: '',
followRemark: ''
},
recordFormData: [
{
label: '跟进结果',
name: 'followResult',
type: 'select',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '真实事故',
value: 0
},
{
label: '非真实事故',
value: 1
},
{
label: '无法处理',
value: 2
}
],
},
{
label: '备注',
name: 'followRemark',
type: 'input',
maxlength: 50,
showLimit: true,
inputType: 'textarea'
}
],
}
},
created() {
},
mounted() {
this.getDetail()
},
methods: {
previewFile(item) {
console.log(item)
this.previewFileVisible = true
this.previewObj = {
previewFileUrl: item.fileUrl,
dialogType: item.mediaType=="VIDEO" ? 'video' : 'img'
}
},
handleOk() {
this.$refs.recordRef.$refs.formRef.validate(valid => {
if(valid){
const params = {
id: this.curCollId,
...this.recordForm
}
this.$apis.sendRepair.setFollowInfoApi(params).then(res => {
if(res){
this.$message({
type: 'success',
message: '操作成功',
customClass: 'customMessageClass'
})
// const { followResult, followRemark} = this.recordForm
// this.detailDataObj.followResult = followResult
// this.detailDataObj.followRemark = followRemark
this.getDetail()
this.resetRecordData()
}
})
}
})
},
handleCancel() {
this.resetRecordData()
},
closeDialogFn(){
this.$emit('closeDialogFn')
},
resetRecordData(){
this.recordVisible = false
this.recordForm = {
followResult: '',
followRemark: ''
}
},
getDetail(){
this.$apis.sendRepair.getCollisionDetailApi({id: this.curCollId}).then(res => {
if(res){
console.log(res)
const result = FOLLOW_RESULT.find(item => item.value==res.followResult)
const status = FOLLOW_STATUS.find(item => item.value==res.followStatus)
res.followUpResult = result ? result.label : ''
res.followUpStatus = status ? status.label : ''
res.followUpTime = res.followTime ? dayjs(res.followTime).format('YYYY-MM-DD HH:mm:ss') : ''
res.acciTime = res.collisionTime ? dayjs(res.collisionTime).format('YYYY-MM-DD HH:mm:ss') : ''
this.detailDataObj = res
if(!res.carAddressList?.length) return this.showMap = false
const addr = [res.longitude? +res.longitude : 0, res.latitude? +res.latitude : 0]
this.handleData(res.carAddressList, res.collisionTime, addr)
}
})
},
openRecordDialog(){
this.recordForm = {
followResult: this.detailDataObj.followResult,
followRemark: this.detailDataObj.followRemark
}
this.recordVisible = true
},
handleData(list, collTime , addr){
let xList = [], yList = [], lineList = [], mapLnglatList=[];
let startAddr = [], pointAddr = [], endAddr = [];
const time = dayjs(collTime).format('HH:mm:ss')
list.forEach((ele,index) => {
mapLnglatList.push(ele.lnglat)
if(index==0 || index==list.length-1){
if(index==0) startAddr = ele.lnglat
if(index!=0) endAddr = ele.lnglat
xList.push(`${ele.time}${index==0 ? '起点' : '终点'}`)
}else{
if(ele.time==time) pointAddr = ele.lnglat
xList.push(ele.time==time ? ele.time + '碰撞点' : '')
}
yList.push(ele.sp)
});
const maxByList = Math.max.apply(null, yList);
const yMax = maxByList + (10-(maxByList%10!=0 ? maxByList%10 : 10))
xList.forEach(item => {
if(item){
const itemlist = [
{
lineStyle: {
type: 'solid',
color: '#e0e6f1'
},
coord: [item, 0]
},
{
coord: [item, yMax]
}
]
lineList.push(itemlist)
}
})
this.drawLine(xList, yList, lineList)
this.initMap(mapLnglatList, startAddr, addr, endAddr)
},
drawLine(xList, yList, lineList){
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('echarts'));
// 绘制图表
myChart.setOption({
tooltip: {
trigger: 'axis',
formatter: function(params) {
return (params[0]?.value || 0) + '(Km/h)'
}
},
grid: {
top: '3%',
left: '3%',
right: '8%',
bottom: '1%',
containLabel: true
},
xAxis: {
axisTick: {
show: false
}, // 隐藏 y 轴刻度线
type: 'category',
boundaryGap: false,
data: xList,
axisLine: {
lineStyle: {
color: '#e0e6f1' // 设置 x 轴的颜色为红色
}
},
axisLabel: {
interval: 0,
color: '#333333' // 让刻度标签的颜色自动适应主题
},
},
yAxis: {
type: 'value'
},
series: [{
type: 'line',
smooth: true,
symbol: 'circle', // 将圆点改为点
stack: 'Total',
itemStyle: {
color: '#5850FF',
},
lineStyle: {
color: '#5850FF', // 设置线条颜色
width: 1,
},
areaStyle: { // 使用 areaStyle 来设置渐变背景
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(88, 80, 255, 0.5)'
}, // 渐变起始颜色
{
offset: 1,
color: 'rgba(145, 136, 255, 0)'
} // 渐变结束颜色
])
},
markLine: {
name: 'cc',
symbol: 'none',
data: lineList
},
data: yList
}]
});
},
initMap(mapLnglatList, startAddr, pointAddr, endAddr) {
AMapLoader.load({
key: "44cc16e43ad7ed3358df507bd0618181", //此处填入我们注册账号后获取的Key
version: "2.0", //指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: ['AMap.Scale'], //需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => {
var map = new AMap.Map('mapContainer', {
zoom: 12, // 初始缩放级别
center: startAddr // 初始地图中心点坐标
});
// 添加缩放控件
map.plugin(["AMap.ToolBar"], function() {
var toolbar = new AMap.ToolBar({
position: 'RT'
});
map.addControl(toolbar);
});
// 自定义起点图标
var startPointIcon = new AMap.Icon({
image: startUrl, // 替换成你的起点图标路径
size: new AMap.Size(36, 36)
});
// 自定义终点图标
var endPointIcon = new AMap.Icon({
image: endUrl, // 替换成你的终点图标路径
size: new AMap.Size(36, 36)
});
// 自定义碰撞位置图标
var collisionPointIcon = new AMap.Icon({
image: accidUrl, // 替换成你的碰撞位置图标路径
size: new AMap.Size(36, 36)
});
// 创建起点标记
var startPoint = new AMap.Marker({
position: startAddr,
icon: startPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
});
// 创建终点标记
var endPoint = new AMap.Marker({
position: endAddr,
icon: endPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
});
// 创建碰撞位置标记
var collisionPoint = new AMap.Marker({
position: pointAddr,
icon: collisionPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
});
// 创建轨迹线
var polyline = new AMap.Polyline({
path: mapLnglatList,
strokeColor: "#3366FF",
strokeOpacity: 1.0,
strokeWeight: 5
});
polyline.setMap(map);
}).catch(e => {
console.log(e);
})
}
}
}
</script>
<style lang="scss" scoped>
.empty-wrap{
width: 100%;
height: 100%;
text-align: center;
.empty-img{
width: 64px;
height: 40px;
margin-bottom: 10px;
}
}
.head-tip{
height: 40px;
line-height: 40px;
background: #E4E3FF;
border-radius: 4px;
width: 100%;
font-size: 14px;
box-sizing: border-box;
margin-bottom: 16px;
padding: 0 16px;
.tip-img{
height: 14px;
width: 14px;
vertical-align: middle;
margin-right: 8px;
}
.follow-up{
cursor: pointer;
color: #5850FF;
}
}
.title{
display: inline-block;
height: 24px;
line-height: 24px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #000000d9;
margin-bottom: 10px;
}
.accident-wrap{
display: flex;
margin-bottom: 20px;
.accident-item{
flex: 1;
.media-box{
display: flex;
.media-item{
display: inline-block;
position: relative;
margin-right: 10px;
.img, .video{
display: inline-block;
width: 104px;
height: 104px;
border-radius: 4px;
}
.mask{
display: none;
}
}
.media-item:hover{
.mask{
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, .3);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
.preview{
height: 20px;
width: 20px;
cursor: pointer;
}
}
}
}
}
}
.record-form{
/deep/ .el-textarea__inner{
height: 75px;
}
}
.obj-item{
display: inline-block;
margin-bottom: 20px;
.label{
display: inline-block;
text-align: right;
width: 154px;
line-height: 20px;
color: #666666;
}
.value{
display: inline-block;
min-width: 230px;
color: #333;
}
}
.eChart-box{
width: 100%;
height: 187px;
}
#mapContainer {
width: 100%;
height: 275px;
}
</style>
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 \ 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>
<template>
<div>
<div class="scrm-sub-client-container">
<div class="pageContent">
<GLCombiForm :rowNumber="2" :searchSelectObj="searchSelectObj" :formObj="searchForm" :formData="searchFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
<!-- 线索分配 -->
<div class="leadList">
<div>
<span>线索列表</span>
</div>
<div>
<el-button fn="线索分配" type="primary" plain size="small" @click="openNoticeDialog">推送设置</el-button>
<el-button fn="线索分配" size="small" @click="handleExport">Excel导出</el-button>
</div>
</div>
<GLTable ref="repairTableRef" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi" :noDataImg="url" :searchForm="realSearchForm" :pageConf="pageConf" :tableParams="tableParams">
<div slot="imageSlot" 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.goodsImage" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover>
</div>
<div slot="statusSlot" slot-scope="scope">
<span :class="['status', scope.scope.goodsStatus==1 ? 'success-status': 'error-status']"></span>
<span>{{scope.scope.goodsStatus==1 ? '上架' : '下架' }}</span>
</div>
<div slot="merchantPriceSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope).slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover">
<div v-for="(item,index) in filterData(scope.scope)" :key="index">
{{item}}
</div>
<span class="more-info" slot="reference">...({{ scope.scope.saleMerchantList.length }})</span>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope).join('、') }}</span>
</template>
</div>
<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>
</template>
</div>
<div class="table-btns" slot="operateSlot" slot-scope="scope">
<el-Button class="blue-text" type="text" fn="线索详情" @click="reVisitFn(scope.scope)">回访</el-Button>
</div>
</GLTable>
</div>
</div>
<GLDialog mode="mid" title="推送设置" :visible.sync="noticeVisible" :before-close="handleCancel" @onOk="handleOk" @onCancel="handleCancel">
<glsx-combi-form class="form" ref="sendNoticeRef" :formRules="basicRule" labelWidth="154px" defaultWidth="432px" :formObj="basicForm" :formData="basicFormData">
<div slot="timeSlot">
<el-time-picker
v-model="basicForm.sendTime"
:is-range="true"
format="HH:mm"
value-format="HH:mm"
></el-time-picker>
</div>
<div slot="phoneSlot">
<div v-for="(item, index) in basicForm.pushPhonesList" :key="index" class="phone-item">
<el-input v-model.trim="basicForm.pushPhonesList[index]" maxlength="11" type="text" placeholder="请输入"></el-input>
<i v-if="basicForm.pushPhonesList.length>1" @click="delPhoneFn(index)" class="el-icon-delete del"></i>
</div>
<div v-if="basicForm.pushPhonesList.length<5" class="add-btn" @click="addPhoneInputFn">
<img src="@/assets/add.png" />新增手机号
</div>
</div>
</glsx-combi-form>
</GLDialog>
<collision v-if="collVisible" @closeDialogFn="closeDialogFn" :curCollId="curCollId"></collision>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import util from '@/utils/util'
import url from '@/assets/clientDataOverview/nodata.png'
import glsxCombiForm from '@/components/glsx-combi-form'
import collision from './collision.vue'
import {PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE} from './constant'
export default {
name: 'repairList',
components: {
glsxCombiForm,
collision
},
data() {
return {
noticeVisible: false,
collVisible: false,
url: url,
basicRule: {
sendTime: [{ required: true, message: '请选择推送时间', trigger: 'change' }],
pushPhonesList: [{
required: true,
validator: (rule, value, callback) => {
const list = this.basicForm.pushPhonesList || []
const emptyValIdx= this.basicForm.pushPhonesList?.findIndex(item => !item)
const copylist = [...new Set(JSON.parse(JSON.stringify(list)))]
if (list?.length<1 || emptyValIdx>-1) {
callback(new Error('请填写手机号'))
} else if (list?.length>5) {
callback(new Error('手机号最多填写5个'))
}else if(copylist.length!==list.length){
callback(new Error('手机号不能重复'))
}else{
callback()
}
},
trigger: 'change'
}]
},
basicForm: {
pushFlag: 0,
sendTime: ['09:00', '20:00'],
pushPhonesList: ['']
},
basicFormData: [
{
label: '门店提醒',
name: 'pushFlag',
type: 'radio',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '开',
value: 1
},
{
label: '关',
value: 0
}
],
isHide: false
},
{
label: '推送时间',
name: 'sendTime',
addHtml: 'timeSlot',
isHide: false,
},
{
label: '顾问手机号',
name: 'pushPhonesList',
tipsWidth: 315,
tipsHtml: `<p style="color: #333333;font-weight: 600;font-size: 12px;">当车主发送碰撞事故时,会往您所填的手机号推送一条碰撞预警的短信,同时也会将您的手机号同步给客户。</p>
<span style="color: #666666;font-size: 12px;">如:您的客户xxx在广东省深圳市南山区粤海街道科苑北路疑似发生事故,客户手机号为:13XXXXXXXXX,请及时联系客户。</span>`,
type: 'input',
addHtml: 'phoneSlot',
isHide: false,
}
],
realSearchForm: {},
searchForm: {
operate: false,
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: '',
},
searchSelectObj: {
nameOrNoOrVin: {
attr: 'customerPhone',
value: ''
}
},
searchFormList: [
{
type: 'selectInput',
selectName: 'nameOrNoOrVin',
isClear: true,
inputWidth: '320px',
selectWidth: '110px',
selectOption: [
{
label: '客户电话',
name: 'customerPhone'
},
{
label: '客户姓名',
name: 'customerName'
},
{
label: '车牌号',
name: 'licensePlate'
},
{
label: '车架号',
name: 'standNo'
}
],
handleSelectChange: value => {
this.searchSelectObj.nameOrNoOrVin.value = ''
}
},
{
type: 'input',
name: 'sn',
label: 'IMEI/SN号'
},
{
type: 'select',
name: 'snType',
label: '设备类型',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
...SN_TYPE
],
placeholder: '请选择'
},
{
type: 'select',
name: 'followStatus',
label: '回访状态',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
...FOLLOW_STATUS
],
placeholder: '请选择'
},
{
label: '回访时间',
name: 'followTime',
type: 'datePicker',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
return date > yesterday
}
}
},
{
label: '碰撞时间',
name: 'collisionTime',
type: 'datePicker',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
return date > yesterday
}
}
},
{
type: 'select',
name: 'followResult',
label: '回访结果',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
...FOLLOW_RESULT
],
placeholder: '请选择'
}
],
getListApi: this.$apis.sendRepair.getSendRepairListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
tableColumns: [
{
label: '商户名称',
prop: 'merchantName',
width: 200,
line: 1
},
{
label: '商户号',
prop: 'merchantId',
width: 180
},
{
label: '设备类型',
prop: 'snType',
width: 180,
formatter : cell => {
const _target = SN_TYPE.find(item => item.value == cell.snType)
return _target ? _target.label : '--'
}
},
{
label: 'IMEI/SN',
prop: 'sn',
width: 200
},
{
label: '客户电话',
prop: 'customerPhone',
width: 200
},
{
label: '客户姓名',
prop: 'customerName',
width: 140
},
{
label: '车牌号',
prop: 'licensePlate',
width: 140
},
{
label: '车架号',
prop: 'standNo',
width: 230
},
{
label: '车型',
prop: 'vehicleShapeName',
width: 140
},
{
label: '碰撞地点',
prop: 'address',
width: 220,
line: 1
},
{
label: '碰撞时间',
prop: 'collisionTime',
formatter: cell => {
return cell.collisionTime ? dayjs(cell.collisionTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
minWidth: 180
},
{
label: '回访状态',
prop: 'userName',
width: 180,
formatter : cell => {
const _target = FOLLOW_STATUS.find(item => item.value == cell.followStatus)
return _target ? _target.label : '--'
}
},
{
label: '回访时间',
prop: 'followTime',
width: 220,
formatter: cell => {
return cell.followTime ? dayjs(cell.followTime).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '回访结果',
prop: 'createdDate',
width: 180,
formatter : cell => {
const _target = FOLLOW_RESULT.find(item => item.value == cell.followResult)
return _target ? _target.label : '--'
}
},
{
label: '回访备注',
prop: 'followRemark',
width: 180
},
{
label: '回访人员',
prop: 'updatedBy',
width: 140
},
{
label: '操作',
fixed: 'right',
addHtml: 'operateSlot',
width: 70
}
]
},
}
},
watch:{
'basicForm.pushFlag':{
handler(nVal,oVal){
this.basicFormData.forEach(item => {
if(item.name != 'pushFlag'){
item.isHide = !nVal
}
})
// if(nVal){
// this.basicForm.sendTime = ['09:00', '20:00']
// this.basicForm.pushPhonesList = ['']
// }
},
deep: true
}
},
created() {
},
mounted() {
},
methods: {
reVisitFn(row){
this.curCollId = row.id
this.collVisible = true
},
closeDialogFn(){
this.collVisible = false
this.searchTable()
},
handleOk() {
this.$refs.sendNoticeRef.$refs.formRef.validate(valid => {
if(valid){
console.log(this.basicForm)
const {pushFlag, pushPhonesList, sendTime} = this.basicForm
const params = {
pushFlag,
startTime: sendTime[0],
endTime: sendTime[1],
configType: 0,
pushPhones: pushPhonesList?.join(',') || ''
}
this.$apis.sendRepair.setNoticeApi(params).then(res => {
console.log(res)
if(res){
this.$message.success('设置成功')
this.resetNoticeData()
}
})
}
})
},
handleCancel() {
this.resetNoticeData()
},
resetNoticeData(){
this.noticeVisible = false
this.basicForm = {
pushFlag: 0,
sendTime: ['09:00', '20:00'],
pushPhonesList: ['']
}
},
addPhoneInputFn(){
if(this.basicForm.pushPhonesList.length >=PHONE_MAX_NUM) return
this.basicForm.pushPhonesList.push('')
},
delPhoneFn(idx){
this.basicForm.pushPhonesList.splice(idx, 1)
},
setTableFinishFun() {
this.$refs.repairTableRef.data.length ? (this.$refs.repairTableRef.tableHeightValues = '') : this.$refs.repairTableRef.setTableHeightFun()
},
setTableHeightEvent() {
this.$refs.repairTableRef.setTableHeightFun()
},
openNoticeDialog() {
this.noticeVisible = true
this.$apis.sendRepair.getNoticeDetailApi({}).then(res => {
if(res?.length) {
const {configType, endTime, startTime, id, pushFlag, pushPhones } = res[0]
if(configType==0){
this.basicForm = {
pushFlag,
sendTime: [startTime, endTime],
pushPhonesList: pushPhones?.split(',') || []
}
}
}
})
},
// 搜索表格
searchTable() {
this.$refs.repairTableRef.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {
operate: false,
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: '',
},
this.searchSelectObj = {
nameOrNoOrVin: {
attr: 'customerPhone',
value: ''
}
}
this.$refs.repairTableRef.refreshTable()
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.followTime.length) {
params.beginFollowTime = new Date(this.searchForm.followTime[0]).toLocaleDateString().replace(/\//g, '-')+ ' 00:00:00'
params.endFollowTime = new Date(this.searchForm.followTime[1]).toLocaleDateString().replace(/\//g, '-')+ ' 23:59:59'
}
if (this.searchForm.collisionTime.length) {
params.beginCollisionTime = new Date(this.searchForm.collisionTime[0]).toLocaleDateString().replace(/\//g, '-')+ ' 00:00:00'
params.endCollisionTime = new Date(this.searchForm.collisionTime[1]).toLocaleDateString().replace(/\//g, '-')+ ' 23:59:59'
}
delete params.followTime
delete params.collisionTime
return {...params, ...this.getSelectInputParams()}
},
beforeSearchFn() {
return new Promise(resolve => {
this.realSearchForm = this.getParams()
resolve()
})
},
handleExport () {
const params = this.getParams()
params.pageNum = 1
params.pageSize = 5000
this.$apis.sendRepair.exportSendRepairListApi(params).then(res => {
util.exportFn(res)
})
},
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container {
/deep/ .el-table .cell {
text-overflow: clip;
}
/deep/ .el-table .cell,
.el-table th div {
text-overflow: clip;
}
.pageContent {
padding: 20px 20px 30px;
// min-width: 1300px;
background-color: #fff;
/deep/ .el-icon-user-solid {
color: #75acff;
// margin-right: 3px;
font-size: 14px;
}
.leadList {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
div {
text-align: center;
span:nth-child(1) {
font-weight: 600;
font-size: 16px;
}
span:nth-child(2) {
font-size: 14px;
margin-left: 8px;
color: #5850ff;
border-bottom: 1px solid #5850ff;
cursor: pointer;
}
}
}
/deep/ .el-tag {
height: 26px;
line-height: 26px;
padding: 0 8px;
}
}
.blue-text {
color: #5850ff;
}
}
.phone-item{
display: flex;
align-items: center;
margin-bottom: 10px;
/deep/ .el-input__inner{
width: 284px;
}
.del{
margin-left: 10px;
color: #C6C6C6;
}
}
.add-btn{
height: 20px;
display: inline-flex;
align-items: center;
color: #5850FF;
font-size: 12px;
cursor: pointer;
img{
height: 20px;
width: 20px;
margin-right: 6px;
}
}
</style>
<template>
<div>
<div class="scrm-sub-client-container">
<div class="pageContent">
<GLCombiForm :rowNumber="2" :formObj="searchForm" :formData="searchFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
<!-- 线索分配 -->
<div class="leadList">
<div>
<span>线索列表</span>
</div>
<div>
<el-button type="primary" plain size="small" @click="openImportDialog">Excel导入</el-button>
<el-button size="small" @click="handleExport">Excel导出</el-button>
</div>
</div>
<GLTable :hasNum="true" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" ref="deviceManage" :getListApi="getListApi" :searchForm="realSearchForm" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams">
<!-- 线索类型 -->
<template slot="type" slot-scope="scope">
<span>{{ switchStaff(scope.scope.type) }}</span>
</template>
<!-- 线索状态 -->
<template slot="status" slot-scope="scope">
<span :class="{ circleStatusYellow: scope.scope.status == 0, circleStatusPurple: scope.scope.status == 1, circleStatusGreen: scope.scope.status == 2 }"></span>
<span>{{ scope.scope.status == 0 ? '待跟进' : scope.scope.status == 1 ? '跟进中' : scope.scope.status == 2 ? '已完成' : '' }}</span>
</template>
<!-- 跟进员工 -->
<template slot="userName" slot-scope="scope">
<el-tag type="info" :disable-transitions="false" v-if="scope.scope.userName">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ scope.scope.userName }}
</el-tag>
</template>
<template slot="options" slot-scope="scope">
<el-button class="blue-text" type="text" @click="openDeviceDialog(scope.scope)">编辑</el-button>
</template>
</GLTable>
</div>
</div>
<GLDialog mode="mid" title="编辑设备信息" :before-close="handleCancel" @onOk="handleOk" @onCancel="handleCancel" :visible.sync="editVisible">
<glsx-combi-form class="form" ref="deviceRef" :formRules="basicRule" labelWidth="154px" defaultWidth="432px" :formObj="basicForm" :formData="basicFormData">
</glsx-combi-form>
</GLDialog>
<leadInto v-if="leadIntoDialogVisible" @closeDialogFn="openImportDialog"></leadInto>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import util from '@/utils/util'
import url from '@/assets/clientDataOverview/nodata.png'
import leadInto from './leadInto.vue'
import glsxCombiForm from '@/components/glsx-combi-form'
import { SN_TYPE, CHANGE_DEVICE} from './constant'
export default {
name: 'deviceManage',
components: {
leadInto,
glsxCombiForm
},
data() {
return {
loading: false,
editVisible: false,
leadIntoDialogVisible: false,
url: url,
basicRule: {
customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }],
customerPhone: [{ required: true, message: '请输入客户手机号', trigger: 'change' }],
standNo: [{ required: true, message: '请输入车架号', trigger: 'change' }]
},
basicForm: {
id: '',
sn: '',
customerName: '',
customerPhone: '',
customerSex: 0,
licensePlate: '',
standNo: '',
replaceFlag: 0,
vehicleBrandId: '',
vehicleBrandName: '',
vehicleSubBrandId: '',
vehicleSubBrandName: '',
vehicleSeriesId: '',
vehicleSeriesName: '',
vehicleShapeId: '',
vehicleShapeName: ''
},
basicFormData: [
{
label: '设备号',
name: 'sn',
type: 'input',
isDisabled: true
},
{
label: '客户姓名',
name: 'customerName',
type: 'input',
},
{
label: '性别',
name: 'customerSex',
type: 'radio',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '男',
value: 0
},
{
label: '女',
value: 1
}
],
},
{
label: '客户手机号',
name: 'customerPhone',
type: 'input',
},
{
label: '车架号',
name: 'standNo',
type: 'input',
},
{
label: '车牌号',
name: 'licensePlate',
type: 'input',
},
{
label: '车辆品牌',
name: 'vehicleBrandId',
type: 'select',
optionLabel: 'name',
optionId: 'id',
optionList: [],
changeAttr: (id, cell)=>{
const _target = cell.optionList.find(item => item.id==id)
if(_target) this.basicForm.vehicleBrandName = _target.name
const _sonTarget = this.basicFormData.find(item => item.name=='vehicleSubBrandId')
if(_sonTarget) _sonTarget.optionList = _target.childs
}
},
{
label: '子品牌',
name: 'vehicleSubBrandId',
type: 'select',
optionLabel: 'name',
optionId: 'id',
optionList: [],
changeAttr: (id, cell)=>{
const _target = cell.optionList.find(item => item.id==id)
if(_target) this.basicForm.vehicleSubBrandName = _target.name
this.getVehicleSeriesList()
}
},
{
label: '车系',
name: 'vehicleSeriesId',
type: 'select',
optionLabel: 'name',
optionId: 'id',
optionList: [],
changeAttr: (id, cell)=>{
const _target = cell.optionList.find(item => item.id==id)
if(_target) this.basicForm.vehicleSeriesName = _target.name
this.getCarTypeList()
}
},
{
label: '车型',
name: 'vehicleShapeId',
type: 'select',
optionLabel: 'name',
optionId: 'id',
optionList: [],
changeAttr: (id, cell)=>{
const _target = cell.optionList.find(item => item.id==id)
if(_target) this.basicForm.vehicleShapeName = _target.name
}
},
{
label: '是否更换设备',
name: 'replaceFlag',
type: 'radio',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '保修更换-免费',
value: 0
},
{
label: '维修更换',
value: 1
},
{
label: '购买',
value: 2
}
],
}
],
searchForm: {
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
replaceFlag: '',
account: '',
operateDate: ''
},
realSearchForm: {},
searchFormList: [
{
type: 'input',
name: 'sn',
label: 'IMEI/SN号'
},
{
type: 'select',
name: 'snType',
label: '设备类型',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
...SN_TYPE
],
placeholder: '请选择'
},
{
type: 'select',
name: 'replaceFlag',
label: '是否更换设备',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
...CHANGE_DEVICE
],
placeholder: '请选择'
},
{
type: 'input',
name: 'account',
label: '操作人'
},
{
label: '操作时间',
name: 'operateDate',
type: 'datePicker',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
return date > yesterday
}
}
}
],
getListApi: this.$apis.sendRepair.getDeviceListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
tableColumns: [
{
label: '商户名称',
prop: 'merchantName',
width: 200,
line: 1
},
{
label: '商户号',
prop: 'merchantId',
minWidth: 150
},
{
label: '设备类型',
prop: 'snType',
formatter : cell => {
const _target = SN_TYPE.find(item => item.value == cell.snType)
return _target ? _target.label : '--'
},
minWidth: 150
},
{
label: 'IMEI/SN',
prop: 'sn',
width: 200,
line: 1
},
{
label: 'ICCID',
prop: 'iccid',
minWidth: 120
},
{
label: '客户电话',
prop: 'customerPhone',
minWidth: 140
},
{
label: '客户姓名',
prop: 'customerName',
minWidth: 140
},
{
label: '性别',
prop: 'customerSex',
formatter : cell => {
return cell.customerSex==1 ? '女' : '男'
},
minWidth: 140
},
{
label: '车牌号',
prop: 'licensePlate',
minWidth: 180
},
{
label: '车架号',
prop: 'standNo',
width: 230
},
{
label: '车型',
prop: 'vehicleShapeName',
minWidth: 180
},
{
label: '设备安装时的初始里程',
prop: 'initialMileage',
width: 200,
},
{
label: '上次保养里程',
prop: 'lastMileage',
minWidth: 180
},
{
label: '上次保养时间',
prop: 'lastTime',
minWidth: 140
},
{
label: '下次保养里程',
prop: 'lowerMileage',
minWidth: 180
},
{
label: '下次保养时间',
prop: 'lowerTime',
minWidth: 180
},
{
label: '是否更换设备',
prop: 'replaceFlag',
formatter : cell => {
const _target = CHANGE_DEVICE.find(item => item.value == cell.replaceFlag)
return _target ? _target.label : '--'
},
minWidth: 180
},
{
label: '操作时间',
prop: 'updatedTime',
minWidth: 180
},
{
label: '操作人',
prop: 'updatedBy',
minWidth: 180
},
{
label: '操作',
prop: 'options',
fixed: 'right',
addHtml: 'options',
width: 70
}
]
},
}
},
created() {
this.getCarBrandList()
},
mounted() {
},
methods: {
openImportDialog(){
this.leadIntoDialogVisible = !this.leadIntoDialogVisible
this.searchTable()
},
handleOk() {
this.$refs.deviceRef.$refs.formRef.validate(valid => {
if(valid){
const params= JSON.parse(JSON.stringify(this.basicForm))
delete params.sn
this.$apis.sendRepair.editDeviceInfoApi(params).then(res => {
if(res){
this.$message.success('操作成功')
this.handleCancel()
this.searchTable()
}
})
}
})
},
handleCancel() {
this.editVisible = false
this.basicForm = {
id: '',
sn: '',
customerName: '',
customerPhone: '',
customerSex: 0,
licensePlate: '',
standNo: '',
replaceFlag: 0,
vehicleBrandId: '',
vehicleBrandName: '',
vehicleSubBrandId: '',
vehicleSubBrandName: '',
vehicleSeriesId: '',
vehicleSeriesName: '',
vehicleShapeId: '',
vehicleShapeName: ''
}
},
getCarBrandList() {
this.$apis.sendRepair.getCarBrandListApi({}).then(res=>{
if(res) {
const _target = this.basicFormData.find(item => item.name=='vehicleBrandId')
_target.optionList = res
}
console.log(res, 'getCarBrandList')
})
},
getVehicleSeriesList(){
const params = {
brandId: this.basicForm.vehicleBrandId,
childBrandId: this.basicForm.vehicleSubBrandId,
}
this.$apis.sendRepair.getVehicleSeriesListApi(params).then(res=>{
if(res) {
const _target = this.basicFormData.find(item => item.name=='vehicleSeriesId')
_target.optionList = res
}
})
},
getCarTypeList(){
const params = {
carSeriesId: this.basicForm.vehicleSeriesId
}
this.$apis.sendRepair.getCarTypeListApi(params).then(res=>{
if(res) {
const _target = this.basicFormData.find(item => item.name=='vehicleShapeId')
_target.optionList = res
}
})
},
openDeviceDialog(row){
this.$apis.sendRepair.getDeviceDetailApi({id: row.id}).then(res=>{
if(res) {
for(const key in this.basicForm){
this.basicForm[key] = res[key]
}
}
})
this.editVisible = true
},
setTableFinishFun() {
this.$refs.deviceManage.data.length ? (this.$refs.deviceManage.tableHeightValues = '') : this.$refs.deviceManage.setTableHeightFun()
},
setTableHeightEvent() {
this.$refs.deviceManage.setTableHeightFun()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.operateDate.length) {
params.beginTime = new Date(this.searchForm.operateDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.operateDate[1]).toLocaleDateString().replace(/\//g, '-')+ ' 23:59:59'
}
delete params.operateDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.realSearchForm = this.getParams()
resolve()
})
},
// 搜索表格
searchTable() {
this.$refs.deviceManage.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
replaceFlag: '',
account: '',
operateDate: ''
}
this.$refs.deviceManage.refreshTable()
},
handleExport () {
const params = this.getParams()
params.pageNum = 1
params.pageSize = 5000
this.$apis.sendRepair.exportDeviceListApi(params).then(res => {
util.exportFn(res)
})
},
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container {
/deep/ .el-table .cell {
text-overflow: clip;
}
/deep/ .el-table .cell,
.el-table th div {
text-overflow: clip;
}
.pageContent {
padding: 20px 20px 30px;
// min-width: 1300px;
background-color: #fff;
/deep/ .el-icon-user-solid {
color: #75acff;
// margin-right: 3px;
font-size: 14px;
}
.leadList {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
div {
text-align: center;
span:nth-child(1) {
font-weight: 600;
font-size: 16px;
}
span:nth-child(2) {
font-size: 14px;
margin-left: 8px;
color: #5850ff;
border-bottom: 1px solid #5850ff;
cursor: pointer;
}
}
}
/deep/ .el-tag {
height: 26px;
line-height: 26px;
padding: 0 8px;
}
}
.blue-text {
color: #5850ff;
}
}
.dialogEncircle {
// width: 100%;
.funcText {
line-height: 20px;
color: #333;
font-weight: 600;
font-size: 14px;
}
.funcIro {
margin-top: 15px;
display: flex;
justify-content: space-between;
> div {
width: 23%;
div {
height: calc(100% - 65px);
display: flex;
align-items: center;
img {
width: 100%;
}
}
p {
margin-left: 5px;
margin-top: 22px;
color: #333;
line-height: 20px;
font-size: 14px;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!