提交即出库

This commit is contained in:
zxy 2026-01-19 16:46:19 +08:00
parent ee60c94396
commit 8cf747d3a7
9 changed files with 136 additions and 12 deletions

View File

@ -169,5 +169,6 @@ public interface ErrorCodeConstants {
ErrorCode TASK_IN_REPORT_NOT_EXISTS = new ErrorCode(1_013_005 , "该报工信息不存在,请退出刷新界面");
ErrorCode TASK_IN_REPORT_IS_FINISH = new ErrorCode(1_013_006 , "该报工已完成,不允许删除,请确认");
ErrorCode TASK_IN_REPORT_NOT_REWORK = new ErrorCode(1_013_007 , "该报工没有完成,不允许返工,请确认");
ErrorCode THIS_SHIPMENT_CANNOT_BE_INVALIDATED = new ErrorCode(1_013_008 , "该出库不允许作废,请刷新界面");
}

View File

@ -130,6 +130,15 @@ public class StorageController {
storageService.updateStorageok(updateReqVO);
return success(true);
}
@PostMapping("/returnOutBound")
@Operation(summary = "出库单作废")
@PreAuthorize("@ss.hasPermission('heli:storage:update')")
public CommonResult<Boolean> returnOutBound(@RequestParam("id") Long id) {
storageService.returnOutBound(id);
return success(true);
}
@PutMapping("/update-status")
@Operation(summary = "更新入/出库")
@Transactional
@ -158,7 +167,7 @@ public class StorageController {
}
updateReqVO = BeanUtils.toBean(targetDo, StorageSaveReqVO.class);
//出库即审核
//提交即审核
if (updateReqVO.getStockType() == 2) {
updateReqVO.setStatus(4);
}

View File

@ -83,4 +83,6 @@ public interface StorageService {
Workbook exportExcelNew(String stockNo);
Workbook exportExcelOut(String stockNo);
void returnOutBound(Long id);
}

View File

@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.chanko.yunxi.mes.framework.common.exception.ErrorCode;
import com.chanko.yunxi.mes.framework.common.exception.ServiceException;
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
import com.chanko.yunxi.mes.framework.web.core.util.WebFrameworkUtils;
import com.chanko.yunxi.mes.module.heli.controller.admin.outsourcestockboom.vo.OutsourceStockBoomSaveReqVO;
import com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory.StorageInventoryController;
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.StorageMatSaveReqVO;
@ -966,4 +968,20 @@ private StorageLogService storageLogService;
}
return unitMap;
}
@Override
public void returnOutBound(Long id) {
StorageDO storageDO = storageMapper.selectById(id);
if (storageDO == null) {
throw new ServiceException(THE_DATA_DOES_NOT_EXIST);
}
if (storageDO.getStatus() != 1){
throw new ServiceException(THIS_SHIPMENT_CANNOT_BE_INVALIDATED);
}
storageDO.setStatus(3);
Long userId = WebFrameworkUtils.getLoginUserId();
storageDO.setCancel(userId);
storageDO.setCancelTime(LocalDateTime.now());
storageMapper.updateById(storageDO);
}
}

View File

@ -69,3 +69,7 @@ export const procurementAndStorage = async (data) => {
export const isPrint = async (id: number) => {
return await request.get({ url: `/heli/storage/isPrint?id=` + id })
}
export const returnOutBound = async (id: number) => {
return await request.post({ url: `/heli/storage/returnOutBound?id=` + id })
}

View File

@ -314,9 +314,11 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
<el-button @click="() => router.go(-1)" size="large" style="margin-left: 5rem"> </el-button>
<el-button @click="isPrint()" type="primary" size="large" :loading="printLoading" > </el-button>
<el-button @click="submitForm" type="success" v-if="btnSave" size="large"> </el-button>
<el-button @click="submitForm" type="success" v-if="btnSave&&formData.status ==1" size="large"> </el-button>
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave" size="large"> </el-button>
<el-button @click="handleStatus(3)" type="danger" v-if="btnCancel&&formData.status != 2" size="large"> </el-button>
<!-- <el-button @click="handleStatus(3)" type="danger" v-if="btnCancel&&formData.status != 2" size="large"> </el-button>-->
<el-button @click="handleDelete" type="danger" v-if="btnCancel&&formData.status ==1" size="large"> </el-button>
</template>
<el-row justify="center">
@ -552,6 +554,29 @@ const matOpenFormRef1 = ref()
const proOpenFormRef = ref()
const materialOpenFormRef = ref()
/** 作废操作 */
const handleDelete = async () => {
try {
//
await message.confirm('确认要作废吗?')
// API
await StorageApi.returnOutBound(formData.value.id)
message.success('作废成功')
if (sumbefore.value == 0) {
reload()
}
} catch (error) {
//
if (error !== 'cancel') {
console.error('作废失败:', error)
}
}
}
const openMatForm = () => {
// if (formData.value.whId == undefined || formData.value.whId == '') {
// message.alertWarning('')

View File

@ -339,11 +339,13 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
<template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
<el-button @click="() => router.go(-1)" size="large" style="margin-left: 5rem"> </el-button>
<el-button @click="submitForm" type="success" v-if="btnSave" size="large">
<el-button @click="submitForm" type="success" v-if="btnSave&&formData.status ==1" size="large">
</el-button>
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave" size="large">
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave&&formData.status ==1" size="large">
</el-button>
<el-button @click="handleStatus(3)" type="danger" v-if="btnCancel" size="large">
<!-- <el-button @click="handleStatus(3)" type="danger" v-if="btnCancel&&formData.status == 1" size="large">-->
<!-- </el-button> -->
<el-button @click="handleDelete" type="danger" v-if="formData.status == 1" size="large">
</el-button>
</template>
@ -518,6 +520,26 @@ const openProjectForm = (scope) => {
proOpenFormRef.value.open(scope)
}
/** 作废操作 */
const handleDelete = async ( ) => {
try {
//
await message.confirm('确认要作废吗?')
// API
await StorageApi.returnOutBound(formData.value.id)
message.success('作废成功')
if (sumbefore.value == 0) {
reload()
}
} catch (error) {
//
if (error !== 'cancel') {
console.error('作废失败:', error)
}
}
}
const getList = async (arrMat) => {
arrMat.forEach((row) => {
@ -636,6 +658,8 @@ const deleteStorage = async() =>{
}
centerDialogVisible.value = false
}
const handleStatus = async (num) => {
formData.value.status = num
const data = formData.value as unknown as StorageApi.StorageVO

View File

@ -324,13 +324,15 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
<template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
<el-button @click="() => router.go(-1)" size="large" style="margin-left: 5rem"> </el-button>
<el-button @click="submitForm" type="success" v-if="btnSave" size="large">
<el-button @click="submitForm" type="success" v-if="btnSave&&formData.status ==1" size="large">
</el-button>
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave" size="large">
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave&&formData.status ==1" size="large">
</el-button>
<el-button @click="handleStatus(4)" type="success" v-if="btnok " size="large">审核</el-button>
<el-button @click="handleStatus(3)" type="danger" v-if="btnCancel&&formData.status != 4 " size="large">
<!-- <el-button @click="handleStatus(3)" type="danger" v-if="btnCancel&&formData.status != 4 " size="large">-->
<!-- </el-button>-->
<el-button @click="handleDelete" type="danger" v-if="btnCancel&&formData.status ==1 " size="large">
</el-button>
</template>
@ -552,6 +554,28 @@ const getProject = async (pro, scope) => {
// )
}
/** 作废操作 */
const handleDelete = async () => {
try {
//
await message.confirm('确认要作废吗?')
// API
await StorageApi.returnOutBound(formData.value.id)
message.success('作废成功')
if (sumbefore.value == 0) {
reload()
}
} catch (error) {
//
if (error !== 'cancel') {
console.error('作废失败:', error)
}
}
}
//
const enableHeadNo = ref(false)
const handleStockType = async (typeid) => {

View File

@ -187,9 +187,6 @@
<el-button link type="primary" @click="openDetail('update', scope.row.id)" v-if="scope.row.status != 3&&scope.row.status != 4">
编辑
</el-button>
<!-- <el-button link type="danger" @click="handleDelete(scope.row.id)" v-if="scope.row.status == 4">-->
<!-- 作废-->
<!-- </el-button>-->
<el-button link type="primary" @click="openDetail('review', scope.row.id)">
查看详情
</el-button>
@ -295,6 +292,26 @@ const openForm = (type: string, id?: number) => {
const openDetail = (active: string, id?: number) => {
router.push({ path: '/inventory/storageoutdetail', query: { type: active, id: id } })
}
/** 作废操作 */
const handleDelete = async (id: number) => {
try {
//
await message.confirm('确认要作废吗?')
// API
await StorageApi.returnOutBound(id)
message.success('作废成功')
await getList()
} catch (error) {
//
if (error !== 'cancel') {
console.error('作废失败:', error)
}
}
}
/** 导出按钮操作 */
const handleExport = async () => {
if (!queryParams.stockNo){