tgDetails.vue 5.7 KB

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