Commit 7656d77c601dd45de1836e47be40f84bb61c4b49
1 parent
992ab8b4
增加配盘界面
Showing
8 changed files
with
265 additions
and
9 deletions
jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -161,6 +161,10 @@ export const getPrintContainer = (params)=>postAction('/config/container/getPrin |
161 | 161 | export const getPrintLocation = (params)=>postAction('/config/location/getPrintContent?ids=' + params, params); |
162 | 162 | //获取物料打印数据 |
163 | 163 | export const getMaterialLocation = (params)=>postAction('/config/material/getPrintContent?ids=' + params, params); |
164 | +//根据出库单头ID查询出库单详情 | |
165 | +export const listShipmentByShipmentDetailId = (params)=>postAction('/shipment/shipmentCombination/listShipmentByShipmentDetailId', params); | |
166 | +//获取物料打印数据 | |
167 | +export const getInventoryFromShipmentDetail = (params)=>postAction('/shipment/shipmentCombination/getInventoryFromShipmentDetail?id=' + params, params); | |
164 | 168 | |
165 | 169 | // 中转HTTP请求 |
166 | 170 | export const transitRESTful = { |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... | ... | @@ -163,7 +163,7 @@ |
163 | 163 | <span slot="action" slot-scope="text, record"> |
164 | 164 | <a @click="handleEdit(record)">编辑</a> |
165 | 165 | <a-divider type="vertical" /> |
166 | - <a @click="receive(record)">收货</a> | |
166 | + <a v-if="record.lastStatus < 800" @click="receive(record)">组盘</a> | |
167 | 167 | <a-divider type="vertical" /> |
168 | 168 | <a-dropdown> |
169 | 169 | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
... | ... | @@ -352,7 +352,7 @@ |
352 | 352 | }, |
353 | 353 | receive(record){ |
354 | 354 | this.$refs.modalForm2.edit(record); |
355 | - this.$refs.modalForm2.title = "收货"; | |
355 | + this.$refs.modalForm2.title = "组盘"; | |
356 | 356 | }, |
357 | 357 | clickThenSelect(record) { |
358 | 358 | return { |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... | ... | @@ -62,6 +62,8 @@ |
62 | 62 | </template> |
63 | 63 | |
64 | 64 | <span slot="action" slot-scope="text, record"> |
65 | + <a @click="combine(record)">配盘</a> | |
66 | + <a-divider type="vertical" /> | |
65 | 67 | <a @click="edit(record)">编辑</a> |
66 | 68 | <a-divider type="vertical" /> |
67 | 69 | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
... | ... | @@ -74,6 +76,8 @@ |
74 | 76 | |
75 | 77 | <shipmentDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></shipmentDetail-modal> |
76 | 78 | <shipment-detail-edit-modal ref="modalEditForm" @ok="modalFormOk" :mainId="mainId"></shipment-detail-edit-modal> |
79 | + <shipment-detail-combine-modal ref="modalCombineForm" @ok="modalFormOk" :mainId="mainId"></shipment-detail-combine-modal> | |
80 | + | |
77 | 81 | </a-card> |
78 | 82 | </template> |
79 | 83 | |
... | ... | @@ -82,11 +86,12 @@ |
82 | 86 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
83 | 87 | import ShipmentDetailModal from './modules/ShipmentDetailModal' |
84 | 88 | import ShipmentDetailEditModal from './modules/ShipmentDetailEditModal' |
89 | + import ShipmentDetailCombineModal from './modules/ShipmentDetailCombineModal' | |
85 | 90 | |
86 | 91 | export default { |
87 | 92 | name: "ShipmentDetailList", |
88 | 93 | mixins:[JeecgListMixin], |
89 | - components: { ShipmentDetailEditModal, ShipmentDetailModal }, | |
94 | + components: { ShipmentDetailCombineModal, ShipmentDetailEditModal, ShipmentDetailModal }, | |
90 | 95 | props:{ |
91 | 96 | mainId:{ |
92 | 97 | type:String, |
... | ... | @@ -218,6 +223,11 @@ |
218 | 223 | this.selectedRowKeys=[] |
219 | 224 | this.ipagination.current = 1 |
220 | 225 | }, |
226 | + combine (record) { | |
227 | + this.$refs.modalCombineForm.edit(record); | |
228 | + this.$refs.modalCombineForm.title = "配盘"; | |
229 | + this.$refs.modalCombineForm.disableSubmit = false; | |
230 | + }, | |
221 | 231 | edit (record) { |
222 | 232 | this.$refs.modalEditForm.edit(record); |
223 | 233 | this.$refs.modalEditForm.title = "编辑"; |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentDetailCombineModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + :confirmLoading="confirmLoading" | |
7 | + switchFullscreen | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <a-spin :spinning="confirmLoading"> | |
12 | + <a-form-model ref="form" :model="model" :rules="validatorRules"> | |
13 | + <a-row> | |
14 | + <a-col :span="24"> | |
15 | + <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode"> | |
16 | + <a-input v-model="model.materialCode"placeholder="请输入物料编码" style="width: 100%" /> | |
17 | + </a-form-model-item> | |
18 | + </a-col> | |
19 | + <a-col :span="24"> | |
20 | + <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> | |
21 | + <a-input v-model="model.materialName"placeholder="请输入物料名称" style="width: 100%" /> | |
22 | + </a-form-model-item> | |
23 | + </a-col> | |
24 | + <a-col :span="24"> | |
25 | + <a-form-model-item label="可出数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty"> | |
26 | + <a-input-number v-model="model.qty"placeholder="请输入可出数量" style="width: 100%" /> | |
27 | + </a-form-model-item> | |
28 | + </a-col> | |
29 | + <a-col :span="24"> | |
30 | + <a-form-model-item label="出库数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskQty"> | |
31 | + <a-input-number v-model="model.taskQty"placeholder="请输入出库数量" style="width: 100%" /> | |
32 | + </a-form-model-item> | |
33 | + </a-col> | |
34 | + </a-row> | |
35 | + </a-form-model> | |
36 | + </a-spin> | |
37 | + </j-modal> | |
38 | +</template> | |
39 | + | |
40 | +<script> | |
41 | + | |
42 | + import { httpAction } from '@/api/manage' | |
43 | + import { validateDuplicateValue } from '@/utils/util' | |
44 | + import {searchMaterialByCode, getInventoryFromShipmentDetail} from '@/api/api' | |
45 | + import {listShipmentByShipmentDetailId} from '@/api/api' | |
46 | + | |
47 | + export default { | |
48 | + name: "ShipmentDetailCombineModal", | |
49 | + components: { | |
50 | + }, | |
51 | + props:{ | |
52 | + mainId:{ | |
53 | + type:String, | |
54 | + required:false, | |
55 | + default:'' | |
56 | + } | |
57 | + }, | |
58 | + data () { | |
59 | + return { | |
60 | + title:"操作", | |
61 | + width:800, | |
62 | + /* 数据源 */ | |
63 | + dataSource:[], | |
64 | + visible: false, | |
65 | + materialList:{}, | |
66 | + querySource:{}, | |
67 | + model:{ | |
68 | + }, | |
69 | + labelCol: { | |
70 | + xs: { span: 24 }, | |
71 | + sm: { span: 5 }, | |
72 | + }, | |
73 | + wrapperCol: { | |
74 | + xs: { span: 24 }, | |
75 | + sm: { span: 16 }, | |
76 | + }, | |
77 | + | |
78 | + confirmLoading: false, | |
79 | + validatorRules: { | |
80 | + }, | |
81 | + url: { | |
82 | + add: "/shipment/shipmentHeader/addShipmentDetail", | |
83 | + edit: "/shipment/shipmentHeader/editShipmentDetail", | |
84 | + } | |
85 | + | |
86 | + } | |
87 | + }, | |
88 | + created () { | |
89 | + //备份model原始值 | |
90 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
91 | + this.searchMaterial(); | |
92 | + }, | |
93 | + methods: { | |
94 | + add () { | |
95 | + this.edit(this.modelDefault); | |
96 | + this.model.inventoryStatus = "good"; | |
97 | + }, | |
98 | + edit (record) { | |
99 | + // this.model = Object.assign({}, record); | |
100 | + this.searchShipment(record); | |
101 | + }, | |
102 | + close () { | |
103 | + this.$emit('close'); | |
104 | + this.visible = false; | |
105 | + this.$refs.form.clearValidate(); | |
106 | + }, | |
107 | + searchShipment(record) { | |
108 | + const that = this; | |
109 | + that.querySource = record; | |
110 | + listShipmentByShipmentDetailId(that.querySource).then((res) => { | |
111 | + this.model = res.result; | |
112 | + this.visible = true; | |
113 | + }); | |
114 | + getInventoryFromShipmentDetail(that.querySource.id).then((res) => { | |
115 | + this.dataSource = res.result; | |
116 | + }); | |
117 | + }, | |
118 | + handleOk () { | |
119 | + const that = this; | |
120 | + // 触发表单验证 | |
121 | + this.$refs.form.validate(valid => { | |
122 | + if (valid) { | |
123 | + that.confirmLoading = true; | |
124 | + let httpurl = ''; | |
125 | + let method = ''; | |
126 | + if(!this.model.id){ | |
127 | + httpurl+=this.url.add; | |
128 | + method = 'post'; | |
129 | + }else{ | |
130 | + httpurl+=this.url.edit; | |
131 | + method = 'put'; | |
132 | + } | |
133 | + this.model['shipmentId'] = this.mainId | |
134 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
135 | + if(res.success){ | |
136 | + that.$message.success(res.message); | |
137 | + that.$emit('ok'); | |
138 | + }else{ | |
139 | + that.$message.warning(res.message); | |
140 | + } | |
141 | + }).finally(() => { | |
142 | + that.confirmLoading = false; | |
143 | + that.close(); | |
144 | + }) | |
145 | + }else{ | |
146 | + return false | |
147 | + } | |
148 | + }) | |
149 | + }, | |
150 | + handleCancel () { | |
151 | + this.close() | |
152 | + }, | |
153 | + searchMaterial() { | |
154 | + const that = this; | |
155 | + that.querySource.materialCode = that.model.materialCode; | |
156 | + console.log("model.materialCode:" + that.model.materialCode); | |
157 | + searchMaterialByCode(that.querySource).then((res) => { | |
158 | + that.materialList = res.result; | |
159 | + }) | |
160 | + }, | |
161 | + | |
162 | + } | |
163 | + } | |
164 | +</script> | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/controller/ReceiveController.java
... | ... | @@ -37,10 +37,11 @@ public class ReceiveController { |
37 | 37 | private IReceiveService receiveService; |
38 | 38 | |
39 | 39 | /** |
40 | - * 通过主表ID查询 | |
40 | + * 通过详情ID查询 | |
41 | 41 | * @return |
42 | 42 | */ |
43 | - @ApiOperation(value="入库单详情-通过主表ID查询", notes="入库单详情-通过主表ID查询") | |
43 | + @AutoLog("入库单详情-通过详情ID查询") | |
44 | + @ApiOperation(value="入库单详情-通过详情ID查询", notes="入库单详情-通过详情ID查询") | |
44 | 45 | @PostMapping("/listReceiveByReceiptId") |
45 | 46 | @ResponseBody |
46 | 47 | public Result listReceiveByReceiptId(@RequestBody ReceiptDetail receiptDetailDomain) { |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/shipmentCombinationController.java renamed to jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java
1 | 1 | package org.jeecg.modules.wms.shipment.shipmentCombination.controller; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
4 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 6 | import io.swagger.annotations.Api; |
6 | 7 | import io.swagger.annotations.ApiOperation; |
7 | 8 | import lombok.extern.slf4j.Slf4j; |
8 | 9 | import org.jeecg.common.api.vo.Result; |
9 | 10 | import org.jeecg.common.aspect.annotation.AutoLog; |
11 | +import org.jeecg.common.system.query.QueryGenerator; | |
10 | 12 | import org.jeecg.common.system.util.JwtUtil; |
11 | 13 | import org.jeecg.modules.wms.config.location.entity.Location; |
12 | 14 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
... | ... | @@ -15,8 +17,10 @@ import org.jeecg.modules.wms.config.port.service.IPortService; |
15 | 17 | import org.jeecg.modules.wms.config.zone.entity.Zone; |
16 | 18 | import org.jeecg.modules.wms.config.zone.service.IZoneService; |
17 | 19 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
20 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | |
18 | 21 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; |
19 | 22 | import org.jeecg.modules.wms.receipt.receiving.domain.Receive; |
23 | +import org.jeecg.modules.wms.shipment.shipmentCombination.entity.Shipment; | |
20 | 24 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; |
21 | 25 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
22 | 26 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
... | ... | @@ -28,6 +32,8 @@ import org.springframework.web.bind.annotation.*; |
28 | 32 | |
29 | 33 | import javax.annotation.Resource; |
30 | 34 | import javax.servlet.http.HttpServletRequest; |
35 | +import java.math.BigDecimal; | |
36 | +import java.util.ArrayList; | |
31 | 37 | import java.util.List; |
32 | 38 | |
33 | 39 | /** |
... | ... | @@ -37,7 +43,7 @@ import java.util.List; |
37 | 43 | @RestController |
38 | 44 | @RequestMapping("/shipment/shipmentCombination") |
39 | 45 | @Slf4j |
40 | -public class shipmentCombinationController { | |
46 | +public class ShipmentCombinationController { | |
41 | 47 | |
42 | 48 | @Resource |
43 | 49 | private IShipmentDetailService shipmentDetailService; |
... | ... | @@ -143,7 +149,31 @@ public class shipmentCombinationController { |
143 | 149 | @PostMapping("/getInventoryFromShipmentDetail") |
144 | 150 | @ResponseBody |
145 | 151 | public Result getInventoryFromShipmentDetail(@RequestParam(name="id",required=true) Integer id, HttpServletRequest req) { |
146 | - | |
147 | 152 | return shipmentCombinationService.getInventoryFromShipmentDetail(id); |
148 | 153 | } |
154 | + | |
155 | + /** | |
156 | + * 通过详情ID查询 | |
157 | + * @return | |
158 | + */ | |
159 | + @AutoLog("出库单详情-通过详情ID查询") | |
160 | + @ApiOperation(value="出库单详情-通过详情ID查询", notes="出库单详情-通过详情ID查询") | |
161 | + @PostMapping("/listShipmentByShipmentDetailId") | |
162 | + @ResponseBody | |
163 | + public Result listShipmentByShipmentDetailId(@RequestBody ShipmentDetail shipmentDetail) { | |
164 | + Shipment shipment = new Shipment(); | |
165 | + shipment.setId(shipmentDetail.getId()); | |
166 | + shipment.setMaterialCode(shipmentDetail.getMaterialCode()); | |
167 | + shipment.setMaterialName(shipmentDetail.getMaterialName()); | |
168 | + //计算待收数量 | |
169 | + BigDecimal qty = shipmentDetail.getQty().subtract(shipmentDetail.getTaskQty()); | |
170 | + if(qty.compareTo(BigDecimal.ZERO) < 0) { | |
171 | + return Result.error("待收数量小于0"); | |
172 | + } | |
173 | + //可出数量 | |
174 | + shipment.setQty(qty); | |
175 | + //锁定数量 | |
176 | + shipment.setTaskQty(BigDecimal.ZERO); | |
177 | + return Result.ok(shipment); | |
178 | + } | |
149 | 179 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/entity/Shipment.java
0 → 100644
1 | +package org.jeecg.modules.wms.shipment.shipmentCombination.entity; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.math.BigDecimal; | |
6 | + | |
7 | +/** | |
8 | + * @author 游杰 | |
9 | + */ | |
10 | +@Data | |
11 | +public class Shipment { | |
12 | + | |
13 | + private Integer id; | |
14 | + private String materialCode; | |
15 | + private String materialName; | |
16 | + private BigDecimal qty; //可收数量 | |
17 | + private BigDecimal taskQty; //实收数量 | |
18 | + | |
19 | + | |
20 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -561,8 +561,35 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
561 | 561 | List<InventoryDetail> removeInventoryList = new ArrayList<>(); |
562 | 562 | for(InventoryDetail inventoryDetail : inventoryDetailList) { |
563 | 563 | String containerCode = inventoryDetail.getContainerCode(); |
564 | - Container container = | |
564 | + Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
565 | + if(container == null) { | |
566 | + return Result.error("没有找到容器,容器号" + containerCode); | |
567 | + } | |
568 | + if(container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) { | |
569 | + removeInventoryList.add(inventoryDetail); | |
570 | + } | |
571 | + } | |
572 | + List<ReceiptContainerHeader> unCompleteCombineList = | |
573 | + receiptContainerHeaderService.getUnCompleteCombineList(); | |
574 | + if(unCompleteCombineList != null && unCompleteCombineList.size() > 0) { | |
575 | + for(ReceiptContainerHeader receiptContainerHeader : unCompleteCombineList) { | |
576 | + String containerCode = receiptContainerHeader.getContainerCode(); | |
577 | + for(InventoryDetail item : inventoryDetailList) { | |
578 | + if(containerCode.equals(item.getContainerCode())) { | |
579 | + if(!removeInventoryList.contains(item)) { | |
580 | + removeInventoryList.add(item); | |
581 | + } | |
582 | + break; | |
583 | + } | |
584 | + } | |
585 | + } | |
586 | + } | |
587 | + if(removeInventoryList.size() > 0) { | |
588 | + boolean success = inventoryDetailList.removeAll(removeInventoryList); | |
589 | + if (!success) { | |
590 | + throw new ServiceException("移除库存失败"); | |
591 | + } | |
565 | 592 | } |
566 | - return null; | |
593 | + return Result.ok(inventoryDetailList); | |
567 | 594 | } |
568 | 595 | } |
... | ... |