zhaoxiaohai před 3 roky
rodič
revize
f70ce479d2

+ 59 - 21
packageA/contract/detail.js

@@ -44,23 +44,33 @@ Page({
                 icon: "icon-genjin",
                 label: "反审核"
             }].concat(tabbarList);
-            if (isLeader || this.data.isAdmin) tabbarList = [{
-                icon: "icon-genjin",
-                label: "提交"
-            }, {
-                icon: "icon-zhuanyi",
-                label: "更换负责人"
-            }, {
-                icon: "icon-genjin",
-                label: "终止"
-            }, {
-                icon: "icon-shanchu",
-                label: "作废"
-            }].concat(tabbarList)
-            if (res.data.status == '新建') tabbarList.push({
-                icon: "icon-bianji",
-                label: "编辑"
-            })
+            if (isLeader || this.data.isAdmin) {
+                tabbarList = [{
+                    icon: "icon-zhuanyi",
+                    label: "更换负责人"
+                }, {
+                    icon: "icon-genjin",
+                    label: "终止"
+                }, {
+                    icon: "icon-shanchu",
+                    label: "作废"
+                }].concat(tabbarList)
+                if (res.data.status == '新建') tabbarList.push({
+                    icon: "icon-bianji",
+                    label: "编辑"
+                });
+                if (isLeader && res.data.status == '已提交') {
+                    tabbarList.unshift({
+                        icon: "icon-genjin",
+                        label: '撤回'
+                    })
+                } else {
+                    tabbarList.unshift({
+                        icon: "icon-genjin",
+                        label: '提交'
+                    })
+                }
+            };
             let data = res.data,
                 tabsList = this.data.tabsList,
                 tabsActive = 0;
@@ -133,9 +143,6 @@ Page({
                 }, {
                     label: "最近编辑时间",
                     value: data.changedate
-                }, {
-                    label: "转手次数",
-                    value: data.leader[0].leadernum
                 }, {
                     label: "提交人",
                     value: data.submitby
@@ -148,6 +155,9 @@ Page({
                 }, {
                     label: "审核时间",
                     value: data.checkdate
+                }, {
+                    label: "转手次数",
+                    value: data.leader[0].leadernum
                 }],
                 tabsList,
                 tabsActive
@@ -479,6 +489,34 @@ Page({
                     }
                 })
                 break;
+            case "撤回":
+                if (data.status != '已提交') return wx.showToast({
+                    title: '当前状态不可撤回!',
+                    icon: "none"
+                })
+                wx.showModal({
+                    title: '提示',
+                    content: `是否撤回审核当前协议`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": 20230130091502,
+                            "content": {
+                                "sa_contractid": that.data.sa_contractid,
+                            }
+                        }).then(res => {
+                            console.log("撤回审核合同", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? "撤回审核成功" : res.msg,
+                                icon: "none"
+                            })
+                            if (res.msg == '成功') setTimeout(() => {
+                                that.getDetail();
+                            }, 300)
+                        })
+                    }
+                })
+                break;
+
             case "反审核":
                 if (data.status == '新建') return wx.showToast({
                     title: '当前状态不可反审核!',
@@ -486,7 +524,7 @@ Page({
                 })
                 wx.showModal({
                     title: '提示',
-                    content: `是否退回当前协议`,
+                    content: `是否反审核当前协议`,
                     complete: (res) => {
                         if (res.confirm) _Http.basic({
                             "id": 20221212135402,

+ 53 - 13
packageA/offers/detail.js

@@ -66,6 +66,29 @@ Page({
                 }],
                 isLeader = res.data.createuserid == wx.getStorageSync('userMsg').userid;
 
+            if (isLeader || this.data.isAdmin) {
+                tabbarList = [{
+                    icon: "icon-guanlian-fuzhi",
+                    label: "复制"
+                }, {
+                    icon: "icon-zhuanyi",
+                    label: "更换负责人"
+                }, {
+                    icon: "icon-shanchu",
+                    label: "作废"
+                }].concat(tabbarList)
+                if (isLeader && res.data.status == '提交') {
+                    tabbarList.unshift({
+                        icon: "icon-genjin",
+                        label: '撤回'
+                    })
+                } else {
+                    tabbarList.unshift({
+                        icon: "icon-genjin",
+                        label: '提交'
+                    })
+                }
+            }
             if (this.data.isAdmin) tabbarList = [{
                 icon: "icon-guanlian-fuzhi",
                 label: "审核"
@@ -74,19 +97,6 @@ Page({
                 label: "反审核"
             }].concat(tabbarList);
 
-            if (isLeader || this.data.isAdmin) tabbarList = tabbarList.concat([{
-                icon: "icon-guanlian-fuzhi",
-                label: "提交"
-            }, {
-                icon: "icon-guanlian-fuzhi",
-                label: "复制"
-            }, {
-                icon: "icon-zhuanyi",
-                label: "更换负责人"
-            }, {
-                icon: "icon-shanchu",
-                label: "作废"
-            }])
 
             this.setData({
                 tabbarList,
@@ -166,6 +176,9 @@ Page({
                 }, {
                     label: "审核时间",
                     value: res.data.checkdate
+                }, {
+                    label: "转手次数",
+                    value: res.data.leader[0].leadernum
                 }],
                 tabsList: this.data.tabsList
             });
@@ -348,6 +361,33 @@ Page({
                     }
                 })
                 break;
+            case "撤回":
+                console.log(data.status)
+                if (data.status != '提交') return wx.showToast({
+                    title: '当前状态不可撤回审核!',
+                    icon: "none"
+                })
+                wx.showModal({
+                    title: '提示',
+                    content: `是否撤回审核当前报价`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": 20221125162803,
+                            "version": 1,
+                            "content": {
+                                "sa_quotedpriceid": that.data.sa_quotedpriceid
+                            }
+                        }).then(res => {
+                            console.log("撤回报价单", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? "撤回审核成功" : res.msg,
+                                icon: "none"
+                            })
+                            if (res.msg == '成功') setTimeout(that.getDetail, 300)
+                        })
+                    }
+                })
+                break;
             case "跟进":
                 wx.navigateTo({
                     url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_quotedprice&ownerid=${data.sa_quotedpriceid}`,

+ 452 - 452
packageA/project/detail.js

@@ -1,464 +1,464 @@
 const _Http = getApp().globalData.http;
 Page({
-	data: {
-		isLeader: false, //是否为负责人
-		tabsActive: 1, //tabs 选中项
-		sa_projectid: "",
-		tabsList: [{
-			label: "详细信息",
-			icon: "icon-tabxiangxixinxi1"
-		}, {
-			label: "项目评估",
-			icon: "icon-tabxiangmupinggu"
-		}, {
-			label: "合同",
-			icon: "icon-tabhetong"
-		}, {
-			label: "关联客户",
-			icon: "icon-tabkehu"
-		}, {
-			label: "产品配置单",
-			icon: "icon-tabchanpin"
-		}, {
-			label: "报价单",
-			icon: "icon-tabbaojiadan"
-		}, {
-			label: "竞争对手",
-			icon: "icon-tabjingzhengduishou"
-		}, {
-			label: "联系人",
-			icon: "icon-tablianxiren"
-		}, {
-			label: "跟进动态",
-			icon: "icon-tabgenjinjilu"
-		}, {
-			label: "附件",
-			icon: "icon-tabfujian1"
-		}, {
-			label: "操作记录",
-			icon: "icon-tabcaozuojilu1"
-		}, {
-			label: "任务",
-			icon: "icon-tabrenwu"
-		}],
-		tabbarList: [],
-	},
-	onLoad(options) {
-		this.setData({
-			sa_projectid: options.sa_projectid,
-			isAdmin: wx.getStorageSync('auth').wCustomer.options.some(v => v == "admin"), //是否具有管理权限
-			options: wx.getStorageSync('auth').wCustomer.options, //权限列表
-		});
-		this.getDetail()
-	},
-	getDetail() {
-		_Http.basic({
-			"id": 20221021103902,
-			"content": {
-				nocache: true,
-				"sa_projectid": this.data.sa_projectid
-			},
-		}).then(res => {
-			console.log("项目商机详情", res)
-			if (res.msg != '成功') return wx.showToast({
-				title: res.data,
-				icon: "none"
-			});
-			let isLeader = res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
-				tabbarList = [{
-					icon: "icon-genjin",
-					label: "跟进"
-				}];
+    data: {
+        isLeader: false, //是否为负责人
+        tabsActive: 1, //tabs 选中项
+        sa_projectid: "",
+        tabsList: [{
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "项目评估",
+            icon: "icon-tabxiangmupinggu"
+        }, {
+            label: "合同",
+            icon: "icon-tabhetong"
+        }, {
+            label: "关联客户",
+            icon: "icon-tabkehu"
+        }, {
+            label: "产品配置单",
+            icon: "icon-tabchanpin"
+        }, {
+            label: "报价单",
+            icon: "icon-tabbaojiadan"
+        }, {
+            label: "竞争对手",
+            icon: "icon-tabjingzhengduishou"
+        }, {
+            label: "联系人",
+            icon: "icon-tablianxiren"
+        }, {
+            label: "跟进动态",
+            icon: "icon-tabgenjinjilu"
+        }, {
+            label: "附件",
+            icon: "icon-tabfujian1"
+        }, {
+            label: "操作记录",
+            icon: "icon-tabcaozuojilu1"
+        }, {
+            label: "任务",
+            icon: "icon-tabrenwu"
+        }],
+        tabbarList: [],
+    },
+    onLoad(options) {
+        this.setData({
+            sa_projectid: options.sa_projectid,
+            isAdmin: wx.getStorageSync('auth').wCustomer.options.some(v => v == "admin"), //是否具有管理权限
+            options: wx.getStorageSync('auth').wCustomer.options, //权限列表
+        });
+        this.getDetail()
+    },
+    getDetail() {
+        _Http.basic({
+            "id": 20221021103902,
+            "content": {
+                nocache: true,
+                "sa_projectid": this.data.sa_projectid
+            },
+        }).then(res => {
+            console.log("项目商机详情", res)
+            if (res.msg != '成功') return wx.showToast({
+                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) tabbarList = [{
-				icon: "icon-genjin",
-				label: "报备审核"
-			}, {
-				icon: "icon-genjin",
-				label: "报备驳回(退回)"
-			}].concat(tabbarList);
+            if (this.data.isAdmin) tabbarList = [{
+                icon: "icon-genjin",
+                label: "报备审核"
+            }, {
+                icon: "icon-genjin",
+                label: "报备驳回(退回)"
+            }].concat(tabbarList);
 
 
 
-			if (isLeader || this.data.isAdmin) tabbarList = tabbarList.concat([{
-				icon: "icon-bianji",
-				label: "编辑"
-			}, {
-				icon: "icon-genjin",
-				label: "提交报备"
-			}, {
-				icon: "icon-dibu-jieshu",
-				label: "结束"
-			}, {
-				icon: "icon-dibu-chehui",
-				label: "恢复"
-			}, {
-				icon: "icon-zhuanyi",
-				label: "更换负责人"
-			}, {
-				icon: "icon-shanchu",
-				label: "作废"
-			}])
+            if (isLeader || this.data.isAdmin) tabbarList = tabbarList.concat([{
+                icon: "icon-bianji",
+                label: "编辑"
+            }, {
+                icon: "icon-genjin",
+                label: "提交报备"
+            }, {
+                icon: "icon-dibu-jieshu",
+                label: "结束"
+            }, {
+                icon: "icon-dibu-chehui",
+                label: "恢复"
+            }, {
+                icon: "icon-zhuanyi",
+                label: "更换负责人"
+            }, {
+                icon: "icon-shanchu",
+                label: "作废"
+            }])
 
-			this.setData({
-				isLeader,
-				tabbarList,
-				detail: res.data,
-				briefs: [{
-					label: "项目编号",
-					value: res.data.projectnum
-				}, {
-					label: "项目地址",
-					value: res.data.province + res.data.city + res.data.county + res.data.address
-				}, {
-					label: "项目等级",
-					value: res.data.grade
-				}, {
-					label: "预计签约金额",
-					value: res.data.signamount_due
-				}, {
-					label: "项目阶段",
-					value: res.data.stagename
-				}],
-				list1: [{
-					label: "项目名称",
-					value: res.data.projectname
-				}, {
-					label: "项目编号",
-					value: res.data.projectnum
-				}, {
-					label: "项目类型",
-					value: res.data.projecttype
-				}, {
-					label: "当前项目阶段",
-					value: res.data.stagename
-				}, {
-					label: "省市县",
-					value: res.data.province ? res.data.province + res.data.city + res.data.county : ''
-				}, {
-					label: "详细地址",
-					value: res.data.address
-				}, {
-					label: "项目等级",
-					value: res.data.grade
-				}, {
-					label: "项目报备时间",
-					value: res.data.createdate
-				}, {
-					label: "项目规模",
-					value: res.data.scale
-				}, {
-					label: "项目状态",
-					value: res.data.status
-				}, {
-					label: "项目预算",
-					value: res.data.budgetary
-				}, {
-					label: "预计签约金额",
-					value: res.data.signamount_due
-				}, {
-					label: "预计签约月份",
-					value: res.data.signdate_due
-				}, {
-					label: "赢率",
-					value: res.data.winrate
-				}, {
-					label: "负责人",
-					value: res.data.name
-				}],
-				list2: [{
-					label: "创建人",
-					value: res.data.createby
-				}, {
-					label: "创建时间",
-					value: res.data.createdate
-				}, {
-					label: "最近编辑人",
-					value: res.data.changeby
-				}, {
-					label: "最近编辑时间",
-					value: res.data.changedate
-				}, {
-					label: "转手次数",
-					value: res.data.changecount
-				}, {
-					label: "报备人",
-					value: res.data.reportby
-				}, {
-					label: "报备时间",
-					value: res.data.reportdate
-				}, {
-					label: "报备审核通过时间",
-					value: res.data.reportcheckdate
-				}]
-			})
-			this.getTags();
-			this.getGroup();
-			this.partialRenewal();
-			this.selectComponent("#TaskTabs").getList();
-		})
-	},
-	//详情按钮回调
-	tabbarOnClick({
-		detail
-	}) {
-		let data = this.data.detail,
-			that = this;
-		switch (detail.label) {
-			case "结束":
-				if (data.status != '跟进中') return wx.showToast({
-					title: '当前状态不可结束',
-					icon: "none"
-				});
+            this.setData({
+                isLeader,
+                tabbarList,
+                detail: res.data,
+                briefs: [{
+                    label: "项目编号",
+                    value: res.data.projectnum
+                }, {
+                    label: "项目地址",
+                    value: res.data.province + res.data.city + res.data.county + res.data.address
+                }, {
+                    label: "项目等级",
+                    value: res.data.grade
+                }, {
+                    label: "预计签约金额",
+                    value: res.data.signamount_due
+                }, {
+                    label: "项目阶段",
+                    value: res.data.stagename
+                }],
+                list1: [{
+                    label: "项目名称",
+                    value: res.data.projectname
+                }, {
+                    label: "项目编号",
+                    value: res.data.projectnum
+                }, {
+                    label: "项目类型",
+                    value: res.data.projecttype
+                }, {
+                    label: "当前项目阶段",
+                    value: res.data.stagename
+                }, {
+                    label: "省市县",
+                    value: res.data.province ? res.data.province + res.data.city + res.data.county : ''
+                }, {
+                    label: "详细地址",
+                    value: res.data.address
+                }, {
+                    label: "项目等级",
+                    value: res.data.grade
+                }, {
+                    label: "项目报备时间",
+                    value: res.data.createdate
+                }, {
+                    label: "项目规模",
+                    value: res.data.scale
+                }, {
+                    label: "项目状态",
+                    value: res.data.status
+                }, {
+                    label: "项目预算",
+                    value: res.data.budgetary
+                }, {
+                    label: "预计签约金额",
+                    value: res.data.signamount_due
+                }, {
+                    label: "预计签约月份",
+                    value: res.data.signdate_due
+                }, {
+                    label: "赢率",
+                    value: res.data.winrate
+                }, {
+                    label: "负责人",
+                    value: res.data.name
+                }],
+                list2: [{
+                    label: "创建人",
+                    value: res.data.createby
+                }, {
+                    label: "创建时间",
+                    value: res.data.createdate
+                }, {
+                    label: "最近编辑人",
+                    value: res.data.changeby
+                }, {
+                    label: "最近编辑时间",
+                    value: res.data.changedate
+                }, {
+                    label: "报备人",
+                    value: res.data.reportby
+                }, {
+                    label: "报备时间",
+                    value: res.data.reportdate
+                }, {
+                    label: "报备审核通过时间",
+                    value: res.data.reportcheckdate
+                }, {
+                    label: "转手次数",
+                    value: res.data.changecount
+                }]
+            })
+            this.getTags();
+            this.getGroup();
+            this.partialRenewal();
+            this.selectComponent("#TaskTabs").getList();
+        })
+    },
+    //详情按钮回调
+    tabbarOnClick({
+        detail
+    }) {
+        let data = this.data.detail,
+            that = this;
+        switch (detail.label) {
+            case "结束":
+                if (data.status != '跟进中') return wx.showToast({
+                    title: '当前状态不可结束',
+                    icon: "none"
+                });
 
-				wx.showModal({
-					title: '提示',
-					content: '是否确认结束项目',
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) _Http.basic({
-							"id": 20221215163702,
-							"content": {
-								"sa_projectid": data.sa_projectid
-							}
-						}).then(res => {
-							console.log('结束', res)
-							wx.showToast({
-								title: res.msg == '成功' ? '已结束' : res.msg,
-								icon: "none"
-							});
-							if (res.msg == '成功') setTimeout(this.getDetail, 300);
-						})
-					}
-				})
-				break;
-			case "恢复":
-				if (data.status != '已失败') return wx.showToast({
-					title: '失败项目才可恢复!',
-					icon: "none"
-				});
-				wx.showModal({
-					title: '提示',
-					content: '是否确认恢复项目',
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) _Http.basic({
-							"id": 20221215164002,
-							"content": {
-								"sa_projectid": data.sa_projectid
-							}
-						}).then(res => {
-							console.log('恢复', res)
-							wx.showToast({
-								title: res.msg == '成功' ? '已恢复' : res.msg,
-								icon: "none"
-							});
-							if (res.msg == '成功') setTimeout(this.getDetail, 300);
-						})
-					}
-				})
-				break;
-			case "提交报备":
-				wx.showModal({
-					title: '提示',
-					content: '是否确认提交项目审核',
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) that.handleReport(1)
-					}
-				})
-				break;
-			case "报备审核":
-				wx.showModal({
-					title: '提示',
-					content: '是否确认审核项目',
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) that.handleReport(2)
-					}
-				})
-				break;
-			case "报备驳回(退回)":
-				wx.showModal({
-					title: '提示',
-					content: '是否确认报备驳回(退回)项目',
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) that.handleReport(3)
-					}
-				})
-				break;
-			case "跟进":
-				wx.navigateTo({
-					url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_project&ownerid=${data.sa_projectid}`,
-				})
-				break;
-			case "编辑":
-				let tags = that.selectComponent("#Tags").data.systemtag;
-				wx.navigateTo({
-					url: `/packageA/project/addAndEdit?data=${JSON.stringify(data)}&disabled=${tags.includes("报备中")||tags.includes("已报备")}`,
-				})
-				break;
-			case "作废":
-				wx.navigateTo({
-					url: `/packageA/project/delete?id=${this.data.detail.sa_projectid}`,
-				})
-				break;
-			case "更换负责人":
-				wx.navigateTo({
-					url: `/pages/group/select?data=${JSON.stringify({
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认结束项目',
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 20221215163702,
+                            "content": {
+                                "sa_projectid": data.sa_projectid
+                            }
+                        }).then(res => {
+                            console.log('结束', res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '已结束' : res.msg,
+                                icon: "none"
+                            });
+                            if (res.msg == '成功') setTimeout(this.getDetail, 300);
+                        })
+                    }
+                })
+                break;
+            case "恢复":
+                if (data.status != '已失败') return wx.showToast({
+                    title: '失败项目才可恢复!',
+                    icon: "none"
+                });
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认恢复项目',
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 20221215164002,
+                            "content": {
+                                "sa_projectid": data.sa_projectid
+                            }
+                        }).then(res => {
+                            console.log('恢复', res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '已恢复' : res.msg,
+                                icon: "none"
+                            });
+                            if (res.msg == '成功') setTimeout(this.getDetail, 300);
+                        })
+                    }
+                })
+                break;
+            case "提交报备":
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认提交项目审核',
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) that.handleReport(1)
+                    }
+                })
+                break;
+            case "报备审核":
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认审核项目',
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) that.handleReport(2)
+                    }
+                })
+                break;
+            case "报备驳回(退回)":
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认报备驳回(退回)项目',
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) that.handleReport(3)
+                    }
+                })
+                break;
+            case "跟进":
+                wx.navigateTo({
+                    url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_project&ownerid=${data.sa_projectid}`,
+                })
+                break;
+            case "编辑":
+                let tags = that.selectComponent("#Tags").data.systemtag;
+                wx.navigateTo({
+                    url: `/packageA/project/addAndEdit?data=${JSON.stringify(data)}&disabled=${tags.includes("报备中")||tags.includes("已报备")}`,
+                })
+                break;
+            case "作废":
+                wx.navigateTo({
+                    url: `/packageA/project/delete?id=${this.data.detail.sa_projectid}`,
+                })
+                break;
+            case "更换负责人":
+                wx.navigateTo({
+                    url: `/pages/group/select?data=${JSON.stringify({
                              ownertable:"sa_project",
                              ownerid:data.sa_projectid,
                         })}&radio=true&principal=true`,
-				})
-				break;
-			default:
-				console.log(detail)
-				break;
-		}
-	},
-	/* 处理报备 */
-	handleReport(type) {
-		_Http.basic({
-			"id": 20221114163402,
-			"content": {
-				"sa_projectid": this.data.sa_projectid,
-				type //1提交报备,2报备审核,3报备驳回(退回)
-			}
-		}).then(res => {
-			console.log("报备", type, res)
-			this.getDetail();
-		})
-	},
-	//局部数据更新 tabs
-	partialRenewal(init = false) {
-		const id = this.data.detail.sa_projectid;
-		let model = '';
-		let name = this.data.tabsList[this.data.tabsActive].label;
-		switch (name) {
-			case "任务":
-				model = "#Work"
-				break;
-			case "合同":
-				model = "#Contract"
-				break;
-			case "跟进动态":
-				model = "#Trace"
-				break;
-			case "项目评估":
-				model = "#Task"
-				break;
-			case "竞争对手":
-				model = "#Opponent"
-				break;
-			case "关联客户":
-				model = "#Treaty"
-				break;
-			case "报价单":
-				model = "#Offers"
-				break;
-			case "产品配置单":
-				model = "#Product"
-				break;
-			case "联系人":
-				model = "#Contacts"
-				break;
-			case "操作记录":
-				model = "#Record"
-				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();
-	},
-	/* 项目评估切换 */
-	taskTabsChange({
-		detail
-	}) {
-		if (detail.change) {
-			this.setData({
-				tabsActive: this.data.tabsList.findIndex(v => v.label == '项目评估')
-			});
-			this.selectComponent("#Task").getList(this.data.sa_projectid, true)
-		}
-	},
-	//tabs 切换
-	tabsChange({
-		detail
-	}) {
-		this.setData({
-			tabsActive: detail
-		});
-		this.partialRenewal();
-	},
-	/* 更换负责人 */
-	handelSubmit(arr) {
-		const that = this;
-		wx.showModal({
-			title: '提示',
-			content: '是否确认更换负责人',
-			complete: ({
-				confirm
-			}) => {
-				if (confirm) _Http.basic({
-					"id": 20220930103701,
-					"content": {
-						ownertable: "sa_project",
-						ownerid: that.data.detail.sa_projectid,
-						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();
-						getCurrentPages().forEach(v => {
-							if (['packageA/project/index'].includes(v.__route__)) v.getList(true)
-						})
-						wx.navigateBack();
-					}, 300)
-				})
-			}
-		})
-	},
-	//更新标签
-	getTags() {
-		this.selectComponent("#Tags").getTags();
-	},
-	//更新团队成员
-	getGroup() {
-		this.selectComponent("#Group").getList();
-	}
+                })
+                break;
+            default:
+                console.log(detail)
+                break;
+        }
+    },
+    /* 处理报备 */
+    handleReport(type) {
+        _Http.basic({
+            "id": 20221114163402,
+            "content": {
+                "sa_projectid": this.data.sa_projectid,
+                type //1提交报备,2报备审核,3报备驳回(退回)
+            }
+        }).then(res => {
+            console.log("报备", type, res)
+            this.getDetail();
+        })
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        const id = this.data.detail.sa_projectid;
+        let model = '';
+        let name = this.data.tabsList[this.data.tabsActive].label;
+        switch (name) {
+            case "任务":
+                model = "#Work"
+                break;
+            case "合同":
+                model = "#Contract"
+                break;
+            case "跟进动态":
+                model = "#Trace"
+                break;
+            case "项目评估":
+                model = "#Task"
+                break;
+            case "竞争对手":
+                model = "#Opponent"
+                break;
+            case "关联客户":
+                model = "#Treaty"
+                break;
+            case "报价单":
+                model = "#Offers"
+                break;
+            case "产品配置单":
+                model = "#Product"
+                break;
+            case "联系人":
+                model = "#Contacts"
+                break;
+            case "操作记录":
+                model = "#Record"
+                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();
+    },
+    /* 项目评估切换 */
+    taskTabsChange({
+        detail
+    }) {
+        if (detail.change) {
+            this.setData({
+                tabsActive: this.data.tabsList.findIndex(v => v.label == '项目评估')
+            });
+            this.selectComponent("#Task").getList(this.data.sa_projectid, true)
+        }
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    /* 更换负责人 */
+    handelSubmit(arr) {
+        const that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认更换负责人',
+            complete: ({
+                confirm
+            }) => {
+                if (confirm) _Http.basic({
+                    "id": 20220930103701,
+                    "content": {
+                        ownertable: "sa_project",
+                        ownerid: that.data.detail.sa_projectid,
+                        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();
+                        getCurrentPages().forEach(v => {
+                            if (['packageA/project/index'].includes(v.__route__)) v.getList(true)
+                        })
+                        wx.navigateBack();
+                    }, 300)
+                })
+            }
+        })
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList();
+    }
 })

+ 3 - 3
packageA/publicClue/detail.js

@@ -141,9 +141,6 @@ Page({
                 }, {
                     label: "最近跟进时间",
                     value: res.data.followDate
-                }, {
-                    label: "转手次数",
-                    value: res.data.leader[0] ? res.data.leader[0].leadernum : 0
                 }, {
                     label: "转化次数",
                     value: res.data.iscustomer + res.data.isproject
@@ -153,6 +150,9 @@ Page({
                 }, {
                     label: "作废原因",
                     value: res.data.deletereason
+                }, {
+                    label: "转手次数",
+                    value: res.data.leader[0] ? res.data.leader[0].leadernum : 0
                 }],
                 tabsList: this.data.tabsList,
             });

+ 427 - 427
packageA/publicCustomer/detail.js

@@ -1,433 +1,433 @@
 const _Http = getApp().globalData.http;
 Page({
-	data: {
-		isLeader: false, //是否为负责人
-		tabsActive: 1, //tabs 选中项
-		sa_customersid: 0,
-		detail: {}, //详情数据
-		briefs: [], //简介列表
-		tabsList: [{
-			label: "详细信息",
-			icon: "icon-tabxiangxixinxi1"
-		}, {
-			label: "线索",
-			icon: "icon-tabxiansuo"
-		}, {
-			label: "项目商机",
-			icon: "icon-tabxiangmu"
-		}, {
-			label: "跟进动态",
-			icon: "icon-tabgenjinjilu"
-		}, {
-			label: "客户地址",
-			icon: "icon-tabdizhi"
-		}, {
-			label: "联系人",
-			icon: "icon-tablianxiren"
-		}, {
-			label: "报价单",
-			icon: "icon-tabbaojiadan"
-		}, {
-			label: "开票信息",
-			icon: "icon-tabkaipiaoxinxi"
-		}, {
-			label: "任务",
-			icon: "icon-tabrenwu"
-		}],
-		list1: [], //基本信息
-		list2: [], //系统信息
-		tabbarList: []
-	},
-	onLoad(options) {
-		this.setData({
-			sa_customersid: options.id,
-			isAdmin: wx.getStorageSync('auth').wPublicCustomer.options.some(v => v == "admin"), //是否具有管理权限
-			options: wx.getStorageSync('auth').wPublicCustomer.options, //权限列表
-		})
-		this.getDetail();
-	},
-	/* 分配 */
-	handleSelectContacts(arr, list) {
-		let item = list[0],
-			that = this;
-		wx.showModal({
-			title: '提示',
-			content: `是否确认将"${this.data.detail.enterprisename}"分配给"${item.name}"?`,
-			complete: ({
-				confirm
-			}) => {
-				if (confirm) _Http.basic({
-					"id": 20221014165502,
-					"content": {
-						"userid": item.userid,
-						"sa_customersids": [that.data.detail.sa_customersid]
-					},
-				}).then(res => {
-					console.log("分配公海客户", res)
-					wx.showToast({
-						title: res.msg == '成功' ? '分配成功' : res.msg,
-						icon: "none"
-					});
-					if (res.msg == '成功') setTimeout(() => {
-						that.handleInit()
-						wx.navigateBack();
-					}, 300)
-				})
-			}
-		})
-	},
-	/* 领取/分配后初始化数据 */
-	handleInit() {
-		// this.getDetail();
-		let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicCustomer/index');
-		page.setData({
-			list: page.data.list.filter(v => v.sa_customersid != this.data.detail.sa_customersid),
-			'content.total': page.data.content.total - 1
-		})
-		wx.redirectTo({
-			url: '/packageA/setclient/detail?id=' + this.data.detail.sa_customersid,
-		})
-	},
-	//详情按钮回调
-	tabbarOnClick({
-		detail
-	}) {
-		let data = this.data.detail;
-		switch (detail.label) {
-			case "领取":
-				let that = this;
-				wx.showModal({
-					title: '提示',
-					content: `是否确认领取"${that.data.detail.enterprisename}?"`,
-					complete: ({
-						confirm
-					}) => {
-						if (confirm) _Http.basic({
-							"id": 20221014160202,
-							"content": {
-								"sa_customersid": that.data.detail.sa_customersid
-							},
-						}).then(res => {
-							console.log("领取公海客户", res)
-							wx.showToast({
-								title: res.msg == '成功' ? '领取成功' : res.msg,
-								icon: "none"
-							});
-							if (res.msg == '成功') setTimeout(() => {
-								that.handleInit();
-							}, 300)
-						})
-					}
-				})
-				break;
-			case "跟进":
-				wx.navigateTo({
-					url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_customers&ownerid=${data.sa_customersid}`,
-				})
-				break;
-			case "编辑":
+    data: {
+        isLeader: false, //是否为负责人
+        tabsActive: 1, //tabs 选中项
+        sa_customersid: 0,
+        detail: {}, //详情数据
+        briefs: [], //简介列表
+        tabsList: [{
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "线索",
+            icon: "icon-tabxiansuo"
+        }, {
+            label: "项目商机",
+            icon: "icon-tabxiangmu"
+        }, {
+            label: "跟进动态",
+            icon: "icon-tabgenjinjilu"
+        }, {
+            label: "客户地址",
+            icon: "icon-tabdizhi"
+        }, {
+            label: "联系人",
+            icon: "icon-tablianxiren"
+        }, {
+            label: "报价单",
+            icon: "icon-tabbaojiadan"
+        }, {
+            label: "开票信息",
+            icon: "icon-tabkaipiaoxinxi"
+        }, {
+            label: "任务",
+            icon: "icon-tabrenwu"
+        }],
+        list1: [], //基本信息
+        list2: [], //系统信息
+        tabbarList: []
+    },
+    onLoad(options) {
+        this.setData({
+            sa_customersid: options.id,
+            isAdmin: wx.getStorageSync('auth').wPublicCustomer.options.some(v => v == "admin"), //是否具有管理权限
+            options: wx.getStorageSync('auth').wPublicCustomer.options, //权限列表
+        })
+        this.getDetail();
+    },
+    /* 分配 */
+    handleSelectContacts(arr, list) {
+        let item = list[0],
+            that = this;
+        wx.showModal({
+            title: '提示',
+            content: `是否确认将"${this.data.detail.enterprisename}"分配给"${item.name}"?`,
+            complete: ({
+                confirm
+            }) => {
+                if (confirm) _Http.basic({
+                    "id": 20221014165502,
+                    "content": {
+                        "userid": item.userid,
+                        "sa_customersids": [that.data.detail.sa_customersid]
+                    },
+                }).then(res => {
+                    console.log("分配公海客户", res)
+                    wx.showToast({
+                        title: res.msg == '成功' ? '分配成功' : res.msg,
+                        icon: "none"
+                    });
+                    if (res.msg == '成功') setTimeout(() => {
+                        that.handleInit()
+                        wx.navigateBack();
+                    }, 300)
+                })
+            }
+        })
+    },
+    /* 领取/分配后初始化数据 */
+    handleInit() {
+        // this.getDetail();
+        let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicCustomer/index');
+        page.setData({
+            list: page.data.list.filter(v => v.sa_customersid != this.data.detail.sa_customersid),
+            'content.total': page.data.content.total - 1
+        })
+        wx.redirectTo({
+            url: '/packageA/setclient/detail?id=' + this.data.detail.sa_customersid,
+        })
+    },
+    //详情按钮回调
+    tabbarOnClick({
+        detail
+    }) {
+        let data = this.data.detail;
+        switch (detail.label) {
+            case "领取":
+                let that = this;
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确认领取"${that.data.detail.enterprisename}?"`,
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 20221014160202,
+                            "content": {
+                                "sa_customersid": that.data.detail.sa_customersid
+                            },
+                        }).then(res => {
+                            console.log("领取公海客户", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '领取成功' : res.msg,
+                                icon: "none"
+                            });
+                            if (res.msg == '成功') setTimeout(() => {
+                                that.handleInit();
+                            }, 300)
+                        })
+                    }
+                })
+                break;
+            case "跟进":
+                wx.navigateTo({
+                    url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_customers&ownerid=${data.sa_customersid}`,
+                })
+                break;
+            case "编辑":
                 data.parentid = [data.superiorenterprisename, [data.parentid]]
                 data.sa_customerpoolid = [data.sourcepoolname, [data.sa_customerpoolid]]
-				wx.navigateTo({
-					url: `/packageA/publicCustomer/addAndEditor?data=${JSON.stringify(data)}`,
-				})
-				break;
-			case "删除":
-				wx.showModal({
-					title: '提示',
-					content: `是否确定删除“${data.enterprisename}”`,
-					complete: (res) => {
-						if (res.confirm) _Http.basic({
-							id: 20221010164402,
-							content: {
-								"sa_customersids": [data.sa_customersid],
-								datastatus: 1, //(0:正常;1:删除;2:锁定)
-							}
-						}).then(res => {
-							console.log("删除公海客户", res)
-							wx.showToast({
-								title: res.msg == '成功' ? '删除成功' : res.msg,
-								icon: "none",
-								mask: true
-							});
-							if (res.msg == '成功') setTimeout(() => {
-								let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicCustomer/index');
-								if (page) page.setData({
-									list: page.data.list.filter(v => v.sa_customersid != data.sa_customersid),
-									"content.total": page.data.content.total - 1
-								});
-								wx.navigateBack()
-							}, 500)
-						})
-					}
-				})
-				break;
-			case "分配":
-				wx.navigateTo({
-					url: '/packageA/select/contacts/select?params=' + JSON.stringify({
-						"id": 20221017094102,
-						"content": {
-							nacache: true,
-							"sa_customerpoolid": this.data.detail.sa_customerpoolid
-						},
-					}) + '&radio=true&idName=userid',
-				})
-				break;
-			default:
-				console.log(detail)
-				break;
-		}
-	},
-	/* 更换负责人 */
-	handelSubmit(arr) {
-		const that = this;
-		wx.showModal({
-			title: '提示',
-			content: '是否确认更换负责人',
-			complete: ({
-				confirm
-			}) => {
-				if (confirm) _Http.basic({
-					"id": 20220930103701,
-					"content": {
-						ownertable: "sa_customers",
-						ownerid: that.data.sa_customersid,
-						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();
-						getCurrentPages().forEach(v => {
-							if (['packageA/setclient/index'].includes(v.__route__)) v.getList(true)
-						})
-						wx.navigateBack();
-					}, 300)
-				})
-			}
-		})
-	},
-	/* 获取详情 */
-	getDetail() {
-		/* 基本信息 */
-		_Http.basic({
-			"id": 20221012164302,
-			"content": {
-				sa_customersid: this.data.sa_customersid
-			},
-		}).then(res => {
-			console.log("详情", res)
-			if (res.msg != '成功') return wx.showToast({
-				title: res.data,
-				icon: "none"
-			})
-			/* 摘要信息 */
-			let briefs = [{
-				label: "客户级别",
-				value: res.data.grade
-			}, {
-				label: "客户类型",
-				value: res.data.type
-			}, {
-				label: "上级企业",
-				value: res.data.superiorenterprisename
-			}];
-			/* 基本信息 */
-			let list1 = [{
-				label: "客户名称",
-				value: res.data.enterprisename
-			}, {
-				label: "客户编号",
-				value: res.data.sa_customersid
-			}, {
-				label: "客户级别",
-				value: res.data.grade
-			}, {
-				label: "客户类型",
-				value: res.data.type
-			}, {
-				label: "上级企业",
-				value: res.data.superiorenterprisename
-			}, {
-				label: "合作状态",
-				value: res.data.status
-			}, {
-				label: "来源",
-				value: res.data.source
-			}];
-			/* 系统信息 */
-			let list2 = [{
-				label: "创建人",
-				value: res.data.createby
-			}, {
-				label: "创建时间",
-				value: res.data.createdate
-			}, {
-				label: "成交状态",
-				value: res.data.tradingstatus
-			}];
-			this.setData({
-				detail: res.data,
-				briefs,
-				list1,
-				list2
-			});
-			//负责人
-			_Http.basic({
-				"id": 20220930103501,
-				"content": {
-					"ownertable": "sa_customers",
-					"ownerid": this.data.sa_customersid
-				}
-			}).then(s => {
-				console.log("负责人", s)
-				let userList = s.data.map(user => user.team[0]),
-					isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid),
-					tabbarList = [{
-						icon: "icon-paixushaixuanxuanzhong",
-						label: "领取"
-					}, {
-						icon: "icon-genjin",
-						label: "跟进"
-					}];
-				if (isLeader || this.data.isAdmin) tabbarList = tabbarList.concat([{
-					icon: "icon-bianji",
-					label: "编辑"
-				}, {
-					icon: "icon-shanchu",
-					label: "删除"
-				}]);
-				if (this.data.options.some(v => v == 'allot')) tabbarList.splice(0, 0, {
-					icon: "icon-a-tuiguangsucailaxinliang",
-					label: "分配"
-				})
-				this.setData({
-					tabbarList
-				})
-				if (s.data.length != 0) {
-					let list = list1.concat([{
-						label: "负责人",
-						value: s.data[0].teamleader[0].name
-					}, {
-						label: "负责人部门",
-						value: s.data[0].teamleader[0].position
-					}])
-					list[5].value = s.data.length > 0 ? '已分配' : '未分配';
-					this.setData({
-						principal: s.data,
-						list1: list,
-						briefs: this.data.briefs.concat([{
-							label: "负责人",
-							value: s.data[0].teamleader[0].name
-						}])
-					});
-				}
-			});
-			//系统信息
-			_Http.basic({
-				"id": 20221019091602,
-				"content": {
-					"sa_customersid": this.data.sa_customersid
-				}
-			}).then(s => {
-				console.log("系统信息", s)
-				let list = this.data.list2.concat([{
-					label: "转手次数",
-					value: s.data.changecount
-				}, {
-					label: "最近编辑人",
-					value: s.data.changeby
-				}, {
-					label: "最近编辑时间",
-					value: s.data.changedate
-				}])
-				this.setData({
-					list2: list
-				})
-			})
-			//获取标签
-			this.getTags();
-			this.partialRenewal();
-		});
-	},
-	//tabs 切换
-	tabsChange({
-		detail
-	}) {
-		this.setData({
-			tabsActive: detail
-		});
-		this.partialRenewal();
-	},
-	//局部数据更新 tabs
-	partialRenewal(init = false) {
-		let id = this.data.detail.sys_enterpriseid;
-		let model = '';
-		let name = this.data.tabsList[this.data.tabsActive].label;
-		switch (name) {
-			case "任务":
-				model = "#Work"
-				break;
-			case "跟进动态":
-				model = "#Trace"
-				break;
-			case "项目商机":
-				model = "#Project"
-				break;
-			case "线索":
-				id = this.data.detail.sa_customersid;
-				model = "#Clue"
-				break;
-			case "客户地址":
-				model = "#Address"
-				break;
-			case "报价单":
-				model = "#Offers"
-				break;
-			case "联系人":
-				model = "#Contacts"
-				break;
-			case "开票信息":
-				model = "#Financing"
-				break;
-			default:
-				break;
-		};
-		if (model) {
-			// 确定好模块ID total = null 是第一次加载 加载数据
-			// init是新增或修改需要清数据
-			let Component = this.selectComponent(model);
-			const {
-				total,
-				pageNumber,
-				pageTotal
-			} = Component.data.content;
-			if (total == null || init) {
-				console.log(1)
-				Component.getList(id, init);
-			} else if (pageNumber <= pageTotal) {
-				console.log(2)
-				Component.getList(id, false);
-			} else {
-				//用来判断 在搜索页面修改,与tabs选项不一致 但是切换到该选项 重置数据
+                wx.navigateTo({
+                    url: `/packageA/publicCustomer/addAndEditor?data=${JSON.stringify(data)}`,
+                })
+                break;
+            case "删除":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定删除“${data.enterprisename}”`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            id: 20221010164402,
+                            content: {
+                                "sa_customersids": [data.sa_customersid],
+                                datastatus: 1, //(0:正常;1:删除;2:锁定)
+                            }
+                        }).then(res => {
+                            console.log("删除公海客户", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '删除成功' : res.msg,
+                                icon: "none",
+                                mask: true
+                            });
+                            if (res.msg == '成功') setTimeout(() => {
+                                let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicCustomer/index');
+                                if (page) page.setData({
+                                    list: page.data.list.filter(v => v.sa_customersid != data.sa_customersid),
+                                    "content.total": page.data.content.total - 1
+                                });
+                                wx.navigateBack()
+                            }, 500)
+                        })
+                    }
+                })
+                break;
+            case "分配":
+                wx.navigateTo({
+                    url: '/packageA/select/contacts/select?params=' + JSON.stringify({
+                        "id": 20221017094102,
+                        "content": {
+                            nacache: true,
+                            "sa_customerpoolid": this.data.detail.sa_customerpoolid
+                        },
+                    }) + '&radio=true&idName=userid',
+                })
+                break;
+            default:
+                console.log(detail)
+                break;
+        }
+    },
+    /* 更换负责人 */
+    handelSubmit(arr) {
+        const that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认更换负责人',
+            complete: ({
+                confirm
+            }) => {
+                if (confirm) _Http.basic({
+                    "id": 20220930103701,
+                    "content": {
+                        ownertable: "sa_customers",
+                        ownerid: that.data.sa_customersid,
+                        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();
+                        getCurrentPages().forEach(v => {
+                            if (['packageA/setclient/index'].includes(v.__route__)) v.getList(true)
+                        })
+                        wx.navigateBack();
+                    }, 300)
+                })
+            }
+        })
+    },
+    /* 获取详情 */
+    getDetail() {
+        /* 基本信息 */
+        _Http.basic({
+            "id": 20221012164302,
+            "content": {
+                sa_customersid: this.data.sa_customersid
+            },
+        }).then(res => {
+            console.log("详情", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            /* 摘要信息 */
+            let briefs = [{
+                label: "客户级别",
+                value: res.data.grade
+            }, {
+                label: "客户类型",
+                value: res.data.type
+            }, {
+                label: "上级企业",
+                value: res.data.superiorenterprisename
+            }];
+            /* 基本信息 */
+            let list1 = [{
+                label: "客户名称",
+                value: res.data.enterprisename
+            }, {
+                label: "客户编号",
+                value: res.data.sa_customersid
+            }, {
+                label: "客户级别",
+                value: res.data.grade
+            }, {
+                label: "客户类型",
+                value: res.data.type
+            }, {
+                label: "上级企业",
+                value: res.data.superiorenterprisename
+            }, {
+                label: "合作状态",
+                value: res.data.status
+            }, {
+                label: "来源",
+                value: res.data.source
+            }];
+            /* 系统信息 */
+            let list2 = [{
+                label: "创建人",
+                value: res.data.createby
+            }, {
+                label: "创建时间",
+                value: res.data.createdate
+            }, {
+                label: "成交状态",
+                value: res.data.tradingstatus
+            }];
+            this.setData({
+                detail: res.data,
+                briefs,
+                list1,
+                list2
+            });
+            //负责人
+            _Http.basic({
+                "id": 20220930103501,
+                "content": {
+                    "ownertable": "sa_customers",
+                    "ownerid": this.data.sa_customersid
+                }
+            }).then(s => {
+                console.log("负责人", s)
+                let userList = s.data.map(user => user.team[0]),
+                    isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid),
+                    tabbarList = [{
+                        icon: "icon-paixushaixuanxuanzhong",
+                        label: "领取"
+                    }, {
+                        icon: "icon-genjin",
+                        label: "跟进"
+                    }];
+                if (isLeader || this.data.isAdmin) tabbarList = tabbarList.concat([{
+                    icon: "icon-bianji",
+                    label: "编辑"
+                }, {
+                    icon: "icon-shanchu",
+                    label: "删除"
+                }]);
+                if (this.data.options.some(v => v == 'allot')) tabbarList.splice(0, 0, {
+                    icon: "icon-a-tuiguangsucailaxinliang",
+                    label: "分配"
+                })
+                this.setData({
+                    tabbarList
+                })
+                if (s.data.length != 0) {
+                    let list = list1.concat([{
+                        label: "负责人",
+                        value: s.data[0].teamleader[0].name
+                    }, {
+                        label: "负责人部门",
+                        value: s.data[0].teamleader[0].position
+                    }])
+                    list[5].value = s.data.length > 0 ? '已分配' : '未分配';
+                    this.setData({
+                        principal: s.data,
+                        list1: list,
+                        briefs: this.data.briefs.concat([{
+                            label: "负责人",
+                            value: s.data[0].teamleader[0].name
+                        }])
+                    });
+                }
+            });
+            //系统信息
+            _Http.basic({
+                "id": 20221019091602,
+                "content": {
+                    "sa_customersid": this.data.sa_customersid
+                }
+            }).then(s => {
+                console.log("系统信息", s)
+                let list = this.data.list2.concat([{
+                    label: "最近编辑人",
+                    value: s.data.changeby
+                }, {
+                    label: "最近编辑时间",
+                    value: s.data.changedate
+                }, {
+                    label: "转手次数",
+                    value: s.data.changecount
+                }])
+                this.setData({
+                    list2: list
+                })
+            })
+            //获取标签
+            this.getTags();
+            this.partialRenewal();
+        });
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        let id = this.data.detail.sys_enterpriseid;
+        let model = '';
+        let name = this.data.tabsList[this.data.tabsActive].label;
+        switch (name) {
+            case "任务":
+                model = "#Work"
+                break;
+            case "跟进动态":
+                model = "#Trace"
+                break;
+            case "项目商机":
+                model = "#Project"
+                break;
+            case "线索":
+                id = this.data.detail.sa_customersid;
+                model = "#Clue"
+                break;
+            case "客户地址":
+                model = "#Address"
+                break;
+            case "报价单":
+                model = "#Offers"
+                break;
+            case "联系人":
+                model = "#Contacts"
+                break;
+            case "开票信息":
+                model = "#Financing"
+                break;
+            default:
+                break;
+        };
+        if (model) {
+            // 确定好模块ID total = null 是第一次加载 加载数据
+            // init是新增或修改需要清数据
+            let Component = this.selectComponent(model);
+            const {
+                total,
+                pageNumber,
+                pageTotal
+            } = Component.data.content;
+            if (total == null || init) {
+                console.log(1)
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                console.log(2)
+                Component.getList(id, false);
+            } else {
+                //用来判断 在搜索页面修改,与tabs选项不一致 但是切换到该选项 重置数据
 
-			}
-		}
-	},
-	//更新标签
-	getTags() {
-		this.selectComponent("#Tags").getTags();
-	},
-	onReachBottom() {
-		this.partialRenewal();
-	},
-	onShareAppMessage() {}
+            }
+        }
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    onShareAppMessage() {}
 })

+ 3 - 3
packageA/saleClue/detail.js

@@ -165,9 +165,6 @@ Page({
                 }, {
                     label: "最近跟进时间",
                     value: res.data.followDate
-                }, {
-                    label: "转手次数",
-                    value: res.data.leader[0].leadernum
                 }, {
                     label: "转化次数",
                     value: res.data.iscustomer + res.data.isproject
@@ -177,6 +174,9 @@ Page({
                 }, {
                     label: "作废原因",
                     value: res.data.deletereason
+                }, {
+                    label: "转手次数",
+                    value: res.data.leader[0].leadernum
                 }],
                 tabsList: this.data.tabsList,
             });

+ 0 - 5
packageA/salesForecasting/detail.js

@@ -128,7 +128,6 @@ Page({
 
             if (init) {
                 this.getTags();
-                this.getGroup();
                 this.partialRenewal();
             }
         })
@@ -315,9 +314,5 @@ Page({
     getTags() {
         this.selectComponent("#Tags").getTags();
     },
-    //更新团队成员
-    getGroup() {
-        this.selectComponent("#Group").getList();
-    },
     onShareAppMessage() {}
 })

+ 1 - 3
packageA/salesForecasting/detail.wxml

@@ -3,9 +3,7 @@
 	<Yl-tags id="Tags" add ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
 </view>
 <!-- 简介 -->
-<Yl_Detail list="{{briefs}}">
-	<Yl-group slot='bottom' id='Group' add ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' add="{{detail.status!='已提报'}}" />
-</Yl_Detail>
+<Yl_Detail list="{{briefs}}" />
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 	<Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />

+ 421 - 425
packageA/setclient/detail.js

@@ -1,61 +1,61 @@
 const _Http = getApp().globalData.http;
 Page({
-	data: {
-		isLeader: false, //是否为负责人
-		tabsActive: 0, //tabs 选中项
-		sa_customersid: 0,
-		detail: {}, //详情数据
-		briefs: [], //简介列表
-		tabsList: [{
-			label: "跟进动态",
-			icon: "icon-tabgenjinjilu"
-		}, {
-			label: "详细信息",
-			icon: "icon-tabxiangxixinxi1"
-		}, {
-			label: "线索",
-			icon: "icon-tabxiansuo"
-		}, {
-			label: "项目商机",
-			icon: "icon-tabxiangmu"
-		}, {
-			label: "客户地址",
-			icon: "icon-tabdizhi"
-		}, {
-			label: "联系人",
-			icon: "icon-tablianxiren"
-		}, {
-			label: "报价单",
-			icon: "icon-tabbaojiadan"
-		}, {
-			label: "开票信息",
-			icon: "icon-tabkaipiaoxinxi"
-		}, {
-			label: "任务",
-			icon: "icon-tabrenwu"
-		}],
-		list1: [], //基本信息
-		list2: [], //系统信息
-		tabbarList: []
-	},
-	onLoad(options) {
-		this.setData({
-			sa_customersid: options.id,
-			isAdmin: wx.getStorageSync('auth').wCustomer.options.some(v => v == "admin"), //是否具有管理权限
-			options: wx.getStorageSync('auth').wCustomer.options, //权限列表
-		})
-		this.getDetail();
-	},
-	//详情按钮回调
-	tabbarOnClick({
-		detail
-	}) {
-		let data = this.data.detail,
-			that = this;
-		switch (detail.label) {
-			case "分享":
-				wx.navigateTo({
-					url: `/packageA/publicCustomer/pond/index?params=${JSON.stringify({
+    data: {
+        isLeader: false, //是否为负责人
+        tabsActive: 0, //tabs 选中项
+        sa_customersid: 0,
+        detail: {}, //详情数据
+        briefs: [], //简介列表
+        tabsList: [{
+            label: "跟进动态",
+            icon: "icon-tabgenjinjilu"
+        }, {
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "线索",
+            icon: "icon-tabxiansuo"
+        }, {
+            label: "项目商机",
+            icon: "icon-tabxiangmu"
+        }, {
+            label: "客户地址",
+            icon: "icon-tabdizhi"
+        }, {
+            label: "联系人",
+            icon: "icon-tablianxiren"
+        }, {
+            label: "报价单",
+            icon: "icon-tabbaojiadan"
+        }, {
+            label: "开票信息",
+            icon: "icon-tabkaipiaoxinxi"
+        }, {
+            label: "任务",
+            icon: "icon-tabrenwu"
+        }],
+        list1: [], //基本信息
+        list2: [], //系统信息
+        tabbarList: []
+    },
+    onLoad(options) {
+        this.setData({
+            sa_customersid: options.id,
+            isAdmin: wx.getStorageSync('auth').wCustomer.options.some(v => v == "admin"), //是否具有管理权限
+            options: wx.getStorageSync('auth').wCustomer.options, //权限列表
+        })
+        this.getDetail();
+    },
+    //详情按钮回调
+    tabbarOnClick({
+        detail
+    }) {
+        let data = this.data.detail,
+            that = this;
+        switch (detail.label) {
+            case "分享":
+                wx.navigateTo({
+                    url: `/packageA/publicCustomer/pond/index?params=${JSON.stringify({
                         "id": 20221206195102,
                         name:"分享",
                         "content": {
@@ -66,42 +66,42 @@ Page({
                             }
                         }
                     })}`,
-				})
-				break;
-			case "退回":
-				wx.showModal({
-					title: '提示',
-					content: `是否确定将${data.enterprisename}退回到公海客户`,
-					complete: (res) => {
-						console.log(data)
-						if (res.confirm) _Http.basic({
-							"id": 20221014102602,
-							"content": {
-								"sa_customerpoolid": data.sa_customerpoolid_source,
-								"sa_customersid": data.sa_customersid
-							}
-						}).then(res => {
-							console.log("公海线索退回", res)
-							wx.showToast({
-								title: res.msg == '成功' ? '退回成功' : res.msg,
-								icon: "none"
-							});
-							if (res.msg == '成功') setTimeout(() => {
-								let page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
-								if (page) page.setData({
-									list: page.data.list.filter(v => v.sa_customersid != data.sa_customersid)
-								});
-								wx.redirectTo({
-									url: '/packageA/publicCustomer/detail?id' + data.sa_customersid,
-								})
-							}, 300)
-						})
-					}
-				});
-				break;
-			case "回收":
-				wx.navigateTo({
-					url: `/packageA/publicCustomer/pond/index?params=${JSON.stringify({
+                })
+                break;
+            case "退回":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定将${data.enterprisename}退回到公海客户`,
+                    complete: (res) => {
+                        console.log(data)
+                        if (res.confirm) _Http.basic({
+                            "id": 20221014102602,
+                            "content": {
+                                "sa_customerpoolid": data.sa_customerpoolid_source,
+                                "sa_customersid": data.sa_customersid
+                            }
+                        }).then(res => {
+                            console.log("公海线索退回", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '退回成功' : res.msg,
+                                icon: "none"
+                            });
+                            if (res.msg == '成功') setTimeout(() => {
+                                let page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
+                                if (page) page.setData({
+                                    list: page.data.list.filter(v => v.sa_customersid != data.sa_customersid)
+                                });
+                                wx.redirectTo({
+                                    url: '/packageA/publicCustomer/detail?id' + data.sa_customersid,
+                                })
+                            }, 300)
+                        })
+                    }
+                });
+                break;
+            case "回收":
+                wx.navigateTo({
+                    url: `/packageA/publicCustomer/pond/index?params=${JSON.stringify({
                         "id": 20221206195102,
                         name:"回收",
                         "content": {
@@ -112,348 +112,344 @@ Page({
                             }
                         }
                     })}`,
-				})
-				break;
-			case "跟进":
-				wx.navigateTo({
-					url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_customers&ownerid=${data.sa_customersid}`,
-				})
-				break;
-			case "编辑":
-				data.parentid = [data.superiorenterprisename, [data.parentid]]
-				wx.navigateTo({
-					url: `/packageA/setclient/addAndEditor?data=${JSON.stringify(data)}`,
-				})
-				break;
-			case "作废":
-				wx.navigateTo({
-					url: `/packageA/setclient/delete?item=${JSON.stringify({
+                })
+                break;
+            case "跟进":
+                wx.navigateTo({
+                    url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_customers&ownerid=${data.sa_customersid}`,
+                })
+                break;
+            case "编辑":
+                data.parentid = [data.superiorenterprisename, [data.parentid]]
+                wx.navigateTo({
+                    url: `/packageA/setclient/addAndEditor?data=${JSON.stringify(data)}`,
+                })
+                break;
+            case "作废":
+                wx.navigateTo({
+                    url: `/packageA/setclient/delete?item=${JSON.stringify({
                         "sa_customersids": [this.data.detail.sa_customersid],
                         datastatus: 1, //(0:正常;1:作废;2:锁定)
                     })}`,
-				})
-				break;
-			case "更换负责人":
-				wx.navigateTo({
-					url: `/pages/group/select?data=${JSON.stringify({
+                })
+                break;
+            case "更换负责人":
+                wx.navigateTo({
+                    url: `/pages/group/select?data=${JSON.stringify({
                          ownertable:"sa_customers",
                          ownerid:this.data.sa_customersid,
                     })}&radio=true&principal=true`,
-				})
-				break;
-			default:
-				console.log(detail)
-				break;
-		}
-	},
-	handleTransfer(ids, list, name) {
-		wx.showModal({
-			title: '提示',
-			content: `是否确定将客户${name}至${list[0].poolname}?`,
-			complete: (res) => {
-				if (res.confirm) _Http.basic({
-					"id": name == '回收' ? 20221014165602 : 20221014102502,
-					"content": {
-						"sa_customerpoolid": ids[0], //公海池id
-						"sa_customersids": [this.data.detail.sa_customersid],
-						"sa_customersid": this.data.detail.sa_customersid
-					},
-				}).then(res => {
-					console.log(name, res)
-					wx.showToast({
-						title: res.data == '成功' ? `${name}成功` : res.msg,
-						icon: "none"
-					});
-					if (res.data == '成功') setTimeout(() => {
-						wx.navigateBack()
-						let page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
-						if (page) page.setData({
-							list: page.data.list.filter(v => v.sa_customersid != this.data.detail.sa_customersid)
-						});
-						wx.redirectTo({
-							url: '/packageA/publicCustomer/detail?id=' + this.data.detail.sa_customersid,
-						})
-					}, 300)
-				})
-			}
-		})
-	},
-	/* 更换负责人 */
-	handelSubmit(arr) {
-		const that = this;
-		wx.showModal({
-			title: '提示',
-			content: '是否确认更换负责人',
-			complete: ({
-				confirm
-			}) => {
-				if (confirm) _Http.basic({
-					"id": 20220930103701,
-					"content": {
-						ownertable: "sa_customers",
-						ownerid: that.data.sa_customersid,
-						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();
-						getCurrentPages().forEach(v => {
-							if (['packageA/setclient/index'].includes(v.__route__)) v.getList(true)
-						})
-						wx.navigateBack();
-					}, 300)
-				})
-			}
-		})
-	},
-	/* 获取详情 */
-	getDetail() {
-		/* 基本信息 */
-		_Http.basic({
-			"id": 20221012164302,
-			"content": {
-				sa_customersid: this.data.sa_customersid
-			},
-		}).then(res => {
-			console.log("详情", res)
-			if (res.msg != '成功') return wx.showToast({
-				title: res.data,
-				icon: "none"
-			})
-			/* 摘要信息 */
-			let briefs = [{
-				label: "客户级别",
-				value: res.data.grade
-			}, {
-				label: "客户类型",
-				value: res.data.type
-			}, {
-				label: "上级企业",
-				value: res.data.superiorenterprisename
-			}];
-			/* 基本信息 */
-			let list1 = [{
-				label: "客户名称",
-				value: res.data.enterprisename
-			}, {
-				label: "客户编号",
-				value: res.data.sa_customersid
-			}, {
-				label: "客户级别",
-				value: res.data.grade
-			}, {
-				label: "客户类型",
-				value: res.data.type
-			}, {
-				label: "上级企业",
-				value: res.data.superiorenterprisename
-			}, {
-				label: "分配状态",
-				value: ""
-			}, {
-				label: "合作状态",
-				value: res.data.status
-			}, {
-				label: "成交次数",
-				value: res.data.contact_signnum
-			}, {
-				label: "来源",
-				value: res.data.source
-			}];
-			/* 系统信息 */
-			let list2 = [{
-				label: "创建人",
-				value: res.data.createby
-			}, {
-				label: "创建时间",
-				value: res.data.createdate
-			}, {
-				label: "成交状态",
-				value: res.data.tradingstatus
-			}];
-			this.setData({
-				detail: res.data,
-				briefs,
-				list1,
-				list2
-			});
-			//负责人
-			_Http.basic({
-				"id": 20220930103501,
-				"content": {
-					"ownertable": "sa_customers",
-					"ownerid": this.data.sa_customersid
-				}
-			}).then(s => {
-				console.log("负责人", s)
-				let tabbarList = [{
-					icon: "icon-genjin",
-					label: "跟进"
-				}];
-				if (s.data.length != 0) {
-					let userList = s.data.map(user => user.team[0]),
-						isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid);
-					if (isLeader || this.data.isAdmin) tabbarList = [{
-						icon: "icon-bianji",
-						label: "编辑"
-					}, {
-						icon: "icon-zhuanyi",
-						label: "更换负责人"
-					}, {
-						icon: "icon-shanchu",
-						label: "作废"
+                })
+                break;
+            default:
+                console.log(detail)
+                break;
+        }
+    },
+    handleTransfer(ids, list, name) {
+        wx.showModal({
+            title: '提示',
+            content: `是否确定将客户${name}至${list[0].poolname}?`,
+            complete: (res) => {
+                if (res.confirm) _Http.basic({
+                    "id": name == '回收' ? 20221014165602 : 20221014102502,
+                    "content": {
+                        "sa_customerpoolid": ids[0], //公海池id
+                        "sa_customersids": [this.data.detail.sa_customersid],
+                        "sa_customersid": this.data.detail.sa_customersid
+                    },
+                }).then(res => {
+                    console.log(name, res)
+                    wx.showToast({
+                        title: res.data == '成功' ? `${name}成功` : res.msg,
+                        icon: "none"
+                    });
+                    if (res.data == '成功') setTimeout(() => {
+                        wx.navigateBack()
+                        let page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
+                        if (page) page.setData({
+                            list: page.data.list.filter(v => v.sa_customersid != this.data.detail.sa_customersid)
+                        });
+                        wx.redirectTo({
+                            url: '/packageA/publicCustomer/detail?id=' + this.data.detail.sa_customersid,
+                        })
+                    }, 300)
+                })
+            }
+        })
+    },
+    /* 更换负责人 */
+    handelSubmit(arr) {
+        const that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认更换负责人',
+            complete: ({
+                confirm
+            }) => {
+                if (confirm) _Http.basic({
+                    "id": 20220930103701,
+                    "content": {
+                        ownertable: "sa_customers",
+                        ownerid: that.data.sa_customersid,
+                        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();
+                        getCurrentPages().forEach(v => {
+                            if (['packageA/setclient/index'].includes(v.__route__)) v.getList(true)
+                        })
+                        wx.navigateBack();
+                    }, 300)
+                })
+            }
+        })
+    },
+    /* 获取详情 */
+    getDetail() {
+        /* 基本信息 */
+        _Http.basic({
+            "id": 20221012164302,
+            "content": {
+                sa_customersid: this.data.sa_customersid
+            },
+        }).then(res => {
+            console.log("详情", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            /* 摘要信息 */
+            let briefs = [{
+                label: "客户级别",
+                value: res.data.grade
+            }, {
+                label: "客户类型",
+                value: res.data.type
+            }, {
+                label: "上级企业",
+                value: res.data.superiorenterprisename
+            }];
+            /* 基本信息 */
+            let list1 = [{
+                label: "客户名称",
+                value: res.data.enterprisename
+            }, {
+                label: "客户编号",
+                value: res.data.sa_customersid
+            }, {
+                label: "客户级别",
+                value: res.data.grade
+            }, {
+                label: "客户类型",
+                value: res.data.type
+            }, {
+                label: "上级企业",
+                value: res.data.superiorenterprisename
+            }, {
+                label: "分配状态",
+                value: ""
+            }, {
+                label: "合作状态",
+                value: res.data.status
+            }, {
+                label: "成交次数",
+                value: res.data.contact_signnum
+            }, {
+                label: "来源",
+                value: res.data.source
+            }];
+            /* 系统信息 */
+            let list2 = [{
+                label: "创建人",
+                value: res.data.createby
+            }, {
+                label: "创建时间",
+                value: res.data.createdate
+            }, {
+                label: "成交状态",
+                value: res.data.tradingstatus
+            }];
+            this.setData({
+                detail: res.data,
+                briefs,
+                list1,
+                list2
+            });
+            //负责人
+            _Http.basic({
+                "id": 20220930103501,
+                "content": {
+                    "ownertable": "sa_customers",
+                    "ownerid": this.data.sa_customersid
+                }
+            }).then(s => {
+                console.log("负责人", s)
+                let tabbarList = [{
+                    icon: "icon-genjin",
+                    label: "跟进"
+                }];
+                if (s.data.length != 0) {
+                    let userList = s.data.map(user => user.team[0]),
+                        isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid);
+                    if (isLeader || this.data.isAdmin) tabbarList = [{
+                        icon: "icon-bianji",
+                        label: "编辑"
+                    }, {
+                        icon: "icon-zhuanyi",
+                        label: "更换负责人"
+                    }, {
+                        icon: "icon-shanchu",
+                        label: "作废"
                     }].concat(tabbarList);
                     /* {
 						icon: "icon-dibu-fenxiang",
 						label: "分享"
 					}, */
-					if (isLeader && res.data.ispublic == 1) tabbarList = tabbarList.concat([ {
-						icon: "icon-dibu-chehui",
-						label: "退回"
-					}]);
-					if (isLeader) tabbarList.splice(0, 0, {
-						icon: "icon-dibu-tuihui",
-						label: "回收"
-					})
-					let list = list1.concat([{
-						label: "负责人",
-						value: s.data[0].teamleader[0].name
-					}, {
-						label: "负责人部门",
-						value: s.data[0].teamleader[0].position
-					}])
-					list[5].value = s.data.length > 0 ? '已分配' : '未分配';
-					this.setData({
-						isLeader,
-						principal: s.data,
-						list1: list,
-						briefs: this.data.briefs.concat([{
-							label: "负责人",
-							value: s.data[0].teamleader[0].name
-						}, {
-							label: "最近跟进时间",
-							value: s.data[0].teamleader[0].changedate
-						}])
-					});
-				}
-				this.setData({
-					tabbarList,
-				})
-			});
-			//系统信息
-			_Http.basic({
-				"id": 20221019091602,
-				"content": {
-					"sa_customersid": this.data.sa_customersid
-				}
-			}).then(s => {
-				console.log("系统信息", s)
-				let list = this.data.list2.concat([{
-					label: "转手次数",
-					value: s.data.changecount
-				}, {
-					label: "最近编辑人",
-					value: s.data.changeby
-				}, {
-					label: "最近编辑时间",
-					value: s.data.changedate
-				}])
-				/* {
-				    label: "客户资料完善度",
-				    value: s.data.tradingstatus + '%'
-				} */
-				this.setData({
-					list2: list
-				})
-			})
-			//获取标签
-			this.getTags();
-			this.getGroup()
-			this.partialRenewal();
-		});
-	},
-	//tabs 切换
-	tabsChange({
-		detail
-	}) {
-		this.setData({
-			tabsActive: detail
-		});
-		this.partialRenewal();
-	},
-	//局部数据更新 tabs
-	partialRenewal(init = false) {
-		let id = this.data.detail.sys_enterpriseid;
-		let model = '';
-		let name = this.data.tabsList[this.data.tabsActive].label;
-		switch (name) {
-			case "任务":
-				model = "#Work"
-				break;
-			case "跟进动态":
-				model = "#Trace"
-				break;
-			case "项目商机":
-				model = "#Project"
-				break;
-			case "线索":
-				id = this.data.detail.sa_customersid;
-				model = "#Clue"
-				break;
-			case "客户地址":
-				model = "#Address"
-				break;
-			case "报价单":
-				model = "#Offers"
-				break;
-			case "联系人":
-				model = "#Contacts"
-				break;
-			case "开票信息":
-				model = "#Financing"
-				break;
-			default:
-				break;
-		};
-		if (model) {
-			// 确定好模块ID total = null 是第一次加载 加载数据
-			// init是新增或修改需要清数据
-			let Component = this.selectComponent(model);
-			const {
-				total,
-				pageNumber,
-				pageTotal
-			} = Component.data.content;
-			if (total == null || init) {
-				console.log(1)
-				Component.getList(id, init);
-			} else if (pageNumber <= pageTotal) {
-				console.log(2)
-				Component.getList(id, false);
-			} else {
-				//用来判断 在搜索页面修改,与tabs选项不一致 但是切换到该选项 重置数据
-			}
-		}
-	},
-	//更新标签
-	getTags() {
-		this.selectComponent("#Tags").getTags();
-	},
-	//更新团队成员
-	getGroup() {
-		this.selectComponent("#Group").getList();
-	},
-	onReachBottom() {
-		this.partialRenewal();
-	},
-	onShareAppMessage() {}
+                    if (isLeader && res.data.ispublic == 1) tabbarList = tabbarList.concat([{
+                        icon: "icon-dibu-chehui",
+                        label: "退回"
+                    }]);
+                    if (isLeader) tabbarList.splice(0, 0, {
+                        icon: "icon-dibu-tuihui",
+                        label: "回收"
+                    })
+                    let list = list1.concat([{
+                        label: "负责人",
+                        value: s.data[0].teamleader[0].name
+                    }, {
+                        label: "负责人部门",
+                        value: s.data[0].teamleader[0].position
+                    }])
+                    list[5].value = s.data.length > 0 ? '已分配' : '未分配';
+                    this.setData({
+                        isLeader,
+                        principal: s.data,
+                        list1: list,
+                        briefs: this.data.briefs.concat([{
+                            label: "负责人",
+                            value: s.data[0].teamleader[0].name
+                        }, {
+                            label: "最近跟进时间",
+                            value: s.data[0].teamleader[0].changedate
+                        }])
+                    });
+                }
+                this.setData({
+                    tabbarList,
+                })
+            });
+            //系统信息
+            _Http.basic({
+                "id": 20221019091602,
+                "content": {
+                    "sa_customersid": this.data.sa_customersid
+                }
+            }).then(s => {
+                console.log("系统信息", s)
+                let list = this.data.list2.concat([{
+                    label: "最近编辑人",
+                    value: s.data.changeby
+                }, {
+                    label: "最近编辑时间",
+                    value: s.data.changedate
+                }, {
+                    label: "转手次数",
+                    value: s.data.changecount
+                }])
+                this.setData({
+                    list2: list
+                })
+            })
+            //获取标签
+            this.getTags();
+            this.getGroup()
+            this.partialRenewal();
+        });
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        let id = this.data.detail.sys_enterpriseid;
+        let model = '';
+        let name = this.data.tabsList[this.data.tabsActive].label;
+        switch (name) {
+            case "任务":
+                model = "#Work"
+                break;
+            case "跟进动态":
+                model = "#Trace"
+                break;
+            case "项目商机":
+                model = "#Project"
+                break;
+            case "线索":
+                id = this.data.detail.sa_customersid;
+                model = "#Clue"
+                break;
+            case "客户地址":
+                model = "#Address"
+                break;
+            case "报价单":
+                model = "#Offers"
+                break;
+            case "联系人":
+                model = "#Contacts"
+                break;
+            case "开票信息":
+                model = "#Financing"
+                break;
+            default:
+                break;
+        };
+        if (model) {
+            // 确定好模块ID total = null 是第一次加载 加载数据
+            // init是新增或修改需要清数据
+            let Component = this.selectComponent(model);
+            const {
+                total,
+                pageNumber,
+                pageTotal
+            } = Component.data.content;
+            if (total == null || init) {
+                console.log(1)
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                console.log(2)
+                Component.getList(id, false);
+            } else {
+                //用来判断 在搜索页面修改,与tabs选项不一致 但是切换到该选项 重置数据
+            }
+        }
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList();
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    onShareAppMessage() {}
 })

+ 3 - 0
packageA/work/detail.js

@@ -139,6 +139,9 @@ Page({
                 }, {
                     label: "最近编辑时间",
                     value: res.data.changedate
+                }, {
+                    label: "转手次数",
+                    value: res.data.leader[0].leadernum
                 }]
             });