index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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. this.getlist();
  132. this.getlist2();
  133. if (Cookies.get("shuaxin") != "true") {
  134. window.location.reload();
  135. }
  136. Cookies.set("shuaxin", "true");
  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. }
  148. });
  149. },
  150. getlist2() {
  151. pendingacceptance().then(res => {
  152. if (res.code == 200) {
  153. this.peopleList2 = res.data;
  154. }
  155. });
  156. },
  157. getlist3() {
  158. completeproportion().then(res => {
  159. if (res.code == 200) {
  160. var myChart = echarts.init(
  161. document.getElementById("foot-left-content")
  162. );
  163. var option = {
  164. title: {
  165. text: "",
  166. subtext: "",
  167. left: ""
  168. },
  169. tooltip: {
  170. trigger: "item",
  171. formatter: "{a} <br/>{b} : {c} ({d}%)"
  172. },
  173. color: ["#5470c6", "#fac858", "#ee6666", "#91cc75"],
  174. legend: {
  175. orient: "vertical",
  176. right: "0",
  177. top: "10%",
  178. itemGap: 20,
  179. textStyle: {
  180. color: "#fff"
  181. },
  182. data: ["待处理", "待验收", "未通过", "已通过"]
  183. },
  184. series: [
  185. {
  186. name: "",
  187. type: "pie",
  188. radius: "80%",
  189. label: {
  190. normal: {
  191. show: true,
  192. position: "inner",
  193. formatter: "{c}", //\n({d}%)
  194. textStyle: {
  195. fontWeight: 300,
  196. fontSize: 16,
  197. color: "#fff"
  198. }
  199. }
  200. },
  201. data: [
  202. {
  203. value:
  204. res.data[0].daiyanshou == 0
  205. ? null
  206. : res.data[0].daiyanshou,
  207. name: "待验收"
  208. },
  209. {
  210. value:
  211. res.data[0].daichuli == 0 ? null : res.data[0].daichuli,
  212. name: "待处理"
  213. },
  214. {
  215. value:
  216. res.data[0].weitongguo == 0
  217. ? null
  218. : res.data[0].weitongguo,
  219. name: "未通过"
  220. },
  221. {
  222. value:
  223. res.data[0].yitongguo == 0 ? null : res.data[0].yitongguo,
  224. name: "已通过"
  225. }
  226. ],
  227. emphasis: {
  228. itemStyle: {
  229. shadowBlur: 10,
  230. shadowOffsetX: 0,
  231. shadowColor: "rgba(0, 0, 0, 0.5)"
  232. }
  233. },
  234. itemStyle: {
  235. normal: {
  236. //饼状图阴影,值越大阴影亮度越高
  237. shadowBlur: 5,
  238. shadowColor: "#93DDFF"
  239. }
  240. }
  241. }
  242. ]
  243. };
  244. if (
  245. res.data[0].daiyanshou == 0 &&
  246. res.data[0].daichuli == 0 &&
  247. res.data[0].weitongguo == 0 &&
  248. res.data[0].yitongguo == 0
  249. ) {
  250. option.color = ["#255F8A"];
  251. option.tooltip = {
  252. show: false
  253. };
  254. option.series[0].data = [{ value: 0, name: "无" }];
  255. }
  256. myChart.setOption(option);
  257. }
  258. });
  259. },
  260. getlist4() {},
  261. echarfun() {
  262. unitproportion().then(res => {
  263. if (res.code == 200) {
  264. this.peopleList3 = res.data;
  265. console.log(res.data);
  266. var roseCharts = document.getElementsByClassName("block");
  267. for (var i = 0; i < this.peopleList3.length; i++) {
  268. var myChart = echarts.init(roseCharts[i]);
  269. var option = {
  270. title: {
  271. text: this.peopleList3[i].name,
  272. subtext: "",
  273. // left: "",
  274. y: "bottom",
  275. x: "center",
  276. padding: 0,
  277. textStyle: {
  278. color: "#ffff",
  279. // fontSize: 12,
  280. fontStyle: "normal",
  281. fontWeight: "normal"
  282. }
  283. },
  284. color: ["#5470c6", "#fac858", "#ee6666", "#91cc75"],
  285. tooltip: {
  286. trigger: "item",
  287. formatter: "{a} <br/>{b} : {c} ({d}%)"
  288. },
  289. // legend: {
  290. // orient: "vertical",
  291. // right: "0",
  292. // top: "3%",
  293. // itemGap: 5,
  294. // textStyle: {
  295. // color: "#fff"
  296. // },
  297. // data: ["待处理", "待验收", "未通过", "已通过"]
  298. // },
  299. series: [
  300. {
  301. name: "",
  302. type: "pie",
  303. radius: "60%",
  304. center: ["50%", "50%"],
  305. label: {
  306. normal: {
  307. show: true,
  308. position: "inner",
  309. formatter: "{c}", //\n({d}%)
  310. textStyle: {
  311. fontWeight: 300,
  312. fontSize: 16,
  313. color: "#fff"
  314. }
  315. }
  316. },
  317. data: [
  318. {
  319. value:
  320. this.peopleList3[i].daiyanshou == 0
  321. ? null
  322. : this.peopleList3[i].daiyanshou,
  323. name: "待验收",
  324. id: this.peopleList3[i].deptId
  325. },
  326. {
  327. value:
  328. this.peopleList3[i].daichuli == 0
  329. ? null
  330. : this.peopleList3[i].daichuli,
  331. name: "待处理",
  332. id: this.peopleList3[i].deptId
  333. },
  334. {
  335. value:
  336. this.peopleList3[i].weitongguo == 0
  337. ? null
  338. : this.peopleList3[i].weitongguo,
  339. name: "未通过",
  340. id: this.peopleList3[i].deptId
  341. },
  342. {
  343. value:
  344. this.peopleList3[i].yitongguo == 0
  345. ? null
  346. : this.peopleList3[i].yitongguo,
  347. name: "已通过",
  348. id: this.peopleList3[i].deptId
  349. }
  350. ],
  351. emphasis: {
  352. itemStyle: {
  353. shadowBlur: 10,
  354. shadowOffsetX: 0,
  355. shadowColor: "rgba(0, 0, 0, 0.5)"
  356. }
  357. },
  358. itemStyle: {
  359. normal: {
  360. //饼状图阴影,值越大阴影亮度越高
  361. shadowBlur: 5,
  362. shadowColor: "#93DDFF"
  363. }
  364. }
  365. }
  366. ]
  367. };
  368. if (
  369. this.peopleList3[i].daiyanshou == 0 &&
  370. this.peopleList3[i].daichuli == 0 &&
  371. this.peopleList3[i].weitongguo == 0 &&
  372. this.peopleList3[i].yitongguo == 0
  373. ) {
  374. option.color = ["#255F8A"];
  375. option.tooltip = {
  376. show: false
  377. };
  378. option.series[0].data = [{ value: 0, name: "无" }];
  379. }
  380. myChart.setOption(option);
  381. myChart.on("click", this.eConsole);
  382. }
  383. }
  384. });
  385. },
  386. rowclick(row) {
  387. console.log(row.inspectedUnitId);
  388. this.$router
  389. .push({
  390. path: "/bdglregular/regularinfo",
  391. query: { id: row.inspectedUnitId }
  392. })
  393. .catch(() => {});
  394. },
  395. //饼状图点击事件
  396. eConsole(param) {
  397. // console.log(param.data);
  398. this.$router
  399. .push({
  400. path: "/bdglregular/regularinfo",
  401. query: { obj: param.data }
  402. })
  403. .catch(() => {});
  404. }
  405. }
  406. };
  407. </script>
  408. <style scoped>
  409. .wrap {
  410. min-height: calc(100vh - 85px);
  411. width: 100%;
  412. position: relative;
  413. overflow: hidden;
  414. background-color: #103360;
  415. margin: 0;
  416. padding: 0;
  417. display: flex;
  418. flex-direction: column;
  419. }
  420. .head {
  421. width: 100%;
  422. /* height: 43.5vh; */
  423. flex: 1;
  424. display: flex;
  425. flex-direction: row;
  426. margin-top: 10px;
  427. margin-bottom: 10px;
  428. }
  429. .head-left {
  430. flex: 4;
  431. height: 44vh;
  432. background-image: url("../../../assets/images/底 拷贝 3.png");
  433. background-repeat: no-repeat;
  434. background-size: 100% 100%;
  435. margin-left: 10px;
  436. margin-right: 10px;
  437. }
  438. .head-right {
  439. flex: 6;
  440. height: 44vh;
  441. background-image: url("../../../assets/images/底 拷贝 3.png");
  442. background-repeat: no-repeat;
  443. background-size: 100% 100%;
  444. margin-right: 10px;
  445. }
  446. .head-left-title {
  447. width: 96%;
  448. height: 30px;
  449. font-size: 18px;
  450. color: #fff;
  451. background-image: url("../../../assets/images/组 21.png");
  452. background-repeat: no-repeat;
  453. margin-top: 9px;
  454. line-height: 30px;
  455. position: relative;
  456. margin-left: 1%;
  457. }
  458. .head-left-title span {
  459. position: absolute;
  460. left: 36px;
  461. }
  462. ::v-deep .el-table__empty-block {
  463. background-color: #0c2c50;
  464. }
  465. .foot {
  466. width: 100%;
  467. /* height: 45vh; */
  468. flex: 1;
  469. display: flex;
  470. flex-direction: row;
  471. margin-bottom: 10px;
  472. }
  473. .foot-left {
  474. flex: 4;
  475. height: 43.5vh;
  476. background-image: url("../../../assets/images/底 拷贝 3.png");
  477. background-repeat: no-repeat;
  478. background-size: 100% 100%;
  479. margin-left: 10px;
  480. margin-right: 10px;
  481. }
  482. .foot-right {
  483. flex: 6;
  484. height: 43.5vh;
  485. background-image: url("../../../assets/images/底 拷贝 3.png");
  486. background-repeat: no-repeat;
  487. background-size: 100% 100%;
  488. margin-right: 10px;
  489. }
  490. .foot-right-main {
  491. width: 100%;
  492. height: 100%;
  493. }
  494. .foot-right-main .block {
  495. width: 20%;
  496. height: 42%;
  497. margin: 0;
  498. display: inline-block;
  499. }
  500. #foot-left-content {
  501. width: 90%;
  502. height: 380px;
  503. }
  504. </style>