Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

490 строки
12 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" v-if="timepickpickisshow">{{staff2.label}}:50</view>
  44. <view class="heji">{{staff1.label}}:25</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" v-if="timepickpickisshow">{{staff2.label}}:50</view>
  73. <view class="heji">{{staff1.label}}:25</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="wangxiaohuaerlingeryilingwuyibhh"
  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" style="padding-right: 30rpx;">
  90. <view class="title1" style="flex: 1;">销讲能力</view>
  91. </view>
  92. <view class="uchaserbox">
  93. <qiun-data-charts
  94. type="radar"
  95. :chartData="chartData"
  96. :canvas2d="true"
  97. canvasId="wangxiaohuaerlingeryilingwuycsdx"
  98. background="none"
  99. />
  100. </view>
  101. </view>
  102. <!-- <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar> -->
  103. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  104. <!-- 选择客户的选择框 -->
  105. <u-select v-model="staffShow" :list="staffList" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
  106. <u-select v-model="staffShow1" :list="staffList1" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
  107. </view>
  108. </template>
  109. <script>
  110. export default {
  111. data() {
  112. return {
  113. timepickpickisshow:false,
  114. totalTimeShow: false,
  115. activeTotal:4,
  116. activeTotal2:1,
  117. // 楼盘id
  118. houseId:'',
  119. staffList:[],
  120. staffList1:[],
  121. staffShow:false,
  122. staffShow1:false,
  123. staff1:{
  124. value:'',
  125. label:''
  126. },
  127. staff2:{
  128. value:'',
  129. label:'平均'
  130. },
  131. lastStartDate:'',
  132. lastEndDate :'',
  133. selindex:[0],
  134. choseStaffFlag:false,
  135. lineOptsect:{
  136. "categories": ["2016","2017","2018","2019","2020","2021"],
  137. "series": [
  138. {
  139. "name": "成交量1",
  140. "data": [35,8,25,37,4,20]
  141. },
  142. {
  143. "name": "成交量2",
  144. "data": [40,18,45,44,10,60]
  145. }
  146. ]
  147. },
  148. lineOptsect1:{
  149. "categories": ["2016","2017","2018","2019","2020","2021"],
  150. "series": [
  151. {
  152. "name": "成交量1",
  153. "data": [35,8,25,37,4,20]
  154. },
  155. {
  156. "name": "成交量2",
  157. "data": [40,18,45,44,10,60]
  158. }
  159. ]
  160. },
  161. chartData:{
  162. "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"],
  163. "series": [
  164. {
  165. "name": "成交量",
  166. "data": [90,110,165,195,187,172]
  167. }
  168. ]
  169. }
  170. };
  171. },
  172. onLoad: function(options) {
  173. // 获取楼盘id
  174. this.houseId = uni.getStorageSync('buildingID').id;
  175. // this.buildingname = uni.getStorageSync('buildingID').name;
  176. // 请求接口获取所有置业顾问员工的列表
  177. this.getStaffList()
  178. },
  179. methods: {
  180. //是否对比
  181. checkboxChange(){
  182. this.timepickpickisshow=!this.timepickpickisshow;
  183. this.staff2.value=''
  184. this.staff2.label='平均'
  185. this.getreception()
  186. this.getRecordList()
  187. this.getAwardList()
  188. },
  189. // 点击员工对比
  190. chiocStaff(idx){
  191. if(idx==0){
  192. // 当选择了第一个的时候
  193. this.choseStaffFlag=false
  194. this.staffShow=true
  195. }else{
  196. this.choseStaffFlag=true
  197. this.staffShow1=true
  198. }
  199. },
  200. // 获取员工列表
  201. getStaffList(){
  202. this.$u.post('/cusLvStatistics/selectAllAccountIdByHouseId',{houseId:this.houseId})
  203. .then(res=>{
  204. // console.log(res,'123')
  205. this.staffList=[]
  206. this.staffList1=[]
  207. res.map(item=>{
  208. let obj={}
  209. obj.value=item.accountId
  210. obj.label=item.name
  211. this.staffList.push(obj)
  212. })
  213. this.staffList1=[...this.staffList]
  214. this.staffList1.unshift({
  215. value:'',
  216. label:'平均'
  217. })
  218. this.staff1=this.staffList[0]
  219. this.getreception()
  220. this.getRecordList()
  221. this.getAwardList()
  222. })
  223. },
  224. // 获取接待量数据
  225. getreception(){
  226. this.$u.post('/cusLvStatistics/employeeAnalysisReception',{
  227. userA:this.staff1.value,
  228. userB:this.staff2.value,
  229. houseId:this.houseId,
  230. timeType:this.lastEndDate?null:this.activeTotal+'',
  231. lastEndDate:this.lastEndDate,
  232. lastStartDate:this.lastStartDate
  233. })
  234. .then(res=>{
  235. console.log(res)
  236. let first=res.first
  237. let second=res.second
  238. this.lineOptsect.categories=[]
  239. if(!this.timepickpickisshow){
  240. this.lineOptsect.series=[
  241. {
  242. name:'成交量',
  243. data:[]
  244. }
  245. ]
  246. first.map(item=>{
  247. this.lineOptsect.categories.push(item.statDate.slice(5,10))
  248. this.lineOptsect.series[0].data.push(item.sumCustomer)
  249. })
  250. }else{
  251. this.lineOptsect.series=[
  252. {
  253. name:'成交量1',
  254. data:[]
  255. },
  256. {
  257. "name": "成交量2",
  258. "data": []
  259. }
  260. ]
  261. first.map(item=>{
  262. this.lineOptsect.categories.push(item.statDate.slice(5,10))
  263. this.lineOptsect.series[0].data.push(item.sumCustomer)
  264. })
  265. second.map(item=>{
  266. this.lineOptsect.series[1].data.push(item.sumCustomer)
  267. })
  268. }
  269. })
  270. },
  271. // 获取有效录音
  272. async getRecordList(){
  273. // 当选择有效录音时
  274. let res=null
  275. if(this.activeTotal2==0){
  276. res= await this.$u.post('/cusLvStatistics/employeeAnalysisEffectiveRecording',{
  277. userA:this.staff1.value,
  278. userB:this.staff2.value,
  279. houseId:this.houseId,
  280. timeType:this.lastEndDate?null:this.activeTotal+'',
  281. lastEndDate:this.lastEndDate,
  282. lastStartDate:this.lastStartDate
  283. })
  284. }else{
  285. res= await this.$u.post('/cusLvStatistics/employeeAnalysisRecordingTime',{
  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. }
  294. // console.log(res)
  295. let first=res.first
  296. let second=res.second
  297. this.lineOptsect1.categories=[]
  298. if(!this.timepickpickisshow){
  299. this.lineOptsect1.series=[
  300. {
  301. name:'成交量',
  302. data:[]
  303. }
  304. ]
  305. first.map(item=>{
  306. this.lineOptsect1.categories.push(item.statDate.slice(5,10))
  307. this.lineOptsect1.series[0].data.push(item.sumDuration)
  308. })
  309. }else{
  310. this.lineOptsect1.series=[
  311. {
  312. name:'成交量1',
  313. data:[]
  314. },
  315. {
  316. "name": "成交量2",
  317. "data": []
  318. }
  319. ]
  320. first.map(item=>{
  321. this.lineOptsect1.categories.push(item.statDate.slice(5,10))
  322. this.lineOptsect1.series[0].data.push(item.sumDuration)
  323. })
  324. second.map(item=>{
  325. this.lineOptsect1.series[1].data.push(item.sumDuration)
  326. })
  327. }
  328. },
  329. // 获取销奖能力
  330. getAwardList(){
  331. this.$u.post('/cusLvStatistics/employeeAnalysisLevel1Fraction',{
  332. userA:this.staff1.value,
  333. userB:this.staff2.value,
  334. houseId:this.houseId,
  335. timeType:this.lastEndDate?null:this.activeTotal+'',
  336. lastEndDate:this.lastEndDate,
  337. lastStartDate:this.lastStartDate
  338. })
  339. .then(res=>{
  340. console.log(res)
  341. let first=res.first
  342. let second=res.second
  343. this.chartData.categories=[]
  344. if(!this.timepickpickisshow){
  345. this.chartData.series=[
  346. {
  347. name:'分数',
  348. data:[]
  349. }
  350. ]
  351. first.map(item=>{
  352. this.chartData.categories.push(item.name)
  353. this.chartData.series[0].data.push(item.sumCustomer)
  354. })
  355. }else{
  356. this.chartData.series=[
  357. {
  358. name:'分数1',
  359. data:[]
  360. },
  361. {
  362. "name": "分数2",
  363. "data": []
  364. }
  365. ]
  366. first.map(item=>{
  367. this.chartData.categories.push(item.name)
  368. this.chartData.series[0].data.push(item.sumCustomer)
  369. })
  370. second.map(item=>{
  371. this.chartData.series[1].data.push(item.sumCustomer)
  372. })
  373. }
  374. })
  375. },
  376. tabtimetap(index){
  377. if (index == 3) {
  378. this.totalTimeShow = true;
  379. } else {
  380. this.activeTotal = index;
  381. this.lastEndDate=''
  382. this.lastStartDate=''
  383. // 获取数据
  384. this.getreception()
  385. this.getRecordList()
  386. this.getAwardList()
  387. }
  388. },
  389. tabtimetap1(index){
  390. this.activeTotal2 = index;
  391. // 调用方法
  392. this.getRecordList()
  393. },
  394. //自定义时间
  395. totalTimeChange(e) {
  396. console.log(e.startDate, e.endDate)
  397. this.activeTotal=3;
  398. this.lastEndDate=e.endDate
  399. this.lastStartDate=e.startDate
  400. // 获取数据
  401. this.getreception()
  402. this.getRecordList()
  403. this.getAwardList()
  404. },
  405. staffSelectCallback(e){
  406. if(this.choseStaffFlag){
  407. // 第二个客户
  408. // console.log(e,'第二个')
  409. this.staff2=e[0]
  410. }else{
  411. // 第一个客户
  412. // console.log(e,'第一个')
  413. this.staff1=e[0]
  414. }
  415. if(this.staff1.label==this.staff2.label){
  416. uni.showToast({
  417. title:'请勿选择重复',
  418. icon:'none'
  419. })
  420. this.staff2.label='请选择'
  421. // this.staff2.label='平均'
  422. // this.staff2.value=''
  423. return
  424. }else{
  425. // 获取数据
  426. this.getreception()
  427. this.getRecordList()
  428. this.getAwardList()
  429. }
  430. },
  431. },
  432. }
  433. </script>
  434. <style lang="scss" scoped>
  435. // 对比时间切换
  436. .timepick{
  437. width: 100%;
  438. height: 90rpx;
  439. display: flex;
  440. align-items: center;
  441. background: #FAFAFA;
  442. }
  443. .timepicktime{
  444. width: 260rpx;
  445. height: 50rpx;
  446. border: 1rpx solid #E0E0E0;
  447. margin-left: 30rpx;
  448. display: flex;
  449. background: #FFFFFF;
  450. }
  451. .timepicktime>view:nth-of-type(1){
  452. width: 210rpx;
  453. height: 100%;
  454. line-height: 50rpx;
  455. font-size: 26rpx;
  456. font-weight: 400;
  457. text-align: center;
  458. }
  459. .timepicktime>view:nth-of-type(2){
  460. width: 50rpx;
  461. height: 100%;
  462. border-left: 1px solid #E0E0E0;
  463. }
  464. .timepickpick{
  465. width: 110rpx;
  466. height: 50rpx;
  467. margin-left: 30rpx;
  468. display: flex;
  469. align-items: center;
  470. }
  471. .Underimg{
  472. width: 50rpx;
  473. height:50rpx;
  474. margin-top: -2rpx;
  475. }
  476. </style>