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

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