| | |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | </div> |
| | | <div class="btns" style="padding-left: 30px;"> |
| | | <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="headers" :on-change="beforeUpload" |
| | | :on-error="onError" ref='upload' :on-success="handleSuccessUp" :show-file-list="false"> |
| | | <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="uploadHeader" |
| | | :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp" |
| | | :show-file-list="false"> |
| | | <el-button size="small" type="primary" :loading="upLoading">导入</el-button></el-upload> |
| | | </div> |
| | | </div> |
| | |
| | | delManageDocumentList, |
| | | doManageDocumentList, |
| | | } from '@/api/cnas/systemManagement/documentControl.js' |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | components: { |
| | | UpPdfStamp, |
| | |
| | | }, |
| | | // 用于上传文件的信息 |
| | | computed: { |
| | | headers() { |
| | | return { |
| | | 'Authorization': "Bearer " + getToken() |
| | | } |
| | | }, |
| | | action() { |
| | | return this.javaApi + '/manageDocumentList/exportManageDocumentList' |
| | | } |
| | |
| | | // 下载文件 |
| | | handleDown(row) { |
| | | if (!row.url) return this.$message.warning('文件未上传') |
| | | let url = this.javaApi + '/word/' + row.url |
| | | this.$download.saveAs(url, row.url); |
| | | this.$download.downloadFileFromUrl(row.url, row.url); |
| | | }, |
| | | // 查看文件 |
| | | handleLook(row) { |
| | |
| | | if (response.code == 200) { |
| | | this.$message.success('上传成功'); |
| | | this.refreshTable() |
| | | }else { |
| | | this.$message.error(response.msg); |
| | | } |
| | | }, |
| | | selectEnumByCategory() { |
| | |
| | | formData.append('file', pdfBlob, fileName); // 文件字段 |
| | | formData.append('id', this.currentInfo.id); // 文件名字段 |
| | | |
| | | let res = await uploadFileManageDocumentList(formData) |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ message: '上传成功', type: 'success' }); |
| | | this.addDialogVisible = false; |
| | | this.refreshTable() |
| | | return true |
| | | } else { |
| | | this.$message({ message: '上传失败', type: 'error' }); |
| | | return false |
| | | try { |
| | | let res = await uploadFileManageDocumentList(formData) |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ message: '上传成功', type: 'success' }); |
| | | this.addDialogVisible = false; |
| | | this.refreshTable() |
| | | return true |
| | | } else { |
| | | this.$message({ message: '上传失败', type: 'error' }); |
| | | return false |
| | | } |
| | | } catch (e) { |
| | | this.addLoading = false |
| | | } |
| | | |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("是否删除该条数据?", "提示", { |
| | |
| | | }) |
| | | .then(() => { |
| | | delManageDocumentList({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("删除成功"); |
| | | this.refresh(); |
| | | }); |