From 72ec737b1a270ee6be2b3e908a4c7300c3c4f88b Mon Sep 17 00:00:00 2001 From: chiyilin <2449182606@qq.com> Date: Fri, 3 Nov 2023 10:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E6=A1=A3=E6=A1=88=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ea/electronicContracts/index.vue | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/views/ea/electronicContracts/index.vue b/src/views/ea/electronicContracts/index.vue index 0db22561..31ab5659 100644 --- a/src/views/ea/electronicContracts/index.vue +++ b/src/views/ea/electronicContracts/index.vue @@ -345,7 +345,12 @@ width="1000px" append-to-body > - + + +
将文件拖到此处,或点击上传
+
+ @@ -485,9 +490,9 @@ - + @@ -573,6 +578,7 @@ import { listSimpleDepts } from "@/api/system/dept"; import { listSimplePosts } from "@/api/system/post"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import { getAccessToken, getTenantId } from "@/utils/auth"; export default { name: "ElectronicContracts", @@ -589,6 +595,15 @@ export default { value: "pId", multiple: false, }, + imgType: ".jpeg, .jpg, .png .doc, .xls, .txt, .pdf, .png, .ofd ", + uploadUrl: + process.env.VUE_APP_BASE_API + + "/admin-api/accounting/attachment/upload", // 上传地址地址 + headers: { + Authorization: "Bearer " + getAccessToken(), + "tenant-id": getTenantId(), + }, // 设置上传的请求头 + fileList: [], // 文件列表 getFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/", imgs: null, // 部门树选项 @@ -743,6 +758,11 @@ export default { handleCompanyChange(val) { this.form.companyId = val.id; this.form.company = val.organizationName; + }, + // 上传成功的函数 + handleSuccess(res) { + console.log(res); + this.form.contractAttachment = res.data.url; }, /** * 文件预览