【new】 完成人力发展-个人中心模块接口对接

This commit is contained in:
tian.guangyuan
2020-03-17 13:20:38 +08:00
parent 22927aed46
commit 5b4e332392
7 changed files with 112 additions and 54 deletions

View File

@@ -1,6 +1,15 @@
import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'
// 个人中心 - 查询接口
export function getPersonalInfo(data) {
return request({
url: getUrl('/agent/personal/getInfo', 1),
method: 'post',
data
})
}
// 人才库列表查询接口
export function getAgentPersonnelList(data = {}) {
return request({
@@ -43,15 +52,6 @@ export function queryWeekly(data) {
})
}
// 查询日志页面人才库列表
export function queryListFirst(data) {
return request({
url: getUrl('/agent/personnel/queryListFirst', 1),
method: 'post',
data
})
}
// 查询日志页面增员列表
export function queryRecordList(data) {
return request({

View File

@@ -3,8 +3,9 @@
<!-- <div class="nav-item"> -->
<van-cell is-link class="relative" @click="rout(config)">
<template slot="title">
<img class="t-cell-icon" :src="config.src" alt="config" />
<span class="custom-title">{{ config.title }}</span>
<van-icon v-if="config.icon" class="t-cell-icon" size="6.4vw" :name="config.icon" />
<img v-else class="t-cell-icon" :src="config.src" alt="config" />
<span class="custom-title"> {{ config.title }}</span>
</template>
</van-cell>
<!-- </div> -->

View File

@@ -25,10 +25,18 @@ export default {
methods: {
async getInfo() {
// 获取代理人信息
let userInfo = localStorage.getItem('userInfo')
if (userInfo) {
this.userInfo = JSON.parse(userInfo)
} else {
const res = await getAgentInfo({})
console.log(res)
if (res.result == 0) {
this.userInfo = res
localStorage.setItem('agentCode', res.jobNo)
localStorage.setItem('userInfo', JSON.stringify(res))
} else {
this.$toast(res.resultMessage)
}
}
}
},

View File

@@ -112,7 +112,6 @@ export default {
},
mounted() {
this.queryWeekly()
this.queryListFirst()
this.getAgentPersonnelListFirst()
this.queryRecordList()
},

View File

@@ -25,22 +25,22 @@ export default {
navList: [
{
title: '个人中心',
src: 'http://localhost:8080/favicon.ico',
icon: 'user-o',
path: '/manpower/PersonalCenter'
},
{
title: '增员工具',
src: 'http://localhost:8080/favicon.ico',
icon: 'friends-o',
path: '/manpower/IncreaseStaffTools'
},
{
title: '活动量管理',
src: 'http://localhost:8080/favicon.ico',
icon: 'todo-list-o',
path: '/manpower/ActiveManagement'
},
{
title: '培训上岗',
src: 'http://localhost:8080/favicon.ico',
icon: 'records',
path: '/manpower/Training'
}
]

View File

@@ -1,76 +1,78 @@
<template>
<div class="personal-center-main">
<div class="personal-center-main" v-if="success">
<van-cell-group class="pl15 mt10">
<van-cell title="姓名" :value="'业务员工号value'" />
<van-cell title="入职职级" :value="'业务员工号value'" />
<van-cell title="现任职级" :value="'业务员工号value'" />
<van-cell title="入职时间" :value="'业务员工号value'" />
<van-cell title="现任职级时间" :value="'业务员工号value'" />
<van-cell title="姓名" :value="agentInfo.name" />
<van-cell title="入职职级" :value="agentInfo.entryGrade" />
<van-cell title="现任职级" :value="agentInfo.presentGrade" />
<van-cell title="入职时间" :value="agentInfo.entryTime" />
<van-cell title="现任职级时间" :value="agentInfo.presentGradeTime" />
</van-cell-group>
<van-tabs v-model="active" class="mt10" sticky>
<van-tab title="团队人力架构">
<van-cell-group class="pl15">
<van-cell title="直辖组人力" :value="'业务员工号value'" />
<van-cell title="直辖部人力" :value="'业务员工号value'" />
<van-cell title="直辖部主管数" :value="'业务员工号value'" />
<van-cell title="大直辖人力" :value="'业务员工号value'" />
<van-cell title="直接增援人数" :value="'业务员工号value'" />
<van-cell title="直接育成主管数量" :value="'业务员工号value'" />
<van-cell title="直接育成部门数量" :value="'业务员工号value'" />
<van-cell title="全辖团队人力" :value="'业务员工号value'" />
<van-cell title="直辖组人力" :value="teamInfo.jurisdictionGroupNum" />
<van-cell title="直辖部人力" :value="teamInfo.jurisdictionDepartNum" />
<van-cell title="直辖部主管数" :value="teamInfo.jurisdictionGroupManagerNum" />
<van-cell title="大直辖人力" :value="teamInfo.majorJurisdictionNum" />
<van-cell title="直接增援人数" :value="teamInfo.directReinforceNum" />
<van-cell title="直接育成主管数量" :value="teamInfo.directBredManagerNum" />
<van-cell title="直接育成部门数量" :value="teamInfo.directBredDepartNum" />
<van-cell title="全辖团队人力" :value="teamInfo.allTeamNum" />
</van-cell-group>
</van-tab>
<van-tab title="实时新增数据">
<van-grid :border="true" :column-num="2" class="p15">
<van-grid-item>
当月个人新增
<span class="c-gray-darker fwb mt20">345</span>
<span class="c-gray-darker fwb mt20">{{ realAddDataInfo.currentMonthPersonalAdd }}</span>
</van-grid-item>
<van-grid-item>
直辖组新增
<span class="c-gray-darker fwb mt20">234</span>
<span class="c-gray-darker fwb mt20">{{ realAddDataInfo.jurisdictionGroupAdd }}</span>
</van-grid-item>
<van-grid-item>
直辖部新增
<span class="c-gray-darker fwb mt20">111</span>
<span class="c-gray-darker fwb mt20">{{ realAddDataInfo.jurisdictionDepartAdd }}</span>
</van-grid-item>
<van-grid-item>
大直辖新增
<span class="c-gray-darker fwb mt20">6436</span>
<span class="c-gray-darker fwb mt20">{{ realAddDataInfo.majorJurisdictionAdd }}</span>
</van-grid-item>
</van-grid>
</van-tab>
<van-tab title="人力架构">
<van-collapse v-model="activeNames" accordion>
<van-collapse-item :name="item" v-for="item of 2" :key="item">
<div slot="title"><span class="tagJOB">SMS</span> 标题{{ item }}</div>
<van-collapse-item v-for="(item, index) of frameworkInfoLstAdmin" :name="item.gradeChineseName" :key="index">
<div slot="title">
<span class="tagJOB">{{ item.gradeEnglishName }}</span>
{{ item.gradeChineseName }} ({{ item.manageStaffNum }})
</div>
<van-grid :border="true" :column-num="2" class="p15">
<van-grid-item>
当月个人新增
<span class="c-gray-darker fwb mt20">345</span>
<span class="c-gray-darker fwb mt20">{{ item.personalRealAddDataInfo.currentMonthPersonalAdd }}</span>
</van-grid-item>
<van-grid-item>
直辖组新增
<span class="c-gray-darker fwb mt20">234</span>
<span class="c-gray-darker fwb mt20">{{ item.personalRealAddDataInfo.jurisdictionGroupAdd }}</span>
</van-grid-item>
<van-grid-item>
直辖部新增
<span class="c-gray-darker fwb mt20">111</span>
<span class="c-gray-darker fwb mt20">{{ item.personalRealAddDataInfo.jurisdictionDepartAdd }}</span>
</van-grid-item>
<van-grid-item>
大直辖新增
<span class="c-gray-darker fwb mt20">6436</span>
<span class="c-gray-darker fwb mt20">{{ item.personalRealAddDataInfo.majorJurisdictionAdd }}</span>
</van-grid-item>
</van-grid>
</van-collapse-item>
</van-collapse>
<van-cell-group class="">
<van-cell>
<van-cell v-for="(item, index) of frameworkInfoLstNotAdmin" :key="index">
<div slot="title">
<span class="tagJOB">SMS</span>
<span class="name">标题</span>
<span class="tagJOB">{{ item.gradeEnglishName }}</span>
<span class="name">{{ item.gradeChineseName }}</span>
</div>
</van-cell>
</van-cell-group>
@@ -80,8 +82,18 @@
</template>
<script>
import { Cell, CellGroup, Tab, Tabs, Grid, GridItem, Collapse, CollapseItem } from 'vant'
const isAdmin = {
BD: true,
SBM: true,
BM: true,
SAS: true,
AS: true,
CM: false,
CA: false
}
import { Cell, CellGroup, Tab, Tabs, Grid, GridItem, Collapse, CollapseItem } from 'vant'
import { getPersonalInfo } from '@/api/ebiz/manpower/manpower'
export default {
name: 'PersonalCenter',
components: {
@@ -96,12 +108,50 @@ export default {
},
data() {
return {
activeNames: {},
active: ''
activeNames: [],
active: '',
success: false,
agentInfo: null,
realAddDataInfo: null,
frameworkInfoLst: null,
teamInfo: null
}
},
computed: {
frameworkInfoLstAdmin: function() {
if (this.frameworkInfoLst) {
return this.frameworkInfoLst.filter(item => {
return isAdmin[item.gradeEnglishName]
})
}
return []
},
frameworkInfoLstNotAdmin: function() {
if (this.frameworkInfoLst) {
return this.frameworkInfoLst.filter(item => {
return !isAdmin[item.gradeEnglishName]
})
}
return []
}
},
watch: {},
created() {},
created() {
getPersonalInfo({
agentCode: localStorage.getItem('agentCode')
})
.then(res => {
if (res.result == 0) {
for (let key of Object.keys(res.content)) {
this[key] = res.content[key]
}
this.success = true
} else {
this.$toast(res.resultMessage)
}
})
.catch(() => {})
},
mounted() {},
methods: {}
}

View File

@@ -25,13 +25,13 @@ export default {
navList: [
{
title: '增员分享',
src: 'http://localhost:8080/favicon.ico',
icon: 'cluster-o',
path: '/',
share: true
},
{
title: '增员审批',
src: 'http://localhost:8080/favicon.ico',
icon: 'comment-o',
path: '/agentEenter/approve/ApproveList'
}
]