From 059486a09548f9fa2b796630374cad9f49d9ae77 Mon Sep 17 00:00:00 2001 From: chiyilin <2449182606@qq.com> Date: Wed, 1 Nov 2023 15:26:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=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/electronicAssets/index.vue | 342 ++++++------------ src/views/ea/electronicConsultation/index.vue | 40 +- .../ea/electronicCustomerComplaint/index.vue | 48 ++- src/views/ea/electronicEmployee/index.vue | 46 ++- 4 files changed, 232 insertions(+), 244 deletions(-) diff --git a/src/views/ea/electronicAssets/index.vue b/src/views/ea/electronicAssets/index.vue index 08fa3333..c7bb421a 100644 --- a/src/views/ea/electronicAssets/index.vue +++ b/src/views/ea/electronicAssets/index.vue @@ -1,81 +1,35 @@ - + - + @@ -179,10 +102,7 @@ @@ -193,103 +113,60 @@ - + - + - + - - + + + +
将文件拖到此处,或点击上传
+
+ + - - + + - + @@ -302,83 +179,54 @@ + + - + - + - + - - + + - + - + - + @@ -388,13 +236,7 @@ - + @@ -402,27 +244,15 @@ - + - + @@ -438,9 +268,7 @@
@@ -464,6 +292,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: "ElectronicAssets", @@ -478,6 +307,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: [], // 文件列表 // 部门树选项 deptOptions: undefined, // 遮罩层 @@ -505,6 +343,7 @@ export default { queryParams: { pageNo: 1, pageSize: 10, + contractAttachment:null, companyId: null, company: null, deptId: null, @@ -558,6 +397,25 @@ export default { this.loading = false; }); }, + // 上传成功的函数 + handleSuccess(res) { + console.log(res); + this.form.contractAttachment = res.data.url; + }, + /** + * 文件预览 + * @param fileUrl + */ + openLink(fileUrl) { + const url = + process.env.VUE_APP_ONLINE_API + + `/onlinePreview?url=${encodeURIComponent(this.base64Encode(fileUrl))}`; + window.open(url); + }, + /** 查看附件按钮操作 */ + handleViewFJ(row) { + this.openLink(row.contractAttachment); + }, //获取字典数据 handleInitList() { // 获取凭证类别 @@ -639,6 +497,7 @@ export default { deptName: undefined, assetCode: undefined, assetName: undefined, + contractAttachment:undefined, assetDescription: undefined, assetType: undefined, purchaseDate: undefined, @@ -681,6 +540,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.fileList = []; this.open = true; this.optType = "add"; this.title = "添加资产档案"; @@ -756,7 +616,7 @@ export default { this.getList(); this.$modal.msgSuccess("删除成功"); }) - .catch(() => {}); + .catch(() => { }); }, /** 导出按钮操作 */ handleExport() { @@ -774,7 +634,7 @@ export default { this.$download.excel(response, "资产档案.xls"); this.exportLoading = false; }) - .catch(() => {}); + .catch(() => { }); }, }, }; diff --git a/src/views/ea/electronicConsultation/index.vue b/src/views/ea/electronicConsultation/index.vue index 01c59487..0cd4414c 100644 --- a/src/views/ea/electronicConsultation/index.vue +++ b/src/views/ea/electronicConsultation/index.vue @@ -312,7 +312,13 @@ v-dialogDrag append-to-body > - + + +
将文件拖到此处,或点击上传
+
+ + @@ -515,6 +521,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: "ElectronicConsultation", @@ -530,6 +537,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: [], // 文件列表 // 部门树选项 deptOptions: undefined, // 遮罩层 @@ -561,6 +577,7 @@ export default { createTime: [], company: null, systemDept: null, + contractAttachment:null, consultationId: null, consultationType: null, consultationTitle: null, @@ -602,6 +619,25 @@ export default { this.total = response.data.total; this.loading = false; }); + }, + // 上传成功的函数 + handleSuccess(res) { + console.log(res); + this.form.contractAttachment = res.data.url; + }, + /** + * 文件预览 + * @param fileUrl + */ + openLink(fileUrl) { + const url = + process.env.VUE_APP_ONLINE_API + + `/onlinePreview?url=${encodeURIComponent(this.base64Encode(fileUrl))}`; + window.open(url); + }, + /** 查看附件按钮操作 */ + handleViewFJ(row) { + this.openLink(row.contractAttachment); }, /** 查询部门下拉树结构 + 岗位下拉 */ getTreeselect() { @@ -683,6 +719,7 @@ export default { systemDept: undefined, consultationId: undefined, consultationType: undefined, + contractAttachment:undefined, consultationTitle: undefined, consultationContent: undefined, consultorName: undefined, @@ -719,6 +756,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.fileList = []; this.open = true; this.optType = "add"; this.title = "添加咨询档案"; diff --git a/src/views/ea/electronicCustomerComplaint/index.vue b/src/views/ea/electronicCustomerComplaint/index.vue index 52e37bfd..866cb673 100644 --- a/src/views/ea/electronicCustomerComplaint/index.vue +++ b/src/views/ea/electronicCustomerComplaint/index.vue @@ -274,6 +274,15 @@ width="180px" >