瀏覽代碼

公海线索 线索管理添加恢复功能

xiaohaizhao 2 年之前
父節點
當前提交
3c6a86480c

+ 422 - 374
packageA/publicClue/detail.js

@@ -1,379 +1,427 @@
 const _Http = getApp().globalData.http;
 Page({
-	data: {
-		isLeader: false, //是否为负责人
-		tabsActive: 0, //tabs 选中项
-		sat_orderclueid: "",
-		detail: '',
-		siteShow: false,
-	},
-	onLoad(options) {
-		const appAuth = wx.getStorageSync('auth').worderclue_public;
-		let tabsList = [{
-			label: "详细信息",
-			icon: "icon-tabxiangxixinxi1"
-		}, {
-			label: "跟进记录",
-			icon: "icon-tabgenjinjilu"
-		}, {
-			label: "来源线索",
-			icon: "icon-tabxiansuo",
-			model: "#Clue"
-		}, {
-			label: "操作",
-			icon: "icon-tabcaozuojilu1"
-		}, {
-			label: "跟进动态",
-			icon: "icon-tabgenjinjilu"
-		}]
-		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": "webmanage.saletool.orderclue.publicclue.PublicClue",
-			"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.msg,
-				icon: "none"
-			});
-			this.setData({
-				isLeader: res.data.createuserid == wx.getStorageSync('userMsg').userid,
-				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: res.data.totalinvestment
-				}, {
-					label: "造价(万元)",
-					value: 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.salename
-				}, {
-					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
-				}]
-			});
-			/* 更新列表中状态 */
-			let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicClue/index');
-			if (page) {
-				let index = page.data.list.findIndex(v => v.sat_orderclueid == res.data.sat_orderclueid);
-				if (index != -1) page.setData({
-					[`list[${index}].status`]: res.data.status
-				})
-			}
-			this.setTabbarList(res.data.status)
-			this.getTags();
-			this.partialRenewal();
-		})
-	},
-	setTabbarList(status) {
-		let tabbarList = this.data.isAdmin ? [{
-			icon: "icon-zhuanyi",
-			label: "分配"
-		}, {
-			icon: "icon-dibu-jieshu",
-			label: "删除"
-		}] : [];
-		if (status == '待跟进') tabbarList.unshift({
-			icon: "icon-bianji",
-			label: "编辑"
-		})
-		if (wx.getStorageSync('auth').worderclue_public.options.some(v => v == "shiftSite")) {
-			tabbarList.unshift({
-				icon: "icon-CRM",
-				label: "转站点"
-			})
-			this.setData({
-				siteShow: true
-			})
-		}
-		this.setData({
-			tabbarList
-		})
-	},
-	//tabs 切换
-	tabsChange({
-		detail
-	}) {
-		this.setData({
-			tabsActive: detail
-		});
-		this.partialRenewal();
-	},
-	//更新标签
-	getTags() {
-		this.selectComponent("#Tags").getTags();
-	},
-	//局部数据更新 tabs
-	partialRenewal(init = false) {
-		let id = this.data.detail.sat_orderclueid;
-		let model = '';
-		let name = this.data.tabsList[this.data.tabsActive].label;
-		switch (name) {
-			case "任务":
-				model = "#Work"
-				break;
-			case "跟进记录":
-				model = "#follow"
-				break;
-			case "来源线索":
-				model = "#Clue"
-				break;
-			case "操作":
-				model = "#Record"
-				break;
-			case "跟进动态":
-				model = "#Trace"
-				break;
-			case "附件":
-				model = "#Files"
-				break;
-		};
-		if (model) {
-			// 确定好模块ID total = null 是第一次加载 加载数据
-			// init是新增或修改需要清数据
-			let Component = this.selectComponent(model);
-			const {
-				total,
-				pageNumber,
-				pageTotal
-			} = Component.data.content;
-			if (total == null || init) {
-				Component.getList(id, init);
-			} else if (pageNumber <= pageTotal) {
-				Component.getList(id, false);
-			} else {
-				//用来判断 在搜索页面修改,与tabs选项不一致 但是切换到该选项 重置数据
-			}
-		}
-	},
-	onReachBottom() {
-		this.partialRenewal();
-	},
+    data: {
+        isLeader: false, //是否为负责人
+        tabsActive: 0, //tabs 选中项
+        sat_orderclueid: "",
+        detail: '',
+        siteShow: false,
+    },
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').worderclue_public;
+        let tabsList = [{
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "跟进记录",
+            icon: "icon-tabgenjinjilu"
+        }, {
+            label: "来源线索",
+            icon: "icon-tabxiansuo",
+            model: "#Clue"
+        }, {
+            label: "操作",
+            icon: "icon-tabcaozuojilu1"
+        }, {
+            label: "跟进动态",
+            icon: "icon-tabgenjinjilu"
+        }]
+        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": "webmanage.saletool.orderclue.publicclue.PublicClue",
+            "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.msg,
+                icon: "none"
+            });
+            this.setData({
+                isLeader: res.data.createuserid == wx.getStorageSync('userMsg').userid,
+                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: res.data.totalinvestment
+                }, {
+                    label: "造价(万元)",
+                    value: 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.salename
+                }, {
+                    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
+                }]
+            });
+            /* 更新列表中状态 */
+            let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicClue/index');
+            if (page) {
+                let index = page.data.list.findIndex(v => v.sat_orderclueid == res.data.sat_orderclueid);
+                if (index != -1) page.setData({
+                    [`list[${index}].status`]: res.data.status
+                })
+            }
+            this.setTabbarList(res.data.status)
+            this.getTags();
+            this.partialRenewal();
+        })
+    },
+    setTabbarList(status) {
+        let tabbarList = [];
+        if (this.data.isAdmin) {
+            if (this.data.detail.isprivate == 0 && this.data.detail.allocationstatus == '待分配') tabbarList.push({
+                icon: "icon-zhuanyi",
+                label: "分配"
+            })
+            tabbarList.push({
+                icon: "icon-dibu-jieshu",
+                label: "删除"
+            })
+        }
+        if (status == '待跟进') tabbarList.unshift({
+            icon: "icon-bianji",
+            label: "编辑"
+        })
+        if (status == '已过期' && wx.getStorageSync('auth').worderclue_public.options.some(v => v == "recover")) tabbarList.unshift({
+            icon: "icon-dibu-chehui",
+            label: "恢复"
+        })
 
-	//详情按钮回调
-	tabbarOnClick({
-		detail
-	}) {
-		let data = this.data.detail,
-			that = this;
-		switch (detail.label) {
-			case "编辑":
-				wx.navigateTo({
-					url: `/packageA/publicClue/addClue?rowData=${JSON.stringify(this.data.detail)}`,
-				})
-				break;
-			case "分配":
-				wx.navigateTo({
-					url: `/packageA/publicClue/distribution?data=${JSON.stringify(this.data.detail)}`,
-				})
-				break;
+        if (wx.getStorageSync('auth').worderclue_public.options.some(v => v == "shiftSite")) {
+            tabbarList.unshift({
+                icon: "icon-CRM",
+                label: "转站点"
+            })
+            this.setData({
+                siteShow: true
+            })
+        }
+        this.setData({
+            tabbarList
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        let id = this.data.detail.sat_orderclueid;
+        let model = '';
+        let name = this.data.tabsList[this.data.tabsActive].label;
+        switch (name) {
+            case "任务":
+                model = "#Work"
+                break;
+            case "跟进记录":
+                model = "#follow"
+                break;
+            case "来源线索":
+                model = "#Clue"
+                break;
+            case "操作":
+                model = "#Record"
+                break;
+            case "跟进动态":
+                model = "#Trace"
+                break;
+            case "附件":
+                model = "#Files"
+                break;
+        };
+        if (model) {
+            // 确定好模块ID total = null 是第一次加载 加载数据
+            // init是新增或修改需要清数据
+            let Component = this.selectComponent(model);
+            const {
+                total,
+                pageNumber,
+                pageTotal
+            } = Component.data.content;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                Component.getList(id, false);
+            } else {
+                //用来判断 在搜索页面修改,与tabs选项不一致 但是切换到该选项 重置数据
+            }
+        }
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    //详情按钮回调
+    tabbarOnClick({
+        detail
+    }) {
+        let data = this.data.detail,
+            that = this;
+        switch (detail.label) {
+            case "编辑":
+                wx.navigateTo({
+                    url: `/packageA/publicClue/addClue?rowData=${JSON.stringify(this.data.detail)}`,
+                })
+                break;
+            case "分配":
+                wx.navigateTo({
+                    url: `/packageA/publicClue/distribution?data=${JSON.stringify(this.data.detail)}`,
+                })
+                break;
+            case "恢复":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定恢复该线索`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": "20230907142004",
+                            "content": {
+                                "sat_orderclueid": data.sat_orderclueid
+                            }
+                        }).then(res => {
+                            console.log("恢复线索", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? "恢复成功" : res.msg,
+                                icon: "none"
+                            });
+                            that.getDetail();
+                        })
+                    }
+                })
+                break;
+            case "转站点":
+                that.selectComponent("#ShiftSite").showSite()
+                break;
+            case "删除":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确认删除该线索?`,
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 20221101100502,
+                            "content": {
+                                "sat_orderclueids": [this.data.detail.sat_orderclueid]
+                            }
+                        }).then(res => {
+                            wx.showToast({
+                                title: res.msg == '成功' ? `操作成功` : res.msg,
+                                icon: "none"
+                            });
+                            setTimeout(() => {
+                                wx.navigateBack()
+                                getCurrentPages().forEach(v => {
+                                    if (v.__route__ == "packageA/publicClue/index") {
+                                        v.getList(true)
+                                    }
+                                })
+                            }, 300)
 
-			case "转站点":
-				that.selectComponent("#ShiftSite").showSite()
-				break;
-			case "删除":
-				wx.showModal({
-					title: '提示',
-					content: `是否确认删除该线索?`,
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) _Http.basic({
-							"id": 20221101100502,
-							"content": {
-								"sat_orderclueids": [this.data.detail.sat_orderclueid]
-							}
-						}).then(res => {
-							wx.showToast({
-								title: res.msg == '成功' ? `操作成功` : res.msg,
-								icon: "none"
-							});
-							setTimeout(() => {
-								wx.navigateBack()
-								getCurrentPages().forEach(v => {
-									if (v.__route__ == "packageA/publicClue/index") {
-										v.getList(true)
-									}
-								})
-							}, 300)
-
-						})
-					}
-				})
-				break;
-			case "撤回":
-				wx.showModal({
-					title: '提示',
-					content: `是否确认撤回该线索?`,
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) _Http.basic({
-							classname: "webmanage.saletool.orderclue.publicclue.PublicClue",
-							method: "revoke",
-							"content": {
-								"sat_orderclueid": this.data.detail.sat_orderclueid
-							}
-						}).then(res => {
-							setTimeout(() => {
-								wx.showToast({
-									title: res.msg == '成功' ? `操作成功` : res.msg,
-									icon: "none"
-								});
-							}, 1000)
-							if (res.msg == '成功') this.getDetail()
-						})
-					}
-				})
-				break;
-		}
-	},
+                        })
+                    }
+                })
+                break;
+            case "撤回":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确认撤回该线索?`,
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            classname: "webmanage.saletool.orderclue.publicclue.PublicClue",
+                            method: "revoke",
+                            "content": {
+                                "sat_orderclueid": this.data.detail.sat_orderclueid
+                            }
+                        }).then(res => {
+                            setTimeout(() => {
+                                wx.showToast({
+                                    title: res.msg == '成功' ? `操作成功` : res.msg,
+                                    icon: "none"
+                                });
+                            }, 1000)
+                            if (res.msg == '成功') this.getDetail()
+                        })
+                    }
+                })
+                break;
+        }
+    },
+    onUnload() {
+        const page = getCurrentPages().find(v => v.__route__ == 'packageA/publicClue/index');
+        if (!page) return;
+        let content = JSON.parse(JSON.stringify(page.data.content));
+        content.pageSize = (content.pageNumber - 1) * content.pageSize;
+        content.pageNumber = 1;
+        _Http.basic({
+            id: '20221101094402',
+            content
+        }).then(res => {
+            console.log("更新公海线索列表", res);
+            if (res.msg == '成功') {
+                page.setData({
+                    list: res.data,
+                    "content.total": res.total
+                })
+                page.getTags()
+            }
+        })
+    }
 })

+ 3 - 8
packageA/publicClue/distribution.js

@@ -76,15 +76,10 @@ Page({
                     if (res.msg != '成功') return;
                     setTimeout(() => {
                         getCurrentPages().forEach(v => {
-                            if (v.__route__ == "packageA/publicClue/index") {
+                            if (v.__route__ == "packageA/publicClue/index" || v.__route__ == "packageA/saleAdmin/index") {
                                 v.getList(true)
-                            } else if (v.__route__ == "packageA/publicClue/detail") {
-                                wx.navigateBack()
-                                getCurrentPages().forEach(v => {
-                                    if (v.__route__ == "packageA/publicClue/index") {
-                                        v.getList(true)
-                                    }
-                                })
+                            } else if (v.__route__ == "packageA/publicClue/detail" || v.__route__ == "packageA/saleAdmin/detail") {
+                                v.getDetail();
                             }
                         })
                         wx.navigateBack()

+ 1 - 1
packageA/publicClue/distribution.scss

@@ -30,7 +30,7 @@
                 font-family: PingFang SC-Regular, PingFang SC;
                 color: #FFFFFF;
                 flex-shrink: 0;
-
+                overflow: hidden;
                 image{
                     width: 100%;
                     height: 100%;

+ 68 - 9
packageA/saleAdmin/detail.js

@@ -8,7 +8,7 @@ Page({
         siteShow: false,
     },
     onLoad(options) {
-        const appAuth = wx.getStorageSync('auth').worderclue_public;
+        const appAuth = wx.getStorageSync('auth').worderclue_admin;
         let tabsList = [{
             label: "详细信息",
             icon: "icon-tabxiangxixinxi1"
@@ -215,17 +215,36 @@ Page({
         })
     },
     setTabbarList(status) {
-        let tabbarList = this.data.isAdmin ? [{
-            icon: "icon-zhuanyi",
-            label: "分配"
-        }, {
-            icon: "icon-dibu-jieshu",
-            label: "删除"
-        }] : [];
+        let tabbarList = [];
+        if (this.data.isAdmin) {
+            if (this.data.detail.isprivate == 0) {
+                if (this.data.detail.allocationstatus == '待分配') {
+                    tabbarList.push({
+                        icon: "icon-zhuanyi",
+                        label: "分配"
+                    })
+                } else {
+                    tabbarList.push({
+                        icon: "icon-a-baobeibohuituihui",
+                        label: "撤回"
+                    })
+                }
+            }
+            tabbarList.push({
+                icon: "icon-dibu-jieshu",
+                label: "删除"
+            })
+        }
         if (status == '待跟进') tabbarList.unshift({
             icon: "icon-bianji",
             label: "编辑"
         })
+
+        if (status == '已过期' && this.data.detail.isprivate == 0 && wx.getStorageSync('auth').worderclue_admin.options.some(v => v == "recover")) tabbarList.unshift({
+            icon: "icon-dibu-chehui",
+            label: "恢复"
+        })
+
         if (wx.getStorageSync('auth').worderclue_public.options.some(v => v == "shiftSite")) {
             tabbarList.unshift({
                 icon: "icon-CRM",
@@ -302,7 +321,6 @@ Page({
     onReachBottom() {
         this.partialRenewal();
     },
-
     //详情按钮回调
     tabbarOnClick({
         detail
@@ -320,6 +338,27 @@ Page({
                     url: `/packageA/publicClue/distribution?data=${JSON.stringify(data)}`,
                 })
                 break;
+            case "恢复":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定恢复该线索`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": "20230907142004",
+                            "content": {
+                                "sat_orderclueid": data.sat_orderclueid
+                            }
+                        }).then(res => {
+                            console.log("恢复线索", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? "恢复成功" : res.msg,
+                                icon: "none"
+                            });
+                            that.getDetail();
+                        })
+                    }
+                })
+                break;
             case "转站点":
                 that.selectComponent("#ShiftSite").showSite()
                 break;
@@ -380,4 +419,24 @@ Page({
                 break;
         }
     },
+    onUnload() {
+        const page = getCurrentPages().find(v => v.__route__ == 'packageA/saleAdmin/index');
+        if (!page) return;
+        let content = JSON.parse(JSON.stringify(page.data.content));
+        content.pageSize = (content.pageNumber - 1) * content.pageSize;
+        content.pageNumber = 1;
+        _Http.basic({
+            id: '20221101094302',
+            content
+        }).then(res => {
+            console.log("更新线索管理列表", res);
+            if (res.msg == '成功') {
+                page.setData({
+                    list: res.data,
+                    "content.total": res.total
+                })
+                page.getTags()
+            }
+        })
+    }
 })

+ 1 - 1
packageA/saleAdmin/index.js

@@ -46,7 +46,7 @@ Page({
     },
     onLoad(options) {
         this.setData({
-            insert: wx.getStorageSync('auth').worderclue.options.some(v => v == 'insert'), //查询新增权限
+            insert: wx.getStorageSync('auth').worderclue_admin.options.some(v => v == 'insert'), //查询新增权限
             classActions: wx.getStorageSync('templetList').map(v => {
                 return {
                     name: v.templetname,

+ 1 - 1
packageA/saleAdmin/insert.js

@@ -490,7 +490,7 @@ Page({
         })
         let content = this.selectComponent("#Form").submit();
         content.sat_orderclueid = sat_orderclueid;
-        content.isprivate = 1; //0表示公海,1表示私域
+        content.isprivate = 0; //0表示公海,1表示私域
         content.sat_campaignid = content.campaign_name ? content.campaign_name[1][0] : 0;
         content.contactsid = content.contactsid ? content.contactsid[1][0] : 0;
         content.sa_projectid = content.sa_projectid ? content.sa_projectid[1][0] : 0;