produceOrder.vue 3.2 KB

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