|
|
@@ -10,18 +10,22 @@
|
|
|
@close="CloseOperationRecordDialog">
|
|
|
<SearchBlock :searchList="operationRecordSearchList"
|
|
|
@searchChange="HandleOperationLogSearchChange">
|
|
|
+ <template #rowItem-time>
|
|
|
+ <el-date-picker
|
|
|
+ v-if="searchParams.time=='custom'"
|
|
|
+ style="flex-grow: 0;height: 28px;width: 220px;"
|
|
|
+ v-model="searchParams.startAndEndTime"
|
|
|
+ @change="(val)=>HandleOperationLogSearchChange({startAndEndTime:val},'startAndEndTime')"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ size="default"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</SearchBlock>
|
|
|
- <!-- 带完善 -->
|
|
|
- <FormSearchGroup :searchList="[
|
|
|
- {
|
|
|
- key:'queryStr',
|
|
|
- type:'input',
|
|
|
- placeholder:'请输入关键字搜索',
|
|
|
- hidden:false,
|
|
|
- defaultValue:'',
|
|
|
- disabled:false
|
|
|
- }
|
|
|
- ]" @searchChange="HandleOperationLogSearchChange"/>
|
|
|
+ <FormSearchGroup style="margin:16px 0" v-if="props.interfaceSource == 'customerFollow'"
|
|
|
+ :searchList="operationRecordBlurSearch" @searchChange="HandleOperationLogSearchChange"/>
|
|
|
|
|
|
<FollowCard :cardList="finalOperationLogRenderData">
|
|
|
<template #operation><i></i></template>
|
|
|
@@ -54,7 +58,7 @@ import Pagination from '@/baseComponents/Pagination.vue';
|
|
|
import {operationRecordSearchList} from './searchBlock'
|
|
|
|
|
|
import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
|
-
|
|
|
+import {operationRecordBlurSearch} from './formSearchGroup'
|
|
|
|
|
|
import {
|
|
|
getOperationLogApi,
|
|
|
@@ -63,10 +67,22 @@ import {
|
|
|
import {getPrivateOperationLogApi} from '@/api/myCustomer'
|
|
|
import { getCustomerOperationLogApi} from '@/api/customerFollowUp';
|
|
|
|
|
|
+
|
|
|
+import {
|
|
|
+ getTodayRange,
|
|
|
+ getYesterdayRange,
|
|
|
+ getRecentDaysRange,
|
|
|
+ getRecentWeeksRange,
|
|
|
+ getRecentMonthsRange,
|
|
|
+ formatTime
|
|
|
+} from '@/utils/timeRangeGet'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
interfaceSource:{
|
|
|
type:String as ()=>'highSeasCustomer'|'myCustomer'|'customerFollow',
|
|
|
- default:'highSeasCustomer', //
|
|
|
+ requreid:true,
|
|
|
}, //查询操作日志 接口来源
|
|
|
})
|
|
|
|
|
|
@@ -83,14 +99,20 @@ const currentPage = ref(1)
|
|
|
const pageSize = ref(20)
|
|
|
const totalNum = ref(0)
|
|
|
const searchParams = ref({
|
|
|
- personnel:'all'
|
|
|
+ personnel:'all',
|
|
|
+ time:'all',
|
|
|
+ group:'all',
|
|
|
+ startAndEndTime:[],
|
|
|
})
|
|
|
|
|
|
// 关闭
|
|
|
const CloseOperationRecordDialog=()=>{
|
|
|
operationRecordDialogVisible.value = false
|
|
|
searchParams.value = {
|
|
|
- personnel:'all'
|
|
|
+ personnel:'all',
|
|
|
+ time:'all',
|
|
|
+ group:'all',
|
|
|
+ startAndEndTime:[],
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -117,6 +139,35 @@ const HandleLogPaginationChange = async (params)=>{
|
|
|
|
|
|
//获取日志列表
|
|
|
const GetOperationList = async ()=>{
|
|
|
+ let rangeTime = {
|
|
|
+ startTime:'',
|
|
|
+ endTime:'',
|
|
|
+ }
|
|
|
+ if(['myCustomer','customerFollow'].includes(props.interfaceSource)){
|
|
|
+ switch(searchParams.value.time){
|
|
|
+ case 'today':
|
|
|
+ rangeTime = getTodayRange()
|
|
|
+ break
|
|
|
+ case 'yesterday':
|
|
|
+ rangeTime = getYesterdayRange()
|
|
|
+ break
|
|
|
+ case 'last3Days':
|
|
|
+ rangeTime = getRecentDaysRange(3)
|
|
|
+ break
|
|
|
+ case 'last1Week':
|
|
|
+ rangeTime = getRecentWeeksRange(1)
|
|
|
+ break
|
|
|
+ case 'last1Month':
|
|
|
+ rangeTime = getRecentMonthsRange(1)
|
|
|
+ break
|
|
|
+ case 'custom':
|
|
|
+ rangeTime = {
|
|
|
+ startTime:formatTime(searchParams.value.startAndEndTime?.[0]) ,
|
|
|
+ endTime: formatTime(searchParams.value.startAndEndTime?.[1]),
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
let res = undefined
|
|
|
if(props.interfaceSource == 'highSeasCustomer'){
|
|
|
@@ -127,31 +178,32 @@ const GetOperationList = async ()=>{
|
|
|
pageSize: pageSize.value
|
|
|
}
|
|
|
res = await getOperationLogApi(params)
|
|
|
+
|
|
|
}else if(props.interfaceSource == 'myCustomer'){
|
|
|
let params = {
|
|
|
customerId: route.query.id,
|
|
|
operUserId: searchParams.value.personnel == 'all' ? '' : searchParams.value.personnel,
|
|
|
- "startDate": "", //带完善
|
|
|
- "endDate": "",
|
|
|
+ startDate: rangeTime.startTime,
|
|
|
+ endDate: rangeTime.endTime,
|
|
|
pageNum: currentPage.value,
|
|
|
pageSize: pageSize.value
|
|
|
}
|
|
|
res = await getPrivateOperationLogApi(params)
|
|
|
}else if(props.interfaceSource == 'customerFollow'){
|
|
|
let params = {
|
|
|
- customerId: '', //待完善
|
|
|
- operUserId: '',
|
|
|
- groupId: '',
|
|
|
- startDate: "",
|
|
|
- endDate: "",
|
|
|
+ operUserId: searchParams.value.personnel == 'all' ? '' : searchParams.value.personnel,
|
|
|
+ groupId: searchParams.value.group == 'all' ? '' : searchParams.value.group,
|
|
|
+ startDate: rangeTime.startTime,
|
|
|
+ endDate: rangeTime.endTime,
|
|
|
pageNum: currentPage.value,
|
|
|
pageSize: pageSize.value,
|
|
|
+ queryStr:searchParams.value.queryStr
|
|
|
}
|
|
|
res = await getCustomerOperationLogApi(params)
|
|
|
}
|
|
|
|
|
|
if(res?.code == 200){
|
|
|
- const {data:operationData, dateData, groupData, memberData} = res?.data
|
|
|
+ const {data:operationData, groupData, memberData} = res?.data
|
|
|
totalNum.value = operationData.total
|
|
|
let memberOption = memberData?.map(item=>{
|
|
|
return {
|
|
|
@@ -159,14 +211,33 @@ const GetOperationList = async ()=>{
|
|
|
value:item.id
|
|
|
}
|
|
|
}) || []
|
|
|
+
|
|
|
+ let groupOption = groupData?.map(item=>{
|
|
|
+ return {
|
|
|
+ label:item.name,
|
|
|
+ value:item.id
|
|
|
+ }
|
|
|
+ }) || []
|
|
|
operationRecordSearchList.value = operationRecordSearchList.value.map(item=>{
|
|
|
- if(item.key=='personnel'){
|
|
|
- item.options = [
|
|
|
- { label: '全部', value: 'all' },
|
|
|
- ...memberOption
|
|
|
- ]
|
|
|
- item.defaultValue = searchParams.value.personnel
|
|
|
+ switch(item.key){
|
|
|
+ case 'personnel':
|
|
|
+ item.options = [
|
|
|
+ { label: '全部', value: 'all' },
|
|
|
+ ...memberOption
|
|
|
+ ]
|
|
|
+ break
|
|
|
+ case 'group':
|
|
|
+ item.options = [
|
|
|
+ { label: '全部', value: 'all' },
|
|
|
+ ...groupOption
|
|
|
+ ]
|
|
|
+ item.hidden = props.interfaceSource == 'customerFollow' ? false : true
|
|
|
+ break
|
|
|
+ case 'time':
|
|
|
+ item.hidden = ['customerFollow','myCustomer']?.includes(props.interfaceSource) ? false : true
|
|
|
+ break
|
|
|
}
|
|
|
+ item.defaultValue = searchParams.value[item.key]
|
|
|
return item
|
|
|
})
|
|
|
|
|
|
@@ -191,9 +262,6 @@ const GetOperationList = async ()=>{
|
|
|
}else{
|
|
|
operationAim = ''
|
|
|
}
|
|
|
- // 这个 记录的结果待完善
|
|
|
- // case 1:
|
|
|
- // return '跟进'
|
|
|
}
|
|
|
|
|
|
// 具体操作信息
|
|
|
@@ -212,7 +280,12 @@ const GetOperationList = async ()=>{
|
|
|
operationDetail = content[0]
|
|
|
}
|
|
|
return {
|
|
|
- headerTitleList:[
|
|
|
+ headerTitleList:props.interfaceSource == 'customerFollow' ? [
|
|
|
+ item.operDatetime,
|
|
|
+ item.operName,
|
|
|
+ item.customerName, // 学校信息 只在 客户跟进显示
|
|
|
+ operationName+operationAim,
|
|
|
+ ] : [
|
|
|
item.operDatetime,
|
|
|
item.operName,
|
|
|
operationName+operationAim,
|