|
|
@@ -172,21 +172,21 @@ const beforeUpload = (file: any) => {
|
|
|
return isLt50M;
|
|
|
};
|
|
|
|
|
|
-/** 上传成功回调 */
|
|
|
-const handleUploadSuccess = (response: any, uploadFile: any) => {
|
|
|
+function handleUploadSuccess(response: any, file: any, fileListParam: any[]) {
|
|
|
if (response.code === 200) {
|
|
|
- uploadFile.url = response.data.url;
|
|
|
- nextTick(() => {
|
|
|
- form.value.invoiceAnnex = fileList.value
|
|
|
- .map((f) => f.url)
|
|
|
- .filter(Boolean)
|
|
|
- .join(',');
|
|
|
- });
|
|
|
- proxy?.$modal.msgSuccess('上传成功');
|
|
|
+ // 更新 fileList
|
|
|
+ fileList.value = fileListParam;
|
|
|
+ // 收集所有已上传成功的文件URL
|
|
|
+ const urls = fileListParam
|
|
|
+ .filter((f: any) => f.response?.code === 200 || f.url)
|
|
|
+ .map((f: any) => f.response?.data?.url || f.url)
|
|
|
+ .filter(Boolean);
|
|
|
+ form.value.invoiceAnnex = urls.join(',');
|
|
|
+ proxy?.$modal.msgSuccess('文件上传成功');
|
|
|
} else {
|
|
|
- proxy?.$modal.msgError(response.msg || '上传失败');
|
|
|
+ proxy?.$modal.msgError(response.msg || '文件上传失败');
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
/** 删除文件 */
|
|
|
const handleRemoveUploadFile = (uploadFile: any) => {
|