|
@@ -1,7 +1,6 @@
|
|
|
<template>
|
|
|
- <Dialog loading="loading" v-model="dialogVisible" title="标本信息导入" width="600">
|
|
|
- <el-alert title="可单独上传xlsx表或者图片压缩包。需确保图片命名规范,不与旧图片命名重复。"
|
|
|
- type="warning" style="margin-bottom: 10px"/>
|
|
|
+ <Dialog loading="loading" v-model="dialogVisible" title="标本信息导入" width="600">
|
|
|
+ <el-alert title="可单独上传xlsx表或者图片压缩包。需确保图片命名规范,不与旧图片命名重复。" type="warning" style="margin-bottom: 10px"/>
|
|
|
<el-upload
|
|
|
ref="uploadRef"
|
|
|
v-model:file-list="fileList"
|
|
@@ -15,7 +14,7 @@
|
|
|
accept=".xlsx, .xls"
|
|
|
drag
|
|
|
>
|
|
|
- <Icon icon="ep:upload"/>
|
|
|
+ <Icon icon="ep:upload" />
|
|
|
<div class="el-upload__text">将xlsx表拖到此处,或<em>点击上传</em></div>
|
|
|
<template #tip>
|
|
|
<div class="el-upload__tip text-center">
|
|
@@ -132,7 +131,9 @@ const submitForm = async () => {
|
|
|
'Content-Type': 'multipart/form-data'
|
|
|
}
|
|
|
});
|
|
|
+ console.log(123)
|
|
|
submitFormSuccess(response)
|
|
|
+ console.log(1233333)
|
|
|
} catch (error) {
|
|
|
submitFormError()
|
|
|
} finally {
|
|
@@ -153,29 +154,51 @@ const submitFormSuccess = (response: any) => {
|
|
|
// 拼接提示语
|
|
|
const data = response.data.data
|
|
|
// console.log(data)
|
|
|
- let text = '上传成功数量:' + data.createSpecimenNumbers.length + ';'
|
|
|
- for (let specimenInfodata of data.createSpecimenNumbers) {
|
|
|
- text += '标本编号:' + specimenInfodata + '、'
|
|
|
+ let text
|
|
|
+ if(data.createSpecimenNumbers != null){
|
|
|
+ text = '上传成功数量:' + data.createSpecimenNumbers.length + ';'
|
|
|
+ for (let specimenInfodata of data.createSpecimenNumbers) {
|
|
|
+ text += '标本编号:' + specimenInfodata + '、'
|
|
|
+ }
|
|
|
}
|
|
|
- text += '。更新成功数量:' + data.updateSpecimenNumbers.length + ';'
|
|
|
- for (const specimenInfodata of data.updateSpecimenNumbers) {
|
|
|
- text += '标本编号:' + specimenInfodata + '、'
|
|
|
+ if(data.updateSpecimenNumbers != null){
|
|
|
+ text += '。更新成功数量:' + data.updateSpecimenNumbers.length + ';'
|
|
|
+ for (const specimenInfodata of data.updateSpecimenNumbers) {
|
|
|
+ text += '标本编号:' + specimenInfodata + '、'
|
|
|
+ }
|
|
|
}
|
|
|
- text += '。更新失败数量:' + Object.keys(data.failureSpecimenNumbers).length + ';'
|
|
|
- for (const specimenInfodata in data.failureSpecimenNumbers) {
|
|
|
- text += '< ' + specimenInfodata + ': ' + data.failureSpecimenNumbers[specimenInfodata] + ' >'
|
|
|
+ if(data.failureSpecimenNumbers != null) {
|
|
|
+ text += '。更新失败数量:' + Object.keys(data.failureSpecimenNumbers).length + ';'
|
|
|
+ for (const specimenInfodata in data.failureSpecimenNumbers) {
|
|
|
+ text += '< ' + specimenInfodata + ': ' + data.failureSpecimenNumbers[specimenInfodata] + ' >'
|
|
|
+ }
|
|
|
}
|
|
|
+ if(data.createSpecimenImages != null) {
|
|
|
+ text = '图片上传成功数量:' + data.createSpecimenImages.length + ';'
|
|
|
+ for (let specimenInfodata of data.createSpecimenImages) {
|
|
|
+ text += '图片名称:' + specimenInfodata + '、'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(JSON.stringify(data.failureSpecimenImages) != '{}' &&data.failureSpecimenImages != null) {
|
|
|
+ text = '图片上传失败数量:' + Object.keys(data.failureSpecimenImages).length + ';'
|
|
|
+ for (let specimenInfodata of data.failureSpecimenImages) {
|
|
|
+ text += '< ' + specimenInfodata + ': ' + data.failureSpecimenImages[specimenInfodata] + ' >'
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
console.log(555)
|
|
|
message.alert(text)
|
|
|
// formLoading.value = false
|
|
|
dialogVisible.value = false
|
|
|
// 发送操作成功的事件
|
|
|
emits('success')
|
|
|
+ formLoading.value = false
|
|
|
}
|
|
|
|
|
|
/** 上传错误提示 */
|
|
|
const submitFormError = (): void => {
|
|
|
message.error('上传失败,请您重新上传!')
|
|
|
+
|
|
|
formLoading.value = false
|
|
|
dialogVisible.value = false
|
|
|
}
|