index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  1. <template>
  2. <div class="personView">
  3. <dv-full-screen-container>
  4. <div class="topView" style="width: 100%;height: 11%;">
  5. <div class="jbd-title">
  6. <dv-decoration-8 style="width:20%;height:50px;position: absolute;left: 0px;top: 0px;" />
  7. <div style="width:100%">
  8. <div style="height:40%;font-size: 22px;margin-top: 10px;">人员管理看板</div>
  9. <dv-decoration-5 style="width:30%;height: 50%;margin: 0 auto;" />
  10. </div>
  11. <dv-decoration-8 :reverse="true" style="width:20%;height:50px;position:absolute;right: 0px;top: 0px;" />
  12. </div>
  13. <div class="contain">
  14. <!-- <div class="personNum">员工数量:{{ employeeNum }}</div> -->
  15. <dv-decoration-11 class="personNum" style="margin-left:10%"><i class="el-icon-user" style="color:#4ea5d6;margin-right: 3px;"></i> 员工数量:{{ employeeNum }}人</dv-decoration-11>
  16. <dv-border-box-8 class="date" style="margin-right:10%; display: flex; align-items: center;">
  17. <div style="width:25%;display: inline-block;margin-right: 3px;">统计时间:</div>
  18. <el-date-picker style="width:75%;" v-model="monthValues" type="monthrange" align="right" unlink-panels range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" :picker-options="pickerOptions" @change="changeDate">
  19. </el-date-picker>
  20. </dv-border-box-8>
  21. <div style="width:80px;position: fixed;top:27px;right:-20px;z-index:999;cursor: pointer;" @click.prevent="goBack()">
  22. <i class="el-icon-d-arrow-left"></i> 返回
  23. </div>
  24. </div>
  25. </div>
  26. <dv-border-box-1 style="width:100%;height:89%; box-sizing: border-box; overflow: hidden;">
  27. <div style="height:3%"></div>
  28. <!-- <dv-decoration-10 style="height:2%;width:100%;" /> -->
  29. <div class="middleView">
  30. <div class="viewLeft">
  31. <pieView v-if="degreePieData.data[0].value" :info="degreePieData" />
  32. </div>
  33. <dv-decoration-2 :reverse="true" style="width:2%;height: 100%;" />
  34. <div class="viewCenter">
  35. <RingChart v-if="ranksPieData.data[2].value" :info="ranksPieData" />
  36. </div>
  37. <dv-decoration-2 :reverse="true" style="width:2%;height: 100%;" />
  38. <div class="viewRight">
  39. <CarouselTabl v-if="personInfoData.data.length" :info="personInfoData" title="员工基本信息列表" />
  40. </div>
  41. </div>
  42. <dv-decoration-10 style="height:2%;width:96%; margin: 0 auto;" />
  43. <div class="bottomView">
  44. <div class="detectionTask">
  45. <!-- <div id="echart-line" :style="{ width: '100%', height: '100%', paddingRight: '10px' }"></div> -->
  46. <BarChart v-if="this.option.yAxis.data[0]" :info="option" :config="{title:'检测任务统计',id:'textJob'}" />
  47. </div>
  48. <dv-decoration-2 :reverse="true" style="width:2%;height: 100%;" />
  49. <div class="taskMatters">
  50. <BarChart v-if="optionPersonShow" :info="optionPerson" :config="{title:'任务事宜统计',id:'taskMatters'}" />
  51. </div>
  52. <!-- <dv-decoration-2 :reverse="true" style="width:2%;height: 100%;" /> -->
  53. <!-- <el-dialog :visible.sync="dialogTableVisible">
  54. <div class="dialogbox">
  55. <div class="jbd-title-cont"> {{ setParams.seriesName }}-{{ setParams.name }} </div>
  56. <div class="ibps">
  57. <ibps-crud key="istree" ref="crud" :data="formDataFiiter" :toolbars="listConfig.toolbars" :search-form="listConfig.searchForm" :pk-key="pkKey" :columns="listConfig.columns" :loading="loading" @action-event="handleAction" :pagination="pagination" @pagination-change="handlePaginationChange">
  58. <template slot="jianceyuan" slot-scope="scope">
  59. <ibps-user-selector :value="scope.row.jian_ce_yuan_" type="user" :multiple="true" :disabled="true" readonly-text="text" @callback="data => formId = data.id" />
  60. </template>
  61. <template slot="fuheyuan" slot-scope="scope">
  62. <ibps-user-selector :value="scope.row.fu_he_yuan_" type="user" :multiple="true" :disabled="true" readonly-text="text" @callback="data => formId = data.id" />
  63. </template>
  64. </ibps-crud>
  65. </div>
  66. </div>
  67. </el-dialog> -->
  68. </div>
  69. </dv-border-box-1>
  70. </dv-full-screen-container>
  71. </div>
  72. </template>
  73. <script>
  74. import * as echarts from "echarts";
  75. import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
  76. import IbpsUserSelector from "@/business/platform/org/selector";
  77. import pieView from "@/views/system/jbdHome/board/component/getPieView";
  78. import CarouselTabl from "@/views/system/jbdHome/board/component/CarouselTabl";
  79. // import { pending, handledTask } from '@/api/platform/office/bpmReceived'
  80. // import { queryPageList } from '@/api/platform/bpmn/bpmTask'
  81. import screenfull from "screenfull";
  82. import { sync } from "@/api/platform/mail/outMail";
  83. import data from "@/components/ibps-icon-select/data";
  84. export default {
  85. name: "checkBoard1",
  86. components: {
  87. "ibps-user-selector": IbpsUserSelector,
  88. pieView,
  89. CarouselTabl,
  90. RingChart: () => import("../personComcont/RingChart"),
  91. BarChart: () => import("../personComcont/BarChart"),
  92. },
  93. props: {},
  94. data() {
  95. return {
  96. pkKey: "id", // 主键 如果主键不是pk需要传主键
  97. pickerOptions: {
  98. shortcuts: [
  99. {
  100. text: "本月",
  101. onClick(picker) {
  102. const start = new Date();
  103. start.setDate(1);
  104. picker.$emit("pick", [start, new Date()]);
  105. },
  106. },
  107. {
  108. text: "今年至今",
  109. onClick(picker) {
  110. const end = new Date();
  111. const start = new Date(new Date().getFullYear(), 0);
  112. picker.$emit("pick", [start, end]);
  113. },
  114. },
  115. {
  116. text: "最近六个月",
  117. onClick(picker) {
  118. const end = new Date();
  119. const start = new Date();
  120. start.setMonth(start.getMonth() - 6);
  121. start.setDate(1);
  122. picker.$emit("pick", [start, end]);
  123. },
  124. },
  125. ],
  126. },
  127. monthValues: [],
  128. dialogTableVisible: false,
  129. getchart: null,
  130. option: {
  131. title: {
  132. text: "",
  133. },
  134. textAlign: "left",
  135. tooltip: {
  136. trigger: "axis",
  137. axisPointer: {
  138. type: "shadow",
  139. },
  140. },
  141. legend: {
  142. // show: true,
  143. right: "0%",
  144. itemGap: 2,
  145. itemWidth: 16,
  146. textStyle: {
  147. color: "#fff",
  148. },
  149. },
  150. grid: {
  151. left: "2%",
  152. right: "10%",
  153. bottom: "3%",
  154. containLabel: true,
  155. },
  156. xAxis: {
  157. type: "value",
  158. name: "任务数量",
  159. nameTextStyle: {
  160. color: "#fff",
  161. },
  162. axisLabel: {
  163. formatter: function (v) {
  164. return parseInt(v); //表示整数。其他数值类型以此类推
  165. },
  166. color: "#fff",
  167. },
  168. },
  169. yAxis: {
  170. type: "category",
  171. name: "检测人员",
  172. data: [],
  173. color: "#ffffff",
  174. axisLabel: {
  175. color: "#fff",
  176. },
  177. nameTextStyle: {
  178. color: "#fff",
  179. },
  180. },
  181. series: [
  182. {
  183. name: "检测未完成数",
  184. type: "bar",
  185. data: [],
  186. label: {
  187. show: true,
  188. position: "right",
  189. valueAnimation: true,
  190. color: "#ffff00",
  191. },
  192. itemStyle: {
  193. normal: {
  194. color: ["#CC0000"],
  195. },
  196. },
  197. },
  198. {
  199. name: "检测已完成数",
  200. type: "bar",
  201. data: [],
  202. label: {
  203. show: true,
  204. position: "right",
  205. valueAnimation: true,
  206. },
  207. itemStyle: {
  208. normal: {
  209. color: ["#99cc00"],
  210. },
  211. },
  212. },
  213. {
  214. name: "复核未完成数",
  215. type: "bar",
  216. data: [],
  217. label: {
  218. show: true,
  219. position: "right",
  220. valueAnimation: true,
  221. },
  222. itemStyle: {
  223. normal: {
  224. color: ["#FFFF00"],
  225. },
  226. },
  227. },
  228. {
  229. name: "复核已完成数",
  230. type: "bar",
  231. data: [],
  232. label: {
  233. show: true,
  234. position: "right",
  235. valueAnimation: true,
  236. },
  237. itemStyle: {
  238. normal: {
  239. color: ["#7070ff"],
  240. },
  241. },
  242. },
  243. ],
  244. dataZoom: [
  245. {
  246. type: "inside",
  247. xAxisIndex: 0,
  248. filterMode: "filter",
  249. },
  250. {
  251. type: "inside",
  252. left: "left",
  253. yAxisIndex: 0,
  254. filterMode: "none",
  255. },
  256. ],
  257. },
  258. optionPersonShow: false,
  259. optionPerson: {
  260. title: {
  261. text: "",
  262. },
  263. textAlign: "left",
  264. tooltip: {
  265. trigger: "axis",
  266. axisPointer: {
  267. type: "shadow",
  268. },
  269. },
  270. legend: {
  271. // show: true,
  272. right: "0%",
  273. itemGap: 2,
  274. itemWidth: 16,
  275. textStyle: {
  276. color: "#fff",
  277. },
  278. },
  279. grid: {
  280. left: "2%",
  281. right: "10%",
  282. bottom: "3%",
  283. containLabel: true,
  284. },
  285. xAxis: {
  286. type: "value",
  287. name: "任务数量",
  288. nameTextStyle: {
  289. color: "#fff",
  290. },
  291. axisLabel: {
  292. formatter: function (v) {
  293. return parseInt(v); //表示整数。其他数值类型以此类推
  294. },
  295. color: "#fff",
  296. },
  297. },
  298. yAxis: {
  299. type: "category",
  300. name: "人员",
  301. data: [],
  302. axisLabel: {
  303. color: "#fff",
  304. },
  305. nameTextStyle: {
  306. color: "#fff",
  307. },
  308. },
  309. series: [
  310. {
  311. name: "待办事宜数",
  312. type: "bar",
  313. data: [],
  314. label: {
  315. show: true,
  316. position: "right",
  317. valueAnimation: true,
  318. },
  319. itemStyle: {
  320. normal: {
  321. color: ["#7070ff"],
  322. },
  323. },
  324. },
  325. {
  326. name: "已办事宜数",
  327. type: "bar",
  328. data: [],
  329. label: {
  330. show: true,
  331. position: "right",
  332. valueAnimation: true,
  333. },
  334. itemStyle: {
  335. normal: {
  336. color: ["#00CC33"],
  337. },
  338. },
  339. },
  340. {
  341. name: "逾期未完成数",
  342. type: "bar",
  343. data: [],
  344. label: {
  345. show: true,
  346. position: "right",
  347. valueAnimation: true,
  348. },
  349. itemStyle: {
  350. normal: {
  351. color: ["#faff72"],
  352. },
  353. },
  354. },
  355. ],
  356. dataZoom: [
  357. {
  358. type: "inside",
  359. xAxisIndex: 0,
  360. filterMode: "filter",
  361. },
  362. {
  363. type: "inside",
  364. left: "left",
  365. yAxisIndex: 0,
  366. filterMode: "none",
  367. },
  368. ],
  369. },
  370. setParams: {},
  371. formData: [],
  372. formDataFiiter: [],
  373. listConfig: {
  374. // 工具栏
  375. toolbars: [{ key: "search" }],
  376. // 查询条件
  377. searchForm: {
  378. forms: [
  379. { prop: "yang_pin_bian_hao", label: "样品编号" },
  380. { prop: "yang_pin_ming_che", label: "样品名称" },
  381. { prop: "yang_pin_lei_xing", label: "样品类型" },
  382. { prop: "shi_fou_he_ge_", label: "是否合格" },
  383. ],
  384. },
  385. // 表格字段配置
  386. columns: [
  387. { prop: "wei_tuo_lei_xing_", label: "委托类型" },
  388. { prop: "jian_ce_zhuang_ta", label: "检测状态" },
  389. { prop: "yang_pin_lei_xing", label: "样品类型" },
  390. { prop: "yang_pin_bian_hao", label: "样品编号" },
  391. { prop: "yang_pin_ming_che", label: "样品名称" },
  392. { prop: "ji_lu_bian_hao_", label: "记录编号" },
  393. { prop: "shi_fou_he_ge_", label: "是否合格" },
  394. { prop: "jian_ce_yuan_", label: "检测员", slotName: "jianceyuan" },
  395. { prop: "fu_he_yuan_", label: "复核员", slotName: "fuheyuan" },
  396. ],
  397. },
  398. startDate: "2023-03-01",
  399. endDate: "",
  400. chartData: [],
  401. pagination: { limit: 20, page: 1 },
  402. loading: false,
  403. degreePieData: {
  404. //学位学历
  405. data: [
  406. {
  407. name: "博士",
  408. value: 0,
  409. },
  410. {
  411. name: "硕士",
  412. value: 0,
  413. },
  414. {
  415. name: "本科",
  416. value: 0,
  417. },
  418. ],
  419. color: ["#FFFF00", "#99CC00", "#6666FF"],
  420. config: { title: "学历学位统计", idSelector: "degreeId" },
  421. },
  422. ranksPieData: {
  423. //职称
  424. data: [
  425. {
  426. name: "高级",
  427. value: 0,
  428. },
  429. {
  430. name: "中级",
  431. value: 0,
  432. },
  433. {
  434. name: "初级",
  435. value: 0,
  436. },
  437. {
  438. name: "其他",
  439. value: 0,
  440. },
  441. ],
  442. color: ["#FFFF00", "#99CC00", "#6666FF", "#FF6666"],
  443. config: { title: "职称统计", idSelector: "ranksid" },
  444. },
  445. personInfoData: {
  446. //员工基本信息轮播表
  447. header: ["姓名", "学历学位", "职称", "员工编号", "入职时间"],
  448. data: [],
  449. columnWidth: ["90", "90", "80", "120", "120"],
  450. rowNum: 7,
  451. align: "center",
  452. hoverPause: true,
  453. },
  454. employeeNum: 0,
  455. employeeInfo: [],
  456. };
  457. },
  458. computed: {},
  459. methods: {
  460. allView() {
  461. // 默认显示全屏
  462. screenfull.request();
  463. },
  464. goBack() {
  465. this.$router.back(-1);
  466. },
  467. async getTtaskMattersData() {
  468. let this_ = this;
  469. this.optionPersonShow = false;
  470. this_.optionPerson.yAxis.data = [];
  471. this_.optionPerson.series[0].data = [];
  472. this_.optionPerson.series[1].data = [];
  473. let create_by_ = "";
  474. let data = [];
  475. let csData = [];
  476. let yibanData1 = [];
  477. let yibanData2 = [];
  478. let personIds = "";
  479. for (let item of this.employeeInfo) {
  480. create_by_ += create_by_ + "," + item.id_;
  481. }
  482. create_by_ = create_by_.slice(0, create_by_.length - 1);
  483. let sql = `select executor_,count(executor_) as num ,c.name_ FROM IBPS_BPM_TASKS as a join IBPS_BPM_TASK_ASSIGN as b on a.task_id_ = b.task_id_ join ibps_party_employee as c on b.executor_ = c.id_ and c.STATUS_= 'actived' and c.ID_ != '1' and c.ID_ != '-1' and c.ID_ != '702117247933480960' and c.GROUP_ID_ not like '%1041786072788369408%' GROUP BY executor_ order by c.CREATE_TIME_ asc `;
  484. await curdPost("sql", sql).then((res) => {
  485. data = res.variables.data;
  486. });
  487. for (let item of data) {
  488. this_.optionPerson.yAxis.data.push(item.name_);
  489. this_.optionPerson.series[0].data.push(item.num);
  490. }
  491. //超时
  492. let cssql = `select executor_ ,count(executor_) as num ,c.name_,a.create_time_ FROM IBPS_BPM_TASKS as a join IBPS_BPM_TASK_ASSIGN as b on a.task_id_ = b.task_id_ join ibps_party_employee as c on b.executor_ = c.id_
  493. where now()> SUBDATE(a.create_time_,interval - 3 day) and c.STATUS_= 'actived' and c.ID_ != '1' and c.ID_ != '-1' and c.ID_ != '702117247933480960' and c.GROUP_ID_ not like '%1041786072788369408%' GROUP BY executor_ order by c.CREATE_TIME_ asc `;
  494. await curdPost("sql", cssql).then((res) => {
  495. csData = res.variables.data;
  496. });
  497. for (let it of csData) {
  498. this_.optionPerson.series[2].data.push(it.num);
  499. personIds += "'" + it.executor_ + "',";
  500. }
  501. personIds = personIds.slice(0, personIds.length - 1);
  502. let yibansql1 = `select count(AUDITOR_) as num,AUDITOR_,name_,STATUS_,CREATE_TIME_ from (select a.AUDITOR_,b.name_,a.STATUS_,b.CREATE_TIME_ from IBPS_BPM_APPROVAL as a join ibps_party_employee as b on a.AUDITOR_ = b.id_
  503. where a.CREATE_TIME_ > '${this.startDate}' and a.CREATE_TIME_ < '${this.endDate}' and b.id_ in(${personIds}) group by a.PROC_inst_ID_) as zz group by AUDITOR_ order by CREATE_TIME_ asc `;
  504. await curdPost("sql", yibansql1).then((res) => {
  505. yibanData1 = res.variables.data;
  506. });
  507. let yibansql2 = `select count(AUDITOR_) as num,AUDITOR_,name_,STATUS_,CREATE_TIME_ from (select a.PROC_inst_ID_,b.name_,a.AUDITOR_,a.STATUS_,b.CREATE_TIME_ from IBPS_BPM_APPROVAL_HIS as a join ibps_party_employee as b on a.AUDITOR_ = b.id_
  508. where a.CREATE_TIME_ > '${this.startDate}' and a.CREATE_TIME_ < '${this.endDate}' and b.id_ in(${personIds}) group by a.PROC_inst_ID_) as bb group by AUDITOR_ order by CREATE_TIME_ asc `;
  509. await curdPost("sql", yibansql2).then((res) => {
  510. yibanData2 = res.variables.data;
  511. });
  512. for (let items of yibanData1) {
  513. for (let el of yibanData2) {
  514. if (items.AUDITOR_ == el.AUDITOR_) {
  515. this_.optionPerson.series[1].data.push(
  516. Number(items.num) + Number(el.num)
  517. );
  518. }
  519. }
  520. }
  521. this.optionPersonShow = true;
  522. },
  523. // initChart() {
  524. // this.getchart = echarts.init(document.getElementById("echart-line"));
  525. // // document.getElementById("echart-line").setAttribute("_echarts_instance_", "");
  526. // this.getchart.setOption(this.option);
  527. // // //随着屏幕大小调节图表
  528. // // window.addEventListener("resize", () => {
  529. // // this.getchart.resize();
  530. // // });
  531. // // this.getchart.on("click", (params) => {
  532. // // this.pagination = { limit: 20, page: 1 };
  533. // // this.dialogTableVisible = true;
  534. // // this.setParams["dataIndex"] = params.dataIndex;
  535. // // this.setParams["name"] = params.name;
  536. // // switch (params.seriesName) {
  537. // // case "检测未完成数":
  538. // // this.setParams["seriesName"] = "未完成检测项目情况";
  539. // // break;
  540. // // case "检测已完成数":
  541. // // this.setParams["seriesName"] = "已完成检测项目情况";
  542. // // break;
  543. // // case "复核未完成数":
  544. // // this.setParams["seriesName"] = "未完成复核项目情况";
  545. // // break;
  546. // // case "复核已完成数":
  547. // // this.setParams["seriesName"] = "已完成复核项目情况";
  548. // // break;
  549. // // default:
  550. // // break;
  551. // // }
  552. // // this.formLoading();
  553. // // });
  554. // },
  555. /**
  556. * 处理按钮事件
  557. */
  558. handleAction(command, position, selection, data) {
  559. switch (command) {
  560. case "search": // 查询
  561. const params = this.$refs["crud"]
  562. ? this.$refs["crud"].getSearcFormData()
  563. : {};
  564. this.formLoading();
  565. break;
  566. default:
  567. break;
  568. }
  569. },
  570. /**
  571. * 处理分页事件
  572. */
  573. handlePaginationChange(page) {
  574. this.pagination = page;
  575. this.paginationFunc(this.formData);
  576. },
  577. // 图表数据加载
  578. async chartLoading() {
  579. // 获取所有检测人员任务统计
  580. let this_ = this;
  581. const sql = `select *FROM (SELECT ie.ID_ AS jcId,ie.NAME_ AS jcName,COUNT(tj.zhuang_tai_ = '待数据输入' OR NULL) AS jianCeWeiWanCheng,COUNT(tj.zhuang_tai_ = '待数据校验' OR tj.zhuang_tai_ = '已完成' OR NULL) AS jianCeYiWanCheng FROM
  582. t_lhjczb tj,ibps_party_employee ie
  583. WHERE ie.positions_ like '%1040709034740547584%' and tj.jian_ce_yuan_ = ie.ID_ AND tj.update_time_ BETWEEN '${this.startDate}' AND '${this.endDate}' GROUP BY jian_ce_yuan_
  584. ) jc LEFT JOIN
  585. (
  586. SELECT ie.ID_ AS fhId,ie.NAME_ AS fhName,COUNT(tj.zhuang_tai_ = '待数据校验' OR NULL) AS fuHeWeiWanCheng,COUNT(tj.zhuang_tai_ = '已完成' OR NULL) AS fuHeYiWanCheng FROM
  587. t_lhjczb tj,ibps_party_employee ie
  588. WHERE ie.positions_ like '%1040709034740547584%' and tj.fu_he_yuan_ = ie.ID_ AND tj.update_time_ BETWEEN '${this.startDate}' AND '${this.endDate}' GROUP BY fu_he_yuan_
  589. ) fh ON jc.jcName = fh.fhName
  590. UNION (
  591. SELECT *FROM (SELECT ie.ID_ AS jcId, ie.NAME_ AS jcName,COUNT(tj.zhuang_tai_ = '待数据输入' OR NULL) AS jianCeWeiWanCheng,COUNT(tj.zhuang_tai_ = '待数据校验' OR tj.zhuang_tai_ = '已完成' OR NULL) AS jianCeYiWanCheng FROM
  592. t_lhjczb tj,ibps_party_employee ie
  593. WHERE tj.jian_ce_yuan_ = ie.ID_ AND tj.update_time_ BETWEEN '${this.startDate}' AND '${this.endDate}' GROUP BY jian_ce_yuan_
  594. ) jc RIGHT JOIN
  595. (
  596. SELECT ie.ID_ AS fhId,ie.NAME_ AS fhName,COUNT(tj.zhuang_tai_ = '待数据校验' OR NULL) AS fuHeWeiWanCheng,COUNT(tj.zhuang_tai_ = '已完成' OR NULL) AS fuHeYiWanCheng FROM
  597. t_lhjczb tj,ibps_party_employee ie
  598. WHERE ie.positions_ like '%1040709034740547584%' and tj.fu_he_yuan_ = ie.ID_ AND tj.update_time_ BETWEEN '${this.startDate}' AND '${this.endDate}' GROUP BY fu_he_yuan_
  599. ) fh ON jc.jcName = fh.fhName
  600. )`;
  601. // console.log(sql,"sql")
  602. this.option.yAxis.data = [];
  603. this.option.series[0].data = [];
  604. this.option.series[1].data = [];
  605. this.option.series[2].data = [];
  606. this.option.series[3].data = [];
  607. this.chartData = [];
  608. await curdPost("sql", sql)
  609. .then((res) => {
  610. const data = res.variables.data;
  611. for (let i of data) {
  612. this_.option.yAxis.data.push(i.jcName ? i.jcName : i.fhName);
  613. // 检测未完成数
  614. this_.option.series[0].data.push(
  615. i.jianCeWeiWanCheng ? i.jianCeWeiWanCheng : 0
  616. );
  617. // 检测已完成数
  618. this_.option.series[1].data.push(
  619. i.jianCeYiWanCheng ? i.jianCeYiWanCheng : 0
  620. );
  621. // 复核未完成数
  622. this_.option.series[2].data.push(
  623. i.fuHeWeiWanCheng ? i.fuHeWeiWanCheng : 0
  624. );
  625. // 复核已完成数
  626. this_.option.series[3].data.push(
  627. i.fuHeYiWanCheng ? i.fuHeYiWanCheng : 0
  628. );
  629. this_.chartData.push(i);
  630. }
  631. })
  632. .catch((error) => {
  633. console.log(error);
  634. });
  635. },
  636. formLoading() {
  637. this.loading = true;
  638. let formsql = `select zhuang_tai_,fu_jian_,yang_pin_bian_hao,yang_pin_ming_che,shi_fou_he_ge_,
  639. ji_lu_bian_hao_,wei_tuo_lei_xing_,jian_ce_yuan_,fu_he_yuan_,yang_pin_lei_xing FROM t_lhjczb
  640. where update_time_ BETWEEN '${this.startDate}' AND '${this.endDate}' and `;
  641. let sql = "";
  642. const params = this.$refs["crud"]
  643. ? this.$refs["crud"].getSearcFormData()
  644. : {};
  645. // console.log("params:", params)
  646. switch (this.setParams.seriesName) {
  647. case "未完成检测项目情况":
  648. sql =
  649. formsql +
  650. `zhuang_tai_ = '待数据输入' and jian_ce_yuan_='${
  651. this.chartData[this.setParams.dataIndex].jcId
  652. }'`;
  653. break;
  654. case "已完成检测项目情况":
  655. sql =
  656. formsql +
  657. `(zhuang_tai_ = '待数据校验' or zhuang_tai_ = '已完成') and jian_ce_yuan_='${
  658. this.chartData[this.setParams.dataIndex].jcId
  659. }'`;
  660. break;
  661. case "未完成复核项目情况":
  662. sql =
  663. formsql +
  664. `zhuang_tai_ = '待数据校验' and fu_he_yuan_='${
  665. this.chartData[this.setParams.dataIndex].fhId
  666. }'`;
  667. break;
  668. case "已完成复核项目情况":
  669. sql =
  670. formsql +
  671. `zhuang_tai_ = '已完成' and fu_he_yuan_='${
  672. this.chartData[this.setParams.dataIndex].fhId
  673. }'`;
  674. break;
  675. default:
  676. break;
  677. }
  678. sql =
  679. sql +
  680. `${
  681. params.yang_pin_lei_xing
  682. ? ` and yang_pin_lei_xing like '%${params.yang_pin_lei_xing}%'`
  683. : ``
  684. }`;
  685. sql =
  686. sql +
  687. `${
  688. params.shi_fou_he_ge_
  689. ? ` and shi_fou_he_ge_ like '%${params.shi_fou_he_ge_}%'`
  690. : ``
  691. }`;
  692. sql =
  693. sql +
  694. `${
  695. params.yang_pin_bian_hao
  696. ? ` and yang_pin_bian_hao like '%${params.yang_pin_bian_hao}%'`
  697. : ``
  698. }`;
  699. sql =
  700. sql +
  701. `${
  702. params.yang_pin_ming_che
  703. ? ` and yang_pin_ming_che like '%${params.yang_pin_ming_che}%'`
  704. : ``
  705. }`;
  706. curdPost("sql", sql)
  707. .then((res) => {
  708. this.loading = false;
  709. const data = res.variables.data;
  710. this.formData = res.variables.data;
  711. document.getElementsByClassName(
  712. "el-pagination__rightwrapper"
  713. )[0].style.display = "none";
  714. this.paginationFunc(res.variables.data);
  715. })
  716. .catch((error) => {
  717. console.log(error);
  718. this.loading = false;
  719. });
  720. },
  721. /**
  722. * 数据分页
  723. * par:[]
  724. * pagination: { limit: 20, page: 1 },
  725. */
  726. paginationFunc(par) {
  727. this.formDataFiiter = [];
  728. for (
  729. var i =
  730. this.pagination.limit * this.pagination.page - this.pagination.limit;
  731. i < this.pagination.limit * this.pagination.page;
  732. i++
  733. ) {
  734. if (i < this.formData.length) {
  735. this.formDataFiiter.push(this.formData[i]);
  736. }
  737. }
  738. },
  739. changeDate(value) {
  740. let year = value[1].getFullYear();
  741. let month = value[1].getMonth() + 1;
  742. // 这里传入的是整数时间,返回的是下个月的第一天,因为月份是0-11
  743. let nextMonthFirthDay = new Date(year, month, 1); // 下个月的第一天
  744. let oneDay = 1000 * 60 * 60 * 24; // 一天的时间毫秒数
  745. let endDay = new Date(nextMonthFirthDay - oneDay);
  746. let day = endDay.getDate(); // 本月最后一天
  747. this.endDate =
  748. value[1].getFullYear() +
  749. "-" +
  750. (value[1].getMonth() + 1 > 9
  751. ? value[1].getMonth() + 1
  752. : "0" + (value[1].getMonth() + 1)) +
  753. "-" +
  754. (day > 9 ? day : "0" + day);
  755. this.startDate =
  756. value[0].getFullYear() +
  757. "-" +
  758. (value[0].getMonth() + 1 > 9
  759. ? value[0].getMonth() + 1
  760. : "0" + (value[0].getMonth() + 1)) +
  761. "-" +
  762. (value[0].getDate() > 9
  763. ? value[0].getDate()
  764. : "0" + value[0].getDate());
  765. this.chartLoading();
  766. this.getTtaskMattersData();
  767. },
  768. //员工基本信息 轮播表数据
  769. async employeeInfoData() {
  770. let this_ = this;
  771. this.personInfoData.data = [];
  772. let data = [];
  773. let personInfo = [];
  774. // let ranksObj = {};
  775. let sql = `select a.id_,a.parent_id_,b.name_,a.zui_gao_xue_li_x_,a.zhi_cheng_deng_ji,b.jian_ding_zi_ge_z,a.ru_zhi_shi_jian_ from t_ryjbqk as a join ibps_party_employee as b on a.parent_id_= b.id_ where a.id_ !='861622496187645952'`;
  776. await curdPost("sql", sql).then((res) => {
  777. data = res.variables.data;
  778. });
  779. this.employeeInfo = data;
  780. this.employeeNum = data.length;
  781. for (let item of data) {
  782. personInfo = [];
  783. personInfo.push(item.name_);
  784. personInfo.push(item.zui_gao_xue_li_x_ || ` `);
  785. personInfo.push(item.zhi_cheng_deng_ji || ` `);
  786. personInfo.push(item.jian_ding_zi_ge_z || ` `);
  787. personInfo.push(item.ru_zhi_shi_jian_ || ` `);
  788. this.personInfoData.data.push(personInfo || ` `);
  789. }
  790. },
  791. //饼图 环形图数据
  792. async degreeGradeInfoData() {
  793. let data = [];
  794. let sql = `select
  795. sum(a.zui_gao_xue_li_x_ = '博士') as doctor,
  796. sum(a.zui_gao_xue_li_x_ = '硕士') as Master,
  797. sum(a.zui_gao_xue_li_x_ = '本科') as undergraduate,
  798. sum(a.zhi_cheng_deng_ji = '初级') as elementary,
  799. sum(a.zhi_cheng_deng_ji = '中级') as middleRank,
  800. sum(a.zhi_cheng_deng_ji = '高级') as senior,
  801. sum(a.zhi_cheng_deng_ji = ''||a.zhi_cheng_deng_ji is null) as other
  802. from t_ryjbqk as a join ibps_party_employee as b on a.parent_id_= b.id_ where b.id_ != '702117247933480960'`;
  803. await curdPost("sql", sql).then((res) => {
  804. data = res.variables.data;
  805. });
  806. this.degreePieData.data[0].value = data[0].doctor;
  807. this.degreePieData.data[1].value = data[0].Master;
  808. this.degreePieData.data[2].value = data[0].undergraduate;
  809. this.ranksPieData.data[0].value = data[0].senior;
  810. this.ranksPieData.data[1].value = data[0].middleRank;
  811. this.ranksPieData.data[2].value = data[0].elementary;
  812. this.ranksPieData.data[3].value = data[0].other;
  813. },
  814. preDate(dateParameter, num) {
  815. //往前推算日期
  816. var translateDate = "",
  817. dateString = "",
  818. monthString = "",
  819. dayString = "";
  820. translateDate = dateParameter.replace("-", "/").replace("-", "/");
  821. var newDate = new Date(translateDate);
  822. newDate = newDate.valueOf();
  823. newDate = newDate - num * 24 * 60 * 60 * 1000; //备注 如果是往前计算日期则为减号 否则为加号
  824. newDate = new Date(newDate); //如果月份长度少于2,则前加 0 补位
  825. if ((newDate.getMonth() + 1).toString().length == 1) {
  826. monthString = 0 + "" + (newDate.getMonth() + 1).toString();
  827. } else {
  828. monthString = (newDate.getMonth() + 1).toString();
  829. }
  830. if (newDate.getDate().toString().length == 1) {
  831. //如果天数长度少于2,则前加 0 补位
  832. dayString = 0 + "" + newDate.getDate().toString();
  833. 0;
  834. } else {
  835. dayString = newDate.getDate().toString();
  836. }
  837. dateString = newDate.getFullYear() + "-" + monthString + "-" + dayString;
  838. return dateString;
  839. },
  840. },
  841. created() {
  842. if (screenfull.isEnabled && !screenfull.isFullscreen) {
  843. this.allView();
  844. }
  845. const initendDate = new Date();
  846. this.endDate =
  847. initendDate.getFullYear() +
  848. "-" +
  849. (initendDate.getMonth() + 1 > 9
  850. ? initendDate.getMonth() + 1
  851. : "0" + (initendDate.getMonth() + 1)) +
  852. "-" +
  853. (initendDate.getDate() > 9
  854. ? initendDate.getDate()
  855. : "0" + initendDate.getDate());
  856. this.startDate = this.preDate(this.endDate, 60);
  857. this.monthValues = [
  858. new Date(this.startDate),
  859. new Date(
  860. initendDate.getFullYear() +
  861. "-" +
  862. (initendDate.getMonth() + 1) +
  863. "-" +
  864. initendDate.getDate()
  865. ),
  866. ];
  867. this.chartLoading();
  868. this.employeeInfoData();
  869. this.degreeGradeInfoData();
  870. this.getTtaskMattersData();
  871. },
  872. beforeDestroy() {
  873. if (screenfull.isFullscreen) {
  874. screenfull.toggle();
  875. }
  876. },
  877. mounted() {
  878. // this.initChart();
  879. },
  880. };
  881. </script>
  882. <style lang="less" scoped>
  883. .personView {
  884. width: 100%;
  885. height: 100vh;
  886. position: absolute;
  887. background-color: #030409;
  888. color: #fff;
  889. z-index: 999;
  890. }
  891. #dv-full-screen-container {
  892. background-image: url("~@/views/system/jbdHome/board/img/bg.png");
  893. background-size: 100% 100%;
  894. box-shadow: 0 0 3px blue;
  895. display: flex;
  896. flex-direction: column;
  897. }
  898. .topView {
  899. overflow: hidden;
  900. box-sizing: border-box;
  901. .jbd-title {
  902. text-align: center;
  903. font-weight: bold;
  904. // background-color: rgb(249, 255, 255);
  905. width: 100%;
  906. color: white;
  907. font-size: 18px;
  908. height: 50%;
  909. }
  910. .contain {
  911. width: 100%;
  912. height: 50%;
  913. display: flex;
  914. justify-content: space-between;
  915. // border-left: 1px solid #dfdcdc;
  916. color: white;
  917. .personNum {
  918. margin-left: 20px;
  919. width: 250px;
  920. }
  921. .date {
  922. text-align: right;
  923. // padding-right: 20px;
  924. display: flex;
  925. width: 300px;
  926. height: 80%;
  927. }
  928. /deep/.dv-border-box-8 .border-box-content {
  929. display: flex;
  930. align-items: center;
  931. padding: 0px 2px;
  932. }
  933. }
  934. }
  935. .middleView {
  936. height: 36%;
  937. width: 96%;
  938. margin: 0 auto;
  939. display: flex;
  940. justify-content: left;
  941. overflow: hidden;
  942. box-sizing: border-box;
  943. .viewLeft {
  944. width: 28%;
  945. height: 100%;
  946. overflow: hidden;
  947. box-sizing: border-box;
  948. }
  949. .viewCenter {
  950. width: 28%;
  951. height: 100%;
  952. overflow: hidden;
  953. box-sizing: border-box;
  954. }
  955. .viewRight {
  956. width: 40%;
  957. height: 100%;
  958. overflow: hidden;
  959. box-sizing: border-box;
  960. }
  961. }
  962. .bottomView {
  963. width: 96%;
  964. margin: 0 auto;
  965. height: 56%;
  966. // background: red;
  967. overflow: hidden;
  968. box-sizing: border-box;
  969. display: flex;
  970. .dialogbox {
  971. display: flex;
  972. flex-direction: column;
  973. }
  974. .detectionTask {
  975. width: 49%;
  976. height: 100%;
  977. }
  978. .taskMatters {
  979. width: 49%;
  980. height: 100%;
  981. }
  982. .ibps {
  983. top: 55px;
  984. border: 1px solid rgb(241, 238, 238);
  985. }
  986. // /deep/ .el-dialog {
  987. // height: 80%;
  988. // width: 80%;
  989. // }
  990. // /deep/ .el-dialog__header {
  991. // border: 0;
  992. // }
  993. // /deep/ .el-pagination__rightwrapper1 {
  994. // display: none;
  995. // }
  996. // /deep/ .ibps-container-crud__header {
  997. // margin-top: 55px;
  998. // }
  999. // /deep/ .el-dialog__headerbtn {
  1000. // z-index: 9999;
  1001. // }
  1002. }
  1003. </style>