| | |
| | | <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 size="small" placeholder="请输入" clearable v-model="queryParams.documentCode" |
| | | @keyup.enter="refreshTable()"></el-input> |
| | | </div> |
| | |
| | | <div class="search_thing"> |
| | | <div class="search_label">上传附件:</div> |
| | | <div class="search_input"><el-upload style="margin: 8px 0 0px 50px;" action="#" :auto-upload="false" |
| | | :multiple="false" accept='.pdf' :on-change="handleChangeUpload" v-if="addDialogVisible"> |
| | | :multiple="false" accept='.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.et,.dps,.txt,.jpg,.jpeg,.png' :on-change="handleChangeUpload" v-if="addDialogVisible"> |
| | | <el-button size="small" type="primary">上传附件</el-button> |
| | | </el-upload></div> |
| | | </div> |
| | |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | current: 1, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | |
| | | handleCheck0(row) { |
| | | this.checkStampDialogVisible = false |
| | | this.checkDialogVisible = true |
| | | checkManageDocumentControlledPdf({ id: row.id }).then(res => { |
| | | const blob = new Blob([res]); |
| | | checkManageDocumentControlledPdf({ id: row.id }).then(async 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.checkDialogVisible = 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.currentStamp) |
| | | }).catch(err => { |
| | | this.checkDialogVisible = false |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | handleDown(row) { |
| | | if (!row.url) return this.$message.warning('文件未上传') |
| | | this.$download.saveAs(row.url, row.url); |
| | | const fileName = row.url.replace(/^[0-9a-fA-F-]{36}_/, '') |
| | | this.$download.saveAs(this.javaApi + '/word/' + row.url, fileName); |
| | | }, |
| | | async uploadPDF(pdfBlob) { |
| | | const formData = new FormData(); |
| | | formData.append('file', pdfBlob, this.fileName + '.pdf'); // 文件字段 |
| | | formData.append('file', pdfBlob, (this.currentInfo.name || 'controlled') + '.pdf'); // 文件字段 |
| | | formData.append('id', this.currentInfo.id); // 文件名字段 |
| | | formData.append('state', this.type); // 文件名字段 |
| | | formData.append('writer', this.currentInfo.writer); // 文件名字段 |