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.

194 lines
5.0 KiB

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