|
|
@@ -88,6 +88,11 @@ Page({
|
|
|
if (page && wx.getStorageSync('userauth').length != 0) {
|
|
|
let authList = {},
|
|
|
entrance = [{
|
|
|
+ label: "CRM",
|
|
|
+ appid: "wx7505ddb0a1ec6146",
|
|
|
+ icon: "work-E-dingdan",
|
|
|
+ list: getcrm()
|
|
|
+ },{
|
|
|
label: "E-订单",
|
|
|
appid: "wx7505ddb0a1ec6146",
|
|
|
icon: "work-E-dingdan",
|
|
|
@@ -209,6 +214,52 @@ Page({
|
|
|
});
|
|
|
return dye(list.sort((a, b) => a.index - b.index))
|
|
|
};
|
|
|
+ //CRM
|
|
|
+ function getcrm() {
|
|
|
+ let paths = [{
|
|
|
+ name: "客户",
|
|
|
+ key: "wcrmcustomer",
|
|
|
+ path: "/CRM/customer/index",
|
|
|
+ icon: "work-kehu"
|
|
|
+ }, {
|
|
|
+ name: "订单",
|
|
|
+ key: "wcrmorder",
|
|
|
+ path: "/CRM/order/index",
|
|
|
+ icon: "work-dingdan"
|
|
|
+ }, {
|
|
|
+ name: "仓库管理",
|
|
|
+ key: "wcrmwarehouse",
|
|
|
+ path: "/CRM/warehouse/index",
|
|
|
+ icon: "work-cangku"
|
|
|
+ }, {
|
|
|
+ name: "线索",
|
|
|
+ key: "wcrmlead",
|
|
|
+ path: "/CRM/lead/index",
|
|
|
+ icon: "work-xiansuo"
|
|
|
+ }];
|
|
|
+ let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["CRM"], ["crm"]),
|
|
|
+ list = [];
|
|
|
+ crm.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),
|
|
|
+ forms: s.meta.forms,
|
|
|
+ tables: s.meta.tables,
|
|
|
+ }
|
|
|
+ if (authList[s.name].options.some(s => s == "read")) {
|
|
|
+ let i = paths.findIndex(k => k.key == s.name || k.name == s.meta.title);
|
|
|
+ if (i != -1) {
|
|
|
+ paths[i].name = s.meta.title;
|
|
|
+ paths[i].index = i;
|
|
|
+ paths[i].isneedpay = s.isneedpay;
|
|
|
+ list.push(paths[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ return dye(list.sort((a, b) => a.index - b.index))
|
|
|
+ };
|
|
|
//染色
|
|
|
function dye(list) {
|
|
|
let colorList = [{
|