index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984
  1. <template>
  2. <div class="message_overview">
  3. <!-- 左侧:产品概览与最新状态 -->
  4. <div class="left_panel ">
  5. <div class="product_summary">
  6. <div class="summary_title">跟进产品总数 {{ followUpProductSummary.total }}</div>
  7. <div class="summary_tags">
  8. <span v-for="(item,index) in followUpProductSummary.differentStatusNum" :key="index"> {{item.statusName}} {{item.count}}</span>
  9. </div>
  10. </div>
  11. <div class="product_list hide_scrollbar" v-if="productsFollowStatistic?.length > 0">
  12. <template v-for="(item,index) in productsFollowStatistic" :key="item.productId" >
  13. <div class="list_item">
  14. <div class="item_title">{{item.productName}}</div>
  15. <div class="item_info">跟进状态:{{item.followName}}</div>
  16. <div class="item_info">联系人:{{item.customerPersonName}}</div>
  17. <div class="item_info">跟进次数:{{item.count}}</div>
  18. <div class="item_info">上次跟进时间:{{item.lastFollowTime}}</div>
  19. </div>
  20. <div v-if="index !== (productsFollowStatistic?.length - 1)" class="page_solid_line" />
  21. </template>
  22. </div>
  23. </div>
  24. <!-- 中间:搜索与 我的跟进 -->
  25. <div class="center_panel">
  26. <div class="page_content hide_scrollbar " ref="scrollDom">
  27. <div v-if="scrollMsg.isScrollTop" :style="{height:scrollMsg.headerHeight || '176px',flexShrink:'0'}"></div>
  28. <div class="search_page" ref="headerDom">
  29. <!-- 滚动头部筛选展示 -->
  30. <DetailSelectSearch v-if="scrollMsg.isScrollTop" @searchChange="HandleSearchChange" ></DetailSelectSearch>
  31. <!-- 正常筛选展示 -->
  32. <DetailBlockSearch v-else @searchChange="HandleSearchChange"></DetailBlockSearch>
  33. </div>
  34. <FollowCard v-if="finalRenderData?.length > 0" :cardList="finalRenderData">
  35. <template #operation="{row}">
  36. <div style="" class="table_row_option">
  37. <!-- 没有取消的待办,显示取消按钮 -->
  38. <span v-if="row.orderType === 0 && [0,1].includes(row.orderStatus)" class="button_delete" @click="OpenCancelAppointmentDialog(row)">取消预约</span>
  39. <span class="option_button_editor" @click="OpenFollowlFormDialog(row,'currentFollowRecord')">详情</span>
  40. </div>
  41. </template>
  42. </FollowCard>
  43. <div v-else class="no_data_bg">
  44. <span>暂无数据</span>
  45. </div>
  46. </div>
  47. <Pagination :currentPage="currentPage"
  48. :showPageSize="true"
  49. :pageSize="pageSize" :totalNum="totalNum"
  50. @paginationChange="HandlePaginationChange">
  51. <template #paginationDesc>
  52. 共 {{ totalNum }} 条数据
  53. </template>
  54. </Pagination>
  55. </div>
  56. <!-- 右侧:待办与统计 -->
  57. <div class="right_panel">
  58. <div class="pending_appointments">
  59. <div class="panel_header">{{'预约待办 ('+ pendingAppointmentList?.length +'项)'}}</div>
  60. <ul class="task_list hide_scrollbar">
  61. <template v-if="pendingAppointmentList?.length > 0">
  62. <li v-for="cardItm in pendingAppointmentList" :key="cardItm.id" class="todo_card">
  63. <div class="card_top">
  64. <span class="time">{{cardItm.createdAt}}</span>
  65. <span class="title one_line_ellipsis">{{cardItm.productName}}</span>
  66. <div class="table_row_option">
  67. <span class="button_editor"@click="OpenFollowlFormDialog(cardItm,'pendingAppointment')">详情</span>
  68. </div>
  69. </div>
  70. <div class="card_tags">
  71. <span v-if="[0,1].includes(cardItm.orderType)" class="task_type">{{cardItm.orderType ===0 ? '预约' : '待办' }}</span>
  72. <span class="follow_status">{{cardItm.followName}}</span>
  73. </div>
  74. <div class="card_info">
  75. <span>跟进人:{{ cardItm.claimUserName }}</span>
  76. <span>联系人:{{ cardItm.customerPersonName }}</span>
  77. <span>职务:{{ cardItm.positionName }}</span>
  78. </div>
  79. <div :title="cardItm.followContent" class="card_content two_line_ellipsis">
  80. 跟进内容:{{cardItm.followContent}}
  81. </div>
  82. </li>
  83. </template>
  84. <template v-else>
  85. <li class="no_data">
  86. <div class="no_data_bg">
  87. <span>暂无数据</span>
  88. </div>
  89. </li>
  90. </template>
  91. </ul>
  92. </div>
  93. <!-- 之前归属人的跟进记录 -->
  94. <!-- 历史跟进的状态是否展示 要判断是否给当前用户开放历史跟进权限 -->
  95. <div v-if="historyFollowData" class="history_statistics">
  96. <div class="stat_header">
  97. <span>历史跟进</span>
  98. <el-button class="button_border" @click="OpenHistoryFollowDialog">历史跟进</el-button>
  99. </div>
  100. <div class="stat_numbers">
  101. <div class="num_item">
  102. <div class="num">{{historyFollowData.historyProductCount}}</div>
  103. <div class="label">历史产品</div>
  104. </div>
  105. <div class="vertical_solid"></div>
  106. <div class="num_item">
  107. <div class="num">{{historyFollowData.historyPersonCount}}</div>
  108. <div class="label">历史人员</div>
  109. </div>
  110. <div class="vertical_solid"></div>
  111. <div class="num_item">
  112. <div class="num">{{historyFollowData.historyFollowCount}}</div>
  113. <div class="label">跟进次数</div>
  114. </div>
  115. <div class="vertical_solid"></div>
  116. <div class="num_item">
  117. <div class="num">{{historyFollowData.successCount}}</div>
  118. <div class="label">赢单次数</div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <!-- 查看跟进详情 -->
  125. <FollowFormDialog
  126. v-if="followVisible"
  127. title="查看详情"
  128. :previewForm="true"
  129. v-model:visible="followVisible"
  130. v-model:submitLoading="followDetailLoading"
  131. :defaultFormData="followDefaultFormData"
  132. @confirm="HandleFollowDetailConfirm"
  133. @close="CloseFollowlFormDialog"
  134. >
  135. </FollowFormDialog>
  136. <!-- 查看历史跟进 -->
  137. <PreviewDialog
  138. v-if="historyFollowVisible"
  139. :title="'历史跟进'"
  140. :previewVisible="historyFollowVisible"
  141. :customFooter="true"
  142. @close="CloseHistoryFollowDialog">
  143. <SearchBlock :searchList="historyFollowSearchList" @searchChange="HandleSearchHistoryFollow"></SearchBlock>
  144. <FollowCard style="margin-top: 16px;" :cardList="historyFollowRecord">
  145. <template #operation>
  146. <i></i>
  147. </template>
  148. </FollowCard>
  149. <Pagination :currentPage="historyCurrentPage"
  150. :showPageSize="true"
  151. :pageSize="historyPageSize" :totalNum="historyTotalNum"
  152. @paginationChange="HandleHistoryPageChange">
  153. <template #paginationDesc>
  154. 共 {{ historyTotalNum }} 条数据
  155. </template>
  156. </Pagination>
  157. <template #close>
  158. <el-button @click="CloseHistoryFollowDialog" class="button_background" >关闭</el-button>
  159. </template>
  160. <template #confirm><i></i></template>
  161. </PreviewDialog>
  162. <!-- 取消预约弹窗 -->
  163. <CancelAppointmentDialog
  164. interfaceSoruce="myCustomer"
  165. v-model:visible="cancelVisible"
  166. :defaultFormData="cancelDefaultFormData"
  167. @confirm="HandleCancelAppointmentConfirm">
  168. </CancelAppointmentDialog>
  169. </template>
  170. <script setup lang="ts">
  171. import { ref, onMounted,watch } from 'vue';
  172. import {useRoute} from 'vue-router'
  173. import { ElMessage } from 'element-plus'
  174. import DetailBlockSearch from '@/components/MyCustomerHeaderSearch/DetailBlockSearch/index.vue'
  175. import {ongoingFollowSearchList} from '@/components/MyCustomerHeaderSearch/DetailBlockSearch/searchBlock'
  176. import {searchParams} from '@/components/MyCustomerHeaderSearch/commonVar'
  177. import DetailSelectSearch from '@/components/MyCustomerHeaderSearch/DetailSelectSearch/index.vue'
  178. import {myFollowSearchSelectList} from '@/components/MyCustomerHeaderSearch/DetailSelectSearch/formSearchGroup'
  179. import { useHeaderFixed } from '@/baseComponents/useHeaderFixed'
  180. import SearchBlock from '@/baseComponents/SearchBlock.vue';
  181. import { historyFollowSearchList } from './searchBlock';
  182. import FollowCard from '@/components/FollowCard.vue';
  183. import Pagination from '@/baseComponents/Pagination.vue';
  184. import FollowFormDialog from '@/components/FollowFormDialog/index.vue'
  185. import PreviewDialog from '@/baseComponents/PreviewDialog.vue';
  186. import CancelAppointmentDialog from '@/components/CancelAppointmentDialog/index.vue'
  187. import {getOverviewDetailApi,getHistoryFollowListApi} from '@/api/myCustomer'
  188. import {closeToDoTaskApi} from '@/api/appointmentAndTodo'
  189. import {winnerCaseStatusMsg} from '@/components/dict'
  190. import {
  191. getTodayRange,
  192. getYesterdayRange,
  193. getRecentDaysRange,
  194. getRecentWeeksRange,
  195. getRecentMonthsRange,
  196. formatTime
  197. } from '@/utils/timeRangeGet'
  198. interface ProductFollowRecord {
  199. productId: string; // 产品ID
  200. productName: string; // 产品名称
  201. count?: number; // 数量
  202. followName: string; // 跟进名称
  203. customerPersonName: string; // 客户人员名称
  204. lastFollowTime: string | number; // 最后跟进时间
  205. }
  206. interface pendingAppointmentItm {
  207. id:string,
  208. createdAt:string,
  209. productName:string,
  210. orderType:number,
  211. followName:string,
  212. claimUserName:string,
  213. customerPersonName:string,
  214. positionName:string,
  215. followContent:string,
  216. }
  217. const props = defineProps({
  218. followReloadFlag:{
  219. type:Number,
  220. }
  221. })
  222. const route = useRoute()
  223. const scrollDom = ref()
  224. const headerDom = ref()
  225. const scrollMsg = useHeaderFixed(scrollDom,headerDom,176) //搜索栏是否需要在滚动的时候固定到顶部
  226. /**
  227. * 1. 左侧数据展示
  228. */
  229. // 左侧——跟进产品总览
  230. const followUpProductSummary = ref({
  231. total:0,
  232. differentStatusNum:[ ]
  233. })
  234. //左侧——跟进产品——统计分析
  235. const productsFollowStatistic = ref<ProductFollowRecord[]>([]);
  236. /**
  237. * 中间数展示
  238. */
  239. // 中间——当前客户跟进记录列表展示 及有关筛选操作
  240. const finalRenderData = ref([])
  241. const currentPage = ref(1)
  242. const pageSize = ref(20)
  243. const totalNum = ref(0)
  244. const HandlePaginationChange = async (params)=>{
  245. const {type,val} = params
  246. if(type == 'currentPage'){
  247. currentPage.value = val
  248. }else if(type == 'pageSize'){
  249. pageSize.value = val
  250. }
  251. await GetOverviewDetail()
  252. }
  253. // 查看总览数据
  254. const GetOverviewDetail = async ()=>{
  255. let rangeTime = {
  256. startTime: '',
  257. endTime: ''
  258. }
  259. switch(searchParams.value.time){
  260. case 'today':
  261. rangeTime = getTodayRange()
  262. break
  263. case 'yesterday':
  264. rangeTime = getYesterdayRange()
  265. break
  266. case 'last3days':
  267. rangeTime = getRecentDaysRange(3)
  268. break
  269. case 'last1week':
  270. rangeTime = getRecentWeeksRange(1)
  271. break
  272. case 'last1month':
  273. rangeTime = getRecentMonthsRange(1)
  274. break
  275. case 'custom':
  276. rangeTime = {
  277. startTime:formatTime(searchParams.value.startAndEndTime?.[0]) ,
  278. endTime: formatTime(searchParams.value.startAndEndTime?.[1]),
  279. }
  280. break
  281. }
  282. let params = {
  283. startDatetime: rangeTime.startTime,
  284. endDatetime: rangeTime.endTime,
  285. customerId: route.query.id,
  286. positionId: searchParams.value.position == 'all' ? '' : searchParams.value.position,
  287. productId: searchParams.value.product == 'all' ? '' : searchParams.value.product,
  288. followId: searchParams.value.followStatus == 'all' ? '' : searchParams.value.followStatus,
  289. // userId: '',
  290. pageNum: currentPage.value,
  291. pageSize: pageSize.value,
  292. }
  293. let res = await getOverviewDetailApi(params)
  294. if(res.code == 200){
  295. const {selectData,dataPageList,productCount,
  296. productData,statusOverviewData,
  297. followOverViewData,orderData
  298. } = res.data
  299. // 跟进产品总览 ——左
  300. followUpProductSummary.value = {
  301. total:productCount,
  302. differentStatusNum:statusOverviewData || []
  303. }
  304. // 跟进产品-各自分析 ——左
  305. productsFollowStatistic.value = productData || []
  306. // 历史跟进统计 —— 右
  307. historyFollowData.value = followOverViewData
  308. //预约待办展示 —— 右
  309. pendingAppointmentList.value = orderData || []
  310. // 中间 正在进行中的跟进记录 —— 中
  311. totalNum.value = dataPageList.total
  312. finalRenderData.value = dataPageList?.records?.map(item=>{
  313. let headerTags = []
  314. if(item.followName){
  315. headerTags.push(item.followName)
  316. }
  317. let statusTag = []
  318. // auditStatus 审核状态:0-待审核,1-已通过,2-已驳回 successStatus 是否是赢单 0否 1是
  319. if([0,1,2].includes(item.auditStatus) && item.successStatus === 1){
  320. statusTag.push(winnerCaseStatusMsg(item.auditStatus))
  321. }
  322. return {
  323. headerTitleList:[
  324. item.claimDatetime,
  325. item.customerName,
  326. item.productName
  327. ],
  328. headerTags,
  329. statusTag,
  330. middleDesc:[
  331. `跟进人:${item.claimUserName}`,
  332. `联系人:${item.customerPersonName}`,
  333. `职务:${item.positionName}`
  334. ],
  335. // orderStatus 预约/待办状态,0-待开始,1-已结束,2-已取消(预约) null-已关闭(待办)
  336. taskType:[0,1].includes(item.orderType) && [0,1].includes(item.orderStatus) ? (item.orderType === 0 ? '预约' : '待办') : '',
  337. bottomDesc:`跟进内容:${item.followContent}`,
  338. ...item,
  339. }
  340. }) || []
  341. const {
  342. followData,
  343. positionData,
  344. productData:productList
  345. } = selectData || {}
  346. let productOption = productList?.map(item=>{
  347. return {
  348. label:item.name,
  349. value:item.id
  350. }
  351. })
  352. let followStatusOption = followData.map(item=>{
  353. return {
  354. label:item.name,
  355. value:item.id
  356. }
  357. })
  358. let positionOption = positionData.map(item=>{
  359. return {
  360. label:item.name,
  361. value:item.id
  362. }
  363. })
  364. // 头部筛选项赋值
  365. ongoingFollowSearchList.value = ongoingFollowSearchList.value.map(item=>{
  366. switch(item.key){
  367. case 'product':
  368. item.options = [
  369. { label: '全部', value: 'all' },
  370. ...productOption,
  371. ]
  372. item.defaultValue = searchParams.value.product
  373. break
  374. case 'followStatus':
  375. item.options = [
  376. { label: '全部', value: 'all' },
  377. ...followStatusOption,
  378. ]
  379. item.defaultValue = searchParams.value.followStatus
  380. break
  381. case 'position':
  382. item.options = [
  383. { label: '全部', value: 'all' },
  384. ...positionOption
  385. ]
  386. item.defaultValue = searchParams.value.position
  387. break
  388. default:
  389. item.defaultValue = searchParams.value[item.key]
  390. break
  391. }
  392. return item
  393. })
  394. myFollowSearchSelectList.value = myFollowSearchSelectList.value.map(item=>{
  395. switch(item.key){
  396. case 'product':
  397. item.options = [
  398. { label: '全部产品', value: 'all' },
  399. ...productOption,
  400. ]
  401. item.defaultValue = searchParams.value.product
  402. break
  403. case 'followStatus':
  404. item.options = [
  405. { label: '全部状态', value: 'all' },
  406. ...followStatusOption,
  407. ]
  408. item.defaultValue = searchParams.value.followStatus
  409. break
  410. case 'position':
  411. item.options = [
  412. { label: '全部职务', value: 'all' },
  413. ...positionOption
  414. ]
  415. item.defaultValue = searchParams.value.position
  416. break
  417. default:
  418. item.defaultValue = searchParams.value[item.key]
  419. break
  420. }
  421. return item
  422. })
  423. }
  424. }
  425. const HandleSearchChange = async (params,key)=>{
  426. searchParams.value = {
  427. ...searchParams.value,
  428. ...params
  429. }
  430. if(key == 'time' && params.time !== 'custom' ){
  431. searchParams.value.startAndEndTime = []
  432. }
  433. await GetOverviewDetail()
  434. }
  435. /**
  436. * 3. 右侧数据展示
  437. */
  438. // 右侧 —— 预约待办数据
  439. const pendingAppointmentList = ref<pendingAppointmentItm[]>([])
  440. // 右侧—— 历史跟进 数据总览
  441. interface historyFollowData {
  442. historyProductCount:number,
  443. historyPersonCount:number,
  444. historyFollowCount:number,
  445. successCount:number,
  446. }
  447. const historyFollowData = ref<historyFollowData>()
  448. /**
  449. * 4. 预约待办/客户 跟进弹窗详情(查看)有关数据及操作
  450. */
  451. const followVisible = ref(false)
  452. const followDefaultFormData = ref({})
  453. const currentFollowRow = ref({}) //当前查看的跟进数据
  454. const followDetailLoading = ref(false)
  455. const OpenFollowlFormDialog = (row,type)=>{
  456. currentFollowRow.value = row
  457. console.log('当前行信息',row)
  458. followVisible.value = true
  459. followDefaultFormData.value = {
  460. id:row.id,
  461. school:row.customerName,
  462. product:row.productName,
  463. status:row.followName,
  464. contact:row.customerPersonName,
  465. position:row.positionName,
  466. content:row.followContent,
  467. appointmentTime:row.orderDatetime,
  468. todoTime:row.orderDatetime,
  469. appointmentType:[0,1].includes(row.orderType) && [0,1].includes(row.orderStatus), // extraAppointmentType 有值(为待办1)的前提下,—— 当前值为false 表示 待办已手动关闭
  470. extraAppointmentType:row.orderType, //查看时候—— 附加的项
  471. }
  472. }
  473. const CloseFollowlFormDialog = ()=>{
  474. followVisible.value = false
  475. followDefaultFormData.value = {}
  476. followDetailLoading.value = false
  477. }
  478. const HandleFollowDetailConfirm = async (params)=>{
  479. const {formData} = params
  480. if([1].includes(currentFollowRow.value.orderType)){
  481. // 待办
  482. // orderStatus 0 待开始 1 已结束 null 已关闭
  483. // 如果是为关闭的待办 变成了关闭状态,调用关闭待办接口
  484. if([0,1].includes(currentFollowRow.value.orderStatus) && !(formData.appointmentType)){
  485. followDetailLoading.value = true
  486. // 关闭待办
  487. let res = undefined
  488. try{
  489. res = await closeToDoTaskApi(formData.id)
  490. }catch{}
  491. if(res?.code == 200){
  492. ElMessage.success('关闭成功')
  493. CloseFollowlFormDialog()
  494. // 刷新预约待办数据
  495. await GetOverviewDetail()
  496. }else{
  497. followDetailLoading.value = false
  498. }
  499. }else{
  500. CloseFollowlFormDialog()
  501. }
  502. }else{
  503. CloseFollowlFormDialog()
  504. }
  505. }
  506. /**
  507. * 5. 取消预约有关操作
  508. */
  509. const cancelVisible = ref(false)
  510. const cancelDefaultFormData = ref({})
  511. const OpenCancelAppointmentDialog = async (row)=>{
  512. cancelVisible.value = true
  513. cancelDefaultFormData.value = {
  514. id:row.id,
  515. customerName:row.customerName,
  516. appointmentTime:row.claimDatetime,
  517. cancelReason:''
  518. }
  519. }
  520. // 取消预约确认
  521. const HandleCancelAppointmentConfirm = async ()=>{
  522. await GetOverviewDetail()
  523. cancelDefaultFormData.value = {}
  524. }
  525. /** 6. 查看历史跟进 弹窗有关数据 */
  526. const historyFollowVisible = ref(false)
  527. const OpenHistoryFollowDialog = async (row)=>{
  528. historyFollowVisible.value = true
  529. await GetHistoryFollowList()
  530. }
  531. const CloseHistoryFollowDialog = ()=>{
  532. historyFollowVisible.value = false
  533. }
  534. // 历史跟进记录 列表信息
  535. const historyFollowRecord = ref([])
  536. // 分页参数
  537. const historyCurrentPage = ref(1)
  538. const historyPageSize = ref(20)
  539. const historyTotalNum = ref(0)
  540. const historySearchParams = ref({
  541. product:'all',
  542. followStatus:'all',
  543. personnel:'all',
  544. })
  545. // 历史跟进记录 分页参数变更
  546. const HandleHistoryPageChange = async (params)=>{
  547. const {type,val} = params
  548. if(type == 'currentPage'){
  549. historyCurrentPage.value = val
  550. }else if(type == 'pageSize'){
  551. historyPageSize.value = val
  552. }
  553. await GetHistoryFollowList()
  554. }
  555. // 历史跟进记录 筛选条件变更
  556. const HandleSearchHistoryFollow = async (params,key)=>{
  557. historySearchParams.value = {
  558. ...historySearchParams.value,
  559. ...params
  560. }
  561. await GetHistoryFollowList()
  562. }
  563. // 获取历史跟进列表
  564. const GetHistoryFollowList = async ()=>{
  565. let prams = {
  566. customerId: route.query.id,
  567. productId: historySearchParams.value.product == 'all' ? '' : historySearchParams.value.product,
  568. followId: historySearchParams.value.followStatus == 'all' ? '' : historySearchParams.value.followStatus,
  569. userId: historySearchParams.value.personnel == 'all' ? '' : historySearchParams.value.personnel,
  570. pageNum: historyCurrentPage.value,
  571. pageSize: historyPageSize.value
  572. }
  573. let res = await getHistoryFollowListApi(prams)
  574. if(res.code == 200){
  575. const {dataPageList, selectData} = res.data
  576. const {productData, memberData, followData} = selectData || {}
  577. historyFollowRecord.value = dataPageList.records?.map(item=>{
  578. let middleDesc = [
  579. `跟进人:${item.claimUserName}`,
  580. `联系人:${item.customerPersonName}`,
  581. `职务:${item.positionName}`
  582. ]
  583. if(item.orderType === 0) {
  584. middleDesc.push(`预约时间:${item.orderDatetime}`)
  585. }else if(item.orderType === 1){
  586. middleDesc.push(`待办时间:${item.orderDatetime}`)
  587. }
  588. return {
  589. headerTitleList:[item.claimDatetime,item.productName],
  590. headerTags:[item.followName],
  591. taskType:[0,1].includes(item.orderType) ? (item.orderType == 0 ? '预约' : '待办') : '',
  592. middleDesc,
  593. bottomDesc:`跟进内容:${item.followContent}`,
  594. ...item,
  595. }
  596. })
  597. historyTotalNum.value = dataPageList.total
  598. const followDataOption = followData?.map(item=>{
  599. return{
  600. label:item.name,
  601. value:item.id,
  602. }
  603. })
  604. const productDataOption = productData?.map(item=>{
  605. return{
  606. label:item.name,
  607. value:item.id,
  608. }
  609. })
  610. const memberDataOption = memberData?.map(item=>{
  611. return{
  612. label:item.username,
  613. value:item.id,
  614. }
  615. })
  616. historyFollowSearchList.value = historyFollowSearchList.value.map(item=>{
  617. if(item.key == 'product'){
  618. item.options = [
  619. { label: '全部', value: 'all' },
  620. ...productDataOption
  621. ]
  622. }else if(item.key == 'personnel'){
  623. item.options = [
  624. { label: '全部', value: 'all' },
  625. ...memberDataOption
  626. ]
  627. }else if(item.key == 'followStatus'){
  628. item.options = [
  629. { label: '全部', value: 'all' },
  630. ...followDataOption
  631. ]
  632. }
  633. item.defaultValue = historySearchParams.value[item.key]
  634. return item
  635. })
  636. }
  637. }
  638. watch(()=>props.followReloadFlag,async (newVal)=>{
  639. await GetOverviewDetail()
  640. })
  641. onMounted( async ()=>{
  642. await GetOverviewDetail()
  643. })
  644. </script>
  645. <style lang="scss" scoped>
  646. .message_overview {
  647. overflow: auto;
  648. display: flex;
  649. align-items: flex-start;
  650. gap: 20px;
  651. background-color: #fff;
  652. font-size: 14px;
  653. color: #333;
  654. > * {
  655. height: 100%;
  656. overflow: auto;
  657. }
  658. // 左侧栏样式
  659. .left_panel {
  660. width: 200px; // 稍微加宽以容纳内容
  661. display: flex;
  662. flex-direction: column;
  663. gap: 16px;
  664. .product_summary {
  665. padding:12px;
  666. background: #F8FAFE;
  667. border-radius: 10px;
  668. border: 1px solid #EBEEF5;
  669. color: #333333;
  670. .summary_title {
  671. font-weight: 600;
  672. font-size: 16px;
  673. margin-bottom: 12px;
  674. line-height: 22px;
  675. }
  676. .summary_tags {
  677. display: grid;
  678. grid-template-columns: repeat(2,1fr);
  679. gap:16px;
  680. font-size: 14px;
  681. line-height: 20px;
  682. }
  683. }
  684. .product_list {
  685. display: flex;
  686. flex-direction: column;
  687. gap: 16px;
  688. overflow: auto;
  689. padding:12px;
  690. background: #F8FAFE;
  691. border-radius: 10px;
  692. border: 1px solid #EBEEF5;
  693. .list_item {
  694. display: flex;
  695. flex-direction: column;
  696. gap:4px;
  697. .item_title {
  698. line-height: 20px;
  699. font-weight: 600;
  700. font-size: 14px;
  701. color: #333333;
  702. margin-bottom: 4px;
  703. }
  704. .item_info {
  705. line-height: 17px;
  706. font-weight: 400;
  707. font-size: 12px;
  708. color: #666666;
  709. }
  710. }
  711. }
  712. }
  713. // 中间栏样式
  714. .center_panel {
  715. flex: 1;
  716. display: flex;
  717. flex-direction: column;
  718. .page_content{
  719. flex: 1 1;
  720. overflow: auto;
  721. padding-bottom: 10px;
  722. display: flex;
  723. flex-direction: column;
  724. .no_data_bg{
  725. flex: 1 1;
  726. background-position: 50% 20px;
  727. background-size: 200px auto;
  728. min-height: 150px;
  729. span{
  730. margin-top: 120px;
  731. }
  732. }
  733. }
  734. :deep(.follow_card){
  735. .table_row_option{
  736. display: none;
  737. }
  738. .audit_card{
  739. &:hover{
  740. border:solid #2E64FA 1px;
  741. background-color: rgba(46, 100, 250,0.04);
  742. .table_row_option{
  743. display: flex;
  744. }
  745. }
  746. }
  747. }
  748. }
  749. // 右侧栏样式
  750. .right_panel {
  751. width: 320px;
  752. display: flex;
  753. flex-direction: column;
  754. justify-content: space-between;
  755. gap: 16px;
  756. .pending_appointments {
  757. flex:1 1;
  758. overflow: auto;
  759. display: flex;
  760. flex-direction: column;
  761. gap: 16px;
  762. color: #333333;
  763. .panel_header {
  764. font-size: 16px;
  765. line-height: 22px;
  766. font-weight: 600;
  767. }
  768. .task_list{
  769. flex:1 1;
  770. display: flex;
  771. flex-direction: column;
  772. gap: 16px;
  773. overflow: auto;
  774. .todo_card {
  775. display: flex;
  776. flex-direction: column;
  777. gap:8px;
  778. border-radius: 8px;
  779. border: 1px solid #EBEEF5;
  780. padding: 12px;
  781. .card_top {
  782. display: flex;
  783. justify-content: flex-start;
  784. align-items: center;
  785. gap:8px;
  786. font-weight: 600;
  787. line-height: 20px;
  788. .title{
  789. flex: 1;
  790. }
  791. .table_row_option {
  792. display: none;
  793. width: auto;
  794. flex-shrink: 0 !important;
  795. font-weight: 400;
  796. }
  797. }
  798. .card_tags {
  799. display: flex;
  800. gap:10px;
  801. font-size: 12px;
  802. line-height: 17px;
  803. >span{
  804. border-radius:4px;
  805. padding:4px 8px;
  806. }
  807. .task_type{
  808. color:white;
  809. background: #2E64FA;
  810. }
  811. .follow_status{
  812. background: rgba(46,100,250,0.1);
  813. color:#2E64FA;
  814. }
  815. }
  816. .card_info{
  817. display: flex;
  818. align-items: center;
  819. gap:11px;
  820. font-size: 12px;
  821. line-height: 17px;
  822. }
  823. .card_content{
  824. font-size: 12px;
  825. color: #999999;
  826. line-height: 17px;
  827. }
  828. &:hover{
  829. border:solid #2E64FA 1px;
  830. .card_top{
  831. .table_row_option {
  832. display: flex;
  833. }
  834. }
  835. }
  836. }
  837. .no_data{
  838. overflow: hidden;
  839. .no_data_bg{
  840. background-size: 200px auto;
  841. background-position: 50% 10px;
  842. span{
  843. margin-top: 110px;
  844. }
  845. }
  846. }
  847. }
  848. }
  849. .history_statistics{
  850. padding:16px 14px 12px 16px;
  851. background: #F8FAFE;
  852. border-radius: 10px;
  853. border: 1px solid #EBEEF5;
  854. .stat_header{
  855. display: flex;
  856. align-items: center;
  857. justify-content: space-between;
  858. line-height: 22px;
  859. font-weight: 600;
  860. font-size: 16px;
  861. margin-bottom: 10px;
  862. .button_border{
  863. background-color: #f8fafe;
  864. }
  865. }
  866. .stat_numbers{
  867. display: flex;
  868. gap:10px;
  869. align-items: center;
  870. .num_item{
  871. display: flex;
  872. flex-direction: column;
  873. align-items: center;
  874. color: #666666;
  875. .num{
  876. font-weight: 600;
  877. font-size: 16px;
  878. line-height: 24px;
  879. }
  880. .label{
  881. font-size: 14px;
  882. line-height: 20px;
  883. }
  884. }
  885. .vertical_solid{
  886. width: 1px;
  887. height: 32px;
  888. background-color: #EBEEF5;
  889. }
  890. }
  891. }
  892. }
  893. }
  894. </style>