Merge branch 'feature/GFRS-717【0402】人力发展-活动量管理' of http://112.124.100.131/GFRS/ebiz-h5 into feature/GFRS-717【0402】人力发展-活动量管理

# Conflicts:
#	src/router/ebiz/manpower.js
This commit is contained in:
tian.guangyuan
2020-03-13 18:30:35 +08:00
11 changed files with 388 additions and 36 deletions

View File

@@ -9,3 +9,21 @@ export function getAgentPersonnelList(data) {
data
})
}
// 活动量统计周报
export function queryWeekly(data) {
return request({
url: getUrl('/agent/activityRecord/queryWeekly', 0),
method: 'post',
data
})
}
// 查询新增人才库
export function queryList(data) {
return request({
url: getUrl('/agent/personnel/saveOrUpdate', 0),
method: 'post',
data
})
}

View File

@@ -60,6 +60,13 @@ Validator.extend('age', {
return value > 17 && /^\d{1,3}$/.test(value)
}
})
//年龄
Validator.extend('maxAge', {
getMessage: () => '年龄不得大于100周岁',
validate: value => {
return value <= 100 && /^\d{1,3}$/.test(value)
}
})
//被保人年龄不得小于18周岁
Validator.extend('appntAge', {
getMessage: () => '年龄不得小于18周岁',

View File

@@ -1,13 +1,14 @@
<template>
<div>
<van-cell :title="ActivityLogInfo.name" is-link :icon="ActivityLogInfo.avatarUrl" value-class="text-left">
<van-cell :title="ActivityLogInfo.name" :is-link="isEdit" :icon="ActivityLogInfo.avatarUrl" value-class="text-left">
<span class="mr20">{{ ActivityLogInfo.age }}</span>
<span>{{ ActivityLogInfo.flag }}</span>
<van-icon slot="right-icon" name="edit" style="line-height: inherit;" color="#1989fa" size="24" />
<van-icon slot="right-icon" name="edit" style="line-height: inherit;" :color="isEdit ? '#1989fa' : 'transparent'" size="24" @click="toEdit" />
</van-cell>
</div>
</template>
<script>
import formatDate from '@/assets/js/utils/date-utils'
import { Cell, CellGroup, Image } from 'vant'
export default {
@@ -25,13 +26,44 @@ export default {
name: '王辉',
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
age: '35岁',
flag: '同业'
flag: '同业',
currentTime: ''
}
}
}
},
data() {
return {}
return {
isEdit: true
}
},
methods: {
toEdit() {
if (!this.isEdit) {
return false
}
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/manpower/ActivityLog/Edit`
},
routerInfo: { path: '/manpower/ActivityLog/Edit' }
})
}
},
computed: {
currentTime() {
return this.ActivityLogInfo.currentTime
}
},
watch: {
currentTime(newVal) {
if (newVal === formatDate.formatDate().split(' ')[0]) {
this.isEdit = true
} else {
this.isEdit = false
}
}
}
}
</script>

View File

@@ -37,7 +37,7 @@ export default {
methods: {
rout(config) {
if (!config.share) {
let url = config.path.split("/").pop()
let url = config.path.split('/').pop()
let path = config.path
this.$jump({
flag: 'h5',

View File

@@ -1,7 +1,11 @@
// 人力发展
let mockBaseUrl = ''
let mockBaseUrl = 'http://rap2api.taobao.org/app/mock/247074'
export default {
// 例子
'/demo/url': mockBaseUrl + '/demo/url',
// 查询日志统计周报
'/agent/activityRecord/queryWeekly': mockBaseUrl + '/agent/activityRecord/queryWeekly',
// 查询新增人才库
'/agent/personnel/saveOrUpdate': mockBaseUrl + '/agent/personnel/saveOrUpdate',
}

View File

@@ -11,6 +11,7 @@ import product from './product'
import serve from './serve'
import common from './common'
import survey from './survey'
import manpower from './manpower'
const mockBaseUrl = 'http://rap2api.taobao.org/app/mock'
let baseObj = {
@@ -18,6 +19,6 @@ let baseObj = {
'/user/info': mockBaseUrl + '/223948/info',
'/user/logout': mockBaseUrl + '/223948/logout'
}
Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, survey)
Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, survey, manpower)
export default baseObj

View File

@@ -13,8 +13,10 @@ const TalentPoolList = () => import('@/views/ebiz/manpower/talentPool/List')
const TalentPoolAdd = () => import('@/views/ebiz/manpower/talentPool/Add')
const TalentPoolEdit = () => import('@/views/ebiz/manpower/talentPool/Edit')
export default [
{
const ActivityLogList = () => import('@/views/ebiz/manpower/activityLog/List')
const ActivityLogEdit = () => import('@/views/ebiz/manpower/activityLog/Edit')
export default [{
// 人力发展
path: '/manpower/Navigation',
name: 'Navigation',
@@ -93,5 +95,25 @@ export default [
title: '基本信息',
index: 103
}
},
{
// 当日增员活动日志
path: '/manpower/ActivityLog/List',
name: 'ActivityLogList',
component: ActivityLogList,
meta: {
title: '当日增员活动日志',
index: 100
}
},
{
// 日志详情
path: '/manpower/ActivityLog/Edit',
name: 'ActivityLogEdit',
component: ActivityLogEdit,
meta: {
title: '日志详情',
index: 100
}
}
]

View File

@@ -6,49 +6,57 @@
<van-grid :column-num="2">
<van-grid-item>
<p class="fs14">周白板面谈数量</p>
<p class="fs14 mt20 fwb">0</p>
<p class="fs14 mt20 fwb">{{ weeklyInfo.whiteboard }}</p>
</van-grid-item>
<van-grid-item>
<p class="fs14">周同业面谈数量</p>
<p class="fs14 mt20 fwb">0</p>
<p class="fs14 mt20 fwb">{{ weeklyInfo.sameTrade }}</p>
</van-grid-item>
</van-grid>
</van-collapse-item>
</van-collapse>
<!-- 人才库 -->
<div>
<p class="fs16 fwb bg-white p15">人才库</p>
<div class="text-center p15 bg-white van-hairline--top">
<van-icon name="add-square" size="50" color="#1989fa" />
<div class="bg-white">
<div class="p15">
<p class="fs16 fwb">人才库</p>
<div class="text-center van-hairline--top">
<van-icon name="add-square" size="50" color="#1989fa" />
</div>
</div>
<van-collapse v-model="personnelNames">
<van-collapse-item name="1" title-class="fs16 fwb">
<div slot="title" class="flex justify-content-s align-items-c">人才库 <van-icon name="plus" /></div>
<TalentPoolItem :talentPoolInfo="talentPoolInfo"> </TalentPoolItem>
</van-collapse-item>
</van-collapse>
</div>
<van-collapse v-model="personnelNames">
<van-collapse-item name="1" title-class="fs16 fwb">
<div slot="title" class="flex justify-content-s align-items-c">人才库 <van-icon name="plus" /></div>
<TalentPoolItem :talentPoolInfo="talentPoolInfo"> </TalentPoolItem>
</van-collapse-item>
</van-collapse>
<!-- 当日增员活动日志 -->
<div>
<p class="fs16 fwb bg-white p15">当日增员活动日志</p>
<div class="text-center p15 bg-white van-hairline--top">
<van-icon name="add-square" size="50" color="#1989fa" />
<div class="bg-white">
<div class="p15">
<p class="fs16 fwb">当日增员活动日志</p>
<div class="text-center van-hairline--top">
<van-icon name="add-square" size="50" color="#1989fa" @click="toEdit" />
</div>
</div>
<van-collapse v-model="personnelNames">
<van-collapse-item name="1" title-class="fs16 fwb">
<div slot="title" class="flex justify-content-s align-items-c">当日增员活动日志 <van-icon name="plus" /></div>
<ActivityLogItem :ActivityLogInfo="ActivityLogInfo"></ActivityLogItem>
<ActivityLogItem :ActivityLogInfo="ActivityLogInfo"></ActivityLogItem>
</van-collapse-item>
</van-collapse>
<p class="p15 text-right blue" @click="toList">查看全部>>></p>
</div>
<van-collapse v-model="personnelNames">
<van-collapse-item name="1" title-class="fs16 fwb">
<div slot="title" class="flex justify-content-s align-items-c">当日增员活动日志 <van-icon name="plus" /></div>
<ActivityLogItem :ActivityLogInfo="ActivityLogInfo"></ActivityLogItem>
</van-collapse-item>
</van-collapse>
</div>
</template>
<script>
import formatDate from '@/assets/js/utils/date-utils'
import { Collapse, CollapseItem, Grid, GridItem } from 'vant'
import TalentPoolItem from '@/components/ebiz/manpower/TalentPoolItem'
import ActivityLogItem from '@/components/ebiz/manpower/ActivityLogItem'
import { queryWeekly } from '@/api/ebiz/manpower/manpower'
export default {
components: {
@@ -71,10 +79,54 @@ export default {
name: '王辉',
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
age: '35岁',
flag: '同业'
flag: '同业',
currentTime: formatDate.formatDate().split(' ')[0]
},
// 日志统计周报信息
weeklyInfo: {
whiteboard: '', // 白板
sameTrade: '' // 同业
}
}
},
mounted() {
this.queryWeekly()
},
methods: {
// 获取日志统计周报
queryWeekly() {
queryWeekly({})
.then(res => {
console.log(res)
if (res.result == 0) {
this.weeklyInfo = res.content.weekly
} else {
this.$toast(res.resultMessage)
}
})
.catch(err => {
console.log(err)
})
},
toList() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/manpower/ActivityLog/List`
},
routerInfo: { path: '/manpower/ActivityLog/List' }
})
},
toEdit() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/manpower/ActivityLog/Edit`
},
routerInfo: { path: '/manpower/ActivityLog/Edit' }
})
}
}
}
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped></style>

View File

@@ -1 +0,0 @@
<!-- 活动日志-新增日志 -->

View File

@@ -1 +1,148 @@
<!-- 活动日志-修改日志 -->
<!-- 活动日志-修改日志 -->
<template>
<div>
<van-cell-group>
<van-field readonly v-model="dateTime" label="日期" />
<van-field required v-model="logName" label="姓名" placeholder="请输入姓名" v-validate="'required|name'" data-vv-name="姓名" />
<van-field required v-model="logAge" type="digit" label="年龄" placeholder="请输入年龄" v-validate="'required|onlyNumber|maxAge'" data-vv-name="年龄" />
<van-cell title="类型" required value-class="text-left">
<span
v-for="(type, index) in typeArr"
:key="index"
class="type-tag inline-flex justify-content-c align-items-c mr20"
@click="slectType(type)"
:class="logType == index ? 'select-tag' : ''"
>
{{ type.text }}
</span>
</van-cell>
<van-field
required
v-model="logTimes"
type="digit"
label="面谈次数"
placeholder="请输入面谈次数"
v-validate="'required|onlyNumber'"
data-vv-name="面谈次数"
/>
<van-field
required
readonly
v-model="logResult"
label="面谈结果"
placeholder="请选择面谈结果"
@click="handleRsult"
v-validate="'required'"
data-vv-name="面谈结果"
/>
<van-field
required
readonly
v-model="logOccupation"
label="过往职业"
placeholder="请选择过往职业"
@click="handleOccupation"
v-validate="'required'"
data-vv-name="过往职业"
/>
</van-cell-group>
<van-button color="#1989fa" type="primary" class="bottom-btn" size="large" @click="subInfo">保存</van-button>
<van-popup v-model="showResultArr" position="bottom" :style="{ height: '30%' }">
<van-picker show-toolbar :columns="resultArr" @cancel="showResultArr = false" @confirm="selectResult" />
</van-popup>
<van-popup v-model="showOccupationArr" position="bottom" :style="{ height: '30%' }">
<van-picker show-toolbar :columns="occupationArr" @cancel="showOccupationArr = false" @confirm="selectOccupation" />
</van-popup>
</div>
</template>
<script>
import formatDate from '@/assets/js/utils/date-utils'
import { Field, CellGroup, Popup, Picker, Cell, Button } from 'vant'
export default {
components: {
[Cell.name]: Cell,
[Field.name]: Field,
[CellGroup.name]: CellGroup,
[Button.name]: Button,
[Popup.name]: Popup,
[Picker.name]: Picker
},
data() {
return {
dateTime: formatDate.formatDate().split(' ')[0],
logName: '',
logAge: '',
logType: 0,
logTimes: '',
logResult: '',
logOccupation: '',
isAlike: false,
showResultArr: false,
showOccupationArr: false,
typeArr: [{ id: 0, text: '同业' }, { id: 1, text: '白板' }],
resultArr: [{ id: '01', text: '同意加盟' }, { id: '02', text: '进班了解' }, { id: '03', text: '考虑中' }, { id: '04', text: '不加盟' }],
occupationArr: [
{ id: '01', text: '一般内勤职员' },
{ id: '02', text: '其他金融行业' },
{ id: '03', text: '家庭主妇' },
{ id: '04', text: '自由职业' },
{ id: '05', text: '离退休人员' },
{ id: '06', text: '个体经营者' },
{ id: '07', text: '销售' },
{ id: '08', text: '公务员' },
{ id: '09', text: '保险外勤' },
{ id: '10', text: '保险内勤' },
{ id: '11', text: '其他' }
]
}
},
methods: {
subInfo() {
this.$validator.validateAll().then(result => {
if (result) {
console.log(result)
} else {
this.$toast(this.errors.all()[0])
}
})
},
slectType(type) {
this.logType = type.id
},
handleRsult() {
this.showResultArr = true
},
handleOccupation() {
this.showOccupationArr = true
},
selectResult(val) {
console.log(val)
this.logResult = val.text
this.showResultArr = false
},
selectOccupation(val) {
console.log(val)
this.logOccupation = val.text
this.showOccupationArr = false
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .van-cell__title {
max-width: 90px;
}
.type-tag {
// display: inline-block;
width: 40px;
height: 16px;
border: 1px solid gray;
border-radius: 4px;
}
.select-tag {
background: #1989fa;
color: white;
border: none;
}
</style>

View File

@@ -1 +1,71 @@
<!-- 活动日志-日志列表 -->
<!-- 活动日志-日志列表 -->
<template>
<div class="pb60">
<div class="p15 flex justify-content-s align-items-c">
<p>
<span v-if="isToday" class="fwb">今天</span>
<span v-else class="blue" @click="backToday">回到今天</span>
</p>
<p @click="openCalendar">{{ showTime }}</p>
</div>
<ActivityLogItem :ActivityLogInfo="ActivityLogInfo" v-for="(item, index) in 20" :key="index"></ActivityLogItem>
<div class="bottom-btn text-center">
<van-icon name="add-square" size="50" color="#1989fa" />
</div>
<van-popup v-model="showDateTime" position="bottom" :style="{ height: '30%' }">
<van-datetime-picker v-model="selectTime" type="date" :max-date="maxDate" @confirm="confirm" @cancel="cancel" />
</van-popup>
</div>
</template>
<script>
import formatDate from '@/assets/js/utils/date-utils'
import { DatetimePicker, Popup } from 'vant'
import ActivityLogItem from '@/components/ebiz/manpower/ActivityLogItem'
export default {
components: {
[DatetimePicker.name]: DatetimePicker,
[Popup.name]: Popup,
ActivityLogItem
},
data() {
return {
isToday: true,
showTime: `< ${formatDate.formatDate().split(' ')[0]} >`,
todayTime: `< ${formatDate.formatDate().split(' ')[0]} >`,
selectTime: new Date(),
maxDate: new Date(),
showDateTime: false,
ActivityLogInfo: {
name: '王辉',
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
age: '35岁',
flag: '同业',
currentTime: ''
}
}
},
mounted() {},
methods: {
openCalendar() {
this.showDateTime = true
},
confirm(val) {
this.showTime = `< ${formatDate.formatDate(val).split(' ')[0]} >`
this.ActivityLogInfo.currentTime = formatDate.formatDate(val).split(' ')[0]
if (this.showTime !== this.todayTime) {
this.isToday = false
}
this.showDateTime = false
},
cancel() {
this.showDateTime = false
},
backToday() {
this.showTime = this.todayTime
this.ActivityLogInfo.currentTime = formatDate.formatDate().split(' ')[0]
this.isToday = true
}
}
}
</script>