Commit 27547aa8590620cbef39f20bb39f56da1889b17b
1 parent
be701034
feat(盘点明细表): 增加平库开始盘点、平库盘点结束 按钮
Showing
9 changed files
with
110 additions
and
17 deletions
ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -187,6 +187,10 @@ export const stockTakeTask = (params, headerId, code) => postAction('/cycleCount |
187 | 187 | export const increaseInInventoryGain = (params) => postAction('/cycleCountDetail/cycleCountDetail/increaseInInventoryGain', params); |
188 | 188 | //盘点任务生成 |
189 | 189 | export const createCycleCoutTaskByDetailId = (params, toPort) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCoutTaskByDetailId?cycleId=' + params + '&toPort=' + toPort, params); |
190 | +// 盘点开始执行 | |
191 | +export const completeRegister = (params) => postAction('/cycleCountDetail/cycleCountDetail/completeRegister', params); | |
192 | +//完成登记 | |
193 | +export const cycleCountStartExecute = (params) => postAction('/cycleCountDetail/cycleCountDetail/cycleCountStartExecute', params); | |
190 | 194 | //盘点登记 |
191 | 195 | export const confirmGapQty = (params) => postAction('/cycleCountDetail/cycleCountDetail/confirmGapQty', params); |
192 | 196 | //创建空托盘组入库任务 |
... | ... |
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | import CycleCountSelectModal from './modules/CycleCountSelectModal' |
103 | 103 | import CycleCountDetailChildSubTable from './subTables/CycleCountDetailChildSubTable' |
104 | 104 | import '@/assets/less/TableExpand.less' |
105 | - import {createCycleCoutTaskByDetailId, stockTakeTask} from "@/api/api"; | |
105 | + import {createCycleCoutTaskByDetailId, stockTakeTask,cycleCountStartExecute} from "@/api/api"; | |
106 | 106 | import Utils from "../../../components/jeecgbiz/JButtonBizComponent/util.js" |
107 | 107 | import CycleCountDetailChiIdModal from "./modules/CycleCountDetailChiIdModal"; |
108 | 108 | |
... | ... | @@ -291,12 +291,15 @@ |
291 | 291 | this.$refs.modalForm2.edit(record); |
292 | 292 | this.$refs.modalForm2.title = "选择出库口"; |
293 | 293 | }, |
294 | + //更新盘点明细状态为执行中 | |
294 | 295 | flatInventoryCount(record) { |
295 | - getAction(this.url.list, { | |
296 | - cycleCountHeadId: record | |
297 | - }).then((res) => { | |
296 | + cycleCountStartExecute(record).then((res) => { | |
298 | 297 | if (res.success) { |
299 | 298 | this.dataSource = res.result.records |
299 | + //刷新页面 | |
300 | + this.loadDatas(record.cycleCountHeadId); | |
301 | + }else{ | |
302 | + this.$message.warning(res.message); | |
300 | 303 | } |
301 | 304 | }).finally(() => { |
302 | 305 | this.loading = false |
... | ... |
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
... | ... | @@ -77,9 +77,15 @@ |
77 | 77 | </a-tag> |
78 | 78 | </span> |
79 | 79 | |
80 | - <span slot="statusCyc_dictText" slot-scope="statusCyc_dictText"> | |
81 | - <a-tag :key="statusCyc_dictText" :color="getStatusColor(statusCyc_dictText)"> | |
82 | - {{ statusCyc_dictText }} | |
80 | + <span slot="firstStatus_dictText" slot-scope="firstStatus_dictText"> | |
81 | + <a-tag :key="firstStatus_dictText" :color="getStatusColor(firstStatus_dictText)"> | |
82 | + {{ firstStatus_dictText }} | |
83 | + </a-tag> | |
84 | + </span> | |
85 | + | |
86 | + <span slot="lastStatus_dictText" slot-scope="lastStatus_dictText"> | |
87 | + <a-tag :key="lastStatus_dictText" :color="getStatusColor(lastStatus_dictText)"> | |
88 | + {{ lastStatus_dictText }} | |
83 | 89 | </a-tag> |
84 | 90 | </span> |
85 | 91 | |
... | ... | @@ -184,13 +190,14 @@ export default { |
184 | 190 | title: '盘点主单首状态', |
185 | 191 | align: "center", |
186 | 192 | dataIndex: 'firstStatus_dictText', |
187 | - // scopedSlots: {customRender: 'firstStatus_dictText'} | |
193 | + scopedSlots: {customRender: 'firstStatus_dictText'} | |
188 | 194 | }, |
189 | 195 | { |
190 | 196 | title: '盘点主单尾状态', |
191 | 197 | align: "center", |
192 | 198 | dataIndex: 'lastStatus_dictText', |
193 | - // scopedSlots: {customRender: 'firstStatus_dictText'} | |
199 | + key: 'lastStatus_dictText', | |
200 | + scopedSlots: {customRender: 'lastStatus_dictText'} | |
194 | 201 | }, |
195 | 202 | { |
196 | 203 | title: '指定盘点人员', |
... | ... | @@ -315,6 +322,7 @@ export default { |
315 | 322 | '新建': 'green', |
316 | 323 | '已登记': 'orange', |
317 | 324 | '盘点完成': 'grey', |
325 | + '已调整': 'Skyblue', | |
318 | 326 | default: 'blue' |
319 | 327 | }; |
320 | 328 | return colors[status] || colors.default; |
... | ... |
ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | <template slot="action" slot-scope="text, record"> |
25 | 25 | <adjustment-doc-modal ref="adjustmentModal" @ok="modalFormOk"/> |
26 | 26 | <a v-if="record.childStatus != 1" @click="createMany(record)"><a-icon />实盘登记</a> |
27 | + <a v-if="record.childStatus == 15" @click="completeRegister(record)"><a-icon />完成登记</a> | |
27 | 28 | </template> |
28 | 29 | |
29 | 30 | <template slot="fileSlot" slot-scope="text"> |
... | ... | @@ -47,6 +48,8 @@ |
47 | 48 | import { getAction } from '@api/manage' |
48 | 49 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
49 | 50 | import AdjustmentDocModal from "../modules/AdjustmentDocModal"; |
51 | + import {cycleCountStartExecute,completeRegister} from "@api/api"; | |
52 | + import Utils from "@comp/jeecgbiz/JButtonBizComponent/util"; | |
50 | 53 | |
51 | 54 | |
52 | 55 | export default { |
... | ... | @@ -171,6 +174,20 @@ |
171 | 174 | this.loading = false |
172 | 175 | }) |
173 | 176 | }, |
177 | + completeRegister(record) { | |
178 | + completeRegister(record).then((res) => { | |
179 | + if (res.success) { | |
180 | + this.dataSource = res.result.records | |
181 | + //刷新页面 | |
182 | + Utils.$emit('methodB',res.result); | |
183 | + this.loadDatas(record.cycleCountHeadId); | |
184 | + }else{ | |
185 | + this.$message.warning(res.message); | |
186 | + } | |
187 | + }).finally(() => { | |
188 | + this.loading = false | |
189 | + }) | |
190 | + }, | |
174 | 191 | createMany(id) { |
175 | 192 | this.$refs.adjustmentModal.edit(id); |
176 | 193 | this.$refs.adjustmentModal.title = "实盘登记"; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -364,4 +364,31 @@ public class CycleCountDetailController extends HuahengBaseController { |
364 | 364 | return Result.OK("文件导入失败!"); |
365 | 365 | } |
366 | 366 | |
367 | + | |
368 | + /** | |
369 | + * 盘点开始 | |
370 | + * @param | |
371 | + * @return | |
372 | + */ | |
373 | + @AutoLog(value = "盘点盘盈-盘点开始") | |
374 | + @ApiOperation(value = "盘点盘盈-盘点开始", notes = "盘点盘盈-盘点开始") | |
375 | + @RequestMapping(value = "/cycleCountStartExecute", method = {RequestMethod.PUT, RequestMethod.POST}) | |
376 | + public Result<?> cycleCountStartExecute(@RequestBody CycleCountDetail cycleCountDetail, HttpServletRequest req) { | |
377 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
378 | + return cycleCountDetailService.cycleCountStartExecute(cycleCountDetail,warehouseCode); | |
379 | + } | |
380 | + | |
381 | + /** | |
382 | + * 完成盘点 | |
383 | + * @param | |
384 | + * @return | |
385 | + */ | |
386 | + @AutoLog(value = "盘点盘盈-完成盘点") | |
387 | + @ApiOperation(value = "盘点盘盈-完成盘点", notes = "盘点盘盈-完成盘点") | |
388 | + @RequestMapping(value = "/completeRegister", method = {RequestMethod.PUT, RequestMethod.POST}) | |
389 | + public Result<?> completeRegister(@RequestBody CycleCountDetailChild cycleCountDetailChild, HttpServletRequest req) { | |
390 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
391 | + return cycleCountDetailService.completeRegister(cycleCountDetailChild,warehouseCode); | |
392 | + } | |
393 | + | |
367 | 394 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailChildService.java
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
... | ... | @@ -39,12 +39,15 @@ public interface ICycleCountDetailService extends IService<CycleCountDetail> { |
39 | 39 | Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, String toPort, String warehouseCode); |
40 | 40 | |
41 | 41 | /** |
42 | - * 平库盘点 | |
43 | - * @param cycleCountDetailId | |
42 | + * 平库盘点开始 | |
43 | + * @param cycleCountDetail | |
44 | 44 | * @param warehouseCode |
45 | 45 | * @return |
46 | 46 | */ |
47 | - Result createCycleCountTaskByDetailId(Integer cycleCountDetailId, String warehouseCode); | |
47 | + Result cycleCountStartExecute(CycleCountDetail cycleCountDetail, String warehouseCode); | |
48 | + | |
49 | + | |
50 | + Result completeRegister(CycleCountDetailChild cycleCountDetailChild, String warehouseCode); | |
48 | 51 | |
49 | 52 | Result increaseInInventoryGain(CycleCountDetailChild cycleCountDetailChild); |
50 | 53 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java
... | ... | @@ -145,4 +145,12 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl<CycleCountDeta |
145 | 145 | lambdaQuery.eq(CycleCountDetailChild::getCycleCountDetailid,mainId); |
146 | 146 | return this.list(lambdaQuery); |
147 | 147 | } |
148 | + | |
149 | + @Override | |
150 | + public boolean updateStatusById(Integer id,Integer status) { | |
151 | + LambdaUpdateWrapper<CycleCountDetailChild> updateWrapper = Wrappers.lambdaUpdate(); | |
152 | + updateWrapper.eq(CycleCountDetailChild::getId,id) | |
153 | + .set(CycleCountDetailChild::getChildStatus,status); | |
154 | + return this.update(updateWrapper); | |
155 | + } | |
148 | 156 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... | ... | @@ -368,17 +368,38 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
368 | 368 | } |
369 | 369 | |
370 | 370 | @Override |
371 | - public Result createCycleCountTaskByDetailId(Integer cycleCountDetailId, String warehouseCode) { | |
372 | - CycleCountDetail cycleCountDetail = this.getById(cycleCountDetailId); | |
373 | - if (StringUtils.isNull(cycleCountDetail)) { | |
371 | + public Result cycleCountStartExecute(CycleCountDetail cycleCountDetail, String warehouseCode) { | |
372 | + Integer cycleCountDetailId = cycleCountDetail.getId(); | |
373 | + Integer cycleCountHeadId = cycleCountDetail.getCycleCountHeadId(); | |
374 | + | |
375 | + CycleCountDetail countDetail = this.getById(cycleCountDetailId); | |
376 | + if (StringUtils.isNull(countDetail)) { | |
374 | 377 | return Result.error("盘点明细ID错误,没有该条明细"); |
375 | 378 | } |
376 | 379 | // 查出明细的子单 |
377 | - List<CycleCountDetailChild> childList = cycleCountDetailChildServiceImpl.selectByMainId(cycleCountDetail.getId()); | |
380 | + List<CycleCountDetailChild> childList = cycleCountDetailChildServiceImpl.selectByMainId(cycleCountDetailId); | |
378 | 381 | if (childList.isEmpty()) { |
379 | 382 | return Result.error("盘点明细没有子单"); |
380 | 383 | } |
381 | - return null; | |
384 | + | |
385 | + for (CycleCountDetailChild child : childList) { | |
386 | + cycleCountDetailChildServiceImpl.updateStatusById(child.getId(),QuantityConstant.CYCLECOUNT_STATUS_EXECUTING); | |
387 | + } | |
388 | + if(!cycleCountDetailService.updateTaskHeaderIdAndEnableStatusById(cycleCountDetailId,0,QuantityConstant.CYCLECOUNT_STATUS_EXECUTING,warehouseCode)){ | |
389 | + throw new JeecgBootException("更新盘点明细表状态失败"); | |
390 | + } | |
391 | + if(!cycleCountHeaderService.updateCycleHeaderStatus(cycleCountHeadId)){ | |
392 | + throw new JeecgBootException("更新盘点头表状态失败"); | |
393 | + } | |
394 | + return Result.OK(); | |
395 | + } | |
396 | + | |
397 | + @Override | |
398 | + public Result completeRegister(CycleCountDetailChild cycleCountDetailChild, String warehouseCode) { | |
399 | + if(!cycleCountDetailChildServiceImpl.updateStatusById(cycleCountDetailChild.getId(),QuantityConstant.CYCLECOUNT_STATUS_COMPLETED)){ | |
400 | + return Result.error("更新状态失败"); | |
401 | + } | |
402 | + return Result.OK(); | |
382 | 403 | } |
383 | 404 | |
384 | 405 | @Override |
... | ... |