diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue index f4b3531..04b2459 100644 --- a/inventory-web/src/views/material/list.vue +++ b/inventory-web/src/views/material/list.vue @@ -323,6 +323,9 @@ width="700px" append-to-body @close="cancel" + :close-on-click-modal="!isUploading" + :close-on-press-escape="!isUploading" + :show-close="!isUploading" > @@ -477,8 +480,8 @@ @@ -596,6 +599,10 @@ const total = ref(0); const tableData = ref([]); const tableRef = ref>(); const submitLoading = ref(false); + +// 上传锁定状态 +const isUploading = ref(false); + const tableSize = ref<'large' | 'default' | 'small'>('large'); const advancedFilterVisible = ref(false); const advancedConditions = ref([{ field: '', operator: '', value: '' }]); @@ -1278,6 +1285,7 @@ const customUpload = async (options: any, targetField: 'generalImage' | 'general const { file, onSuccess, onError } = options const formData = new FormData() formData.append('file', file) + isUploading.value = true try { const res: any = await uploadFile(formData) if (res.code === 200) { @@ -1293,6 +1301,7 @@ const customUpload = async (options: any, targetField: 'generalImage' | 'general ElMessage.error('网络错误'); onError(e) } + finally { isUploading.value = false } } const handleRemoveImage = async (uploadFile: any, targetField: 'generalImage' | 'generalManual') => { diff --git a/inventory-web/src/views/stock/inbound/buy.vue b/inventory-web/src/views/stock/inbound/buy.vue index 27517c5..a823ea9 100644 --- a/inventory-web/src/views/stock/inbound/buy.vue +++ b/inventory-web/src/views/stock/inbound/buy.vue @@ -251,7 +251,9 @@ :width="'min(1000px, 95vw)'" top="4vh" destroy-on-close - :close-on-click-modal="false" + :close-on-click-modal="!isUploading" + :close-on-press-escape="!isUploading" + :show-close="!isUploading" class="stylish-dialog compact-layout" >
@@ -618,8 +620,8 @@
@@ -782,6 +784,9 @@ const tableData = ref([]) const total = ref(0) const formRef = ref() +// 上传锁定状态 +const isUploading = ref(false) + const categoryOptions = ref([]) const typeOptions = ref([]) const companyOptions = ref([]) @@ -1423,6 +1428,7 @@ const customUpload = async (options: any, targetField: 'arrival_photo' | 'inspec const { file, onSuccess, onError } = options const formData = new FormData() formData.append('file', file) + isUploading.value = true try { const res: any = await uploadFile(formData) if (res.code === 200) { @@ -1448,6 +1454,8 @@ const customUpload = async (options: any, targetField: 'arrival_photo' | 'inspec } catch (e) { ElMessage.error('网络错误') onError(e) + } finally { + isUploading.value = false } } diff --git a/inventory-web/src/views/stock/inbound/product.vue b/inventory-web/src/views/stock/inbound/product.vue index b9aeb3b..09760ba 100644 --- a/inventory-web/src/views/stock/inbound/product.vue +++ b/inventory-web/src/views/stock/inbound/product.vue @@ -231,7 +231,7 @@ - +
@@ -488,8 +488,8 @@