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.

StaffAnalysis.vue 12 KiB

3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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>