赫艾前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

201 lines
5.2 KiB

4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
  1. <template>
  2. <div class="mod-config">
  3. <div style="text-align: center">
  4. <h1>生产制造看板</h1>
  5. </div>
  6. <div class="board2">
  7. <!-- @mouseenter.native="mouseEnter"-->
  8. <!-- @mouseleave.native="mouseLeave"-->
  9. <el-table
  10. cell-style="cc"
  11. :height="height"
  12. :data="tableData"
  13. ref="wt_table"
  14. border
  15. :row-class-name="tableRowClassName"
  16. style="width: 100%;">
  17. <el-table-column
  18. prop="erpStatus"
  19. header-align="center"
  20. align="left"
  21. min-width="30"
  22. style="font-size: 20px"
  23. label="ERP">
  24. </el-table-column>
  25. <el-table-column
  26. prop="orderNo"
  27. header-align="center"
  28. align="left"
  29. min-width="65"
  30. style="font-size: 20px"
  31. label="生产订单号">
  32. </el-table-column>
  33. <el-table-column
  34. prop="partNo"
  35. header-align="center"
  36. align="left"
  37. min-width="105"
  38. label="产品编码">
  39. </el-table-column>
  40. <el-table-column
  41. prop="partDescSpec"
  42. header-align="center"
  43. align="left"
  44. min-width="180"
  45. label="产品名称">
  46. </el-table-column>
  47. <el-table-column
  48. prop="qtyRequired"
  49. header-align="center"
  50. align="right"
  51. min-width="45"
  52. label="计划数量">
  53. </el-table-column>
  54. <el-table-column
  55. prop="qtyFinished"
  56. header-align="center"
  57. align="right"
  58. min-width="45"
  59. label="完成数量">
  60. </el-table-column>
  61. <el-table-column
  62. prop="planStartDate"
  63. header-align="center"
  64. align="right"
  65. min-width="80"
  66. label="要求开工日期">
  67. </el-table-column>
  68. </el-table>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. let rollstop = ''
  74. let rolltimer = ''// 自动滚动的定时任务
  75. let refresher = '' //数据刷新定时器
  76. import {
  77. soLiuhuaBoard,
  78. } from '@/api/board.js'
  79. export default {
  80. name: 'soLiuhuaBoard',
  81. data () {
  82. return {
  83. pageIndex: 1,
  84. totalPage: 1,
  85. height: 200,
  86. tableData: [],
  87. // 默认的刷新,滚动时间,滚动间距
  88. // refreshTime: 5,
  89. // rollTime: 5,
  90. // rollPx: 1,
  91. }
  92. },
  93. mounted () {
  94. this.$nextTick(() => {
  95. this.height = window.innerHeight - 80
  96. })
  97. // this.autoRoll()
  98. },
  99. methods: {
  100. tableRowClassName ({row, rowIndex}) {
  101. if (row.finishedFlag == '2') {
  102. return 'success-row'
  103. }
  104. if (row.finishedFlag == '3') {
  105. return 'false-row'
  106. }
  107. if (row.finishedFlag == '4') {
  108. return 'yellow-row'
  109. }
  110. return ''
  111. // if (row.finishedFlag == '2') {
  112. //
  113. // // return {css:{"background-color":"#1bb61b"}};
  114. // return 'success-row'
  115. // }
  116. // if (row.finishedFlag == '3') {
  117. // return 'false-row'
  118. // // return {css:{"background-color":"#cbcb14"}};
  119. // }
  120. // return ''
  121. },
  122. search () {
  123. let inData= {number:this.pageIndex};
  124. soLiuhuaBoard(inData).then(({data}) => {
  125. this.tableData = data.rows;
  126. this.totalPage= data.maxPage;
  127. if(this.pageIndex+1>data.maxPage){
  128. this.pageIndex=1
  129. }else {
  130. this.pageIndex=this.pageIndex+1
  131. }
  132. })
  133. },
  134. // 鼠标进入
  135. // mouseEnter (time) {
  136. // // 鼠标进入停止滚动和切换的定时任务
  137. // this.autoRoll(true)
  138. // },
  139. // 鼠标离开
  140. // mouseLeave () {
  141. // // 开启
  142. // this.autoRoll()
  143. // },
  144. // 设置自动滚动
  145. // autoRoll (stop) {
  146. // if (stop) {
  147. // clearInterval(rolltimer)
  148. // return
  149. // }
  150. // // 拿到表格挂载后的真实DOM
  151. // const table = this.$refs.wt_table
  152. // // 拿到表格中承载数据的div元素
  153. // const divData = table.bodyWrapper
  154. // // 拿到元素后,对元素进行定时增加距离顶部距离,实现滚动效果
  155. // rolltimer = setInterval(() => {
  156. // // 元素自增距离顶部像素
  157. // divData.scrollTop = this.decimalUtil.add(Number(divData.scrollTop), Number(this.rollPx))
  158. // // 判断元素是否滚动到底部(可视高度+距离顶部=整个高度)
  159. // if (divData.clientHeight + divData.scrollTop +1>= divData.scrollHeight) {
  160. // // 重置table距离顶部距离
  161. // divData.scrollTop = 0
  162. // }
  163. // }, this.rollTime * 10)
  164. // },
  165. refreshTable () {
  166. refresher = setInterval(() => {
  167. this.search()
  168. }, 30000)
  169. }
  170. },
  171. created () {
  172. this.search()
  173. this.refreshTable()
  174. }
  175. }
  176. </script>
  177. <style >
  178. .board2 .el-table .cell {
  179. line-height: 13px;
  180. font-size: 12px;
  181. height: 13px;
  182. padding: 0px;
  183. }
  184. .board2 .el-table .success-row {
  185. background: #1bb61b;
  186. }
  187. .board2 .el-table .false-row {
  188. /*background: #cbcb14;*/
  189. background: #db1212;
  190. }
  191. .board2 .el-table .yellow-row{
  192. background: #ffff00;
  193. }
  194. </style>