Przeglądaj źródła

电子表单填写时未获取record文件路径问题修复

cfort 1 rok temu
rodzic
commit
fa3fc7218b
1 zmienionych plików z 11 dodań i 4 usunięć
  1. 11 4
      src/views/business/onlineForm/index.vue

+ 11 - 4
src/views/business/onlineForm/index.vue

@@ -442,13 +442,20 @@ export default {
             }
             createTemplateFile({ templateId }).then(res => {
                 this.fileOption = res.data
+                if (this.$utils.isEmpty(res.data)) {
+                    return this.$message.warning('获取文件信息失败!')
+                }
+                const { referenceData, title } = res.data.document || {}
+                const { fileKey } = referenceData || {}
+                const temp = fileKey ? JSON.parse(fileKey) : {}
+                const fileInfo = JSON.stringify({ filename: title, filepath: temp.fileName })
                 this.addDataCont = {
                     templateId,
                     name: name,
-                    file: templateFile,
+                    file: fileInfo,
                     type: parentId,
-                    path: filePath,
-                    option: res.data ? JSON.stringify(res.data) : '',
+                    path: temp.fileName,
+                    option: res.data,
                     config: configData
                 }
                 this.startFormVisible = true
@@ -470,7 +477,7 @@ export default {
                 file: templateFile,
                 type: parentId,
                 path: filePath,
-                option: fileOption,
+                option: this.fileOption,
                 config: configData
             }
             this.startFormVisible = true