Commit dfbb0908db38db610da507571ea2d66b5ec3820e
1 parent
12bacbdc
盘点明细可以添加盘盈的物料子明细
Showing
6 changed files
with
207 additions
and
16 deletions
ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -159,6 +159,8 @@ export const selectPort = (params) => postAction('/task/taskHeader/selectPort', |
159 | 159 | export const createOverStationTask = (params) => postAction('/task/taskHeader/createOverStationTask', params); |
160 | 160 | //盘点任务创建 |
161 | 161 | export const stockTakeTask = (params,headerId,code) => postAction('/cycleCountDetail/cycleCountDetail/stockTakeTask?ids='+params+'&headerId='+headerId+'&code='+code, code); |
162 | +//盘盈添加 | |
163 | +export const increaseInInventoryGain = (params) => postAction('/cycleCountDetail/cycleCountDetail/increaseInInventoryGain', params); | |
162 | 164 | //盘点任务生成 |
163 | 165 | export const createCycleCoutTaskByDetailId = (params,toPort) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCoutTaskByDetailId?cycleId='+params+'&toPort='+toPort, params); |
164 | 166 | //盘点确定实盘数量 |
... | ... |
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
... | ... | @@ -72,8 +72,11 @@ |
72 | 72 | <span>下载</span> |
73 | 73 | </a-button> |
74 | 74 | </template> |
75 | - | |
75 | + CycleCountDetailChiIdModal | |
76 | 76 | <template slot="action" slot-scope="text, record"> |
77 | + <cycle-count-detail-chi-id-modal ref="adjustmentModal" @ok="modalFormOk" :id="record.id"/> | |
78 | + <a @click="createMany()"><a-icon/>新增</a> | |
79 | + <a-divider type="vertical"/> | |
77 | 80 | <a v-if="record.enableStatus === 1" @click="selectPort(record)">生成盘点任务</a> |
78 | 81 | <a-divider v-if="record.enableStatus === 1" type="vertical"/> |
79 | 82 | <a @click="loadDatas(record.cycleCountHeadId)"><a-icon type="sync"/>刷新</a> |
... | ... | @@ -101,6 +104,7 @@ |
101 | 104 | import '@/assets/less/TableExpand.less' |
102 | 105 | import {createCycleCoutTaskByDetailId, stockTakeTask} from "../../../api/api"; |
103 | 106 | import Utils from "../../../components/jeecgbiz/JButtonBizComponent/util.js" |
107 | + import CycleCountDetailChiIdModal from "./modules/CycleCountDetailChiIdModal"; | |
104 | 108 | |
105 | 109 | export default { |
106 | 110 | name: 'CycleCountDetailList', |
... | ... | @@ -110,6 +114,7 @@ |
110 | 114 | CycleCountDetailModal, |
111 | 115 | CycleCountDetailChildSubTable, |
112 | 116 | CycleCountSelectModal, |
117 | + CycleCountDetailChiIdModal, | |
113 | 118 | }, |
114 | 119 | props: { |
115 | 120 | record: { |
... | ... | @@ -333,7 +338,12 @@ |
333 | 338 | fieldList.push({type:'string',value:'completedAt',text:'完成时间',dictCode:''}) |
334 | 339 | fieldList.push({type:'string',value:'enableStatus',text:'盘点明细状态',dictCode:''}) |
335 | 340 | this.superFieldList = fieldList |
336 | - } | |
341 | + }, | |
342 | + | |
343 | + createMany() { | |
344 | + this.$refs.adjustmentModal.edit(); | |
345 | + this.$refs.adjustmentModal.title = "实盘登记"; | |
346 | + }, | |
337 | 347 | } |
338 | 348 | } |
339 | 349 | </script> |
... | ... |
ant-design-vue-jeecg/src/views/system/stocktaking/modules/CycleCountDetailChiIdModal.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 :xs="24"> | |
15 | + <a-form-model-item label="物料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode"> | |
16 | + <j-search-select-tag | |
17 | + v-model="model.materialCode" | |
18 | + :dictOptions="materialList" | |
19 | + :trigger-change="true" | |
20 | + placeholder="请选择物料编码" | |
21 | + @change="searchMaterial"> | |
22 | + </j-search-select-tag> | |
23 | + </a-form-model-item> | |
24 | + </a-col> | |
25 | + <a-col :xs="24"> | |
26 | + <a-form-model-item label="实盘数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="countedQty"> | |
27 | + <a-input v-model="model.countedQty" placeholder="请输入实盘数量"></a-input> | |
28 | + </a-form-model-item> | |
29 | + </a-col> | |
30 | + <a-col :span="24"> | |
31 | + <a-form-model-item label="库存状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryStatus"> | |
32 | + <j-dict-select-tag type="list" v-model="model.inventoryStatus" dictCode="inventory_status" | |
33 | + placeholder="请选择库存状态"/> | |
34 | + </a-form-model-item> | |
35 | + </a-col> | |
36 | + <a-col :xs="24"> | |
37 | + <a-form-model-item label="批次" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batch"> | |
38 | + <a-input v-model="model.batch" placeholder="请输入批次"></a-input> | |
39 | + </a-form-model-item> | |
40 | + </a-col> | |
41 | + </a-row> | |
42 | + </a-form-model> | |
43 | + </a-spin> | |
44 | + </j-modal> | |
45 | +</template> | |
46 | + | |
47 | +<script> | |
48 | + | |
49 | +import {createManyEmptyIn} from '@/api/api' | |
50 | +import {increaseInInventoryGain} from "../../../../api/api"; | |
51 | +import {searchMaterialByCode} from '@/api/api'; | |
52 | +import Utils from '../../../../components/jeecgbiz/JButtonBizComponent/util.js'; | |
53 | + | |
54 | +export default { | |
55 | + name: "CycleCountDetailChiIdModal", | |
56 | + components: {}, | |
57 | + props: { | |
58 | + id: "", | |
59 | + }, | |
60 | + data() { | |
61 | + return { | |
62 | + title: "操作", | |
63 | + width: 500, | |
64 | + visible: false, | |
65 | + model: { | |
66 | + cycleCountDetailid:this.id, | |
67 | + materialCode:'', | |
68 | + batch:'', | |
69 | + countedQty:'', | |
70 | + }, | |
71 | + materialList: {}, | |
72 | + querySource: {}, | |
73 | + labelCol: { | |
74 | + xs: {span: 24}, | |
75 | + sm: {span: 5}, | |
76 | + }, | |
77 | + wrapperCol: { | |
78 | + xs: {span: 24}, | |
79 | + sm: {span: 16}, | |
80 | + }, | |
81 | + | |
82 | + confirmLoading: false, | |
83 | + validatorRules: { | |
84 | + countedQty: [ | |
85 | + {required: true, message: '请输入实盘数量!'}, | |
86 | + ], | |
87 | + }, | |
88 | + url: { | |
89 | + add: "/cycleCountDetail/cycleCountDetail/increaseInInventoryGain", | |
90 | + } | |
91 | + | |
92 | + } | |
93 | + }, | |
94 | + | |
95 | + | |
96 | + created() { | |
97 | + //备份model原始值 | |
98 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
99 | + this.searchMaterial(); | |
100 | + this.model.inventoryStatus = "good"; | |
101 | + }, | |
102 | + | |
103 | + methods: { | |
104 | + searchMaterial() { | |
105 | + const that = this; | |
106 | + that.querySource.materialCode = that.model.materialCode; | |
107 | + searchMaterialByCode(that.querySource).then((res) => { | |
108 | + that.materialList = res.result; | |
109 | + }) | |
110 | + }, | |
111 | + add() { | |
112 | + this.edit(this.modelDefault); | |
113 | + }, | |
114 | + edit() { | |
115 | + this.visible = true; | |
116 | + }, | |
117 | + close() { | |
118 | + this.$emit('close'); | |
119 | + this.visible = false; | |
120 | + this.$refs.form.clearValidate(); | |
121 | + }, | |
122 | + handleOk() { | |
123 | + const that = this; | |
124 | + // 触发表单验证 | |
125 | + this.$refs.form.validate(valid => { | |
126 | + if (valid) { | |
127 | + that.confirmLoading = true; | |
128 | + increaseInInventoryGain(this.model).then((res) => { | |
129 | + if (res.success) { | |
130 | + that.$message.success(res.message); | |
131 | + that.$emit('ok'); | |
132 | + that.model.containerCode = ''; | |
133 | + that.model.toLocationCode = ''; | |
134 | + Utils.$emit('methodB',res.result); | |
135 | + } else { | |
136 | + that.$message.warning(res.message); | |
137 | + } | |
138 | + }).finally(() => { | |
139 | + that.confirmLoading = false; | |
140 | + that.close(); | |
141 | + }) | |
142 | + } else { | |
143 | + return false | |
144 | + } | |
145 | + }) | |
146 | + }, | |
147 | + handleCancel() { | |
148 | + this.close() | |
149 | + }, | |
150 | + | |
151 | + | |
152 | + } | |
153 | +} | |
154 | +</script> | |
0 | 155 | \ No newline at end of file |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -131,23 +131,16 @@ public class CycleCountDetailController extends HuahengBaseController { |
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | - * 编辑 | |
134 | + * 盘盈增加明细 | |
135 | 135 | * |
136 | - * @param cycleCountDetailPage | |
136 | + * @param | |
137 | 137 | * @return |
138 | 138 | */ |
139 | - @AutoLog(value = "盘点明细表-编辑") | |
140 | - @ApiOperation(value="盘点明细表-编辑", notes="盘点明细表-编辑") | |
141 | - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |
142 | - public Result<String> edit(@RequestBody CycleCountDetailPage cycleCountDetailPage) { | |
143 | - CycleCountDetail cycleCountDetail = new CycleCountDetail(); | |
144 | - BeanUtils.copyProperties(cycleCountDetailPage, cycleCountDetail); | |
145 | - CycleCountDetail cycleCountDetailEntity = cycleCountDetailService.getById(cycleCountDetail.getId()); | |
146 | - if(cycleCountDetailEntity==null) { | |
147 | - return Result.error("未找到对应数据"); | |
148 | - } | |
149 | - cycleCountDetailService.updateMain(cycleCountDetail, cycleCountDetailPage.getCycleCountDetailChildList()); | |
150 | - return Result.OK("编辑成功!"); | |
139 | + @AutoLog(value = "盘点盘盈-增加明细") | |
140 | + @ApiOperation(value="盘点盘盈-增加明细", notes="盘点盘盈-增加明细") | |
141 | + @RequestMapping(value = "/increaseInInventoryGain", method = {RequestMethod.PUT,RequestMethod.POST}) | |
142 | + public Result<String> increaseInInventoryGain(@RequestBody CycleCountDetailChild cycleCountDetailChild) { | |
143 | + return cycleCountDetailService.increaseInInventoryGain(cycleCountDetailChild); | |
151 | 144 | } |
152 | 145 | |
153 | 146 | /** |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
... | ... | @@ -42,4 +42,5 @@ public interface ICycleCountDetailService extends IService<CycleCountDetail> { |
42 | 42 | |
43 | 43 | Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId,String toPort,String warehouseCode); |
44 | 44 | |
45 | + Result increaseInInventoryGain(CycleCountDetailChild cycleCountDetailChild); | |
45 | 46 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... | ... | @@ -8,6 +8,9 @@ import org.jeecg.modules.wms.config.container.entity.Container; |
8 | 8 | import org.jeecg.modules.wms.config.container.service.impl.ContainerServiceImpl; |
9 | 9 | import org.jeecg.modules.wms.config.location.entity.Location; |
10 | 10 | import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl; |
11 | +import org.jeecg.modules.wms.config.material.entity.Material; | |
12 | +import org.jeecg.modules.wms.config.material.service.impl.MaterialServiceImpl; | |
13 | +import org.jeecg.modules.wms.config.materialType.entity.MaterialType; | |
11 | 14 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
12 | 15 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
13 | 16 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; |
... | ... | @@ -57,6 +60,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
57 | 60 | private LocationServiceImpl locationService; |
58 | 61 | @Resource |
59 | 62 | private TaskHeaderServiceImpl taskHeaderService; |
63 | + @Autowired | |
64 | + private ICycleCountDetailService cycleCountDetailService; | |
65 | + @Resource | |
66 | + private MaterialServiceImpl materialServiceImpl; | |
60 | 67 | @Resource |
61 | 68 | private TaskDetailServiceImpl taskDetailService; |
62 | 69 | @Resource |
... | ... | @@ -320,5 +327,29 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
320 | 327 | return result; |
321 | 328 | } |
322 | 329 | |
330 | + @Override | |
331 | + public Result increaseInInventoryGain(CycleCountDetailChild cycleCountDetailChild) { | |
332 | + CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(cycleCountDetailChild.getCycleCountDetailid()); | |
333 | + if (cycleCountDetail==null) | |
334 | + { | |
335 | + return Result.error("盘点明细不存在"); | |
336 | + } | |
337 | + | |
338 | + cycleCountDetailChild.setCyclecountheadcode(cycleCountDetail.getCycleCountHeadCode()); | |
339 | + cycleCountDetailChild.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_REGISTERED); | |
340 | + cycleCountDetailChild.setLocationCode(cycleCountDetail.getLocationCode()); | |
341 | + cycleCountDetailChild.setContainerCode(cycleCountDetail.getContainerCode()); | |
342 | + | |
343 | + Material materialByCode = materialServiceImpl.getMaterialByCode(cycleCountDetailChild.getMaterialCode()); | |
344 | + cycleCountDetailChild.setMaterialName(materialByCode.getName()); | |
345 | + cycleCountDetailChild.setMaterialSpec(materialByCode.getSpec()); | |
346 | + cycleCountDetailChild.setMaterialUnit(materialByCode.getUnit()); | |
347 | + cycleCountDetailChild.setSystemQty(BigDecimal.ZERO); | |
348 | + cycleCountDetailChild.setGapQty(BigDecimal.ZERO.subtract(cycleCountDetailChild.getCountedQty())); | |
349 | + cycleCountDetailChildServiceImpl.save(cycleCountDetailChild); | |
350 | + | |
351 | + return Result.ok("成功"); | |
352 | + } | |
353 | + | |
323 | 354 | |
324 | 355 | } |
... | ... |