出入库
pull/1/head
siontion 9 months ago
parent 4339338745
commit 271edea9ab

@ -64,7 +64,7 @@ public class StorageController {
if(updateReqVO.getStatus().equals(2) && updateReqVO.getStockType().equals(1)){ if(updateReqVO.getStatus().equals(2) && updateReqVO.getStockType().equals(1)){
targetDo.setKeeper(updateReqVO.getKeeper()); targetDo.setKeeper(updateReqVO.getKeeper());
targetDo.setKeeperTime(currTime); targetDo.setKeeperTime(currTime);
}if(updateReqVO.getStatus().equals(2) && updateReqVO.getStockType().equals(2)){ } else if(updateReqVO.getStatus().equals(2) && updateReqVO.getStockType().equals(2)){
targetDo.setOutbound(updateReqVO.getOutbound()); targetDo.setOutbound(updateReqVO.getOutbound());
targetDo.setOutboundTime(currTime); targetDo.setOutboundTime(currTime);
}else{ }else{

@ -28,19 +28,18 @@ public interface StorageMapper extends BaseMapperX<StorageDO> {
default PageResult<StorageDO> selectPage(StoragePageReqVO reqVO) { default PageResult<StorageDO> selectPage(StoragePageReqVO reqVO) {
MPJLambdaWrapper<StorageDO> query = new MPJLambdaWrapper<>(); MPJLambdaWrapper<StorageDO> query = new MPJLambdaWrapper<>();
query.selectAll(StorageDO.class) query.selectAll(StorageDO.class)
.select("mat.code as matNo", "mat.name as matName")
.leftJoin(StorageMatDO.class, "sm", StorageMatDO::getStockId, StorageDO::getId) .leftJoin(StorageMatDO.class, "sm", StorageMatDO::getStockId, StorageDO::getId)
.leftJoin(MaterialDO.class, "mat", MaterialDO::getId, StorageMatDO::getMatId) .leftJoin(MaterialDO.class, "mat", MaterialDO::getId, StorageMatDO::getMatId)
.orderByDesc(StorageDO::getId); .orderByDesc(StorageDO::getId);
query.like(!StringUtils.isEmpty(reqVO.getMatNo()), "mat.code", reqVO.getMatNo()) query.like(!StringUtils.isEmpty(reqVO.getMatNo()), MaterialDO::getCode, reqVO.getMatNo())
.like(!StringUtils.isEmpty(reqVO.getMatName()), "mat.name", reqVO.getMatName()) .like(!StringUtils.isEmpty(reqVO.getMatName()), MaterialDO::getName, reqVO.getMatName())
.like(!StringUtils.isEmpty(reqVO.getStockNo()),StorageDO::getStockNo, reqVO.getStockNo()) .like(!StringUtils.isEmpty(reqVO.getStockNo()),StorageDO::getStockNo, reqVO.getStockNo())
.like(!StringUtils.isEmpty(reqVO.getHeaderNo()),StorageDO::getHeaderNo, reqVO.getHeaderNo()) .like(!StringUtils.isEmpty(reqVO.getHeaderNo()),StorageDO::getHeaderNo, reqVO.getHeaderNo())
.eq(reqVO.getStockType() != null,StorageDO::getStockType, reqVO.getStockType()) .eq(reqVO.getStockType() != null,StorageDO::getStockType, reqVO.getStockType())
.eq(reqVO.getStockInType() != null,StorageDO::getStockInType, reqVO.getStockInType()) .eq(reqVO.getStockInType() != null,StorageDO::getStockInType, reqVO.getStockInType())
.eq(reqVO.getWhId() != null,StorageDO::getWhId, reqVO.getWhId()) .eq(reqVO.getWhId() != null,StorageDO::getWhId, reqVO.getWhId())
.eq(reqVO.getStatus() != null,StorageDO::getStatus, reqVO.getStatus()); .eq(reqVO.getStatus() != null,StorageDO::getStatus, reqVO.getStatus()).distinct();
return selectPage(reqVO,query); return selectPage(reqVO,query);
// return selectPage(reqVO, new LambdaQueryWrapperX<StorageDO>() // return selectPage(reqVO, new LambdaQueryWrapperX<StorageDO>()

@ -125,6 +125,9 @@ const rgSelected = ref([])
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
await initPageData()
loading.value = true loading.value = true
try { try {
const data = await PnApi.getPnPage(queryParams) const data = await PnApi.getPnPage(queryParams)
@ -193,10 +196,7 @@ const handleExport = async () => {
exportLoading.value = false exportLoading.value = false
} }
} }
const initPageData = async () =>{
/** 初始化 **/
onMounted(async () => {
const queryParamsWh = reactive({ const queryParamsWh = reactive({
pageNo: 1, pageNo: 1,
pageSize: 99, pageSize: 99,
@ -219,7 +219,9 @@ onMounted(async () => {
}); });
rgList.value = dataRg.list rgList.value = dataRg.list
}
/** 初始化 **/
onMounted(async () => {
await getList() await getList()
}) })
</script> </script>

@ -116,6 +116,7 @@ const warehouseList = ref([])
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
await initPageData()
loading.value = true loading.value = true
try { try {
const data = await RgApi.getRgPage(queryParams) const data = await RgApi.getRgPage(queryParams)
@ -172,9 +173,7 @@ const handleExport = async () => {
} }
} }
/** 初始化 **/ const initPageData = async () =>{
onMounted(async () => {
const queryParamsWarehouse = reactive({ const queryParamsWarehouse = reactive({
pageNo: 1, pageNo: 1,
pageSize: 99, pageSize: 99,
@ -188,6 +187,9 @@ onMounted(async () => {
}); });
warehouseList.value = data.list warehouseList.value = data.list
}
/** 初始化 **/
onMounted(async () => {
await getList() await getList()
}) })
</script> </script>

@ -74,7 +74,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="单据日期" prop="createTime"> <el-form-item label="单据日期" prop="createTime">
{{ formatDate(formData.createTime, 'YYYY-MM-DD HH:mm') }} {{ formatDate(formData.createTime, 'YYYY-MM-DD HH:mm:ss') }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -295,7 +295,7 @@
link link
type="danger" type="danger"
@click.prevent="handleDelete2(scope.$index)" @click.prevent="handleDelete2(scope.$index)"
v-bind:disabled="isShowBtnOther" v-if="isShowBtnOther"
> >
删除 删除
</el-button> </el-button>
@ -357,7 +357,7 @@
type="danger" type="danger"
size="small" size="small"
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)" @click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)"
v-bind:disabled="isShowBtnOther" v-if="isShowBtnOther"
> >
删除 删除
</el-button> </el-button>
@ -365,7 +365,6 @@
link link
type="primary" type="primary"
size="small" size="small"
v-if="isShow"
@click="downloadAttachment(scope.row.name, scope.row.url)" @click="downloadAttachment(scope.row.name, scope.row.url)"
> >
下载 下载
@ -391,7 +390,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="createTime" label="创建时间"> <el-form-item prop="createTime" label="创建时间">
{{ formatDate(formData.createTime, 'YYYY-MM-DD HH:mm') }} {{ formatDate(formData.createTime, 'YYYY-MM-DD HH:mm:ss') }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -403,7 +402,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="keeperTime" label="入库时间"> <el-form-item prop="keeperTime" label="入库时间">
{{ formatDate(formData.keeperTime, 'YYYY-MM-DD HH:mm') }} {{ formatDate(formData.keeperTime, 'YYYY-MM-DD HH:mm:ss') }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -415,7 +414,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="cancelTime" label="作废时间"> <el-form-item prop="cancelTime" label="作废时间">
{{ formatDate(formData.cancelTime, 'YYYY-MM-DD HH:mm') }} {{ formatDate(formData.cancelTime, 'YYYY-MM-DD HH:mm:ss') }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -491,7 +490,7 @@ const formData = ref({
status: 1, status: 1,
whId: undefined, whId: undefined,
creator: undefined, creator: undefined,
createTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm'), createTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm:ss'),
keeper: undefined, keeper: undefined,
keeperTime: undefined, keeperTime: undefined,
outbound: undefined, outbound: undefined,
@ -518,6 +517,22 @@ const subFormRules = reactive({
storageOkQty: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }] storageOkQty: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }]
}) })
const handleStatus = async (num) => { const handleStatus = async (num) => {
//
await formRef.value.validate()
if(formData.value.matItemDOList.length === 0){
message.alertWarning('请添加物料信息!')
return
}
//
try {
await matSubFormRef.value.validate()
} catch (e) {
return
}
//
await saveFormData()
formData.value.status = num formData.value.status = num
const dataUpdate = formData.value as unknown as StorageApi.StorageVO const dataUpdate = formData.value as unknown as StorageApi.StorageVO
@ -555,8 +570,7 @@ const handleStatus = async (num) => {
isShowBtnOther.value = true isShowBtnOther.value = true
} }
query.type= 'update' query.type= 'update'
query.id = storageid.value query.id = formData.value.id
formData.value.id = storageid.value
reload() reload()
} }
@ -620,15 +634,8 @@ var commonResult = ''
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => {
// const saveFormData = async () =>{
await formRef.value.validate()
//
try {
await matSubFormRef.value.validate()
} catch (e) {
return
}
// //
formLoading.value = true formLoading.value = true
try { try {
@ -655,18 +662,36 @@ const submitForm = async () => {
matUploadData.value.businessId = storageid matUploadData.value.businessId = storageid
matUploadRef.value!.submit() matUploadRef.value!.submit()
} }
formData.value = await StorageApi.getStorage(storageid.value)
message.success(t(commonResult)) message.success(t(commonResult))
//
query.type= 'update'
query.id = storageid.value
formData.value.id = storageid.value
reload();
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
const submitForm = async () => {
//
await formRef.value.validate()
if(formData.value.matItemDOList.length === 0){
message.alertWarning('请添加物料信息!')
return
}
//
try {
await matSubFormRef.value.validate()
} catch (e) {
return
}
//
await saveFormData()
//
query.type= 'update'
query.id = storageid.value
formData.value.id = storageid.value
//
reload();
}
var matCount = 1 var matCount = 1
const onAddItem = () => { const onAddItem = () => {

@ -267,7 +267,7 @@
type="danger" type="danger"
size="small" size="small"
@click.prevent="handleDelete2(scope.$index)" @click.prevent="handleDelete2(scope.$index)"
v-bind:disabled="isShowBtnOther" v-if="isShowBtnOther"
> >
删除 删除
</el-button> </el-button>
@ -328,7 +328,7 @@
link link
type="danger" type="danger"
size="small" size="small"
v-bind:disabled="isShowBtnOther" v-if="isShowBtnOther"
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)" @click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)"
> >
删除 删除
@ -337,7 +337,6 @@
link link
type="primary" type="primary"
size="small" size="small"
v-if="isShow"
@click="downloadAttachment(scope.row.name, scope.row.url)" @click="downloadAttachment(scope.row.name, scope.row.url)"
> >
下载 下载
@ -491,6 +490,22 @@ const subFormRules = reactive({
storageOkQty: [{ required: true, message: '出库数量不能为空', trigger: 'blur' }] storageOkQty: [{ required: true, message: '出库数量不能为空', trigger: 'blur' }]
}) })
const handleStatus = async (num) => { const handleStatus = async (num) => {
//
await formRef.value.validate()
if(formData.value.matItemDOList.length === 0){
message.alertWarning('请添加物料信息!')
return
}
//
try {
await matSubFormRef.value.validate()
} catch (e) {
return
}
//
await saveFormData()
formData.value.status = num formData.value.status = num
const dataUpdate = formData.value as unknown as StorageApi.StorageVO const dataUpdate = formData.value as unknown as StorageApi.StorageVO
@ -507,14 +522,17 @@ const handleStatus = async (num) => {
case 1: case 1:
isShowBtnGroup.value = true isShowBtnGroup.value = true
isShowBtnCancel.value = false isShowBtnCancel.value = false
isShowBtnOther.value = true
break break
case 2: case 2:
isShowBtnGroup.value = false isShowBtnGroup.value = false
isShowBtnCancel.value = true isShowBtnCancel.value = true
isShowBtnOther.value = false
break break
case 3: case 3:
isShowBtnGroup.value = false isShowBtnGroup.value = false
isShowBtnCancel.value = false isShowBtnCancel.value = false
isShowBtnOther.value = false
break break
default: default:
break break
@ -523,11 +541,10 @@ const handleStatus = async (num) => {
if (query.type === 'review') { if (query.type === 'review') {
isShowBtnGroup.value = false isShowBtnGroup.value = false
isShowBtnCancel.value = false isShowBtnCancel.value = false
isShowBtnOther.value = true isShowBtnOther.value = false
} }
query.id = storageid.value query.id = storageid.value
query.type= 'update' query.type= 'update'
formData.value.id = storageid.value
reload() reload()
} }
const userList = ref<UserApi.UserVO[]>([]) // const userList = ref<UserApi.UserVO[]>([]) //
@ -590,16 +607,8 @@ var commonResult = ''
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
try {
await matSubFormRef.value.validate()
} catch (e) {
return
}
const saveFormData = async () =>{
// //
const matCurrentData = await StorageMatApi.getStorageMatList() const matCurrentData = await StorageMatApi.getStorageMatList()
var hasRestNum = true var hasRestNum = true
@ -646,18 +655,35 @@ const submitForm = async () => {
matUploadData.value.businessId = storageid matUploadData.value.businessId = storageid
matUploadRef.value!.submit() matUploadRef.value!.submit()
} }
formData.value = await StorageApi.getStorage(storageid.value)
message.success(t(commonResult)) message.success(t(commonResult))
//
query.id = storageid.value
query.type= 'update'
formData.value.id = storageid.value
reload()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
const submitForm = async () => {
//
await formRef.value.validate()
if(formData.value.matItemDOList.length === 0){
message.alertWarning('请添加物料信息!')
return
}
//
try {
await matSubFormRef.value.validate()
} catch (e) {
return
}
//
await saveFormData()
//
query.id = storageid.value
query.type= 'update'
reload()
}
var matCount = 1 var matCount = 1
const onAddItem = () => { const onAddItem = () => {
@ -850,10 +876,12 @@ onMounted(async () => {
case 2: case 2:
isShowBtnGroup.value = false isShowBtnGroup.value = false
isShowBtnCancel.value = true isShowBtnCancel.value = true
isShowBtnOther.value = false
break break
case 3: case 3:
isShowBtnGroup.value = false isShowBtnGroup.value = false
isShowBtnCancel.value = false isShowBtnCancel.value = false
isShowBtnOther.value = false
break break
default: default:
break break
@ -862,7 +890,7 @@ onMounted(async () => {
if (query.type === 'review') { if (query.type === 'review') {
isShowBtnGroup.value = false isShowBtnGroup.value = false
isShowBtnCancel.value = false isShowBtnCancel.value = false
isShowBtnOther.value = true isShowBtnOther.value = false
} }
// //

Loading…
Cancel
Save