浏览代码

供应分析配置化

cxmo 1 年之前
父节点
当前提交
99629faf1b
共有 3 个文件被更改,包括 29 次插入5 次删除
  1. 15 1
      src/utils/buttonConfig.js
  2. 12 4
      src/views/supply_manage/stockPlant.vue
  3. 2 0
      src/vuex/modules/permissionButton.js

+ 15 - 1
src/utils/buttonConfig.js

@@ -361,4 +361,18 @@ export const statisticPermission = {
     fittingEq_refresh:'fittingEq:refresh',
     fittingEq_addMyChart:'fittingEq:addMyChart',
     fittingEq_share:'fittingEq:share',
-}
+}
+/*
+ * --------------------------------------------------------------------------供应分析------------------------------------------------
+*/
+export const stockPlantPermission = {
+    stockPlant_del:'stockPlant:del',
+    stockPlant_anlysisView:'stockPlant:anlysisView',//分析和查看,包括点击品种名称跳转详情
+    stockPlant_saveVariety:'stockPlant:saveVariety',//添加编辑
+}
+/*
+ * --------------------------------------------------------------------------商品价格曲线------------------------------------------------
+*/
+/*
+ * --------------------------------------------------------------------------系统设置------------------------------------------------
+*/

+ 12 - 4
src/views/supply_manage/stockPlant.vue

@@ -1,7 +1,8 @@
 <template>
   <div class="variety-list-page">
     <div class="top">
-      <el-button type="primary" @click="addVarietyHandle(null)" v-if="isCanAdd">添加品种</el-button>
+      <el-button v-permission="permissionBtn.stockPlantPermission.stockPlant_saveVariety"
+        type="primary" @click="addVarietyHandle(null)" v-if="isCanAdd">添加品种</el-button>
       <div class="top-right">
         <el-checkbox v-model="isCanAnalyse" @change="pageChangeHandle(1)" v-if="!isCanAdd">只看可分析</el-checkbox>
         <el-input
@@ -35,9 +36,12 @@
         </el-table-column>
         <el-table-column label="操作" align="center">
           <template slot-scope="{row}">
-            <el-button type="text" @click="analyseVarietyHandle(row)" v-if="row.Button.Analyse">分析</el-button>
-            <el-button type="text" @click="addVarietyHandle(row)" v-if="row.Button.Edit">编辑</el-button>
-            <span class="deletesty" @click="delHandle(row)" style="margin-left: 10px;" v-if="row.Button.Delete">删除</span>
+            <el-button v-permission="permissionBtn.stockPlantPermission.stockPlant_anlysisView"
+                type="text" @click="analyseVarietyHandle(row)" v-if="row.Button.Analyse">分析</el-button>
+            <el-button v-permission="permissionBtn.stockPlantPermission.stockPlant_saveVariety"
+                type="text" @click="addVarietyHandle(row)" v-if="row.Button.Edit">编辑</el-button>
+            <span v-permission="permissionBtn.stockPlantPermission.stockPlant_del"
+                class="deletesty" @click="delHandle(row)" style="margin-left: 10px;" v-if="row.Button.Delete">删除</span>
           </template>
         </el-table-column>
         <div slot="empty" style="padding: 20px 0">
@@ -119,6 +123,10 @@ export default {
     },
     
     analyseVarietyHandle(row,type='') {
+        //如果没有分析查看的权限,就不跳转
+        if(!this.permissionBtn.checkPermissionBtn(
+            this.permissionBtn.stockPlantPermission.stockPlant_anlysisView
+        )) return
       this.$router.push({
         path:'/analyseVariety',
         query:{id:row.VarietyId,type}

+ 2 - 0
src/vuex/modules/permissionButton.js

@@ -40,6 +40,8 @@ const permissionButtons = {
                     {button_code:'sandbox:saveView'},
                     //chartHandle test
                     {button_code:'statisticFeature:share'},
+                    //stockPlant:anlysisView
+                    {button_code:'stockPlant:anlysisView'},
                 ]
                 commit('SET_PERMISSION_BUTTONS',buttons)
                 resolve('获取权限按钮成功')