|
|
@@ -55,45 +55,10 @@ Page({
|
|
|
}).then(res => {
|
|
|
console.log("线索详情", res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.msg,
|
|
|
+ title: res.data,
|
|
|
icon: "none"
|
|
|
});
|
|
|
-
|
|
|
- let isLeader = res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
|
|
|
- tabbarList = [{
|
|
|
- icon: "icon-genjin",
|
|
|
- label: "跟进"
|
|
|
- }];
|
|
|
- if (this.data.isAdmin || isLeader) tabbarList = tabbarList.concat([{
|
|
|
- icon: "icon-bianji",
|
|
|
- label: "编辑"
|
|
|
- }, {
|
|
|
- icon: "icon-dibu-zhuanhuan",
|
|
|
- label: "转化项目"
|
|
|
- }, {
|
|
|
- icon: "icon-dibu-zhuanhuan",
|
|
|
- label: "转化客户"
|
|
|
- }, {
|
|
|
- icon: "icon-zhuanyi",
|
|
|
- label: "更换负责人"
|
|
|
- }, {
|
|
|
- icon: "icon-dibu-jieshu",
|
|
|
- label: "作废"
|
|
|
- }]);
|
|
|
- if (isLeader) {
|
|
|
- let arr5 = [{
|
|
|
- icon: "icon-dibu-wuxiao",
|
|
|
- label: "无效"
|
|
|
- }];
|
|
|
- if (res.data.isprivate == 0) arr5.push({
|
|
|
- icon: "icon-dibu-tuihui",
|
|
|
- label: "退回"
|
|
|
- });
|
|
|
- tabbarList = tabbarList.concat(arr5)
|
|
|
- }
|
|
|
this.setData({
|
|
|
- isLeader,
|
|
|
- tabbarList,
|
|
|
detail: res.data,
|
|
|
briefs: [{
|
|
|
label: "联系人",
|
|
|
@@ -215,8 +180,7 @@ Page({
|
|
|
}, {
|
|
|
label: "转手次数",
|
|
|
value: res.data.leader[0].leadernum
|
|
|
- }],
|
|
|
- tabsList: this.data.tabsList,
|
|
|
+ }]
|
|
|
});
|
|
|
/* 更新列表中状态 */
|
|
|
let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/index');
|
|
|
@@ -227,33 +191,76 @@ Page({
|
|
|
[`list[${index}].status`]: res.data.status
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- if (res.data.status == '已转化') {
|
|
|
- tabbarList = tabbarList.filter(item => {
|
|
|
- return item.label == '编辑' || item.label == '跟进' || item.label == '转化客户' || item.label == '转化项目'
|
|
|
- })
|
|
|
- if (res.data.isproject == 1) {
|
|
|
- let i = tabbarList.findIndex(item => item.label == '转化项目')
|
|
|
- tabbarList.splice(i, 1)
|
|
|
- console.log('触发项目');
|
|
|
- }
|
|
|
- if (res.data.iscustomer == 1) {
|
|
|
- let i = tabbarList.findIndex(item => item.label == '转化客户')
|
|
|
- tabbarList.splice(i, 1)
|
|
|
- console.log('触发客户');
|
|
|
- }
|
|
|
- console.log(tabbarList);
|
|
|
- this.setData({
|
|
|
- tabbarList
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- if (res.data.status != '待跟进' && res.data.status != '跟进中' && res.data.status != '已转化') this.setData({
|
|
|
- tabbarList: []
|
|
|
- })
|
|
|
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 == 1, res))
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置tabbar选项
|
|
|
+ * @param {*} isLeader 是否为负责人或代理人
|
|
|
+ * @param {object} res
|
|
|
+ */
|
|
|
+ setTabbarList(isLeader, res) {
|
|
|
+ let tabbarList = [{
|
|
|
+ icon: "icon-genjin",
|
|
|
+ label: "跟进"
|
|
|
+ }];
|
|
|
+ if (this.data.isAdmin || isLeader) tabbarList = tabbarList.concat([{
|
|
|
+ icon: "icon-bianji",
|
|
|
+ label: "编辑"
|
|
|
+ }, {
|
|
|
+ icon: "icon-dibu-zhuanhuan",
|
|
|
+ label: "转化项目"
|
|
|
+ }, {
|
|
|
+ icon: "icon-dibu-zhuanhuan",
|
|
|
+ label: "转化客户"
|
|
|
+ }, {
|
|
|
+ icon: "icon-zhuanyi",
|
|
|
+ label: "更换负责人"
|
|
|
+ }, {
|
|
|
+ icon: "icon-dibu-jieshu",
|
|
|
+ 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.isproject == 1) {
|
|
|
+ let i = tabbarList.findIndex(item => item.label == '转化项目')
|
|
|
+ tabbarList.splice(i, 1)
|
|
|
+ console.log('触发项目');
|
|
|
+ }
|
|
|
+ if (res.data.iscustomer == 1) {
|
|
|
+ let i = tabbarList.findIndex(item => item.label == '转化客户')
|
|
|
+ tabbarList.splice(i, 1)
|
|
|
+ console.log('触发客户');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.data.status != '待跟进' && res.data.status != '跟进中' && res.data.status != '已转化') tabbarList = [];
|
|
|
+ this.setData({
|
|
|
+ tabbarList,
|
|
|
+ isLeader
|
|
|
})
|
|
|
},
|
|
|
//tabs 切换
|