AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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