index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <template>
  2. <dv-full-screen-container>
  3. <el-scrollbar class="screen" ref="scrollDiv" >
  4. <!-- :style="{height:height}" -->
  5. <div class="statistics">
  6. <div class="editDate">
  7. <div class="stitle">实验室管理看板</div>
  8. <div class="block" style="display:none">
  9. <span class="demonstration">开始:</span>
  10. <el-date-picker v-model="BeginDate" type="year" size="mini" value-format="yyyy" format="yyyy年" style="width: 96px;"
  11. :clearable="false" @change="checkYear(BeginDate,'begin')" placeholder="选择日期">
  12. </el-date-picker>
  13. </div>
  14. <div class="block">
  15. <span class="demonstration">查询年度:</span>
  16. <!-- <el-date-picker v-model="endDate" type="year" size="mini" value-format="yyyy" format="yyyy年" :clearable="false" style="width: 96px;"
  17. @change="checkYear(endDate,'end')" placeholder="选择日期"> -->
  18. <el-date-picker
  19. v-model="endDate"
  20. type="year"
  21. value-format="yyyy"
  22. @change="checkYear(endDate,'end')"
  23. placeholder="选择年">
  24. </el-date-picker>
  25. <!-- </el-date-picker> -->
  26. </div>
  27. <div class="block">
  28. <el-button type="primary" size="mini" plain @click="selectAll">
  29. 查询
  30. </el-button>
  31. </div>
  32. <div class="goBackButton" @click.prevent="goBack()" >
  33. 返回
  34. </div>
  35. </div>
  36. <div class="ttitle">质量目标统计</div>
  37. <div class="componentsData" v-if="relOf">
  38. <s1zhiLiangMuBiao :width="static=='row' ? '20%': '100%'"
  39. v-if="showAll || showComponents[1]" :data = "getS1renwu()"/>
  40. <s1jianCe :width="static=='row' ? '20%': '100%'"
  41. v-if="showAll || showComponents[5]" :data = "getS2jianCe()" />
  42. <s2manYiDu :width="static=='row' ? '20%': '100%'"
  43. v-if="showAll || showComponents[7]" :data = "getS2manYiDu()"/>
  44. <s3tousu :width="static=='row' ? '20%': '100%'"
  45. v-if="showAll || showComponents[6]" :data = "getS3tousu()"/>
  46. <s13shengWu :width="static=='row' ? '20%': '100%'"
  47. v-if="showAll || showComponents[17]" :data = "getS3tousu()"/>
  48. <!-- <s1zhiLiang1 :width="static=='row' ? '20%': '100%'"
  49. v-if="showAll || showComponents[2]" />
  50. <s1zhiLiang2 :width="static=='row' ? '20%': '100%'"
  51. v-if="showAll || showComponents[3]" />
  52. <s1zhiLiang3 :width="static=='row' ? '20%': '100%'"
  53. v-if="showAll || showComponents[4]" /> -->
  54. <!-- <s4renYuanPeiXun :width="static=='row' ? '20%': '100%'"
  55. v-if="showAll || showComponents[8]" :data = "getS4renYuanPeiXun()"/> -->
  56. <!-- <none :width="static=='row' ? '20%': '100%'"
  57. /> -->
  58. <!-- <s6sheBeiWeiHu :width="static=='row' ? '20%': '100%'"
  59. v-if="showAll || showComponents[10]" :data = "getS6sheBeiWeiHu()"/> -->
  60. <!-- <s7sheBeiJiaoZhun :width="'50%'"
  61. v-if="showAll || showComponents[12]" :data = "getJiaoYanObjNum()"/>
  62. <s8sheBeiHeCha :width="'50%'"
  63. v-if="showAll || showComponents[11]" :data = "gethechaObjNum()"/> -->
  64. <!-- <s10waiBuNengLi :width="'50%'"
  65. v-if="showAll || showComponents[14]" :data = "getnengtliObjNum()"/> -->
  66. <!-- <s11biaoZhunWu :width="'50%'"
  67. v-if="showAll || showComponents[15]" :data = "getbiaozhunObjNum()"/> -->
  68. <!-- <s5renYuanJianDu :width="static=='row' ? '20%': '100%'"
  69. v-if="showAll || showComponents[9]" :data = "getS5renYuanJianDu()"/> -->
  70. <!-- <s9neiBuZhiLiang :width="static=='row' ? '20%': '100%'"
  71. v-if="showAll || showComponents[13]" :data = "getS9neiBuZhiLiang()"/> -->
  72. <!-- <s12fengXian :width="static=='row' ? '20%': '100%'"
  73. v-if="showAll || showComponents[13]" :data = "getS12fengXian()"/> -->
  74. <div class="clear"></div>
  75. </div>
  76. <div class="ttitle">人员培训与管理</div>
  77. <div class="componentsData" v-if="relOf">
  78. <s4renYuanPeiXun :width="static=='row' ? '25%': '100%'"
  79. v-if="showAll || showComponents[8]" :data = "getS4renYuanPeiXun()"/>
  80. <s5renYuanJianDu :width="static=='row' ? '25%': '100%'"
  81. v-if="showAll || showComponents[9]" :data = "getS5renYuanJianDu()"/>
  82. <div class="clear"></div>
  83. </div>
  84. <div class="ttitle">设备维保</div>
  85. <div class="componentsData" v-if="relOf">
  86. <s7sheBeiJiaoZhun :width="static=='row' ? '33%': '100%'"
  87. v-if="showAll || showComponents[12]" :data = "getJiaoYanObjNum()"/>
  88. <s8sheBeiHeCha :width="static=='row' ? '33%': '100%'"
  89. v-if="showAll || showComponents[11]" :data = "gethechaObjNum()"/>
  90. <s11biaoZhunWu :width="static=='row' ? '33%': '100%'"
  91. v-if="showAll || showComponents[15]" :data = "getbiaozhunObjNum()"/>
  92. <div class="clear"></div>
  93. </div>
  94. <div class="ttitle">质量控制</div>
  95. <div class="componentsData" v-if="relOf">
  96. <s9neiBuZhiLiang :width="static=='row' ? '25%': '100%'"
  97. v-if="showAll || showComponents[13]" :data = "getS9neiBuZhiLiang()"/>
  98. <s10waiBuNengLi :width="static=='row' ? '25%': '100%'"
  99. v-if="showAll || showComponents[14]" :data = "getnengtliObjNum()"/>
  100. <s14bufuhexiang :width="static=='row' ? '25%': '100%'"
  101. v-if="showAll || showComponents[18]" :data = "getS14bufuhexiang()"/>
  102. <s15tousu :width="static=='row' ? '25%': '100%'"
  103. v-if="showAll || showComponents[19]" :data = "getS3tousu()"/>
  104. <div class="clear"></div>
  105. </div>
  106. <div class="ttitle">风险控制</div>
  107. <div class="componentsData" v-if="relOf">
  108. <s12fengXian :width="static=='row' ? '25%': '100%'"
  109. v-if="showAll || showComponents[16]" :data = "getS12fengXian()"/>
  110. <div class="clear"></div>
  111. </div>
  112. </div>
  113. </el-scrollbar>
  114. </dv-full-screen-container>
  115. </template>
  116. <script>
  117. //全屏展示
  118. import screenfull from 'screenfull'
  119. //大屏标题组件
  120. // import headerDecoration from './headerDecoration'
  121. import s1zhiLiangMuBiao from './item/s1zhiLiangMuBiao.vue'
  122. import s1zhiLiang1 from './item/s1zhiLiang1.vue'
  123. import s1zhiLiang2 from './item/s1zhiLiang2.vue'
  124. import s1zhiLiang3 from './item/s1zhiLiang3.vue'
  125. import s1jianCe from './item/s1jianCe.vue'
  126. import s2manYiDu from './item/s2manYiDu.vue'
  127. import s3tousu from './item/s3tousu.vue'
  128. import s4renYuanPeiXun from './item/s4renYuanPeiXun.vue'
  129. import s5renYuanJianDu from './item/s5renYuanJianDu.vue'
  130. import s6sheBeiWeiHu from './item/s6sheBeiWeiHu.vue'
  131. import s7sheBeiJiaoZhun from './item/s7sheBeiJiaoZhun.vue'
  132. import s8sheBeiHeCha from './item/s8sheBeiHeCha.vue'
  133. import s9neiBuZhiLiang from './item/s9neiBuZhiLiang.vue'
  134. import s10waiBuNengLi from './item/s10waiBuNengLi.vue'
  135. import s11biaoZhunWu from './item/s11biaoZhunWu.vue'
  136. import s12fengXian from './item/s12fengXian.vue'
  137. import s13shengWu from './item/s13shengWu.vue'
  138. import s14bufuhexiang from './item/s14bufuhexiang.vue'
  139. import s15tousu from './item/s15tousu.vue'
  140. import none from './item/none.vue'
  141. import { DBData ,getConfig,getJiaoYanObj, gethechaObj, getnengliObj, getbiaozhunObj} from './js/selectDB.js'
  142. import sendDatas from './sendDatas.js'
  143. import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js'
  144. export default {
  145. components:{
  146. // headerDecoration,
  147. none,
  148. s1zhiLiang1,
  149. s1zhiLiang2,
  150. s1zhiLiang3,
  151. s1zhiLiangMuBiao,
  152. s1jianCe,
  153. s2manYiDu,
  154. s3tousu,
  155. s4renYuanPeiXun,
  156. s5renYuanJianDu,
  157. s6sheBeiWeiHu,
  158. s7sheBeiJiaoZhun,
  159. s8sheBeiHeCha,
  160. s9neiBuZhiLiang,
  161. s10waiBuNengLi,
  162. s11biaoZhunWu,
  163. s12fengXian,
  164. s13shengWu,
  165. s14bufuhexiang,
  166. s15tousu
  167. },
  168. props:{
  169. shows:{ //传入的内容显示序号
  170. type: Array,
  171. default:() => []
  172. },
  173. static:{ //显示类型,默认为横向 ,作为表单统计图的外部引用为 line
  174. type: String,
  175. default:'row'
  176. }
  177. },
  178. mixins: [sendDatas],
  179. mounted() {
  180. /*以shows是否有参数来判断, 是否需要仅显示部分子组件*/
  181. if(this.shows.length>0){
  182. this.showAll=false
  183. this.isShowComponents()
  184. }
  185. /* 开始及结束时间的默认设置*/
  186. if (!this.BeginDate && !this.endDate) {
  187. this.BeginDate = this.getDate(1) + ''
  188. this.endDate = this.getDate(0) + ''
  189. this.dataScope.push(this.BeginDate)
  190. this.dataScope.push(this.endDate)
  191. }
  192. this.getConfigData() //获取统计的配置
  193. },
  194. data() {
  195. return {
  196. height:(window.screen.height-200)+"px",
  197. BeginDate: '',
  198. endDate: '',
  199. jiaoyanObj:[],
  200. hechaObj:[],
  201. nengliObj:[],
  202. biaozhunObj:[],
  203. relData: {},
  204. relOf: false,
  205. selectEnd: '',
  206. selectBeg: '',
  207. showAll:true,
  208. timer: '',
  209. showComponents:{},//显示全部统计子组件 , 若有新增,往后累计。 供动态表单进行查阅使用。
  210. dataScope: []
  211. }
  212. },
  213. beforeDestroy() {
  214. clearInterval(this.timer);
  215. },
  216. methods: {
  217. /* 判断是否统计子组件中传递过来的,是否需要隐藏。若需要则进行隐藏的遍历 */
  218. isShowComponents(){
  219. /* 将参数进行显示 */
  220. for(let i=0;i<this.shows.length;i++){
  221. this.showComponents[this.shows[i]] = true
  222. }
  223. },
  224. /* 查询统计配置中的完成率*/
  225. getConfigData() {
  226. repostCurd('sql', getConfig()).then(response => {
  227. this.config = response.variables.data //结果一定存在第0个,因为只有一条数据
  228. this.getJiaoYanObjData(this.endDate)
  229. })
  230. },
  231. getJiaoYanObjData(end) {
  232. repostCurd('sql', getJiaoYanObj(end)).then(response => {
  233. this.jiaoyanObj = response.variables.data //结果一定存在第0个,因为只有一条数据
  234. // this.getData(this.BeginDate, this.endDate, true, this.dataScope)
  235. // console.log(end,this.jiaoyanObj,"nmnakak")
  236. this.gethechaObjData(this.endDate)
  237. })
  238. },
  239. gethechaObjData(end) {
  240. repostCurd('sql', gethechaObj(end)).then(response => {
  241. this.hechaObj = response.variables.data //结果一定存在第0个,因为只有一条数据
  242. // this.getData(this.BeginDate, this.endDate, true, this.dataScope)
  243. this.getnengliObjData(this.endDate)
  244. })
  245. },
  246. getnengliObjData(end) {
  247. repostCurd('sql', getnengliObj(end)).then(response => {
  248. this.nengliObj = response.variables.data //结果一定存在第0个,因为只有一条数据
  249. // this.getData(this.BeginDate, this.endDate, true, this.dataScope)
  250. this.getbiaozhunObjData(this.endDate)
  251. })
  252. },
  253. getbiaozhunObjData(end) {
  254. repostCurd('sql', getbiaozhunObj(end)).then(response => {
  255. this.biaozhunObj = response.variables.data //结果一定存在第0个,因为只有一条数据
  256. // this.getData(this.BeginDate, this.endDate, true, this.dataScope)
  257. // console.log(this.biaozhunObj,'8888')
  258. this.getData(this.BeginDate, this.endDate, true, this.dataScope)
  259. })
  260. },
  261. /* 通过拼接的sql进行查询全部数据*/
  262. getData(beg, end, of, scope) {
  263. // console.log(2222,DBData(beg, end, scope))
  264. repostCurd('sql', DBData(beg, end, scope)).then(response => {
  265. if(typeof response.variables.data[0] === "undefined"){
  266. this.relData = [0] //结果一定存在第0个,因为只有一条数据
  267. }else{
  268. this.relData = response.variables.data[0] //结果一定存在第0个,因为只有一条数据
  269. }
  270. this.relOf = of
  271. // console.log(beg, end, of, response,this.relData,'getdata')
  272. })
  273. },
  274. /* 查询全部*/
  275. selectAll() {
  276. /* 上次查询时间不等于当次查询时间, 开始时间不能等于结束时间, 则开始查询。*/
  277. if (this.selectEnd != this.endDate) {
  278. // if ((this.selectEnd != this.endDate || this.selectBeg != this.BeginDate) && this.endDate != this.BeginDate && this.endDate > this.BeginDate) {
  279. // this.getData(this.BeginDate, this.endDate, false, this.dataScope)
  280. this.getConfigData()
  281. // this.$forceUpdate();
  282. // this.selectEnd = this.endDate
  283. // this.selectBeg = this.BeginDate
  284. /* 延迟刷新*/
  285. this.relOf = true;
  286. this.timer = setTimeout(() => {
  287. this.relOf = false
  288. clearTimeout(this.timer)
  289. }, 0)
  290. // this.timer = setInterval(() => {
  291. // if (!this.relOf) {
  292. // this.relOf = true
  293. // clearInterval(this.timer)
  294. // }
  295. // }, 100);
  296. }
  297. // else if (this.endDate == this.BeginDate) {
  298. // this.$message({
  299. // showClose: true,
  300. // message: '年份相等无法进行查询对比',
  301. // type: 'warning'
  302. // });
  303. // } else if(this.endDate < this.BeginDate){
  304. // this.$message({
  305. // showClose: true,
  306. // message: '结束时间不得小于开始时间',
  307. // type: 'warning'
  308. // });
  309. // }
  310. },
  311. /* 年份不得大于当前年份*/
  312. checkYear(year, data) {
  313. // let that = this
  314. // that.dataScope.length = 0
  315. // if(that.BeginDate != '' && that.endDate != ''){
  316. // let poor = Number(that.endDate) - Number(that.BeginDate)
  317. // for (let i = 0; i <= poor; i++) {
  318. // let element = Number(that.BeginDate) + i;
  319. // that.dataScope.push(element+'')
  320. // }
  321. // }
  322. if (Number(year) > Number(this.getDate(0))) {
  323. console.log(data,'3y87sdvfsdf')
  324. data == 'end' ?
  325. this.endDate = this.getDate(0) + '' :
  326. this.BeginDate = this.getDate(0) + ''
  327. this.$message({
  328. showClose: true,
  329. message: '年份不得大于当前年份',
  330. type: 'warning'
  331. });
  332. this.selectAll()
  333. }
  334. // else(
  335. // this.endDate = Number(year)
  336. // )
  337. // this.$forceUpdate();
  338. },
  339. /* 获取当前年份*/
  340. getDate(year) {
  341. year = year || 0
  342. let nowDate = new Date();
  343. return nowDate.getFullYear() - year;
  344. },
  345. allView(){
  346. screenfull.request() //默认显示全屏
  347. },
  348. goBack(){
  349. this.$router.back(-1)
  350. }
  351. },
  352. created() {
  353. //时间
  354. // this.currentTime()
  355. if(screenfull.isEnabled && !screenfull.isFullscreen){
  356. this.allView()
  357. }
  358. },
  359. beforeDestroy() {
  360. if(screenfull.isFullscreen){
  361. screenfull.toggle()
  362. }
  363. }
  364. }
  365. </script>
  366. <style lang="scss">
  367. .statistics {
  368. .editDate{
  369. overflow: hidden;
  370. background-color:rgb(249, 255, 255);
  371. position: relative;
  372. }
  373. .block{
  374. float: left;
  375. font-size: 14px;
  376. }
  377. }
  378. #dv-full-screen-container {
  379. // background-image: url('./img/stars.png');
  380. // background-size: 100% 100%;
  381. // box-shadow: 0 0 3px blue;bete
  382. // display: flex;
  383. // flex-direction: column;
  384. background-color: #f9ffff;
  385. display: flex;
  386. flex-direction:column;
  387. align-items: stretch;
  388. // .headerContent{
  389. // flex: 1;
  390. // // background-color: rgb(99, 12, 41);
  391. // }
  392. }
  393. .goBackButton{
  394. width: 2%;
  395. position: absolute;
  396. right: 0;
  397. }
  398. #dv-border-box-8{
  399. border: none;
  400. }
  401. .stitle{
  402. text-align: center;
  403. font-size: 150%;
  404. // font-family: PingFangSC-Semibold, sans-serif;
  405. font-weight: 600;
  406. margin: 0;
  407. }
  408. .ttitle{
  409. font-size: 120%;
  410. font-weight: 600;
  411. margin: 1% 0;
  412. }
  413. .screen{
  414. height: 100%;
  415. }
  416. .clear{ clear: both; }
  417. </style>
  418. <style lang="scss">
  419. .el-year-table .today .cell {
  420. color: #606266 !important;
  421. font-weight: 100 !important;
  422. }
  423. </style>