Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

1482 rindas
41 KiB

  1. <template>
  2. <div class="box-center">
  3. <!-- 头 -->
  4. <div class="app-top">
  5. <div class="app-titel" style="margin-left: 15px">
  6. <el-select
  7. v-model="houseTypes"
  8. @change="sysChange"
  9. style="width: 100px; margin-right: 10px"
  10. placeholder="请选择"
  11. >
  12. <el-option
  13. v-for="item in options2"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value"
  17. >
  18. </el-option>
  19. </el-select>
  20. <el-select
  21. v-model="selValue"
  22. @change="selChange"
  23. style="width: 100px"
  24. placeholder="请选择"
  25. >
  26. <el-option
  27. v-for="item in options"
  28. :key="item.value"
  29. :label="item.label"
  30. :value="item.value"
  31. >
  32. </el-option>
  33. </el-select>
  34. <div style="margin-left: 26px" v-if="selValue == 1 || operaFlag">
  35. <el-select
  36. v-model="choicValue"
  37. @change="valuechange"
  38. placeholder="默认为全部"
  39. filterable
  40. clearable
  41. >
  42. <el-option
  43. v-for="item in houseList"
  44. :key="item.orgCode"
  45. :label="item.name"
  46. :value="item.orgCode"
  47. >
  48. </el-option>
  49. </el-select>
  50. </div>
  51. <div style="margin-left: 26px" v-if="selValue == 0 || operaFlag">
  52. <el-select
  53. v-model="choicValue"
  54. @change="valuechange"
  55. clearable
  56. filterable
  57. placeholder="默认为全部"
  58. >
  59. <el-option
  60. v-for="item in houseList"
  61. :key="item.id"
  62. :label="item.agentName"
  63. :value="item.id"
  64. >
  65. </el-option>
  66. </el-select>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- 二 -->
  71. <div class="app-box-er">
  72. <div class="container">
  73. <div v-if="agentissow" class="grid-content">
  74. <div class="text1">代理商数</div>
  75. <div class="text2">{{ firstTab.agentQuantity || 0 }}</div>
  76. </div>
  77. <div v-if="agentissow" class="grid-content">
  78. <div class="text1">服务期内代理商数</div>
  79. <div class="text2">{{ firstTab.agentQofEnough || 0 }}</div>
  80. </div>
  81. <div v-if="agentissow" class="grid-content">
  82. <div class="text1">过期代理商数</div>
  83. <div class="text2">
  84. {{ firstTab.agentQofUnenough || 0 }}
  85. </div>
  86. </div>
  87. <div class="grid-content">
  88. <div class="text1">楼盘总数</div>
  89. <div class="text2">{{ firstTab.houseQuantity || 0 }}</div>
  90. </div>
  91. <div class="grid-content">
  92. <div class="text1">服务期内楼盘总数</div>
  93. <div class="text2">{{ firstTab.houseQofEnough || 0 }}</div>
  94. </div>
  95. <div class="grid-content">
  96. <div class="text1">试用楼盘数</div>
  97. <div class="text2">{{ firstTab.houseQuantityOfTryOut || 0 }}</div>
  98. </div>
  99. <div class="grid-content">
  100. <div class="text1">过期楼盘数</div>
  101. <div class="text2">{{ firstTab.houseQofUnenough || 0 }}</div>
  102. </div>
  103. <div class="grid-content">
  104. <div class="text1">设备总数</div>
  105. <div class="text2">{{ firstTab.equipmentQuantity || 0 }}</div>
  106. </div>
  107. <div class="grid-content">
  108. <div class="text1">已售设备数</div>
  109. <div class="text2">{{ firstTab.equipmentQuantityWithSold || 0 }}</div>
  110. </div>
  111. <div class="grid-content">
  112. <div class="text1">待售设备数</div>
  113. <div class="text2">
  114. {{ firstTab.equipmentQuantityWithNotSold || 0 }}
  115. </div>
  116. </div>
  117. <!-- <div class="grid-content">
  118. <div class="text1">待验收设备数</div>
  119. <div class="text2">
  120. {{ firstTab.equipmentQuantityWithNotAccept || 0 }}
  121. </div>
  122. </div>
  123. <div class="grid-content">
  124. <div class="text1">已报废设备数</div>
  125. <div class="text2">{{ firstTab.damageEquipmentQuantity || 0 }}</div>
  126. </div>
  127. <div class="grid-content">
  128. <div class="text1">正常设备数</div>
  129. <div class="text2">{{ firstTab.normalequipmentQuantity || 0 }}</div>
  130. </div> -->
  131. <div class="grid-content">
  132. <div class="text1">用户数</div>
  133. <div class="text2">{{ firstTab.userQuantity || 0 }}</div>
  134. </div>
  135. <div class="grid-content">
  136. <div class="text1">顾问数</div>
  137. <div class="text2">{{ firstTab.accountQuantity || 0 }}</div>
  138. </div>
  139. <div class="grid-content">
  140. <div class="text1">接待量</div>
  141. <div class="text2">{{ firstTab.receptionQuantity || 0 }}</div>
  142. </div>
  143. <div class="grid-content">
  144. <div class="text1">接待客户</div>
  145. <div class="text2">
  146. {{ firstTab.customerQuantity || 0 }}
  147. </div>
  148. </div>
  149. <div class="grid-content">
  150. <div class="text1">接待时长(小时)</div>
  151. <div class="text2">
  152. {{ Math.floor(firstTab.receptionTime / 60) || 0 }}
  153. </div>
  154. </div>
  155. <div class="grid-content">
  156. <div class="text1">平均接待时长(分钟)</div>
  157. <div class="text2">{{ firstTab.receptionTimeWithAvg || 0 }}</div>
  158. </div>
  159. </div>
  160. <!-- <div id="main"></div> -->
  161. </div>
  162. <div class="app-box-er">
  163. <div class="app_titile" style="margin-bottom: 10px">
  164. <div style="line-height: 40px; font-weight: bold">时段统计</div>
  165. <div>
  166. <div class="app-titel">
  167. <div class="toptimeqhuan">
  168. <div :class="{ tophove: dateType1 == 1 }" @click="tabtimetap1(1)">
  169. 近7天
  170. </div>
  171. <div :class="{ tophove: dateType1 == 3 }" @click="tabtimetap1(3)">
  172. 近15天
  173. </div>
  174. <div :class="{ tophove: dateType1 == 2 }" @click="tabtimetap1(2)">
  175. 近30天
  176. </div>
  177. </div>
  178. <div style="margin-left: 26px">
  179. <el-date-picker
  180. @change="confirmtime1()"
  181. v-model="customtime1"
  182. type="daterange"
  183. range-separator="-"
  184. :default-time="['00:00:00', '23:59:59']"
  185. value-format="yyyy-MM-dd"
  186. start-placeholder="开始日期"
  187. end-placeholder="结束日期"
  188. :picker-options="pickerOptions"
  189. >
  190. </el-date-picker>
  191. </div>
  192. <el-select
  193. v-model="echarValue1"
  194. style="width: 100px; margin-left: 10px"
  195. placeholder="请选择"
  196. >
  197. <el-option
  198. v-for="item in options1"
  199. :key="item.value"
  200. :label="item.label"
  201. :value="item.value"
  202. >
  203. </el-option>
  204. </el-select>
  205. </div>
  206. </div>
  207. </div>
  208. <div class="container" v-if="echarValue1 == 0">
  209. <div
  210. class="grid-content"
  211. style="cursor: pointer"
  212. @click="secondChange('1')"
  213. >
  214. <div class="text1" :class="{ tophovese: secindex == 1 }">接待量</div>
  215. <div class="text2" :class="{ tophovese: secindex == 1 }">
  216. {{ secondTab.receptionQuantityInToday || 0 }}
  217. </div>
  218. </div>
  219. <div
  220. class="grid-content"
  221. style="cursor: pointer"
  222. @click="secondChange('2')"
  223. >
  224. <div class="text1" :class="{ tophovese: secindex == 2 }">
  225. 活跃用户
  226. </div>
  227. <div class="text2" :class="{ tophovese: secindex == 2 }">
  228. {{ secondTab.activeUserQuantity || 0 }}
  229. </div>
  230. </div>
  231. <div
  232. class="grid-content"
  233. style="cursor: pointer"
  234. @click="secondChange('3')"
  235. >
  236. <div class="text1" :class="{ tophovese: secindex == 3 }">
  237. 活跃设备
  238. </div>
  239. <div class="text2" :class="{ tophovese: secindex == 3 }">
  240. {{ secondTab.activeEquipmentQuantity || 0 }}
  241. </div>
  242. </div>
  243. </div>
  244. <div v-if="echarValue1 == 0" id="main"></div>
  245. <div v-if="echarValue1 == 1">
  246. <el-table :data="echarList1" stripe style="width: 100%">
  247. <!-- <el-table-column type="index" label="序号" width="50">
  248. </el-table-column> -->
  249. <el-table-column prop="time" label="时间" align="center">
  250. </el-table-column>
  251. <el-table-column
  252. prop="receptionQuantityInToday"
  253. label="接待量"
  254. align="center"
  255. >
  256. </el-table-column>
  257. <el-table-column
  258. prop="activeUserQuantity"
  259. label="活跃用户"
  260. align="center"
  261. >
  262. </el-table-column>
  263. <el-table-column
  264. prop="activeEquipmentQuantity"
  265. label="活跃设备"
  266. align="center"
  267. >
  268. </el-table-column>
  269. <!-- scope -->
  270. <el-table-column label="操作" align="center">
  271. <template slot-scope="{ row }">
  272. <el-button type="text" @click="goDetail(row)">查看详情</el-button>
  273. </template>
  274. </el-table-column>
  275. </el-table>
  276. </div>
  277. </div>
  278. <div class="app-box-er">
  279. <div class="app_titile" style="margin-bottom: 10px">
  280. <div style="line-height: 30px; font-weight: bold">整体看板</div>
  281. <div>
  282. <div class="app-titel">
  283. <div class="toptimeqhuan">
  284. <div :class="{ tophove: dateType == 4 }" @click="tabtimetap(4)">
  285. 近7天
  286. </div>
  287. <div :class="{ tophove: dateType == 5 }" @click="tabtimetap(5)">
  288. 近15天
  289. </div>
  290. <div :class="{ tophove: dateType == 6 }" @click="tabtimetap(6)">
  291. 近30天
  292. </div>
  293. </div>
  294. <div style="margin-left: 26px">
  295. <el-date-picker
  296. @change="confirmtime()"
  297. v-model="customtime"
  298. type="daterange"
  299. range-separator="-"
  300. :default-time="['00:00:00', '23:59:59']"
  301. value-format="yyyy-MM-dd"
  302. start-placeholder="开始日期"
  303. end-placeholder="结束日期"
  304. :picker-options="pickerOptions"
  305. >
  306. </el-date-picker>
  307. </div>
  308. <el-select
  309. v-model="echarValue"
  310. style="width: 100px; margin-left: 10px"
  311. placeholder="请选择"
  312. @change="echarChange"
  313. >
  314. <el-option
  315. v-for="item in options1"
  316. :key="item.value"
  317. :label="item.label"
  318. :value="item.value"
  319. >
  320. </el-option>
  321. </el-select>
  322. </div>
  323. </div>
  324. </div>
  325. <div class="container" v-if="echarValue == 0">
  326. <div
  327. class="grid-content"
  328. style="cursor: pointer"
  329. @click="Overviewxlick('1')"
  330. >
  331. <div class="text1" :class="{ tophovese: cardindex == 1 }">
  332. 购买服务楼盘数
  333. </div>
  334. <div
  335. class="text2"
  336. style="cursor: pointer"
  337. :class="{ tophovese: cardindex == 1 }"
  338. >
  339. {{ thirdTab.houseQuantity || 0 }}
  340. </div>
  341. </div>
  342. <!-- <div class="grid-content" style="cursor: pointer;" @click="Overviewxlick('2')">
  343. <div class="text1" :class="{ tophovese: cardindex == 2 }">
  344. 服务期内楼盘数
  345. </div>
  346. <div class="text2" :class="{ tophovese: cardindex == 2 }">
  347. {{ thirdTab.houseQofEnough || 0 }}
  348. </div>
  349. </div> -->
  350. <!-- <div class="grid-content" @click="Overviewxlick('3')">
  351. <div class="text1" :class="{ tophovese: cardindex == 3 }">
  352. 销售设备数
  353. </div>
  354. <div class="text2" :class="{ tophovese: cardindex == 3 }">
  355. {{ thirdTab.avgDuration || 0 }}
  356. </div>
  357. </div> -->
  358. <div
  359. class="grid-content"
  360. style="cursor: pointer"
  361. @click="Overviewxlick('4')"
  362. >
  363. <div class="text1" :class="{ tophovese: cardindex == 4 }">
  364. 活跃用户数
  365. </div>
  366. <div class="text2" :class="{ tophovese: cardindex == 4 }">
  367. {{ thirdTab.activeUserQuantity || 0 }}
  368. </div>
  369. </div>
  370. <div
  371. class="grid-content"
  372. style="cursor: pointer"
  373. @click="Overviewxlick('5')"
  374. >
  375. <div class="text1" :class="{ tophovese: cardindex == 5 }">
  376. 新增用户数
  377. </div>
  378. <div class="text2" :class="{ tophovese: cardindex == 5 }">
  379. {{ thirdTab.userCountWithNewJoin || 0 }}
  380. </div>
  381. </div>
  382. <div
  383. class="grid-content"
  384. style="cursor: pointer"
  385. @click="Overviewxlick('6')"
  386. >
  387. <div class="text1" :class="{ tophovese: cardindex == 6 }">接待量</div>
  388. <div class="text2" :class="{ tophovese: cardindex == 6 }">
  389. {{ thirdTab.receptionQuantity || 0 }}
  390. </div>
  391. </div>
  392. <div
  393. class="grid-content"
  394. style="cursor: pointer"
  395. @click="Overviewxlick('7')"
  396. >
  397. <div class="text1" :class="{ tophovese: cardindex == 7 }">
  398. 平均接待时长
  399. </div>
  400. <div class="text2" :class="{ tophovese: cardindex == 7 }">
  401. {{ thirdTab.receptionTimeWithAvg || 0 }}
  402. </div>
  403. </div>
  404. <div
  405. class="grid-content"
  406. style="cursor: pointer"
  407. @click="Overviewxlick('8')"
  408. >
  409. <div class="text1" :class="{ tophovese: cardindex == 8 }">
  410. 活跃设备数
  411. </div>
  412. <div class="text2" :class="{ tophovese: cardindex == 8 }">
  413. {{ thirdTab.activeEquipmentQuantity || 0 }}
  414. </div>
  415. </div>
  416. <div
  417. class="grid-content"
  418. style="cursor: pointer"
  419. @click="Overviewxlick('9')"
  420. >
  421. <div class="text1" :class="{ tophovese: cardindex == 9 }">
  422. 销售设备数
  423. </div>
  424. <div class="text2" :class="{ tophovese: cardindex == 9 }">
  425. {{ thirdTab.buyEquipQuantity || 0 }}
  426. </div>
  427. </div>
  428. </div>
  429. <div v-if="echarValue == 0" id="echar2"></div>
  430. <div v-if="echarValue == 1">
  431. <el-table :data="echarList" stripe style="width: 100%">
  432. <!-- <el-table-column type="index" label="序号" width="50">
  433. </el-table-column> -->
  434. <el-table-column prop="date" label="日期" align="center">
  435. </el-table-column>
  436. <el-table-column
  437. prop="buyHouseQuantity"
  438. label="购买服务楼盘数"
  439. align="center"
  440. >
  441. <template slot-scope="{ row }">
  442. <span
  443. @click="goDetail1(row, '购买服务楼盘数', 0)"
  444. style="cursor: pointer"
  445. >{{ row.buyHouseQuantity || 0 }}</span
  446. >
  447. </template>
  448. </el-table-column>
  449. <el-table-column
  450. prop="activeUserQuantity"
  451. label="活跃用户数"
  452. align="center"
  453. >
  454. <template slot-scope="{ row }">
  455. <span
  456. @click="goDetail1(row, '活跃用户数', 1)"
  457. style="cursor: pointer"
  458. >{{ row.activeUserQuantity }}</span
  459. >
  460. </template>
  461. </el-table-column>
  462. <el-table-column
  463. prop="newJoinUserQuantity"
  464. label="新增用户数"
  465. align="center"
  466. >
  467. <template slot-scope="{ row }">
  468. <span
  469. @click="goDetail1(row, '新增用户数', 2)"
  470. style="cursor: pointer"
  471. >{{ row.newJoinUserQuantity || 0 }}</span
  472. >
  473. </template>
  474. </el-table-column>
  475. <el-table-column
  476. prop="receptionQuantity"
  477. label="接待量"
  478. align="center"
  479. >
  480. <template slot-scope="{ row }">
  481. <span
  482. @click="goDetail1(row, '接待量', 3)"
  483. style="cursor: pointer"
  484. >{{ row.receptionQuantity || 0 }}</span
  485. >
  486. </template>
  487. </el-table-column>
  488. <el-table-column
  489. prop="avgReceptionTime"
  490. label="平均接待时长"
  491. align="center"
  492. >
  493. <template slot-scope="{ row }">
  494. <span
  495. @click="goDetail1(row, '平均接待时长', 4)"
  496. style="cursor: pointer"
  497. >{{ row.avgReceptionTime || 0 }}</span
  498. >
  499. </template>
  500. </el-table-column>
  501. <el-table-column
  502. prop="activeEquipmentQuantity"
  503. label="活跃设备数"
  504. align="center"
  505. >
  506. <template slot-scope="{ row }">
  507. <span
  508. @click="goDetail1(row, '活跃设备数', 5)"
  509. style="cursor: pointer"
  510. >{{ row.activeEquipmentQuantity || 0 }}</span
  511. >
  512. </template>
  513. </el-table-column>
  514. <el-table-column
  515. prop="buyEquipQuantity"
  516. label="销售设备数"
  517. align="center"
  518. >
  519. <template slot-scope="{ row }">
  520. <span
  521. @click="goDetail1(row, '销售设备数', 6)"
  522. style="cursor: pointer"
  523. >{{ row.buyEquipQuantity || 0 }}</span
  524. >
  525. </template>
  526. </el-table-column>
  527. </el-table>
  528. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  529. <el-pagination
  530. @size-change="handleSizeChange1"
  531. @current-change="handleCurrentChange1"
  532. :current-page="currentPage1"
  533. :page-sizes="[10, 30, 50]"
  534. :page-size="size1"
  535. layout="total, sizes, prev, pager, next, jumper"
  536. :total="total1"
  537. >
  538. </el-pagination>
  539. </div>
  540. </div>
  541. </div>
  542. <el-dialog :title="elTitle" :visible.sync="dialogVisible">
  543. <div class="cen-tab">
  544. <div style="font-size: 20px">{{ timeStr }}</div>
  545. <el-table :data="detailList" stripe style="width: 100%">
  546. <el-table-column
  547. v-if="visible1"
  548. prop="houseName"
  549. label="楼盘"
  550. align="center"
  551. >
  552. </el-table-column>
  553. <el-table-column
  554. v-if="visible1"
  555. prop="receptionQuantity"
  556. label="接待量"
  557. align="center"
  558. >
  559. </el-table-column>
  560. <el-table-column
  561. v-if="visible5"
  562. prop="imei"
  563. label="设备编号"
  564. align="center"
  565. >
  566. </el-table-column>
  567. <el-table-column
  568. v-if="visible5"
  569. prop="agentName"
  570. label="代理商"
  571. align="center"
  572. >
  573. </el-table-column>
  574. <el-table-column
  575. v-if="visible5"
  576. prop="houseName"
  577. label="公司"
  578. align="center"
  579. >
  580. </el-table-column>
  581. <el-table-column
  582. v-if="visible5"
  583. prop="orgName"
  584. label="楼盘"
  585. align="center"
  586. >
  587. </el-table-column>
  588. </el-table>
  589. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  590. <el-pagination
  591. @size-change="handleSizeChange"
  592. @current-change="handleCurrentChange"
  593. :current-page="currentPage"
  594. :page-sizes="[10, 30, 50]"
  595. :page-size="size"
  596. layout="total, sizes, prev, pager, next, jumper"
  597. :total="total"
  598. >
  599. </el-pagination>
  600. </div>
  601. </div>
  602. </el-dialog>
  603. </div>
  604. </template>
  605. <script>
  606. import * as echarts from "echarts";
  607. import { getStore, setStore } from "@/util/store";
  608. export default {
  609. data() {
  610. return {
  611. pickerOptions: {
  612. disabledDate(time) {
  613. //根据当前日期 --- 禁止选中之后的日期
  614. // return time.getTime() > Date.now();
  615. },
  616. },
  617. firstTab: {},
  618. secondTab: {},
  619. thirdTab: {},
  620. selValue: "0",
  621. houseTypes: "0,1",
  622. operaFlag: true,
  623. echarValue: "0",
  624. echarValue1: "0",
  625. choicValue: "",
  626. detailList: [],
  627. houseList: [],
  628. secindex: "1",
  629. dateType: 4,
  630. currentPage: 1,
  631. size: 10,
  632. total: 10,
  633. currentPage1: 1,
  634. size1: 10,
  635. total1: 10,
  636. customtime: [],
  637. cardindex: "1",
  638. options: [
  639. {
  640. label: "代理商",
  641. value: "0",
  642. },
  643. {
  644. label: "公司",
  645. value: "1",
  646. },
  647. ],
  648. options1: [
  649. {
  650. label: "趋势图",
  651. value: "0",
  652. },
  653. {
  654. label: "表格",
  655. value: "1",
  656. },
  657. ],
  658. options2: [
  659. {
  660. label: "正式数据",
  661. value: "0,1",
  662. },
  663. {
  664. label: "测试数据",
  665. value: "2,3",
  666. },
  667. ],
  668. agentissow: true,
  669. dateType1: 1,
  670. customtime1: [],
  671. echarList1: [],
  672. echarList: [],
  673. dialogVisible: false,
  674. dialogVisible1: false,
  675. visible1: false,
  676. visible2: false,
  677. visible3: false,
  678. visible4: false,
  679. visible5: false,
  680. info: {},
  681. elTitle: "",
  682. timeStr: "",
  683. };
  684. },
  685. mounted() {
  686. // 获取用户信息
  687. this.info = getStore({ name: "userInfo" });
  688. // 当他系统后台时
  689. if (localStorage.getItem("orgType") == 0 && this.info.userRoleType == 1) {
  690. console.log("有全部");
  691. this.options.push({
  692. label: "全部",
  693. value: "3",
  694. });
  695. this.selValue = "3";
  696. this.agentissow = true;
  697. this.operaFlag = false;
  698. } else {
  699. this.operaFlag = true;
  700. }
  701. this.getList();
  702. // this.tabtimetap(4);
  703. },
  704. methods: {
  705. goDetail1(row, str, idx) {
  706. console.log(row);
  707. this.dialogVisible = true;
  708. this.timeStr = "";
  709. this.elTitle = str;
  710. this.detailList = [];
  711. if (idx == 0) {
  712. } else if (idx == 1) {
  713. // this.visible1 = true;
  714. // this.visible2 = false;
  715. // this.visible3 = false;
  716. // this.visible4 = false;
  717. // this.visible5 = false;
  718. } else if (idx == 2) {
  719. } else if (idx == 3) {
  720. } else if (idx == 4) {
  721. } else if (idx == 5) {
  722. } else if (idx == 6) {
  723. this.visible1 = false;
  724. this.visible2 = false;
  725. this.visible3 = false;
  726. this.visible4 = false;
  727. this.visible5 = true;
  728. this.buyEquipmentQuantity(row.date);
  729. }
  730. },
  731. buyEquipmentQuantity(date) {
  732. this.$api.api
  733. .buyEquipmentQuantity({
  734. agentId: this.selValue == 0 ? this.choicValue : null,
  735. orgCode: this.selValue == 1 ? this.choicValue : null,
  736. orgType: localStorage.getItem("orgType"),
  737. startDate: date,
  738. endDate: date,
  739. dateType: null,
  740. houseTypes: this.houseTypes,
  741. current: this.currentPage,
  742. size: this.size,
  743. })
  744. .then((res) => {
  745. // console.log(res);
  746. this.detailList = res.data.records;
  747. this.total = res.data.total;
  748. });
  749. },
  750. echarChange(e) {
  751. if (e == 0) {
  752. this.dataOverviewWithSystemWithLook();
  753. } else {
  754. //获取表格数据
  755. this.dataOverviewWithSystemWithLookWithTable();
  756. }
  757. },
  758. dataOverviewWithSystemWithLookWithTable() {
  759. this.$api.api
  760. .dataOverviewWithSystemWithLookWithTable({
  761. agentId: this.selValue == 0 ? this.choicValue : null,
  762. orgCode: this.selValue == 1 ? this.choicValue : null,
  763. orgType: localStorage.getItem("orgType"),
  764. startDate: this.dateType1 ? "" : this.customtime1[0],
  765. endDate: this.dateType1 ? "" : this.customtime1[1],
  766. dateType: this.dateType1,
  767. houseTypes: this.houseTypes,
  768. current: this.currentPage1,
  769. size: this.size1,
  770. // hour
  771. })
  772. .then((res) => {
  773. // console.log(res);
  774. this.echarList = res.data.records;
  775. this.total1 = res.data.total;
  776. });
  777. },
  778. handleSizeChange(val) {
  779. console.log(`每页 ${val} 条`);
  780. this.size = val;
  781. // this.correctFindbypage();
  782. },
  783. handleCurrentChange(val) {
  784. console.log(`当前页: ${val}`);
  785. this.currentPage = val;
  786. // this.correctFindbypage();
  787. },
  788. handleSizeChange1(val) {
  789. console.log(`每页 ${val} 条`);
  790. this.size1 = val;
  791. // this.correctFindbypage();
  792. },
  793. handleCurrentChange1(val) {
  794. console.log(`当前页: ${val}`);
  795. this.currentPage1 = val;
  796. // this.correctFindbypage();
  797. },
  798. goDetail(row) {
  799. this.dialogVisible = true;
  800. this.timeStr = row.time;
  801. this.elTitle = "楼盘实时统计";
  802. this.realTimeStatisticsOfTime(row.hour);
  803. this.visible1 = true;
  804. this.visible2 = false;
  805. this.visible3 = false;
  806. this.visible4 = false;
  807. },
  808. realTimeStatisticsOfTime(hour) {
  809. this.$api.api
  810. .realTimeStatisticsOfTime({
  811. agentId: this.selValue == 0 ? this.choicValue : null,
  812. orgCode: this.selValue == 1 ? this.choicValue : null,
  813. orgType: localStorage.getItem("orgType"),
  814. startDate: this.dateType1 ? "" : this.customtime1[0],
  815. endDate: this.dateType1 ? "" : this.customtime1[1],
  816. dateType: this.dateType1,
  817. houseTypes: this.houseTypes,
  818. current: this.currentPage,
  819. size: this.size,
  820. hour,
  821. })
  822. .then((res) => {
  823. console.log(res);
  824. this.detailList = res.data.records;
  825. this.total = res.data.total;
  826. });
  827. },
  828. valuechange() {
  829. this.dateType = 4;
  830. this.cardindex = 1;
  831. this.secindex = 1;
  832. if (this.choicValue == "") {
  833. }
  834. if (this.selValue == 1) {
  835. this.agentissow = false;
  836. } else {
  837. if (this.choicValue == "") {
  838. this.agentissow = true;
  839. } else {
  840. this.agentissow = false;
  841. }
  842. }
  843. this.dataOverViewWithSystem();
  844. this.dataOverviewWithSystemWithDay();
  845. this.dataOverviewWithSystemWithLook();
  846. },
  847. // 当选择的代理商或者楼盘切换时
  848. selChange(e) {
  849. if (e == 3) {
  850. this.operaFlag = false;
  851. this.agentissow = true;
  852. return;
  853. }
  854. this.choicValue = "";
  855. this.dateType = 4;
  856. this.cardindex = 1;
  857. this.secindex = 1;
  858. this.getList();
  859. if (this.selValue == 1) {
  860. this.agentissow = false;
  861. } else {
  862. if (this.choicValue == "") {
  863. this.agentissow = true;
  864. } else {
  865. this.agentissow = false;
  866. }
  867. }
  868. },
  869. sysChange() {
  870. this.dataOverViewWithSystem();
  871. this.dataOverviewWithSystemWithDay();
  872. this.dataOverviewWithSystemWithLook();
  873. },
  874. // 获取下拉框数据
  875. getList() {
  876. console.log(this.selValue);
  877. // 当为楼盘选择时
  878. if (this.selValue == 1) {
  879. this.$api.api
  880. .findMyOrg({
  881. orgType: localStorage.getItem("orgType"),
  882. })
  883. .then((res) => {
  884. this.houseList = res.data;
  885. this.dataOverViewWithSystem();
  886. this.dataOverviewWithSystemWithDay();
  887. this.dataOverviewWithSystemWithLook();
  888. });
  889. } else if (this.selValue == 2) {
  890. this.$api.api
  891. .findMyAgent({
  892. orgType: localStorage.getItem("orgType"),
  893. })
  894. .then((res) => {
  895. this.houseList = res.data;
  896. this.dataOverViewWithSystem();
  897. this.dataOverviewWithSystemWithDay();
  898. this.dataOverviewWithSystemWithLook();
  899. });
  900. } else {
  901. this.dataOverViewWithSystem();
  902. this.dataOverviewWithSystemWithDay();
  903. this.dataOverviewWithSystemWithLook();
  904. }
  905. },
  906. dataOverviewWithSystemWithDay() {
  907. this.$api.api
  908. .dataOverviewWithSystemWithDay({
  909. agentId: this.selValue == 0 ? this.choicValue : null,
  910. orgCode: this.selValue == 1 ? this.choicValue : null,
  911. orgType: localStorage.getItem("orgType"),
  912. startDate: this.dateType1 ? "" : this.customtime1[0],
  913. endDate: this.dateType1 ? "" : this.customtime1[1],
  914. dateType: this.dateType1,
  915. houseTypes: this.houseTypes,
  916. })
  917. .then((res) => {
  918. this.secondTab = res.data;
  919. // 调用方法
  920. // 处理数据
  921. let arr = [];
  922. res.data.todayActiveUserList.map((item, index) => {
  923. let obj = {};
  924. if (index == 23) {
  925. obj.time =
  926. item.time.substring(11, 16) +
  927. "-" +
  928. res.data.todayActiveUserList[0].time.substring(11, 16);
  929. // return
  930. } else {
  931. // console.log(item.time,res.data.todayActiveUserList[index/1+1].time);
  932. obj.time =
  933. item.time.substring(11, 16) +
  934. "-" +
  935. res.data.todayActiveUserList[index / 1 + 1].time.substring(
  936. 11,
  937. 16
  938. );
  939. }
  940. obj.hour = index;
  941. // 接待量
  942. obj.receptionQuantityInToday =
  943. res.data.todayReceptionList[index].data;
  944. // 活跃用户
  945. obj.activeUserQuantity = res.data.todayActiveUserList[index].data;
  946. // 活跃设备
  947. obj.activeEquipmentQuantity =
  948. res.data.todayActiveEquipmentList[index].data;
  949. arr.push(obj);
  950. });
  951. // console.log(arr);
  952. this.echarList1 = arr;
  953. this.getChars1(1);
  954. });
  955. },
  956. // 整体看板
  957. dataOverviewWithSystemWithLook() {
  958. this.$api.api
  959. .dataOverviewWithSystemWithLook({
  960. startDate: this.dateType ? "" : this.customtime[0],
  961. endDate: this.dateType ? "" : this.customtime[1],
  962. dateType: this.dateType,
  963. agentId: this.selValue == 0 ? this.choicValue : null,
  964. orgCode: this.selValue == 1 ? this.choicValue : null,
  965. houseTypes: this.houseTypes,
  966. orgType: localStorage.getItem("orgType"),
  967. })
  968. .then((res) => {
  969. // console.log(res);
  970. this.thirdTab = res.data;
  971. this.getChars2(this.cardindex);
  972. });
  973. },
  974. // echars生成
  975. getChars1(idx) {
  976. // console.log(idx);
  977. let Strname = ["时段一", "时段二"];
  978. let timeDate = [];
  979. // 判断是第几个然后对数据进行渲染
  980. // 先处理时间
  981. let arr1 = [];
  982. let arr2 = [];
  983. // console.log(timeDate);
  984. if (idx == 1) {
  985. // 接待量
  986. this.secondTab.todayReceptionList.map((item) => {
  987. timeDate.push(item.time.substring(11, 16));
  988. arr1.push(item.data);
  989. });
  990. this.secondTab.yesterdayReceptionList.map((item) => {
  991. arr2.push(item.data);
  992. });
  993. }
  994. if (idx == 2) {
  995. // 活跃用户
  996. this.secondTab.todayActiveUserList.map((item) => {
  997. timeDate.push(item.time.substring(11, 16));
  998. arr1.push(item.data);
  999. });
  1000. this.secondTab.yesterdayActiveUserList.map((item) => {
  1001. arr2.push(item.data);
  1002. });
  1003. }
  1004. if (idx == 3) {
  1005. // 活跃设备
  1006. this.secondTab.todayActiveEquipmentList.map((item) => {
  1007. timeDate.push(item.time.substring(11, 16));
  1008. arr1.push(item.data);
  1009. });
  1010. this.secondTab.yesterdayActiveEquipmentList.map((item) => {
  1011. arr2.push(item.data);
  1012. });
  1013. }
  1014. let arr = [
  1015. {
  1016. name: Strname[0],
  1017. data: arr1,
  1018. type: "line",
  1019. smooth: true,
  1020. },
  1021. {
  1022. name: Strname[1],
  1023. data: arr2,
  1024. type: "line",
  1025. smooth: true,
  1026. },
  1027. ];
  1028. // console.log(arr1,arr2);
  1029. this.SwitchCARDS(arr, "main", timeDate, Strname);
  1030. },
  1031. getChars2(idx) {
  1032. // console.log(idx);
  1033. let Strname = [];
  1034. let timeDate = [];
  1035. let arr1 = [];
  1036. // 判断是第几个然后对数据进行渲染
  1037. // 先处理时间
  1038. // console.log(timeDate);
  1039. if (idx == 1) {
  1040. Strname = ["购买服务楼盘数"];
  1041. this.thirdTab.buyHouseList.map((item) => {
  1042. timeDate.push(item.time.substring(5, 10));
  1043. arr1.push(item.data);
  1044. });
  1045. } else if (idx == 2) {
  1046. Strname = ["服务期内楼盘数"];
  1047. this.thirdTab.houseQofEnoughList.map((item) => {
  1048. timeDate.push(item.time.substring(5, 10));
  1049. arr1.push(item.data);
  1050. });
  1051. } else if (idx == 4) {
  1052. Strname = ["活跃用户数"];
  1053. this.thirdTab.activeUserList.map((item) => {
  1054. timeDate.push(item.time.substring(5, 10));
  1055. arr1.push(item.data);
  1056. });
  1057. } else if (idx == 5) {
  1058. Strname = ["新增用户数"];
  1059. this.thirdTab.newJoinUserList.map((item) => {
  1060. timeDate.push(item.time.substring(5, 10));
  1061. arr1.push(item.data);
  1062. });
  1063. } else if (idx == 6) {
  1064. Strname = ["接待量"];
  1065. this.thirdTab.receptionList.map((item) => {
  1066. timeDate.push(item.time.substring(5, 10));
  1067. arr1.push(item.data);
  1068. });
  1069. } else if (idx == 7) {
  1070. Strname = ["平均接待时长"];
  1071. this.thirdTab.avgReceptionList.map((item) => {
  1072. timeDate.push(item.time.substring(5, 10));
  1073. arr1.push(item.data);
  1074. });
  1075. } else if (idx == 8) {
  1076. Strname = ["活跃设备数"];
  1077. this.thirdTab.activeEquipmentList.map((item) => {
  1078. timeDate.push(item.time.substring(5, 10));
  1079. arr1.push(item.data);
  1080. });
  1081. } else if (idx == 9) {
  1082. Strname = ["销售设备数"];
  1083. this.thirdTab.buyEquipQuantityList.map((item) => {
  1084. timeDate.push(item.time.substring(5, 10));
  1085. arr1.push(item.data);
  1086. });
  1087. }
  1088. let arr = [
  1089. {
  1090. name: Strname[0],
  1091. data: arr1,
  1092. type: "line",
  1093. smooth: true,
  1094. },
  1095. ];
  1096. this.SwitchCARDS(arr, "echar2", timeDate, Strname);
  1097. },
  1098. // 获取总览数据
  1099. dataOverViewWithSystem() {
  1100. this.$api.api
  1101. .dataOverViewWithSystem({
  1102. agentId: this.selValue == 0 ? this.choicValue : null,
  1103. orgCode: this.selValue == 1 ? this.choicValue : null,
  1104. orgType: localStorage.getItem("orgType"),
  1105. houseTypes: this.houseTypes,
  1106. })
  1107. .then((res) => {
  1108. this.firstTab = res.data;
  1109. });
  1110. },
  1111. Overviewxlick(i) {
  1112. this.cardindex = i;
  1113. this.getChars2(i);
  1114. },
  1115. secondChange(i) {
  1116. this.secindex = i;
  1117. this.getChars1(i);
  1118. },
  1119. confirmtime1(e) {
  1120. this.dateType1 = null;
  1121. this.dataOverviewWithSystemWithDay();
  1122. },
  1123. tabtimetap1(i) {
  1124. this.dateType1 = i;
  1125. this.customtime1 = [];
  1126. if (this.echarValue == 0) {
  1127. this.dataOverviewWithSystemWithDay();
  1128. } else {
  1129. this.dataOverviewWithSystemWithLookWithTable();
  1130. }
  1131. },
  1132. confirmtime(e) {
  1133. this.dateType = null;
  1134. this.dataOverviewWithSystemWithLook();
  1135. },
  1136. tabtimetap(i) {
  1137. this.dateType = i;
  1138. this.customtime = [];
  1139. this.dataOverviewWithSystemWithLook();
  1140. },
  1141. //卡片下折线图
  1142. SwitchCARDS(arr, str, timeDate, Strname) {
  1143. var chartDom = document.getElementById(str);
  1144. var myChart = echarts.init(chartDom);
  1145. var option;
  1146. option = {
  1147. color: [
  1148. "#6F8EDC",
  1149. "#EE6666",
  1150. "#F98120",
  1151. "#1CC99E",
  1152. "#9474FB",
  1153. "#66AFF5",
  1154. "#FABD2B",
  1155. "#FFCF8F",
  1156. "#657292",
  1157. "#7A6A99",
  1158. "#BF5D52",
  1159. "#77B7E4",
  1160. "#E6A065",
  1161. "#9D5139",
  1162. "#C1AA88",
  1163. "#F87F7A",
  1164. "#F6CF74",
  1165. "#7F5506",
  1166. "#88BB9B",
  1167. "#6E99AA",
  1168. "#5789D0",
  1169. ],
  1170. tooltip: {
  1171. trigger: "axis",
  1172. },
  1173. legend: {
  1174. data: Strname,
  1175. bottom: "10",
  1176. },
  1177. grid: {
  1178. left: 10,
  1179. right: 10,
  1180. containLabel: true,
  1181. },
  1182. xAxis: {
  1183. type: "category",
  1184. data: timeDate,
  1185. axisLabel: {
  1186. //重点在这一块,其余可以忽略
  1187. textStyle: {
  1188. color: "#212121", //更改坐标轴文字颜色
  1189. },
  1190. },
  1191. axisLine: {
  1192. lineStyle: {
  1193. type: "solid",
  1194. color: "#DDE1EE", //x线的颜色
  1195. width: "1", //坐标线的宽度
  1196. },
  1197. },
  1198. },
  1199. yAxis: {
  1200. type: "value",
  1201. splitNumber: 4,
  1202. axisLabel: {
  1203. //重点在这一块,其余可以忽略
  1204. textStyle: {
  1205. color: "#212121", //更改坐标轴文字颜色
  1206. },
  1207. },
  1208. axisLine: {
  1209. lineStyle: {
  1210. ype: "solid",
  1211. color: "#DDE1EE", //x线的颜色
  1212. width: "1", //坐标线的宽度
  1213. },
  1214. },
  1215. splitLine: {
  1216. lineStyle: {
  1217. type: "dashed", // y轴分割线类型
  1218. },
  1219. },
  1220. axisTick: {
  1221. //y轴刻度线
  1222. show: false,
  1223. },
  1224. },
  1225. series: arr,
  1226. };
  1227. option && myChart.setOption(option);
  1228. window.addEventListener("resize", () => {
  1229. myChart.resize();
  1230. });
  1231. },
  1232. },
  1233. };
  1234. </script>
  1235. <style scoped="scoped" lang="scss" >
  1236. .box-center {
  1237. width: 100%;
  1238. padding: 15px;
  1239. min-width: 1000px;
  1240. padding-bottom: 100px;
  1241. }
  1242. .container {
  1243. display: grid;
  1244. grid-template-columns: repeat(6, 16%);
  1245. grid-column-gap: 12px;
  1246. grid-row-gap: 18px;
  1247. }
  1248. // 进度条
  1249. .jinbox {
  1250. width: 100%;
  1251. height: 18px;
  1252. line-height: 18px;
  1253. display: flex;
  1254. font-size: 16px;
  1255. color: #2c3542;
  1256. margin-top: 20px;
  1257. .jinboxtit {
  1258. width: 14%;
  1259. height: 18px;
  1260. padding-right: 6px;
  1261. white-space: nowrap;
  1262. text-overflow: ellipsis;
  1263. overflow: hidden;
  1264. }
  1265. .jinbox-box {
  1266. width: 75%;
  1267. height: 100%;
  1268. border-radius: 8px;
  1269. background: #f2f2f2;
  1270. }
  1271. .boxbaifenbi {
  1272. height: 100%;
  1273. background: #60d7a0;
  1274. border-radius: 8px;
  1275. }
  1276. .boxbaifenbi2 {
  1277. height: 100%;
  1278. background: #5b8ff9;
  1279. }
  1280. .jinboxbott {
  1281. width: 16%;
  1282. text-indent: 20px;
  1283. }
  1284. }
  1285. #main {
  1286. width: 100%;
  1287. height: 380px;
  1288. }
  1289. #echar2 {
  1290. width: 100%;
  1291. height: 380px;
  1292. }
  1293. #Brokenline1 {
  1294. width: 100%;
  1295. height: 350px;
  1296. }
  1297. #Brokenline2 {
  1298. width: 100%;
  1299. height: 350px;
  1300. }
  1301. #Pinspeak1 {
  1302. width: 100%;
  1303. height: 350px;
  1304. }
  1305. #Pinspeak2 {
  1306. width: 100%;
  1307. height: 350px;
  1308. }
  1309. .app-box-san {
  1310. width: 100%;
  1311. // height: 400px;
  1312. display: flex;
  1313. margin-top: 15px;
  1314. .zuo {
  1315. flex: 1;
  1316. height: 100%;
  1317. margin-right: 15px;
  1318. background: #ffffff;
  1319. border-radius: 4px;
  1320. .title {
  1321. width: 100%;
  1322. height: 55px;
  1323. border-bottom: 1px solid #e0e0e0;
  1324. display: flex;
  1325. align-content: center;
  1326. .text1 {
  1327. flex: 2;
  1328. line-height: 55px;
  1329. text-indent: 20px;
  1330. font-weight: 500;
  1331. font-size: 16px;
  1332. color: #333333;
  1333. }
  1334. .text2 {
  1335. flex: 1;
  1336. height: 55px;
  1337. display: flex;
  1338. align-items: center;
  1339. }
  1340. }
  1341. }
  1342. .you {
  1343. height: 100%;
  1344. flex: 1;
  1345. background: #ffffff;
  1346. border-radius: 4px;
  1347. .title {
  1348. width: 100%;
  1349. height: 55px;
  1350. border-bottom: 1px solid #e0e0e0;
  1351. display: flex;
  1352. align-content: center;
  1353. .text1 {
  1354. flex: 2;
  1355. line-height: 55px;
  1356. text-indent: 20px;
  1357. font-weight: 500;
  1358. font-size: 16px;
  1359. color: #333333;
  1360. }
  1361. .text2 {
  1362. flex: 1;
  1363. height: 55px;
  1364. display: flex;
  1365. align-items: center;
  1366. }
  1367. }
  1368. }
  1369. }
  1370. .app-box-er {
  1371. width: 100%;
  1372. background: #ffffff;
  1373. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1374. border-radius: 4px;
  1375. margin-top: 15px;
  1376. padding: 15px;
  1377. }
  1378. .grid-content {
  1379. background: #ffffff;
  1380. height: 90px;
  1381. border: 1px solid #e0e0e0;
  1382. .text1 {
  1383. height: 16px;
  1384. font-size: 16px;
  1385. font-weight: 400;
  1386. line-height: 16px;
  1387. text-indent: 20px;
  1388. margin-top: 20px;
  1389. }
  1390. .text2 {
  1391. height: 32px;
  1392. font-size: 32px;
  1393. font-weight: normal;
  1394. line-height: 32px;
  1395. text-indent: 20px;
  1396. margin-top: 10px;
  1397. }
  1398. }
  1399. .tophove {
  1400. color: #ffffff;
  1401. background: #2671e2;
  1402. }
  1403. .tophovese {
  1404. color: #2671e2;
  1405. }
  1406. .app-top {
  1407. width: 100%;
  1408. background: #ffffff;
  1409. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1410. border-radius: 4px;
  1411. padding-top: 15px;
  1412. padding-bottom: 15px;
  1413. }
  1414. .app-titel {
  1415. width: 100%;
  1416. display: flex;
  1417. align-items: center;
  1418. .titel-text {
  1419. height: 100%;
  1420. font-size: 16px;
  1421. font-weight: 600;
  1422. color: #32363d;
  1423. text-indent: 30px;
  1424. }
  1425. .toptimeqhuan {
  1426. width: 190px;
  1427. height: 32px;
  1428. background: #ffffff;
  1429. border-radius: 4px;
  1430. border: 1px solid #e0e0e0;
  1431. display: flex;
  1432. align-items: center;
  1433. overflow: hidden;
  1434. margin-left: 20px;
  1435. cursor: pointer;
  1436. }
  1437. .toptimeqhuan div {
  1438. flex: 1;
  1439. text-align: center;
  1440. line-height: 32px;
  1441. font-size: 14px;
  1442. }
  1443. }
  1444. .hejisan {
  1445. width: 92%;
  1446. margin: 0 auto;
  1447. display: flex;
  1448. margin-top: 15px;
  1449. .text1-1 {
  1450. color: #666666;
  1451. }
  1452. .text1-2 {
  1453. color: #333333;
  1454. margin-top: 10px;
  1455. }
  1456. }
  1457. .app_titile {
  1458. display: flex;
  1459. justify-content: space-between;
  1460. }
  1461. </style>