AI营销辅助 普强使用
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

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