produceOrder.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <el-dialog
  3. title="工单列表"
  4. :visible.sync="visible"
  5. :before-close="handleClose"
  6. :close-on-click-modal="false"
  7. :close-on-press-escape="false"
  8. append-to-body
  9. width="70%"
  10. >
  11. <produceOrderSearch @search="reload"></produceOrderSearch>
  12. <ele-pro-table
  13. ref="table"
  14. height="55vh"
  15. :columns="columns"
  16. width="30%"
  17. :initLoad="false"
  18. :datasource="datasource"
  19. :selection.sync="selection"
  20. cache-key="produceOrderZ"
  21. highlight-current-row
  22. >
  23. <template v-slot:code="{ row }">
  24. <el-link type="primary" :underline="false">{{ row.code }}</el-link>
  25. </template>
  26. <template v-slot:singleReport="{ row }">
  27. <el-tag> {{ row.singleReport == 1 ? '单个报工' : '批量报工' }}</el-tag>
  28. </template>
  29. <template v-slot:formingNum="{ row }">
  30. <span> {{ row.formingNum }} {{ row.unit }} </span>
  31. </template>
  32. <template v-slot:formingWeight="{ row }">
  33. <span> {{ row.formingNum }} {{ row.weightUnit }} </span>
  34. </template>
  35. </ele-pro-table>
  36. <template slot="footer">
  37. <el-button size="mini" @click="handleClose">取 消</el-button>
  38. <el-button size="mini" type="primary" @click="handleSelect()"
  39. >确 定</el-button
  40. >
  41. </template>
  42. </el-dialog>
  43. </template>
  44. <script>
  45. import { pickTaskReportPage } from '@/api/produce/workOrder.js';
  46. import produceOrderSearch from './produceOrder-search.vue';
  47. export default {
  48. components: { produceOrderSearch,
  49. },
  50. data() {
  51. return {
  52. loading: false,
  53. selection: [],
  54. visible: true,
  55. taskId: null
  56. };
  57. },
  58. watch: {},
  59. computed: {
  60. columns() {
  61. return [
  62. {
  63. width: 45,
  64. type: 'selection',
  65. columnKey: 'selection',
  66. align: 'center',
  67. fixed: true
  68. },
  69. {
  70. columnKey: 'index',
  71. label: '序号',
  72. type: 'index',
  73. width: 55,
  74. align: 'center',
  75. showOverflowTooltip: true
  76. },
  77. {
  78. prop: 'batchNo',
  79. label: '批次号',
  80. align: 'center'
  81. },
  82. {
  83. prop: 'code',
  84. slot: 'code',
  85. label: '生产工单号',
  86. align: 'center',
  87. minWidth: '110'
  88. },
  89. {
  90. prop: '',
  91. label: '计划编号',
  92. align: 'center'
  93. },
  94. {
  95. prop: '',
  96. label: '计划类型',
  97. align: 'center'
  98. },
  99. {
  100. prop: 'productCode',
  101. label: '产品编码',
  102. align: 'center'
  103. },
  104. {
  105. prop: 'productName',
  106. label: '产品名称',
  107. align: 'center'
  108. },
  109. {
  110. prop: 'singleReport',
  111. slot: 'singleReport',
  112. label: '报工类型',
  113. align: 'center',
  114. width: 100
  115. },
  116. {
  117. prop: 'brandNo',
  118. label: '牌号',
  119. align: 'center'
  120. },
  121. {
  122. prop: 'model',
  123. label: '型号',
  124. align: 'center'
  125. },
  126. {
  127. prop: 'priority',
  128. label: '优先级',
  129. align: 'center',
  130. minWidth: 120
  131. },
  132. {
  133. prop: 'formingNum',
  134. label: '要求生产数量',
  135. align: 'center',
  136. slot: 'formingNum',
  137. showOverflowTooltip: true,
  138. minWidth: 110
  139. },
  140. {
  141. prop: 'formingWeight',
  142. label: '要求生产重量',
  143. slot: 'formingWeight',
  144. align: 'center',
  145. showOverflowTooltip: true,
  146. minWidth: 110
  147. },
  148. {
  149. prop: 'formedNum',
  150. label: '已生产数量',
  151. align: 'center',
  152. showOverflowTooltip: true,
  153. minWidth: 110
  154. },
  155. {
  156. prop: 'formedWeight',
  157. label: '已生产重量',
  158. align: 'center',
  159. showOverflowTooltip: true,
  160. minWidth: 110
  161. },
  162. {
  163. prop: 'planStartTime',
  164. label: '计划开始时间',
  165. align: 'center',
  166. showOverflowTooltip: true,
  167. minWidth: 110
  168. },
  169. {
  170. prop: 'planCompleteTime',
  171. label: '计划结束时间',
  172. align: 'center',
  173. showOverflowTooltip: true,
  174. minWidth: 110
  175. },
  176. {
  177. prop: 'startTime',
  178. label: '实际开始时间',
  179. align: 'center',
  180. showOverflowTooltip: true,
  181. minWidth: 110
  182. },
  183. {
  184. prop: 'createTime',
  185. label: '创建时间',
  186. align: 'center',
  187. showOverflowTooltip: true,
  188. minWidth: 110
  189. }
  190. ];
  191. }
  192. },
  193. methods: {
  194. /* 表格数据源 */
  195. datasource({ page, limit, where }) {
  196. return pickTaskReportPage({
  197. pageNum: page,
  198. size: limit,
  199. ...where
  200. });
  201. },
  202. /* 刷新表格 */
  203. reload(where) {
  204. this.taskId = where.taskId || '';
  205. this.$nextTick(() => {
  206. this.$refs.table.reload({ page: 1, where });
  207. });
  208. },
  209. handleSelect() {
  210. let ids = [];
  211. ids = this.selection.map((item) => {
  212. return item.id;
  213. });
  214. if (!this.taskId) {
  215. return this.$message.warning('请选择工序');
  216. }
  217. this.$emit('workSelect', ids, this.taskId);
  218. },
  219. handleClose() {
  220. this.$emit('close');
  221. }
  222. }
  223. };
  224. </script>