mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 03:26:45 +08:00
调试接口
This commit is contained in:
65
src/api/ebiz/eqiVisit/eqiVisit.js
Normal file
65
src/api/ebiz/eqiVisit/eqiVisit.js
Normal 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
|
||||
})
|
||||
}
|
||||
@@ -94,6 +94,16 @@ let hgb = ['/sale/order/selectHgb', '/sale/order/getHgbDetail']
|
||||
|
||||
let whitelist = ['/agent/white/getWhiteInfo']
|
||||
|
||||
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',
|
||||
...proposal,
|
||||
@@ -106,7 +116,8 @@ let whiteList = [
|
||||
...preserve,
|
||||
...renewalManage,
|
||||
...hgb,
|
||||
...whitelist
|
||||
...whitelist,
|
||||
...eqiVisit
|
||||
]
|
||||
|
||||
// 创建axios实例
|
||||
|
||||
@@ -33,6 +33,35 @@ 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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
// 宽度设置
|
||||
@include set-width($width-list);
|
||||
// 宽度设置
|
||||
|
||||
@@ -11,7 +11,7 @@ let apiDomain, imgDomain, assetsUrl, mainUrl, payUrl, zssqUrl ,REQ_PWD, CACHE_EN
|
||||
console.log('环境:', process.env.VUE_APP_FLAG)
|
||||
switch (process.env.VUE_APP_FLAG) {
|
||||
case 'dev':
|
||||
apiDomain = 'http://139.199.50.151:7000/api/v2' // 国富api ///api/v1
|
||||
apiDomain = 'http://139.199.50.151:7000/api/v1' // 国富api ///api/v1
|
||||
imgDomain = 'http://211.159.248.123:7012/updown' // dev
|
||||
// 静态服务资源
|
||||
assetsUrl = 'http://139.199.50.151:8000/app/'
|
||||
@@ -22,7 +22,7 @@ switch (process.env.VUE_APP_FLAG) {
|
||||
zssqUrl = 'http://139.199.50.151/html/test/index.html#/'
|
||||
REQ_PWD = '41424344454631323334353637383930'
|
||||
CACHE_ENCRYP = '41424344454631323334353637383930'
|
||||
API_VERSION = 'v2'
|
||||
API_VERSION = 'v1'
|
||||
break
|
||||
case 'uat':
|
||||
apiDomain = 'http://115.159.235.59:7000/api/v1' // 国富api
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="bg-white">
|
||||
<div class="bg-white newcomerlist">
|
||||
<van-sticky>
|
||||
<van-tabs v-model="deptIndex">
|
||||
<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">
|
||||
<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="onLoad">
|
||||
<div v-for="(item, i) in list" :key="i" class="van-hairline--bottom newcomer">
|
||||
<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>
|
||||
@@ -18,7 +18,7 @@
|
||||
<p class="mb10 agentCode">工号: {{ item.agentCode }}</p>
|
||||
<div class="detail">
|
||||
<span>{{ item.name }}</span>
|
||||
<span>{{ item.gender }}</span>
|
||||
<span>{{ item.gender | genderFilter }}</span>
|
||||
<span>{{ item.phone }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,7 +31,9 @@
|
||||
<script>
|
||||
import avatar from '@/assets/images/bnf_avatar.png'
|
||||
import { Tab, Tabs, Sticky } from 'vant'
|
||||
import { getAccompanyComCode, getAccompanyPerson } from '@/api/ebiz/eqiVisit/eqiVisit'
|
||||
export default {
|
||||
name: 'NewcomerList',
|
||||
components: {
|
||||
[Tab.name]: Tab,
|
||||
[Tabs.name]: Tabs,
|
||||
@@ -41,93 +43,93 @@ export default {
|
||||
return {
|
||||
avatar,
|
||||
isLoading: false,
|
||||
list: [
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' },
|
||||
{ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' }
|
||||
],
|
||||
list: [],
|
||||
loading: false,
|
||||
finished: false,
|
||||
deptIndex: 0,
|
||||
depts: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'aaa部门'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'bbb部门'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'ccc部门'
|
||||
}
|
||||
],
|
||||
depts: [],
|
||||
groupIndex: 0,
|
||||
groups: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'aaa组'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'bbb组'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'ccc组'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: 'ddd组'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: 'eee组'
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: 'fff组'
|
||||
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: {
|
||||
onRefresh() {
|
||||
setTimeout(() => {
|
||||
this.isLoading = false
|
||||
this.count++
|
||||
}, 1000)
|
||||
async getDepts() {
|
||||
let res = await getAccompanyComCode({})
|
||||
if (res.result === '0') {
|
||||
let dept = {
|
||||
...res.content.branchInfoBeanList[0]
|
||||
}
|
||||
let d = JSON.parse(JSON.stringify(dept))
|
||||
d.code = '1450100201'
|
||||
d.subBranchGroupLst.splice(0, 4)
|
||||
this.depts = [dept, d]
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 异步更新数据
|
||||
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
|
||||
setTimeout(() => {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
this.list.push({ agentCode: '0232389', name: 'xxx', gender: 0, phone: '13888888888' })
|
||||
}
|
||||
|
||||
// 加载状态结束
|
||||
// 刷新组
|
||||
async onRefresh() {
|
||||
this.pageNum = 1
|
||||
this.finished = false
|
||||
await this.getNewcomers()
|
||||
this.loading = false
|
||||
|
||||
// 数据全部加载完成
|
||||
if (this.list.length >= 40) {
|
||||
this.finished = true
|
||||
this.isLoading = false
|
||||
},
|
||||
// 切换部
|
||||
onDeptChanged() {
|
||||
this.pageNum = 1
|
||||
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
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
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 ? '男' : '女'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,4 +161,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .van-tabs__line {
|
||||
background-color: #1989fa !important;
|
||||
}
|
||||
|
||||
.newcomerlist {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<div class="wrapper">
|
||||
<img class="mb30 icon" :src="img" />
|
||||
<h1 class="blue mb30">恭喜完成陪访</h1>
|
||||
<p class="blue mb30">奖励: +1积分</p>
|
||||
<h2 class="blue mb30">累计积分99分</h2>
|
||||
<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">继续登记陪访</van-button>
|
||||
<van-button class="mr5" plain color="#199ed8" type="primary" @click="accompanyAgain">继续登记陪访</van-button>
|
||||
<van-button class="ml5" plain color="#199ed8" type="primary">积分榜</van-button>
|
||||
<van-button color="#199ed8" type="primary">返回</van-button>
|
||||
<van-button color="#199ed8" type="primary" @click="quit">返回</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,10 +17,58 @@
|
||||
<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'
|
||||
})
|
||||
},
|
||||
accompanyAgain() {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
forbidSwipeBack: '1',
|
||||
url: location.origin + `/#/eqiVisit/visitInfoRegister?agentCode=${this.agentCode}`
|
||||
},
|
||||
routerInfo: { path: `/eqiVisit/visitInfoRegister?agentCode=${this.agentCode}` }
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,34 +2,34 @@
|
||||
<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="data.length">
|
||||
<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="van-hairline--bottom">
|
||||
<template v-if="agentRank">
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 2em;">{{ agentRank.rank }}</td>
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 3em;">{{ agentRank.name }}</td>
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 4em;">{{ agentRank.org }}</td>
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 2em;">{{ agentRank.level }}</td>
|
||||
<tr class="hairline-bottom">
|
||||
<template v-if="agentRank.name">
|
||||
<td class="thin-right thin-bottom" style="max-width: 2em;">{{ agentRank.rank }}</td>
|
||||
<td class="thin-right thin-bottom" style="max-width: 3em;">{{ agentRank.name }}</td>
|
||||
<td class="thin-right thin-bottom" style="max-width: 4em;">{{ agentRank.org }}</td>
|
||||
<td class="thin-right thin-bottom" style="max-width: 2em;">{{ agentRank.level }}</td>
|
||||
<td class="van-hairline--bottom" style="max-width: 2em;" @click="jumpToDetail">{{ agentRank.score }}</td>
|
||||
</template>
|
||||
<td v-else colspan="5">暂无积分</td>
|
||||
<td class="van-hairline--bottom" v-else colspan="5">暂无积分</td>
|
||||
</tr>
|
||||
|
||||
<tr v-for="(d, index) in data" :key="index">
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 2em;">{{ d.rank }}</td>
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 3em;">{{ d.name }}</td>
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 4em;">{{ d.org }}</td>
|
||||
<td class="van-hairline--right van-hairline--bottom" style="max-width: 2em;">{{ d.level }}</td>
|
||||
<td class="van-hairline--bottom" style="max-width: 2em;">{{ d.score }}</td>
|
||||
<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">
|
||||
<div class="empty pt150" v-else>
|
||||
<p class="mb10">暂无排名</p>
|
||||
<img :src="empty" />
|
||||
</div>
|
||||
@@ -40,6 +40,7 @@
|
||||
<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
|
||||
@@ -47,26 +48,35 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
empty,
|
||||
agentRank: null,
|
||||
agentRank: {},
|
||||
isLoading: false,
|
||||
theads: ['排名', '姓名', '所在机构', '职级', '积分'],
|
||||
data: []
|
||||
ranking: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
noticeText() {
|
||||
if (this.data.length) {
|
||||
if (this.ranking.length) {
|
||||
return '温馨提示: 每日凌晨更新前一日积分排行,下拉刷新最新排行'
|
||||
} else {
|
||||
return '温馨提示:当前暂无最新排名,赶紧去陪访吧!'
|
||||
}
|
||||
},
|
||||
agentCode() {
|
||||
return this.$route.query.agentCode
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.queryRanking()
|
||||
},
|
||||
methods: {
|
||||
onRefresh() {
|
||||
setTimeout(() => {
|
||||
async queryRanking() {
|
||||
let res = await getAccompanyRank({ billboardStart: 0, billboardEnd: 20, agentCode: this.agentCode })
|
||||
this.ranking = res.content.statisticsBeanList
|
||||
},
|
||||
async onRefresh() {
|
||||
await this.queryRanking()
|
||||
this.isLoading = false
|
||||
}, 2000)
|
||||
},
|
||||
jumpToDetail() {
|
||||
this.$jump({
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<div class="full-page bg-white">
|
||||
<div class="form ml10 mr10">
|
||||
<van-cell-group>
|
||||
<van-field v-model="accompanyingName" label="陪访人" readonly />
|
||||
<van-field v-model="agentInfo.name" label="陪访人" readonly />
|
||||
</van-cell-group>
|
||||
<van-cell-group>
|
||||
<van-cell-group @click="selectNewcomer">
|
||||
<van-field
|
||||
right-icon="arrow"
|
||||
v-model="newcomerName"
|
||||
v-model="newcomerInfo.name"
|
||||
label="陪访新人姓名"
|
||||
placeholder="请选择"
|
||||
required
|
||||
@@ -37,25 +37,27 @@
|
||||
</template>
|
||||
</PopupSelector>
|
||||
<van-cell-group>
|
||||
<van-field v-model="customerName" label="客户姓名" placeholder="请输入" required name="客户姓名" v-validate="'required'" />
|
||||
<van-field v-model="visitName" label="客户姓名" placeholder="请输入" required name="客户姓名" v-validate="'required'" />
|
||||
</van-cell-group>
|
||||
<PopupSelector v-model="customerAge" :columns="ages" label="客户年龄" placeholder="请选择" readonly required name="客户年龄" v-validate="'required'" />
|
||||
<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="homeAddress" label="详细地址" placeholder="请输入" required clearable name="详细地址" v-validate="'required'" maxlength="200" />
|
||||
<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="fileList" :after-read="afterRead" :max-count="9" />
|
||||
<van-uploader class="m10" v-model="imageList" :after-read="uploadImg" :max-count="9" />
|
||||
</div>
|
||||
<van-button type="info" block @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>
|
||||
|
||||
@@ -65,25 +67,34 @@ 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
|
||||
PopupSelector,
|
||||
[CheckAgent.name]: CheckAgent
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileList: [],
|
||||
newcomerInfo: {},
|
||||
showFlag: true,
|
||||
agentInfo: {},
|
||||
imageList: [],
|
||||
areaList,
|
||||
accompanyingName: '张三',
|
||||
newcomerName: '',
|
||||
customerName: '',
|
||||
customerAge: '',
|
||||
visitName: '',
|
||||
visitAge: '',
|
||||
areaName: '',
|
||||
homeProvince: '',
|
||||
homeCity: '',
|
||||
homeArea: '',
|
||||
homeAddress: '',
|
||||
visitProvinceCode: '',
|
||||
visitProvinceName: '',
|
||||
visitCityCode: '',
|
||||
visitCityName: '',
|
||||
visitAreaCode: '',
|
||||
visitAreaName: '',
|
||||
visitAddress: '',
|
||||
visitType: '',
|
||||
visitTypes: ['入职前陪访', '新人首单', '冲刺挑战', '参与衔训'],
|
||||
visitDate: '',
|
||||
@@ -128,10 +139,44 @@ export default {
|
||||
return age
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setRightBtn()
|
||||
},
|
||||
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
|
||||
@@ -150,7 +195,7 @@ export default {
|
||||
this.isSearchMoreShow = true
|
||||
}
|
||||
},
|
||||
async afterRead(file) {
|
||||
async uploadImg(file) {
|
||||
let data = new FormData()
|
||||
data.append('imgPath', file.file)
|
||||
this.$toast.loading({
|
||||
@@ -158,9 +203,11 @@ export default {
|
||||
loadingType: 'spinner'
|
||||
})
|
||||
let res = await uploadImg(data)
|
||||
console.log('res :>> ', res)
|
||||
this.$toast.clear()
|
||||
if (res.result === '0') {
|
||||
file.result = res.path
|
||||
file.rgssUrl = res.path
|
||||
} else {
|
||||
this.imageList.splice(this.imageList.length - 1, 1)
|
||||
}
|
||||
},
|
||||
onDateConfirm(data, fun) {
|
||||
@@ -169,7 +216,8 @@ export default {
|
||||
},
|
||||
onAreaConfirm(data, fun) {
|
||||
let [province, city, area] = [data[0], data[1], data[2]]
|
||||
;[this.homeProvince, this.homeCity, this.homeArea] = [province.code, city.code, area.code]
|
||||
;[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()
|
||||
},
|
||||
@@ -178,12 +226,50 @@ export default {
|
||||
fun()
|
||||
},
|
||||
async submitInfo() {
|
||||
this.isSearchMoreShow = true
|
||||
// let res = await this.$validator.validate()
|
||||
// if (!res) {
|
||||
// return this.$toast(this.$validator.errors.all()[0])
|
||||
// }
|
||||
// console.log('res :>> ', res)
|
||||
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) {
|
||||
@@ -227,4 +313,8 @@ export default {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
/deep/ .van-tabs__line {
|
||||
background-color: #1989fa !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user