出入库附件上传

出入库附件上传
pull/1/head
siontion 9 months ago
parent 74a08096aa
commit da980aa35d

@ -207,7 +207,7 @@
<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="{ 'businessType': 'STORAGE', 'businessId': formData.id, 'businessFileType': 'MATERIAL' }"
:data="matUploadData"
:on-change="matUploadChange" class="upload-file-uploader">
<el-button type="primary">
<Icon icon="ep:upload-filled" />上传
@ -403,6 +403,7 @@ const userList = ref<UserApi.UserVO[]>([]) // 用户列表
const uploadUrl = ref(import.meta.env.VITE_UPLOAD_BATCH_URL)
const matUploadRef = ref();
const matUploadFiles = ref<UploadUserFile[]>([]);
const matUploadData = ref({ businessType: 'STORAGE', businessId: formData.value.id, businessFileType: 'MATERIAL' })
const matUploadChange = (file, files) => {
matUploadFiles.value = files;
refreshAttachments(files, 'MATERIAL')
@ -417,7 +418,7 @@ const refreshAttachments = (files, type) => {
}
//
formData.value.attachments.sort((v1, v2) => {
return v1.businessFileType == v2.businessFileType ? 0 : 1;
return (v1.createTime - v2.createTime) > 0
})
}
//
@ -480,7 +481,7 @@ const submitForm = async () => {
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
//
matUploadFiles.value = { 'businessType': 'STORAGE', 'businessId': storageid, 'businessFileType': '' }
matUploadData.value.businessId = storageid
matUploadRef.value!.submit()
message.success(t(commonResult))

@ -189,7 +189,7 @@
<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="{ 'businessType': 'STORAGE', 'businessId': formData.id, 'businessFileType': 'MATERIAL' }"
:data="matUploadData
:on-change="matUploadChange" class="upload-file-uploader">
<el-button type="primary">
<Icon icon="ep:upload-filled" />上传
@ -385,6 +385,7 @@ const userList = ref<UserApi.UserVO[]>([]) // 用户列表
const uploadUrl = ref(import.meta.env.VITE_UPLOAD_BATCH_URL)
const matUploadRef = ref();
const matUploadFiles = ref<UploadUserFile[]>([]);
const matUploadData = ref({ businessType: 'STORAGE', businessId: formData.value.id, businessFileType: 'MATERIAL' })
const matUploadChange = (file, files) => {
matUploadFiles.value = files;
refreshAttachments(files, 'MATERIAL')
@ -399,7 +400,7 @@ const refreshAttachments = (files, type) => {
}
//
formData.value.attachments.sort((v1, v2) => {
return v1.businessFileType == v2.businessFileType ? 0 : 1;
return (v1.createTime - v2.createTime) > 0
})
}
//
@ -479,7 +480,7 @@ const submitForm = async () => {
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
//
matUploadFiles.value = { 'businessType': 'STORAGE', 'businessId': storageid, 'businessFileType': '' }
matUploadData.value.businessId = storageid
matUploadRef.value!.submit()
message.success(t(commonResult))

Loading…
Cancel
Save