出入库 按钮控制

出入库 按钮控制
pull/1/head
siontion 9 months ago
parent 64bcbf0f94
commit e43c66500b

@ -3,7 +3,8 @@
<template #header> <template #header>
<span v-text="dialogTitle"></span> <span v-text="dialogTitle"></span>
</template> </template>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading"> <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading"
v-bind:disabled="isShowBtnOther">
<!-- 基础信息 --> <!-- 基础信息 -->
<el-card class="hl-card-info"> <el-card class="hl-card-info">
<template #header> <template #header>
@ -31,7 +32,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="industry" label="单据状态"> <el-form-item prop="industry" label="单据状态">
@ -184,7 +185,8 @@
</el-button> </el-button>
<el-button link type="primary" @click="handlefuke(scope.$index, scope.row)">复制</el-button> --> <el-button link type="primary" @click="handlefuke(scope.$index, scope.row)">复制</el-button> -->
<el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)"> <el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)"
v-bind:disabled="isShowBtnOther">
删除 删除
</el-button> </el-button>
</template> </template>
@ -206,9 +208,8 @@
<el-col> <el-col>
<el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :action="uploadUrl" <el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :action="uploadUrl"
:headers="{ 'Authorization': 'Bearer ' + getAccessToken(), 'tenant-id': getTenantId() }" name="files" :headers="{ 'Authorization': 'Bearer ' + getAccessToken(), 'tenant-id': getTenantId() }" name="files"
:show-file-list="false" :auto-upload="false" :show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange"
:data="matUploadData" class="upload-file-uploader">
:on-change="matUploadChange" class="upload-file-uploader">
<el-button type="primary"> <el-button type="primary">
<Icon icon="ep:upload-filled" />上传 <Icon icon="ep:upload-filled" />上传
</el-button> </el-button>
@ -227,7 +228,8 @@
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button link type="danger" size="small" <el-button link type="danger" size="small"
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)"> @click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)"
v-bind:disabled="isShowBtnOther">
删除 删除
</el-button> </el-button>
<el-button link type="primary" size="small" v-if="isShow" <el-button link type="primary" size="small" v-if="isShow"
@ -369,9 +371,9 @@ const handleStatus = (async (num) => {
const dataUpdate = formData.value as unknown as StorageApi.StorageVO const dataUpdate = formData.value as unknown as StorageApi.StorageVO
if(num==2){ if (num == 2) {
dataUpdate.keeper = useUserStore().getUser.id dataUpdate.keeper = useUserStore().getUser.id
}else{ } else {
dataUpdate.cancel = useUserStore().getUser.id dataUpdate.cancel = useUserStore().getUser.id
} }
@ -395,6 +397,12 @@ const handleStatus = (async (num) => {
default: default:
break break
} }
//
if (query.type === 'review') {
isShowBtnGroup.value = false;
isShowBtnCancel.value = false;
isShowBtnOther.value = true;
}
reload(); reload();
}) })
const userList = ref<UserApi.UserVO[]>([]) // const userList = ref<UserApi.UserVO[]>([]) //
@ -481,7 +489,7 @@ const submitForm = async () => {
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value) await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
// //
matUploadData.value.businessId = storageid matUploadData.value.businessId = storageid
matUploadRef.value!.submit() matUploadRef.value!.submit()
message.success(t(commonResult)) message.success(t(commonResult))
@ -606,6 +614,8 @@ const handleMatCode = async (scope, matid) => {
const isShowBtnGroup = ref(true) const isShowBtnGroup = ref(true)
const isShowBtnCancel = ref(false) const isShowBtnCancel = ref(false)
const isShowBtnOther = ref(false)
const btnWhClickable = ref(false)
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
@ -622,6 +632,8 @@ onMounted(async () => {
dialogTitle.value = t('action.' + query.type) dialogTitle.value = t('action.' + query.type)
dialogTitle.value = query.type === 'review'?'查看':dialogTitle.value
isShow.value = query.type == "create" ? false : true isShow.value = query.type == "create" ? false : true
//------------------- //-------------------
@ -648,6 +660,12 @@ onMounted(async () => {
default: default:
break break
} }
//
if (query.type === 'review') {
isShowBtnGroup.value = false;
isShowBtnCancel.value = false;
isShowBtnOther.value = true;
}
// //
const queryParamsRg = reactive({ const queryParamsRg = reactive({

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

Loading…
Cancel
Save