提交即出库
This commit is contained in:
parent
ee60c94396
commit
8cf747d3a7
@ -169,5 +169,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode TASK_IN_REPORT_NOT_EXISTS = new ErrorCode(1_013_005 , "该报工信息不存在,请退出刷新界面");
|
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_IS_FINISH = new ErrorCode(1_013_006 , "该报工已完成,不允许删除,请确认");
|
||||||
ErrorCode TASK_IN_REPORT_NOT_REWORK = new ErrorCode(1_013_007 , "该报工没有完成,不允许返工,请确认");
|
ErrorCode TASK_IN_REPORT_NOT_REWORK = new ErrorCode(1_013_007 , "该报工没有完成,不允许返工,请确认");
|
||||||
|
ErrorCode THIS_SHIPMENT_CANNOT_BE_INVALIDATED = new ErrorCode(1_013_008 , "该出库不允许作废,请刷新界面");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,6 +130,15 @@ public class StorageController {
|
|||||||
storageService.updateStorageok(updateReqVO);
|
storageService.updateStorageok(updateReqVO);
|
||||||
return success(true);
|
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")
|
@PutMapping("/update-status")
|
||||||
@Operation(summary = "更新入/出库")
|
@Operation(summary = "更新入/出库")
|
||||||
@Transactional
|
@Transactional
|
||||||
@ -158,7 +167,7 @@ public class StorageController {
|
|||||||
}
|
}
|
||||||
updateReqVO = BeanUtils.toBean(targetDo, StorageSaveReqVO.class);
|
updateReqVO = BeanUtils.toBean(targetDo, StorageSaveReqVO.class);
|
||||||
|
|
||||||
//出库即审核
|
//提交即审核
|
||||||
if (updateReqVO.getStockType() == 2) {
|
if (updateReqVO.getStockType() == 2) {
|
||||||
updateReqVO.setStatus(4);
|
updateReqVO.setStatus(4);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,4 +83,6 @@ public interface StorageService {
|
|||||||
Workbook exportExcelNew(String stockNo);
|
Workbook exportExcelNew(String stockNo);
|
||||||
|
|
||||||
Workbook exportExcelOut(String stockNo);
|
Workbook exportExcelOut(String stockNo);
|
||||||
|
|
||||||
|
void returnOutBound(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
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.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.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.outsourcestockboom.vo.OutsourceStockBoomSaveReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory.StorageInventoryController;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory.StorageInventoryController;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.StorageMatSaveReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.StorageMatSaveReqVO;
|
||||||
@ -966,4 +968,20 @@ private StorageLogService storageLogService;
|
|||||||
}
|
}
|
||||||
return unitMap;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,3 +69,7 @@ export const procurementAndStorage = async (data) => {
|
|||||||
export const isPrint = async (id: number) => {
|
export const isPrint = async (id: number) => {
|
||||||
return await request.get({ url: `/heli/storage/isPrint?id=` + id })
|
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 })
|
||||||
|
}
|
||||||
|
|||||||
@ -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>
|
<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="() => 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="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(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>
|
</template>
|
||||||
|
|
||||||
<el-row justify="center">
|
<el-row justify="center">
|
||||||
@ -552,6 +554,29 @@ const matOpenFormRef1 = ref()
|
|||||||
const proOpenFormRef = ref()
|
const proOpenFormRef = ref()
|
||||||
const materialOpenFormRef = 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 = () => {
|
const openMatForm = () => {
|
||||||
// if (formData.value.whId == undefined || formData.value.whId == '') {
|
// if (formData.value.whId == undefined || formData.value.whId == '') {
|
||||||
// message.alertWarning('请选择入库仓库')
|
// message.alertWarning('请选择入库仓库')
|
||||||
|
|||||||
@ -339,11 +339,13 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
|
<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="() => 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>
|
||||||
<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>
|
||||||
<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>
|
废</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -518,6 +520,26 @@ const openProjectForm = (scope) => {
|
|||||||
proOpenFormRef.value.open(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) => {
|
const getList = async (arrMat) => {
|
||||||
arrMat.forEach((row) => {
|
arrMat.forEach((row) => {
|
||||||
@ -636,6 +658,8 @@ const deleteStorage = async() =>{
|
|||||||
}
|
}
|
||||||
centerDialogVisible.value = false
|
centerDialogVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleStatus = async (num) => {
|
const handleStatus = async (num) => {
|
||||||
formData.value.status = num
|
formData.value.status = num
|
||||||
const data = formData.value as unknown as StorageApi.StorageVO
|
const data = formData.value as unknown as StorageApi.StorageVO
|
||||||
|
|||||||
@ -324,13 +324,15 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
|
<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="() => 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>
|
||||||
<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>
|
||||||
<el-button @click="handleStatus(4)" type="success" v-if="btnok " 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>
|
废</el-button>
|
||||||
</template>
|
</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 enableHeadNo = ref(false)
|
||||||
const handleStockType = async (typeid) => {
|
const handleStockType = async (typeid) => {
|
||||||
|
|||||||
@ -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 link type="primary" @click="openDetail('update', scope.row.id)" v-if="scope.row.status != 3&&scope.row.status != 4">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</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 link type="primary" @click="openDetail('review', scope.row.id)">
|
||||||
查看详情
|
查看详情
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -295,6 +292,26 @@ const openForm = (type: string, id?: number) => {
|
|||||||
const openDetail = (active: string, id?: number) => {
|
const openDetail = (active: string, id?: number) => {
|
||||||
router.push({ path: '/inventory/storageoutdetail', query: { type: active, id: id } })
|
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 () => {
|
const handleExport = async () => {
|
||||||
if (!queryParams.stockNo){
|
if (!queryParams.stockNo){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user