index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  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
  7. style="
  8. width: 20%;
  9. height: 50px;
  10. position: absolute;
  11. left: 0px;
  12. top: 0px;
  13. "
  14. />
  15. <div style="width: 100%">
  16. <div
  17. style="
  18. height: 40%;
  19. font-size: 22px;
  20. margin-top: 10px;
  21. "
  22. >
  23. 室间质控看板
  24. </div>
  25. <dv-decoration-5
  26. style="width: 30%; height: 50%; margin: 0 auto"
  27. />
  28. </div>
  29. <dv-decoration-8
  30. :reverse="true"
  31. style="
  32. width: 20%;
  33. height: 50px;
  34. position: absolute;
  35. right: 0px;
  36. top: 0px;
  37. "
  38. />
  39. </div>
  40. <div class="contain">
  41. <div style="display: flex; text-align: center; height:38px; line-height: 38px;width: 25%;position: absolute; left: 3%;top:6%;">
  42. <div style="margin-right:10px;">选择年份</div>
  43. <yearrange st :year-values="yearValues" :size="size" :value-format="valueFormat" />
  44. </div>
  45. <div style="display: flex; text-align: center; height:38px; line-height: 38px;width: 25%;position: absolute; left: 33%;top:16%;z-index:1">
  46. <div style="margin-right:10px;">活动名称</div>
  47. <el-select v-model="activityValue" clearable filterable placeholder="请选择">
  48. <el-option
  49. v-for="item in activityList"
  50. :key="item.value"
  51. :label="item.value"
  52. :value="item.value"
  53. />
  54. </el-select>
  55. </div>
  56. <div
  57. style="width:12%; height:2.825rem; line-height:2.825rem; text-align:center;position: absolute; right: 3%; top:6%;color:white;"
  58. @click.prevent="goBack()"
  59. >
  60. <dv-border-box-8>返回</dv-border-box-8>
  61. </div>
  62. </div>
  63. </div>
  64. <dv-border-box-1
  65. style="
  66. width: 100%;
  67. height: 89%;
  68. box-sizing: border-box;
  69. overflow: hidden;
  70. "
  71. >
  72. <div style="height: 3%" />
  73. <div class="botView">
  74. <div class="viewTop">
  75. <div class="topleft">
  76. <topLeftChart :info="topLeftData" />
  77. </div>
  78. <dv-decoration-2
  79. :reverse="true"
  80. style="width: 2%; height: 100%"
  81. />
  82. <div class="topright">
  83. <topRightChart :info="topRightData" />
  84. </div>
  85. </div>
  86. <dv-decoration-10
  87. style="height: 2%; width: 100%; margin: 0 auto"
  88. />
  89. <div class="viewBot">
  90. <div class="botleft">
  91. <botChart :info="botLeftData" />
  92. </div>
  93. <dv-decoration-2
  94. :reverse="true"
  95. style="width: 2%; height: 100%"
  96. />
  97. <div class="botmidd">
  98. <botChart :info="botMiddData" />
  99. </div>
  100. <dv-decoration-2
  101. :reverse="true"
  102. style="width: 2%; height: 100%"
  103. />
  104. <div class="botright">
  105. <botChart :info="botRightData" />
  106. </div>
  107. </div>
  108. </div>
  109. </dv-border-box-1>
  110. </dv-full-screen-container>
  111. </div>
  112. </template>
  113. <script>
  114. import screenfull from 'screenfull'
  115. export default {
  116. components: {
  117. yearrange: () => import('../yearrange.vue'),
  118. topLeftChart: () => import('./topLeftChart.vue'),
  119. topRightChart: () => import('./topRightChart.vue'),
  120. botChart: () => import('./botChart.vue')
  121. },
  122. data () {
  123. return {
  124. yearArr: [],
  125. numArr: [],
  126. result: [],
  127. result1: [],
  128. result2: [],
  129. result3: [],
  130. list1: [],
  131. list2: [],
  132. list3: [],
  133. data1: [],
  134. data2: [],
  135. data3: [],
  136. yearValues: [new Date().getFullYear() - 4 + '', new Date().getFullYear() + ''],
  137. size: 'mini',
  138. valueFormat: 'yyyy',
  139. activityValue: '',
  140. activityList: [],
  141. topLeftData: {
  142. id: 'topLeftChart',
  143. title: '室间质评计划项目总数'
  144. },
  145. topRightData: {
  146. id: 'topRightChart',
  147. title: '项目验证类型统计'
  148. },
  149. botLeftData: {
  150. id: 'botLeftChart',
  151. title: '室间质评项目不合格率'
  152. },
  153. botMiddData: {
  154. id: 'botMiddChart',
  155. title: '室间质评项目覆盖率'
  156. },
  157. botRightData: {
  158. id: 'botRightChart',
  159. title: '实验室间比对率'
  160. }
  161. }
  162. },
  163. watch: {
  164. yearValues: {
  165. handler (newVal, oldVal) {
  166. this.getData()
  167. },
  168. deep: true
  169. // immediate: true
  170. },
  171. activityValue: {
  172. handler (newVal, oldVal) {
  173. this.topLeftData = {
  174. id: 'topLeftChart',
  175. title: '室间质评计划项目总数'
  176. }
  177. this.getList1()
  178. this.topLeftData.yearArr = this.yearArr
  179. this.topLeftData.numArr = this.numArr
  180. },
  181. deep: true
  182. // immediate: true
  183. }
  184. },
  185. created () {
  186. if (screenfull.isEnabled && !screenfull.isFullscreen) {
  187. screenfull.request()
  188. }
  189. this.getData()
  190. this.getactivityList()
  191. },
  192. mounted () {
  193. },
  194. beforeDestroy () {
  195. if (screenfull.isFullscreen) {
  196. screenfull.toggle()
  197. }
  198. },
  199. methods: {
  200. // 返回
  201. goBack () {
  202. this.$router.back(-1)
  203. },
  204. getNumArr (min, max) { return Array.from(Array(max - min + 1), (v, k) => k + min) },
  205. // 所有活动
  206. async getactivityList () {
  207. const sql = `select huo_dong_ming_che as value from t_sjzphdjhylxqb GROUP BY huo_dong_ming_che`
  208. const { variables: { data }} = await this.$common.request('sql', sql)
  209. this.activityList = data
  210. },
  211. getData () {
  212. this.topLeftData = {
  213. id: 'topLeftChart',
  214. title: '室间质评计划项目总数'
  215. }
  216. this.topRightData = {
  217. id: 'topRightChart',
  218. title: '项目验证类型统计'
  219. }
  220. this.botLeftData = {
  221. id: 'botLeftChart',
  222. title: '室间质评项目不合格率'
  223. }
  224. this.botMiddData = {
  225. id: 'botMiddChart',
  226. title: '室间质评项目覆盖率'
  227. }
  228. this.botRightData = {
  229. id: 'botRightChart',
  230. title: '实验室间比对率'
  231. }
  232. this.yearArr = this.getNumArr(Number(this.yearValues[0]), Number(this.yearValues[1]))
  233. this.getList1()
  234. this.topLeftData.yearArr = this.yearArr
  235. this.topLeftData.numArr = this.numArr
  236. this.getList2()
  237. // this.topRightData.yearArr = this.yearArr
  238. this.topRightData.numArr = this.result
  239. this.getList3()
  240. this.botLeftData.yearArr = this.yearArr
  241. this.botLeftData.result1 = this.result1
  242. this.botLeftData.result2 = this.result2
  243. this.botLeftData.result3 = this.result3
  244. this.getList4()
  245. this.botMiddData.yearArr = this.yearArr
  246. this.botMiddData.list1 = this.list1
  247. this.botMiddData.list2 = this.list2
  248. this.botMiddData.list3 = this.list3
  249. this.getList5()
  250. this.botRightData.yearArr = this.yearArr
  251. this.botRightData.data1 = this.data1
  252. this.botRightData.data2 = this.data2
  253. this.botRightData.data3 = this.data3
  254. },
  255. async getList1 () {
  256. this.numArr = []
  257. const yearStr = `('${this.yearArr.join("', '")}')`
  258. const activityStr = this.activityValue ? `= '${this.activityValue}'` : `is not null`
  259. // const sql = `select left(zhu_biao_shi_jian, 4) as niandu, coalesce(count(*), 0) as count
  260. // from t_sjzphdjhylxqb
  261. // where left(zhu_biao_shi_jian, 4) in ${yearStr}
  262. // group by left(zhu_biao_shi_jian, 4)`
  263. const sql = `select e.ji_hua_nian_fen_ as niandu,COALESCE(COUNT(*), 0) AS count from (select a.huo_dong_ming_che,a.zu_zhi_dan_wei_,a.xu_hao_,a.shi_yan_shi_jian_,a.bi_dui_lei_xing_,b.ji_hua_nian_fen_ from t_sjzphdjhylxqb a join (select c.*, d.ji_hua_nian_fen_ from t_cjwbzlpjhdjhxqb c join t_cjwbzlpjhdjhb d on c.parent_id_ = d.id_ WHERE d.shi_fou_guo_shen_='已完成' and huo_dong_ming_che ${activityStr}) b on a.huo_dong_ming_che=b.huo_dong_ming_che and a.zu_zhi_dan_wei_ = b.zu_zhi_dan_wei_ and a.xu_hao_ = b.xu_hao_ and a.shi_yan_shi_jian_ = b.shi_yan_shi_jian_) e WHERE ji_hua_nian_fen_ in ${yearStr} GROUP BY e.ji_hua_nian_fen_`
  264. await this.$common.request('sql', sql).then((res) => {
  265. const data = res.variables.data
  266. for (var item of this.yearArr) {
  267. const m = data.find((v) => { return v.niandu === item + '' })
  268. if (m) {
  269. this.numArr.push(m.count)
  270. } else {
  271. this.numArr.push(0)
  272. }
  273. }
  274. })
  275. },
  276. getList2 () {
  277. this.result = []
  278. const yearStr = `('${this.yearArr.join("', '")}')`
  279. const sql = `select LEFT(bi_dui_lei_xing_, 2) as leixing,LEFT(zhu_biao_shi_jian, 4) as niandu, COALESCE(COUNT(*), 0) as count FROM t_sjzphdjhylxqb where left(zhu_biao_shi_jian, 4) in ${yearStr} GROUP BY CONCAT(LEFT(zhu_biao_shi_jian, 4), ' ', LEFT(bi_dui_lei_xing_, 2))`
  280. this.$common.request('sql', sql).then((res) => {
  281. const data = res.variables.data
  282. // console.log(data)
  283. this.result.push(['product', '能力验证', '室间质评'])
  284. for (var item of this.yearArr) {
  285. const arr = []
  286. arr[0] = item
  287. const m = data.find((v) => { return v.niandu === item + '' && v.leixing === '能力' })
  288. const n = data.find((v) => { return v.niandu === item + '' && v.leixing === '室间' })
  289. // console.log(m, n)
  290. if (m) {
  291. arr[1] = m.count
  292. } else {
  293. arr[1] = 0
  294. }
  295. if (n) {
  296. arr[2] = n.count
  297. } else {
  298. arr[2] = 0
  299. }
  300. this.result.push(arr)
  301. }
  302. })
  303. },
  304. getList3 () {
  305. this.result1 = []
  306. this.result2 = []
  307. this.result3 = []
  308. const yearStr = `('${this.yearArr.join("', '")}')`
  309. const sql = `select 年度 as niandu,评价结果 as jieguo, COALESCE(COUNT(*), 0) AS count FROM v_sjzpjgpj WHERE 年度 IN ${yearStr} GROUP BY CONCAT(年度, ' ',评价结果)`
  310. this.$common.request('sql', sql).then((res) => {
  311. const data = res.variables.data
  312. for (var item of this.yearArr) {
  313. const m = data.find((v) => { return v.niandu === item + '' && v.jieguo === '通过' })
  314. const n = data.find((v) => { return v.niandu === item + '' && v.jieguo === '不满意项目' })
  315. const f = data.find((v) => { return v.niandu === item + '' && v.jieguo === '不通过' })
  316. // 总数
  317. this.result1.push((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0))
  318. // 不合格数
  319. this.result2.push(f ? f.count : 0)
  320. // 不合格率
  321. this.result3.push(((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) === 0 ? 0 : (f ? f.count : 0) / ((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) * 100)
  322. // console.log(this.result1, this.result2, this.result3)
  323. }
  324. })
  325. },
  326. async getList4 () {
  327. this.list1 = []
  328. this.list2 = []
  329. this.list3 = []
  330. const yearStr = `('${this.yearArr.join("', '")}')`
  331. let data1 = []
  332. let data2 = []
  333. const sql1 = `select LEFT(zhu_biao_shi_jian, 4) as niandu, COUNT(*) AS count FROM t_sjzphdjhylxqb WHERE LEFT(zhu_biao_shi_jian, 4) IN ${yearStr} GROUP BY LEFT(zhu_biao_shi_jian, 4)`
  334. const sql2 = `select e.ji_hua_nian_fen_ as niandu,COALESCE(COUNT(*), 0) AS count from (select a.huo_dong_ming_che,a.zu_zhi_dan_wei_,a.xu_hao_,a.shi_yan_shi_jian_,a.bi_dui_lei_xing_,b.ji_hua_nian_fen_ from t_sjzphdjhylxqb a join (select c.*, d.ji_hua_nian_fen_ from t_cjwbzlpjhdjhxqb c join t_cjwbzlpjhdjhb d on c.parent_id_ = d.id_ WHERE d.shi_fou_guo_shen_='已完成') b on a.huo_dong_ming_che=b.huo_dong_ming_che and a.zu_zhi_dan_wei_ = b.zu_zhi_dan_wei_ and a.xu_hao_ = b.xu_hao_ and a.shi_yan_shi_jian_ = b.shi_yan_shi_jian_) e WHERE ji_hua_nian_fen_ in ${yearStr} GROUP BY e.ji_hua_nian_fen_`
  335. await this.$common.request('sql', sql1).then((res) => {
  336. data1 = res.variables.data
  337. })
  338. await this.$common.request('sql', sql2).then((res) => {
  339. data2 = res.variables.data
  340. })
  341. for (var item of this.yearArr) {
  342. const m = data1.find((v) => { return v.niandu === item + '' })
  343. const n = data2.find((v) => { return v.niandu === item + '' })
  344. // 一览
  345. this.list1.push(m ? m.count : 0)
  346. // 计划
  347. this.list2.push(n ? n.count : 0)
  348. // 覆盖率率
  349. this.list3.push((m ? m.count : 0) === 0 ? 0 : (n ? n.count : 0) / (m ? m.count : 0) * 100)
  350. }
  351. },
  352. async getList5 () {
  353. this.data1 = []
  354. this.data2 = []
  355. this.data3 = []
  356. const yearStr = `('${this.yearArr.join("', '")}')`
  357. let data1 = []
  358. let data2 = []
  359. let data3 = []
  360. const sql1 = `select LEFT(zhu_biao_shi_jian, 4) as niandu, COUNT(*) AS count FROM t_sjzphdjhylxqb WHERE LEFT(zhu_biao_shi_jian, 4) IN ${yearStr} GROUP BY LEFT(zhu_biao_shi_jian, 4)`
  361. const sql2 = `select e.ji_hua_nian_fen_ as niandu,COALESCE(COUNT(*), 0) AS count from (select a.huo_dong_ming_che,a.zu_zhi_dan_wei_,a.xu_hao_,a.shi_yan_shi_jian_,a.bi_dui_lei_xing_,b.ji_hua_nian_fen_ from t_sjzphdjhylxqb a join (select c.*, d.ji_hua_nian_fen_ from t_cjwbzlpjhdjhxqb c join t_cjwbzlpjhdjhb d on c.parent_id_ = d.id_ WHERE d.shi_fou_guo_shen_='已完成') b on a.huo_dong_ming_che=b.huo_dong_ming_che and a.zu_zhi_dan_wei_ = b.zu_zhi_dan_wei_ and a.xu_hao_ = b.xu_hao_ and a.shi_yan_shi_jian_ = b.shi_yan_shi_jian_) e WHERE ji_hua_nian_fen_ in ${yearStr} GROUP BY e.ji_hua_nian_fen_`
  362. const sql3 = `select LEFT(bian_zhi_shi_jian, 4) as niandu, COALESCE(COUNT(*), 0) AS count from t_sysbdjlb bian_zhi_shi_jian where shi_fou_guo_shen_ = '已完成' and LEFT(bian_zhi_shi_jian, 4) IN ${yearStr}`
  363. await this.$common.request('sql', sql1).then((res) => {
  364. data1 = res.variables.data
  365. })
  366. await this.$common.request('sql', sql2).then((res) => {
  367. data2 = res.variables.data
  368. })
  369. await this.$common.request('sql', sql3).then((res) => {
  370. data3 = res.variables.data
  371. })
  372. for (var item of this.yearArr) {
  373. const m = data1.find((v) => { return v.niandu === item + '' })
  374. const n = data2.find((v) => { return v.niandu === item + '' })
  375. const f = data3.find((v) => { return v.niandu === item + '' })
  376. // 无室间质评计划项目数
  377. this.data1.push((m ? m.count : 0) - (n ? n.count : 0))
  378. // 室间比对项目数
  379. this.data2.push(f ? f.count : 0)
  380. // 比对率
  381. this.data3.push((m ? m.count : 0) - (n ? n.count : 0) === 0 ? 0 : (f ? f.count : 0) / ((m ? m.count : 0) - (n ? n.count : 0)) * 100)
  382. }
  383. // console.log(this.data1, this.data2, this.data3)
  384. }
  385. }
  386. }
  387. </script>
  388. <style lang="less" scoped>
  389. .personView {
  390. width: 100%;
  391. // height: calc(100vh - 100px);
  392. height: 100%;
  393. // background-image: url("~@/assets/images/screen/bg.png");
  394. z-index: 999;
  395. #dv-full-screen-container {
  396. background-image: url("~@/assets/images/screen/bg.png");
  397. background-size: 100% 100%;
  398. box-shadow: 0 0 3px blue;
  399. display: flex;
  400. flex-direction: column;
  401. color: white;
  402. }
  403. }
  404. .topView {
  405. overflow: hidden;
  406. box-sizing: border-box;
  407. .jbd-title {
  408. text-align: center;
  409. font-weight: bold;
  410. width: 100%;
  411. color: white;
  412. font-size: 18px;
  413. height: 50%;
  414. }
  415. }
  416. .botView {
  417. height: 98%;
  418. width: 98%;
  419. margin: 0 auto;
  420. overflow: hidden;
  421. box-sizing: border-box;
  422. }
  423. .viewTop{
  424. display: flex;
  425. overflow: hidden;
  426. box-sizing: border-box;
  427. height: 40%;
  428. width: 100%;
  429. .topleft{
  430. height: 100%;
  431. width: 50%;
  432. overflow: hidden;
  433. box-sizing: border-box;
  434. }
  435. .topright{
  436. height: 100%;
  437. width: 50%;
  438. overflow: hidden;
  439. box-sizing: border-box;
  440. }
  441. }
  442. .viewBot{
  443. display: flex;
  444. overflow: hidden;
  445. box-sizing: border-box;
  446. height: 50%;
  447. width: 100%;
  448. .botleft{
  449. height: 100%;
  450. width: 33%;
  451. overflow: hidden;
  452. box-sizing: border-box;
  453. }
  454. .botmidd{
  455. height: 100%;
  456. width: 33%;
  457. overflow: hidden;
  458. box-sizing: border-box;
  459. }
  460. .botright{
  461. height: 100%;
  462. width: 33%;
  463. overflow: hidden;
  464. box-sizing: border-box;
  465. }
  466. }
  467. </style>