From 63204f933e349118cee4636a2fd1da038e10d99c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 25 十二月 2023 19:01:36 +0800
Subject: [PATCH] 	modified:   src/views/technology/document/index.vue 	modified:   src/views/technology/routing/index.vue

---
 src/views/technology/document/index.vue |  127 ++++++++++++++++--------------------------
 1 files changed, 49 insertions(+), 78 deletions(-)

diff --git a/src/views/technology/document/index.vue b/src/views/technology/document/index.vue
index 7ba962f..d37951f 100644
--- a/src/views/technology/document/index.vue
+++ b/src/views/technology/document/index.vue
@@ -11,29 +11,6 @@
         ref="documentTable"
       >
         <template #toolbar>
-          <!-- <el-button type="primary" :loading="ifsSynsLoading" @click="syncIfs"
-            >ERP鍚屾</el-button
-          > -->
-          <el-button v-if="permissions.technology_document_add"
-          type="primary" @click="addOrUpdateHandle">鏂板</el-button>
-
-          <el-button @click="() => {this.changeState('accept')}" 
-          :disabled="uniqueStateArr.includes(['01draft', '03accepted', '04reject'])"
-          v-if="permissions.technology_document_accept">鎵瑰噯</el-button>
-
-          <el-button @click="() => {this.changeState('reject')}"
-          :disabled="uniqueStateArr.includes(['01draft', '03accepted', '04reject'])"
-          v-if="permissions.technology_document_reject">鎷掔粷</el-button>
-
-          <el-button @click="() => {this.changeState('cancel')}" 
-          :disabled="uniqueStateArr.includes(['01draft', '03accepted', '04reject'])"
-          v-if="permissions.technology_document_cancel">鎾ら攢</el-button>
-          <el-button
-            type="primary"
-            @click="deleteBatch"
-            v-if="permissions.technology_document_del"
-            >鎵归噺鍒犻櫎</el-button
-          >
           <!-- <el-button
             type="primary"
             @click="bindTestStandard"
@@ -337,41 +314,8 @@
             searchInfoType: 'datetimerange'
           }
         ],
-        toolbar: [
-          // {
-          //   text: '澶嶅埗',
-          //   fun: this.copyDocument,
-          //   disabled: false,
-          //   permitArr: []
-          // },
-          /*,
-          {
-            text: '娴风紗OA',
-            fun: () => {
-              this.approveHandle(0)
-            },
-            disabled: false,
-            permitArr: ['01draft', '04reject'],
-            loading: false
-          },
-          {
-            text: '闄嗙紗OA',
-            fun: () => {
-              this.approveHandle(1)
-            },
-            disabled: false,
-            permitArr: ['01draft', '04reject'],
-            loading: false
-          },
-          {
-            text: '瀵煎嚭word',
-            type: 'primary',
-            fun: this.exportWord,
-            disabled: false,
-            permitArr: []
-          } */
-        ],
-        operator: [],
+        toolbar: [],
+        operator: null,
         operatorConfig: {
           fixed: 'right',
           label: '鎿嶄綔',
@@ -441,10 +385,51 @@
   activated() {
     this.getData()
   },
-  created() {
-    this.getBomTypeDbOptions()
+  created() {  
+    if(this.permissions.technology_document_add){
+      this.table.toolbar.push({
+        text: '鏂板',
+        type: 'primary',
+        disabled: true,
+        fun: ()=>{this.addOrUpdateHandle()},
+        permitArr: [],
+      })
+    }
+    if(this.permissions.technology_document_accept){
+      this.table.toolbar.push({
+        text: '鎵瑰噯',
+        disabled: true,
+        fun: ()=>{this.changeState('accept')},
+        permitArr: ['01draft', '03accepted', '04reject'],
+      })
+    }
+    if(this.permissions.technology_document_reject){
+      this.table.toolbar.push({
+        text: '鎷掔粷',
+        disabled: true,
+        fun: () => {this.changeState('reject')},
+        permitArr: ['01draft', '03accepted', '04reject'],
+      })
+    }
+    if(this.permissions.technology_document_cancel){
+      this.table.toolbar.push({
+        text: '鎾ら攢',
+        disabled: true,
+        fun: ()=>{this.changeState('cancel')},
+        permitArr: ['01draft', '03accepted', '04reject'],
+      })
+    }
     if (this.permissions.technology_document_del) {
-      this.table.operator.push({
+      this.table.toolbar.push({
+        text: '鎵归噺鍒犻櫎',
+        type: 'primary',
+        disabled: false,
+        fun: ()=>{this.deleteBatch()},
+        permitArr: [],
+      })
+    } 
+    if (this.permissions.technology_document_del) {
+      this.table.operator = [{
         text: '鍒犻櫎',
         type: 'text',
         size: 'small',
@@ -453,19 +438,9 @@
           val: ['01draft'],
           key: 'state'
         }
-      })
-    } else {
-      this.table.operator.push({
-        text: '鍒犻櫎',
-        type: 'text',
-        size: 'small',
-        fun: this.deleteHandle,
-        show: {
-          val: [],
-          key: 'state'
-        }
-      })
-    }
+      }]
+    } 
+    this.getBomTypeDbOptions()
   },
   methods: {
     getBomTypeDbOptions() {
@@ -518,10 +493,6 @@
     },
     // 鍒犻櫎
     deleteHandle(row) {
-      if(!this.permissions.technology_document_del){
-        this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
-        return
-      }
       this.$confirm('鏄惁纭鍒犻櫎宸ヨ壓鏂囦欢缂栧彿锛�' + row.number + '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',

--
Gitblit v1.9.3