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.

TrendAnalysis.vue 33 KiB

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