From 58478924423d0dc44f5f9432a2a0a69db309e77f Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期二, 09 一月 2024 10:49:48 +0800 Subject: [PATCH] 设备同步bug修改 --- src/views/plan/customerorder/index.vue | 33 +++++++++++++++++++++++---------- 1 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue index fe3aa84..7990386 100644 --- a/src/views/plan/customerorder/index.vue +++ b/src/views/plan/customerorder/index.vue @@ -855,6 +855,13 @@ permitArr: [] }) } + this.table.toolbar.push({ + text: '涓嬭浇Word', + disabled: false, + type: 'primary', + fun: this.downloadWord, + permitArr: ['03plan','04planed'], + }) if (this.permissions.customerorder_create_masterplan) { this.table.toolbar.push({ text: '涓荤敓浜ц鍒�', @@ -863,13 +870,6 @@ permitArr: [] }) } - this.table.toolbar.push({ - text: '涓嬭浇Word', - disabled: false, - type: 'primary', - fun: this.downloadWord, - permitArr: ['03plan','04planed'], - }) }, methods: { //涓嬭浇word @@ -879,8 +879,20 @@ this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�") return } - downloadWordFile(ids).then(res=>{ - transform(res) + downloadWordFile(ids).then(response=>{ + // 澶勭悊杩斿洖鐨勬枃浠舵祦 + const blob = response.data + const link = document.createElement('a') + link.href = URL.createObjectURL(blob) + const disposition = response.headers["content-disposition"] + let temp = disposition.substring(disposition.lastIndexOf('=') + 1) + link.download = decodeURI(temp) + document.body.appendChild(link) + link.click() + window.setTimeout(function() { + URL.revokeObjectURL(blob) + document.body.removeChild(link) + }, 0) }).catch(error=>{ console.error(error); }) @@ -1037,7 +1049,8 @@ } }) if (flag) { - checkOA(this.multipleSelection.map((e) => e.id)).then((res) => { + + checkOA(this.multipleSelection.map((e) => e.id),{}).then((res) => { if (!res.data.data.success) { this.$confirm(`${res.data.data.message}`, '鎻愮ず', { confirmButtonText: '纭畾', -- Gitblit v1.9.3