produceOrder.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <el-dialog
  3. :visible.sync="equipmentdialog"
  4. :before-close="handleClose"
  5. :close-on-click-modal="true"
  6. :close-on-press-escape="false"
  7. append-to-body
  8. width="70%"
  9. title="生产工单"
  10. >
  11. <div>
  12. <el-row>
  13. <el-col :span="24" class="table_col" v-if="equipmentdialog">
  14. <ele-pro-table
  15. ref="equiTable"
  16. :columns="columns"
  17. :datasource="datasource"
  18. :selection.sync="selection"
  19. :current.sync="current"
  20. highlight-current-row
  21. row-key="id"
  22. height="50vh"
  23. @done="onDone"
  24. >
  25. </ele-pro-table>
  26. </el-col>
  27. </el-row>
  28. </div>
  29. <div class="btns">
  30. <el-button type="primary" size="small" @click="selected">选择</el-button>
  31. <el-button size="small" @click="handleClose">关闭</el-button>
  32. </div>
  33. </el-dialog>
  34. </template>
  35. <script>
  36. import { produceOrder } from '@/api/aps/index.js';
  37. export default {
  38. components: {},
  39. props: {
  40. selectList: Array,
  41. type: {
  42. default: 2 //1多选 2单选
  43. }
  44. },
  45. data() {
  46. return {
  47. planType: [
  48. { label: '所有计划类型', value: null },
  49. { label: '内销计划', value: '1' },
  50. { label: '外销计划', value: '2' },
  51. { label: '预制计划', value: '3' }
  52. ],
  53. equipmentdialog: false,
  54. current: null,
  55. columns: [
  56. {
  57. width: 45,
  58. type: 'selection',
  59. columnKey: 'selection',
  60. align: 'center',
  61. reserveSelection: true,
  62. show: this.type == 1
  63. },
  64. {
  65. label: '生产工单号',
  66. align: 'center',
  67. prop: 'code',
  68. minWidth: 110
  69. },
  70. {
  71. prop: 'productionPlanCode',
  72. label: '计划编号',
  73. align: 'center',
  74. minWidth: 110
  75. },
  76. {
  77. prop: 'planType',
  78. label: '计划类型',
  79. align: 'center',
  80. formatter: (row) => {
  81. const obj = this.planType.find((i) => i.value == row.planType);
  82. return obj && obj.label;
  83. }
  84. },
  85. {
  86. prop: 'produceRoutingName',
  87. label: '工艺路线',
  88. align: 'center'
  89. },
  90. {
  91. prop: 'productCode',
  92. label: '产品编号',
  93. align: 'center'
  94. },
  95. {
  96. prop: 'productName',
  97. label: '产品名称',
  98. align: 'center'
  99. },
  100. {
  101. prop: 'brandNo',
  102. label: '牌号',
  103. align: 'center'
  104. },
  105. {
  106. prop: 'specification',
  107. label: '规格',
  108. align: 'center'
  109. },
  110. {
  111. prop: 'model',
  112. label: '型号',
  113. align: 'center'
  114. },
  115. {
  116. prop: 'batchNo',
  117. label: '批号',
  118. align: 'center',
  119. minWidth: 100,
  120. showOverflowTooltip: true
  121. },
  122. {
  123. prop: 'priority',
  124. label: '优先级',
  125. align: 'center',
  126. minWidth: 120,
  127. sortable: 'custom'
  128. },
  129. {
  130. prop: 'formingNum',
  131. label: '要求生产数量',
  132. align: 'center',
  133. showOverflowTooltip: true,
  134. minWidth: 110
  135. },
  136. {
  137. prop: 'formingWeight',
  138. label: '要求生产重量',
  139. align: 'center',
  140. showOverflowTooltip: true,
  141. minWidth: 110
  142. },
  143. {
  144. prop: 'formedNum',
  145. label: '已生产数量',
  146. align: 'center',
  147. showOverflowTooltip: true,
  148. minWidth: 110
  149. },
  150. {
  151. prop: 'formedWeight',
  152. label: '已生产重量',
  153. align: 'center',
  154. showOverflowTooltip: true,
  155. minWidth: 110
  156. },
  157. {
  158. prop: 'planStartTime',
  159. label: '计划开始时间',
  160. align: 'center',
  161. showOverflowTooltip: true,
  162. minWidth: 110
  163. },
  164. {
  165. prop: 'planCompleteTime',
  166. label: '计划结束时间',
  167. align: 'center',
  168. showOverflowTooltip: true,
  169. minWidth: 110
  170. },
  171. {
  172. prop: 'startTime',
  173. label: '实际开始时间',
  174. align: 'center',
  175. showOverflowTooltip: true,
  176. minWidth: 110
  177. },
  178. {
  179. prop: 'createTime',
  180. label: '创建时间',
  181. align: 'center',
  182. showOverflowTooltip: true,
  183. minWidth: 110
  184. },
  185. {
  186. prop: 'teamName',
  187. label: '班组',
  188. align: 'center',
  189. showOverflowTooltip: true
  190. }
  191. ],
  192. categoryLevelId: null,
  193. code: null,
  194. selection: [],
  195. ids: []
  196. };
  197. },
  198. watch: {},
  199. methods: {
  200. datasource({ page, where, limit }) {
  201. return produceOrder({
  202. ...where,
  203. pageNum: page,
  204. size: limit
  205. });
  206. },
  207. open(ids) {
  208. this.equipmentdialog = true;
  209. },
  210. onDone() {
  211. this.$nextTick(() => {
  212. this.$refs.equiTable.setSelectedRowKeys(this.ids);
  213. });
  214. },
  215. handleClose() {
  216. this.equipmentdialog = false;
  217. this.$refs.equiTable.clearSelection();
  218. },
  219. // 选择
  220. selected() {
  221. let data =
  222. this.type == 1
  223. ? JSON.parse(JSON.stringify(this.selection))
  224. : JSON.parse(JSON.stringify(this.current));
  225. this.$emit('choose', data);
  226. this.handleClose();
  227. }
  228. }
  229. };
  230. </script>
  231. <style lang="scss" scoped>
  232. .tree_col {
  233. border: 1px solid #eee;
  234. padding: 10px 0;
  235. box-sizing: border-box;
  236. max-height: 530px;
  237. overflow: auto;
  238. }
  239. .table_col {
  240. padding-left: 10px;
  241. ::v-deep .el-table th.el-table__cell {
  242. background: #f2f2f2;
  243. }
  244. }
  245. .pagination {
  246. text-align: right;
  247. padding: 10px 0;
  248. }
  249. .btns {
  250. text-align: center;
  251. padding: 10px 0;
  252. }
  253. .topsearch {
  254. margin-bottom: 15px;
  255. }
  256. </style>