|
|
@@ -221,35 +221,34 @@ Page({
|
|
|
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
|
|
|
})
|
|
|
}
|
|
|
if (this.data.appAuth.isdatatag) this.getTags();
|
|
|
if (this.data.appAuth.isdatateam) this.getGroup();
|
|
|
+ this.setTabbarList()
|
|
|
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) {
|
|
|
+ async setTabbarList() {
|
|
|
let tabbarList = [{
|
|
|
- icon: "icon-genjin",
|
|
|
- label: "跟进"
|
|
|
- }];
|
|
|
+ icon: "icon-genjin",
|
|
|
+ label: "跟进"
|
|
|
+ }],
|
|
|
+ detail = this.data.detail,
|
|
|
+ isLeader = detail.leader.some(v => v.userid == wx.getStorageSync('userMsg').userid),
|
|
|
+ editdataleader = isLeader ? 1 : 0;
|
|
|
+ if (!isLeader) {
|
|
|
+ let res = await getApp().agentOrNot("sat_orderclue", this.data.sat_orderclueid),
|
|
|
+ data = res.msg == '成功' ? res.data : {
|
|
|
+ editable: 0,
|
|
|
+ editdataleader: 0
|
|
|
+ }
|
|
|
+ isLeader = data.editable == 1;
|
|
|
+ if (!isLeader && this.data.appAuth.isdatateam) isLeader = this.selectComponent("#Group").data.ismyteam == 1;
|
|
|
+ editdataleader = data.editdataleader;
|
|
|
+ }
|
|
|
if (wx.getStorageSync('auth').worderclue.options.some(v => v == "shiftSite")) {
|
|
|
tabbarList.push({
|
|
|
icon: "icon-CRM",
|
|
|
@@ -278,17 +277,17 @@ Page({
|
|
|
icon: "icon-dibu-wuxiao",
|
|
|
label: "无效"
|
|
|
})
|
|
|
- if (res.data.isprivate == 0) tabbarList.push({
|
|
|
+ if (detail.isprivate == 0) tabbarList.push({
|
|
|
icon: "icon-dibu-tuihui",
|
|
|
label: "退回"
|
|
|
})
|
|
|
}
|
|
|
- if (res.data.status == '已转化') tabbarList = tabbarList.filter(item => {
|
|
|
+ if (detail.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 (res.data.status != '待跟进' && res.data.status != '跟进中' && res.data.status != '已转化') tabbarList = [];
|
|
|
+ if (detail.isproject) tabbarList = tabbarList.filter(v => v.label != '转化项目')
|
|
|
+ if (detail.iscustomer) tabbarList = tabbarList.filter(v => v.label != '转化客户')
|
|
|
+ if (detail.status != '待跟进' && detail.status != '跟进中' && detail.status != '已转化') tabbarList = [];
|
|
|
tabbarList.push({
|
|
|
icon: "icon-dibu-jieshu",
|
|
|
label: "作废"
|
|
|
@@ -296,7 +295,6 @@ Page({
|
|
|
this.setData({
|
|
|
tabbarList,
|
|
|
isLeader,
|
|
|
- editdataleader,
|
|
|
isFollow: tabbarList.some(v => v.label == '跟进')
|
|
|
})
|
|
|
},
|
|
|
@@ -309,13 +307,12 @@ Page({
|
|
|
});
|
|
|
this.partialRenewal();
|
|
|
},
|
|
|
- //更新标签
|
|
|
getTags() {
|
|
|
this.selectComponent("#Tags").getTags();
|
|
|
},
|
|
|
//更新团队成员
|
|
|
getGroup() {
|
|
|
- this.selectComponent("#Group").getList();
|
|
|
+ this.selectComponent("#Group").getList().then(this.setTabbarList)
|
|
|
},
|
|
|
//局部数据更新 tabs
|
|
|
partialRenewal(init = false) {
|