Parcourir la source

fix: 增加按钮权限

zh il y a 2 ans
Parent
commit
72334c4a19

+ 1 - 1
src/views/supply/transferOrder/transferOrderForm.vue

@@ -49,7 +49,7 @@
     <!-- 审核 /详情-->
     <div v-if="moduleType === 3 || moduleType === 2">
       <el-button v-if="moduleType === 3" type="primary" size="mini" @click="onExamine('OK')">同意</el-button>
-      <el-button v-if="formData.status === 'OK'" size="mini" @click="onInvoice('WAIT')">反审</el-button>
+      <el-button v-if="formData.status === 'OK' && $checkBtnRole('examine', $route.meta.roles)" size="mini" @click="onInvoice('WAIT')">反审</el-button>
     </div>
   </div>
 </template>

+ 42 - 33
src/views/supply/transferOrder/transferOrderList.vue

@@ -21,7 +21,12 @@ import import_mixin from '@/components/template/import_mixin.js'
 import add_callback_mixin from '@/components/template/add_callback_mixin.js'
 import Popu from '@/components/template/popu.vue'
 import TransferOrderForm from './transferOrderForm.vue'
-import { getListTransferV2, exportListTransferV2, invoiceCustomerTransfer, dletransferDelete } from '@/api/transferOrder'
+import {
+  getListTransferV2,
+  exportListTransferV2,
+  invoiceCustomerTransfer,
+  dletransferDelete
+} from '@/api/transferOrder'
 import { mapGetters } from 'vuex'
 export default {
   components: { TemplatePage, Popu, TransferOrderForm },
@@ -55,19 +60,21 @@ export default {
     optionsEvensGroup() {
       return [
         ...[
-          this.isCustomer ? [
-            [
-              {
-                name: '新增',
-                click: this.addOn(() => {
-                  this.visible = true
-                  this.moduleType = 1
-                })
-              }
+          this.isCustomer
+            ? [
+              [
+                {
+                  name: '新增',
+                  click: this.addOn(() => {
+                    this.visible = true
+                    this.moduleType = 1
+                  }),
+                  isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+                }
+              ]
             ]
-          ] : []
+            : []
         ]
-
       ]
     }
   },
@@ -102,7 +109,7 @@ export default {
             >
               查看
             </el-button>
-            {row.status === 'WAIT' ? (
+            {row.status === 'WAIT' && this.$checkBtnRole('examine', this.$route.meta.roles) ? (
               <el-button
                 size='mini'
                 type='text'
@@ -115,7 +122,7 @@ export default {
                 审核
               </el-button>
             ) : null}
-            {row.status === 'SAVE' || row.status === 'WAIT' ? (
+            {(row.status === 'SAVE' || row.status === 'WAIT') && this.$checkBtnRole('edit', this.$route.meta.roles) ? (
               <el-button
                 size='mini'
                 type='text'
@@ -128,9 +135,9 @@ export default {
                 编辑
               </el-button>
             ) : null}
-            {row.status === 'SAVE' ? (
+            {row.status === 'SAVE' && this.$checkBtnRole('apply', this.$route.meta.roles) ? (
               <el-popconfirm
-                onOnConfirm={ () => {
+                onOnConfirm={() => {
                   invoiceCustomerTransfer({
                     id: row.id,
                     status: 'WAIT'
@@ -146,23 +153,25 @@ export default {
                 </el-button>
               </el-popconfirm>
             ) : null}
-            {row.status === 'SAVE' || row.status === 'WAIT' ? <el-popconfirm
-              onOnConfirm={ () => {
-                dletransferDelete({
-                  id: row.id
-                }).then(res => {
-                  this.$successMsg('删除成功')
-                  this.$refs.pageRef.refreshList()
-                })
-              }}
-              title='是否确定需要删除该项内容?'
-            >
-              <el-button slot='reference' size='mini' type='text'>
-                删除
-              </el-button>
-            </el-popconfirm> : null
-            }
-          </div>)
+            {(row.status === 'SAVE' || row.status === 'WAIT') && this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={() => {
+                  dletransferDelete({
+                    id: row.id
+                  }).then(res => {
+                    this.$successMsg('删除成功')
+                    this.$refs.pageRef.refreshList()
+                  })
+                }}
+                title='是否确定需要删除该项内容?'
+              >
+                <el-button slot='reference' size='mini' type='text'>
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
       }
     },
     handleClose() {