Merge branch 'feature/【GFRS-2145】e起陪访' into dev

# Conflicts:
#	src/assets/js/utils/request.js
#	src/main.js
#	src/router/ebiz/index.js
This commit is contained in:
mengxiaolong
2021-02-18 09:14:18 +08:00
17 changed files with 1385 additions and 5 deletions

View File

@@ -0,0 +1,65 @@
import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'
// 陪访机构信息查询
export function getAccompanyComCode(data) {
return request({
url: getUrl('/agent/accompany/getAccompanyComCode', 1),
method: 'post',
data
})
}
// 陪访代理人查询
export function getAccompanyPerson(data) {
return request({
url: getUrl('/agent/accompany/getAccompanyPerson', 1),
method: 'post',
data
})
}
// 陪访记录查询
export function getAgentAccompanyRecordPage(data) {
return request({
url: getUrl('/agent/accompany/getAgentAccompanyRecordPage', 1),
method: 'post',
data
})
}
// 陪访信息登记
export function saveAccompanyRecord(data) {
return request({
url: getUrl('/agent/accompany/saveAccompanyRecord', 1),
method: 'post',
data
})
}
// 陪访记录详情查询
export function getAccompanyDetail(data) {
return request({
url: getUrl('/agent/accompany/getAccompanyDetail', 1),
method: 'post',
data
})
}
// 积分记录查询
export function getRewardRecord(data) {
return request({
url: getUrl('/agent/reward/getRewardRecord', 1),
method: 'post',
data
})
}
// 积分榜单查询
export function getAccompanyRank(data) {
return request({
url: getUrl('/agent/reward/getAccompanyRank', 1),
method: 'post',
data
})
}

BIN
src/assets/images/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -1831,6 +1831,13 @@ export default {
{ id: 'A302', text: '高级营业部经理' },
{ id: 'A401', text: '业务总监' }
],
// e起陪访: 陪访类型枚举
visitTypes: [
{ code: '01', text: '入职前陪访' },
{ code: '02', text: '新人首单' },
{ code: '03', text: '冲刺挑战' },
{ code: '04', text: '参与衔训' }
],
salarySource: [
{
id: 1,

View File

@@ -101,6 +101,15 @@ let whitelist = ['/agent/white/getWhiteInfo']
// 开门红
let goodStart = ['/data/performance/getComPerformance']
let eqiVisit = [
'/agent/accompany/getAccompanyComCode',
'/agent/accompany/getAccompanyPerson',
'/agent/accompany/getAgentAccompanyRecordPage',
'/agent/accompany/saveAccompanyRecord',
'/agent/accompany/getAccompanyDetail',
'/agent/reward/getRewardRecord',
'/agent/reward/getAccompanyRank'
]
let whiteList = [
'/customer/agent/getCustomersList',
@@ -116,7 +125,8 @@ let whiteList = [
...performanceRanking,
...hgb,
...whitelist,
...goodStart
...goodStart,
...eqiVisit
]
// 创建axios实例

View File

@@ -10,7 +10,7 @@
}
body {
height:auto;
height: auto;
max-height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
@@ -20,7 +20,7 @@ body {
}
html {
height:auto;
height: auto;
max-height: 100%;
}
@@ -33,6 +33,37 @@ a:hover {
text-decoration: none;
}
.thin-right,
.thin-bottom {
position: relative;
}
.thin-right::after {
content: ' ';
position: absolute;
width: 200%;
height: 200%;
border-right: 1px solid #edeff2;
transform-origin: top left;
transform: scale(0.5);
left: 0;
top: 0;
pointer-events: none;
}
.thin-bottom::after {
content: ' ';
position: absolute;
width: 200%;
height: 200%;
border-bottom: 1px solid #edeff2;
transform-origin: top left;
transform: scale(0.5);
left: 0;
top: 0;
pointer-events: none;
}
// 宽度设置
@include set-width($width-list);
// 宽度设置

View File

@@ -0,0 +1,65 @@
<template>
<div>
<van-cell-group @click.native="showPopup">
<van-field v-bind="$attrs" right-icon="arrow" :value="value" :required="required" :readonly="readonly" />
</van-cell-group>
<van-popup id="popup" :value="isShow" :position="position" @click-overlay="closePopup">
<slot :closePopup="closePopup">
<van-picker id="picker" show-toolbar :columns="columns" @confirm="onPickerConfirm" @cancel="closePopup" />
</slot>
</van-popup>
</div>
</template>
<script>
export default {
name: 'PopupSelector',
props: {
value: {
type: String
},
position: {
type: String,
default: 'bottom'
},
columns: {
type: Array,
default() {
return ['暂无数据']
}
},
required: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
}
},
data() {
return {
isShow: false
}
},
methods: {
showPopup() {
this.isShow = true
},
closePopup() {
this.isShow = false
},
onPickerConfirm(pickedValue) {
this.$emit('input', String(pickedValue))
this.closePopup()
}
}
}
</script>
<style lang="scss">
#app .van-picker__cancel,
#app .van-picker__confirm {
color: #1989fa;
}
</style>

View File

@@ -15,7 +15,30 @@ import md5 from 'js-md5'
import cryptoJs from 'crypto-js'
import cacheUtils from '@/assets/js/utils/cacheUtils'
import { Cell, CellGroup, DatetimePicker, Popup, Picker, Col, Row, Tab, Tabs, NavBar, Toast, Button, Dialog, Icon, Lazyload } from 'vant'
import {
Cell,
CellGroup,
DatetimePicker,
Popup,
Picker,
Col,
Row,
Tab,
Tabs,
NavBar,
Toast,
Button,
Dialog,
Icon,
Lazyload,
Field,
Area,
Uploader,
PullRefresh,
List,
Image as VanImage,
Sticky
} from 'vant'
Vue.use(Cell)
Vue.use(CellGroup)
Vue.use(DatetimePicker)
@@ -34,6 +57,13 @@ Vue.use(Dialog)
Vue.use(Lazyload, {
lazyComponent: true
})
Vue.use(Field)
Vue.use(Area)
Vue.use(Uploader)
Vue.use(PullRefresh)
Vue.use(List)
Vue.use(VanImage)
Vue.use(Sticky)
Vue.prototype.$assetsUrl = config.assetsUrl
Vue.prototype.$assetsUpUrl = config.assetsUpUrl

View File

@@ -0,0 +1,68 @@
// e起陪访
const VisitInfoRegister = () => import('@/views/ebiz/eqiVisit/VisitInfoRegister')
const RegisterResult = () => import('@/views/ebiz/eqiVisit/RegisterResult')
const NewcomerList = () => import('@/views/ebiz/eqiVisit/NewcomerList')
const ScoreRanking = () => import('@/views/ebiz/eqiVisit/ScoreRanking')
const VisitHistory = () => import('@/views/ebiz/eqiVisit/VisitHistory')
const HistoryDetail = () => import('@/views/ebiz/eqiVisit/HistoryDetail')
const ScoreHistory = () => import('@/views/ebiz/eqiVisit/ScoreHistory')
export default [
{
path: '/eqiVisit/visitInfoRegister',
name: 'VisitInfoRegister',
component: VisitInfoRegister,
meta: {
title: '陪访信息登记'
}
},
{
path: '/eqiVisit/registerResult',
name: 'RegisterResult',
component: RegisterResult,
meta: {
title: '提交结果'
}
},
{
path: '/eqiVisit/newcomerList',
name: 'NewcomerList',
component: NewcomerList,
meta: {
title: '选择陪访对象'
}
},
{
path: '/eqiVisit/scoreRanking',
name: 'ScoreRanking',
component: ScoreRanking,
meta: {
title: '积分榜'
}
},
{
path: '/eqiVisit/visitHistory',
name: 'VisitHistory',
component: VisitHistory,
meta: {
title: '陪访记录'
}
},
{
path: '/eqiVisit/historyDetail/:id',
name: 'VisitHistory',
component: HistoryDetail,
props: true,
meta: {
title: '陪访记录详情'
}
},
{
path: '/eqiVisit/scoreHistory',
name: 'ScoreHistory',
component: ScoreHistory,
meta: {
title: '查询积分'
}
}
]

View File

@@ -29,6 +29,7 @@ import attendance from './attendance'
import goodStart from './goodStart'
import hgb from './hgb'
import train from './train'
import eqiVisit from './eqiVisit'
export default [
...proposal,
@@ -57,5 +58,6 @@ export default [
...question,
...hgb,
...goodStart,
...train
...train,
...eqiVisit
] //根据需要进行删减

View File

@@ -0,0 +1,110 @@
<template>
<div class="history-detail bg-white">
<p class="date pl20 pt5 pb5">2021-1-29</p>
<van-cell-group>
<van-field label-width="120" v-model="accompanyRecordDTO.agentName" label="陪访人" readonly />
</van-cell-group>
<van-cell-group>
<van-field label-width="120" v-model="accompanyRecordDTO.accompanyAgentName" label="陪访新人姓名" readonly />
</van-cell-group>
<van-cell-group>
<van-field label-width="120" v-model="accompanyRecordDTO.visitDuration" label="时长" readonly />
</van-cell-group>
<van-cell-group>
<van-field label-width="120" v-model="accompanyRecordDTO.visitName" label="客户姓名" readonly />
</van-cell-group>
<van-cell-group>
<van-field label-width="120" v-model="accompanyRecordDTO.visitAge" label="客户年龄" readonly />
</van-cell-group>
<van-cell-group>
<van-field label-width="120" v-model="homeLocation" label="地点" readonly />
</van-cell-group>
<van-cell-group>
<van-field label-width="120" v-model="accompanyRecordDTO.visitAddress" label="详细地址" readonly />
</van-cell-group>
<van-cell-group v-if="imgList.length">
<van-field label-width="120" label="现场照片" readonly />
</van-cell-group>
<div class="imgs pb30">
<van-grid :column-num="3" :border="false">
<van-grid-item v-for="(img, i) in imgList" :key="i" @click="prevImg(img)">
<van-image height="100" fit="cover" :src="img.url" />
</van-grid-item>
</van-grid>
</div>
</div>
</template>
<script>
import { Grid, GridItem, ImagePreview } from 'vant'
import config from '@/config'
import { getAccompanyDetail } from '@/api/ebiz/eqiVisit/eqiVisit'
export default {
components: {
[Grid.name]: Grid,
[GridItem.name]: GridItem
},
props: ['id'],
data() {
return {
accompanyRecordDTO: {},
mediaDTOLst: []
}
},
computed: {
homeLocation() {
let detail = this.accompanyRecordDTO
if (!detail.visitProvinceName || !detail.visitCityName || !detail.visitAreaName) {
return ''
}
return `${detail.visitProvinceName} ${detail.visitCityName} ${detail.visitAreaName}`
},
imgList() {
return this.mediaDTOLst.map(img => {
return {
url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${encodeURIComponent(img.rgssUrl)}`
}
})
}
},
created() {
this.getHistoryDetail()
},
methods: {
prevImg(img) {
ImagePreview([img.url])
},
async getHistoryDetail() {
let res = await getAccompanyDetail({
accompanyRecordDTO: {
accompanyId: this.id
}
})
this.accompanyRecordDTO = res.content.accompanyRecordDTO
this.mediaDTOLst = res.content.mediaDTOLst ? res.content.mediaDTOLst : []
}
}
}
</script>
<style lang="scss" scoped>
.history-detail {
min-height: 100vh;
.date {
font-size: 14px;
background-color: #ebebeb;
}
.imgs {
padding: 0 8px;
}
.van-image {
height: 100%;
}
/deep/ .van-grid-item__content {
padding: 3px;
}
}
</style>

View File

@@ -0,0 +1,174 @@
<template>
<div class="bg-white newcomerlist">
<van-sticky>
<!-- -->
<van-tabs v-model="deptIndex" :ellipsis="false" @change="onDeptChanged">
<van-tab v-for="(dept, i) in depts" :key="i" :title="dept.name" />
</van-tabs>
<!-- -->
<van-tabs v-model="groupIndex" :ellipsis="false" @change="onGroupChanged">
<van-tab v-for="(group, i) in groups" :key="i" :title="group.name" />
</van-tabs>
</van-sticky>
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getNewcomers" :immediate-check="false">
<div v-for="(item, i) in list" :key="i" class="van-hairline--bottom newcomer" @click="saveNewcomerInfo(item)">
<div class="avatar">
<img :src="avatar" />
</div>
<div class="info">
<p class="mb10 agentCode">工号: {{ item.agentCode }}</p>
<div class="detail">
<span>{{ item.name }}</span>
<span>{{ item.gender | genderFilter }}</span>
<span>{{ item.phone }}</span>
</div>
</div>
</div>
</van-list>
</van-pull-refresh>
</div>
</template>
<script>
import avatar from '@/assets/images/bnf_avatar.png'
import { getAccompanyComCode, getAccompanyPerson } from '@/api/ebiz/eqiVisit/eqiVisit'
export default {
name: 'NewcomerList',
data() {
return {
avatar,
// pull-refresh是否处于加载状态
isLoading: false,
list: [],
// List是否处于加载状态
loading: false,
// List是否加载完毕
finished: false,
// 已选部索引
deptIndex: 0,
// 可选部数据
depts: [],
// 已选组索引
groupIndex: 0,
// 可选组数据
groups: [],
pageSize: 10,
pageNum: 1
}
},
computed: {
dept() {
return this.depts.find((item, index) => index === this.deptIndex)
},
groupCode() {
return this.groups.find((item, index) => index === this.groupIndex).groupCode
}
},
async created() {
// 获取代理人可查看部
await this.getDepts()
// 设置初始组
this.groups = this.dept.subBranchGroupLst
await this.getNewcomers()
},
methods: {
async getDepts() {
let res = await getAccompanyComCode({})
if (res.result === '0') {
this.depts = [...res.content.branchInfoBeanList]
} else {
this.$toast(res.resultMessage)
}
},
// 刷新组
async onRefresh() {
this.pageNum = 1
this.finished = false
await this.getNewcomers()
this.loading = false
this.isLoading = false
},
// 切换部
onDeptChanged() {
this.pageNum = 1
// groupIndex为0时切换部不会触发groupChange事件, 手动调一下接口
if (this.groupIndex === 0) {
this.getNewcomers()
} else {
this.groupIndex = 0
}
this.groups = this.dept.subBranchGroupLst
},
// 切换组
onGroupChanged() {
this.pageNum = 1
this.getNewcomers()
},
async getNewcomers() {
let res = await getAccompanyPerson({
groupCode: this.groupCode,
pageReqDTO: {
pageSize: this.pageSize,
pageNum: this.pageNum
}
})
this.pageNum++
this.finished = res.content.pageInfo.isLastPage
this.list = res.content.pageInfo.list
},
saveNewcomerInfo(newcomer) {
this.$CacheUtils.setLocItem('newcomer', JSON.stringify(newcomer))
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#/eqiVisit/visitInfoRegister?edit=true`
},
routerInfo: { path: '/eqiVisit/visitInfoRegister?edit=true' }
})
}
},
filters: {
genderFilter(val) {
return val === 0 ? '男' : '女'
}
}
}
</script>
<style lang="scss" scoped>
.newcomer {
display: flex;
padding: 10px 25px;
.avatar {
max-width: 50px;
margin-right: 10px;
img {
max-width: 100%;
}
}
.info {
flex: 1;
display: flex;
flex-direction: column;
.agentCode {
color: #999;
}
.detail {
display: flex;
justify-content: space-between;
}
}
}
/deep/ .van-tabs__line {
background-color: #1989fa !important;
}
.newcomerlist {
min-height: 100vh;
}
</style>

View File

@@ -0,0 +1,116 @@
<template>
<div class="bg-white container">
<div class="wrapper">
<img class="mb30 icon" :src="img" />
<h1 class="blue mb30">恭喜完成陪访</h1>
<p class="blue mb30">奖励: +{{ singleScore }}积分</p>
<h2 class="blue mb30">累计积分{{ totalScore }}</h2>
<div class="btns p30">
<van-button class="mr5" plain color="#199ed8" type="primary" @click="accompanyAgain">继续登记陪访</van-button>
<van-button class="ml5" plain color="#199ed8" type="primary" @click="toScoreRanking">积分榜</van-button>
<van-button color="#199ed8" type="primary" @click="quit">返回</van-button>
</div>
</div>
</div>
</template>
<script>
import img from '@/assets/images/success.png'
export default {
name: 'RegisterResult',
data() {
return {
img
}
},
computed: {
totalScore() {
return this.$route.query.total
},
singleScore() {
return this.$route.query.single
},
agentCode() {
return this.$route.query.agentCode
}
},
created() {
this.setLeftBtn()
},
methods: {
setLeftBtn() {
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
intercept: '1'
})
}, 1000)
window.appCallBack = this.appCallBack
},
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.quit()
}
},
quit() {
// 跳转首页
this.$jump({
flag: 'home'
})
},
toScoreRanking() {
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#/eqiVisit/scoreRanking?agentCode=${this.agentCode}`
},
routerInfo: { path: `/eqiVisit/scoreRanking?agentCode=${this.agentCode}` }
})
},
accompanyAgain() {
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#/eqiVisit/visitInfoRegister`
},
routerInfo: { path: `/eqiVisit/visitInfoRegister` }
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
height: 100vh;
}
.icon {
transform: scale(1.5);
}
.blue {
color: #199ed8;
}
.btns {
display: flex;
flex-wrap: wrap;
.van-button:nth-of-type(1),
.van-button:nth-of-type(2) {
flex: 1;
margin-bottom: 10px;
}
.van-button:nth-of-type(3) {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,126 @@
<template>
<div ref="container" class="score-history bg-white">
<div v-for="(value, key) in list" :key="key">
<p class="year">{{ value.year }} </p>
<template v-for="v in value.data">
<div class="history-item pt10 pb10 pl20 pr20 van-hairline--bottom" :key="v.bussinessId">
<div class="col mb10">
<p>
<span>{{ v.accompanyAgentName }}</span> - <span>{{ v.recordInfo }}</span>
</p>
<p style="color: #008000;">+ {{ v.rewardCount }}</p>
</div>
<div class="col">
<span>{{ v.recordDate }}</span>
<span>累计 {{ v.rewardAllCount }} 积分</span>
</div>
</div>
</template>
</div>
<p v-show="finished" class="finished p10">没有更多了</p>
</div>
</template>
<script>
import { getRewardRecord } from '@/api/ebiz/eqiVisit/eqiVisit'
import dataDictionary from '@/assets/js/utils/data-dictionary'
let timer = null
export default {
name: 'ScoreHistory',
data() {
return {
dataList: [],
pageNum: 1,
pageSize: 20,
finished: false,
dataMap: {},
visitTypes: dataDictionary.visitTypes
}
},
computed: {
list() {
let years = []
for (let key in this.dataMap) {
years.push(Number(key))
}
years.sort((a, b) => b - a)
let result = []
years.forEach(value => {
result.push({ year: value, data: this.dataMap[value] })
})
return result
}
},
async created() {
await this.getScoreHistory()
},
mounted() {
this.$refs.container.onscroll = this.onscroll
},
methods: {
onscroll() {
let sHeight = this.$refs.container.scrollHeight
let sTop = this.$refs.container.scrollTop
let dHeight = document.documentElement.scrollHeight
if (sHeight - sTop - dHeight <= 100) {
this.getScoreHistory()
}
},
async getScoreHistory() {
if (this.finished) {
return
}
clearTimeout(timer)
timer = setTimeout(async () => {
let res = await getRewardRecord({
pageReqDTO: {
pageSize: this.pageSize,
pageNum: this.pageNum
}
})
this.pageNum++
if (res.content.pageInfo.isLastPage) {
this.finished = true
}
let arrs = res.content.pageInfo.list
for (let item of arrs) {
let year = new Date(item.recordDate).getFullYear()
if (!this.dataMap.hasOwnProperty(year)) {
this.$set(this.dataMap, year, [])
this.dataMap[year].push(item)
} else {
this.dataMap[year].push(item)
}
}
}, 200)
}
}
}
</script>
<style lang="scss" scoped>
.score-history {
height: 100vh;
overflow: auto;
.year {
padding: 5px 10px;
background-color: #ebebeb;
}
.history-item {
.col {
display: flex;
justify-content: space-between;
}
.col:nth-of-type(2) {
color: #999999;
}
}
.finished {
text-align: center;
color: #999999;
}
}
</style>

View File

@@ -0,0 +1,147 @@
<template>
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<div class="bg-white ranking">
<van-notice-bar :text="noticeText" wrapable />
<div class="table-wrapper" v-if="ranking.length">
<table class="van-hairline--surround">
<thead>
<th v-for="(th, i) in theads" :key="i">{{ th }}</th>
</thead>
<tbody>
<tr class="thin-bottom">
<template v-if="inRanking">
<td class="thin-right thin-bottom" style="max-width: 2em; font-weight: bold;">{{ agentRank.rank }}</td>
<td class="thin-right thin-bottom" style="max-width: 3em; font-weight: bold;">{{ agentRank.agentName }}</td>
<td class="thin-right thin-bottom" style="max-width: 4em; font-weight: bold;">{{ agentRank.thirManageName }}</td>
<td class="thin-right thin-bottom" style="max-width: 2em; font-weight: bold;">{{ agentRank.applGrade }}</td>
<td class="thin-bottom" style="max-width: 2em; text-decoration: underline; font-weight: bold;" @click="jumpToDetail">
{{ agentRank.rewardCount }}
</td>
</template>
<td class="thin-bottom" v-else colspan="5">暂无积分</td>
</tr>
<tr v-for="(rank, index) in ranking" :key="index">
<td class="thin-right thin-bottom" style="max-width: 2em;">{{ rank.rank }}</td>
<td class="thin-right thin-bottom" style="max-width: 3em;">{{ rank.agentName }}</td>
<td class="thin-right thin-bottom" style="max-width: 4em;">{{ rank.thirManageName }}</td>
<td class="thin-right thin-bottom" style="max-width: 2em;">{{ rank.applGrade }}</td>
<td class="thin-bottom" style="max-width: 2em;">{{ rank.rewardCount }}</td>
</tr>
</tbody>
</table>
</div>
<div class="empty pt150" v-else>
<p class="mb10">暂无排名</p>
<img :src="empty" />
</div>
</div>
</van-pull-refresh>
</template>
<script>
import { NoticeBar } from 'vant'
import empty from '@/assets/images/empty.png'
import { getAccompanyRank } from '@/api/ebiz/eqiVisit/eqiVisit'
export default {
components: {
[NoticeBar.name]: NoticeBar
},
data() {
return {
empty,
agentRank: {},
inRanking: false,
isLoading: false,
theads: ['排名', '姓名', '所在机构', '职级', '积分'],
ranking: []
}
},
computed: {
noticeText() {
if (this.ranking.length) {
return '温馨提示: 每日凌晨更新前一日积分排行,下拉刷新最新排行'
} else {
return '温馨提示:当前暂无最新排名,赶紧去陪访吧!'
}
},
agentCode() {
return this.$route.query.agentCode
}
},
created() {
this.queryRanking()
},
methods: {
async queryRanking() {
let res = await getAccompanyRank({ billboardStart: 0, billboardEnd: 20, agentCode: this.agentCode })
this.ranking = res.content.statisticsBeanList
if (res.content.agentStatisticsBean) {
this.agentRank = res.content.agentStatisticsBean
this.inRanking = true
}
},
async onRefresh() {
await this.queryRanking()
this.isLoading = false
},
jumpToDetail() {
console.log('object')
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#/eqiVisit/scoreHistory`
},
routerInfo: { path: `/eqiVisit/scoreHistory` }
})
}
}
}
</script>
<style lang="scss" scoped>
.ranking {
min-height: 100vh;
.table-wrapper {
overflow: auto;
display: flex;
table {
flex: 1;
border-collapse: collapse;
text-align: center;
}
th {
white-space: nowrap;
padding: 15px 0;
background: #199ed8;
color: #fff;
}
tr {
td {
padding: 6px 0;
font-size: 14px;
word-break: break-all;
color: #199ed8;
}
}
}
.empty {
text-align: center;
p {
font-size: 20px;
color: #999999;
}
}
}
.van-pull-refresh {
overflow: auto;
}
.van-notice-bar {
background-color: #f6f6f6;
color: #199ed8;
}
</style>

View File

@@ -0,0 +1,109 @@
<template>
<div class="history bg-white">
<div class="history-item p10 thin-bottom">
<div>陪访类型</div>
<div>被陪访人</div>
<div>日期</div>
</div>
<div class="divider" />
<van-list v-model="loading" :finished="finished" @load="getListData" finished-text="没有更多了...">
<div class="history-item p10 thin-bottom arrow" v-for="his in dataList" :key="his.accompanyId" @click="jumpToDetail(his.accompanyId)">
<div>{{ his.accompanyName }}</div>
<div>{{ his.accompanyAgentName }}</div>
<div class="time">
<span>{{ his.visitDate | dateFilter }}</span>
<van-icon name="arrow" />
</div>
</div>
</van-list>
</div>
</template>
<script>
import { getAgentAccompanyRecordPage } from '@/api/ebiz/eqiVisit/eqiVisit'
import dateUtil from '@/assets/js/utils/date-utils'
export default {
name: 'VisitHistory',
props: ['id'],
data() {
return {
loading: false,
finished: false,
dataList: [],
index: 5,
pageSize: 10,
pageNum: 1
}
},
methods: {
async getListData() {
let res = await getAgentAccompanyRecordPage({
pageReqDTO: {
pageSize: this.pageSize,
pageNum: this.pageNum
}
})
this.pageNum++
if (res.content.pageInfo.isLastPage) {
this.finished = true
}
this.dataList.push(...res.content.pageInfo.list)
this.loading = false
},
jumpToDetail(id) {
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#/eqiVisit/historyDetail/${id}`
},
routerInfo: { path: `/eqiVisit/historyDetail/${id}` }
})
}
},
filters: {
dateFilter(val) {
let time = new Date(Number(val))
return dateUtil.formatDate(time, 'yyyy-MM-dd')
}
}
}
</script>
<style lang="scss" scoped>
* {
box-sizing: border-box;
}
.history {
min-height: 100vh;
.history-item {
display: flex;
justify-content: space-around;
align-items: center;
font-size: 16px;
div {
flex: 1;
height: 30px;
line-height: 30px;
text-align: center;
color: #333;
}
}
.time {
position: relative;
}
.divider {
height: 10px;
background-color: #ebebeb;
}
}
.van-icon {
position: absolute;
font-weight: bold;
top: 50%;
transform: translate(50%, -60%);
}
</style>

View File

@@ -0,0 +1,320 @@
<template>
<div class="full-page bg-white">
<div class="form ml10 mr10">
<van-cell-group>
<van-field v-model="agentInfo.name" label="陪访人" readonly />
</van-cell-group>
<van-cell-group @click="selectNewcomer">
<van-field
right-icon="arrow"
v-model="newcomerInfo.name"
label="陪访新人姓名"
placeholder="请选择"
required
readonly
name="陪访新人姓名"
v-validate="'required'"
/>
</van-cell-group>
<PopupSelector
v-model="visitType"
label="陪访类型"
placeholder="请选择"
readonly
required
:columns="visitTypes"
name="陪访类型"
v-validate="'required'"
/>
<PopupSelector v-model="visitDate" label="日期" placeholder="请选择" readonly required name="日期" v-validate="'required'">
<template v-slot:default="{ closePopup }">
<van-datetime-picker v-model="currentDate" type="date" @confirm="onDateConfirm($event, closePopup)" @cancel="closePopup" />
</template>
</PopupSelector>
<PopupSelector v-model="visitDuration" label="时长(h)" placeholder="请选择" readonly required name="时长" v-validate="'required'">
<template v-slot:default="{ closePopup }">
<van-picker show-toolbar :columns="duration" @confirm="onDurationConfirm($event, closePopup)" @cancel="closePopup" />
</template>
</PopupSelector>
<van-cell-group>
<van-field v-model="visitName" label="客户姓名" placeholder="请输入" required name="客户姓名" v-validate="'required'" />
</van-cell-group>
<PopupSelector v-model="visitAge" :columns="ages" label="客户年龄" placeholder="请选择" readonly required name="客户年龄" v-validate="'required'" />
<PopupSelector v-model="areaName" label="地点" placeholder="请选择" readonly required name="地点" v-validate="'required'">
<template v-slot:default="{ closePopup }">
<van-area :area-list="areaList" value="450000" @confirm="onAreaConfirm($event, closePopup)" @cancel="closePopup" />
</template>
</PopupSelector>
<van-cell-group>
<van-field v-model="visitAddress" label="详细地址" placeholder="请输入" required clearable name="详细地址" v-validate="'required'" maxlength="200" />
</van-cell-group>
<p class="m10">现场照片(最多9张)</p>
<van-uploader class="m10" v-model="imageList" :after-read="uploadImg" :max-count="9" />
</div>
<van-button type="info" block v-no-more-click="2000" @click="submitInfo">提交</van-button>
<van-popup :value="isSearchMoreShow" position="bottom" @click-overlay="isSearchMoreShow = false">
<div class="action van-hairline--bottom" v-for="(action, i) in actions" :key="i" @click="jumpPage(action)">{{ action.title }}</div>
</van-popup>
<check-agent @checModelSuccessMethod="initThisPage" />
</div>
</template>
<script>
import PopupSelector from '@/components/common/PopupSelector.vue'
import areaList from '@/assets/js/utils/areaForSale'
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
import { uploadImg } from '@/api/ebiz/sale/sale'
import timeUtil from '@/assets/js/utils/date-utils'
import { getAgentInfo } from '@/api/ebiz/my/my'
import CheckAgent from '@/components/common/CheckAgent'
import { saveAccompanyRecord } from '@/api/ebiz/eqiVisit/eqiVisit'
export default {
name: 'VisitInfoRegister',
components: {
PopupSelector,
[CheckAgent.name]: CheckAgent
},
data() {
return {
newcomerInfo: {},
showFlag: true,
agentInfo: {},
imageList: [],
areaList,
newcomerName: '',
visitName: '',
visitAge: '',
areaName: '',
visitProvinceCode: '',
visitProvinceName: '',
visitCityCode: '',
visitCityName: '',
visitAreaCode: '',
visitAreaName: '',
visitAddress: '',
visitType: '',
visitTypes: ['入职前陪访', '新人首单', '冲刺挑战', '参与衔训'],
visitDate: '',
visitDuration: '',
show: false,
currentDate: new Date(),
isSearchMoreShow: false,
actions: [
{
title: '陪访记录',
to: '/eqiVisit/visitHistory'
},
{
title: '查询积分',
to: '/eqiVisit/scoreHistory'
},
{
title: '积分榜',
to: '/eqiVisit/scoreRanking'
},
{
title: '取消'
}
]
}
},
computed: {
// 陪访时长0.5-24
duration() {
let duration = []
for (let i = 0; i < 48; i++) {
duration.push(0.5 + i * 0.5)
}
return duration
},
// 客户年龄18-60
ages() {
let age = []
for (let i = 18; i <= 80; i++) {
age.push(i)
}
return age
}
},
methods: {
initThisPage(showFlag) {
this.showFlag = showFlag
if (this.showFlag) {
return
}
this.init()
},
async init() {
// 拦截右上角按钮
this.setRightBtn()
// 获取代理人信息
await this.setAgentInfo({})
// 新增陪访记录时清空缓存数据, 编辑时从缓存取出数据回显
if (this.$route.query.edit) {
this.newcomerInfo = JSON.parse(this.$CacheUtils.getLocItem('newcomer'))
} else {
this.$CacheUtils.removeLocItem('newcomer')
}
},
async setAgentInfo() {
let res = await getAgentInfo({})
if (res.result === '0') {
this.agentInfo = res
} else {
this.$toast(res.resultMessage)
}
},
selectNewcomer() {
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#/eqiVisit/newcomerList`
},
routerInfo: { path: '/eqiVisit/newcomerList' }
})
},
setRightBtn() {
// setTimeout(() => {
// // eslint-disable-next-line no-undef
// EWebBridge.webCallAppInJs('webview_right_button', {
// btns: [
// {
// title: '查询更多'
// }
// ]
// })
// }, 1000)
window.appCallBack = this.appCallBack
},
appCallBack(data) {
if (data.trigger == 'right_button_click') {
this.isSearchMoreShow = true
}
},
async uploadImg(file) {
let data = new FormData()
data.append('imgPath', file.file)
this.$toast.loading({
duration: 0,
loadingType: 'spinner'
})
let res = await uploadImg(data)
this.$toast.clear()
if (res.result === '0') {
file.rgssUrl = res.path
} else {
this.imageList.splice(this.imageList.length - 1, 1)
}
},
onDateConfirm(data, fun) {
this.visitDate = timeUtil.formatDate(data, 'yyyy-MM-dd')
fun()
},
onAreaConfirm(data, fun) {
let [province, city, area] = [data[0], data[1], data[2]]
;[this.visitProvinceCode, this.visitCityCode, this.visitAreaCode] = [province.code, city.code, area.code]
;[this.visitProvinceName, this.visitCityName, this.visitAreaName] = [province.name, city.name, area.name]
this.areaName = getAreaName(data)
fun()
},
onDurationConfirm(data, fun) {
this.visitDuration = String(data)
fun()
},
async submitInfo() {
let res = await this.$validator.validate()
if (!res) {
return this.$toast(this.$validator.errors.all()[0])
}
// 保存陪访信息
let accompanyType = `0${this.visitTypes.findIndex(type => type === this.visitType) + 1}`
let param = {
accompanyRecordDTO: {
agentCode: this.agentInfo.jobNo,
agentName: this.agentInfo.name,
applGrade: this.agentInfo.agentGrade,
accompanyAgentCode: this.newcomerInfo.agentCode,
accompanyAgentName: this.newcomerInfo.name,
accompanyApplGrade: this.newcomerInfo.applGrade,
accompanyType,
accompanyName: this.visitType,
visitDate: this.visitDate,
visitDuration: this.visitDuration,
visitName: this.visitName,
visitAge: this.visitAge,
visitProvinceCode: this.visitProvinceCode,
visitProvinceName: this.visitProvinceName,
visitCityCode: this.visitCityCode,
visitCityName: this.visitCityName,
visitAreaCode: this.visitAreaCode,
visitAreaName: this.visitAreaName,
visitAddress: this.visitAddress
},
mediaDTOLst: this.imageList.map(img => ({ rgssUrl: img.rgssUrl }))
}
res = await saveAccompanyRecord(param)
if (res.result === '0') {
let { rewardCount, allRewardCount } = res.content
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#/eqiVisit/registerResult?single=${rewardCount}&total=${allRewardCount}&agentCode=${this.agentInfo.jobNo}`
},
routerInfo: { path: `/eqiVisit/registerResult?single=${rewardCount}&total=${allRewardCount}&agentCode=${this.agentInfo.jobNo}` }
})
} else {
this.$toast(res.resultMessage)
}
},
jumpPage(route) {
if (route.to) {
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#${route.to}`
},
routerInfo: { path: route.to }
})
} else {
this.isSearchMoreShow = false
}
}
}
}
</script>
<style lang="scss" scoped>
.full-page {
width: 100vw;
height: 100vh;
position: fixed;
overflow: auto;
.form {
padding-bottom: 50px;
flex: 1;
}
.action {
text-align: center;
font-size: 16px;
padding: 12px;
}
}
.van-button {
border-radius: 0;
position: fixed;
bottom: 0;
}
/deep/ .van-tabs__line {
background-color: #1989fa !important;
}
</style>