workOrder.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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 { workOrder} 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. equipmentdialog: false,
  48. current: null,
  49. planType: [
  50. { label: '所有计划类型', value: null },
  51. { label: '内销计划', value: '1' },
  52. { label: '外销计划', value: '2' },
  53. { label: '预制计划', value: '3' }
  54. ],
  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. columnKey: 'index',
  66. label: '序号',
  67. type: 'index',
  68. width: 55,
  69. align: 'center',
  70. showOverflowTooltip: true,
  71. fixed: 'left'
  72. },
  73. {
  74. label: '生产订单号',
  75. align: 'center',
  76. minWidth: 110,
  77. prop: 'code',
  78. },
  79. {
  80. prop: 'productionPlanCode',
  81. label: '计划编号',
  82. align: 'center'
  83. },
  84. {
  85. prop: 'produceRoutingName',
  86. label: '工艺路线',
  87. align: 'center'
  88. },
  89. {
  90. prop: 'productCode',
  91. label: '产品编码',
  92. align: 'center'
  93. },
  94. {
  95. prop: 'productName',
  96. label: '产品名称',
  97. align: 'center'
  98. },
  99. {
  100. prop: 'brandNo',
  101. label: '牌号',
  102. align: 'center'
  103. },
  104. {
  105. prop: 'batchNo',
  106. label: '批号',
  107. align: 'center',
  108. minWidth: 100,
  109. showOverflowTooltip: true
  110. },
  111. {
  112. prop: 'model',
  113. label: '型号',
  114. align: 'center'
  115. },
  116. {
  117. prop: 'priority',
  118. label: '优先级',
  119. align: 'center',
  120. minWidth: 120,
  121. sortable: 'custom'
  122. },
  123. {
  124. prop: 'formingNum',
  125. label: '要求生产数量',
  126. align: 'center',
  127. showOverflowTooltip: true,
  128. minWidth: 110
  129. },
  130. {
  131. prop: 'formingWeight',
  132. label: '要求生产重量',
  133. align: 'center',
  134. showOverflowTooltip: true,
  135. minWidth: 110,
  136. },
  137. {
  138. prop: 'planStartTime',
  139. label: '计划开始时间',
  140. align: 'center',
  141. showOverflowTooltip: true,
  142. minWidth: 110
  143. },
  144. {
  145. prop: 'planCompleteTime',
  146. label: '计划结束时间',
  147. align: 'center',
  148. showOverflowTooltip: true,
  149. minWidth: 110
  150. },
  151. {
  152. prop: 'createTime',
  153. label: '创建时间',
  154. align: 'center',
  155. showOverflowTooltip: true,
  156. minWidth: 110
  157. },
  158. {
  159. prop: 'serialNo',
  160. label: '客户代号',
  161. align: 'center',
  162. showOverflowTooltip: true
  163. },
  164. {
  165. prop: 'simpleName',
  166. label: '客户简称',
  167. align: 'center',
  168. showOverflowTooltip: true
  169. },
  170. ],
  171. categoryLevelId: null,
  172. code: null,
  173. selection: [],
  174. ids:[]
  175. };
  176. },
  177. watch: {},
  178. methods: {
  179. datasource({ page, where, limit }) {
  180. return workOrder({
  181. ...where,
  182. pageNum: page,
  183. size: limit
  184. });
  185. },
  186. open(ids) {
  187. this.equipmentdialog = true;
  188. },
  189. onDone(){
  190. this.$nextTick(() => {
  191. this.$refs.equiTable.setSelectedRowKeys(this.ids);
  192. });
  193. },
  194. handleClose() {
  195. this.equipmentdialog = false;
  196. this.$refs.equiTable.clearSelection();
  197. },
  198. // 选择
  199. selected() {
  200. let data=this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current))
  201. data['productNumber']=data.formingNum
  202. this.$emit('choose', data);
  203. this.handleClose();
  204. }
  205. }
  206. };
  207. </script>
  208. <style lang="scss" scoped>
  209. .tree_col {
  210. border: 1px solid #eee;
  211. padding: 10px 0;
  212. box-sizing: border-box;
  213. max-height: 530px;
  214. overflow: auto;
  215. }
  216. .table_col {
  217. padding-left: 10px;
  218. ::v-deep .el-table th.el-table__cell {
  219. background: #f2f2f2;
  220. }
  221. }
  222. .pagination {
  223. text-align: right;
  224. padding: 10px 0;
  225. }
  226. .btns {
  227. text-align: center;
  228. padding: 10px 0;
  229. }
  230. .topsearch {
  231. margin-bottom: 15px;
  232. }
  233. </style>