修改完善增员日志功能

This commit is contained in:
史旭文
2020-03-16 17:29:27 +08:00
parent 8705245e40
commit dbcfdcc485
7 changed files with 258 additions and 83 deletions

View File

@@ -13,7 +13,7 @@ export function getAgentPersonnelList(data) {
// 活动量统计周报
export function queryWeekly(data) {
return request({
url: getUrl('/agent/activityRecord/queryWeekly', 0),
url: getUrl('/agent/activityRecord/queryWeekly', 1),
method: 'post',
data
})
@@ -22,7 +22,34 @@ export function queryWeekly(data) {
// 查询日志页面人才库列表
export function queryListFirst(data) {
return request({
url: getUrl('/agent/personnel/queryListFirst', 0),
url: getUrl('/agent/personnel/queryListFirst', 1),
method: 'post',
data
})
}
// 查询日志页面增员列表
export function queryRecordList(data) {
return request({
url: getUrl('/agent/activityRecord/queryList', 1),
method: 'post',
data
})
}
// 日志详情查询
export function queryRecordDetail(data) {
return request({
url: getUrl('/agent/activityRecord/queryDetail', 1),
method: 'post',
data
})
}
// 新增日志
export function saveRecord(data) {
return request({
url: getUrl('/agent/activityRecord/saveOrUpdate', 1),
method: 'post',
data
})

View File

@@ -1,10 +1,13 @@
<template>
<div>
<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="isEdit ? '#1989fa' : 'transparent'" size="24" @click="toEdit" />
</van-cell>
<van-cell-group>
<van-cell :title="ActivityLogInfo.name" title-class="ml10" :is-link="isEdit" value-class="text-left">
<van-icon slot="icon" :name="ActivityLogInfo.avatarUrl || defaultAcatarUrl" style="line-height: inherit;" size="22" />
<span class="mr20">{{ ActivityLogInfo.age }}</span>
<span>{{ ActivityLogInfo.type == 0 ? '同业' : '白板' }}</span>
<van-icon slot="right-icon" name="edit" style="line-height: inherit;" :color="isEdit ? '#1989fa' : 'transparent'" size="24" @click="toEdit" />
</van-cell>
</van-cell-group>
</div>
</template>
<script>
@@ -23,18 +26,19 @@ export default {
required: true,
default: () => {
return {
recordCode: '',
name: '王辉',
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
// avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
age: '35岁',
flag: '同业',
currentTime: ''
type: '同业',
recordDate: ''
}
}
}
},
data() {
return {
isEdit: true
defaultAcatarUrl: 'https://b.yzcdn.cn/vant/icon-demo-1126.png'
}
},
methods: {
@@ -45,23 +49,20 @@ export default {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/manpower/ActivityLog/Edit`
url: location.origin + `/#/manpower/ActivityLog/Edit?code=${this.ActivityLogInfo.recordCode}`,
forbidSwipeBack: '1'
},
routerInfo: { path: '/manpower/ActivityLog/Edit' }
routerInfo: { path: `/manpower/ActivityLog/Edit?code=${this.ActivityLogInfo.recordCode}` }
})
}
},
computed: {
currentTime() {
return this.ActivityLogInfo.currentTime
}
},
watch: {
currentTime(newVal) {
if (newVal === formatDate.formatDate().split(' ')[0]) {
this.isEdit = true
isEdit() {
console.log(this.ActivityLogInfo.recordDate)
if (this.ActivityLogInfo.recordDate === formatDate.formatDate().split(' ')[0]) {
return true
} else {
this.isEdit = false
return false
}
}
}

View File

@@ -1,10 +1,12 @@
<template>
<div>
<van-cell :title="talentPoolInfo.name" title-class="ml10" is-link value-class="text-left">
<van-icon slot="icon" :name="talentPoolInfo.avatarUrl || defaultAcatarUrl" style="line-height: inherit;" size="24" />
<span>{{ talentPoolInfo.sameCompany }}</span>
<van-icon slot="right-icon" name="edit" style="line-height: inherit;" color="#1989fa" size="24" />
</van-cell>
<van-cell-group>
<van-cell :title="talentPoolInfo.name" title-class="ml10" is-link value-class="text-left">
<van-icon slot="icon" :name="talentPoolInfo.avatarUrl || defaultAcatarUrl" style="line-height: inherit;" size="24" />
<span>{{ talentPoolInfo.sameCompany }}</span>
<van-icon slot="right-icon" name="edit" style="line-height: inherit;" color="#1989fa" size="24" />
</van-cell>
</van-cell-group>
</div>
</template>
<script>

View File

@@ -8,4 +8,10 @@ export default {
'/agent/activityRecord/queryWeekly': mockBaseUrl + '/agent/activityRecord/queryWeekly',
// 查询日志页面人才库列表
'/agent/personnel/queryListFirst': mockBaseUrl + '/agent/personnel/queryListFirst',
// 查询日志页面增员列表
'/agent/activityRecord/queryList': mockBaseUrl + '/agent/activityRecord/queryList',
// 日志详情查询
'/agent/activityRecord/queryDetail': mockBaseUrl + '/agent/activityRecord/queryDetail',
// 新增日志
'/agent/activityRecord/saveOrUpdate': mockBaseUrl + '/agent/activityRecord/saveOrUpdate'
}

View File

@@ -27,27 +27,27 @@
<van-collapse v-model="personnelNames" v-else>
<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>
<TalentPoolItem :talentPoolInfo="info" v-for="(info, index) in personnelsList" :key="index"> </TalentPoolItem>
</van-collapse-item>
</van-collapse>
<p class="p15 text-right blue" v-if="personnelsList.length != 0">查看全部>>></p>
</div>
<!-- 当日增员活动日志 -->
<div class="bg-white">
<div class="p15">
<div class="p15" v-if="recordList.length == 0">
<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 v-model="recordNames" v-else>
<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>
<div slot="title" class="flex justify-content-s align-items-c">当日增员活动日志 <van-icon name="plus" @click="toEdit" /></div>
<ActivityLogItem :ActivityLogInfo="info" v-for="(info, index) in recordList" :key="index"></ActivityLogItem>
</van-collapse-item>
</van-collapse>
<p class="p15 text-right blue" @click="toList">查看全部>>></p>
<p class="p15 text-right blue" v-if="recordList.length != 0" @click="toList">查看全部>>></p>
</div>
</div>
</template>
@@ -56,7 +56,7 @@ 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, queryListFirst } from '@/api/ebiz/manpower/manpower'
import { queryWeekly, queryListFirst, queryRecordList } from '@/api/ebiz/manpower/manpower'
export default {
components: {
@@ -71,16 +71,18 @@ export default {
return {
weeklyNames: ['1'],
personnelNames: ['1'],
recordNames: ['1'],
talentPoolInfo: {
name: '王辉',
sameCompany: '中国人寿'
},
ActivityLogInfo: {
recordCode: '',
name: '王辉',
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
// avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
age: '35岁',
flag: '同业',
currentTime: formatDate.formatDate().split(' ')[0]
type: '同业',
recordDate: formatDate.formatDate().split(' ')[0]
},
// 日志统计周报信息
weeklyInfo: {
@@ -88,12 +90,15 @@ export default {
sameTrade: '' // 同业
},
// 人才库列表
personnelsList: []
personnelsList: [],
// 增员日志列表
recordList: []
}
},
mounted() {
this.queryWeekly()
this.queryListFirst()
this.queryRecordList()
},
methods: {
// 获取日志统计周报
@@ -118,6 +123,26 @@ export default {
console.log(res)
if (res.result == 0) {
this.personnelsList = res.content.personnels
} else {
this.$toast(res.resultMessage)
}
})
.catch(err => {
console.log(err)
})
},
// 查询增员日志列表
queryRecordList() {
let data = {
recordDate: ''
}
queryRecordList(data)
.then(res => {
console.log(res)
if (res.result == 0) {
this.recordList = res.content.records
} else {
this.$toast(res.resultMessage)
}
})
.catch(err => {
@@ -128,7 +153,8 @@ export default {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/manpower/ActivityLog/List`
url: location.origin + `/#/manpower/ActivityLog/List`,
forbidSwipeBack: '1'
},
routerInfo: { path: '/manpower/ActivityLog/List' }
})
@@ -137,7 +163,8 @@ export default {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/manpower/ActivityLog/Edit`
url: location.origin + `/#/manpower/ActivityLog/Edit`,
forbidSwipeBack: '1'
},
routerInfo: { path: '/manpower/ActivityLog/Edit' }
})

View File

@@ -2,23 +2,31 @@
<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-field readonly v-model="recordInfo.recordDate" label="日期" />
<van-field required v-model="recordInfo.name" label="姓名" placeholder="请输入姓名" v-validate="'required|name'" data-vv-name="姓名" />
<van-field
required
v-model="recordInfo.age"
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"
v-for="(item, 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' : ''"
@click="slectType(item)"
:class="recordInfo.type == index ? 'select-tag' : ''"
>
{{ type.text }}
{{ item.text }}
</span>
</van-cell>
<van-field
required
v-model="logTimes"
v-model="recordInfo.interviewNum"
type="digit"
label="面谈次数"
placeholder="请输入面谈次数"
@@ -58,6 +66,7 @@
<script>
import formatDate from '@/assets/js/utils/date-utils'
import { Field, CellGroup, Popup, Picker, Cell, Button } from 'vant'
import { queryRecordDetail, saveRecord } from '@/api/ebiz/manpower/manpower'
export default {
components: {
@@ -70,45 +79,117 @@ export default {
},
data() {
return {
dateTime: formatDate.formatDate().split(' ')[0],
logName: '',
logAge: '',
logType: 0,
logTimes: '',
logResult: '',
logOccupation: '',
isAlike: false,
recordInfo: {
recordDate: formatDate.formatDate().split(' ')[0],
name: '',
age: '',
type: 0,
interviewNum: '', // 面试次数
interviewResult: '', // 面谈结果
pastOccu: '' // 过往职业
},
recordCode: '',
// 面试结果
showResultArr: false,
// 职业选择
showOccupationArr: false,
typeArr: [{ id: 0, text: '同业' }, { id: 1, text: '白板' }],
resultArr: [{ id: '01', text: '同意加盟' }, { id: '02', text: '进班了解' }, { id: '03', text: '考虑中' }, { id: '04', text: '加盟' }],
resultArr: [{ id: '0', text: '加盟' }, { id: '1', text: '考虑中' }, { id: '2', text: '进班了解' }, { id: '3', 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: '其他' }
{ id: '001', text: '一般内勤职员' },
{ id: '002', text: '其他金融行业' },
{ id: '003', text: '家庭主妇' },
{ id: '004', text: '自由职业' },
{ id: '005', text: '离退休人员' },
{ id: '006', text: '个体经营者' },
{ id: '007', text: '销售' },
{ id: '008', text: '公务员' },
{ id: '009', text: '保险外勤' },
{ id: '010', text: '保险内勤' },
{ id: '011', text: '其他' }
]
}
},
mounted() {
this.recordCode = this.$route.query.code || ''
this.queryRecordDetail()
},
computed: {
logResult() {
if (this.recordInfo.interviewResult) {
return this.resultArr.find(ele => ele.id === this.recordInfo.interviewResult).text
} else {
return ''
}
},
logOccupation() {
if (this.recordInfo.pastOccu) {
return this.occupationArr.find(ele => ele.id === this.recordInfo.pastOccu).text
} else {
return ''
}
}
},
methods: {
queryRecordDetail() {
let data = {
recordCode: this.recordCode
}
queryRecordDetail(data)
.then(res => {
console.log(res)
if (res.result == 0) {
this.recordInfo = res.content.record
} else {
this.$toast(res.resultMessage)
}
})
.catch(err => {
console.log(err)
})
},
subInfo() {
this.$validator.validateAll().then(result => {
if (result) {
console.log(result)
let data = {
recordCode: this.recordCode,
name: this.recordInfo.name,
age: this.recordInfo.age,
type: this.recordInfo.type || '0',
interviewNum: this.recordInfo.interviewNum,
interviewResult: this.recordInfo.interviewResult,
pastOccu: this.recordInfo.pastOccu
}
console.log(data)
saveRecord(data)
.then(res => {
console.log(res)
if (res.result == 0) {
this.$jump({
flag: 'goBack',
extra: {
refresh: '1',
index: '-1',
forbidSwipeBack: '1'
},
routerInfo: {
type: 2
}
})
} else {
this.$toast(res.resultMessage)
}
})
.catch(err => {
console.log(err)
})
} else {
this.$toast(this.errors.all()[0])
}
})
},
slectType(type) {
this.logType = type.id
this.recordInfo.type = type.id
},
handleRsult() {
this.showResultArr = true
@@ -117,13 +198,11 @@ export default {
this.showOccupationArr = true
},
selectResult(val) {
console.log(val)
this.logResult = val.text
this.recordInfo.interviewResult = val.id
this.showResultArr = false
},
selectOccupation(val) {
console.log(val)
this.logOccupation = val.text
this.recordInfo.pastOccu = val.id
this.showOccupationArr = false
}
}

View File

@@ -8,9 +8,9 @@
</p>
<p @click="openCalendar">{{ showTime }}</p>
</div>
<ActivityLogItem :ActivityLogInfo="ActivityLogInfo" v-for="(item, index) in 20" :key="index"></ActivityLogItem>
<ActivityLogItem :ActivityLogInfo="item" v-for="(item, index) in recordList" :key="index"></ActivityLogItem>
<div class="bottom-btn text-center">
<van-icon name="add-square" size="50" color="#1989fa" />
<van-icon name="add-square" size="50" color="#1989fa" @click="toEdit" />
</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" />
@@ -21,6 +21,7 @@
import formatDate from '@/assets/js/utils/date-utils'
import { DatetimePicker, Popup } from 'vant'
import ActivityLogItem from '@/components/ebiz/manpower/ActivityLogItem'
import { queryRecordList } from '@/api/ebiz/manpower/manpower'
export default {
components: {
@@ -38,24 +39,55 @@ export default {
showDateTime: false,
ActivityLogInfo: {
name: '王辉',
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
// avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
age: '35岁',
flag: '同业',
currentTime: ''
}
recordDate: ''
},
recordList: []
}
},
mounted() {},
mounted() {
this.queryRecordList(formatDate.formatDate().split(' ')[0])
},
methods: {
queryRecordList(date) {
let data = {
recordDate: date
}
queryRecordList(data)
.then(res => {
console.log(res)
if (res.result == 0) {
this.recordList = res.content.records
} else {
this.$toast(res.resultMessage)
}
})
.catch(err => {
console.log(err)
})
},
toEdit() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/manpower/ActivityLog/Edit`,
forbidSwipeBack: '1'
},
routerInfo: { path: '/manpower/ActivityLog/Edit' }
})
},
openCalendar() {
this.showDateTime = true
},
confirm(val) {
this.showTime = `< ${formatDate.formatDate(val).split(' ')[0]} >`
this.ActivityLogInfo.currentTime = formatDate.formatDate(val).split(' ')[0]
this.ActivityLogInfo.recordDate = formatDate.formatDate(val).split(' ')[0]
if (this.showTime !== this.todayTime) {
this.isToday = false
}
this.queryRecordList(formatDate.formatDate(val).split(' ')[0])
this.showDateTime = false
},
cancel() {
@@ -63,8 +95,9 @@ export default {
},
backToday() {
this.showTime = this.todayTime
this.ActivityLogInfo.currentTime = formatDate.formatDate().split(' ')[0]
this.ActivityLogInfo.recordDate = formatDate.formatDate().split(' ')[0]
this.isToday = true
this.queryRecordList(formatDate.formatDate().split(' ')[0])
}
}
}