|
|
|
@ -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')
|
|
|
|
@ -397,9 +398,9 @@ const refreshAttachments = (files, type) => {
|
|
|
|
|
file.createTime = new Date();
|
|
|
|
|
formData.value.attachments.push(file);
|
|
|
|
|
}
|
|
|
|
|
// 排序
|
|
|
|
|
formData.value.attachments.sort((v1, v2) => {
|
|
|
|
|
return v1.businessFileType == v2.businessFileType ? 0 : 1;
|
|
|
|
|
// 排序
|
|
|
|
|
formData.value.attachments.sort((v1, v2) => {
|
|
|
|
|
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))
|
|
|
|
|