|
@@ -10,76 +10,11 @@ Page({
|
|
|
msgList: [], //消息列表
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- console.log(options)
|
|
|
this.setData({ //获取胶囊位置信息
|
|
|
capsule: wx.getMenuButtonBoundingClientRect()
|
|
|
})
|
|
|
this.refreshData() //更新权限等信息
|
|
|
},
|
|
|
-
|
|
|
- queryApp(name) {
|
|
|
- const routeList = [{
|
|
|
- name: "商城",
|
|
|
- path: "/packageA/market/index",
|
|
|
- icon: "icon-shangcheng"
|
|
|
- }, {
|
|
|
- name: "销售订单",
|
|
|
- path: "/packageA/orderForm/index",
|
|
|
- icon: "icon-dingdan"
|
|
|
- }, {
|
|
|
- name: "收货",
|
|
|
- path: "/packageA/shipment/index",
|
|
|
- icon: "icon-shouhuo"
|
|
|
- }, {
|
|
|
- name: "业绩目标",
|
|
|
- path: "/packageA/target/index",
|
|
|
- icon: "icon-yejimubiao"
|
|
|
- }, {
|
|
|
- name: "账户",
|
|
|
- path: "/packageA/account/index",
|
|
|
- icon: "icon-zhanghu"
|
|
|
- }, {
|
|
|
- name: "促销活动",
|
|
|
- path: "/packageA/activity/index",
|
|
|
- icon: "icon-cuxiaohuodong"
|
|
|
- }, {
|
|
|
- name: "工具查询",
|
|
|
- path: "/packageA/tool/index",
|
|
|
- icon: "icon-kaipiao"
|
|
|
- }, {
|
|
|
- name: "购物车",
|
|
|
- path: "/packageA/shopping/index",
|
|
|
- icon: "icon-kaipiao"
|
|
|
- }, {
|
|
|
- name: "开票",
|
|
|
- path: "/packageA/invoice/index",
|
|
|
- icon: "icon-kaipiao"
|
|
|
- }, {
|
|
|
- name: "打款凭证",
|
|
|
- path: "/packageA/remitVoucher/index",
|
|
|
- icon: "icon-shujuchaxun"
|
|
|
- }, {
|
|
|
- name: "工具借用",
|
|
|
- path: "/packageA/borrow/index",
|
|
|
- icon: "icon-shujuchaxun"
|
|
|
- }, {
|
|
|
- name: "工具归还",
|
|
|
- path: "/packageA/toolBill/index",
|
|
|
- icon: "icon-shujuchaxun"
|
|
|
- }, {
|
|
|
- name: "居间费结算",
|
|
|
- path: "/packageA/betweenFee/index",
|
|
|
- icon: "icon-shujuchaxun"
|
|
|
- }, {
|
|
|
- name: "数据查询",
|
|
|
- path: "#",
|
|
|
- icon: "icon-shujuchaxun"
|
|
|
- }];
|
|
|
- let i = routeList.findIndex(v => v.name == name);
|
|
|
- routeList[i].index = i
|
|
|
- return routeList[i]
|
|
|
- },
|
|
|
-
|
|
|
/* 更新站点信息 */
|
|
|
refreshData() {
|
|
|
this.setData({
|
|
@@ -88,11 +23,6 @@ Page({
|
|
|
if (wx.getStorageSync('userauth').length != 0) {
|
|
|
let authList = {},
|
|
|
entrance = [{
|
|
|
- label: "E-订单",
|
|
|
- appid: "wxc1b6ae925ac1d06a",
|
|
|
- icon: "work-E-dingdan",
|
|
|
- list: getedd()
|
|
|
- }, {
|
|
|
label: "通用",
|
|
|
icon: "work-tongyong",
|
|
|
appid: "wx08b337e860e3ea58",
|
|
@@ -110,8 +40,18 @@ Page({
|
|
|
icon: "work-xiaochengxutongxunlu"
|
|
|
}])
|
|
|
}, {
|
|
|
- label: "营销工具",
|
|
|
+ label: "E-订单",
|
|
|
+ appid: "wxc1b6ae925ac1d06a",
|
|
|
icon: "work-E-dingdan",
|
|
|
+ list: getedd()
|
|
|
+ }, {
|
|
|
+ label: "E-服务",
|
|
|
+ appid: "wxc1b6ae925ac1d06a",
|
|
|
+ icon: "work-E-fuwu",
|
|
|
+ list: geteservice()
|
|
|
+ }, {
|
|
|
+ label: "营销工具",
|
|
|
+ icon: "work-yingxiaogongju",
|
|
|
appid: "wx08b337e860e3ea58",
|
|
|
list: gettool()
|
|
|
}, {
|
|
@@ -266,7 +206,7 @@ Page({
|
|
|
}, {
|
|
|
name: "打款凭证",
|
|
|
path: "/packageA/remitVoucher/index",
|
|
|
- icon: "work-shujuchaxun"
|
|
|
+ icon: "work-dakuanpingzheng"
|
|
|
}, {
|
|
|
name: "工具借用",
|
|
|
path: "/packageA/borrow/index",
|
|
@@ -278,12 +218,13 @@ Page({
|
|
|
}, {
|
|
|
name: "居间费结算",
|
|
|
path: "/packageA/betweenFee/index",
|
|
|
- icon: "work-shujuchaxun"
|
|
|
- }, {
|
|
|
+ icon: "work-jujianfeijiesuan"
|
|
|
+ }, ];
|
|
|
+ /* {
|
|
|
name: "数据查询",
|
|
|
path: "#",
|
|
|
icon: "work-shujuchaxun"
|
|
|
- }];
|
|
|
+ } */
|
|
|
let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货与库存", "业绩查询"]),
|
|
|
list = [];
|
|
|
edd.forEach(v => {
|
|
@@ -303,6 +244,44 @@ Page({
|
|
|
});
|
|
|
return dye(list.sort((a, b) => a.index - b.index))
|
|
|
};
|
|
|
+ //E服务
|
|
|
+ function geteservice() {
|
|
|
+ let paths = [{
|
|
|
+ name: "工单",
|
|
|
+ path: "/packageA/target/index",
|
|
|
+ icon: "work-yejimubiao"
|
|
|
+ }, {
|
|
|
+ name: "申请单",
|
|
|
+ path: "/packageA/market/index",
|
|
|
+ icon: "work-shangcheng"
|
|
|
+ }, {
|
|
|
+ name: "申请单管理",
|
|
|
+ path: "/packageA/orderForm/index",
|
|
|
+ icon: "work-dingdan"
|
|
|
+ }, {
|
|
|
+ name: "业务员服务申请单",
|
|
|
+ path: "/packageA/shipment/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 = [{
|
|
@@ -358,21 +337,17 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
-
|
|
|
+ wx.setStorageSync('auth', authList)
|
|
|
this.setData({
|
|
|
entrance,
|
|
|
auth: JSON.stringify(authList),
|
|
|
userMsg: JSON.stringify(wx.getStorageSync('userMsg'))
|
|
|
})
|
|
|
-
|
|
|
/* 获取首页banner */
|
|
|
let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
|
|
|
if (banner) this.setData({
|
|
|
bannerList: banner.ads
|
|
|
})
|
|
|
-
|
|
|
- wx.setStorageSync('auth', authList)
|
|
|
-
|
|
|
} else {
|
|
|
setTimeout(this.refreshData, 10);
|
|
|
return;
|
|
@@ -443,7 +418,7 @@ Page({
|
|
|
clearInterval(DataCarousel);
|
|
|
},
|
|
|
onReady() {
|
|
|
- this.setListHeight();
|
|
|
+ // this.setListHeight();
|
|
|
},
|
|
|
/* 设置页面高度 */
|
|
|
setListHeight() {
|