| | |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <div style="display: flex;"> |
| | | <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> |
| | | <span style="width: 128px;font-size: 14px;font-weight: 700;color: #606266;">申请文件编号</span> |
| | | <span style="width: 128px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">申请文件编号</span> |
| | | <el-input v-model="queryParams.code" clearable placeholder="请输入" size="small" |
| | | @keyup.enter="refreshTable()"></el-input> |
| | | </div> |
| | |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">相关附件:</div> |
| | | <div class="search_input"><el-upload v-if="addDialogVisible" :auto-upload="false" :multiple="false" |
| | | :on-change="handleChangeUpload" accept='.pdf' action="#" style="margin: 8px 0 0px 50px;"> |
| | | :on-change="handleChangeUpload" accept='.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.et,.dps,.txt,.jpg,.jpeg,.png' action="#" style="margin: 8px 0 0px 50px;"> |
| | | <el-button size="small" type="primary">上传附件</el-button> |
| | | </el-upload></div> |
| | | </div> |
| | |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | current: 1, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | |
| | | this.getCurrentFile(alterBeforeCode) |
| | | this.addDialogVisible = true |
| | | this.diaLoading = true |
| | | checkManageDocumentAlterPdf({ id: row.id }).then(res => { |
| | | checkManageDocumentAlterPdf({ id: row.id }).then(async res => { |
| | | // |
| | | this.diaLoading = false |
| | | const blob = new Blob([res]); |
| | | // 后端转 PDF 失败时会返回 JSON 错误,blob 里就不是 PDF |
| | | if (res.type && res.type.includes('json')) { |
| | | const data = JSON.parse(await res.text()) |
| | | this.$message.error(data.msg || '附件转换预览失败') |
| | | this.addDialogVisible = false |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/pdf' }); |
| | | const file = new File([blob], row.name, { type: 'application/pdf' }) |
| | | this.$refs.UpPdfStamp.lookFile(file) |
| | | this.currentInfo = row |
| | | }).catch(err => { |
| | | this.diaLoading = false |
| | | this.addDialogVisible = false |
| | | console.log(err) |
| | | }) |
| | | }, |