indexold.vue 16 KB

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