出库
This commit is contained in:
parent
43ee0ba0da
commit
21623980d3
@ -103,7 +103,7 @@ public class StorageController {
|
|||||||
|
|
||||||
// 获取最新的出入库信息
|
// 获取最新的出入库信息
|
||||||
StorageDO targetDo = storageService.getStorage(updateReqVO.getId());
|
StorageDO targetDo = storageService.getStorage(updateReqVO.getId());
|
||||||
int beforeStatus = targetDo.getStatus();
|
int beforeStatus = updateReqVO.getBeforeStatus();
|
||||||
|
|
||||||
targetDo.setStatus(updateReqVO.getStatus());
|
targetDo.setStatus(updateReqVO.getStatus());
|
||||||
|
|
||||||
@ -123,6 +123,7 @@ public class StorageController {
|
|||||||
|
|
||||||
storageService.updateStorage(updateReqVO);
|
storageService.updateStorage(updateReqVO);
|
||||||
int status = targetDo.getStatus();
|
int status = targetDo.getStatus();
|
||||||
|
//状态说明:1保存 2提交 3作废 4已审批
|
||||||
if(updateReqVO.getStockType() == 2){
|
if(updateReqVO.getStockType() == 2){
|
||||||
//盘亏出库以外直接出
|
//盘亏出库以外直接出
|
||||||
if(updateReqVO.getStockInType() != 3){
|
if(updateReqVO.getStockInType() != 3){
|
||||||
@ -133,10 +134,15 @@ public class StorageController {
|
|||||||
}else if (updateReqVO.getStatus() == 4){
|
}else if (updateReqVO.getStatus() == 4){
|
||||||
//如果是从已提交改为已审核就是要出库了
|
//如果是从已提交改为已审核就是要出库了
|
||||||
status = 2;
|
status = 2;
|
||||||
|
}else if ((beforeStatus == 1 || beforeStatus == 2) && updateReqVO.getStatus() == 3){
|
||||||
|
//如果是已提交状态被作废了不需要还原库存
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
else if (beforeStatus == 4 && updateReqVO.getStatus() == 3){
|
else if (beforeStatus == 4 && updateReqVO.getStatus() == 3){
|
||||||
//如果是已审核改为作废,要还原库存
|
//如果是已审核改为作废,要还原库存
|
||||||
status = 3;
|
status = 3;
|
||||||
|
storageLogService.deleteByStockId(targetDo.getId());
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,5 +67,6 @@ public class StorageSaveReqVO {
|
|||||||
private String projectSubName;
|
private String projectSubName;
|
||||||
@Schema(description = "子项目id", example = "你说的对")
|
@Schema(description = "子项目id", example = "你说的对")
|
||||||
private String projectNo;
|
private String projectNo;
|
||||||
|
@Schema(description = "提交前的状态", example = "提交前的状态")
|
||||||
|
private Integer beforeStatus;
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,6 @@ public class StorageMatSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "备注", example = "你猜")
|
@Schema(description = "备注", example = "你猜")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String projectSubName;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ public class StorageMatDO extends BaseDO {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
@TableField(exist = false)
|
// @TableField(exist = false)
|
||||||
private String projectSubName;
|
private String projectSubName;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String pickmode;
|
private String pickmode;
|
||||||
|
@ -47,7 +47,7 @@ public interface StorageLogService {
|
|||||||
* @return 入/出库日志
|
* @return 入/出库日志
|
||||||
*/
|
*/
|
||||||
StorageLogDO getStorageLog(Long id);
|
StorageLogDO getStorageLog(Long id);
|
||||||
|
int deleteByStockId(Long stockId);
|
||||||
/**
|
/**
|
||||||
* 获得入/出库日志分页
|
* 获得入/出库日志分页
|
||||||
*
|
*
|
||||||
|
@ -86,7 +86,10 @@ public class StorageLogServiceImpl implements StorageLogService {
|
|||||||
public StorageLogDO getStorageLog(Long id) {
|
public StorageLogDO getStorageLog(Long id) {
|
||||||
return storageLogMapper.selectById(id);
|
return storageLogMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public int deleteByStockId(Long stockId){
|
||||||
|
return storageLogMapper.delete(StorageLogDO::getStockId,stockId);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public PageResult<StorageLogAllDO> getStorageLogPage(StorageLogPageReqVO pageReqVO) {
|
public PageResult<StorageLogAllDO> getStorageLogPage(StorageLogPageReqVO pageReqVO) {
|
||||||
return storageLogAllMapper.selectPage(pageReqVO);
|
return storageLogAllMapper.selectPage(pageReqVO);
|
||||||
|
@ -246,17 +246,17 @@ public class StorageMatServiceImpl implements StorageMatService {
|
|||||||
}
|
}
|
||||||
StorageLogNowDO storageLogNowDO = storageLogNowMapper.selectOne(queryWrapper);
|
StorageLogNowDO storageLogNowDO = storageLogNowMapper.selectOne(queryWrapper);
|
||||||
storageMatDO.setMatRest(storageLogNowDO.getStorageOkQty());
|
storageMatDO.setMatRest(storageLogNowDO.getStorageOkQty());
|
||||||
if(storageMatDO.getProjectSubName()!=null && !storageMatDO.getProjectSubName().equals("")){
|
// if(storageMatDO.getProjectSubName()!=null && !storageMatDO.getProjectSubName().equals("")){
|
||||||
if(subNameMap.get(storageMatDO.getProjectNo())!=null){
|
// if(subNameMap.get(storageMatDO.getProjectNo())!=null){
|
||||||
storageMatDO.setProjectSubName(subNameMap.get(storageMatDO.getProjectNo()));
|
// storageMatDO.setProjectSubName(subNameMap.get(storageMatDO.getProjectNo()));
|
||||||
}else{
|
// }else{
|
||||||
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(storageMatDO.getProjectNo());
|
// ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(storageMatDO.getProjectNo());
|
||||||
storageMatDO.setProjectSubName(projectOrderSubDO.getName());
|
// storageMatDO.setProjectSubName(projectOrderSubDO.getName());
|
||||||
subNameMap.put(storageMatDO.getProjectNo(),projectOrderSubDO.getName());
|
// subNameMap.put(storageMatDO.getProjectNo(),projectOrderSubDO.getName());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return storageMatDOS;
|
return storageMatDOS;
|
||||||
|
@ -52,14 +52,11 @@
|
|||||||
INNER JOIN
|
INNER JOIN
|
||||||
pro_process_bom ppb ON pbd.bom_id = ppb.id
|
pro_process_bom ppb ON pbd.bom_id = ppb.id
|
||||||
WHERE
|
WHERE
|
||||||
ppb.project_sub_id = #{param2}
|
ppb.project_sub_id = #{param2} and pbd.bom_id = #{param1}
|
||||||
AND pbd.material_id IS NOT NULL
|
AND pbd.material_id IS NOT NULL
|
||||||
)
|
)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
t.id DESC;
|
t.id DESC;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
@ -374,8 +374,8 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
|
|||||||
存</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" 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" size="large">作
|
||||||
废</el-button> -->
|
废</el-button>
|
||||||
<!-- <el-button @click="handleStatus(4)" type="success" v-if="btnCancel" size="large">审核</el-button> -->
|
<!-- <el-button @click="handleStatus(4)" type="success" v-if="btnCancel" size="large">审核</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -442,7 +442,8 @@ const formData = ref({
|
|||||||
cancel: undefined,
|
cancel: undefined,
|
||||||
cancelTime: undefined,
|
cancelTime: undefined,
|
||||||
matItemDOList: [],
|
matItemDOList: [],
|
||||||
attachments: []
|
attachments: [],
|
||||||
|
beforeStatus:1,
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
@ -1108,9 +1109,8 @@ const initStatus = async (status) => {
|
|||||||
ctrSave.value = false
|
ctrSave.value = false
|
||||||
ctrCancel.value = true
|
ctrCancel.value = true
|
||||||
ctrDelete.value = false
|
ctrDelete.value = false
|
||||||
|
|
||||||
btnSave.value = true
|
btnSave.value = true
|
||||||
btnCancel.value = false
|
btnCancel.value = true
|
||||||
break
|
break
|
||||||
case 2:
|
case 2:
|
||||||
ctrView.value = false
|
ctrView.value = false
|
||||||
@ -1118,7 +1118,7 @@ const initStatus = async (status) => {
|
|||||||
ctrCancel.value = false
|
ctrCancel.value = false
|
||||||
ctrDelete.value = true
|
ctrDelete.value = true
|
||||||
btnSave.value = false
|
btnSave.value = false
|
||||||
btnCancel.value = true
|
btnCancel.value = false
|
||||||
break
|
break
|
||||||
case 3:
|
case 3:
|
||||||
ctrView.value = true
|
ctrView.value = true
|
||||||
@ -1129,7 +1129,7 @@ const initStatus = async (status) => {
|
|||||||
btnCancel.value = false
|
btnCancel.value = false
|
||||||
break
|
break
|
||||||
case 4:
|
case 4:
|
||||||
btnCancel.value = false
|
btnCancel.value = true
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1141,7 +1141,12 @@ const initStatus = async (status) => {
|
|||||||
ctrDelete.value = true
|
ctrDelete.value = true
|
||||||
|
|
||||||
btnSave.value = false
|
btnSave.value = false
|
||||||
btnCancel.value = false
|
if(formData.value.status == 4){
|
||||||
|
btnCancel.value = true;
|
||||||
|
}else{
|
||||||
|
btnCancel.value = false
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const matList = ref<MaterialApi.MaterialVO[]>([]) // 物料列表
|
const matList = ref<MaterialApi.MaterialVO[]>([]) // 物料列表
|
||||||
@ -1239,6 +1244,7 @@ onMounted(async () => {
|
|||||||
handleStockType(formData.value.stockInType);
|
handleStockType(formData.value.stockInType);
|
||||||
//用户信息,用于底部数据展示
|
//用户信息,用于底部数据展示
|
||||||
userList.value = await UserApi.getSimpleUserList()
|
userList.value = await UserApi.getSimpleUserList()
|
||||||
|
formData.value.beforeStatus = formData.value.status;
|
||||||
})
|
})
|
||||||
|
|
||||||
//接收物料传递的数据
|
//接收物料传递的数据
|
||||||
|
@ -362,9 +362,9 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
|
|||||||
存</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" 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 " 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>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 表单弹窗:物料列表 -->
|
<!-- 表单弹窗:物料列表 -->
|
||||||
@ -428,7 +428,8 @@ const formData = ref({
|
|||||||
cancel: undefined,
|
cancel: undefined,
|
||||||
cancelTime: undefined,
|
cancelTime: undefined,
|
||||||
matItemDOList: [],
|
matItemDOList: [],
|
||||||
attachments: []
|
attachments: [],
|
||||||
|
beforeStatus:undefined,
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
@ -1041,6 +1042,7 @@ const initStatus = async (status) => {
|
|||||||
ctrDelete.value = true
|
ctrDelete.value = true
|
||||||
btnSave.value = false
|
btnSave.value = false
|
||||||
btnCancel.value = false
|
btnCancel.value = false
|
||||||
|
btnok.value=false
|
||||||
break
|
break
|
||||||
case 4:
|
case 4:
|
||||||
ctrView.value = true
|
ctrView.value = true
|
||||||
@ -1048,7 +1050,7 @@ const initStatus = async (status) => {
|
|||||||
ctrCancel.value = true
|
ctrCancel.value = true
|
||||||
ctrDelete.value = false
|
ctrDelete.value = false
|
||||||
btnSave.value = false
|
btnSave.value = false
|
||||||
btnCancel.value = false
|
btnCancel.value = true
|
||||||
btnok.value=false
|
btnok.value=false
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
@ -1060,9 +1062,15 @@ const initStatus = async (status) => {
|
|||||||
ctrSave.value = true
|
ctrSave.value = true
|
||||||
ctrCancel.value = true
|
ctrCancel.value = true
|
||||||
ctrDelete.value = true
|
ctrDelete.value = true
|
||||||
|
|
||||||
btnSave.value = false
|
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[]>([]) // 物料列表
|
const matList = ref<MaterialApi.MaterialVO[]>([]) // 物料列表
|
||||||
@ -1156,6 +1164,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
//用户信息,用于底部数据展示
|
//用户信息,用于底部数据展示
|
||||||
userList.value = await UserApi.getSimpleUserList()
|
userList.value = await UserApi.getSimpleUserList()
|
||||||
|
formData.value.beforeStatus = formData.value.status;
|
||||||
})
|
})
|
||||||
|
|
||||||
//接收物料传递的数据
|
//接收物料传递的数据
|
||||||
|
@ -132,7 +132,6 @@ const getList = async () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}else if(formType.value == 'bomfind'){
|
}else if(formType.value == 'bomfind'){
|
||||||
debugger
|
|
||||||
dataone = await ProcessBomApi.getProcessBomDetailListByBomIdbyid(queryReqVo.whId.projectNo)
|
dataone = await ProcessBomApi.getProcessBomDetailListByBomIdbyid(queryReqVo.whId.projectNo)
|
||||||
dataone = dataone.filter(item => item.whId === queryReqVo.whId.whId);
|
dataone = dataone.filter(item => item.whId === queryReqVo.whId.whId);
|
||||||
// 将过滤后的数据赋值给datatow
|
// 将过滤后的数据赋值给datatow
|
||||||
|
@ -172,7 +172,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="180" fixed="right">
|
<el-table-column label="操作" align="center" width="180" fixed="right">
|
||||||
<template #default="scope">
|
<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>
|
||||||
<el-button link type="primary" @click="openDetail('review', scope.row.id)">
|
<el-button link type="primary" @click="openDetail('review', scope.row.id)">
|
||||||
|
Loading…
Reference in New Issue
Block a user