From 210e6ea4eab68b1c607b48870b5e3553930853fb Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期五, 05 一月 2024 14:53:51 +0800 Subject: [PATCH] 销售订单-下载按钮修改4 --- src/views/plan/customerorder/index.vue | 40 ++++++++++++++++++++++++++++++++-------- 1 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue index 990cd87..fe3aa84 100644 --- a/src/views/plan/customerorder/index.vue +++ b/src/views/plan/customerorder/index.vue @@ -54,11 +54,6 @@ type="primary" @click="()=>exportDialogVisible=true" >瀵煎嚭鍙拌处</el-button> - <el-button - style="margin-left:10px;" - type="primary" - @click="downloadWord" - >涓嬭浇</el-button> </template> </ttable> <!-- 寮圭獥, 鏃ユ湡閫夋嫨 --> @@ -290,6 +285,7 @@ export default { data() { return { + uniqueStateArr: [], dataForm: { selectTime: null, exportTime: null @@ -855,16 +851,25 @@ text: '璁剧疆閿�鍞欢', type: 'primary', fun: this.setSalesPart, - disabled: false + disabled: false, + permitArr: [] }) } if (this.permissions.customerorder_create_masterplan) { this.table.toolbar.push({ text: '涓荤敓浜ц鍒�', disabled: false, - fun: this.masterPlanHandle + fun: this.masterPlanHandle, + permitArr: [] }) } + this.table.toolbar.push({ + text: '涓嬭浇Word', + disabled: false, + type: 'primary', + fun: this.downloadWord, + permitArr: ['03plan','04planed'], + }) }, methods: { //涓嬭浇word @@ -874,7 +879,11 @@ this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�") return } - downloadWordFile(ids) + downloadWordFile(ids).then(res=>{ + transform(res) + }).catch(error=>{ + console.error(error); + }) }, getOtcPartSyncOptionList() { return this.otcPartSyncOptionList @@ -1192,6 +1201,21 @@ this.stateTagArr[i].disabled = true } } + // 寰幆琛ㄥご鎸夐挳锛屽垽鏂瘡涓寜閽殑permitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆 + var toolbar = this.table.toolbar + for (var j = 0; j < toolbar.length; j++) { + if ( + uniqueStateArr.every((val) => + toolbar[j].permitArr.length <= 0 + ? true + : toolbar[j].permitArr.includes(val) + ) + ) { + toolbar[j].disabled = false + } else { + toolbar[j].disabled = true + } + } this.multipleSelection = val }, getCustomerCoState(row, column, cellValue) { -- Gitblit v1.9.3