AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

629 行
16 KiB

  1. <template>
  2. <view>
  3. <view class="boxtittab">
  4. <view class="tabbox">
  5. <view :class="{ activecllasscet: activeTotal == 4 }" @click="tabtimetap(4)">近七天</view>
  6. </view>
  7. <view class="tabbox">
  8. <view :class="{ activecllasscet: activeTotal == 5 }" @click="tabtimetap(5)">近15天</view>
  9. </view>
  10. <view class="tabbox">
  11. <view :class="{ activecllasscet: activeTotal == 6 }" @click="tabtimetap(6)">近30天</view>
  12. </view>
  13. <view class="tabbox">
  14. <view :class="{ activecllasscet: activeTotal == 3 }" @click="tabtimetap(3)">自定义</view>
  15. </view>
  16. </view>
  17. <view class="timepick">
  18. <view class="timepicktime" @click="chiocStaff(0)">
  19. <view>{{staff1.label}}</view>
  20. <view>
  21. <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
  22. </view>
  23. </view>
  24. <view class="timepickpick">
  25. <view @click="checkboxChange()" style="width: 40rpx;height:40rpx;border: 1rpx solid #E0E0E0;">
  26. <image v-if="timepickpickisshow" style="width: 40rpx;height: 40rpx;" src="../../../static/images/xuanzhong.png" mode=""></image>
  27. </view>
  28. <view style="font-size:26rpx;text-indent: 12rpx;">对比</view>
  29. </view>
  30. <view class="timepicktime" v-if="timepickpickisshow" @click="chiocStaff(1)">
  31. <view>{{staff2.label}}</view>
  32. <view>
  33. <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
  34. </view>
  35. </view>
  36. </view>
  37. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  38. <view class="single">
  39. <view class="title">
  40. <view class="title1" style="flex: 1;">接待量</view>
  41. </view>
  42. <view class="hejibox">
  43. <view class="heji">{{staff1.label}}:{{newTeam1||0}}</view>
  44. <view class="heji" v-if="timepickpickisshow">{{staff2.label}}:{{newAvg1||0}}</view>
  45. </view>
  46. <view class="danwei">来访(人)</view>
  47. <view class="uchaserbox">
  48. <qiun-data-charts
  49. type="line"
  50. :chartData="lineOptsect"
  51. background="none"
  52. :ontouch="true"
  53. canvasId="wangxiaohuaerlingeryilingwuyibbb"
  54. :canvas2d="true"
  55. />
  56. </view>
  57. </view>
  58. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  59. <view class="single">
  60. <view class="title">
  61. <view class="title1" style="flex: 1;">录音时长</view>
  62. <view class="title3" style="flex: 1;">
  63. <!-- <view class="title3-box" style="width: 40%;" @click="tabtimetap1(0)">
  64. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">有效录音</view>
  65. </view>
  66. <view class="title3-box" style="width: 40%;"@click="tabtimetap1(1)">
  67. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">录音时长</view>
  68. </view> -->
  69. </view>
  70. </view>
  71. <view class="hejibox">
  72. <view class="heji">{{staff1.label}}:{{newTeam2||0}}</view>
  73. <view class="heji" v-if="timepickpickisshow">{{staff2.label}}:{{newAvg2||0}}</view>
  74. </view>
  75. <view class="danwei">录音时长</view>
  76. <view class="uchaserbox">
  77. <qiun-data-charts
  78. type="line"
  79. :chartData="lineOptsect1"
  80. background="none"
  81. :ontouch="true"
  82. canvasId="wangxiaouaerlingeryilingwuyibhh"
  83. :canvas2d="true"
  84. />
  85. </view>
  86. </view>
  87. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  88. <view class="single">
  89. <view class="title">
  90. <view class="title1" style="flex: 1;">销讲执行率</view>
  91. <view class="title3" style="flex: 1;">
  92. <!-- <view class="title3-box" style="width: 40%;" @click="tabtimetap1(0)">
  93. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">有效录音</view>
  94. </view>
  95. <view class="title3-box" style="width: 40%;"@click="tabtimetap1(1)">
  96. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">录音时长</view>
  97. </view> -->
  98. </view>
  99. </view>
  100. <view class="hejibox">
  101. <view class="heji">{{staff1.label}}:{{newTeam3||0}}</view>
  102. <view class="heji" v-if="timepickpickisshow">{{staff2.label}}:{{newAvg3||0}}</view>
  103. </view>
  104. <!-- <view class="danwei">录音时长</view> -->
  105. <view class="uchaserbox">
  106. <qiun-data-charts
  107. type="line"
  108. :chartData="lineOptsect2"
  109. background="none"
  110. :ontouch="true"
  111. canvasId="wangxiaohuaerlingryilingwuyibhh"
  112. :canvas2d="true"
  113. />
  114. </view>
  115. </view>
  116. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  117. <view class="single">
  118. <view class="title" style="padding-right: 30rpx;">
  119. <view class="title1" style="flex: 1;">销讲能力</view>
  120. </view>
  121. <view class="uchaserbox">
  122. <qiun-data-charts
  123. type="radar"
  124. :opts="opts"
  125. :chartData="chartData"
  126. :canvas2d="true"
  127. canvasId="wangxiaohuaerlingeryilinwuycsdx"
  128. background="none"
  129. :loadingType="0"
  130. />
  131. </view>
  132. </view>
  133. <!-- <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar> -->
  134. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  135. <!-- 选择客户的选择框 -->
  136. <u-select v-model="staffShow" :list="staffList" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
  137. <u-select v-model="staffShow1" :list="staffList1" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
  138. </view>
  139. </template>
  140. <script>
  141. export default {
  142. data() {
  143. return {
  144. timepickpickisshow:true,
  145. totalTimeShow: false,
  146. activeTotal:4,
  147. activeTotal2:1,
  148. // 楼盘id
  149. houseId:'',
  150. staffList:[],
  151. staffList1:[],
  152. staffShow:false,
  153. staffShow1:false,
  154. newTeam1:'',
  155. newAvg1:'',
  156. newTeam2:'',
  157. newAvg2:'',
  158. newTeam3:'',
  159. newAvg3:'',
  160. staff1:{
  161. value:'',
  162. label:''
  163. },
  164. staff2:{
  165. value:'',
  166. label:'平均'
  167. },
  168. lastStartDate:'',
  169. lastEndDate :'',
  170. selindex:[0],
  171. choseStaffFlag:false,
  172. lineOptsect:{
  173. "categories": ["2016","2017","2018","2019","2020","2021"],
  174. "series": [
  175. {
  176. "name": "成交量1",
  177. "data": [35,8,25,37,4,20]
  178. },
  179. {
  180. "name": "成交量2",
  181. "data": [40,18,45,44,10,60]
  182. }
  183. ]
  184. },
  185. lineOptsect1:{
  186. "categories": ["2016","2017","2018","2019","2020","2021"],
  187. "series": [
  188. {
  189. "name": "成交量1",
  190. "data": [35,8,25,37,4,20]
  191. },
  192. {
  193. "name": "成交量2",
  194. "data": [40,18,45,44,10,60]
  195. }
  196. ]
  197. },
  198. lineOptsect2:{
  199. "categories": ["2016","2017","2018","2019","2020","2021"],
  200. "series": [
  201. {
  202. "name": "成交量1",
  203. "data": [35,8,25,37,4,20]
  204. },
  205. {
  206. "name": "成交量2",
  207. "data": [40,18,45,44,10,60]
  208. }
  209. ]
  210. },
  211. chartData:{
  212. "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"],
  213. "series": [
  214. {
  215. "name": "成交量",
  216. "data": [90,110,165,195,187,172]
  217. }
  218. ]
  219. },
  220. opts: {
  221. fontSize: 10,
  222. extra: {
  223. radar: {
  224. max: 100
  225. }
  226. }
  227. }
  228. };
  229. },
  230. onLoad: function(options) {
  231. // 获取楼盘id
  232. this.houseId = uni.getStorageSync('buildingID').id;
  233. // this.buildingname = uni.getStorageSync('buildingID').name;
  234. // 请求接口获取所有置业顾问员工的列表
  235. this.getStaffList()
  236. },
  237. methods: {
  238. //是否对比
  239. checkboxChange(){
  240. this.timepickpickisshow=!this.timepickpickisshow;
  241. this.staff2.value=''
  242. this.staff2.label='平均'
  243. // this.getreception()
  244. // this.getRecordList()
  245. // this.getAwardList()
  246. // this.getAward()
  247. this.getdata()
  248. },
  249. // 点击员工对比
  250. chiocStaff(idx){
  251. if(idx==0){
  252. // 当选择了第一个的时候
  253. this.choseStaffFlag=false
  254. this.staffShow=true
  255. }else{
  256. this.choseStaffFlag=true
  257. this.staffShow1=true
  258. }
  259. },
  260. // 获取员工列表
  261. getStaffList(){
  262. this.$u.post('/cusLvStatistics/selectAllAccountIdByHouseId',{houseId:this.houseId})
  263. .then(res=>{
  264. // console.log(res,'123')
  265. this.staffList=[]
  266. this.staffList1=[]
  267. res.map(item=>{
  268. let obj={}
  269. obj.value=item.accountId
  270. obj.label=item.name
  271. this.staffList.push(obj)
  272. })
  273. this.staffList1=[...this.staffList]
  274. this.staffList1.unshift({
  275. value:'',
  276. label:'平均'
  277. })
  278. this.staff1=this.staffList[0]
  279. // this.getreception()
  280. // this.getRecordList()
  281. // this.getAwardList()
  282. // this.getAward()
  283. this.getdata()
  284. })
  285. },
  286. getdata(){
  287. this.getreception()
  288. this.getRecordList()
  289. this.getAward()
  290. this.getAwardList()
  291. },
  292. // 获取接待量数据
  293. getreception(){
  294. this.$u.post('/cusLvStatistics/employeeAnalysisReception',{
  295. userA:this.staff1.value,
  296. userB:this.staff2.value,
  297. houseId:this.houseId,
  298. timeType:this.lastEndDate?null:this.activeTotal+'',
  299. lastEndDate:this.lastEndDate,
  300. lastStartDate:this.lastStartDate
  301. })
  302. .then(res=>{
  303. this.newTeam1=res.avg[0]
  304. this.newAvg1=res.avg[1]
  305. // console.log(res)
  306. let first=res.first
  307. let second=res.second
  308. this.lineOptsect.categories=[]
  309. if(!this.timepickpickisshow){
  310. this.lineOptsect.series=[
  311. {
  312. name:first[0].accountName,
  313. data:[]
  314. }
  315. ]
  316. first.map(item=>{
  317. this.lineOptsect.categories.push(item.statDate.slice(5,10))
  318. this.lineOptsect.series[0].data.push(item.receptionCount||0)
  319. })
  320. }else{
  321. this.lineOptsect.series=[
  322. {
  323. name:first[0].accountName,
  324. data:[]
  325. },
  326. {
  327. "name": second[0].accountName,
  328. "data": []
  329. }
  330. ]
  331. first.map(item=>{
  332. this.lineOptsect.categories.push(item.statDate.slice(5,10))
  333. this.lineOptsect.series[0].data.push(item.receptionCount)
  334. })
  335. second.map(item=>{
  336. this.lineOptsect.series[1].data.push(item.receptionCount)
  337. })
  338. }
  339. // console.log(this.lineOptsect,'1')
  340. })
  341. },
  342. // 销奖趋势
  343. getAward(){
  344. this.$u.post('/cusLvStatistics/employeeAnalysisExacutiveRate',{
  345. userA:this.staff1.value,
  346. userB:this.staff2.value,
  347. houseId:this.houseId,
  348. timeType:this.lastEndDate?null:this.activeTotal+'',
  349. lastEndDate:this.lastEndDate,
  350. lastStartDate:this.lastStartDate
  351. })
  352. .then(res=>{
  353. this.newTeam3=res.avg[0]
  354. this.newAvg3=res.avg[1]
  355. // console.log(res)
  356. let first=res.first
  357. let second=res.second
  358. this.lineOptsect2.categories=[]
  359. if(!this.timepickpickisshow){
  360. this.lineOptsect2.series=[
  361. {
  362. name:first[0].accountName,
  363. data:[]
  364. }
  365. ]
  366. first.map(item=>{
  367. // console.log(item)
  368. this.lineOptsect2.categories.push(item.statDate.slice(5,10))
  369. this.lineOptsect2.series[0].data.push(item.sumFraction)
  370. })
  371. }else{
  372. this.lineOptsect2.series=[
  373. {
  374. name:first[0].accountName,
  375. data:[]
  376. },
  377. {
  378. "name": second[0].accountName,
  379. "data": []
  380. }
  381. ]
  382. first.map(item=>{
  383. this.lineOptsect2.categories.push(item.statDate.slice(5,10))
  384. this.lineOptsect2.series[0].data.push(item.sumFraction)
  385. })
  386. second.map(item=>{
  387. this.lineOptsect2.series[1].data.push(item.sumFraction)
  388. })
  389. }
  390. // console.log(this.lineOptsect2,'3')
  391. })
  392. },
  393. // 获取有效录音
  394. async getRecordList(){
  395. // 当选择有效录音时
  396. let res=null
  397. if(this.activeTotal2==0){
  398. res= await this.$u.post('/cusLvStatistics/employeeAnalysisEffectiveRecording',{
  399. userA:this.staff1.value,
  400. userB:this.staff2.value,
  401. houseId:this.houseId,
  402. timeType:this.lastEndDate?null:this.activeTotal+'',
  403. lastEndDate:this.lastEndDate,
  404. lastStartDate:this.lastStartDate
  405. })
  406. }else{
  407. res= await this.$u.post('/cusLvStatistics/employeeAnalysisRecordingTime',{
  408. userA:this.staff1.value,
  409. userB:this.staff2.value,
  410. houseId:this.houseId,
  411. timeType:this.lastEndDate?null:this.activeTotal+'',
  412. lastEndDate:this.lastEndDate,
  413. lastStartDate:this.lastStartDate
  414. })
  415. }
  416. // console.log(res)
  417. this.newTeam2=res.avg[0]
  418. this.newAvg2=res.avg[1]
  419. let first=res.first
  420. let second=res.second
  421. this.lineOptsect1.categories=[]
  422. if(!this.timepickpickisshow){
  423. this.lineOptsect1.series=[
  424. {
  425. name:first[0].accountName,
  426. data:[]
  427. }
  428. ]
  429. first.map(item=>{
  430. this.lineOptsect1.categories.push(item.statDate.slice(5,10))
  431. this.lineOptsect1.series[0].data.push(item.sumDuration)
  432. })
  433. }else{
  434. this.lineOptsect1.series=[
  435. {
  436. name:first[0].accountName,
  437. data:[]
  438. },
  439. {
  440. "name": second[0].accountName,
  441. "data": []
  442. }
  443. ]
  444. first.map(item=>{
  445. this.lineOptsect1.categories.push(item.statDate.slice(5,10))
  446. this.lineOptsect1.series[0].data.push(item.sumDuration)
  447. })
  448. second.map(item=>{
  449. this.lineOptsect1.series[1].data.push(item.sumDuration)
  450. })
  451. }
  452. // console.log(this.lineOptsect1,'2')
  453. },
  454. // 获取销奖能力
  455. getAwardList(){
  456. this.chartData={
  457. categories:[],
  458. series:[]
  459. }
  460. this.$u.post('/cusLvStatistics/employeeAnalysisLevel1Fraction',{
  461. userA:this.staff1.value,
  462. userB:this.staff2.value,
  463. houseId:this.houseId,
  464. timeType:this.lastEndDate?null:this.activeTotal+'',
  465. lastEndDate:this.lastEndDate,
  466. lastStartDate:this.lastStartDate
  467. })
  468. .then(res=>{
  469. // console.log(res)
  470. let first=res.first
  471. let second=res.second
  472. this.chartData.categories=[]
  473. if(!this.timepickpickisshow){
  474. this.chartData.series=[
  475. {
  476. name:first[0].accountName,
  477. data:[]
  478. }
  479. ]
  480. first.map(item=>{
  481. this.chartData.categories.push(item.name)
  482. this.chartData.series[0].data.push(item.avgExecutionRate)
  483. })
  484. }else{
  485. this.chartData.series=[
  486. {
  487. name:first[0].accountName,
  488. data:[]
  489. },
  490. {
  491. "name": second[0].accountName,
  492. "data": []
  493. }
  494. ]
  495. first.map(item=>{
  496. this.chartData.categories.push(item.name)
  497. this.chartData.series[0].data.push(item.avgExecutionRate)
  498. })
  499. second.map(item=>{
  500. this.chartData.series[1].data.push(item.avgExecutionRate)
  501. })
  502. }
  503. })
  504. },
  505. tabtimetap(index){
  506. if (index == 3) {
  507. this.totalTimeShow = true;
  508. } else {
  509. this.activeTotal = index;
  510. this.lastEndDate=''
  511. this.lastStartDate=''
  512. // 获取数据
  513. // this.getreception()
  514. // this.getRecordList()
  515. // this.getAwardList()
  516. this.getdata()
  517. }
  518. },
  519. tabtimetap1(index){
  520. this.activeTotal2 = index;
  521. // 调用方法
  522. this.getRecordList()
  523. },
  524. //自定义时间
  525. totalTimeChange(e) {
  526. console.log(e.startDate, e.endDate)
  527. this.activeTotal=3;
  528. this.lastEndDate=e.endDate
  529. this.lastStartDate=e.startDate
  530. // 获取数据
  531. // this.getreception()
  532. // this.getRecordList()
  533. // this.getAwardList()
  534. this.getdata()
  535. },
  536. staffSelectCallback(e){
  537. if(this.choseStaffFlag){
  538. // 第二个客户
  539. // console.log(e,'第二个')
  540. this.staff2=e[0]
  541. }else{
  542. // 第一个客户
  543. // console.log(e,'第一个')
  544. this.staff1=e[0]
  545. }
  546. if(this.staff1.label==this.staff2.label){
  547. uni.showToast({
  548. title:'请勿选择重复',
  549. icon:'none'
  550. })
  551. this.staff2.label='请选择'
  552. // this.staff2.label='平均'
  553. // this.staff2.value=''
  554. return
  555. }else{
  556. // 获取数据
  557. // this.getreception()
  558. // this.getRecordList()
  559. // this.getAwardList()
  560. this.getdata()
  561. }
  562. },
  563. },
  564. }
  565. </script>
  566. <style lang="scss" scoped>
  567. .boxtittab {
  568. position: sticky;
  569. top: var(--window-top);
  570. z-index: 999;
  571. }
  572. // 对比时间切换
  573. .timepick{
  574. width: 100%;
  575. height: 90rpx;
  576. display: flex;
  577. align-items: center;
  578. background: #FAFAFA;
  579. }
  580. .timepicktime{
  581. width: 260rpx;
  582. height: 50rpx;
  583. border: 1rpx solid #E0E0E0;
  584. margin-left: 30rpx;
  585. display: flex;
  586. background: #FFFFFF;
  587. }
  588. .timepicktime>view:nth-of-type(1){
  589. width: 210rpx;
  590. height: 100%;
  591. line-height: 50rpx;
  592. font-size: 26rpx;
  593. font-weight: 400;
  594. text-align: center;
  595. }
  596. .timepicktime>view:nth-of-type(2){
  597. width: 49rpx;
  598. height: 100%;
  599. // border-left: 1px solid #E0E0E0;
  600. }
  601. .timepickpick{
  602. width: 110rpx;
  603. height: 50rpx;
  604. margin-left: 30rpx;
  605. display: flex;
  606. align-items: center;
  607. }
  608. .Underimg{
  609. width: 50rpx;
  610. height:50rpx;
  611. margin-top: -2rpx;
  612. }
  613. </style>