productionPlan.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <ele-pro-table
  3. ref="equiTable"
  4. :columns="columns"
  5. :datasource="datasource"
  6. :selection.sync="selection"
  7. :current.sync="current"
  8. highlight-current-row
  9. row-key="id"
  10. height="20vh"
  11. >
  12. </ele-pro-table>
  13. </template>
  14. <script>
  15. import { getList } from '@/api/bpm/components/exceptionManagement';
  16. export default {
  17. components: {},
  18. props: {
  19. selectList: Array,
  20. type: {
  21. default: 1 //1多选 2单选
  22. }
  23. },
  24. data() {
  25. return {
  26. equipmentdialog: false,
  27. current: null,
  28. planType: [
  29. { label: '所有计划类型', value: null },
  30. { label: '内销计划', value: '1' },
  31. { label: '外销计划', value: '2' },
  32. { label: '预制计划', value: '3' }
  33. ],
  34. columns: [
  35. {
  36. width: 45,
  37. type: 'selection',
  38. columnKey: 'selection',
  39. align: 'center',
  40. reserveSelection: true,
  41. show: this.type == 1
  42. },
  43. {
  44. columnKey: 'index',
  45. label: '序号',
  46. type: 'index',
  47. width: 55,
  48. align: 'center',
  49. showOverflowTooltip: true,
  50. fixed: 'left'
  51. },
  52. {
  53. prop: 'code',
  54. label: '计划编号',
  55. align: 'center',
  56. showOverflowTooltip: true,
  57. minWidth: 180,
  58. fixed: 'left'
  59. },
  60. {
  61. prop: 'productCode',
  62. label: '产品编码',
  63. align: 'center',
  64. showOverflowTooltip: true,
  65. minWidth: 180
  66. },
  67. {
  68. prop: 'productName',
  69. label: '产品名称',
  70. align: 'center',
  71. showOverflowTooltip: true,
  72. minWidth: 150
  73. },
  74. {
  75. prop: 'brandNo',
  76. label: '牌号',
  77. align: 'center',
  78. showOverflowTooltip: true,
  79. minWidth: 80
  80. },
  81. {
  82. prop: 'batchNo',
  83. label: '批号',
  84. align: 'center',
  85. minWidth: 100,
  86. showOverflowTooltip: true
  87. },
  88. {
  89. prop: 'model',
  90. label: '型号',
  91. align: 'center',
  92. showOverflowTooltip: true,
  93. minWidth: 100
  94. },
  95. {
  96. prop: 'priority',
  97. label: '优先级',
  98. align: 'center',
  99. minWidth: 90,
  100. showOverflowTooltip: true,
  101. sortable: 'custom'
  102. },
  103. {
  104. prop: 'productNum',
  105. label: '计划数量',
  106. showOverflowTooltip: true,
  107. align: 'center',
  108. minWidth: 90
  109. },
  110. {
  111. prop: 'productWeight',
  112. label: '计划重量',
  113. minWidth: 90,
  114. align: 'center',
  115. showOverflowTooltip: true
  116. },
  117. {
  118. prop: 'requiredFormingNum',
  119. label: '要求生产数量',
  120. minWidth: 120,
  121. align: 'center',
  122. showOverflowTooltip: true
  123. },
  124. {
  125. prop: 'newSumOrderWeight',
  126. label: '要求生产重量',
  127. minWidth: 120,
  128. align: 'center',
  129. showOverflowTooltip: true
  130. },
  131. {
  132. prop: 'reqMoldTime',
  133. label: '要求生产日期',
  134. align: 'center',
  135. showOverflowTooltip: true,
  136. minWidth: 120
  137. },
  138. {
  139. prop: 'orderType',
  140. label: '计划类型',
  141. align: 'center',
  142. minWidth: 80,
  143. showOverflowTooltip: true,
  144. formatter: (row) => {
  145. const obj = this.planType.find((i) => i.value == row.planType);
  146. return obj && obj.label;
  147. }
  148. },
  149. {
  150. prop: 'createTime',
  151. label: '创建时间',
  152. align: 'center',
  153. showOverflowTooltip: true,
  154. minWidth: 110
  155. }
  156. ],
  157. categoryLevelId: null,
  158. code: null,
  159. selection: [],
  160. ids: []
  161. };
  162. },
  163. watch: {},
  164. methods: {
  165. datasource({ page, where, limit }) {
  166. return getList({
  167. ...where,
  168. pageNum: page,
  169. size: limit
  170. });
  171. },
  172. /* 刷新表格 */
  173. reload(where) {
  174. this.$nextTick(() =>
  175. this.$refs.equiTable.reload({ page: 1, limit: 10, where })
  176. );
  177. },
  178. // 选择
  179. getValue() {
  180. this.selection.forEach((item) => {
  181. item['objType'] = 1;
  182. });
  183. return JSON.parse(JSON.stringify(this.selection));
  184. }
  185. }
  186. };
  187. </script>