warehousing.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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 { warehousing} 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. columns: [
  50. {
  51. width: 45,
  52. type: 'selection',
  53. columnKey: 'selection',
  54. align: 'center',
  55. reserveSelection: true,
  56. show:this.type==1
  57. },
  58. {
  59. columnKey: 'index',
  60. label: '序号',
  61. type: 'index',
  62. width: 55,
  63. align: 'center',
  64. showOverflowTooltip: true,
  65. fixed: 'left'
  66. },
  67. {
  68. prop: 'code',
  69. label: '编码',
  70. align: 'center',
  71. minWidth: 110
  72. },
  73. {
  74. prop: 'workOrderCode',
  75. label: '工单编码',
  76. align: 'center',
  77. minWidth: 110
  78. },
  79. {
  80. prop: 'warehouseName',
  81. label: '仓库名称 ',
  82. align: 'center'
  83. },
  84. {
  85. prop: 'categoryLevelName',
  86. label: '物品分类',
  87. align: 'center'
  88. },
  89. {
  90. prop: 'categoryName',
  91. label: '名称',
  92. align: 'center'
  93. },
  94. { label: '型号', prop: 'modelType', width: '150' },
  95. { label: '规格', prop: 'specification', width: '150' },
  96. { label: '牌号', prop: 'brandNum', width: '50' },
  97. {
  98. slot: 'totalCount',
  99. label: '总数量',
  100. align: 'center'
  101. },
  102. {
  103. slot: 'totalPackage',
  104. label: '总包装',
  105. align: 'center'
  106. },
  107. {
  108. slot: 'totalWeight',
  109. label: '总重量',
  110. align: 'center'
  111. },
  112. {
  113. prop: 'type',
  114. label: '入库类型',
  115. align: 'center',
  116. formatter: (row, column, cellValue) => {
  117. return cellValue==1?'生产入库':""
  118. }
  119. },
  120. {
  121. prop: 'approvalUserName',
  122. label: '审核人',
  123. align: 'center'
  124. },
  125. {
  126. prop: 'createTime',
  127. label: '创建时间',
  128. align: 'center',
  129. showOverflowTooltip: true,
  130. minWidth: 110
  131. },
  132. ],
  133. categoryLevelId: null,
  134. code: null,
  135. selection: [],
  136. ids:[]
  137. };
  138. },
  139. watch: {},
  140. methods: {
  141. datasource({ page, where, limit }) {
  142. return warehousing({
  143. ...where,
  144. pageNum: page,
  145. size: limit
  146. });
  147. },
  148. open(ids) {
  149. this.equipmentdialog = true;
  150. },
  151. onDone(){
  152. this.$nextTick(() => {
  153. this.$refs.equiTable.setSelectedRowKeys(this.ids);
  154. });
  155. },
  156. handleClose() {
  157. this.equipmentdialog = false;
  158. this.$refs.equiTable.clearSelection();
  159. },
  160. // 选择
  161. selected() {
  162. let data=this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current))
  163. data['model']=data.specification
  164. data['productName']=data.categoryName
  165. data['productNumber']=data.totalCount
  166. data['productCode']=data.categoryCode
  167. this.$emit('choose', data);
  168. this.handleClose();
  169. }
  170. }
  171. };
  172. </script>
  173. <style lang="scss" scoped>
  174. .tree_col {
  175. border: 1px solid #eee;
  176. padding: 10px 0;
  177. box-sizing: border-box;
  178. max-height: 530px;
  179. overflow: auto;
  180. }
  181. .table_col {
  182. padding-left: 10px;
  183. ::v-deep .el-table th.el-table__cell {
  184. background: #f2f2f2;
  185. }
  186. }
  187. .pagination {
  188. text-align: right;
  189. padding: 10px 0;
  190. }
  191. .btns {
  192. text-align: center;
  193. padding: 10px 0;
  194. }
  195. .topsearch {
  196. margin-bottom: 15px;
  197. }
  198. </style>