bottom3.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div id="quabottom3">
  3. <div class="bg-color-black">
  4. <div class="d-flex pt-1 pl-2 jc-center">
  5. <span class="fs-xxxl text mx-2 fw-b">超24小时未检明细</span>
  6. </div>
  7. <div class="d-flex jc-center body-box">
  8. <dv-scroll-board :config="config" ref="scroll-board" />
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. import {mapState} from "vuex";
  15. export default {
  16. computed: {
  17. //数组写法
  18. ...mapState(['user','factoryoptions','factory']),
  19. },
  20. data() {
  21. return {
  22. config: {
  23. header: [] ,//['检验单号','物料编号','物料名称','批次数量','来料日期'],
  24. data: [],
  25. rowNum: 10, //表格行数
  26. headerHeight: 40,
  27. headerBGC: 'rgba(15,19,37,0.1)', //表头
  28. oddRowBGC: 'rgba(15,19,37,0.1)', //奇数行
  29. evenRowBGC: 'rgba(23,28,51,0.1)', //偶数行
  30. columnWidth: [],//[130,200, 100,100,100],
  31. align: [] //['center','center','center','center','center'],
  32. },
  33. timing: null,
  34. }
  35. },
  36. mounted() {
  37. this.refreshdata();
  38. },
  39. beforeDestroy () {
  40. clearInterval(this.timing)
  41. },
  42. methods: {
  43. refreshdata() {
  44. this.getdata(); //获取-数据
  45. this.timing = setInterval(() => {
  46. this.getdata(); //获取--数据
  47. }, 10000);
  48. },
  49. async getdata() {
  50. var caller = 'KB!IQC!OVERTIME';
  51. await this.$http.get("kanban/datalist.action?caller=" + caller + "&_noc=1&page=1&pageSize=100", {
  52. params: {
  53. condition: "1=1" ,
  54. }
  55. }).then((result) => {
  56. let columns = result.data.columns;
  57. let headers = new Array();
  58. let columnWidths = new Array();
  59. let fieldnames = new Array();
  60. let aligns = new Array();
  61. for (let index = 0; index < columns.length; index++) {
  62. const element = columns[index];
  63. if(element.width>0) {
  64. headers.push(element.text);
  65. columnWidths.push(element.width);
  66. fieldnames.push(element.dataIndex);
  67. aligns.push('center');
  68. }
  69. }
  70. this.config.header = headers;
  71. this.config.columnWidth = columnWidths;
  72. this.config.align = aligns;
  73. let dataList = JSON.parse(result.data.data);
  74. let resultList = new Array();
  75. for (let index = 0; index < dataList.length; index++) {
  76. const element = dataList[index];
  77. let cellClass = 'colorGrass';
  78. let item = new Array();
  79. fieldnames.forEach(function (ele) {
  80. // 遍历数组,对每个元素进行操作
  81. item.push(`<span class="fs-xl ${cellClass}">`+element[ele]+`</span>`);
  82. });
  83. resultList.push(item);
  84. }
  85. this.config.data = resultList;
  86. this.config = { ...this.config };
  87. }, (result) => {
  88. console.error(result)
  89. }
  90. );
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. $box-height: 525px;
  97. $box-width: 100%;
  98. #quabottom3 {
  99. padding: 13px;
  100. height: $box-height;
  101. // font-size: 32px;
  102. width: $box-width;
  103. border-radius: 5px;
  104. .bg-color-black {
  105. height: $box-height - 25px;
  106. border-radius: 10px;
  107. padding: 5px;
  108. width: $box-width;
  109. .body-box {
  110. padding-top: 15px;
  111. }
  112. }
  113. .text {
  114. color: #c3cbde;
  115. //font-size: 15px;
  116. }
  117. .body-box {
  118. width: $box-width;
  119. ::v-deep .dv-scroll-board {
  120. height: 460px;
  121. padding-top: 0px; // 添加这行减少顶部间距
  122. .header {
  123. font-size: 20px !important;
  124. color: #c3cbde !important;
  125. }
  126. .rows {
  127. .row-item {
  128. font-size: 20px !important;
  129. color: #c3cbde !important;
  130. }
  131. }
  132. }
  133. }
  134. }
  135. </style>