|
|
|
@ -126,7 +126,8 @@
|
|
|
|
|
<el-table-column prop="rgId" width="140" label="出库库区" required>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!">
|
|
|
|
|
<el-select v-model="scope.row.rgId" placeholder="" style="width: 100%" @change="handleRg(scope)" disabled="">
|
|
|
|
|
<el-select v-model="scope.row.rgId" placeholder="" style="width: 100%" @change="handleRg(scope)"
|
|
|
|
|
disabled="">
|
|
|
|
|
<el-option v-for="dict in rgList" :key="dict.id" :label="dict.rgName" :value="dict.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -188,9 +189,8 @@
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :action="uploadUrl"
|
|
|
|
|
:headers="{ 'Authorization': 'Bearer ' + getAccessToken(), 'tenant-id': getTenantId() }" name="files"
|
|
|
|
|
:show-file-list="false" :auto-upload="false"
|
|
|
|
|
:data="matUploadData"
|
|
|
|
|
:on-change="matUploadChange" class="upload-file-uploader">
|
|
|
|
|
:show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange"
|
|
|
|
|
class="upload-file-uploader">
|
|
|
|
|
<el-button type="primary">
|
|
|
|
|
<Icon icon="ep:upload-filled" />上传
|
|
|
|
|
</el-button>
|
|
|
|
@ -350,9 +350,9 @@ const handleStatus = (async (num) => {
|
|
|
|
|
formData.value.status = num
|
|
|
|
|
|
|
|
|
|
const dataUpdate = formData.value as unknown as StorageApi.StorageVO
|
|
|
|
|
if(num==2){
|
|
|
|
|
if (num == 2) {
|
|
|
|
|
dataUpdate.outbound = useUserStore().getUser.id
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
dataUpdate.cancel = useUserStore().getUser.id
|
|
|
|
|
}
|
|
|
|
|
await StorageApi.updateStorageStatus(dataUpdate)
|
|
|
|
@ -375,6 +375,12 @@ const handleStatus = (async (num) => {
|
|
|
|
|
default:
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
//查看页面不可以编辑
|
|
|
|
|
if (query.type === 'review') {
|
|
|
|
|
isShowBtnGroup.value = false;
|
|
|
|
|
isShowBtnCancel.value = false;
|
|
|
|
|
isShowBtnOther.value = true;
|
|
|
|
|
}
|
|
|
|
|
reload()
|
|
|
|
|
})
|
|
|
|
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
|
|
|
@ -396,8 +402,8 @@ const refreshAttachments = (files, type) => {
|
|
|
|
|
file.createTime = new Date();
|
|
|
|
|
formData.value.attachments.push(file);
|
|
|
|
|
}
|
|
|
|
|
// 排序
|
|
|
|
|
formData.value.attachments.sort((v1, v2) => {
|
|
|
|
|
// 排序
|
|
|
|
|
formData.value.attachments.sort((v1, v2) => {
|
|
|
|
|
return (v1.createTime - v2.createTime) > 0
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -441,14 +447,13 @@ const submitForm = async () => {
|
|
|
|
|
//获取最新库存信息
|
|
|
|
|
const matCurrentData = await StorageMatApi.getStorageMatList()
|
|
|
|
|
var hasRestNum = true
|
|
|
|
|
formData.value.matItemDOList.forEach( (rest) =>{
|
|
|
|
|
formData.value.matItemDOList.forEach((rest) => {
|
|
|
|
|
|
|
|
|
|
if(matCurrentData.find((mat)=>{ mat.matId == rest.matId && mat.pnId == rest.pnId && mat.matRest<rest.matRest}))
|
|
|
|
|
{
|
|
|
|
|
hasRestNum = fasle
|
|
|
|
|
if (matCurrentData.find(mat => mat.matId == rest.matId && mat.pnId == rest.pnId && mat.matRest < Number(rest.storageOkQty))) {
|
|
|
|
|
hasRestNum = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(!hasRestNum){
|
|
|
|
|
if (!hasRestNum) {
|
|
|
|
|
message.alertWarning('物料库存不足')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -478,7 +483,7 @@ const submitForm = async () => {
|
|
|
|
|
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
|
|
|
|
|
|
|
|
|
|
//附件信息保存
|
|
|
|
|
matUploadData.value.businessId = storageid
|
|
|
|
|
matUploadData.value.businessId = storageid
|
|
|
|
|
matUploadRef.value!.submit()
|
|
|
|
|
|
|
|
|
|
message.success(t(commonResult))
|
|
|
|
@ -652,6 +657,7 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialogTitle.value = t('action.' + query.type)
|
|
|
|
|
dialogTitle.value = query.type === 'review'?'查看':dialogTitle.value
|
|
|
|
|
|
|
|
|
|
isShow.value = query.type == "create" ? false : true
|
|
|
|
|
|
|
|
|
@ -734,7 +740,7 @@ onMounted(async () => {
|
|
|
|
|
item.matUnit = matVos.list.find((record) => record.id == item.matId)?.unit
|
|
|
|
|
item.pnlist = pnList.value.filter((pn) => pn.rgId == item.rgId)
|
|
|
|
|
item.matRest = matLastData.value.find((rest) => rest.rgId == item.rgId && rest.pnId == item.pnId)?.matRest
|
|
|
|
|
item.matRest = item.matRest == undefined?0:item.matRest
|
|
|
|
|
item.matRest = item.matRest == undefined ? 0 : item.matRest
|
|
|
|
|
matCount = matCount + 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|