|
|
@@ -1,6 +1,9 @@
|
|
|
const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
|
data: {
|
|
|
+ isAdmin: getApp().globalData.auth.wCustomer.options.some(v => v == "admin"), //是否具有管理权限
|
|
|
+ isLeader: false, //是否为负责人
|
|
|
+
|
|
|
tabsActive: 0, //tabs 选中项
|
|
|
sat_orderclueid: "",
|
|
|
detail: '',
|
|
|
@@ -20,24 +23,6 @@ Page({
|
|
|
tabbarList: [{
|
|
|
icon: "icon-genjin",
|
|
|
label: "跟进"
|
|
|
- }, {
|
|
|
- icon: "icon-bianji",
|
|
|
- label: "编辑"
|
|
|
- }, {
|
|
|
- icon: "icon-dibu-zhuanhuan",
|
|
|
- label: "转化"
|
|
|
- }, {
|
|
|
- icon: "icon-zhuanyi",
|
|
|
- label: "更换负责人"
|
|
|
- }, {
|
|
|
- icon: "icon-dibu-tuihui",
|
|
|
- label: "退回"
|
|
|
- }, {
|
|
|
- icon: "icon-dibu-wuxiao",
|
|
|
- label: "无效"
|
|
|
- }, {
|
|
|
- icon: "icon-dibu-jieshu",
|
|
|
- label: "作废"
|
|
|
}],
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -61,7 +46,32 @@ Page({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
});
|
|
|
+
|
|
|
+ let isLeader = res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
|
|
|
+ tabbarList = this.data.tabbarList;
|
|
|
+ if (this.data.isAdmin || isLeader) tabbarList = [{
|
|
|
+ icon: "icon-bianji",
|
|
|
+ label: "编辑"
|
|
|
+ }, {
|
|
|
+ icon: "icon-dibu-zhuanhuan",
|
|
|
+ label: "转化"
|
|
|
+ }, {
|
|
|
+ icon: "icon-zhuanyi",
|
|
|
+ label: "更换负责人"
|
|
|
+ }, {
|
|
|
+ icon: "icon-dibu-jieshu",
|
|
|
+ label: "作废"
|
|
|
+ }].concat(tabbarList);
|
|
|
+ if (isLeader) tabbarList = tabbarList.concat([{
|
|
|
+ icon: "icon-dibu-tuihui",
|
|
|
+ label: "退回"
|
|
|
+ }, {
|
|
|
+ icon: "icon-dibu-wuxiao",
|
|
|
+ label: "无效"
|
|
|
+ }])
|
|
|
this.setData({
|
|
|
+ isLeader,
|
|
|
+ tabbarList,
|
|
|
detail: res.data,
|
|
|
briefs: [{
|
|
|
label: "联系人",
|
|
|
@@ -310,11 +320,11 @@ Page({
|
|
|
confirm
|
|
|
}) => {
|
|
|
if (confirm) _Http.basic({
|
|
|
- "id":20221207160802,
|
|
|
+ "id": 20221207160802,
|
|
|
"content": {
|
|
|
- sat_orderclueid: this.data.detail.sat_orderclueid
|
|
|
+ sat_orderclueid: this.data.detail.sat_orderclueid
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
+ }).then(res => {
|
|
|
if (res.msg == '成功') {
|
|
|
that.getDetail();
|
|
|
}
|