This commit is contained in:
Ledo 2025-01-10 08:37:55 +08:00
parent 43ee0ba0da
commit 21623980d3
12 changed files with 59 additions and 36 deletions

View File

@ -103,7 +103,7 @@ public class StorageController {
// 获取最新的出入库信息
StorageDO targetDo = storageService.getStorage(updateReqVO.getId());
int beforeStatus = targetDo.getStatus();
int beforeStatus = updateReqVO.getBeforeStatus();
targetDo.setStatus(updateReqVO.getStatus());
@ -123,6 +123,7 @@ public class StorageController {
storageService.updateStorage(updateReqVO);
int status = targetDo.getStatus();
//状态说明1保存 2提交 3作废 4已审批
if(updateReqVO.getStockType() == 2){
//盘亏出库以外直接出
if(updateReqVO.getStockInType() != 3){
@ -133,10 +134,15 @@ public class StorageController {
}else if (updateReqVO.getStatus() == 4){
//如果是从已提交改为已审核就是要出库了
status = 2;
}else if ((beforeStatus == 1 || beforeStatus == 2) && updateReqVO.getStatus() == 3){
//如果是已提交状态被作废了不需要还原库存
return success(true);
}
else if (beforeStatus == 4 && updateReqVO.getStatus() == 3){
//如果是已审核改为作废要还原库存
status = 3;
storageLogService.deleteByStockId(targetDo.getId());
return success(true);
}
}
}

View File

@ -67,5 +67,6 @@ public class StorageSaveReqVO {
private String projectSubName;
@Schema(description = "子项目id", example = "你说的对")
private String projectNo;
@Schema(description = "提交前的状态", example = "提交前的状态")
private Integer beforeStatus;
}

View File

@ -48,4 +48,6 @@ public class StorageMatSaveReqVO {
@Schema(description = "备注", example = "你猜")
private BigDecimal amount;
@Schema(description = "备注", example = "你猜")
private String projectSubName;
}

View File

@ -94,7 +94,7 @@ public class StorageMatDO extends BaseDO {
@TableField(exist = false)
private String unit;
@TableField(exist = false)
// @TableField(exist = false)
private String projectSubName;
@TableField(exist = false)
private String pickmode;

View File

@ -47,7 +47,7 @@ public interface StorageLogService {
* @return /出库日志
*/
StorageLogDO getStorageLog(Long id);
int deleteByStockId(Long stockId);
/**
* 获得入/出库日志分页
*

View File

@ -86,7 +86,10 @@ public class StorageLogServiceImpl implements StorageLogService {
public StorageLogDO getStorageLog(Long id) {
return storageLogMapper.selectById(id);
}
@Override
public int deleteByStockId(Long stockId){
return storageLogMapper.delete(StorageLogDO::getStockId,stockId);
}
@Override
public PageResult<StorageLogAllDO> getStorageLogPage(StorageLogPageReqVO pageReqVO) {
return storageLogAllMapper.selectPage(pageReqVO);

View File

@ -246,17 +246,17 @@ public class StorageMatServiceImpl implements StorageMatService {
}
StorageLogNowDO storageLogNowDO = storageLogNowMapper.selectOne(queryWrapper);
storageMatDO.setMatRest(storageLogNowDO.getStorageOkQty());
if(storageMatDO.getProjectSubName()!=null && !storageMatDO.getProjectSubName().equals("")){
if(subNameMap.get(storageMatDO.getProjectNo())!=null){
storageMatDO.setProjectSubName(subNameMap.get(storageMatDO.getProjectNo()));
}else{
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(storageMatDO.getProjectNo());
storageMatDO.setProjectSubName(projectOrderSubDO.getName());
subNameMap.put(storageMatDO.getProjectNo(),projectOrderSubDO.getName());
}
}
// if(storageMatDO.getProjectSubName()!=null && !storageMatDO.getProjectSubName().equals("")){
// if(subNameMap.get(storageMatDO.getProjectNo())!=null){
// storageMatDO.setProjectSubName(subNameMap.get(storageMatDO.getProjectNo()));
// }else{
// ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(storageMatDO.getProjectNo());
// storageMatDO.setProjectSubName(projectOrderSubDO.getName());
// subNameMap.put(storageMatDO.getProjectNo(),projectOrderSubDO.getName());
// }
//
//
// }
}
}
return storageMatDOS;

View File

@ -52,14 +52,11 @@
INNER JOIN
pro_process_bom ppb ON pbd.bom_id = ppb.id
WHERE
ppb.project_sub_id = #{param2}
ppb.project_sub_id = #{param2} and pbd.bom_id = #{param1}
AND pbd.material_id IS NOT NULL
)
ORDER BY
t.id DESC;
</select>

View File

@ -374,8 +374,8 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
</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" size="large">
</el-button> -->
<el-button @click="handleStatus(3)" type="danger" v-if="btnCancel" size="large">
</el-button>
<!-- <el-button @click="handleStatus(4)" type="success" v-if="btnCancel" size="large">审核</el-button> -->
</div>
</el-card>
@ -442,7 +442,8 @@ const formData = ref({
cancel: undefined,
cancelTime: undefined,
matItemDOList: [],
attachments: []
attachments: [],
beforeStatus:1,
})
const formRules = reactive({
@ -1108,9 +1109,8 @@ const initStatus = async (status) => {
ctrSave.value = false
ctrCancel.value = true
ctrDelete.value = false
btnSave.value = true
btnCancel.value = false
btnCancel.value = true
break
case 2:
ctrView.value = false
@ -1118,7 +1118,7 @@ const initStatus = async (status) => {
ctrCancel.value = false
ctrDelete.value = true
btnSave.value = false
btnCancel.value = true
btnCancel.value = false
break
case 3:
ctrView.value = true
@ -1129,7 +1129,7 @@ const initStatus = async (status) => {
btnCancel.value = false
break
case 4:
btnCancel.value = false
btnCancel.value = true
default:
break
}
@ -1141,7 +1141,12 @@ const initStatus = async (status) => {
ctrDelete.value = true
btnSave.value = false
btnCancel.value = false
if(formData.value.status == 4){
btnCancel.value = true;
}else{
btnCancel.value = false
}
}
}
const matList = ref<MaterialApi.MaterialVO[]>([]) //
@ -1239,6 +1244,7 @@ onMounted(async () => {
handleStockType(formData.value.stockInType);
//
userList.value = await UserApi.getSimpleUserList()
formData.value.beforeStatus = formData.value.status;
})
//

View File

@ -362,9 +362,9 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
</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" size="large">
<el-button @click="handleStatus(3)" type="danger" v-if="btnCancel " size="large">
</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>
</div>
</el-card>
<!-- 表单弹窗物料列表 -->
@ -428,7 +428,8 @@ const formData = ref({
cancel: undefined,
cancelTime: undefined,
matItemDOList: [],
attachments: []
attachments: [],
beforeStatus:undefined,
})
const formRules = reactive({
@ -1041,6 +1042,7 @@ const initStatus = async (status) => {
ctrDelete.value = true
btnSave.value = false
btnCancel.value = false
btnok.value=false
break
case 4:
ctrView.value = true
@ -1048,7 +1050,7 @@ const initStatus = async (status) => {
ctrCancel.value = true
ctrDelete.value = false
btnSave.value = false
btnCancel.value = false
btnCancel.value = true
btnok.value=false
break
default:
@ -1060,9 +1062,15 @@ const initStatus = async (status) => {
ctrSave.value = true
ctrCancel.value = true
ctrDelete.value = true
btnSave.value = false
btnCancel.value = false
btnok.value=false
console.log('ss'+formData.value.status)
if(formData.value.status == 4){
btnCancel.value = true
}else{
btnCancel.value = false
}
}
}
const matList = ref<MaterialApi.MaterialVO[]>([]) //
@ -1156,6 +1164,7 @@ onMounted(async () => {
//
userList.value = await UserApi.getSimpleUserList()
formData.value.beforeStatus = formData.value.status;
})
//

View File

@ -132,7 +132,6 @@ const getList = async () => {
})
}else if(formType.value == 'bomfind'){
debugger
dataone = await ProcessBomApi.getProcessBomDetailListByBomIdbyid(queryReqVo.whId.projectNo)
dataone = dataone.filter(item => item.whId === queryReqVo.whId.whId);
// datatow

View File

@ -172,7 +172,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="180" fixed="right">
<template #default="scope">
<el-button link type="primary" @click="openDetail('update', scope.row.id)" v-if="scope.row.status != 3">
<el-button link type="primary" @click="openDetail('update', scope.row.id)" v-if="(scope.row.status == 2)">
去审核
</el-button>
<el-button link type="primary" @click="openDetail('review', scope.row.id)">