indexold.vue 16 KB

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