Selaa lähdekoodia

工作台添加E服务应用

zhaoxiaohai 3 vuotta sitten
vanhempi
commit
76e1569a84
2 muutettua tiedostoa jossa 45 lisäystä ja 2 poistoa
  1. 44 1
      pages/tabbar/workbench/index.js
  2. 1 1
      pages/tabbar/workbench/index.wxml

+ 44 - 1
pages/tabbar/workbench/index.js

@@ -44,7 +44,12 @@ Page({
                     appid: "wxc1b6ae925ac1d06a",
                     icon: "work-E-dingdan",
                     list: getedd()
-                }];
+                }, {
+                    label: "E-服务",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-fuwu",
+                    list: geteservice()
+                }, ];
             //营销工具
             function gettool() {
                 const paths = [{
@@ -229,6 +234,44 @@ Page({
                 });
                 return dye(list.sort((a, b) => a.index - b.index))
             };
+            //E服务
+            function geteservice() {
+                let paths = [{
+                    name: "工单",
+                    path: "/Eservice/workOrder/index",
+                    icon: "work-yejimubiao"
+                }, {
+                    name: "申请单",
+                    path: "/Eservice/agent/serviceBillList/index",
+                    icon: "work-shangcheng"
+                }, {
+                    name: "申请单管理",
+                    path: "/Eservice/workerLeader/serviceBillList/index",
+                    icon: "work-dingdan"
+                }, {
+                    name: "业务员服务申请单",
+                    path: "/Eservice/saler/serviceBillList/index",
+                    icon: "work-shouhuo"
+                }];
+                let eservice = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-服务"], ["工单管理"]),
+                    list = [];
+                eservice.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            }
             //染色
             function dye(list) {
                 let colorList = [{

+ 1 - 1
pages/tabbar/workbench/index.wxml

@@ -20,7 +20,7 @@
                     <view class="icon-box" style="background-color: {{it.bColor}};">
                         <text class="work {{it.icon}}" style="color: {{it.color}};" />
                     </view>
-                    <view class="name line-1">{{it.name}}</view>
+                    <view class="name">{{it.name}}</view>
                 </navigator>
             </view>
         </view>