Browse Source

任务模块由权限控制

xiaohaizhao 2 years ago
parent
commit
1b0dca3c61

+ 13 - 10
packageA/activity/detail.js

@@ -4,7 +4,12 @@ Page({
         loading: true,
         isLeader: false, //是否为负责人
         tabsActive: 1, //tabs 选中项
-        tabsList: [{
+
+    },
+    onLoad(options) {
+        getApp().globalData.handleClue = null;
+        const appAuth = wx.getStorageSync('auth').wmarketing_activity;
+        let tabsList = [{
             label: "详细信息",
             icon: "icon-tabxiangxixinxi1"
         }, {
@@ -19,18 +24,17 @@ Page({
             label: "跟进动态",
             icon: "icon-tabgenjinjilu",
             model: "#Trace"
-        }, {
+        }]
+        if (appAuth.istask) tabsList.push({
             label: "任务",
             icon: "icon-tabrenwu",
             model: "#Work"
-        }]
-    },
-    onLoad(options) {
-        getApp().globalData.handleClue = null;
+        })
         this.setData({
             sat_campaignid: options.id,
-            isAdmin: wx.getStorageSync('auth').wmarketing_activity.options.some(v => v == "admin"), //是否具有管理权限
-            options: wx.getStorageSync('auth').wmarketing_activity.options, //权限列表
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            options: appAuth.options, //权限列表
+            tabsList
         });
         this.getDetail();
     },
@@ -117,8 +121,7 @@ Page({
                 }, {
                     label: "转手次数",
                     value: res.data.leader[0].leadernum
-                }],
-                tabsList: this.data.tabsList
+                }]
             });
             this.getTags();
             this.getGroup();

+ 7 - 5
packageA/contract/detail.js

@@ -17,12 +17,14 @@ Page({
         loading: true
     },
     onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').wcontract;
         this.setData({
             sa_contractid: options.id,
-            isAdmin: wx.getStorageSync('auth').wcontract.options.some(v => v == "admin"), //是否具有管理权限
-            options: wx.getStorageSync('auth').wcontract.options, //权限列表
-        });
-        this.getDetail();
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            options: appAuth.options, //权限列表
+            istask: appAuth.istask
+        })
+        this.getDetail(true);
     },
     getDetail() {
         _Http.basic({
@@ -102,7 +104,7 @@ Page({
                     tabsActive = 1;
                     break;
             };
-            tabsList.push({
+            if (this.data.istask) tabsList.push({
                 label: "任务",
                 icon: "icon-tabrenwu",
                 model: "#Work"

+ 25 - 17
packageA/finishforecast/detail.js

@@ -12,19 +12,6 @@ Page({
         admin: false,
         tabsActive: 0,
         active: null,
-        tabsList: [{
-            label: "项目产品清单",
-            icon: "icon-tabchanpin",
-            model: "#Project"
-        }, {
-            label: "附件",
-            icon: "icon-tabfujian1",
-            model: "#Files"
-        }, {
-            label: "操作记录",
-            icon: "icon-tabcaozuojilu1",
-            model: "#Record"
-        }],
         tabbarList: [{
             icon: "icon-guanlian-bianji",
             label: "添加项目"
@@ -43,10 +30,6 @@ Page({
         this.setData({
             sa_salesforecastbillid: options.id
         })
-        this.getDetail();
-        this.getTags();
-        this.partialRenewal();
-
         if (options.admin == 'true') {
             this.setData({
                 admin: true
@@ -91,6 +74,31 @@ Page({
                 });
             });
         }
+        const appAuth = wx.getStorageSync('auth')[options.admin == 'true' ? 'finishforecastadmin' : 'finishforecast'];
+        let tabsList = [{
+            label: "项目产品清单",
+            icon: "icon-tabchanpin",
+            model: "#Project"
+        }, {
+            label: "附件",
+            icon: "icon-tabfujian1",
+            model: "#Files"
+        }, {
+            label: "操作记录",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Record"
+        }];
+        if (appAuth.istask) tabsList.push({
+            label: "任务",
+            icon: "icon-tabrenwu",
+            model: "#Work"
+        })
+        this.setData({
+            tabsList
+        })
+        this.getDetail();
+        this.getTags();
+        this.partialRenewal();
     },
     /* 切换 */
     onChange(e) {

+ 2 - 1
packageA/finishforecast/detail.json

@@ -3,7 +3,8 @@
         "Project": "./modules/project/index",
         "Record": "/packageA/public/record/index",
         "Files": "/packageA/public/files/index",
-        "List": "./modules/list"
+        "List": "./modules/list",
+        "Work": "/packageA/public/work/index"
     },
     "navigationBarTitleText": "预测填报"
 }

+ 2 - 0
packageA/finishforecast/detail.wxml

@@ -19,6 +19,8 @@
         <Project slot='项目产品清单' id='Project' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" catchtoAdd="toAddProject" />
         <Record slot='操作记录' id="Record" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
         <Files slot='附件' id="Files" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
+        <Work slot='任务' id='Work' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" />
+
         <view style="height: 140rpx;" />
     </Yl_FunTabs>
     <Yl_Tabbar wx:if="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />

+ 36 - 24
packageA/invoiceforecast/detail.js

@@ -12,27 +12,6 @@ Page({
         admin: false,
         tabsActive: 0,
         active: null,
-        tabsList: [{
-            label: "订单",
-            icon: "icon-E-dingdan",
-            model: "#OrderForm"
-        }, {
-            label: "项目",
-            icon: "icon-tabxiangmu",
-            model: "#Project"
-        }, {
-            label: "客户",
-            icon: "icon-tabkehu",
-            model: "#Client"
-        }, {
-            label: "附件",
-            icon: "icon-tabfujian1",
-            model: "#Files"
-        }, {
-            label: "操作记录",
-            icon: "icon-tabcaozuojilu1",
-            model: "#Record"
-        }],
         "content": {
             "type": 1,
             "dataid": 0,
@@ -44,9 +23,7 @@ Page({
         this.setData({
             sa_salesforecastbillid: options.id
         })
-        this.getDetail();
-        this.getTags();
-        this.partialRenewal();
+
 
         if (options.admin == 'true') {
             this.setData({
@@ -92,6 +69,41 @@ Page({
                 });
             });
         }
+
+        const appAuth = wx.getStorageSync('auth')[options.admin == 'true' ? 'invoiceforecastadmin' : 'invoiceforecast'];
+        let tabsList = [{
+            label: "订单",
+            icon: "icon-E-dingdan",
+            model: "#OrderForm"
+        }, {
+            label: "项目",
+            icon: "icon-tabxiangmu",
+            model: "#Project"
+        }, {
+            label: "客户",
+            icon: "icon-tabkehu",
+            model: "#Client"
+        }, {
+            label: "附件",
+            icon: "icon-tabfujian1",
+            model: "#Files"
+        }, {
+            label: "操作记录",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Record"
+        }];
+        if (appAuth.istask) tabsList.push({
+            label: "任务",
+            icon: "icon-tabrenwu",
+            model: "#Work"
+        })
+        this.setData({
+            tabsList
+        })
+
+        this.getDetail();
+        this.getTags();
+        this.partialRenewal();
     },
     /* 切换 */
     onChange(e) {

+ 2 - 1
packageA/invoiceforecast/detail.json

@@ -5,7 +5,8 @@
         "Project": "./modules/project/index",
         "Client": "./modules/client/index",
         "Record": "/packageA/public/record/index",
-        "Files": "/packageA/public/files/index"
+        "Files": "/packageA/public/files/index",
+        "Work": "/packageA/public/work/index"
     },
     "navigationBarTitleText": "预测填报"
 }

+ 1 - 0
packageA/invoiceforecast/detail.wxml

@@ -22,6 +22,7 @@
         <Client slot='客户' id='Client' disabled="{{(detail.status=='进行中' || detail.status=='未开始')&&isLeader}}" />
         <Record slot='操作记录' id="Record" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
         <Files slot='附件' id="Files" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
+        <Work slot='任务' id='Work' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" />
         <view style="height: 140rpx;" />
     </Yl_FunTabs>
     <wxs src="../finishforecast/modules/getColor.wxs" module="backColor" />

+ 12 - 9
packageA/offers/detail.js

@@ -10,7 +10,11 @@ Page({
         isLeader: false, //是否为负责人
         tabsActive: 1, //tabs 选中项
         sa_quotedpriceid: "",
-        tabsList: [{
+        tabbarList: [],
+    },
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').woffer;
+        let tabsList = [{
             label: "详细信息",
             icon: "icon-tabxiangxixinxi1"
         }, {
@@ -41,19 +45,18 @@ Page({
             label: "附件",
             icon: "icon-tabfujian1",
             model: "#Files"
-        }, {
+        }];
+        if (appAuth.istask) tabsList.push({
             label: "任务",
             icon: "icon-tabrenwu",
             model: "#Work"
-        }],
-        tabbarList: [],
-    },
-    onLoad(options) {
+        })
         this.setData({
             sa_quotedpriceid: options.sa_quotedpriceid,
-            isAdmin: wx.getStorageSync('auth').woffer.options.some(v => v == "admin"), //是否具有管理权限
-            options: wx.getStorageSync('auth').woffer.options, //权限列表
-        });
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            options: appAuth.options, //权限列表
+            tabsList
+        })
         this.getDetail(true);
     },
     getDetail(init = false) {

+ 14 - 10
packageA/opponent/detail.js

@@ -5,7 +5,13 @@ Page({
         sa_competitorid: 0,
         detail: {}, //详情数据
         briefs: [], //简介列表
-        tabsList: [{
+        list1: [], //基本信息
+        list2: [], //系统信息
+
+    },
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').wPublicCustomer;
+        let tabsList = [{
             label: "详细信息",
             icon: "icon-tabxiangxixinxi1"
         }, {
@@ -26,18 +32,16 @@ Page({
         }, {
             label: "附件",
             icon: "icon-tabfujian1"
-        }, {
+        }];
+        if (appAuth.istask) tabsList.push({
             label: "任务",
-            icon: "icon-tabrenwu"
-        }],
-        list1: [], //基本信息
-        list2: [], //系统信息
-
-    },
-    onLoad(options) {
+            icon: "icon-tabrenwu",
+            model: "#Work"
+        })
         this.setData({
             sa_competitorid: options.id,
-            isAdmin: wx.getStorageSync('auth').wPublicCustomer.options.some(v => v == "admin"), //是否具有管理权限
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            tabsList
         })
         this.getDetail();
     },

+ 16 - 11
packageA/project/detail.js

@@ -14,7 +14,12 @@ Page({
         isRecover: false, //关闭弹窗是否恢复项目
         tabsActive: 0, //tabs 选中项
         sa_projectid: "",
-        tabsList: [{
+        tabbarList: [],
+    },
+
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').wproject;
+        let tabsList = [{
             label: "详细信息",
             icon: "icon-tabxiangxixinxi1"
         }, {
@@ -49,11 +54,13 @@ Page({
             label: "项目评估",
             icon: "icon-tabxiangmupinggu",
             model: "#Task"
-        }, {
+        }];
+        if (appAuth.istask) tabsList.push({
             label: "任务",
             icon: "icon-tabrenwu",
             model: "#Work"
-        }, {
+        })
+        tabsList = tabsList.concat([{
             label: "报备进度",
             icon: "icon-tabfujian1",
             model: "#ReportingProgress"
@@ -69,16 +76,14 @@ Page({
             label: "跟进动态",
             icon: "icon-tabgenjinjilu",
             model: "#Trace"
-        }],
-        tabbarList: [],
-    },
-    onLoad(options) {
+        }])
         this.setData({
             sa_projectid: options.id,
-            isAdmin: wx.getStorageSync('auth').wproject.options.some(v => v == "admin"), //是否具有管理权限
-            options: wx.getStorageSync('auth').wproject.options, //权限列表
-        });
-        this.getDetail(true)
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            options: appAuth.options, //权限列表
+            tabsList
+        })
+        this.getDetail(true);
     },
     getDetail(init = false) {
         _Http.basic({

+ 13 - 8
packageA/publicClue/detail.js

@@ -6,7 +6,10 @@ Page({
 		sat_orderclueid: "",
 		detail: '',
 		siteShow: false,
-		tabsList: [{
+	},
+	onLoad(options) {
+		const appAuth = wx.getStorageSync('auth').worderclue_public;
+		let tabsList = [{
 			label: "详细信息",
 			icon: "icon-tabxiangxixinxi1"
 		}, {
@@ -22,18 +25,20 @@ Page({
 		}, {
 			label: "跟进动态",
 			icon: "icon-tabgenjinjilu"
-		}, {
+		}]
+		if (appAuth.istask) tabsList.push({
 			label: "任务",
-			icon: "icon-tabrenwu"
-		}, {
+			icon: "icon-tabrenwu",
+			model: "#Work"
+		})
+		tabsList.push({
 			label: "附件",
 			icon: "icon-tabfujian1"
-		}]
-	},
-	onLoad(options) {
+		})
 		this.setData({
 			sat_orderclueid: options.sat_orderclueid || options.id,
-			isAdmin: wx.getStorageSync('auth').worderclue_public.options.some(v => v == "admin"), //是否具有管理权限
+			isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+			tabsList
 		});
 		this.getDetail();
 	},

+ 62 - 66
packageA/publicCustomer/detail.js

@@ -5,79 +5,75 @@ Page({
         sa_customersid: 0,
         detail: {}, //详情数据
         briefs: [], //简介列表
-        tabsList: [{
-                label: "详细信息",
-                icon: "icon-tabxiangxixinxi1"
-            }, {
-                label: "跟进动态",
-                icon: "icon-tabgenjinjilu",
-                model: "#Trace"
-            }, {
-                label: "关联线索",
-                icon: "icon-tabxiansuo",
-                model: "#Clue"
-            },
-            {
-                label: "项目商机",
-                icon: "icon-tabxiangmu",
-                model: "#Project"
-            }, {
-                label: "客户地址",
-                icon: "icon-tabdizhi",
-                model: "#Address"
-            }, {
-                label: "联系人",
-                icon: "icon-tablianxiren",
-                model: "#Contacts"
-            }, {
-                label: "报价单",
-                icon: "icon-tabbaojiadan",
-                model: "#Offers"
-            },
-            {
-                label: "合同",
-                icon: "icon-tabhetong",
-                model: "#Contract"
-            },
-            {
-                label: "账户余额",
-                icon: "icon-tabkaipiaoxinxi",
-                model: "#Account"
-            },
-
-
-            {
-                label: "银行卡信息",
-                icon: "icon-tabchanpin",
-                model: "#Bankcard"
-            }, {
-                label: "开票信息",
-                icon: "icon-tabbaojiadan",
-                model: "#Financing"
-            },
-            {
-                label: "任务",
-                icon: "icon-tabrenwu",
-                model: "#Work"
-            }, {
-                label: "操作",
-                icon: "icon-tabcaozuojilu1",
-                model: "#Record"
-            }, {
-                label: "附件",
-                icon: "icon-tabfujian1",
-                model: "#Files"
-            }
-        ],
         list1: [], //基本信息
         list2: [], //系统信息
         tabbarList: []
     },
     onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').wPublicCustomer;
+        let tabsList = [{
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "跟进动态",
+            icon: "icon-tabgenjinjilu",
+            model: "#Trace"
+        }, {
+            label: "关联线索",
+            icon: "icon-tabxiansuo",
+            model: "#Clue"
+        }, {
+            label: "项目商机",
+            icon: "icon-tabxiangmu",
+            model: "#Project"
+        }, {
+            label: "客户地址",
+            icon: "icon-tabdizhi",
+            model: "#Address"
+        }, {
+            label: "联系人",
+            icon: "icon-tablianxiren",
+            model: "#Contacts"
+        }, {
+            label: "报价单",
+            icon: "icon-tabbaojiadan",
+            model: "#Offers"
+        }, {
+            label: "合同",
+            icon: "icon-tabhetong",
+            model: "#Contract"
+        }, {
+            label: "账户余额",
+            icon: "icon-tabkaipiaoxinxi",
+            model: "#Account"
+        }, {
+            label: "银行卡信息",
+            icon: "icon-tabchanpin",
+            model: "#Bankcard"
+        }, {
+            label: "开票信息",
+            icon: "icon-tabbaojiadan",
+            model: "#Financing"
+        }];
+        if (appAuth.istask) tabsList.push({
+            label: "任务",
+            icon: "icon-tabrenwu",
+            model: "#Work"
+        })
+        tabsList = tabsList.concat([{
+            label: "操作",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Record"
+        }, {
+            label: "附件",
+            icon: "icon-tabfujian1",
+            model: "#Files"
+        }])
         this.setData({
             sa_customersid: options.id,
-            isAdmin: wx.getStorageSync('auth').wPublicCustomer.options.some(v => v == "admin"), //是否具有管理权限
-            options: wx.getStorageSync('auth').wPublicCustomer.options, //权限列表
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            options: appAuth.options, //权限列表
+            tabsList
         })
         this.getDetail();
     },

+ 512 - 509
packageA/saleClue/detail.js

@@ -1,520 +1,523 @@
 const _Http = getApp().globalData.http,
-	currency = require("../../utils/currency"),
-	CNY = value => currency(value, {
-		symbol: "¥",
-		precision: 2
-	}).format();
+    currency = require("../../utils/currency"),
+    CNY = value => currency(value, {
+        symbol: "¥",
+        precision: 2
+    }).format();
 Page({
-	data: {
-		loading: true,
-		isLeader: false, //是否为负责人
-		tabsActive: 0, //tabs 选中项
-		sat_orderclueid: "",
-		deletereasonShow: false,
-		deletereason: "",
-		invalidreasonShow: false,
-		invalidreason: "",
-		detail: '',
-		siteShow: false,
-		tabsList: [{
-			label: "详细信息",
-			icon: "icon-tabxiangxixinxi1"
-		}, {
-			label: "跟进记录",
-			icon: "icon-tabgenjinjilu",
-			model: "#follow"
-		}, {
-			label: "来源线索",
-			icon: "icon-tabxiansuo",
-			model: "#Clue"
-		}, {
-			label: "操作",
-			icon: "icon-tabcaozuojilu1",
-			model: "#Record"
-		}, {
-			label: "跟进动态",
-			icon: "icon-tabgenjinjilu",
-			model: "#Trace"
-		}, {
-			label: "任务",
-			icon: "icon-tabrenwu",
-			model: "#Work"
-		}, {
-			label: "附件",
-			icon: "icon-tabfujian1",
-			model: "#Files"
-		}],
-		tabbarList: [],
-	},
-	onLoad(options) {
-		this.setData({
-			sat_orderclueid: options.sat_orderclueid,
-			isAdmin: wx.getStorageSync('auth').worderclue.options.some(v => v == "admin"), //是否具有管理权限
-		});
-		this.getDetail();
-	},
-	getDetail() {
-		_Http.basic({
-			"classname": "saletool.orderclue.web.orderclue",
-			"method": "selectDetail",
-			"version": 1,
-			"content": {
-				"nocache": true,
-				"sat_orderclueid": this.data.sat_orderclueid
-			},
-		}).then(res => {
-			console.log("线索详情", res)
-			if (res.msg != '成功') return wx.showToast({
-				title: res.data,
-				icon: "none"
-			});
-			this.setData({
-				loading: false,
-				detail: res.data,
-				briefs: [{
-						label: "联系人",
-						value: res.data.name
-					}, {
-						label: "手机号",
-						value: res.data.phonenumber
-					}, {
-						label: "市场活动",
-						value: res.data.campaign_name
-					}, {
-						label: "领域",
-						value: res.data.tradefield
-					}, {
-						label: '负责人',
-						value: res.data.leader && res.data.leader.length > 0 ? res.data.leader[0].name : ''
-					},
-					{
-						label: '分配状态',
-						value: res.data.allocationstatus
-					},
-					{
-						label: '跟进状态',
-						value: res.data.status
-					},
-					{
-						label: '跟进次数',
-						value: res.data.followcount || '0'
-					},
-				],
-				list1: [{
-					label: "客户(企业)",
-					value: res.data.enterprisename_customer
-				}, {
-					label: "联系人",
-					value: res.data.name
-				}, {
-					label: "联系角色",
-					value: res.data.contactsrole
-				}, {
-					label: "手机号码",
-					value: res.data.phonenumber
-				}, {
-					label: "微信",
-					value: res.data.wechatnum
-				}, {
-					label: "省市县",
-					value: res.data.province ? res.data.province + res.data.city + res.data.county : ''
-				}, {
-					label: "地址",
-					value: res.data.address
-				}, {
-					label: "项目名称",
-					value: res.data.projectname
-				}, {
-					label: "项目规模",
-					value: res.data.scale ? res.data.scale + res.data.unitname : ""
-				}, {
-					label: "总投资额(万元)",
-					value: CNY(res.data.totalinvestment)
-				}, {
-					label: "造价(万元)",
-					value: CNY(res.data.costofconstruction)
-				}, {
-					label: "预计开工时间",
-					value: res.data.begdate_due
-				}, {
-					label: "预计完工时间",
-					value: res.data.enddate_due
-				}, {
-					label: "市场活动",
-					value: res.data.campaign_name
-				}, {
-					label: "领域",
-					value: res.data.tradefield
-				}, {
-					label: "设计院",
-					value: res.data.institute
-				}, {
-					label: "设计师",
-					value: res.data.designer
-				}, {
-					label: "关联项目",
-					value: res.data.projectname1
-				}, {
-					label: "来源",
-					value: res.data.cluesource
-				}, {
-					label: "线索概况",
-					value: res.data.notes
-				}, {
-					label: '负责人',
-					value: res.data.leader && res.data.leader.length > 0 ? res.data.leader[0].name : ''
-				}, {
-					label: '上图员',
-					value: res.data.uppictured
-				}, {
-					label: '分配状态',
-					value: res.data.allocationstatus
-				}, {
-					label: '跟进状态',
-					value: res.data.status
-				}],
-				list2: [{
-					label: "创建人",
-					value: res.data.createBy
-				}, {
-					label: "创建时间",
-					value: res.data.createDate
-				}, {
-					label: "分配人",
-					value: res.data.assignedBy
-				}, {
-					label: "分配时间",
-					value: res.data.assignedDate
-				}, {
-					label: "最近跟进人",
-					value: res.data.followBy
-				}, {
-					label: "最近跟进时间",
-					value: res.data.followDate
-				}, {
-					label: "最近编辑人",
-					value: res.data.editBy
-				}, {
-					label: "最近编辑时间",
-					value: res.data.editDate
-				}, {
-					label: "无效原因",
-					value: res.data.invalidreason
-				}, {
-					label: "作废原因",
-					value: res.data.deletereason
-				}, {
-					label: "跟进次数",
-					value: res.data.followcount
-				}, {
-					label: "转手次数",
-					value: res.data.leader[0].leadernum
-				}]
-			});
-			/* 更新列表中状态 */
-			let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/index');
-			if (page) {
-				let index = page.data.list.findIndex(v => v.sat_orderclueid == res.data.sat_orderclueid);
-				console.log("列表中位置", index)
-				if (index != -1) page.setData({
-					[`list[${index}].status`]: res.data.status
-				})
-			}
-			this.getTags();
-			this.getGroup();
-			this.partialRenewal();
-			if (res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid)) {
-				this.setTabbarList(true, res)
-			} else {
-				getApp().agentOrNot("sat_orderclue", this.data.sat_orderclueid).then(({
-					data
-				}) => this.setTabbarList(data.editable == 1, res, data.editdataleader == 1))
-			}
-		})
+    data: {
+        loading: true,
+        isLeader: false, //是否为负责人
+        tabsActive: 0, //tabs 选中项
+        sat_orderclueid: "",
+        deletereasonShow: false,
+        deletereason: "",
+        invalidreasonShow: false,
+        invalidreason: "",
+        detail: '',
+        siteShow: false,
+        tabbarList: [],
+    },
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').worderclue;
+        let tabsList = [{
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "跟进记录",
+            icon: "icon-tabgenjinjilu",
+            model: "#follow"
+        }, {
+            label: "来源线索",
+            icon: "icon-tabxiansuo",
+            model: "#Clue"
+        }, {
+            label: "操作",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Record"
+        }, {
+            label: "跟进动态",
+            icon: "icon-tabgenjinjilu",
+            model: "#Trace"
+        }];
+        if (appAuth.istask) tabsList.push({
+            label: "任务",
+            icon: "icon-tabrenwu",
+            model: "#Work"
+        })
+        tabsList.push({
+            label: "附件",
+            icon: "icon-tabfujian1"
+        })
+        this.setData({
+            sat_orderclueid: options.sat_orderclueid || options.id,
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            tabsList
+        });
+        this.getDetail();
+    },
+    getDetail() {
+        _Http.basic({
+            "classname": "saletool.orderclue.web.orderclue",
+            "method": "selectDetail",
+            "version": 1,
+            "content": {
+                "nocache": true,
+                "sat_orderclueid": this.data.sat_orderclueid
+            },
+        }).then(res => {
+            console.log("线索详情", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            this.setData({
+                loading: false,
+                detail: res.data,
+                briefs: [{
+                        label: "联系人",
+                        value: res.data.name
+                    }, {
+                        label: "手机号",
+                        value: res.data.phonenumber
+                    }, {
+                        label: "市场活动",
+                        value: res.data.campaign_name
+                    }, {
+                        label: "领域",
+                        value: res.data.tradefield
+                    }, {
+                        label: '负责人',
+                        value: res.data.leader && res.data.leader.length > 0 ? res.data.leader[0].name : ''
+                    },
+                    {
+                        label: '分配状态',
+                        value: res.data.allocationstatus
+                    },
+                    {
+                        label: '跟进状态',
+                        value: res.data.status
+                    },
+                    {
+                        label: '跟进次数',
+                        value: res.data.followcount || '0'
+                    },
+                ],
+                list1: [{
+                    label: "客户(企业)",
+                    value: res.data.enterprisename_customer
+                }, {
+                    label: "联系人",
+                    value: res.data.name
+                }, {
+                    label: "联系角色",
+                    value: res.data.contactsrole
+                }, {
+                    label: "手机号码",
+                    value: res.data.phonenumber
+                }, {
+                    label: "微信",
+                    value: res.data.wechatnum
+                }, {
+                    label: "省市县",
+                    value: res.data.province ? res.data.province + res.data.city + res.data.county : ''
+                }, {
+                    label: "地址",
+                    value: res.data.address
+                }, {
+                    label: "项目名称",
+                    value: res.data.projectname
+                }, {
+                    label: "项目规模",
+                    value: res.data.scale ? res.data.scale + res.data.unitname : ""
+                }, {
+                    label: "总投资额(万元)",
+                    value: CNY(res.data.totalinvestment)
+                }, {
+                    label: "造价(万元)",
+                    value: CNY(res.data.costofconstruction)
+                }, {
+                    label: "预计开工时间",
+                    value: res.data.begdate_due
+                }, {
+                    label: "预计完工时间",
+                    value: res.data.enddate_due
+                }, {
+                    label: "市场活动",
+                    value: res.data.campaign_name
+                }, {
+                    label: "领域",
+                    value: res.data.tradefield
+                }, {
+                    label: "设计院",
+                    value: res.data.institute
+                }, {
+                    label: "设计师",
+                    value: res.data.designer
+                }, {
+                    label: "关联项目",
+                    value: res.data.projectname1
+                }, {
+                    label: "来源",
+                    value: res.data.cluesource
+                }, {
+                    label: "线索概况",
+                    value: res.data.notes
+                }, {
+                    label: '负责人',
+                    value: res.data.leader && res.data.leader.length > 0 ? res.data.leader[0].name : ''
+                }, {
+                    label: '上图员',
+                    value: res.data.uppictured
+                }, {
+                    label: '分配状态',
+                    value: res.data.allocationstatus
+                }, {
+                    label: '跟进状态',
+                    value: res.data.status
+                }],
+                list2: [{
+                    label: "创建人",
+                    value: res.data.createBy
+                }, {
+                    label: "创建时间",
+                    value: res.data.createDate
+                }, {
+                    label: "分配人",
+                    value: res.data.assignedBy
+                }, {
+                    label: "分配时间",
+                    value: res.data.assignedDate
+                }, {
+                    label: "最近跟进人",
+                    value: res.data.followBy
+                }, {
+                    label: "最近跟进时间",
+                    value: res.data.followDate
+                }, {
+                    label: "最近编辑人",
+                    value: res.data.editBy
+                }, {
+                    label: "最近编辑时间",
+                    value: res.data.editDate
+                }, {
+                    label: "无效原因",
+                    value: res.data.invalidreason
+                }, {
+                    label: "作废原因",
+                    value: res.data.deletereason
+                }, {
+                    label: "跟进次数",
+                    value: res.data.followcount
+                }, {
+                    label: "转手次数",
+                    value: res.data.leader[0].leadernum
+                }]
+            });
+            /* 更新列表中状态 */
+            let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/index');
+            if (page) {
+                let index = page.data.list.findIndex(v => v.sat_orderclueid == res.data.sat_orderclueid);
+                console.log("列表中位置", index)
+                if (index != -1) page.setData({
+                    [`list[${index}].status`]: res.data.status
+                })
+            }
+            this.getTags();
+            this.getGroup();
+            this.partialRenewal();
+            if (res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid)) {
+                this.setTabbarList(true, res)
+            } else {
+                getApp().agentOrNot("sat_orderclue", this.data.sat_orderclueid).then(({
+                    data
+                }) => this.setTabbarList(data.editable == 1, res, data.editdataleader == 1))
+            }
+        })
 
-	},
+    },
 
-	/**
-	 * 设置tabbar选项
-	 * @param {*} isLeader 是否为负责人或代理人
-	 * @param {object} res 
-	 */
-	setTabbarList(isLeader, res, editdataleader = true) {
-		let tabbarList = [{
-			icon: "icon-genjin",
-			label: "跟进"
-		}];
-		if (wx.getStorageSync('auth').worderclue.options.some(v => v == "shiftSite")) {
-			tabbarList.push({
-				icon: "icon-CRM",
-				label: "转站点"
-			})
-			this.setData({
-				siteShow: true
-			})
-		}
-		if (this.data.isAdmin || isLeader) tabbarList = tabbarList.concat([{
-			icon: "icon-bianji",
-			label: "编辑"
-		}, {
-			icon: "icon-dibu-zhuanhuan",
-			label: "转化项目"
-		}, {
-			icon: "icon-dibu-zhuanhuan",
-			label: "转化客户"
-		}]);
-		if (editdataleader) tabbarList.push({
-			icon: "icon-zhuanyi",
-			label: "更换负责人"
-		})
-		if (isLeader) {
-			tabbarList.push({
-				icon: "icon-dibu-wuxiao",
-				label: "无效"
-			})
-			if (res.data.isprivate == 0) tabbarList.push({
-				icon: "icon-dibu-tuihui",
-				label: "退回"
-			})
-		}
+    /**
+     * 设置tabbar选项
+     * @param {*} isLeader 是否为负责人或代理人
+     * @param {object} res 
+     */
+    setTabbarList(isLeader, res, editdataleader = true) {
+        let tabbarList = [{
+            icon: "icon-genjin",
+            label: "跟进"
+        }];
+        if (wx.getStorageSync('auth').worderclue.options.some(v => v == "shiftSite")) {
+            tabbarList.push({
+                icon: "icon-CRM",
+                label: "转站点"
+            })
+            this.setData({
+                siteShow: true
+            })
+        }
+        if (this.data.isAdmin || isLeader) tabbarList = tabbarList.concat([{
+            icon: "icon-bianji",
+            label: "编辑"
+        }, {
+            icon: "icon-dibu-zhuanhuan",
+            label: "转化项目"
+        }, {
+            icon: "icon-dibu-zhuanhuan",
+            label: "转化客户"
+        }]);
+        if (editdataleader) tabbarList.push({
+            icon: "icon-zhuanyi",
+            label: "更换负责人"
+        })
+        if (isLeader) {
+            tabbarList.push({
+                icon: "icon-dibu-wuxiao",
+                label: "无效"
+            })
+            if (res.data.isprivate == 0) tabbarList.push({
+                icon: "icon-dibu-tuihui",
+                label: "退回"
+            })
+        }
 
-		if (res.data.status == '已转化') tabbarList = tabbarList.filter(item => {
-			return item.label == '编辑' || item.label == '跟进' || item.label == '转化客户' || item.label == '转化项目'
-		})
+        if (res.data.status == '已转化') tabbarList = tabbarList.filter(item => {
+            return item.label == '编辑' || item.label == '跟进' || item.label == '转化客户' || item.label == '转化项目'
+        })
 
-		if (this.data.detail.isproject) tabbarList = tabbarList.filter(v => v.label != '转化项目')
-		if (this.data.detail.iscustomer) tabbarList = tabbarList.filter(v => v.label != '转化客户')
+        if (this.data.detail.isproject) tabbarList = tabbarList.filter(v => v.label != '转化项目')
+        if (this.data.detail.iscustomer) tabbarList = tabbarList.filter(v => v.label != '转化客户')
 
-		if (res.data.status != '待跟进' && res.data.status != '跟进中' && res.data.status != '已转化') tabbarList = [];
-		tabbarList.push({
-			icon: "icon-dibu-jieshu",
-			label: "作废"
-		})
-		this.setData({
-			tabbarList,
-			isLeader,
-			editdataleader
-		})
-	},
-	//tabs 切换
-	tabsChange({
-		detail
-	}) {
-		this.setData({
-			tabsActive: detail
-		});
-		this.partialRenewal();
-	},
-	//更新标签
-	getTags() {
-		this.selectComponent("#Tags").getTags();
-	},
-	//更新团队成员
-	getGroup() {
-		this.selectComponent("#Group").getList();
-	},
-	//局部数据更新 tabs
-	partialRenewal(init = false) {
-		let model = this.data.tabsList[this.data.tabsActive].model;
-		if (model) {
-			let Component = this.selectComponent(model),
-				{
-					total,
-					pageNumber,
-					pageTotal
-				} = Component.data.content,
-				id = this.data.sat_orderclueid;
-			if (total == null || init) {
-				Component.getList(id, init);
-			} else if (pageNumber <= pageTotal) {
-				Component.getList(id, false);
-			}
-		}
-	},
-	onReachBottom() {
-		this.partialRenewal();
-	},
-	//详情按钮回调
-	tabbarOnClick({
-		detail
-	}) {
-		let data = this.data.detail,
-			that = this;
-		switch (detail.label) {
-			case "编辑":
-				wx.navigateTo({
-					url: `/packageA/saleClue/addClue?rowData=${JSON.stringify(this.data.detail)}`,
-				})
-				break;
-			case "作废":
-				that.setData({
-					deletereasonShow: true
-				})
-				break;
-			case "无效":
-				that.setData({
-					invalidreasonShow: true
-				})
-				break;
-			case "转站点":
-				that.selectComponent("#ShiftSite").showSite()
-				break;
-			case "退回":
-				wx.showModal({
-					title: '提示',
-					content: `是否退回该线索,确定后无法撤销!`,
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) _Http.basic({
-							"id": 20221207160802,
-							"content": {
-								sat_orderclueid: data.sat_orderclueid
-							}
-						}).then(res => {
-							wx.showToast({
-								title: res.msg == '成功' ? `退回成功` : res.msg,
-								icon: "none"
-							});
-							setTimeout(() => {
-								let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/index');
-								if (page) page.getList(true)
-								wx.navigateBack();
-							}, 500)
-						})
-					}
-				})
-				break;
-			case "转化项目":
-				wx.navigateTo({
-					url: `/packageA/saleClue/change?rowData=${JSON.stringify(this.data.detail)}`,
-				})
-				break;
-			case "转化客户":
-				wx.navigateTo({
-					url: `/packageA/saleClue/translate?data=${JSON.stringify(this.data.detail)}`,
-				})
-				break;
-			case "跟进":
-				wx.navigateTo({
-					url: `/packageA/saleClue/addFollow?sat_orderclueid=` + this.data.detail.sat_orderclueid
-				})
-				break;
-			case "更换负责人":
-				wx.navigateTo({
-					url: `/pages/group/select?data=${JSON.stringify({
+        if (res.data.status != '待跟进' && res.data.status != '跟进中' && res.data.status != '已转化') tabbarList = [];
+        tabbarList.push({
+            icon: "icon-dibu-jieshu",
+            label: "作废"
+        })
+        this.setData({
+            tabbarList,
+            isLeader,
+            editdataleader
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        let model = this.data.tabsList[this.data.tabsActive].model;
+        if (model) {
+            let Component = this.selectComponent(model),
+                {
+                    total,
+                    pageNumber,
+                    pageTotal
+                } = Component.data.content,
+                id = this.data.sat_orderclueid;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                Component.getList(id, false);
+            }
+        }
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    //详情按钮回调
+    tabbarOnClick({
+        detail
+    }) {
+        let data = this.data.detail,
+            that = this;
+        switch (detail.label) {
+            case "编辑":
+                wx.navigateTo({
+                    url: `/packageA/saleClue/addClue?rowData=${JSON.stringify(this.data.detail)}`,
+                })
+                break;
+            case "作废":
+                that.setData({
+                    deletereasonShow: true
+                })
+                break;
+            case "无效":
+                that.setData({
+                    invalidreasonShow: true
+                })
+                break;
+            case "转站点":
+                that.selectComponent("#ShiftSite").showSite()
+                break;
+            case "退回":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否退回该线索,确定后无法撤销!`,
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 20221207160802,
+                            "content": {
+                                sat_orderclueid: data.sat_orderclueid
+                            }
+                        }).then(res => {
+                            wx.showToast({
+                                title: res.msg == '成功' ? `退回成功` : res.msg,
+                                icon: "none"
+                            });
+                            setTimeout(() => {
+                                let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/index');
+                                if (page) page.getList(true)
+                                wx.navigateBack();
+                            }, 500)
+                        })
+                    }
+                })
+                break;
+            case "转化项目":
+                wx.navigateTo({
+                    url: `/packageA/saleClue/change?rowData=${JSON.stringify(this.data.detail)}`,
+                })
+                break;
+            case "转化客户":
+                wx.navigateTo({
+                    url: `/packageA/saleClue/translate?data=${JSON.stringify(this.data.detail)}`,
+                })
+                break;
+            case "跟进":
+                wx.navigateTo({
+                    url: `/packageA/saleClue/addFollow?sat_orderclueid=` + this.data.detail.sat_orderclueid
+                })
+                break;
+            case "更换负责人":
+                wx.navigateTo({
+                    url: `/pages/group/select?data=${JSON.stringify({
                              ownertable:"sat_orderclue",
                              ownerid:data.sat_orderclueid,
                         })}&radio=true&principal=true`,
-				})
-				break;
-		}
-	},
-	/* 更换负责人 */
-	handelSubmit(arr) {
-		const that = this;
-		wx.showModal({
-			title: '提示',
-			content: '是否确认更换负责人',
-			complete: ({
-				confirm
-			}) => {
-				if (confirm) _Http.basic({
-					"id": 20220930103701,
-					"content": {
-						ownertable: "sat_orderclue",
-						ownerid: that.data.detail.sat_orderclueid,
-						userid: arr[0]
-					}
-				}).then(res => {
-					console.log("更换负责人", res)
-					if (res.msg != '成功') return wx.showToast({
-						title: res.data,
-						icon: "none"
-					});
-					wx.showToast({
-						title: '更换成功!',
-						icon: "none"
-					});
-					setTimeout(() => {
-						that.getDetail();
-						wx.navigateBack();
-						/*  getCurrentPages().forEach(v => {
-						     if (['packageA/project/index'].includes(v.__route__)) v.getList(true)
-						 }) */
-					}, 300)
-				})
-			}
-		})
-	},
-	/* 完成情况说明输入 */
-	areaInput(e) {
-		this.setData({
-			[e.currentTarget.dataset.name]: e.detail.value
-		})
-	},
-	/* 确认无效 */
-	invalidItem() {
-		let that = this;
-		_Http.basic({
-			id: "20221208100602",
-			"content": {
-				"sat_orderclueid": this.data.detail.sat_orderclueid,
-				sat_ordercluefollowuplogid: 0,
-				"content": this.data.invalidreason,
-				"followupmode": "",
-				"logtype": "无效",
-				"competitor": ""
-			}
-		}).then(res => {
-			console.log("无效", res)
-			wx.showToast({
-				title: res.msg == '成功' ? `操作成功` : res.msg,
-				icon: "none",
-				mask: true
-			});
-			if (res.msg == '成功') setTimeout(() => {
-				this.getDetail();
-				this.selectComponent("#follow").getList(that.data.detail.sat_orderclueid, true)
-				this.onCancel()
-				this.setData({
-					invalidreason: ""
-				})
-			}, 300)
-		})
-	},
-	deleteItem() {
-		let that = this;
-		_Http.basic({
-			"id": 20221123193702,
-			"content": {
-				"sat_orderclueids": [this.data.detail.sat_orderclueid],
-				deletereason: this.data.deletereason
-			}
-		}).then(res => {
-			wx.showToast({
-				title: res.msg == '成功' ? `操作成功` : res.msg,
-				icon: "none"
-			});
-			this.onCancel();
-			this.setData({
-				deletereason: ""
-			})
-			that.getDetail();
-			setTimeout(() => {
-				let pages = getCurrentPages(),
-					page = pages[pages.length - 2];
-				if (page.getList) page.setData({
-					list: page.data.list.filter(v => v.sat_orderclueid != that.data.detail.sat_orderclueid),
-					"content.total": page.data.content.total - 1,
-				})
-			}, 300)
-		})
-	},
-	onCancel() {
-		this.setData({
-			deletereasonShow: false,
-			invalidreasonShow: false,
-		})
-	}
+                })
+                break;
+        }
+    },
+    /* 更换负责人 */
+    handelSubmit(arr) {
+        const that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认更换负责人',
+            complete: ({
+                confirm
+            }) => {
+                if (confirm) _Http.basic({
+                    "id": 20220930103701,
+                    "content": {
+                        ownertable: "sat_orderclue",
+                        ownerid: that.data.detail.sat_orderclueid,
+                        userid: arr[0]
+                    }
+                }).then(res => {
+                    console.log("更换负责人", res)
+                    if (res.msg != '成功') return wx.showToast({
+                        title: res.data,
+                        icon: "none"
+                    });
+                    wx.showToast({
+                        title: '更换成功!',
+                        icon: "none"
+                    });
+                    setTimeout(() => {
+                        that.getDetail();
+                        wx.navigateBack();
+                        /*  getCurrentPages().forEach(v => {
+                             if (['packageA/project/index'].includes(v.__route__)) v.getList(true)
+                         }) */
+                    }, 300)
+                })
+            }
+        })
+    },
+    /* 完成情况说明输入 */
+    areaInput(e) {
+        this.setData({
+            [e.currentTarget.dataset.name]: e.detail.value
+        })
+    },
+    /* 确认无效 */
+    invalidItem() {
+        let that = this;
+        _Http.basic({
+            id: "20221208100602",
+            "content": {
+                "sat_orderclueid": this.data.detail.sat_orderclueid,
+                sat_ordercluefollowuplogid: 0,
+                "content": this.data.invalidreason,
+                "followupmode": "",
+                "logtype": "无效",
+                "competitor": ""
+            }
+        }).then(res => {
+            console.log("无效", res)
+            wx.showToast({
+                title: res.msg == '成功' ? `操作成功` : res.msg,
+                icon: "none",
+                mask: true
+            });
+            if (res.msg == '成功') setTimeout(() => {
+                this.getDetail();
+                this.selectComponent("#follow").getList(that.data.detail.sat_orderclueid, true)
+                this.onCancel()
+                this.setData({
+                    invalidreason: ""
+                })
+            }, 300)
+        })
+    },
+    deleteItem() {
+        let that = this;
+        _Http.basic({
+            "id": 20221123193702,
+            "content": {
+                "sat_orderclueids": [this.data.detail.sat_orderclueid],
+                deletereason: this.data.deletereason
+            }
+        }).then(res => {
+            wx.showToast({
+                title: res.msg == '成功' ? `操作成功` : res.msg,
+                icon: "none"
+            });
+            this.onCancel();
+            this.setData({
+                deletereason: ""
+            })
+            that.getDetail();
+            setTimeout(() => {
+                let pages = getCurrentPages(),
+                    page = pages[pages.length - 2];
+                if (page.getList) page.setData({
+                    list: page.data.list.filter(v => v.sat_orderclueid != that.data.detail.sat_orderclueid),
+                    "content.total": page.data.content.total - 1,
+                })
+            }, 300)
+        })
+    },
+    onCancel() {
+        this.setData({
+            deletereasonShow: false,
+            invalidreasonShow: false,
+        })
+    }
 })

+ 13 - 8
packageA/setclient/detail.js

@@ -5,7 +5,11 @@ Page({
         isLeader: false, //是否为负责人
         tabsActive: 1, //tabs 选中项
         sa_customersid: 0,
-        tabsList: [{
+
+    },
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').wCustomer;
+        let tabsList = [{
             label: "跟进动态",
             icon: "icon-tabgenjinjilu",
             model: "#Trace"
@@ -48,11 +52,13 @@ Page({
             label: "开票信息",
             icon: "icon-tabbaojiadan",
             model: "#Financing"
-        }, {
+        }];
+        if (appAuth.istask) tabsList.push({
             label: "任务",
             icon: "icon-tabrenwu",
             model: "#Work"
-        }, {
+        })
+        tabsList = tabsList.concat([{
             label: "操作",
             icon: "icon-tabcaozuojilu1",
             model: "#Record"
@@ -60,13 +66,12 @@ Page({
             label: "附件",
             icon: "icon-tabfujian1",
             model: "#Files"
-        }],
-    },
-    onLoad(options) {
+        }])
         this.setData({
             sa_customersid: options.id,
-            isAdmin: wx.getStorageSync('auth').wCustomer.options.some(v => v == "admin"), //是否具有管理权限
-            options: wx.getStorageSync('auth').wCustomer.options, //权限列表
+            isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
+            options: appAuth.options, //权限列表
+            tabsList
         })
         this.getDetail();
     },

+ 7 - 0
project.private.config.json

@@ -21,6 +21,13 @@
                     "query": "id=5214",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "首页",
+                    "pathName": "pages/tabbar/home/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }

+ 0 - 1
utils/Http.js

@@ -1,4 +1,3 @@
-let count = null;
 class HTTP {
     constructor() {
         let ENV = wx.getAccountInfoSync().miniProgram.envVersion;

+ 0 - 1
utils/api.js

@@ -56,7 +56,6 @@ class ApiModel extends HTTP {
             data
         })
     }
-
 }
 export {
     ApiModel

+ 7 - 3
utils/work/apps.js

@@ -44,7 +44,7 @@ function getapps() {
         })
     });
     return dye(list.sort((a, b) => a.index - b.index))
-}
+};
 //营销工具
 function gettool() {
     const paths = [{
@@ -168,6 +168,10 @@ function getcrm() {
             authList[s.name] = {
                 options: s.meta.auth.map(a => a.option),
                 optionnames: s.meta.auth.map(a => a.optionname),
+                istask: s.istask == 1,
+                isdatafollowup: s.isdatafollowup == 1,
+                isdatatag: s.isdatatag == 1,
+                isdatateam: s.isdatateam == 1,
             }
             if (authList[s.name].options.some(s => s == "read")) {
                 let i = paths.findIndex(k => k.name == s.meta.title);
@@ -308,7 +312,7 @@ function geteservice() {
         })
     });
     return dye(list.sort((a, b) => a.index - b.index))
-}
+};
 //染色
 function dye(list) {
     let colorList = [{
@@ -371,4 +375,4 @@ module.exports = {
     getedd,
     geteservice,
     authList
-}
+};