produceOrder.vue 5.7 KB

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