index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <search @search="reload" ref="searchRef"> </search>
  5. <!-- 数据表格 -->
  6. <ele-pro-table
  7. ref="table"
  8. :columns="columns"
  9. :datasource="datasource"
  10. cache-key="workOrderTable"
  11. >
  12. <template v-slot:feedStatus="{ row }">
  13. {{
  14. row.feedStatus === 1
  15. ? '报工中'
  16. : row.feedStatus === 0
  17. ? '投料中'
  18. : ''
  19. }}
  20. </template>
  21. </ele-pro-table>
  22. </el-card>
  23. </div>
  24. </template>
  25. <script>
  26. import { getList } from '@/api/InTheSystem/index.js';
  27. import search from './components/search.vue';
  28. export default {
  29. components: {
  30. search
  31. },
  32. data() {
  33. return {
  34. loading: false
  35. };
  36. },
  37. computed: {
  38. // 表格列配置
  39. columns() {
  40. return [
  41. {
  42. columnKey: 'index',
  43. label: '序号',
  44. type: 'index',
  45. width: 55,
  46. align: 'center',
  47. fixed: 'left'
  48. },
  49. {
  50. prop: 'batchNo',
  51. label: '批次号',
  52. align: 'center',
  53. fixed: 'left'
  54. },
  55. {
  56. prop: 'workOrderCode',
  57. label: '工单编码',
  58. align: 'center',
  59. minWidth: 110,
  60. fixed: 'left'
  61. },
  62. {
  63. prop: 'qualityTaskName',
  64. label: '当前工序',
  65. align: 'center'
  66. },
  67. {
  68. prop: 'taskName',
  69. label: '处置工序',
  70. align: 'center'
  71. },
  72. {
  73. prop: 'categoryCode',
  74. label: '物品编码',
  75. align: 'center',
  76. minWidth: 160
  77. },
  78. {
  79. prop: 'name',
  80. label: '物品名称',
  81. align: 'center',
  82. minWidth: 160
  83. },
  84. {
  85. slot: 'feedStatus',
  86. label: '类型',
  87. align: 'center'
  88. },
  89. {
  90. prop: 'number',
  91. label: '数量',
  92. align: 'center'
  93. },
  94. {
  95. prop: 'deviceName',
  96. label: '设备名称',
  97. align: 'center'
  98. },
  99. {
  100. prop: 'taskStayTimeDuration',
  101. label: '停留时间(分钟)',
  102. align: 'center'
  103. },
  104. {
  105. prop: 'workstationName',
  106. label: '工位',
  107. align: 'center'
  108. },
  109. {
  110. prop: 'factoriesName',
  111. label: '所属工厂',
  112. align: 'center'
  113. },
  114. {
  115. prop: 'createName',
  116. label: '创建人',
  117. align: 'center'
  118. },
  119. {
  120. prop: 'createTime',
  121. label: '创建时间',
  122. align: 'center',
  123. showOverflowTooltip: true,
  124. minWidth: 110
  125. }
  126. ];
  127. }
  128. },
  129. created() {},
  130. methods: {
  131. /* 表格数据源 */
  132. datasource({ page, limit, where }) {
  133. where = { rootCategoryLevelId: ['2'], ...where };
  134. return getList({
  135. pageNum: page,
  136. size: limit,
  137. ...where
  138. });
  139. },
  140. /* 刷新表格 */
  141. reload(where) {
  142. this.$nextTick(() => {
  143. this.$refs.table.reload({ page: 1, where });
  144. });
  145. }
  146. }
  147. };
  148. </script>
  149. <style lang="scss" scoped></style>