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.
 
 
 

1336 rivejä
37 KiB

  1. <template>
  2. <view>
  3. <view class="timetabct">
  4. <view class="timetabctview">
  5. <view :class="{ activecllasscet: activeTotal == 0 }" @click="tabtimetap(0)">7天</view>
  6. </view>
  7. <view class="timetabctview">
  8. <view :class="{ activecllasscet: activeTotal == 1 }" @click="tabtimetap(1)">15天</view>
  9. </view>
  10. <view class="timetabctview">
  11. <view :class="{ activecllasscet: activeTotal == 2 }" @click="tabtimetap(2)">30天</view>
  12. </view>
  13. </view>
  14. <view class="timepick">
  15. <view class="timepicktime">
  16. <view @click="tabtimetap(3)">{{sheartime1}}</view>
  17. <view>
  18. <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
  19. </view>
  20. </view>
  21. <view class="timepickpick">
  22. <view @click="checkboxChange()" style="width: 40rpx;height:40rpx;border: 1rpx solid #E0E0E0;">
  23. <image v-if="timepickpickisshow" style="width: 40rpx;height: 40rpx;"
  24. src="../../../static/images/xuanzhong.png" mode=""></image>
  25. </view>
  26. <view style="font-size:26rpx;text-indent: 12rpx;">对比</view>
  27. </view>
  28. <view class="timepicktime" v-if="timepickpickisshow">
  29. <view @click="tabtimetap(4)">{{sheartime2}}</view>
  30. <view>
  31. <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="timeduibi">
  36. <view class="timeshow">数据起始时间:<text style="color: #333333;">{{kanbanlist.kaishitime}}</text></view>
  37. <view class="timeshow" v-if="kanbanlist.duibitime.length!=0">
  38. 数据对比时间:
  39. <text style="color: #333333;">{{kanbanlist.duibitime}}</text>
  40. </view>
  41. </view>
  42. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  43. <view class="boxzonglan" style="min-height: 100rpx;">
  44. <view class="zonglantit">简报</view>
  45. <view class="zonglanbox" >
  46. <view class="grid" v-for="(item,index) in numlist" :key="index" style="height: auto;padding-bottom: 20rpx;">
  47. <view class="audonum" v-if="item.name=='接待时长'">{{item.name}}/分</view>
  48. <view class="audonum" v-else>{{item.name}}</view>
  49. <view class="num" >
  50. <view class="" style="width: 35%;">
  51. {{index==1?item.num+'%':item.num}}
  52. </view>
  53. <view class="comparesize" v-if="compareFlag&&timepickpickisshow">
  54. <text style="margin-right: 10rpx;">对比:{{index==1?item.num1+'%':item.num1}} </text>
  55. <text :style="{color:item.num2*1>0?'red':'green'}">{{index==1?item.num2+'%':item.num2}} {{item.num2*1>0?'↑':'↓'}}</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  62. <view class="boxtittab" style="border: none;height: 82rpx;">
  63. <view class="tabbox">
  64. <view :class="{ activecllasscet2: newactiveTotal == 0 }" @click="tabxuanxiangtap(0)">项目</view>
  65. </view>
  66. <view class="tabbox">
  67. <view :class="{ activecllasscet2: newactiveTotal == 1 }" @click="tabxuanxiangtap(1)">顾问</view>
  68. </view>
  69. <view class="tabbox">
  70. <view :class="{ activecllasscet2: newactiveTotal == 2 }" @click="tabxuanxiangtap(2)">团队</view>
  71. </view>
  72. <view class="tabbox">
  73. <view :class="{ activecllasscet2: newactiveTotal == 3 }" @click="tabxuanxiangtap(3)">销讲一级</view>
  74. </view>
  75. <view class="tabbox">
  76. <view :class="{ activecllasscet2: newactiveTotal == 4 }" @click="tabxuanxiangtap(4)">销讲二级</view>
  77. </view>
  78. </view>
  79. <view class="chart">
  80. <view style="display: flex;justify-content:center;padding-left: 30rpx;padding-right: 30rpx;margin-top: 16rpx;"
  81. v-if="guwenshow&&lopanobj.name" @click="oninputtap()">
  82. <view class="title2-che" style="width: 220rpx;">{{lopanobj.name}}
  83. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  84. </view>
  85. </view>
  86. <view style="padding: 30rpx;padding-bottom: 20rpx;align-items: center;" v-if="Selectlevel">
  87. <view style="display: flex;align-items: center;border-bottom: 1px solid #C9C9C9;height: 80rpx;">
  88. <view>选择一级:</view>
  89. <!-- <view style="width:75%;">
  90. <input @click="oninputtap2()" v-model="Selectlevelobj.name" type="text" disabled="true"
  91. :border="border" placeholder="请选择" />
  92. </view>
  93. <view>
  94. <image src="https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/qf/more.png"
  95. style="width:12rpx;height:23rpx;margin-left: 16rpx;">
  96. </view> -->
  97. <view style="display: flex;justify-content:center;padding-left: 30rpx;padding-right: 30rpx;margin-top: 16rpx;"
  98. v-if="Selectlevelobj.name" @click="oninputtap2()">
  99. <view class="title2-che" style="width: 220rpx;">{{Selectlevelobj.name}}
  100. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  101. </view>
  102. </view>
  103. </view>
  104. <view style="display: flex;align-items: center;border-bottom: 1px solid #C9C9C9;height: 80rpx;">
  105. <view>选择二级:</view>
  106. <!-- <view style="width:75%;">
  107. <input @click="oninputtap3()" v-model="erSelectlevelobj.name" type="text" disabled="true"
  108. :border="border" placeholder="请选择" />
  109. </view>
  110. <view>
  111. <image src="https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/qf/more.png"
  112. style="width:12rpx;height:23rpx;margin-left: 16rpx;">
  113. </view> -->
  114. <view style="display: flex;justify-content:center;padding-left: 30rpx;padding-right: 30rpx;margin-top: 16rpx;"
  115. v-if="erSelectlevelobj.name" @click="oninputtap3()">
  116. <view class="title2-che" style="width: 220rpx;">{{erSelectlevelobj.name}}
  117. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. <view style="display: flex;align-items: center;height: 80rpx;justify-content: center;" v-if="Selecttuandui&&Selecttuanduiobj.name"
  123. @click="oninputtap4()">
  124. <view class="title2-che" style="width: 220rpx;">{{Selecttuanduiobj.name}}
  125. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  126. </view>
  127. </view>
  128. <view class="single">
  129. <!-- <view class="danwei" style="margin-top: 10rpx;">销讲词执行率</view> -->
  130. <view class="uchaserbox" v-if="lineOptsect.series.length!=0">
  131. <qiun-data-charts :style="!showCanvas?'display:none':''" :type="linetype" :chartData="lineOptsect"
  132. background="none" :ontouch="true" canvasId="wangxiaohuaerlingeryilingwuyibao"
  133. :canvas2d="true" />
  134. </view>
  135. <view v-else style="width: 100%;">
  136. <view style="width: 100%;text-align: center;">
  137. <image style="width: 200rpx;height: 200rpx;"
  138. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  139. </view>
  140. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  141. </view>
  142. </view>
  143. </view>
  144. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  145. <view class="single" v-if="timepickpickisshow">
  146. <view class="title">
  147. <view class="title1">对比报表</view>
  148. </view>
  149. <view class="table" v-if="!guwenFlag">
  150. <view v-for="(item,index) in tableDate" :key="index">
  151. <view class="tr">
  152. <view v-for="(item1,index1) in item" :key="index" style="width: 100%;">
  153. <view v-if="index1<item.length-1||index==0" class="td"
  154. style="border-right:1px solid #E0E0E0;">{{item1}}</view>
  155. <view v-if="index>0 && index1==item.length-1" class="td"
  156. style="border-right:1px solid #E0E0E0;" :style="{color:item1*1>0?'red':'green'}">
  157. {{item1==0?'--':item1+'%'}}{{item1*1>0?'↑':item1*1<0?'↓':''}}</view>
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. <view class="table" v-if="guwenFlag" style="width: 100%;">
  163. <scroll-view scroll-x="true" style="white-space: nowrap;">
  164. <view v-for="(item,index) in tableDate" :key="index" :style="{display:index==0?'inline-block':'block'}">
  165. <view class="tr" style="display: inline-block;">
  166. <view v-for="(item1,index1) in item" :key="index1" class="trd" style="display: inline-block;">
  167. <view v-if="index==1&&index1>0" class="td" :style="{color:item1*1>0?'red':'green'}"
  168. style="border-right:1px solid #E0E0E0;">{{item1==0?'--':item1+'%'}}{{item1*1>0?'↑':item1*1<0?'↓':''}}</view>
  169. <view v-else-if="index>1&&index1>0" class="td" style="border-right:1px solid #E0E0E0;">
  170. {{item1+'%'}}</view>
  171. <view v-else class="td" style="border-right:1px solid #E0E0E0;">{{item1}}</view>
  172. </view>
  173. </view>
  174. </view>
  175. </scroll-view>
  176. </view>
  177. </view>
  178. <view style="width: 100%;height: 60rpx;"></view>
  179. <view v-if="Showhiddenunits">
  180. <u-select v-model="Showhiddenunits" mode="single-column" :list="selectlist" @confirm="confirm">
  181. </u-select>
  182. </view>
  183. <view v-if="Showhiddenunits2">
  184. <u-select v-model="Showhiddenunits2" mode="single-column" :list="selectlist2" @confirm="confirm2">
  185. </u-select>
  186. </view>
  187. <view v-if="Showhiddenunits3">
  188. <u-select v-model="Showhiddenunits3" mode="single-column" :list="selectlist3" @confirm="confirm3">
  189. </u-select>
  190. </view>
  191. <view v-if="Showhiddenunits4">
  192. <u-select v-model="Showhiddenunits4" mode="single-column" :list="selectlist4" @confirm="confirm4">
  193. </u-select>
  194. </view>
  195. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  196. <newcalendar v-model="totalTimeShow2" :planNum='intervaltime' mode="date" @change="totalTimeChange2">
  197. </newcalendar>
  198. </view>
  199. </template>
  200. <script>
  201. import newcalendar from '@/components/newcalendar/newcalendar.vue';
  202. export default {
  203. data() {
  204. return {
  205. compareFlag: false,
  206. numlist: [{
  207. name: '接待量',
  208. num: '10',
  209. num1: '0',
  210. num2: '0'
  211. },
  212. {
  213. name: '平均执行率',
  214. num: '10',
  215. num1: '0',
  216. num2: '0'
  217. },
  218. {
  219. name: '接待时长',
  220. num: '10',
  221. num1: '0',
  222. num2: '0'
  223. },
  224. ],
  225. activeTotal: 0, //时间下标
  226. newactiveTotal: 0, //tab下标
  227. totalTimeShow: false,
  228. totalTimeShow2: false,
  229. totalTimeShow3: false,
  230. cWidth: uni.upx2px(690),
  231. cHeight: uni.upx2px(453),
  232. AcHeight: uni.upx2px(500),
  233. kanbanlist: { //录音和测评的数据
  234. kaishitime: '',
  235. duibitime: '',
  236. audonum: '',
  237. audotime: "",
  238. avgDuration: '',
  239. fraction: ''
  240. },
  241. pamect: { //接口参数
  242. houseId: '',
  243. timeType: "4",
  244. firstStartDate: '', //第一次开始时间
  245. firstEndDate: '', //第一次结束时间
  246. lastStartDate: '',
  247. lastEndDate: '',
  248. accountId: '', //顾问ids
  249. marketingId: '', //二级销讲id
  250. deptId: "", //部门id
  251. showStatus: 0
  252. },
  253. linetype: "line",
  254. lineOptsect: {}, //图表数据
  255. Showhiddenunits: false,
  256. selectlist: [],
  257. guwenshow: false,
  258. lopanobj: {
  259. id: '',
  260. name: ''
  261. },
  262. //二级相关
  263. Selectlevel: false,
  264. Selectlevelobj: {
  265. id: '',
  266. name: ''
  267. },
  268. erSelectlevelobj: {
  269. id: '',
  270. name: ''
  271. },
  272. Showhiddenunits2: false,
  273. Showhiddenunits3: false,
  274. selectlist2: [],
  275. selectlist3: [],
  276. //团队相关
  277. Selecttuandui: false,
  278. selectlist4: [],
  279. Selecttuanduiobj: {
  280. id: '',
  281. name: ''
  282. },
  283. Showhiddenunits4: false,
  284. showCanvas: true,
  285. timepickpickisshow: false,
  286. sheartime1: "",
  287. sheartime2: "",
  288. intervaltime: 0,
  289. tableDate: [],
  290. guwenFlag: false
  291. };
  292. },
  293. components: {
  294. newcalendar
  295. },
  296. onLoad: function(options) {
  297. this.pamect.houseId = uni.getStorageSync('buildingID').id;
  298. this.init()
  299. },
  300. watch: {
  301. Showhiddenunits(newValue, oldValue) {
  302. this.showCanvas = !newValue
  303. },
  304. Showhiddenunits2(newValue, oldValue) {
  305. this.showCanvas = !newValue
  306. },
  307. Showhiddenunits3(newValue, oldValue) {
  308. this.showCanvas = !newValue
  309. },
  310. Showhiddenunits4(newValue, oldValue) {
  311. this.showCanvas = !newValue
  312. },
  313. totalTimeShow(newValue, oldValue) {
  314. this.showCanvas = !newValue
  315. },
  316. totalTimeShow2(newValue, oldValue) {
  317. this.showCanvas = !newValue
  318. },
  319. totalTimeShow3(newValue, oldValue) {
  320. this.showCanvas = !newValue
  321. },
  322. },
  323. methods: {
  324. //是否对比
  325. checkboxChange() {
  326. if (this.newactiveTotal == 3) {
  327. uni.showToast({
  328. title: '销讲一级无对比',
  329. duration: 2000
  330. });
  331. return
  332. }
  333. if (this.newactiveTotal == 2) {
  334. if (this.Selecttuanduiobj.id == '') {
  335. uni.showToast({
  336. title: '全部团队无对比',
  337. duration: 2000
  338. });
  339. return
  340. }
  341. }
  342. if (this.timepickpickisshow == true) {
  343. this.timepickpickisshow = false;
  344. this.pamect.showStatus = 0;
  345. this.init()
  346. } else {
  347. this.timepickpickisshow = true;
  348. this.pamect.showStatus = 1;
  349. }
  350. this.activeTotal = 8;
  351. },
  352. init() {
  353. this.$u.post("/cusLvStatistics/lyAndcp", this.pamect).then(data => {
  354. this.pamect.lastStartDate = data.lastStartDate;
  355. this.pamect.lastEndDate = data.lastEndDate;
  356. this.numlist[0].num = data.startSumCustomer
  357. this.numlist[1].num = data.startFraction;
  358. this.numlist[2].num = Math.floor(data.startSumDuration/60) || 0;
  359. if (data.endSumDuration != null) {
  360. this.compareFlag = true
  361. // return
  362. this.numlist[0].num1 = data.endSumCustomer
  363. this.numlist[1].num1 = data.endFraction;
  364. this.numlist[2].num1 = Math.floor(data.endSumDuration/60) || 0;
  365. this.numlist[0].num2 = data.contrastSumCustomer
  366. this.numlist[1].num2 = data.contrastFraction;
  367. this.numlist[2].num2 = Math.floor(data.contrastSumDuration/60) || 0;
  368. } else {
  369. this.compareFlag = false
  370. }
  371. this.sheartime1 = data.lastStartDate.substring(5, 10) + "--" + data.lastEndDate.substring(5,
  372. 10);
  373. this.sheartime2 = '请选择';
  374. this.kanbanlist.duibitime = '';
  375. var kaishi = this.DateDiff(data.lastStartDate, data.lastEndDate);
  376. this.kanbanlist.kaishitime = data.lastStartDate + "至" + data.lastEndDate + "(" + kaishi + "天)";
  377. if (this.pamect.showStatus == 1) {
  378. this.sheartime2 = data.firstStartDate.substring(5, 10) + "--" + data.firstEndDate
  379. .substring(5, 10);
  380. var jeishu = this.DateDiff(data.firstStartDate, data.firstEndDate);
  381. this.kanbanlist.duibitime = data.firstStartDate + "至" + data.firstEndDate + "(" + jeishu +
  382. "天)";
  383. }
  384. this.kanbanlist.audonum = data.sumCustomer;
  385. this.kanbanlist.audotime = data.avgDuration;
  386. this.kanbanlist.avgDuration = data.fraction;
  387. this.kanbanlist.fraction = data.fraction;
  388. if (this.newactiveTotal == 0) {
  389. this.ProjectDimension()
  390. } else if (this.newactiveTotal == 1) {
  391. if (this.pamect.accountId == "") {
  392. this.getguwenlist()
  393. } else {
  394. this.ConsultantDimension()
  395. }
  396. } else if (this.newactiveTotal == 2) {
  397. if (this.pamect.deptId == "") {
  398. this.getuanduilist()
  399. } else {
  400. this.TeamCompared()
  401. }
  402. } else if (this.newactiveTotal == 3) {
  403. this.speakingLevel()
  404. } else {
  405. if (this.pamect.marketingId == '') {
  406. this.getonsyiji()
  407. } else {
  408. this.aboutEecondary()
  409. }
  410. }
  411. });
  412. },
  413. //起始时间
  414. totalTimeChange(e) {
  415. this.pamect.lastStartDate = e.startDate;
  416. this.pamect.lastEndDate = e.endDate;
  417. var kaishi = this.DateDiff(this.pamect.lastStartDate, this.pamect.lastEndDate)
  418. this.kanbanlist.kaishitime = this.pamect.lastStartDate + "至" + this.pamect.lastEndDate + "(" + kaishi +
  419. "天)";
  420. if (this.pamect.showStatus == 0) {
  421. this.init()
  422. this.totalTimeShow = false;
  423. } else {
  424. if (this.pamect.firstStartDate.length == 0) {
  425. uni.showToast({
  426. title: '请选择对比时间',
  427. duration: 2000
  428. });
  429. } else {
  430. var jshu = this.DateDiff(this.pamect.firstStartDate, this.pamect.firstEndDate)
  431. if (kaishi == jshu) {
  432. this.init()
  433. } else {
  434. uni.showToast({
  435. title: '请选择相同天数',
  436. duration: 2000
  437. });
  438. }
  439. }
  440. this.totalTimeShow = false;
  441. }
  442. },
  443. //对比时间
  444. totalTimeChange2(e) {
  445. var d = new Date(e.result);
  446. d.setDate(d.getDate() + this.intervaltime);
  447. var year = d.getFullYear();
  448. var month = d.getMonth() + 1;
  449. if (month < 10) month = '0' + month;
  450. var day = d.getDate();
  451. if (day < 10) day = '0' + day;
  452. this.pamect.firstStartDate = e.result;
  453. this.pamect.firstEndDate = year + '-' + month + '-' + day;
  454. console.log(this.pamect.firstStartDate)
  455. var kaishi = this.DateDiff(this.pamect.lastStartDate, this.pamect.lastEndDate)
  456. var jeishu = this.DateDiff(this.pamect.firstStartDate, this.pamect.firstEndDate)
  457. this.kanbanlist.duibitime = this.pamect.firstStartDate + "至" + this.pamect.firstEndDate + "(" + jeishu +
  458. "天)";
  459. console.log(this.pamect.lastStartDate, this.pamect.lastEndDate, kaishi, jeishu)
  460. if (kaishi == jeishu) {
  461. this.init()
  462. } else {
  463. uni.showToast({
  464. title: '请选择相同天数',
  465. duration: 2000
  466. });
  467. }
  468. this.totalTimeShow2 = false;
  469. },
  470. //自定义时间
  471. totalTimeChange3(e) {
  472. this.pamect.firstStartDate = "";
  473. this.pamect.firstEndDate = "";
  474. this.pamect.lastStartDate = e.startDate;
  475. this.pamect.lastEndDate = e.endDate;
  476. this.init()
  477. this.totalTimeShow3 = false;
  478. },
  479. //时间切换
  480. tabtimetap(index) {
  481. if (index == 0) {
  482. this.pamect.timeType = "4";
  483. this.pamect.firstStartDate = '';
  484. this.pamect.firstEndDate = '';
  485. this.pamect.lastStartDate = '';
  486. this.pamect.lastEndDate = '';
  487. this.init()
  488. } else if (index == 1) {
  489. this.pamect.timeType = "5";
  490. this.pamect.firstStartDate = '';
  491. this.pamect.firstEndDate = '';
  492. this.pamect.lastStartDate = '';
  493. this.pamect.lastEndDate = '';
  494. this.init()
  495. } else if (index == 2) {
  496. this.pamect.timeType = "6";
  497. this.pamect.firstStartDate = '';
  498. this.pamect.firstEndDate = '';
  499. this.pamect.lastStartDate = '';
  500. this.pamect.lastEndDate = '';
  501. this.init()
  502. } else if (index == 3) {
  503. this.pamect.timeType = "";
  504. this.totalTimeShow = true;
  505. } else if (index == 4) {
  506. this.pamect.timeType = "";
  507. var kaishi = this.DateDiff(this.pamect.lastStartDate, this.pamect.lastEndDate)
  508. console.log(kaishi)
  509. this.intervaltime = kaishi - 1;
  510. this.totalTimeShow2 = true;
  511. } else {
  512. this.pamect.timeType = "";
  513. this.totalTimeShow3 = true;
  514. }
  515. this.activeTotal = index;
  516. },
  517. //tab切换
  518. tabxuanxiangtap(index) {
  519. this.newactiveTotal = index;
  520. this.guwenshow = false;
  521. this.Selectlevel = false;
  522. this.Selecttuandui = false;
  523. this.pamect.showStatus = 0;
  524. this.pamect.timeType = "4";
  525. this.pamect.firstStartDate = '';
  526. this.pamect.firstEndDate = '';
  527. this.pamect.lastStartDate = '';
  528. this.pamect.lastEndDate = '';
  529. this.pamect.accountId = '';
  530. this.pamect.marketingId = '';
  531. this.pamect.deptId = ""
  532. this.activeTotal = 0;
  533. this.timepickpickisshow = false;
  534. this.init()
  535. if (index == 1) {
  536. this.guwenshow = true;
  537. }
  538. },
  539. //项目维度
  540. ProjectDimension() {
  541. const that = this;
  542. that.lineOptsect = {
  543. categories: [],
  544. series: []
  545. };
  546. this.linetype = "line";
  547. this.$u.post("/cusLvStatistics/teamOrOneValueShow", this.pamect).then(data => {
  548. if (this.pamect.showStatus == 0) {
  549. that.lineOptsect = {
  550. categories: [],
  551. series: [{
  552. name: '起始时间',
  553. data: [],
  554. color: '#7ED3F4'
  555. }]
  556. }
  557. data.lastValue.forEach((child, zxc) => {
  558. that.lineOptsect.categories.push(child.statDate.substring(5, 10))
  559. })
  560. that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction);
  561. } else {
  562. that.lineOptsect = {
  563. categories: [],
  564. series: [{
  565. name: '起始时间',
  566. data: [],
  567. color: '#7ED3F4'
  568. },
  569. {
  570. name: '对比时间',
  571. data: [],
  572. color: '#FF7070'
  573. },
  574. ]
  575. }
  576. data.firstValue.forEach((item, sdf) => {
  577. data.lastValue.forEach((child, zxc) => {
  578. if (sdf == zxc) {
  579. that.lineOptsect.categories.push(
  580. child.statDate.substring(5,10) + 'vs' + item.statDate.substring(5, 10)
  581. )
  582. }
  583. })
  584. })
  585. that.lineOptsect.series[1].data = data.firstValue.map(item => item.fraction);
  586. that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction)
  587. that.guwenFlag = false
  588. // // 处理表格数据
  589. let arr = [
  590. ['时间', '时段一', '时段二', '变化']
  591. // {
  592. // time:'时间',
  593. // time1:'时段一',
  594. // time2:'时段二',
  595. // compare:'变化'
  596. // },
  597. ]
  598. that.lineOptsect.categories.map((item, index) => {
  599. let newarr = [item, data.lastValue[index].fraction, data.firstValue[index].fraction,data.contrast[index].data
  600. ]
  601. // obj.time=item
  602. // obj.time1=data.firstValue[index].fraction
  603. // obj.time2=data.lastValue[index].fraction
  604. // obj.compare=data.contrast[index].data
  605. // arr.push(obj)
  606. arr.push(newarr)
  607. })
  608. // console.log(arr)
  609. that.tableDate = arr
  610. }
  611. });
  612. },
  613. //顾问维度
  614. ConsultantDimension() {
  615. const that = this;
  616. that.lineOptsect = {
  617. categories: [],
  618. series: []
  619. };
  620. this.linetype = "radar";
  621. this.$u.post("/cusLvStatistics/accFirstLevelContrast", this.pamect).then(data => {
  622. // return
  623. if (this.pamect.showStatus == 0) {
  624. that.lineOptsect = {
  625. categories: [],
  626. series: [{
  627. name: '时段一',
  628. data: [],
  629. color: '#7ED3F4'
  630. }]
  631. }
  632. data.firstList.forEach((item, sdf) => {
  633. that.lineOptsect.categories.push(item.name)
  634. that.lineOptsect.series[0].data.push(data.firstList[sdf].total)
  635. })
  636. // that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction);
  637. } else {
  638. // 当有对比的时候
  639. that.lineOptsect = {
  640. categories: [],
  641. series: [{
  642. name: '时段一',
  643. data: [],
  644. color: '#7ED3F4'
  645. },
  646. {
  647. name: '时段二',
  648. data: [],
  649. color: '#FF7070'
  650. },
  651. ]
  652. }
  653. data.headerList.forEach((item, sdf) => {
  654. that.lineOptsect.categories.push(item.name)
  655. that.lineOptsect.series[0].data.push(data.firstList[sdf].total)
  656. that.lineOptsect.series[1].data.push(data.secondList[sdf].total)
  657. })
  658. // return
  659. // // 处理表格数据
  660. that.guwenFlag = true
  661. let arr = []
  662. arr[0] = ['时间', ...that.lineOptsect.categories]
  663. arr[1] = ['变化']
  664. arr[2] = ['时段一']
  665. arr[3] = ['时段二']
  666. // console.log(arr)
  667. data.firstList.map((item, index) => {
  668. arr[2].push(item.total)
  669. arr[3].push(data.secondList[index].total)
  670. arr[1].push(data.thirdList[index].total)
  671. })
  672. that.tableDate = arr
  673. }
  674. });
  675. },
  676. // 顾问纬度选择顾问
  677. oninputtap() {
  678. this.Showhiddenunits = true;
  679. },
  680. // 顾问选择确认
  681. confirm(e) {
  682. this.lopanobj.id = e[0].value;
  683. this.lopanobj.name = e[0].label;
  684. this.pamect.accountId = this.lopanobj.id;
  685. this.ConsultantDimension()
  686. this.Showhiddenunits = false;
  687. },
  688. //获取顾问
  689. getguwenlist() {
  690. this.$u.post("/cusLvStatistics/selectAllAccountIdByHouseId", {
  691. houseId: this.pamect.houseId
  692. }).then(data => {
  693. this.selectlist = [];
  694. if (data.length == 0) {
  695. this.lineOptsect = {
  696. categories: [],
  697. series: []
  698. };
  699. this.guwenshow = false;
  700. return
  701. } else {
  702. this.guwenshow = true;
  703. data.forEach(item => {
  704. this.selectlist.push({
  705. value: item.accountId,
  706. label: item.name
  707. })
  708. })
  709. this.lopanobj.id = data[0].accountId;
  710. this.lopanobj.name = data[0].name;
  711. this.pamect.accountId = this.lopanobj.id;
  712. this.ConsultantDimension()
  713. }
  714. })
  715. },
  716. //销讲一级
  717. speakingLevel() {
  718. this.linetype = "radar";
  719. this.lineOptsect = {
  720. categories: [],
  721. series: []
  722. };
  723. this.$u.post("/cusLvStatistics/firstLevelContrast", this.pamect).then(data => {
  724. if (data.length == 0) {
  725. return
  726. } else {
  727. let list = data.map(item => {
  728. return item.name
  729. });
  730. let list1 = data.map(item => {
  731. if (item.avgExecutionRate == null) {
  732. item.avgExecutionRate = 0
  733. } else {
  734. item.avgExecutionRate = item.avgExecutionRate
  735. }
  736. return item.avgExecutionRate
  737. });
  738. this.lineOptsect = {
  739. "categories": list,
  740. "series": [{
  741. "name": "销讲一级",
  742. "data": list1
  743. }]
  744. }
  745. }
  746. })
  747. },
  748. //销讲二级
  749. aboutEecondary() {
  750. this.lineOptsect = {};
  751. this.linetype = "line";
  752. this.$u.post("/cusLvStatistics/level2Contrast", this.pamect).then(data => {
  753. if (this.pamect.showStatus == 0) {
  754. this.lineOptsect = {
  755. categories: [],
  756. series: [{
  757. name: '起始时间',
  758. data: [],
  759. color: '#7ED3F4'
  760. }]
  761. }
  762. data.lastList.forEach((item, sdf) => {
  763. this.lineOptsect.categories.push(item.statDate.substring(5, 10))
  764. })
  765. this.lineOptsect.series[0].data = data.lastList.map(item => item.avgExecutionRate);
  766. } else {
  767. this.lineOptsect = {
  768. categories: [],
  769. series: [{
  770. name: '起始时间',
  771. data: [],
  772. color: '#7ED3F4'
  773. },
  774. {
  775. name: '对比时间',
  776. data: [],
  777. color: '#FF7070'
  778. },
  779. ]
  780. }
  781. data.firstList.forEach((item, sdf) => {
  782. data.lastList.forEach((child, zxc) => {
  783. if (sdf == zxc) {
  784. this.lineOptsect.categories.push(
  785. child.statDate.substring(5,10) + 'vs' + item.statDate.substring(5, 10)
  786. )
  787. }
  788. })
  789. })
  790. this.lineOptsect.series[1].data = data.firstList.map(item => item.avgExecutionRate);
  791. this.lineOptsect.series[0].data = data.lastList.map(item => item.avgExecutionRate)
  792. let that = this
  793. this.guwenFlag = false
  794. // // 处理表格数据
  795. let arr = [
  796. ['时间', '时段一', '时段二', '变化']
  797. ]
  798. that.lineOptsect.categories.map((item, index) => {
  799. let newarr = [item, data.lastList[
  800. index].avgExecutionRate, data.firstList[index].avgExecutionRate, data.contrast[index].data]
  801. arr.push(newarr)
  802. })
  803. // console.log(arr)
  804. that.tableDate = arr
  805. }
  806. })
  807. },
  808. //销讲二级:获取一级
  809. getonsyiji() {
  810. this.$u.post("/cusLvStatistics/findAllFirstLevel", {
  811. houseId: this.pamect.houseId
  812. }).then(data => {
  813. this.selectlist2 = [];
  814. if (data.length == 0) {
  815. this.Selectlevel = false;
  816. this.lineOptsect = {
  817. categories: [],
  818. series: []
  819. };
  820. return
  821. } else {
  822. this.Selectlevel = true;
  823. data.forEach(item => {
  824. this.selectlist2.push({
  825. value: item.marketingId,
  826. label: item.name
  827. })
  828. })
  829. this.Selectlevelobj.id = data[0].marketingId;
  830. this.Selectlevelobj.name = data[0].name;
  831. this.getonserji(this.Selectlevelobj.id)
  832. }
  833. })
  834. },
  835. //销讲二级:通过一级获取二级
  836. getonserji(ccd) {
  837. this.$u.post("/cusLvStatistics/findLevel2ByFirstLevel", {
  838. houseId: this.pamect.houseId,
  839. marketingId: ccd
  840. }).then(data => {
  841. this.selectlist3 = [];
  842. data.forEach(item => {
  843. this.selectlist3.push({
  844. value: item.marketingId,
  845. label: item.name
  846. })
  847. })
  848. this.erSelectlevelobj.id = data[0].marketingId;
  849. this.erSelectlevelobj.name = data[0].name;
  850. this.pamect.marketingId = this.erSelectlevelobj.id;
  851. this.aboutEecondary()
  852. })
  853. },
  854. //销讲二级:一级选择
  855. oninputtap2() {
  856. this.Showhiddenunits2 = true;
  857. },
  858. //销讲二级:二级选择
  859. oninputtap3() {
  860. if (this.Selectlevelobj.id == "") {
  861. uni.showToast({
  862. title: '请先选择一级',
  863. duration: 2000
  864. });
  865. } else {
  866. this.Showhiddenunits3 = true;
  867. }
  868. },
  869. //销讲二级:一级选择确认
  870. confirm2(e) {
  871. this.Selectlevelobj.id = e[0].value;
  872. this.Selectlevelobj.name = e[0].label;
  873. this.getonserji(this.Selectlevelobj.id)
  874. },
  875. //销讲二级:二级选择确认
  876. confirm3(e) {
  877. this.erSelectlevelobj.id = e[0].value;
  878. this.erSelectlevelobj.name = e[0].label;
  879. this.pamect.marketingId = this.erSelectlevelobj.id;
  880. this.aboutEecondary()
  881. },
  882. //团队请选择
  883. oninputtap4() {
  884. this.Showhiddenunits4 = true;
  885. },
  886. //团队选择确认
  887. confirm4(e) {
  888. this.Selecttuanduiobj.id = e[0].value;
  889. this.Selecttuanduiobj.name = e[0].label;
  890. this.pamect.deptId = this.Selecttuanduiobj.id;
  891. this.pamect.showStatus = 0;
  892. this.pamect.timeType = "4";
  893. this.pamect.firstStartDate = '';
  894. this.pamect.firstEndDate = '';
  895. this.pamect.lastStartDate = '';
  896. this.pamect.lastEndDate = '';
  897. this.activeTotal = 0;
  898. this.timepickpickisshow = false;
  899. this.init()
  900. this.TeamCompared()
  901. },
  902. //获取团队列表
  903. getuanduilist() {
  904. this.$u.post("/cusLvStatistics/findAllDeptIdByHouseId ", {
  905. houseId: this.pamect.houseId
  906. }).then(data => {
  907. this.selectlist4 = [{
  908. value: "",
  909. label: "全部"
  910. }];
  911. if (data.length == 0) {
  912. this.Selecttuandui = false;
  913. this.lineOptsect = {
  914. categories: [],
  915. series: []
  916. };
  917. return
  918. } else {
  919. this.Selecttuandui = true;
  920. data.forEach(item => {
  921. this.selectlist4.push({
  922. value: item.deptId,
  923. label: item.deptName
  924. })
  925. })
  926. this.Selecttuanduiobj.id = "";
  927. this.Selecttuanduiobj.name = "全部";
  928. this.pamect.deptId = this.Selecttuanduiobj.id;
  929. this.TeamCompared()
  930. }
  931. })
  932. },
  933. //团队对比
  934. TeamCompared() {
  935. const that = this;
  936. that.lineOptsect = {};
  937. this.linetype = "line";
  938. this.$u.post("/cusLvStatistics/teamOrOneValueShowByDept", this.pamect).then(data => {
  939. if (this.Selecttuanduiobj.id == "") {
  940. var newlist = [];
  941. for (var i in data) {
  942. var ect = data[i].receptionStatList.map(item => {
  943. if (item.fraction == null) {
  944. item.fraction = 0
  945. } else {
  946. item.fraction = item.fraction
  947. }
  948. return item.fraction
  949. });
  950. newlist.push({
  951. name: data[i].deptName,
  952. data: ect
  953. })
  954. }
  955. var timelist = [];
  956. for (var i in data) {
  957. var ect = data[i].receptionStatList.map(item => {
  958. return item.statDate
  959. });
  960. timelist.push({
  961. name: data[i].deptName,
  962. data: ect
  963. })
  964. }
  965. var xAxisdata = [];
  966. timelist[0].data.forEach((item, sdf) => {
  967. xAxisdata.push(item.substring(5, 10))
  968. })
  969. that.lineOptsect = {
  970. categories: xAxisdata,
  971. series: newlist
  972. }
  973. } else {
  974. if (this.pamect.showStatus == 0) {
  975. that.lineOptsect = {
  976. categories: [],
  977. series: [{
  978. name: '起始时间',
  979. data: [],
  980. color: '#7ED3F4'
  981. }]
  982. }
  983. data.lastValue.receptionStatList.forEach((item, sdf) => {
  984. that.lineOptsect.categories.push(item.statDate.substring(5, 10))
  985. })
  986. that.lineOptsect.series[0].data = data.lastValue.receptionStatList.map(item => item
  987. .fraction);
  988. } else {
  989. that.lineOptsect = {
  990. categories: [],
  991. series: [{
  992. name: '起始时间',
  993. data: [],
  994. color: '#7ED3F4'
  995. },
  996. {
  997. name: '对比时间',
  998. data: [],
  999. color: '#FF7070'
  1000. },
  1001. ]
  1002. }
  1003. data.firstValue.receptionStatList.forEach((item, sdf) => {
  1004. data.lastValue.receptionStatList.forEach((child, zxc) => {
  1005. if (sdf == zxc) {
  1006. that.lineOptsect.categories.push(
  1007. child.statDate.substring(5,10) + 'vs' + item.statDate.substring(5, 10)
  1008. )
  1009. }
  1010. })
  1011. })
  1012. that.lineOptsect.series[1].data = data.firstValue.receptionStatList.map(item => item
  1013. .fraction);
  1014. that.lineOptsect.series[0].data = data.lastValue.receptionStatList.map(item => item
  1015. .fraction)
  1016. that.guwenFlag = false
  1017. // 团队处理数据
  1018. // // 处理表格数据
  1019. let arr = [
  1020. ['时间', '时段一', '时段二', '变化']
  1021. // {
  1022. // time:'时间',
  1023. // time1:'时段一',
  1024. // time2:'时段二',
  1025. // compare:'变化'
  1026. // },
  1027. ]
  1028. that.lineOptsect.categories.map((item, index) => {
  1029. let newarr = [item, data
  1030. .lastValue.receptionStatList[index].fraction, data.firstValue.receptionStatList[index].fraction,data.contrast
  1031. .receptionStatList[index].data
  1032. ]
  1033. // obj.time=item
  1034. // obj.time1=data.firstValue[index].fraction
  1035. // obj.time2=data.lastValue[index].fraction
  1036. // obj.compare=data.contrast[index].data
  1037. // arr.push(obj)
  1038. arr.push(newarr)
  1039. })
  1040. // console.log(arr)
  1041. that.tableDate = arr
  1042. }
  1043. }
  1044. });
  1045. },
  1046. //算相隔天数
  1047. DateDiff(sDate1, sDate2) {
  1048. var aDate, oDate1, oDate2, iDays;
  1049. aDate = sDate1.split("-");
  1050. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]); //转换为yyyy-MM-dd格式
  1051. aDate = sDate2.split("-");
  1052. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
  1053. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数
  1054. return iDays + 1; //返回相差天数
  1055. },
  1056. },
  1057. }
  1058. </script>
  1059. <style lang="scss" scoped>
  1060. .title2-che {
  1061. width: 178rpx;
  1062. height: 48rpx;
  1063. background: #FFFFFF;
  1064. border-radius: 6rpx;
  1065. border: 1px solid #E0E0E0;
  1066. line-height: 48rpx;
  1067. font-size: 28rpx;
  1068. font-weight: 400;
  1069. color: #666666;
  1070. text-indent: 12rpx;
  1071. margin-left: 35rpx;
  1072. position: relative;
  1073. .righttochoose {
  1074. width: 18rpx;
  1075. height: 24rpx;
  1076. position: absolute;
  1077. top: 12rpx;
  1078. right: 12rpx;
  1079. }
  1080. }
  1081. .table {
  1082. border: 0px solid darkgray;
  1083. .tr {
  1084. display: flex;
  1085. // width: 100%;
  1086. justify-content: center;
  1087. height: 64rpx;
  1088. align-items: center;
  1089. border-bottom: 1px solid #E0E0E0;
  1090. flex-wrap: nowrap;
  1091. .td {
  1092. text-align: center;
  1093. font-size: 24rpx;
  1094. font-weight: 400;
  1095. color: #333333;
  1096. height: 64rpx;
  1097. line-height: 64rpx;
  1098. // flex-shrink: 0;
  1099. }
  1100. .trd{
  1101. flex-shrink: 0;
  1102. min-width: 300rpx;
  1103. // border-bottom: 1px solid #ccc;
  1104. }
  1105. .th {
  1106. height: 64rpx;
  1107. text-align: center;
  1108. font-size: 28rpx;
  1109. font-weight: 400;
  1110. color: #666666;
  1111. line-height: 64rpx;
  1112. }
  1113. }
  1114. }
  1115. .activecllasscet2 {
  1116. color: #2671E2;
  1117. border-bottom: 2px solid #2671E2;
  1118. }
  1119. .timeduibi {
  1120. width: 100%;
  1121. background: #FFFFFF;
  1122. padding-bottom: 10rpx;
  1123. .timeshow {
  1124. color: #666666;
  1125. width: 100%;
  1126. height: 50rpx;
  1127. font-size: 28rpx;
  1128. line-height: 50rpx;
  1129. text-indent: 30rpx;
  1130. }
  1131. }
  1132. // 顶部时间切换
  1133. .timetabct {
  1134. width: 100%;
  1135. height: 98rpx;
  1136. display: flex;
  1137. align-items: center;
  1138. border-bottom: 1px solid #E0E0E0;
  1139. }
  1140. .timetabctview {
  1141. flex: 1;
  1142. height: 100%;
  1143. display: flex;
  1144. justify-content: center;
  1145. align-items: center;
  1146. }
  1147. .timetabct view {
  1148. width: 94rpx;
  1149. text-align: center;
  1150. height: 100%;
  1151. line-height: 98rpx;
  1152. font-size: 28rpx;
  1153. font-family: PingFangSC-Regular, PingFang SC;
  1154. font-weight: 400;
  1155. color: #666666;
  1156. }
  1157. .activecllasscet {
  1158. border-bottom: 2px solid #2671E2;
  1159. }
  1160. // 对比时间切换
  1161. .timepick {
  1162. width: 100%;
  1163. height: 90rpx;
  1164. display: flex;
  1165. align-items: center;
  1166. background: #FFFFFF;
  1167. }
  1168. .timepicktime {
  1169. width: 260rpx;
  1170. height: 50rpx;
  1171. border: 1rpx solid #E0E0E0;
  1172. margin-left: 30rpx;
  1173. display: flex;
  1174. background: #FFFFFF;
  1175. }
  1176. .timepicktime>view:nth-of-type(1) {
  1177. width: 210rpx;
  1178. height: 100%;
  1179. line-height: 50rpx;
  1180. font-size: 26rpx;
  1181. font-weight: 400;
  1182. text-align: center;
  1183. }
  1184. .timepicktime>view:nth-of-type(2) {
  1185. width: 49rpx;
  1186. height: 100%;
  1187. // border-left: 1px solid #E0E0E0;
  1188. }
  1189. .timepickpick {
  1190. width: 110rpx;
  1191. height: 50rpx;
  1192. margin-left: 30rpx;
  1193. display: flex;
  1194. align-items: center;
  1195. }
  1196. .Underimg {
  1197. width: 50rpx;
  1198. height: 50rpx;
  1199. margin-top: -2rpx;
  1200. }
  1201. .timeButton {
  1202. width: 100%;
  1203. height: 60rpx;
  1204. display: flex;
  1205. color: #b1b1b1;
  1206. font-size: 28rpx;
  1207. .item {
  1208. text-align: center;
  1209. line-height: 60rpx;
  1210. padding-left: 12rpx;
  1211. padding-right: 12rpx;
  1212. border-radius: 8rpx;
  1213. border: 1px solid #E0E0E0;
  1214. margin-right: 20rpx;
  1215. &.active {
  1216. color: #FFFFFF;
  1217. background-color: #2671E2;
  1218. }
  1219. }
  1220. }
  1221. .boardbox {
  1222. width: 100%;
  1223. height: 172rpx;
  1224. display: flex;
  1225. align-items: center;
  1226. background: #F4F8FD;
  1227. border-radius: 8rpx;
  1228. margin-top: 28rpx;
  1229. .boardbox-zuo {
  1230. width: 50%;
  1231. height: 120rpx;
  1232. border-right: 1px solid #E0E0E0;
  1233. }
  1234. .boardbox-you {
  1235. width: 50%;
  1236. height: 120rpx;
  1237. }
  1238. .boardbox-text1 {
  1239. width: 100%;
  1240. text-align: center;
  1241. font-size: 28rpx;
  1242. color: #333333;
  1243. }
  1244. .boardbox-text2 {
  1245. width: 100%;
  1246. text-align: center;
  1247. font-size: 26rpx;
  1248. color: #333333;
  1249. margin-top: 10rpx;
  1250. }
  1251. }
  1252. .comparesize {
  1253. flex: 1;
  1254. font-size: 24rpx;
  1255. color: #666666;
  1256. margin-top: 10rpx;
  1257. }
  1258. .grid:nth-child(1){
  1259. border-right:none ;
  1260. border-bottom:none ;
  1261. }
  1262. .grid:nth-child(3){
  1263. width: 50.5%;
  1264. }
  1265. </style>