|
@@ -31,7 +31,7 @@
|
|
|
</el-form>
|
|
|
</hc-card-item>
|
|
|
</el-scrollbar>
|
|
|
- <HcUploadFile ref="HcUploadFileRef" @finish="HcUploadFileFinish" />
|
|
|
+ <HcUploadFile ref="HcUploadFileRef" @finish="HcUploadFileFinish" @success="uploadFileSuccess" />
|
|
|
</hc-new-dialog>
|
|
|
</template>
|
|
|
|
|
@@ -217,11 +217,16 @@ const formItemChange = (src, index, list)=>{
|
|
|
}
|
|
|
const HcUploadFileRef = ref(null)
|
|
|
|
|
|
+// 文件全部上传完成
|
|
|
// 文件全部上传完成
|
|
|
const HcUploadFileFinish = async (res) => {
|
|
|
let arr = []
|
|
|
res.forEach((ele)=>{
|
|
|
- arr.push(ele.resData)
|
|
|
+ const { pdfUrl } = ele.resData
|
|
|
+ if (pdfUrl) {
|
|
|
+ arr.push(ele.resData)
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
arr.forEach((ele)=>{
|
|
|
ele.fileName = ele.originalName
|
|
@@ -234,6 +239,17 @@ fileName.value = baseForm.value.fileList
|
|
|
|
|
|
HcUploadFileRef?.value.setModalShow(false)
|
|
|
}
|
|
|
+
|
|
|
+// 文件上传成功的回调
|
|
|
+const uploadFileSuccess = ({ resData }) => {
|
|
|
+ const { pdfUrl } = resData
|
|
|
+ if (isNullES(pdfUrl)) {
|
|
|
+ window.$message.warning('该文件不能生成pdf,请更换文件上传')
|
|
|
+ HcUploadFileRef?.value.setModalShow(false)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|