From 616a71ebbb82d6143768a17bf4ab84b860bb82e0 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 21 五月 2024 14:53:12 +0800
Subject: [PATCH] 修改产品追溯
---
src/views/technology/document/index.vue | 43 ++++++++++++++++++++++++++-----------------
1 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/src/views/technology/document/index.vue b/src/views/technology/document/index.vue
index d37951f..0f9485e 100644
--- a/src/views/technology/document/index.vue
+++ b/src/views/technology/document/index.vue
@@ -79,7 +79,6 @@
data() {
return {
ids: [],
- uniqueStateArr: [],
ajaxFun: fetchList,
multipleSelection: [],
isShowQuery: false,
@@ -390,7 +389,7 @@
this.table.toolbar.push({
text: '鏂板',
type: 'primary',
- disabled: true,
+ disabled: false,
fun: ()=>{this.addOrUpdateHandle()},
permitArr: [],
})
@@ -441,6 +440,17 @@
}]
}
this.getBomTypeDbOptions()
+ },
+ watch:{
+ multipleSelection(newVal){
+ if(newVal.length==0){
+ this.table.toolbar.forEach(ele=>{
+ if(ele.text=='鎷掔粷' || ele.text=='鎵瑰噯' || ele.text=='鎾ら攢'){
+ ele.disabled = true
+ }
+ })
+ }
+ }
},
methods: {
getBomTypeDbOptions() {
@@ -548,22 +558,21 @@
uniqueStateArr.push(stateArr[i])
}
}
- this.uniqueStateArr = uniqueStateArr
// 寰幆琛ㄥご鎸夐挳锛屽垽鏂瘡涓寜閽殑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
- // }
- // }
+ 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
+ }
+ }
// 灏嗛�変腑璁板綍璧嬪�肩粰multipleSelection
this.multipleSelection = val
},
--
Gitblit v1.9.3