index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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 ref="table" :columns="columns" :datasource="datasource" cache-key="workOrderTable">
  7. <template v-slot:feedStatus="{ row }">
  8. {{ row.feedStatus === 1 ? '已投料' : row.feedStatus === 0 ? '未投料' : '' }}
  9. </template>
  10. </ele-pro-table>
  11. </el-card>
  12. </div>
  13. </template>
  14. <script>
  15. import { getList } from '@/api/InTheSystem/index.js';
  16. import search from './components/search.vue';
  17. export default {
  18. components: {
  19. search,
  20. },
  21. data() {
  22. return {
  23. loading: false,
  24. };
  25. },
  26. computed: {
  27. // 表格列配置
  28. columns() {
  29. return [
  30. {
  31. columnKey: 'index',
  32. label: '序号',
  33. type: 'index',
  34. width: 55,
  35. align: 'center',
  36. showOverflowTooltip: true,
  37. fixed: 'left'
  38. },
  39. {
  40. prop: 'workOrderCode',
  41. label: '工单编码',
  42. align: 'center',
  43. minWidth: 110
  44. },
  45. {
  46. prop: 'taskName',
  47. label: '工序',
  48. align: 'center'
  49. },
  50. {
  51. prop: 'name',
  52. label: '物品名称',
  53. align: 'center',
  54. minWidth: 280
  55. },
  56. {
  57. slot: 'feedStatus',
  58. label: '类型',
  59. align: 'center'
  60. },
  61. {
  62. prop: 'number',
  63. label: '数量',
  64. align: 'center'
  65. },
  66. {
  67. prop: 'deviceName',
  68. label: '设备名称',
  69. align: 'center'
  70. },
  71. {
  72. prop: 'workstationName',
  73. label: '工位',
  74. align: 'center'
  75. },
  76. {
  77. prop: 'createTime',
  78. label: '创建时间',
  79. align: 'center',
  80. showOverflowTooltip: true,
  81. minWidth: 110
  82. },
  83. ];
  84. },
  85. },
  86. created() {
  87. },
  88. methods: {
  89. /* 表格数据源 */
  90. datasource({ page, limit, where }) {
  91. return getList({
  92. pageNum: page,
  93. size: limit,
  94. ...where
  95. });
  96. },
  97. /* 刷新表格 */
  98. reload(where) {
  99. this.$nextTick(() => {
  100. this.$refs.table.reload({ page: 1, where });
  101. });
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="scss" scoped></style>