index(备份).vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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:15%;z-index:1">
  46. <div style="margin-right:10px;font-size: 14px;">活动名称</div>
  47. <el-select v-model="activityValue" size="small" 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. yearStr: '',
  126. numArr: [],
  127. result: [],
  128. result1: [],
  129. result2: [],
  130. result3: [],
  131. list1: [],
  132. list2: [],
  133. list3: [],
  134. data1: [],
  135. data2: [],
  136. data3: [],
  137. yearValues: [new Date().getFullYear() - 4 + '', new Date().getFullYear() + ''],
  138. size: 'mini',
  139. valueFormat: 'yyyy',
  140. activityValue: '',
  141. activityList: [],
  142. topLeftData: {
  143. id: 'topLeftChart',
  144. title: '室间质评计划项目总数'
  145. },
  146. topRightData: {
  147. id: 'topRightChart',
  148. title: '项目验证类型统计'
  149. },
  150. botLeftData: {
  151. id: 'botLeftChart',
  152. title: '室间质评项目不合格率'
  153. },
  154. botMiddData: {
  155. id: 'botMiddChart',
  156. title: '室间质评项目覆盖率'
  157. },
  158. botRightData: {
  159. id: 'botRightChart',
  160. title: '实验室间比对率'
  161. }
  162. }
  163. },
  164. watch: {
  165. yearValues: {
  166. handler (newVal, oldVal) {
  167. this.getData()
  168. },
  169. deep: true
  170. // immediate: true
  171. },
  172. activityValue: {
  173. handler (newVal, oldVal) {
  174. this.topLeftData = {
  175. id: 'topLeftChart',
  176. title: '室间质评计划项目总数'
  177. }
  178. this.getList1()
  179. this.topLeftData.yearArr = this.yearArr
  180. this.topLeftData.numArr = this.numArr
  181. },
  182. deep: true
  183. // immediate: true
  184. }
  185. },
  186. created () {
  187. if (screenfull.isEnabled && !screenfull.isFullscreen) {
  188. screenfull.request()
  189. }
  190. this.getData()
  191. this.getactivityList()
  192. },
  193. mounted () {
  194. },
  195. beforeDestroy () {
  196. if (screenfull.isFullscreen) {
  197. screenfull.toggle()
  198. }
  199. },
  200. methods: {
  201. // 返回
  202. goBack () {
  203. this.$router.back(-1)
  204. },
  205. getNumArr (min, max) { return Array.from(Array(max - min + 1), (v, k) => k + min) },
  206. // 所有活动
  207. async getactivityList () {
  208. // const sql = `select huo_dong_ming_che as value from t_sjzphdjhylxqb GROUP BY huo_dong_ming_che`
  209. const { variables: { data }} = await this.$common.request('query', {
  210. key: 'interlabQualityBoard1',
  211. params: [null]
  212. })
  213. this.activityList = data
  214. },
  215. getData () {
  216. this.topLeftData = {
  217. id: 'topLeftChart',
  218. title: '室间质评计划项目总数'
  219. }
  220. this.topRightData = {
  221. id: 'topRightChart',
  222. title: '项目验证类型统计'
  223. }
  224. this.botLeftData = {
  225. id: 'botLeftChart',
  226. title: '室间质评项目不合格率'
  227. }
  228. this.botMiddData = {
  229. id: 'botMiddChart',
  230. title: '室间质评项目覆盖率'
  231. }
  232. this.botRightData = {
  233. id: 'botRightChart',
  234. title: '实验室间比对率'
  235. }
  236. this.yearArr = this.getNumArr(Number(this.yearValues[0]), Number(this.yearValues[1]))
  237. this.yearStr = this.yearArr.join(',')
  238. this.getList1()
  239. this.topLeftData.yearArr = this.yearArr
  240. this.topLeftData.numArr = this.numArr
  241. this.getList2()
  242. // this.topRightData.yearArr = this.yearArr
  243. this.topRightData.numArr = this.result
  244. this.getList3()
  245. this.botLeftData.yearArr = this.yearArr
  246. this.botLeftData.result1 = this.result1
  247. this.botLeftData.result2 = this.result2
  248. this.botLeftData.result3 = this.result3
  249. this.getList4()
  250. this.botMiddData.yearArr = this.yearArr
  251. this.botMiddData.list1 = this.list1
  252. this.botMiddData.list2 = this.list2
  253. this.botMiddData.list3 = this.list3
  254. this.getList5()
  255. this.botRightData.yearArr = this.yearArr
  256. this.botRightData.data1 = this.data1
  257. this.botRightData.data2 = this.data2
  258. this.botRightData.data3 = this.data3
  259. },
  260. async getList1 () {
  261. this.numArr = []
  262. // const activityStr = this.activityValue ? `= '${this.activityValue}'` : `is not null`
  263. // const sql = `select left(zhu_biao_shi_jian, 4) as niandu, coalesce(count(*), 0) as count
  264. // from t_sjzphdjhylxqb
  265. // where left(zhu_biao_shi_jian, 4) in ${yearStr}
  266. // group by left(zhu_biao_shi_jian, 4)`
  267. const key = this.activityValue ? 'interlabQualityBoard3' : 'interlabQualityBoard2'
  268. const params = this.activityValue ? [this.activityValue, this.yearStr] : [this.yearStr]
  269. // 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 find_in_set(ji_hua_nian_fen_, '${this.yearStr}') GROUP BY e.ji_hua_nian_fen_`
  270. await this.$common.request('query', { key, params }).then((res) => {
  271. const data = res.variables.data
  272. for (var item of this.yearArr) {
  273. const m = data.find((v) => { return v.niandu === item + '' })
  274. if (m) {
  275. this.numArr.push(m.count)
  276. } else {
  277. this.numArr.push(0)
  278. }
  279. }
  280. })
  281. },
  282. async getList2 () {
  283. this.result = []
  284. // 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 ${this.yearStr} GROUP BY CONCAT(LEFT(zhu_biao_shi_jian, 4), ' ', LEFT(bi_dui_lei_xing_, 2))`
  285. // this.$common.request('', sql).then((res) => {
  286. // const data = res.variables.data
  287. // // console.log(data)
  288. // this.result.push(['product', '能力验证', '室间质评'])
  289. // for (var item of this.yearArr) {
  290. // const arr = []
  291. // arr[0] = item
  292. // const m = data.find((v) => { return v.niandu === item + '' && v.leixing === '能力' })
  293. // const n = data.find((v) => { return v.niandu === item + '' && v.leixing === '室间' })
  294. // // console.log(m, n)
  295. // if (m) {
  296. // arr[1] = m.count
  297. // } else {
  298. // arr[1] = 0
  299. // }
  300. // if (n) {
  301. // arr[2] = n.count
  302. // } else {
  303. // arr[2] = 0
  304. // }
  305. // this.result.push(arr)
  306. // }
  307. // })
  308. let data1 = []
  309. let data2 = []
  310. // const sql1 = `select 年度 as niandu,LEFT(能力验证类型, 2) as leixing,COUNT(*) AS count FROM v_sjzpjgpj WHERE 状态 ='已完成' and find_in_set('年度', '${this.yearStr}') GROUP BY LEFT(能力验证类型, 2)`
  311. // const sql2 = `select LEFT(bian_zhi_shi_jian, 4) as niandu,'实验室' as leixing, COALESCE(COUNT(*), 0) AS count from t_sysbdjlb bian_zhi_shi_jian where shi_fou_guo_shen_ = '已完成' and find_in_set(LEFT(bian_zhi_shi_jian, 4), '${this.yearStr}')`
  312. await this.$common.request('query', { key: 'interlabQualityBoard4', params: [this.yearStr] }).then((res) => {
  313. data1 = res.variables.data
  314. })
  315. await this.$common.request('query', { key: 'interlabQualityBoard5', params: [this.yearStr] }).then((res) => {
  316. data2 = res.variables.data
  317. })
  318. this.result.push(['product', '能力验证', '室间质评', '实验室', '其它'])
  319. for (var item of this.yearArr) {
  320. const m = data1.find((v) => { return v.niandu === item + '' && v.leixing === '能力' })
  321. const n = data1.find((v) => { return v.niandu === item + '' && v.leixing === '室间' })
  322. const f = data2.find((v) => { return v.niandu === item + '' && v.leixing === '实验室' })
  323. const g = data1.find((v) => { return v.niandu === item + '' && v.leixing !== '能力' && v.leixing !== '室间' })
  324. const arr = []
  325. arr[0] = item
  326. arr[1] = m ? m.count : 0
  327. arr[2] = n ? n.count : 0
  328. arr[3] = f ? f.count : 0
  329. arr[4] = g ? g.count : 0
  330. this.result.push(arr)
  331. console.log(this.result)
  332. }
  333. },
  334. getList3 () {
  335. this.result1 = []
  336. this.result2 = []
  337. this.result3 = []
  338. // const sql = `select 年度 as niandu,评价结果 as jieguo, COALESCE(COUNT(*), 0) AS count FROM v_sjzpjgpj WHERE find_in_set('年度', '${this.yearStr}') and 状态 = '已完成' GROUP BY CONCAT(年度, ' ',评价结果)`
  339. this.$common.request('query', { key: 'interlabQualityBoard6', params: [this.yearStr] }).then((res) => {
  340. const data = res.variables.data
  341. for (var item of this.yearArr) {
  342. const m = data.find((v) => { return v.niandu === item + '' && v.jieguo === '通过' })
  343. const n = data.find((v) => { return v.niandu === item + '' && v.jieguo === '不满意项目' })
  344. const f = data.find((v) => { return v.niandu === item + '' && v.jieguo === '不通过' })
  345. // 总数
  346. this.result1.push((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0))
  347. // 不合格数
  348. this.result2.push((f ? f.count : 0) + (n ? n.count : 0))
  349. // 不合格率
  350. this.result3.push((((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) === 0 ? 0 : ((f ? f.count : 0) + (n ? n.count : 0)) / ((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) * 100).toFixed(2))
  351. // console.log(this.result1, this.result2, this.result3)
  352. }
  353. })
  354. },
  355. async getList4 () {
  356. this.list1 = []
  357. this.list2 = []
  358. this.list3 = []
  359. const yearStr = `('${this.yearArr.join("', '")}')`
  360. let data1 = []
  361. let data2 = []
  362. // const sql1 = `select LEFT(zhu_biao_shi_jian, 4) as niandu, COUNT(*) AS count FROM t_sjzphdjhylxqb WHERE find_in_set(LEFT(zhu_biao_shi_jian, 4), '${this.yearStr}') GROUP BY LEFT(zhu_biao_shi_jian, 4)`
  363. // 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 find_in_set(ji_hua_nian_fen_, '${this.yearStr}') GROUP BY e.ji_hua_nian_fen_`
  364. await this.$common.request('query', { key: 'interlabQualityBoard7', params: [this.yearStr] }).then((res) => {
  365. data1 = res.variables.data
  366. })
  367. await this.$common.request('query', { key: 'interlabQualityBoard8', params: [this.yearStr] }).then((res) => {
  368. data2 = res.variables.data
  369. })
  370. for (var item of this.yearArr) {
  371. const m = data1.find((v) => { return v.niandu === item + '' })
  372. const n = data2.find((v) => { return v.niandu === item + '' })
  373. // 一览
  374. this.list1.push(m ? m.count : 0)
  375. // 计划
  376. this.list2.push(n ? n.count : 0)
  377. // 覆盖率率
  378. this.list3.push(((m ? m.count : 0) === 0 ? 0 : (n ? n.count : 0) / (m ? m.count : 0) * 100).toFixed(2))
  379. }
  380. },
  381. async getList5 () {
  382. this.data1 = []
  383. this.data2 = []
  384. this.data3 = []
  385. let data1 = []
  386. let data2 = []
  387. let data3 = []
  388. // const sql1 = `select LEFT(zhu_biao_shi_jian, 4) as niandu, COUNT(*) AS count FROM t_sjzphdjhylxqb WHERE find_in_set(LEFT(zhu_biao_shi_jian, 4), '${this.yearStr}') GROUP BY LEFT(zhu_biao_shi_jian, 4)`
  389. // 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 find_in_set(ji_hua_nian_fen_, '${this.yearStr}') GROUP BY e.ji_hua_nian_fen_`
  390. // const sql3 = `select LEFT(bian_zhi_shi_jian, 4) as niandu,'实验室' as leixing, COALESCE(COUNT(*), 0) AS count from t_sysbdjlb bian_zhi_shi_jian where shi_fou_guo_shen_ = '已完成' and find_in_set(LEFT(bian_zhi_shi_jian, 4), '${this.yearStr}')`
  391. await this.$common.request('query', { key: 'interlabQualityBoard7', params: [this.yearStr] }).then((res) => {
  392. data1 = res.variables.data
  393. })
  394. await this.$common.request('query', { key: 'interlabQualityBoard8', params: [this.yearStr] }).then((res) => {
  395. data2 = res.variables.data
  396. })
  397. await this.$common.request('query', { key: 'interlabQualityBoard5', params: [this.yearStr] }).then((res) => {
  398. data3 = res.variables.data
  399. })
  400. for (var item of this.yearArr) {
  401. const m = data1.find((v) => { return v.niandu === item + '' })
  402. const n = data2.find((v) => { return v.niandu === item + '' })
  403. const f = data3.find((v) => { return v.niandu === item + '' })
  404. // 无室间质评计划项目数
  405. this.data1.push((m ? m.count : 0) - (n ? n.count : 0))
  406. // 实验室比对项目数
  407. this.data2.push(f ? f.count : 0)
  408. // 比对率
  409. 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).toFixed(2))
  410. }
  411. // console.log(this.data1, this.data2, this.data3)
  412. }
  413. }
  414. }
  415. </script>
  416. <style lang="less" scoped>
  417. .personView {
  418. width: 100%;
  419. // height: calc(100vh - 100px);
  420. height: 100%;
  421. // background-image: url("~@/assets/images/screen/bg.png");
  422. z-index: 999;
  423. #dv-full-screen-container {
  424. background-image: url("~@/assets/images/screen/bg.png");
  425. background-size: 100% 100%;
  426. box-shadow: 0 0 3px blue;
  427. display: flex;
  428. flex-direction: column;
  429. color: white;
  430. }
  431. }
  432. .topView {
  433. overflow: hidden;
  434. box-sizing: border-box;
  435. .jbd-title {
  436. text-align: center;
  437. font-weight: bold;
  438. width: 100%;
  439. color: white;
  440. font-size: 18px;
  441. height: 50%;
  442. }
  443. }
  444. .botView {
  445. height: 98%;
  446. width: 98%;
  447. margin: 0 auto;
  448. overflow: hidden;
  449. box-sizing: border-box;
  450. }
  451. .viewTop{
  452. display: flex;
  453. overflow: hidden;
  454. box-sizing: border-box;
  455. height: 40%;
  456. width: 100%;
  457. .topleft{
  458. height: 100%;
  459. width: 50%;
  460. overflow: hidden;
  461. box-sizing: border-box;
  462. }
  463. .topright{
  464. height: 100%;
  465. width: 50%;
  466. overflow: hidden;
  467. box-sizing: border-box;
  468. }
  469. }
  470. .viewBot{
  471. display: flex;
  472. overflow: hidden;
  473. box-sizing: border-box;
  474. height: 52%;
  475. width: 100%;
  476. .botleft{
  477. height: 100%;
  478. width: 33%;
  479. overflow: hidden;
  480. box-sizing: border-box;
  481. }
  482. .botmidd{
  483. height: 100%;
  484. width: 33%;
  485. overflow: hidden;
  486. box-sizing: border-box;
  487. }
  488. .botright{
  489. height: 100%;
  490. width: 33%;
  491. overflow: hidden;
  492. box-sizing: border-box;
  493. }
  494. }
  495. </style>