Commit 407496abeba54d2583e8f2cf32ea6139ab5bde6a

Authored by xcq
1 parent 6ca14666

优化库存详情快速出库,允许修改出库数量

ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentDetailModal.vue
... ... @@ -29,11 +29,25 @@
29 29 </a-row>
30 30 </a-form-model>
31 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 45 </j-modal>
33 46 </template>
34 47  
35 48 <script>
36 49 import { getZoneList, selectOutPort, shipmentInventoryDetail } from '@/api/api'
  50 +import {getAction} from "@api/manage";
37 51  
38 52 export default {
39 53 name: 'QuickShipmentDetailModal',
... ... @@ -41,9 +55,10 @@ export default {
41 55 data() {
42 56 return {
43 57 title: '操作',
44   - width: 400,
  58 + width: 800,
45 59 portList: [],
46 60 inventoryDetailList: [],
  61 + dataSource: [],
47 62 querySource: {},
48 63 visible: false,
49 64 model: {},
... ... @@ -55,6 +70,53 @@ export default {
55 70 xs: { span: 24 },
56 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 121 selectUserQueryConfig: [],
60 122 confirmLoading: false,
... ... @@ -76,6 +138,7 @@ export default {
76 138 this.model.containerCode = record[0].containerCode
77 139 this.inventoryDetailList = record
78 140 this.getPortList()
  141 + this.searchInventoryDetailList();
79 142 },
80 143 close() {
81 144 this.$emit('close')
... ... @@ -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 170 handleOk() {
95 171 if (this.model.outPortCode === '') {
96 172 this.$message.warning('请选择出库口')
... ... @@ -101,6 +177,7 @@ export default {
101 177 shipmentInventoryDetail(this.inventoryDetailList).then(res => {
102 178 if (res.success) {
103 179 this.$message.success(res.message)
  180 + this.$emit('ok')
104 181 } else {
105 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 159 private Date updateTime;
160 160 @TableField(exist = false)
161 161 private String toPortCode;
  162 + @TableField(exist = false)
  163 + private BigDecimal shipmentQty;
  164 +
162 165  
163 166 public void setQty(BigDecimal qty) {
164 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&lt;InventoryHeaderMappe
327 327 shipmentDetail.setMaterialCode(inventoryDetail.getMaterialCode());
328 328 shipmentDetail.setInventoryStatus(inventoryDetail.getInventoryStatus());
329 329 shipmentDetail.setZoneCode(inventoryDetail.getZoneCode());
330   - shipmentDetail.setQty(inventoryDetail.getQty());
  330 + shipmentDetail.setQty(inventoryDetail.getShipmentQty());
331 331 shipmentDetail.setBatch(inventoryDetail.getBatch());
332 332 result = shipmentDetailService.saveShipmentDetail(shipmentDetail);
333 333 if (!result.isSuccess()) {
... ... @@ -343,7 +343,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl&lt;InventoryHeaderMappe
343 343 CombinationModel combinationModel = new CombinationModel();
344 344 combinationModel.setInventoryDetail(inventoryDetail);
345 345 combinationModel.setShipmentDetail(shipmentDetail);
346   - combinationModel.setShipQty(inventoryDetail.getQty());
  346 + combinationModel.setShipQty(inventoryDetail.getShipmentQty());
347 347 result = shipmentCombinationService.combination(combinationModel);
348 348 if (!result.isSuccess()) {
349 349 throw new JeecgBootException("批量快速出库,配盘失败:".concat(result.getMessage()));
... ...