tgDetails.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. <template v-slot:weight="{ row }">
  22. <span v-if="row.extInfo.newWeight">
  23. {{ row.extInfo.newWeight }} {{ row.extInfo.weightUnit }}</span
  24. >
  25. <span v-else>
  26. {{ row.extInfo.weight }}{{ row.extInfo.weightUnit }}
  27. <el-tag size="mini" type="warning">原</el-tag></span
  28. >
  29. </template>
  30. </ele-pro-table>
  31. </el-card>
  32. </div>
  33. </template>
  34. <script>
  35. import { detailPage } from '@/api/InTheSystem/index.js';
  36. import search from './tg-details-search.vue';
  37. export default {
  38. components: {
  39. search
  40. },
  41. data() {
  42. return {
  43. loading: false
  44. };
  45. },
  46. computed: {
  47. // 表格列配置
  48. columns() {
  49. return [
  50. {
  51. columnKey: 'index',
  52. label: '序号',
  53. type: 'index',
  54. width: 55,
  55. align: 'center',
  56. showOverflowTooltip: true,
  57. fixed: 'left'
  58. },
  59. {
  60. prop: 'batchNo',
  61. label: '批次号',
  62. align: 'center'
  63. },
  64. {
  65. prop: 'workOrderCode',
  66. label: '工单编码',
  67. align: 'center',
  68. minWidth: 110
  69. },
  70. {
  71. prop: 'qualityTaskName',
  72. label: '当前工序',
  73. align: 'center'
  74. },
  75. {
  76. prop: 'taskName',
  77. label: '处置工序',
  78. align: 'center'
  79. },
  80. {
  81. prop: 'categoryCode',
  82. label: '物品编码',
  83. align: 'center',
  84. minWidth: 160
  85. },
  86. {
  87. prop: 'name',
  88. label: '物品名称',
  89. align: 'center',
  90. minWidth:
  91. {
  92. prop: 'categoryCode',
  93. label: '物品编码',
  94. align: 'center',
  95. minWidth: 160
  96. },
  97. },
  98. {
  99. slot: 'feedStatus',
  100. label: '类型',
  101. align: 'center'
  102. },
  103. {
  104. prop: 'extInfo.engrave',
  105. label: '刻码',
  106. align: 'center'
  107. },
  108. {
  109. prop: 'extInfo.materielDesignation',
  110. label: '物料代号 ',
  111. align: 'center'
  112. },
  113. {
  114. prop: 'quantity',
  115. label: '数量',
  116. align: 'center'
  117. },
  118. {
  119. prop: 'weight',
  120. slot: 'weight',
  121. label: '重量',
  122. align: 'center'
  123. },
  124. {
  125. prop: 'deviceName',
  126. label: '设备名称',
  127. align: 'center'
  128. },
  129. {
  130. prop: 'workstationName',
  131. label: '工位',
  132. align: 'center'
  133. },
  134. {
  135. prop: 'modelType',
  136. label: '型号',
  137. align: 'center'
  138. },
  139. {
  140. prop: 'specification',
  141. label: '规格',
  142. align: 'center'
  143. },
  144. {
  145. prop: 'updateTime',
  146. label: '更新时间',
  147. align: 'center',
  148. minWidth: 90
  149. },
  150. {
  151. prop: 'createTime',
  152. label: '创建时间',
  153. align: 'center',
  154. minWidth: 90
  155. }
  156. ];
  157. }
  158. },
  159. created() {},
  160. methods: {
  161. /* 表格数据源 */
  162. datasource({ page, limit, where }) {
  163. where = { rootCategoryLevelId: ['2'], ...where };
  164. return detailPage({
  165. pageNum: page,
  166. size: limit,
  167. ...where
  168. });
  169. },
  170. /* 刷新表格 */
  171. reload(where) {
  172. this.$nextTick(() => {
  173. this.$refs.table.reload({ page: 1, where });
  174. });
  175. }
  176. }
  177. };
  178. </script>
  179. <style lang="scss" scoped></style>