produceOrder.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <ele-pro-table
  3. ref="table"
  4. :columns="columns"
  5. height="320px"
  6. :datasource="datasource"
  7. :selection.sync="selection"
  8. @selection-change="handleSelectionChange"
  9. cache-key="produceOrderZ"
  10. highlight-current-row
  11. @row-click="rowClick"
  12. :need-page="false"
  13. >
  14. <template v-slot:toolbar>
  15. <div class="c_title">工单列表 </div>
  16. </template>
  17. </ele-pro-table>
  18. </template>
  19. <script>
  20. import { workorderPage } from '@/api/produce/workOrder.js';
  21. export default {
  22. components: {},
  23. data() {
  24. return {
  25. loading: false,
  26. selection: []
  27. };
  28. },
  29. computed: {
  30. // 表格列配置
  31. columns() {
  32. return [
  33. {
  34. width: 45,
  35. type: 'selection',
  36. columnKey: 'selection',
  37. align: 'center'
  38. },
  39. {
  40. columnKey: 'index',
  41. label: '序号',
  42. type: 'index',
  43. width: 55,
  44. align: 'center',
  45. showOverflowTooltip: true
  46. },
  47. {
  48. prop: 'batchNo',
  49. label: '批号',
  50. align: 'center'
  51. },
  52. {
  53. prop: 'code',
  54. label: '生产工单号',
  55. align: 'center'
  56. },
  57. {
  58. prop: '',
  59. label: '计划编号',
  60. align: 'center'
  61. },
  62. {
  63. prop: '',
  64. label: '计划类型',
  65. align: 'center'
  66. },
  67. {
  68. prop: 'produceRoutingName',
  69. label: '工艺路线',
  70. align: 'center'
  71. },
  72. {
  73. prop: 'productCode',
  74. label: '产品编码',
  75. align: 'center'
  76. },
  77. {
  78. prop: 'productName',
  79. label: '产品名称',
  80. align: 'center'
  81. },
  82. {
  83. prop: 'brandNo',
  84. label: '牌号',
  85. align: 'center'
  86. },
  87. {
  88. prop: 'model',
  89. label: '型号',
  90. align: 'center'
  91. }
  92. ];
  93. },
  94. taskObj() {
  95. return this.$store.state.user.taskObj;
  96. }
  97. },
  98. watch: {
  99. taskObj: {
  100. handler(val) {
  101. this.reload();
  102. },
  103. immediate: true,
  104. deep: true
  105. }
  106. },
  107. created() {},
  108. methods: {
  109. /* 表格数据源 */
  110. datasource({ page, limit, where }) {
  111. return workorderPage({
  112. pageNum: page,
  113. size: limit,
  114. taskId: this.taskObj.id,
  115. ...where
  116. });
  117. },
  118. /* 刷新表格 */
  119. reload(where) {
  120. this.$nextTick(() => {
  121. this.$refs.table.reload({ page: 1, where });
  122. });
  123. },
  124. handleSelectionChange(val) {
  125. let ids = []
  126. ids = val.map(item => {
  127. return item.id;
  128. });
  129. console.log(ids)
  130. this.$emit('workSelect', ids);
  131. },
  132. rowClick() {}
  133. }
  134. };
  135. </script>
  136. <style lang="scss" scoped>
  137. .table {
  138. height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
  139. }
  140. </style>