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.
 
 
 

840 lines
21 KiB

  1. <template>
  2. <div class="pages">
  3. <div class="app-titel" style="height: auto; padding: 26px">
  4. <div class="screeningbox" style="display: flex; flex-wrap: wrap">
  5. <div class="screeningbox" style="display: flex; align-items: center">
  6. 添加时间:
  7. </div>
  8. <el-radio-group
  9. v-model="pageParams.dateType"
  10. size="small"
  11. @change="tabtimetap"
  12. >
  13. <el-radio-button :label="4">近7天</el-radio-button>
  14. <el-radio-button :label="5">近15天</el-radio-button>
  15. <el-radio-button :label="6">近30天</el-radio-button>
  16. </el-radio-group>
  17. <div style="margin-left: 26px">
  18. <el-date-picker
  19. style="width: 250px; height: 32px; line-height: 32px"
  20. @change="confirmtime()"
  21. v-model="customtime"
  22. type="daterange"
  23. range-separator="至"
  24. value-format="yyyy-MM-dd"
  25. start-placeholder="开始日期"
  26. end-placeholder="结束日期"
  27. >
  28. </el-date-picker>
  29. </div>
  30. <div style="width: 100%; display: flex">
  31. <div class="items">
  32. 团队:
  33. <el-select
  34. v-model="pageParams.deptId"
  35. clearable
  36. placeholder="请选择"
  37. >
  38. <el-option
  39. v-for="item in deptList"
  40. :key="item.id"
  41. :label="item.name"
  42. :value="item.id"
  43. >
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <div class="items">
  48. 接待顾问:
  49. <el-select
  50. v-model="pageParams.agentId"
  51. clearable
  52. placeholder="请选择"
  53. >
  54. <el-option
  55. v-for="item in accountList"
  56. :key="item.accountId"
  57. :label="item.name"
  58. :value="item.accountId"
  59. >
  60. </el-option>
  61. </el-select>
  62. </div>
  63. <div class="items">
  64. 销讲业务:
  65. <el-select
  66. @change="changeSelect"
  67. v-model="pageParams.marketingBusiness"
  68. clearable
  69. placeholder="请选择销讲业务"
  70. >
  71. <el-option
  72. v-for="item in options"
  73. :key="item.id"
  74. :label="item.templateName"
  75. :value="item.id"
  76. >
  77. </el-option>
  78. </el-select>
  79. </div>
  80. <div class="items">
  81. <el-button type="primary" @click="employeeUsageStatistics"
  82. >筛选</el-button
  83. >
  84. <el-button type="text" @click="Emptycondition"
  85. >清空筛选条件</el-button
  86. >
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <!-- <%--
  92. <div class="screeningbox" style="margin-top: 20px; background: #fff">
  93. --%> <%--
  94. <button class="button1" @click="employeeUsageStatistics()">筛选</button
  95. >--%> <%--
  96. <button
  97. style="background: #ffffff; color: #606775"
  98. class="button1"
  99. @click="Emptycondition()"
  100. >
  101. 清空筛选条件</button
  102. >--%> <%-- <button class="button1" @click="daochu()">导出</button>--%>
  103. <%--
  104. </div>
  105. --%> -->
  106. <div class="box-forhtml" v-for="(item, index) in objList" :key="index">
  107. <div class="conbox">{{ item.name }}</div>
  108. <div class="box-forhtml-flex">
  109. <div class="left">
  110. <div class="left-title">
  111. {{ item.leftTitle }}
  112. <!-- <%--
  113. <el-tooltip :content="item.leftReason" placement="bottom-end"
  114. >--%> <%-- <i class="el-icon-warning-outline"></i>--%> <%-- </el-tooltip
  115. >--%> -->
  116. </div>
  117. <div class="Templatetable">
  118. <div class="table-tit">
  119. <div>排名</div>
  120. <div>无效原因</div>
  121. <div>接待数</div>
  122. <div>占比</div>
  123. <div>操作</div>
  124. </div>
  125. <template v-if="item.total > 0">
  126. <div
  127. class="table-cent"
  128. v-for="(itcen, inde) in item.matchKeywords"
  129. :key="inde"
  130. >
  131. <div
  132. style="
  133. display: flex;
  134. align-items: center;
  135. justify-content: center;
  136. "
  137. >
  138. <img
  139. v-if="inde == 0"
  140. style="width: 30px; height: 30px"
  141. src="https://zkgj.quhouse.com/static/images/system/images/ranking1.png"
  142. alt=""
  143. />
  144. <img
  145. v-else-if="inde == 1"
  146. style="width: 30px; height: 30px"
  147. src="https://zkgj.quhouse.com/static/images/system/images/ranking2.png"
  148. alt=""
  149. />
  150. <img
  151. v-else-if="inde == 2"
  152. style="width: 30px; height: 30px"
  153. src="https://zkgj.quhouse.com/static/images/system/images/ranking3.png"
  154. alt=""
  155. />
  156. <div v-else class="indeclass">{{ inde + 1 }}</div>
  157. </div>
  158. <div>{{ itcen.name }}</div>
  159. <div>{{ itcen.count }}</div>
  160. <div>{{ itcen.percent }}%</div>
  161. <div
  162. style="color: #2671e2; cursor: pointer"
  163. @click="Toview(item, itcen)"
  164. >
  165. 明细
  166. </div>
  167. </div>
  168. </template>
  169. <template v-else>
  170. <div
  171. style="
  172. width: 100%;
  173. line-height: 400px;
  174. text-align: center;
  175. color: #999999;
  176. font-size: 16px;
  177. "
  178. >
  179. 暂无数据
  180. </div>
  181. </template>
  182. </div>
  183. </div>
  184. <div class="right">
  185. <div class="right-title">
  186. <div>
  187. {{ item.leftTitle }}
  188. </div>
  189. <div class="export">
  190. <el-button type="primary" @click="exportExcel(item.url)"
  191. >导出</el-button
  192. >
  193. </div>
  194. </div>
  195. <div
  196. :id="item.id"
  197. class="container"
  198. style="width: 100%; height: 400px; text-align: center"
  199. >
  200. <img
  201. v-if="item.total == 0"
  202. style="width: 400px; height: 400px"
  203. src="https://zkgj.quhouse.com/static/images/system/images/Elementcircle.png"
  204. alt=""
  205. />
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. </template>
  212. <script>
  213. import * as echarts from "echarts";
  214. import { exportMethodPost } from "@/util/util";
  215. export default {
  216. data() {
  217. return {
  218. pageParams: {
  219. dateType: 5, // 4 近七天 5 十五天 6 三十天
  220. startTime: "", // 开始时间
  221. endTime: "", // 结束时间
  222. houseId: "", // 项目id
  223. agentId: "", // 顾问id
  224. deptId: "", // 部门id
  225. marketingBusiness: "", // 销讲业务
  226. },
  227. customtime: [], // 时间段选择
  228. tableData: [], // 员工分析列表
  229. loading: false,
  230. deptList: [], // 部门/团队列表
  231. accountList: [], // 顾问列表
  232. objList: [
  233. {
  234. name: "无效接待分布",
  235. title: "接待总数",
  236. matchKeywords: [],
  237. id: "deptName", // echarts渲染的盒子id
  238. total: 0, // 接待总数
  239. leftReason: `原因1:无录音(离线接待).
  240. 原因2:无录音(无设备).
  241. 原因3:无录音(录音时间小于1分钟).
  242. 原因4:选择的无效原因.`, // 左侧原因
  243. rightReason: `1:没电指派无有效录音.
  244. 2:离线指派无有效录音.
  245. 3:系统测试.
  246. 4:非接访场景录音.
  247. 5:其它.`, // 右侧原因
  248. leftTitle: "无效原因排名", // 左侧小标题
  249. rightTitle: "无效原因占比", // 右侧小标题
  250. url: "/customer/invalidReceptionRankExport", // 导出接口get请求
  251. },
  252. ], // 数据合集包含 无效接待分布
  253. options: [], // 列表
  254. myChart: null, // 图表实例对象
  255. };
  256. },
  257. created() {
  258. this.pageParams.houseId = localStorage.getItem("houseId");
  259. },
  260. mounted() {
  261. // 员工使用统计
  262. this.initPage();
  263. },
  264. methods: {
  265. // 销讲业务模板
  266. getMarketingBusiness() {
  267. this.$api.http
  268. .marketingBusiness({
  269. houseId: this.pageParams.houseId,
  270. })
  271. .then((res) => {
  272. if (res.code == 10000) {
  273. this.options = res.data;
  274. }
  275. });
  276. },
  277. // 初始化页面
  278. initPage() {
  279. this.getAllDeptName();
  280. this.getAllAccountName();
  281. this.employeeUsageStatistics();
  282. this.getMarketingBusiness();
  283. },
  284. changeSelect() {
  285. this.employeeUsageStatistics();
  286. },
  287. // 部门
  288. getAllDeptName() {
  289. this.$api.http
  290. .getAllDeptName({ itemId: this.pageParams.houseId })
  291. .then((res) => {
  292. if (res.code == 10000) {
  293. this.deptList = res.data;
  294. }
  295. });
  296. },
  297. // 顾问
  298. getAllAccountName() {
  299. this.$api.http
  300. .getAllAccountName({ itemId: this.pageParams.houseId })
  301. .then((res) => {
  302. if (res.code == 10000) {
  303. this.accountList = res.data;
  304. }
  305. });
  306. },
  307. // 获取员工使用统计
  308. employeeUsageStatistics() {
  309. this.$api.http.invalidReceptionRank(this.pageParams).then((res) => {
  310. console.log(res, "sadlka;ldkls;");
  311. if (res.code == 10000) {
  312. let result = res.data;
  313. this.objList[0].matchKeywords = result.list;
  314. this.objList[0].total = result.sum;
  315. let isEmpty =
  316. this.objList[0].matchKeywords.filter((item) => item.count != 0)
  317. .length > 0;
  318. if (!isEmpty) this.myChart && this.myChart.clear();
  319. this.myChartinit(this.objList[0], isEmpty);
  320. }
  321. });
  322. },
  323. //导出表格
  324. // TO DO
  325. exportExcel(url) {
  326. exportMethodPost(`/autoSR/audit/reception/invalidReceptionRankExport`,'无效接待分析', this.pageParams)
  327. // let str = "?";
  328. // for (let i in this.pageParams) {
  329. // str += i + "=" + (this.pageParams[i] || "") + "&";
  330. // }
  331. // window.location.href = "${jypath}" + url + str.substr(0, str.length - 1);
  332. },
  333. //清空筛选条件
  334. Emptycondition() {
  335. this.pageParams = {
  336. dateType: 5, // 4 近七天 5 十五天 6 三十天
  337. startTime: "", // 开始时间
  338. endTime: "", // 结束时间
  339. houseId: localStorage.getItem("houseId"), // 项目id
  340. agentId: "", // 顾问id
  341. deptId: "", // 部门id
  342. marketingBusiness: "", // 销讲业务
  343. };
  344. this.customtime = [];
  345. this.employeeUsageStatistics();
  346. },
  347. resetParamsTime() {
  348. this.pageParams.pageNum = 1;
  349. this.pageParams.pageSize = 1;
  350. this.pageParams.startTime = "";
  351. this.pageParams.endTime = "";
  352. },
  353. //时间tab切换
  354. tabtimetap() {
  355. this.resetParamsTime();
  356. this.employeeUsageStatistics();
  357. },
  358. //时间选择
  359. confirmtime() {
  360. if (this.customtime.length) {
  361. this.pageParams.dateType = null;
  362. this.pageParams.startTime = this.customtime[0];
  363. this.pageParams.endTime = this.customtime[1];
  364. this.employeeUsageStatistics();
  365. }
  366. },
  367. // 查看详情
  368. Toview(item, items) {
  369. let obj = {
  370. ...this.pageParams,
  371. accountId: this.pageParams.agentId, // 顾问id
  372. invalidReason: items.id,
  373. };
  374. if (this.pageParams.dateType == 4) {
  375. obj.dateType = 2;
  376. } else if (this.pageParams.dateType == 5) {
  377. // 4 近七天 5 十五天 6 三十天
  378. this.customtime = this.getTimeArea(15);
  379. obj.date = this.customtime.join(","); // 筛选时间
  380. } else if (this.pageParams.dateType == 6) {
  381. this.customtime = this.getTimeArea(30);
  382. obj.date = this.customtime.join(","); // 筛选时间
  383. } else {
  384. obj.date = this.customtime.join(","); // 筛选时间
  385. }
  386. this.$router.push({
  387. path: "/ReceivingRecords/index",
  388. query: obj,
  389. });
  390. },
  391. // 获取时间段
  392. getTimeArea(x = 1) {
  393. let starTime = new Date().getTime() - 24 * 60 * 60 * 1000 * x;
  394. let startDate = `${new Date(starTime).getFullYear()}-${
  395. new Date(starTime).getMonth() + 1
  396. }-${new Date(starTime).getDate()}`;
  397. let endTime = new Date().getTime() - 24 * 60 * 60 * 1000;
  398. let endDate = `${new Date(endTime).getFullYear()}-${
  399. new Date(endTime).getMonth() + 1
  400. }-${new Date(endTime).getDate()}`;
  401. return [startDate, endDate];
  402. },
  403. // 初始化表格
  404. myChartinit(item, empity) {
  405. this.myChart = echarts.init(document.getElementById(item.id));
  406. let objoptlis = [];
  407. let option = {};
  408. if (!empity) {
  409. option.title = {
  410. text: "暂无数据",
  411. x: "center",
  412. y: "center",
  413. textStyle: {
  414. fontSize: 14,
  415. fontWeight: "normal",
  416. },
  417. };
  418. } else {
  419. item.matchKeywords.forEach((ice) => {
  420. objoptlis.push({
  421. value: ice.count,
  422. name: ice.name,
  423. percent: ice.percent,
  424. });
  425. });
  426. option = {
  427. color: [
  428. "#66AFF5",
  429. "#FABD2B",
  430. "#6F8EDC",
  431. "#FFCF8F",
  432. "#F98120",
  433. "#1CC99E",
  434. "#9474FB",
  435. "#657292",
  436. "#7A6A99",
  437. "#BF5D52",
  438. "#EE6666",
  439. "#77B7E4",
  440. "#E6A065",
  441. "#9D5139",
  442. "#C1AA88",
  443. "#F87F7A",
  444. "#F6CF74",
  445. "#7F5506",
  446. "#88BB9B",
  447. "#6E99AA",
  448. "#5789D0",
  449. ],
  450. tooltip: {
  451. show: true,
  452. trigger: "item",
  453. formatter: (data) => {
  454. console.log(data);
  455. return (
  456. data.data.name +
  457. " " +
  458. data.data.value +
  459. "(" +
  460. data.data.percent +
  461. "%)"
  462. );
  463. },
  464. },
  465. legend: {
  466. type: "scroll",
  467. data: objoptlis,
  468. bottom: 0,
  469. },
  470. graphic: [
  471. {
  472. type: "text",
  473. left: "center",
  474. top: "42%",
  475. style: {
  476. text: item.total,
  477. textAlign: "center",
  478. fill: "#000",
  479. width: 30,
  480. height: 30,
  481. fontSize: 24,
  482. color: "#32363D",
  483. fontFamily: "Microsoft YaHei",
  484. },
  485. },
  486. {
  487. type: "text",
  488. left: "center",
  489. top: "55%",
  490. style: {
  491. text: item.title,
  492. textAlign: "center",
  493. fill: "#000",
  494. width: 30,
  495. height: 30,
  496. fontSize: 16,
  497. color: "#666666",
  498. },
  499. },
  500. ],
  501. series: [
  502. {
  503. name: "",
  504. type: "pie",
  505. radius: ["48%", "70%"],
  506. avoidLabelOverlap: true,
  507. data: objoptlis,
  508. label: {
  509. show: true,
  510. },
  511. },
  512. ],
  513. };
  514. }
  515. this.myChart.setOption(option);
  516. },
  517. },
  518. };
  519. </script>
  520. <style lang="scss" scoped>
  521. .app-titel {
  522. padding: 20px 24px;
  523. width: 100%;
  524. /*min-height: 80px;*/
  525. background: #ffffff;
  526. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  527. border-radius: 8px;
  528. display: flex;
  529. flex-wrap: wrap;
  530. }
  531. .app-titel .items {
  532. margin: 20px 24px 0 0;
  533. }
  534. .toptimeqhuan {
  535. width: 190px;
  536. height: 32px;
  537. background: #ffffff;
  538. border-radius: 4px;
  539. border: 1px solid #e0e0e0;
  540. display: flex;
  541. align-items: center;
  542. overflow: hidden;
  543. margin-left: 30px;
  544. cursor: pointer;
  545. }
  546. .toptimeqhuan div {
  547. flex: 1;
  548. text-align: center;
  549. line-height: 32px;
  550. font-size: 16px;
  551. }
  552. .tophove {
  553. color: #ffffff;
  554. background: #2671e2;
  555. }
  556. .app-box {
  557. width: 100%;
  558. padding-bottom: 20px;
  559. background: #ffffff;
  560. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  561. border-radius: 8px;
  562. padding-top: 20px;
  563. padding-left: 30px;
  564. padding-right: 30px;
  565. margin-top: 30px;
  566. }
  567. .conbox {
  568. height: 18px;
  569. font-size: 18px;
  570. font-family: PingFangSC-Semibold, PingFang SC;
  571. font-weight: 600;
  572. color: #32363d;
  573. line-height: 18px;
  574. }
  575. /*.con-bodeer-box{*/
  576. /* width: 100%;height: 113px;*/
  577. /* border-radius: 4px;border: 1px solid #E0E0E0;margin-top: 20px;*/
  578. /*}*/
  579. /*.con-bodeer-box .con-flex{*/
  580. /* width: 100%;height: 56px;display: flex;align-items: center;*/
  581. /*}*/
  582. /*.con-bodeer-box .con-flex div{*/
  583. /* flex: 1;text-align: center;line-height: 56px;font-size: 16px;*/
  584. /*}*/
  585. .box-forhtml {
  586. width: 100%;
  587. min-height: 400px;
  588. background: #ffffff;
  589. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  590. border-radius: 8px;
  591. padding: 20px 30px;
  592. margin-top: 30px;
  593. }
  594. .box-forhtml-flex {
  595. position: relative;
  596. width: 100%;
  597. display: flex;
  598. margin-top: 20px;
  599. }
  600. .box-forhtml-flex .right .right-title {
  601. display: flex;
  602. justify-content: space-between;
  603. }
  604. .box-forhtml-flex .left .left-title,
  605. .box-forhtml-flex .right .right-title {
  606. padding: 12px 0;
  607. width: 100%;
  608. }
  609. .box-forhtml-flex .left {
  610. width: 50%;
  611. min-height: 320px;
  612. }
  613. .box-forhtml-flex .right {
  614. width: 50%;
  615. min-height: 330px;
  616. display: flex;
  617. flex-direction: column;
  618. align-items: center;
  619. }
  620. .Templatetable {
  621. width: 88%;
  622. height: 100%;
  623. margin: 0 auto;
  624. overflow-y: auto;
  625. }
  626. .table-tit {
  627. width: 100%;
  628. height: 20px;
  629. line-height: 20px;
  630. display: flex;
  631. }
  632. .table-tit > div:nth-of-type(1) {
  633. width: 10%;
  634. text-align: center;
  635. font-size: 16px;
  636. font-family: PingFangSC-Semibold, PingFang SC;
  637. font-weight: 600;
  638. color: #606775;
  639. }
  640. .table-tit > div:nth-of-type(2) {
  641. width: 40%;
  642. text-align: center;
  643. font-size: 16px;
  644. font-family: PingFangSC-Semibold, PingFang SC;
  645. font-weight: 600;
  646. color: #606775;
  647. }
  648. .table-tit > div:nth-of-type(3) {
  649. width: 20%;
  650. text-align: center;
  651. font-size: 16px;
  652. font-family: PingFangSC-Semibold, PingFang SC;
  653. font-weight: 600;
  654. color: #606775;
  655. }
  656. .table-tit > div:nth-of-type(4) {
  657. width: 20%;
  658. text-align: center;
  659. font-size: 16px;
  660. font-family: PingFangSC-Semibold, PingFang SC;
  661. font-weight: 600;
  662. color: #606775;
  663. }
  664. .table-tit > div:nth-of-type(5) {
  665. width: 10%;
  666. text-align: center;
  667. font-size: 16px;
  668. font-family: PingFangSC-Semibold, PingFang SC;
  669. font-weight: 600;
  670. color: #606775;
  671. }
  672. .table-cent {
  673. padding: 5px 0;
  674. width: 100%;
  675. display: flex;
  676. margin-top: 10px;
  677. }
  678. .table-cent > div:nth-of-type(1) {
  679. width: 10%;
  680. text-align: center;
  681. font-size: 14px;
  682. font-family: PingFangSC-Semibold, PingFang SC;
  683. color: #32363d;
  684. }
  685. .table-cent > div:nth-of-type(2) {
  686. width: 40%;
  687. text-align: center;
  688. font-size: 14px;
  689. font-family: PingFangSC-Semibold, PingFang SC;
  690. color: #32363d;
  691. overflow: hidden;
  692. white-space: nowrap;
  693. text-overflow: ellipsis;
  694. }
  695. .table-cent > div:nth-of-type(3) {
  696. width: 20%;
  697. text-align: center;
  698. font-size: 14px;
  699. font-family: PingFangSC-Semibold, PingFang SC;
  700. color: #32363d;
  701. }
  702. .table-cent > div:nth-of-type(4) {
  703. width: 20%;
  704. text-align: center;
  705. font-size: 14px;
  706. font-family: PingFangSC-Semibold, PingFang SC;
  707. color: #32363d;
  708. }
  709. .table-cent > div:nth-of-type(5) {
  710. width: 10%;
  711. text-align: center;
  712. font-size: 14px;
  713. font-family: PingFangSC-Semibold, PingFang SC;
  714. color: #32363d;
  715. }
  716. .indeclass {
  717. width: 20px;
  718. height: 20px;
  719. border-radius: 50%;
  720. background: #ecf1ff;
  721. color: #ffffff;
  722. text-align: center;
  723. line-height: 20px;
  724. font-size: 14px;
  725. }
  726. .el-date-editor .el-range__icon {
  727. line-height: 25px;
  728. }
  729. .el-date-editor .el-range-separator {
  730. line-height: 25px;
  731. }
  732. .el-date-editor .el-range-input,
  733. .el-date-editor .el-range-separator {
  734. margin: 3px;
  735. }
  736. .con-bodeer-box {
  737. width: 100%;
  738. height: 113px;
  739. border-radius: 4px;
  740. border: 1px solid #e0e0e0;
  741. margin-top: 20px;
  742. }
  743. .con-bodeer-box .con-flex {
  744. width: 100%;
  745. height: 56px;
  746. display: flex;
  747. align-items: center;
  748. }
  749. .con-bodeer-box .con-flex div {
  750. flex: 1;
  751. text-align: center;
  752. line-height: 56px;
  753. font-size: 16px;
  754. }
  755. .backTopbox {
  756. width: 40px;
  757. height: 40px;
  758. border-radius: 50%;
  759. background: #d0edff;
  760. position: fixed;
  761. bottom: 40px;
  762. right: 40px;
  763. border: none;
  764. display: flex;
  765. align-items: center;
  766. justify-content: center;
  767. }
  768. .backTop {
  769. display: block;
  770. width: 16px;
  771. height: 20px;
  772. }
  773. .btns {
  774. width: 90px;
  775. height: 40px;
  776. display: flex;
  777. justify-content: center;
  778. align-items: center;
  779. color: #fff;
  780. background: #2671e2;
  781. border-radius: 8px;
  782. }
  783. </style>