warehousing.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. <searchWarehousing ref="search" @search="reload"></searchWarehousing>
  15. <ele-pro-table
  16. ref="equiTable"
  17. :columns="columns"
  18. :datasource="datasource"
  19. :selection.sync="selection"
  20. :current.sync="current"
  21. highlight-current-row
  22. row-key="id"
  23. height="50vh"
  24. @done="onDone"
  25. >
  26. </ele-pro-table>
  27. </el-col>
  28. </el-row>
  29. </div>
  30. <div class="btns">
  31. <el-button type="primary" size="small" @click="selected">选择</el-button>
  32. <el-button size="small" @click="handleClose">关闭</el-button>
  33. </div>
  34. </el-dialog>
  35. </template>
  36. <script>
  37. import {
  38. purchaseorderreceive,
  39. purchaseorderreceiveGetById
  40. } from '@/api/inspectionPlan/index.js';
  41. import searchWarehousing from './searchWarehousing.vue';
  42. export default {
  43. components: {
  44. searchWarehousing
  45. },
  46. props: {
  47. selectList: Array,
  48. type: {
  49. default: 2 //1多选 2单选
  50. }
  51. },
  52. data() {
  53. return {
  54. equipmentdialog: false,
  55. current: null,
  56. columns: [
  57. {
  58. width: 45,
  59. type: 'selection',
  60. columnKey: 'selection',
  61. align: 'center',
  62. reserveSelection: true,
  63. show: this.type == 1
  64. },
  65. {
  66. columnKey: 'index',
  67. label: '序号',
  68. type: 'index',
  69. width: 55,
  70. align: 'center',
  71. showOverflowTooltip: true
  72. },
  73. {
  74. prop: 'receiveNo',
  75. label: '收货单编码',
  76. align: 'center',
  77. slot: 'receiveNo',
  78. showOverflowTooltip: true,
  79. minWidth: 140
  80. },
  81. {
  82. prop: 'orderNo',
  83. label: '采购订单编码',
  84. align: 'center',
  85. slot: 'orderNo',
  86. showOverflowTooltip: true,
  87. minWidth: 140
  88. },
  89. {
  90. prop: 'batchNo',
  91. label: '批次号',
  92. align: 'center',
  93. slot: 'orderNo',
  94. showOverflowTooltip: true,
  95. minWidth: 140
  96. },
  97. {
  98. prop: 'productCode',
  99. label: '产品编号',
  100. align: 'center',
  101. showOverflowTooltip: true,
  102. minWidth: 140
  103. },
  104. {
  105. prop: 'productName',
  106. label: '产品名称',
  107. align: 'center',
  108. showOverflowTooltip: true,
  109. minWidth: 140
  110. },
  111. {
  112. prop: 'specification',
  113. label: '规格',
  114. align: 'center',
  115. showOverflowTooltip: true,
  116. minWidth: 140
  117. },
  118. {
  119. prop: 'modelType',
  120. label: '型号',
  121. align: 'center',
  122. showOverflowTooltip: true,
  123. minWidth: 140
  124. },
  125. {
  126. prop: 'productBrand',
  127. label: '牌号',
  128. align: 'center',
  129. showOverflowTooltip: true,
  130. minWidth: 140
  131. },
  132. {
  133. prop: 'supplierMark',
  134. label: '供应商代号',
  135. align: 'center',
  136. showOverflowTooltip: true,
  137. minWidth: 140
  138. },
  139. {
  140. prop: 'warehouseName',
  141. label: '仓库名称',
  142. align: 'center',
  143. showOverflowTooltip: true,
  144. minWidth: 140
  145. },
  146. {
  147. prop: 'totalCount',
  148. label: '进货数量',
  149. align: 'center',
  150. showOverflowTooltip: true,
  151. minWidth: 120
  152. },
  153. {
  154. prop: 'singlePrice',
  155. label: '单价',
  156. align: 'center',
  157. showOverflowTooltip: true,
  158. minWidth: 120
  159. },
  160. {
  161. prop: 'remark',
  162. label: '备注',
  163. align: 'center',
  164. showOverflowTooltip: true,
  165. minWidth: 120
  166. }
  167. ],
  168. categoryLevelId: null,
  169. code: null,
  170. selection: [],
  171. ids: []
  172. };
  173. },
  174. watch: {},
  175. methods: {
  176. datasource({ page, where, limit }) {
  177. return purchaseorderreceive({
  178. ...where,
  179. pageNum: page,
  180. reviewStatus: '2',
  181. size: limit,
  182. isQmsQuery:1
  183. });
  184. },
  185. open(ids) {
  186. this.equipmentdialog = true;
  187. },
  188. onDone() {
  189. this.$nextTick(() => {
  190. this.$refs.equiTable.setSelectedRowKeys(this.ids);
  191. });
  192. },
  193. handleClose() {
  194. this.equipmentdialog = false;
  195. this.$refs.equiTable.clearSelection();
  196. },
  197. // 选择
  198. async selected() {
  199. // let data = await purchaseorderreceiveGetById(this.current.id);
  200. // data['code'] = data.receiveNo;
  201. // data.productList = data.productList?.map((item) => {
  202. // item['brandNo'] = item.productBrand;
  203. // item['productNumber'] = item.totalCount;
  204. // return item;
  205. // });
  206. this.$emit('choose', this.current);
  207. this.handleClose();
  208. },
  209. reload(where) {
  210. this.$refs.equiTable.reload({ page: 1, where });
  211. }
  212. }
  213. };
  214. </script>
  215. <style lang="scss" scoped>
  216. .tree_col {
  217. border: 1px solid #eee;
  218. padding: 10px 0;
  219. box-sizing: border-box;
  220. max-height: 530px;
  221. overflow: auto;
  222. }
  223. .table_col {
  224. padding-left: 10px;
  225. ::v-deep .el-table th.el-table__cell {
  226. background: #f2f2f2;
  227. }
  228. }
  229. .pagination {
  230. text-align: right;
  231. padding: 10px 0;
  232. }
  233. .btns {
  234. text-align: center;
  235. padding: 10px 0;
  236. }
  237. .topsearch {
  238. margin-bottom: 15px;
  239. }
  240. </style>