tgDetails.vue 6.1 KB

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