Commit 407496abeba54d2583e8f2cf32ea6139ab5bde6a
1 parent
6ca14666
优化库存详情快速出库,允许修改出库数量
Showing
3 changed files
with
83 additions
and
3 deletions
ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentDetailModal.vue
@@ -29,11 +29,25 @@ | @@ -29,11 +29,25 @@ | ||
29 | </a-row> | 29 | </a-row> |
30 | </a-form-model> | 30 | </a-form-model> |
31 | </a-spin> | 31 | </a-spin> |
32 | + <a-table ref="table" rowKey="id" size="middle" :columns="columns" :dataSource="dataSource" :pagination="false"> | ||
33 | + <span slot="action" slot-scope="text, record"> | ||
34 | + <a-input-number placeholder="" v-model="record.shipmentQty" :value="text" /> | ||
35 | + </span> | ||
36 | + | ||
37 | + | ||
38 | + <span slot="inventoryStatus" slot-scope="inventoryStatus"> | ||
39 | + <a-tag :key="inventoryStatus" color="blue" :color="getStatusColor(inventoryStatus)"> | ||
40 | + {{ solutionInvStatus(inventoryStatus) }} | ||
41 | + </a-tag> | ||
42 | + </span> | ||
43 | + | ||
44 | + </a-table> | ||
32 | </j-modal> | 45 | </j-modal> |
33 | </template> | 46 | </template> |
34 | 47 | ||
35 | <script> | 48 | <script> |
36 | import { getZoneList, selectOutPort, shipmentInventoryDetail } from '@/api/api' | 49 | import { getZoneList, selectOutPort, shipmentInventoryDetail } from '@/api/api' |
50 | +import {getAction} from "@api/manage"; | ||
37 | 51 | ||
38 | export default { | 52 | export default { |
39 | name: 'QuickShipmentDetailModal', | 53 | name: 'QuickShipmentDetailModal', |
@@ -41,9 +55,10 @@ export default { | @@ -41,9 +55,10 @@ export default { | ||
41 | data() { | 55 | data() { |
42 | return { | 56 | return { |
43 | title: '操作', | 57 | title: '操作', |
44 | - width: 400, | 58 | + width: 800, |
45 | portList: [], | 59 | portList: [], |
46 | inventoryDetailList: [], | 60 | inventoryDetailList: [], |
61 | + dataSource: [], | ||
47 | querySource: {}, | 62 | querySource: {}, |
48 | visible: false, | 63 | visible: false, |
49 | model: {}, | 64 | model: {}, |
@@ -55,6 +70,53 @@ export default { | @@ -55,6 +70,53 @@ export default { | ||
55 | xs: { span: 24 }, | 70 | xs: { span: 24 }, |
56 | sm: { span: 16 } | 71 | sm: { span: 16 } |
57 | }, | 72 | }, |
73 | + columns: [ | ||
74 | + { | ||
75 | + title: '物料编码', | ||
76 | + dataIndex: 'materialCode', | ||
77 | + align: 'center', | ||
78 | + width: 124 | ||
79 | + }, | ||
80 | + { | ||
81 | + title: '物料名称', | ||
82 | + dataIndex: 'materialName', | ||
83 | + align: 'center', | ||
84 | + width: 96 | ||
85 | + }, | ||
86 | + { | ||
87 | + title: '库存状态', | ||
88 | + align: 'center', | ||
89 | + dataIndex: 'inventoryStatus_dictText', | ||
90 | + scopedSlots: {customRender: 'inventoryStatus_dictText'} | ||
91 | + }, | ||
92 | + { | ||
93 | + title: '批次', | ||
94 | + dataIndex: 'batch', | ||
95 | + align: 'center' | ||
96 | + }, | ||
97 | + { | ||
98 | + title: '库存数量', | ||
99 | + dataIndex: 'qty', | ||
100 | + align: 'center', | ||
101 | + width: 80 | ||
102 | + }, | ||
103 | + { | ||
104 | + title: '入库日期', | ||
105 | + dataIndex: 'receiptDate', | ||
106 | + align: 'center', | ||
107 | + width: 180 | ||
108 | + }, | ||
109 | + { | ||
110 | + title: '出库数量', | ||
111 | + dataIndex: 'shipmentQty', | ||
112 | + align: 'center', | ||
113 | + key: 'action', | ||
114 | + scopedSlots: { customRender: 'action' } | ||
115 | + }, | ||
116 | + ], | ||
117 | + url: { | ||
118 | + pageByMainIds: "/inventory/inventoryDetail/pageByMainIds", | ||
119 | + }, | ||
58 | // 选择用户查询条件配置 | 120 | // 选择用户查询条件配置 |
59 | selectUserQueryConfig: [], | 121 | selectUserQueryConfig: [], |
60 | confirmLoading: false, | 122 | confirmLoading: false, |
@@ -76,6 +138,7 @@ export default { | @@ -76,6 +138,7 @@ export default { | ||
76 | this.model.containerCode = record[0].containerCode | 138 | this.model.containerCode = record[0].containerCode |
77 | this.inventoryDetailList = record | 139 | this.inventoryDetailList = record |
78 | this.getPortList() | 140 | this.getPortList() |
141 | + this.searchInventoryDetailList(); | ||
79 | }, | 142 | }, |
80 | close() { | 143 | close() { |
81 | this.$emit('close') | 144 | this.$emit('close') |
@@ -91,6 +154,19 @@ export default { | @@ -91,6 +154,19 @@ export default { | ||
91 | } | 154 | } |
92 | }) | 155 | }) |
93 | }, | 156 | }, |
157 | + searchInventoryDetailList(){ | ||
158 | + let params = { | ||
159 | + inventoryHeaderIds:"" | ||
160 | + }; | ||
161 | + this.inventoryDetailList.forEach(x=>{ | ||
162 | + params.inventoryHeaderIds+= + x.inventoryHeaderId + "," | ||
163 | + }) | ||
164 | + debugger | ||
165 | + getAction(this.url.pageByMainIds, params).then((res) => { | ||
166 | + this.dataSource = res.result.records | ||
167 | + this.inventoryDetailList = res.result.records | ||
168 | + }) | ||
169 | + }, | ||
94 | handleOk() { | 170 | handleOk() { |
95 | if (this.model.outPortCode === '') { | 171 | if (this.model.outPortCode === '') { |
96 | this.$message.warning('请选择出库口') | 172 | this.$message.warning('请选择出库口') |
@@ -101,6 +177,7 @@ export default { | @@ -101,6 +177,7 @@ export default { | ||
101 | shipmentInventoryDetail(this.inventoryDetailList).then(res => { | 177 | shipmentInventoryDetail(this.inventoryDetailList).then(res => { |
102 | if (res.success) { | 178 | if (res.success) { |
103 | this.$message.success(res.message) | 179 | this.$message.success(res.message) |
180 | + this.$emit('ok') | ||
104 | } else { | 181 | } else { |
105 | this.$message.error(res.message) | 182 | this.$message.error(res.message) |
106 | } | 183 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java
@@ -159,6 +159,9 @@ public class InventoryDetail implements Serializable { | @@ -159,6 +159,9 @@ public class InventoryDetail implements Serializable { | ||
159 | private Date updateTime; | 159 | private Date updateTime; |
160 | @TableField(exist = false) | 160 | @TableField(exist = false) |
161 | private String toPortCode; | 161 | private String toPortCode; |
162 | + @TableField(exist = false) | ||
163 | + private BigDecimal shipmentQty; | ||
164 | + | ||
162 | 165 | ||
163 | public void setQty(BigDecimal qty) { | 166 | public void setQty(BigDecimal qty) { |
164 | if (qty.compareTo(BigDecimal.ZERO) < 0) { | 167 | if (qty.compareTo(BigDecimal.ZERO) < 0) { |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java
@@ -327,7 +327,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | @@ -327,7 +327,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | ||
327 | shipmentDetail.setMaterialCode(inventoryDetail.getMaterialCode()); | 327 | shipmentDetail.setMaterialCode(inventoryDetail.getMaterialCode()); |
328 | shipmentDetail.setInventoryStatus(inventoryDetail.getInventoryStatus()); | 328 | shipmentDetail.setInventoryStatus(inventoryDetail.getInventoryStatus()); |
329 | shipmentDetail.setZoneCode(inventoryDetail.getZoneCode()); | 329 | shipmentDetail.setZoneCode(inventoryDetail.getZoneCode()); |
330 | - shipmentDetail.setQty(inventoryDetail.getQty()); | 330 | + shipmentDetail.setQty(inventoryDetail.getShipmentQty()); |
331 | shipmentDetail.setBatch(inventoryDetail.getBatch()); | 331 | shipmentDetail.setBatch(inventoryDetail.getBatch()); |
332 | result = shipmentDetailService.saveShipmentDetail(shipmentDetail); | 332 | result = shipmentDetailService.saveShipmentDetail(shipmentDetail); |
333 | if (!result.isSuccess()) { | 333 | if (!result.isSuccess()) { |
@@ -343,7 +343,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | @@ -343,7 +343,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | ||
343 | CombinationModel combinationModel = new CombinationModel(); | 343 | CombinationModel combinationModel = new CombinationModel(); |
344 | combinationModel.setInventoryDetail(inventoryDetail); | 344 | combinationModel.setInventoryDetail(inventoryDetail); |
345 | combinationModel.setShipmentDetail(shipmentDetail); | 345 | combinationModel.setShipmentDetail(shipmentDetail); |
346 | - combinationModel.setShipQty(inventoryDetail.getQty()); | 346 | + combinationModel.setShipQty(inventoryDetail.getShipmentQty()); |
347 | result = shipmentCombinationService.combination(combinationModel); | 347 | result = shipmentCombinationService.combination(combinationModel); |
348 | if (!result.isSuccess()) { | 348 | if (!result.isSuccess()) { |
349 | throw new JeecgBootException("批量快速出库,配盘失败:".concat(result.getMessage())); | 349 | throw new JeecgBootException("批量快速出库,配盘失败:".concat(result.getMessage())); |