From 4e2bb29096ac63837f8d2c5e25766ee094f45d6c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 27 十二月 2023 14:35:49 +0800
Subject: [PATCH] 	modified:   src/page/index/top/index.vue 	modified:   src/views/common/part.vue 	modified:   src/views/equipment/equipment/index.vue 	modified:   src/views/equipment/metering/index.vue 	modified:   src/views/plan/manufacturingorder/auto-operationtask.vue 	modified:   src/views/plan/operationtask/operationtask-form.vue 	modified:   src/views/quality/Packaging_ledger/index.vue 	modified:   src/views/quality/packageinspect/index.vue 	modified:   src/views/quality/processconfiguration/index.vue 	modified:   src/views/quality/teststandard/index.vue 	modified:   vue.config.js

---
 src/views/quality/teststandard/index.vue |  144 +++++++++++++++++++++++++----------------------
 1 files changed, 76 insertions(+), 68 deletions(-)

diff --git a/src/views/quality/teststandard/index.vue b/src/views/quality/teststandard/index.vue
index 4be8c9b..27c09ec 100644
--- a/src/views/quality/teststandard/index.vue
+++ b/src/views/quality/teststandard/index.vue
@@ -26,6 +26,7 @@
                 </el-col>
                 <el-col :span="8" :offset="4">
                   <el-button
+                    v-if="permissions.quality_teststandard_layout"
                     style="float: right; padding: 3px 0"
                     type="text"
                     @click="beginItemLayOut"
@@ -39,7 +40,7 @@
                     type="text"
                     :disabled="isSubmit"
                     v-thinclick="`dataFormTestStandardParam`"
-                    v-if="editable"
+                    v-if="editable && permissions.quality_teststandard_save"
                     >淇濆瓨
                   </el-button>
                 </el-col>
@@ -48,7 +49,7 @@
                     style="float: right; padding: 3px 0"
                     type="text"
                     @click="relateOperationParam()"
-                    v-if="editable"
+                    v-if="editable && permissions.quality_teststandard_insert"
                     >娣诲姞
                   </el-button>
                 </el-col>
@@ -232,7 +233,7 @@
               </el-table-column> -->
               <el-table-column label="鍗曚綅" prop="unit" align="center" />
               <!--<el-table-column label="鍙傛暟绫诲瀷" prop="type" align="center" :formatter="getParam"/>-->
-              <el-table-column label="鎿嶄綔" align="center">
+              <el-table-column label="鎿嶄綔" align="center" v-if="permissions.quality_teststandard_table_operate">
                 <template slot-scope="scope">
                   <el-button
                     type="text"
@@ -308,6 +309,7 @@
 import { copyTestStandard } from '../../../api/quality/teststandard'
 import EditParamForm from './edit-param-form'
 import itemLayout from './item-layout'
+import { mapGetters } from 'vuex'
 export default {
   data() {
     return {
@@ -424,71 +426,8 @@
             searchInfoType: 'text'
           }
         ],
-        toolbar: [
-          {
-            text: '鏂板',
-            type: 'primary',
-            fun: this.addOrUpdateHandle
-          },
-          {
-            text: '澶嶅埗',
-            type: 'primary',
-            fun: this.copy
-          },
-          {
-            text: '鎵瑰噯',
-            fun: () => {
-              this.changeState('accept')
-            },
-            disabled: false,
-            permitArr: []
-          },
-          {
-            text: '鎷掔粷',
-            fun: () => {
-              this.changeState('reject')
-            },
-            disabled: false,
-            permitArr: []
-          },
-          {
-            text: '鎾ら攢',
-            fun: () => {
-              this.changeState('cancel')
-            },
-            disabled: false,
-            permitArr: []
-          },
-          {
-            text: '澶辨晥',
-            fun: () => {
-              this.changeState('disabled')
-            },
-            disabled: false,
-            permitArr: []
-          },
-          {
-            text: '鍒犻櫎',
-            fun: () => {
-              this.deleteAll()
-            },
-            disabled: false,
-            permitArr: []
-          }
-        ],
-        operator: [
-          {
-            text: '鍒犻櫎',
-            icon: 'el-icon-delete',
-            type: 'text',
-            size: 'small',
-            fun: this.deleteHandle
-            // show: {
-            //   val: ['01draft'],
-            //   key: 'state'
-            // }
-          }
-        ],
+        toolbar: [],
+        operator: null,
         operatorConfig: {
           fixed: 'right',
           label: '鎿嶄綔',
@@ -557,6 +496,7 @@
     itemLayout
   },
   computed: {
+    ...mapGetters(['permissions']),
     editable: function() {
       if (!this.currentTestStandard) {
         return true
@@ -575,6 +515,74 @@
     this.rowDrop()
   },
   created() {
+    if(this.permissions.quality_teststandard_add){
+      this.table.toolbar.push({
+        text: '鏂板',
+        disabled: false,
+        type: 'primary',
+        fun: ()=>{this.addOrUpdateHandle()},
+        permitArr: []
+      })
+    }
+    if(this.permissions.quality_teststandard_copy){
+      this.table.toolbar.push({
+        text: '澶嶅埗',
+        type: 'primary',
+        disabled: false,
+        fun: ()=>{this.copy()},
+        permitArr: []
+      })
+    }
+    if(this.permissions.quality_teststandard_accept){
+      this.table.toolbar.push({
+        text: '鎵瑰噯',
+        disabled: false,
+        fun: ()=>{this.changeState('accept')},
+        permitArr: [],
+      })
+    }
+    if(this.permissions.quality_teststandard_revoke){
+      this.table.toolbar.push({
+        text: '鎷掔粷',
+        disabled: false,
+        fun: ()=>{this.changeState('reject')},
+        permitArr: [],
+      })
+    }
+    if(this.permissions.quality_teststandard_cancel){
+      this.table.toolbar.push({
+        text: '鎾ら攢',
+        disabled: false,
+        fun: () => {this.changeState('cancel')},
+        permitArr: [],
+      })
+    }
+    if(this.permissions.quality_teststandard_lose){
+      this.table.toolbar.push({
+        text: '澶辨晥',
+        disabled: false,
+        fun: () => {this.changeState('disabled')},
+        permitArr: [],
+      })
+    }
+    if(this.permissions.quality_teststandard_del){
+      this.table.toolbar.push({
+        text: '鎵归噺鍒犻櫎',
+        type:'primary',
+        disabled: false,
+        permitArr: [],
+        fun: ()=>{this.deleteAll()},
+      })
+    }
+    if(this.permissions.quality_teststandard_del){
+      this.table.operator = [{
+            text: '鍒犻櫎',
+            icon: 'el-icon-delete',
+            type: 'text',
+            size: 'small',
+            fun: this.deleteHandle
+          }]
+    }
     this.initDirParamType()
     this.initDirInspectionType()
   },

--
Gitblit v1.9.3