| | |
| | | <div class="option-label">选择注解:</div> |
| | | <div class="annotation-options"> |
| | | <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox"> |
| | | <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="annotation"> |
| | | <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="index"> |
| | | <span>{{ annotation }} |
| | | </span> |
| | | </label> |
| | |
| | | <div class="signature-options"> |
| | | <div class="signature-checkboxes"> |
| | | <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox"> |
| | | <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="signature"> |
| | | <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="index"> |
| | | <span>{{ signature }}</span> |
| | | </label> |
| | | |
| | |
| | | /** 查看并打印Excel文件 */ |
| | | viewAndPrintExcel(row) { |
| | | const id = row.id || this.ids; |
| | | // alert(id) |
| | | this.recordId = id; |
| | | this.$modal.loading('正在获取Excel文件,请稍候...'); |
| | | |
| | | // 从后端获取Excel文件 |
| | |
| | | handlePreviewClick() { |
| | | this.showExcelPreview = true; |
| | | this.excelRenderError = ''; |
| | | |
| | | var id = this.recordId ; |
| | | this.$modal.loading('正在获取Excel文件,请稍候...'); |
| | | alert(id) |
| | | // 从后端获取Excel文件 |
| | | this.getExcelFile(id).then(blob => { |
| | | this.$modal.closeLoading(); |
| | | // 保存文件信息并显示静态弹窗 |
| | | this.currentExcelUrl = URL.createObjectURL(blob); |
| | | this.currentExcelBlob = blob; |
| | | this.currentExcelId = id; |
| | | this.excelDialogVisible = true; |
| | | this.excelLoading = false; |
| | | }).catch(error => { |
| | | this.$modal.closeLoading(); |
| | | console.error('获取Excel文件失败:', error); |
| | | this.$modal.msgError('获取Excel文件失败,请稍后重试'); |
| | | }); |
| | | // 重置vue-office-excel组件 |
| | | if (this.currentExcelUrl) { |
| | | const tempUrl = this.currentExcelUrl; |
| | |
| | | /** 从后端获取Excel文件 */ |
| | | getExcelFile(id) { |
| | | var includeQrCode = this.excelOptions.includeQrCode; |
| | | var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode; |
| | | |
| | | |
| | | if(this.excelOptions.subselectedSignatures.length!=0) |
| | | { |
| | | var selectedSignatures = this.excelOptions.subselectedSignatures |
| | | urls = urls +'/'+ selectedSignatures |
| | | } |
| | | if(this.excelOptions.subselectedAnnotations.length!=0) |
| | | { |
| | | var selectedAnnotations = this.excelOptions.subselectedAnnotations |
| | | urls = urls+"/"+selectedAnnotations |
| | | } |
| | | |
| | | return new Promise((resolve, reject) => { |
| | | // 首先尝试使用axios(项目已有的HTTP客户端) |
| | | try { |
| | |
| | | recordId: id, |
| | | |
| | | }; |
| | | alert(355) |
| | | |
| | | axios({ |
| | | method: 'Post', |
| | | url: `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode, |
| | | url: urls, |
| | | params: params, |
| | | responseType: 'blob', |
| | | headers: { 'Authorization': 'Bearer ' + getToken() } |