index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <template>
  2. <div class="wrap">
  3. <div class="head">
  4. <div class="head-left">
  5. <div class="head-left-title">
  6. <span>营级单位排名</span>
  7. </div>
  8. <el-table
  9. :data="peopleList"
  10. :header-cell-style="{ background: '#0c2c50', color: 'white' }"
  11. style="width: 98%; background: #0c2c50; margin-left: 1%"
  12. height="88%"
  13. >
  14. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  15. <el-table-column label="名次" align="center" type="index" />
  16. <!-- <el-table-column label="备用手机号" align="center" prop="id" /> -->
  17. <el-table-column label="单位" align="center" prop="name" />
  18. <el-table-column label="加分" align="center" prop="addscore">
  19. <template slot-scope="scope">
  20. <div style="color: rgb(2 255 2)">{{ scope.row.addscore }}</div>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="减分" align="center" prop="subscore">
  24. <template slot-scope="scope">
  25. <div style="color: rgb(255 106 0)">{{ scope.row.subscore }}</div>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="总分" align="center" prop="zongfen" />
  29. </el-table>
  30. </div>
  31. <div class="head-right">
  32. <div class="head-left-title">
  33. <span>待处理及待验收问题</span>
  34. </div>
  35. <el-table
  36. :data="peopleList2"
  37. :header-cell-style="{ background: '#0c2c50', color: 'white' }"
  38. style="width: 98%; background: #0c2c50; margin-left: 1%"
  39. height="88%"
  40. @row-click="rowclick"
  41. >
  42. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  43. <el-table-column label="序号" align="center" type="index" />
  44. <el-table-column
  45. label="受检单位"
  46. align="center"
  47. prop="inspectedUnit"
  48. />
  49. <el-table-column
  50. label="检查单位"
  51. align="center"
  52. prop="unitCheck"
  53. ></el-table-column>
  54. <el-table-column
  55. label="状态"
  56. align="center"
  57. prop="currentState"
  58. ></el-table-column>
  59. <el-table-column label="减分" align="center" prop="score">
  60. <template slot-scope="scope">
  61. <div style="color: rgb(255 106 0)">{{ scope.row.score }}</div>
  62. </template>
  63. </el-table-column>
  64. <el-table-column
  65. label="事由"
  66. show-overflow-tooltip
  67. align="center"
  68. prop="question"
  69. />
  70. <el-table-column
  71. label="整改时间"
  72. align="center"
  73. prop="rectificationTime"
  74. width="180"
  75. >
  76. <template slot-scope="scope">
  77. <span>
  78. {{ parseTime(scope.row.rectificationTime, "{y}-{m}-{d}") }}
  79. </span>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. </div>
  84. </div>
  85. <div class="foot">
  86. <div class="foot-left">
  87. <div class="head-left-title">
  88. <span>整体状态完成比例</span>
  89. </div>
  90. <div id="foot-left-content"></div>
  91. </div>
  92. <div class="foot-right">
  93. <div class="head-left-title">
  94. <span>各营级</span>
  95. </div>
  96. <div class="foot-right-main" id="foot-right-main" ref="foot">
  97. <div class="block"></div>
  98. <div class="block"></div>
  99. <div class="block"></div>
  100. <div class="block"></div>
  101. <div class="block"></div>
  102. <div class="block"></div>
  103. <div class="block"></div>
  104. <div class="block"></div>
  105. <div class="block"></div>
  106. <div class="block"></div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. import {
  114. unitrank,
  115. pendingacceptance,
  116. completeproportion,
  117. unitproportion,
  118. getRegularinfo,
  119. } from "@/api/bdglregular/regularcountinfo";
  120. import * as echarts from "echarts";
  121. import Cookies from "js-cookie";
  122. export default {
  123. data() {
  124. return {
  125. peopleList: [],
  126. peopleList2: [],
  127. peopleList3: [],
  128. };
  129. },
  130. created() {
  131. // if (Cookies.get("shuaxin") != "true") {
  132. // window.location.reload();
  133. // }
  134. // Cookies.set("shuaxin", "true");
  135. this.getlist();
  136. this.getlist2();
  137. },
  138. mounted() {
  139. this.getlist3();
  140. this.echarfun();
  141. },
  142. methods: {
  143. getlist() {
  144. unitrank().then((res) => {
  145. if (res.code == 200) {
  146. this.peopleList = res.data;
  147. // console.log(this.peopleList)
  148. this.peopleList.forEach((item)=>{
  149. // console.log(item.zongfen)
  150. return item.zongfen = item.zongfen.split(".")[0]
  151. })
  152. this.peopleList.forEach((item)=>{
  153. // console.log(item.zongfen)
  154. return item.subscore = item.subscore.split(".")[0]
  155. })
  156. // console.log(this.peopleList)
  157. }
  158. });
  159. },
  160. getlist2() {
  161. pendingacceptance().then((res) => {
  162. if (res.code == 200) {
  163. this.peopleList2 = res.data;
  164. }
  165. });
  166. },
  167. getlist3() {
  168. completeproportion().then((res) => {
  169. if (res.code == 200) {
  170. var myChart = echarts.init(
  171. document.getElementById("foot-left-content")
  172. );
  173. var option = {
  174. title: {
  175. text: "",
  176. subtext: "",
  177. left: "",
  178. },
  179. tooltip: {
  180. trigger: "item",
  181. formatter: "{a} <br/>{b} : {c} ({d}%)",
  182. },
  183. color: ["#5470c6", "#fac858", "#ee6666", "#91cc75"],
  184. legend: {
  185. orient: "vertical",
  186. right: "0",
  187. top: "10%",
  188. itemGap: 20,
  189. textStyle: {
  190. color: "#fff",
  191. },
  192. data: ["待处理", "待验收", "未通过", "已通过"],
  193. },
  194. series: [
  195. {
  196. name: "",
  197. type: "pie",
  198. radius: "80%",
  199. label: {
  200. normal: {
  201. show: true,
  202. position: "inner",
  203. formatter: "{c}", //\n({d}%)
  204. textStyle: {
  205. fontWeight: 300,
  206. fontSize: 16,
  207. color: "#fff",
  208. },
  209. },
  210. },
  211. data: [
  212. {
  213. value:
  214. res.data[0].daiyanshou == 0
  215. ? null
  216. : res.data[0].daiyanshou,
  217. name: "待验收",
  218. },
  219. {
  220. value:
  221. res.data[0].daichuli == 0 ? null : res.data[0].daichuli,
  222. name: "待处理",
  223. },
  224. {
  225. value:
  226. res.data[0].weitongguo == 0
  227. ? null
  228. : res.data[0].weitongguo,
  229. name: "未通过",
  230. },
  231. {
  232. value:
  233. res.data[0].yitongguo == 0 ? null : res.data[0].yitongguo,
  234. name: "已通过",
  235. },
  236. ],
  237. emphasis: {
  238. itemStyle: {
  239. shadowBlur: 10,
  240. shadowOffsetX: 0,
  241. shadowColor: "rgba(0, 0, 0, 0.5)",
  242. },
  243. },
  244. itemStyle: {
  245. normal: {
  246. //饼状图阴影,值越大阴影亮度越高
  247. shadowBlur: 5,
  248. shadowColor: "#93DDFF",
  249. },
  250. },
  251. },
  252. ],
  253. };
  254. if (
  255. res.data[0].daiyanshou == 0 &&
  256. res.data[0].daichuli == 0 &&
  257. res.data[0].weitongguo == 0 &&
  258. res.data[0].yitongguo == 0
  259. ) {
  260. option.color = ["#255F8A"];
  261. option.tooltip = {
  262. show: false,
  263. };
  264. option.series[0].data = [{ value: 0, name: "无" }];
  265. }
  266. myChart.setOption(option);
  267. }
  268. });
  269. },
  270. getlist4() {},
  271. echarfun() {
  272. unitproportion().then((res) => {
  273. if (res.code == 200) {
  274. this.peopleList3 = res.data;
  275. console.log(res.data);
  276. var roseCharts = document.getElementsByClassName("block");
  277. for (var i = 0; i < this.peopleList3.length; i++) {
  278. var myChart = echarts.init(roseCharts[i]);
  279. var option = {
  280. title: {
  281. text: this.peopleList3[i].name,
  282. subtext: "",
  283. // left: "",
  284. y: "bottom",
  285. x: "center",
  286. padding: 0,
  287. textStyle: {
  288. color: "#ffff",
  289. // fontSize: 12,
  290. fontStyle: "normal",
  291. fontWeight: "normal",
  292. },
  293. },
  294. color: ["#5470c6", "#fac858", "#ee6666", "#91cc75"],
  295. tooltip: {
  296. trigger: "item",
  297. formatter: "{a} <br/>{b} : {c} ({d}%)",
  298. },
  299. // legend: {
  300. // orient: "vertical",
  301. // right: "0",
  302. // top: "3%",
  303. // itemGap: 5,
  304. // textStyle: {
  305. // color: "#fff"
  306. // },
  307. // data: ["待处理", "待验收", "未通过", "已通过"]
  308. // },
  309. series: [
  310. {
  311. name: "",
  312. type: "pie",
  313. radius: "60%",
  314. center: ["50%", "50%"],
  315. label: {
  316. normal: {
  317. show: true,
  318. position: "inner",
  319. formatter: "{c}", //\n({d}%)
  320. textStyle: {
  321. fontWeight: 300,
  322. fontSize: 16,
  323. color: "#fff",
  324. },
  325. },
  326. },
  327. data: [
  328. {
  329. value:
  330. this.peopleList3[i].daiyanshou == 0
  331. ? null
  332. : this.peopleList3[i].daiyanshou,
  333. name: "待验收",
  334. id: this.peopleList3[i].deptId,
  335. },
  336. {
  337. value:
  338. this.peopleList3[i].daichuli == 0
  339. ? null
  340. : this.peopleList3[i].daichuli,
  341. name: "待处理",
  342. id: this.peopleList3[i].deptId,
  343. },
  344. {
  345. value:
  346. this.peopleList3[i].weitongguo == 0
  347. ? null
  348. : this.peopleList3[i].weitongguo,
  349. name: "未通过",
  350. id: this.peopleList3[i].deptId,
  351. },
  352. {
  353. value:
  354. this.peopleList3[i].yitongguo == 0
  355. ? null
  356. : this.peopleList3[i].yitongguo,
  357. name: "已通过",
  358. id: this.peopleList3[i].deptId,
  359. },
  360. ],
  361. emphasis: {
  362. itemStyle: {
  363. shadowBlur: 10,
  364. shadowOffsetX: 0,
  365. shadowColor: "rgba(0, 0, 0, 0.5)",
  366. },
  367. },
  368. itemStyle: {
  369. normal: {
  370. //饼状图阴影,值越大阴影亮度越高
  371. shadowBlur: 5,
  372. shadowColor: "#93DDFF",
  373. },
  374. },
  375. },
  376. ],
  377. };
  378. if (
  379. this.peopleList3[i].daiyanshou == 0 &&
  380. this.peopleList3[i].daichuli == 0 &&
  381. this.peopleList3[i].weitongguo == 0 &&
  382. this.peopleList3[i].yitongguo == 0
  383. ) {
  384. option.color = ["#255F8A"];
  385. option.tooltip = {
  386. show: false,
  387. };
  388. option.series[0].data = [{ value: 0, name: "无" }];
  389. }
  390. myChart.setOption(option);
  391. myChart.on("click", this.eConsole);
  392. }
  393. }
  394. });
  395. },
  396. rowclick(row) {
  397. console.log(row.inspectedUnitId);
  398. this.$router
  399. .push({
  400. path: "/bdglregular/regularinfo",
  401. query: { id: row.inspectedUnitId },
  402. })
  403. .catch(() => {});
  404. },
  405. //饼状图点击事件
  406. eConsole(param) {
  407. // console.log(param.data);
  408. this.$router
  409. .push({
  410. path: "/bdglregular/regularinfo",
  411. query: { obj: param.data },
  412. })
  413. .catch(() => {});
  414. },
  415. },
  416. };
  417. </script>
  418. <style scoped>
  419. .wrap {
  420. min-height: calc(100vh - 85px);
  421. width: 100%;
  422. position: relative;
  423. overflow: hidden;
  424. background-color: #103360;
  425. margin: 0;
  426. padding: 0;
  427. display: flex;
  428. flex-direction: column;
  429. }
  430. .head {
  431. width: 100%;
  432. /* height: 43.5vh; */
  433. flex: 1;
  434. display: flex;
  435. flex-direction: row;
  436. margin-top: 10px;
  437. margin-bottom: 10px;
  438. }
  439. .head-left {
  440. flex: 4;
  441. height: 44vh;
  442. background-image: url("../../../assets/images/底 拷贝 3.png");
  443. background-repeat: no-repeat;
  444. background-size: 100% 100%;
  445. margin-left: 10px;
  446. margin-right: 10px;
  447. }
  448. .head-right {
  449. flex: 6;
  450. height: 44vh;
  451. background-image: url("../../../assets/images/底 拷贝 3.png");
  452. background-repeat: no-repeat;
  453. background-size: 100% 100%;
  454. margin-right: 10px;
  455. }
  456. .head-left-title {
  457. width: 96%;
  458. height: 30px;
  459. font-size: 18px;
  460. color: #fff;
  461. background-image: url("../../../assets/images/组 21.png");
  462. background-repeat: no-repeat;
  463. margin-top: 9px;
  464. line-height: 30px;
  465. position: relative;
  466. margin-left: 1%;
  467. }
  468. .head-left-title span {
  469. position: absolute;
  470. left: 36px;
  471. }
  472. ::v-deep .el-table__empty-block {
  473. background-color: #0c2c50;
  474. }
  475. .foot {
  476. width: 100%;
  477. /* height: 45vh; */
  478. flex: 1;
  479. display: flex;
  480. flex-direction: row;
  481. margin-bottom: 10px;
  482. }
  483. .foot-left {
  484. flex: 4;
  485. height: 43.5vh;
  486. background-image: url("../../../assets/images/底 拷贝 3.png");
  487. background-repeat: no-repeat;
  488. background-size: 100% 100%;
  489. margin-left: 10px;
  490. margin-right: 10px;
  491. }
  492. .foot-right {
  493. flex: 6;
  494. height: 43.5vh;
  495. background-image: url("../../../assets/images/底 拷贝 3.png");
  496. background-repeat: no-repeat;
  497. background-size: 100% 100%;
  498. margin-right: 10px;
  499. }
  500. .foot-right-main {
  501. width: 100%;
  502. height: 100%;
  503. }
  504. .foot-right-main .block {
  505. width: 20%;
  506. height: 42%;
  507. margin: 0;
  508. display: inline-block;
  509. }
  510. #foot-left-content {
  511. width: 90%;
  512. height: 380px;
  513. }
  514. </style>