zhaoxiaohai 3 年 前
コミット
89717a065d
2 ファイル変更18 行追加3 行削除
  1. 14 1
      packageA/forecast/index.js
  2. 4 2
      packageA/forecast/index.wxml

+ 14 - 1
packageA/forecast/index.js

@@ -16,7 +16,20 @@ Page({
         }
     },
     onLoad(options) {
-        this.getList()
+        this.getList();
+        try {
+            const arr = JSON.parse(options.auth)[0].meta.auth,
+                auth = arr.map(v => v.optionname)
+            this.setData({
+                auth
+            })
+        } catch (e) {
+            let arr = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['销售预测'])[0].apps[0].meta.auth,
+                auth = arr.map(v => v.optionname)
+            this.setData({
+                auth
+            })
+        }
     },
     getList(init = false) {
         //init 用于初始化分页

+ 4 - 2
packageA/forecast/index.wxml

@@ -14,10 +14,12 @@
             <navigator url="#" data-item="{{item}}" bindtap="toDetail">
                 <van-icon size='24rpx' name="add-o" /> 创建/编辑提报
             </navigator>
-            <navigator url="./record?id={{item.sa_salesforecastmodelid}}">
+            <navigator wx:if="{{per.query(auth,'查看记录')}}" url="./record?id={{item.sa_salesforecastmodelid}}">
                 <van-icon size='24rpx' name="search" /> 提报记录
             </navigator>
         </view>
     </view>
     <view style="height:30px;" />
-</My_listBox>
+</My_listBox>
+
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />