zhaoxiaohai 3 lat temu
rodzic
commit
c6f34391c6

+ 4 - 2
packageA/project/modules/task/add.wxml

@@ -37,5 +37,7 @@
 <view style="height: 130rpx;" />
 <view style="height: 130rpx;" />
 <view class="footer">
 <view class="footer">
     <view />
     <view />
-    <van-button custom-class='but' disabled='{{!content.actionnotes}}' bind:click="submit">确定</van-button>
-</view>
+    <van-button custom-class='but' bind:click="submit">确定</van-button>
+</view>
+
+<!-- disabled='{{!content.actionnotes}}' -->

+ 38 - 2
packageA/publicCustomer/addAndEditor.js

@@ -94,7 +94,7 @@ Page({
             valueName: "contact",
             valueName: "contact",
             checking: "base",
             checking: "base",
             required: false
             required: false
-        },{
+        }, {
             label: "所属行业",
             label: "所属行业",
             error: false,
             error: false,
             errMsg: "",
             errMsg: "",
@@ -125,6 +125,41 @@ Page({
             valueName: "address",
             valueName: "address",
             checking: "base",
             checking: "base",
             required: false
             required: false
+        }, {
+            label: "上级企业",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/select/setclient/select",
+            radio: true,
+            value: "",
+            params: {
+                id: 20221012164402,
+                valueKey: "sa_customersid",
+                content: {
+                    nocache: true,
+                    "type": 1,
+                    "pageNumber": 1,
+                    "pageSize": 20,
+                    "isExport": 0,
+                    "where": {
+                        "condition": "",
+                        "status": "", //状态
+                        "startdate": "",
+                        "enddate": ""
+                    },
+                    "sort": [{
+                        sortname: "默认",
+                        sorted: 1,
+                        sortid: 67,
+                        reversed: 0
+                    }]
+                },
+            },
+            placeholder: "选择上级企业",
+            valueName: "parentid",
+            checking: "base",
+            required: true
         }],
         }],
         content: {
         content: {
             "sa_customersid": 0, //新增是传0
             "sa_customersid": 0, //新增是传0
@@ -205,7 +240,7 @@ Page({
             let that = this;
             let that = this;
             wx.showModal({
             wx.showModal({
                 title: '提示',
                 title: '提示',
-                content: `是否继续创建客户`,
+                content: `是否继续${this.data.content.sys_enterpriseid==0?'创建':'编辑'}客户`,
                 complete: (res) => {
                 complete: (res) => {
                     if (res.confirm) that.handleSubmit(true);
                     if (res.confirm) that.handleSubmit(true);
                 }
                 }
@@ -327,6 +362,7 @@ Page({
             data.county = data.region[2]
             data.county = data.region[2]
         };
         };
         data.sa_customerpoolid = data.sa_customerpoolid[1][0]
         data.sa_customerpoolid = data.sa_customerpoolid[1][0]
+        if (data.parentid) data.parentid = data.parentid[1][0]
         delete(data.region);
         delete(data.region);
         _Http.basic({
         _Http.basic({
             "id": 20221010164302,
             "id": 20221010164302,

+ 429 - 427
packageA/publicCustomer/detail.js

@@ -1,431 +1,433 @@
 const _Http = getApp().globalData.http;
 const _Http = getApp().globalData.http;
 Page({
 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 "编辑":
-                wx.navigateTo({
-                    url: `/packageA/setclient/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选项不一致 但是切换到该选项 重置数据
+	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选项不一致 但是切换到该选项 重置数据
 
 
-            }
-        }
-    },
-    //更新标签
-    getTags() {
-        this.selectComponent("#Tags").getTags();
-    },
-    onReachBottom() {
-        this.partialRenewal();
-    },
-    onShareAppMessage() {}
+			}
+		}
+	},
+	//更新标签
+	getTags() {
+		this.selectComponent("#Tags").getTags();
+	},
+	onReachBottom() {
+		this.partialRenewal();
+	},
+	onShareAppMessage() {}
 })
 })

+ 19 - 13
packageA/salesForecasting/detail.js

@@ -59,24 +59,30 @@ Page({
             this.setData({
             this.setData({
                 detail: res.data,
                 detail: res.data,
                 briefs: [{
                 briefs: [{
-                    label: "提报开始时间",
-                    value: res.data.periodstart
-                }, {
-                    label: "提报周期",
-                    value: res.data.reportingperiod
+                    label: "提报类型",
+                    value: res.data.isrepeat == 1 ? '月度提报' : '单次提报'
                 }, {
                 }, {
                     label: "提报要求",
                     label: "提报要求",
                     value: res.data.remarks
                     value: res.data.remarks
+                }, {
+                    label: "提报开始时间",
+                    value: res.data.periodstart
+                }, {
+                    label: "截止时间",
+                    value: '--'
                 }, {
                 }, {
                     label: "预测金额",
                     label: "预测金额",
                     value: res.data.sumamount
                     value: res.data.sumamount
+                }, {
+                    label: "提报人",
+                    value: res.data.createby
                 }, {
                 }, {
                     label: "状态",
                     label: "状态",
                     value: res.data.status
                     value: res.data.status
                 }],
                 }],
                 list1: [{
                 list1: [{
-                    label: "单号",
-                    value: res.data.billnum
+                    label: "提报类型",
+                    value: res.data.isrepeat == 1 ? '月度提报' : '单次提报'
                 }, {
                 }, {
                     label: "提报要求",
                     label: "提报要求",
                     value: res.data.remarks
                     value: res.data.remarks
@@ -84,20 +90,20 @@ Page({
                     label: "提报开始时间",
                     label: "提报开始时间",
                     value: res.data.periodstart
                     value: res.data.periodstart
                 }, {
                 }, {
-                    label: "提报周期",
-                    value: res.data.reportingperiod
+                    label: "截止日期",
+                    value: '--'
                 }, {
                 }, {
                     label: "预测金额(元)",
                     label: "预测金额(元)",
                     value: res.data.sumamount
                     value: res.data.sumamount
                 }, {
                 }, {
-                    label: "负责人",
-                    value: res.data.createby
+                    label: "状态",
+                    value: res.data.status
                 }],
                 }],
                 list2: [{
                 list2: [{
-                    label: "创建人",
+                    label: "提报人",
                     value: res.data.createby
                     value: res.data.createby
                 }, {
                 }, {
-                    label: "创建时间",
+                    label: "提报时间",
                     value: res.data.createdate
                     value: res.data.createdate
                 }, {
                 }, {
                     label: "最近编辑人",
                     label: "最近编辑人",

+ 143 - 135
packageA/select/setclient/select.js

@@ -1,139 +1,147 @@
 const _Http = getApp().globalData.http,
 const _Http = getApp().globalData.http,
-    getHeight = require("../../../utils/getRheRemainingHeight");
+	getHeight = require("../../../utils/getRheRemainingHeight");
 Page({
 Page({
-    data: {
-        item: null,
-        result: [],
-        radio: true,
-    },
-    onLoad(options) {
-        /* 从表单组件进入进入 */
-        if (options.item) {
-            let item = JSON.parse(options.item);
-            this.setData({
-                item,
-                result: item.value.length ? item.value[1] : [],
-                params: item.params
-            })
-        };
-        if (options.params) this.setData({
-            params: JSON.parse(options.params)
-        });
-        this.setData({
-            radio: options.radio ? true : false
-        });
-        this.getList()
-    },
-    submit() {
-        let pages = getCurrentPages(),
-            item = this.data.item,
-            result = this.data.result,
-            list = result.map(v => this.data.list.find(value => value.sys_enterpriseid == v));
-        try {
-            if (item) {
-                let page = pages[pages.length - 2].selectComponent(item.model || "#Form");
-                item.value = this.data.radio ? [list[0].enterprisename, result] : [list.map(v => v.enterprisename), result];
-                page.handleRoute(item, list);
-            } else if (this.data.params.content.model) {
-                let page = pages[pages.length - 2].selectComponent(this.data.params.content.model);
-                page.handleSelectProject(this.data.result, list)
-            } else {
-                pages[pages.length - 2].handleSelectProject(this.data.result, list)
-            }
-        } catch (e) {
-            console.log(e)
-            wx.showToast({
-                title: '操作失败',
-                icon: "none"
-            })
-        }
-    },
-    getList(init = false) {
-        //init 用于初始化分页
-        if (init.detail != undefined) init = init.detail;
-        let params = this.data.params;
-        if (init) params.content.pageNumber = 1;
-        if (params.content.pageNumber > params.content.pageTotal) return;
-        _Http.basic(params).then(res => {
-            console.log("选择客户列表", res)
-            this.selectComponent('#ListBox').RefreshToComplete();
-            if (res.msg != '成功') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            })
-            this.setData({
-                'params.content.pageNumber': res.pageNumber + 1,
-                'params.content.pageTotal': res.pageTotal,
-                'params.content.total': res.total,
-                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
-            })
-            this.getTags();
-        })
-    },
-    /* 获取列表标签 */
-    getTags() {
-        let list = this.data.list,
-            ownerids = list.map(v => v.sys_enterpriseid)
-        _Http.basic({
-            "id": 20221018102001,
-            "content": {
-                "ownertable": "sa_customers",
-                ownerids
-            }
-        }).then(res => {
-            for (let key in res.data) {
-                let index = list.findIndex(v => v.sys_enterpriseid == key);
-                list[index].tags = res.data[key]
-            };
-            this.setData({
-                list
-            })
-        })
-    },
-    /* 选中 */
-    changeResult(e) {
-        const {
-            id
-        } = e.currentTarget.dataset;
-        let result = this.data.result;
-        if (this.data.radio) {
-            result = [id];
-        } else {
-            if (result.some(v => v == id)) {
-                result = result.filter(v => v != id);
-            } else {
-                result.push(id)
-            };
-        }
-        this.setData({
-            result
-        })
-        if (this.data.radio) this.submit();
+	data: {
+		item: null,
+		result: [],
+		radio: true,
+		valueKey: 'sys_enterpriseid'
+	},
+	onLoad(options) {
+		/* 从表单组件进入进入 */
+		if (options.item) {
+			let item = JSON.parse(options.item);
+			this.setData({
+				item,
+				result: item.value.length ? item.value[1] : [],
+				params: item.params
+			})
+			if (item.params.valueKey) this.setData({
+				valueKey: item.params.valueKey
+			})
+		};
 
 
-    },
-    /* 开始搜索 */
-    startSearch({
-        detail
-    }) {
-        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
-        if (detail == condition) return;
-        this.setData({
-            'content.where.condition': detail,
-            'params.content.where.condition': detail
-        });
-        this.getList(true);
-    },
-    /* 取消搜索 */
-    onClear() {
-        this.setData({
-            'content.where.condition': "",
-            'params.content.where.condition': ""
-        });
-        this.getList(true);
-    },
-    onReady() {
-        getHeight.getHeight('.total', this).then(res => this.setData({
-            listHeight: res
-        }));
-    }
+		if (options.params) {
+			let params = JSON.parse(options.params)
+			this.setData({
+				params
+			});
+		}
+		this.setData({
+			radio: options.radio ? true : false
+		});
+		this.getList()
+	},
+	submit() {
+		let pages = getCurrentPages(),
+			item = this.data.item,
+			result = this.data.result,
+			list = result.map(v => this.data.list.find(value => value[this.data.valueKey] == v));
+		try {
+			if (item) {
+				let page = pages[pages.length - 2].selectComponent(item.model || "#Form");
+				item.value = this.data.radio ? [list[0].enterprisename, result] : [list.map(v => v.enterprisename), result];
+				page.handleRoute(item, list);
+			} else if (this.data.params.content.model) {
+				let page = pages[pages.length - 2].selectComponent(this.data.params.content.model);
+				page.handleSelectProject(this.data.result, list)
+			} else {
+				pages[pages.length - 2].handleSelectProject(this.data.result, list)
+			}
+		} catch (e) {
+			console.log(e)
+			wx.showToast({
+				title: '操作失败',
+				icon: "none"
+			})
+		}
+	},
+	getList(init = false) {
+		//init 用于初始化分页
+		if (init.detail != undefined) init = init.detail;
+		let params = this.data.params;
+		if (init) params.content.pageNumber = 1;
+		if (params.content.pageNumber > params.content.pageTotal) return;
+		_Http.basic(params).then(res => {
+			console.log("选择客户列表", res)
+			this.selectComponent('#ListBox').RefreshToComplete();
+			if (res.msg != '成功') return wx.showToast({
+				title: res.data,
+				icon: "none"
+			})
+			this.setData({
+				'params.content.pageNumber': res.pageNumber + 1,
+				'params.content.pageTotal': res.pageTotal,
+				'params.content.total': res.total,
+				list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+			})
+			this.getTags();
+		})
+	},
+	/* 获取列表标签 */
+	getTags() {
+		let list = this.data.list,
+			ownerids = list.map(v => v[this.data.valueKey])
+		_Http.basic({
+			"id": 20221018102001,
+			"content": {
+				"ownertable": "sa_customers",
+				ownerids
+			}
+		}).then(res => {
+			for (let key in res.data) {
+				let index = list.findIndex(v => v[this.data.valueKey] == key);
+				list[index].tags = res.data[key]
+			};
+			this.setData({
+				list
+			})
+		})
+	},
+	/* 选中 */
+	changeResult(e) {
+		const {
+			id
+		} = e.currentTarget.dataset;
+		let result = this.data.result;
+		if (this.data.radio) {
+			result = [id];
+		} else {
+			if (result.some(v => v == id)) {
+				result = result.filter(v => v != id);
+			} else {
+				result.push(id)
+			};
+		}
+		this.setData({
+			result
+		})
+		if (this.data.radio) this.submit();
+
+	},
+	/* 开始搜索 */
+	startSearch({
+		detail
+	}) {
+		let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
+		if (detail == condition) return;
+		this.setData({
+			'content.where.condition': detail,
+			'params.content.where.condition': detail
+		});
+		this.getList(true);
+	},
+	/* 取消搜索 */
+	onClear() {
+		this.setData({
+			'content.where.condition': "",
+			'params.content.where.condition': ""
+		});
+		this.getList(true);
+	},
+	onReady() {
+		getHeight.getHeight('.total', this).then(res => this.setData({
+			listHeight: res
+		}));
+	}
 })
 })

+ 2 - 2
packageA/select/setclient/select.wxml

@@ -1,7 +1,7 @@
 <van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
 <van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
 <My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
 <My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
     <view class="total">共{{params.content.total}}个</view>
     <view class="total">共{{params.content.total}}个</view>
-    <navigator class="setclient-list-item" url="#" wx:for="{{list}}" wx:key="item.sys_enterpriseid" data-id="{{item.sys_enterpriseid}}" bindtap="changeResult">
+    <navigator class="setclient-list-item" url="#" wx:for="{{list}}" wx:key="index" data-id="{{item[valueKey]}}" bindtap="changeResult">
         <view class="con">
         <view class="con">
             <view class="portrait {{item.enterprisename <=2?'min-portrait':''}}">
             <view class="portrait {{item.enterprisename <=2?'min-portrait':''}}">
                 {{handle.getName(item.enterprisename)}}
                 {{handle.getName(item.enterprisename)}}
@@ -15,7 +15,7 @@
                 </view>
                 </view>
             </view>
             </view>
             <view class="checkbox" wx:if="{{!radio}}">
             <view class="checkbox" wx:if="{{!radio}}">
-                <van-checkbox value='{{handle.isCheck(item.sys_enterpriseid,result)}}' />
+                <van-checkbox value='{{handle.isCheck(item[valueKey],result)}}' />
             </view>
             </view>
         </view>
         </view>
     </navigator>
     </navigator>

+ 0 - 2
pages/tags/index.js

@@ -91,12 +91,10 @@ Page({
                 title: res.data,
                 title: res.data,
                 icon: "none"
                 icon: "none"
             });
             });
-
             wx.showToast({
             wx.showToast({
                 title: '保存成功!',
                 title: '保存成功!',
                 icon: "none"
                 icon: "none"
             });
             });
-
             setTimeout(() => {
             setTimeout(() => {
                 getCurrentPages().forEach(v => {
                 getCurrentPages().forEach(v => {
                     if (v.getTags) v.getTags();
                     if (v.getTags) v.getTags();

+ 2 - 1
project.config.json

@@ -53,7 +53,8 @@
         "disableUseStrict": false,
         "disableUseStrict": false,
         "useCompilerPlugins": [
         "useCompilerPlugins": [
             "sass"
             "sass"
-        ]
+        ],
+        "condition": false
     },
     },
     "compileType": "miniprogram",
     "compileType": "miniprogram",
     "libVersion": "2.19.4",
     "libVersion": "2.19.4",

+ 28 - 0
project.private.config.json

@@ -119,6 +119,34 @@
                     "query": "",
                     "query": "",
                     "launchMode": "default",
                     "launchMode": "default",
                     "scene": null
                     "scene": null
+                },
+                {
+                    "name": "经销合同",
+                    "pathName": "packageA/contract/detail",
+                    "query": "sa_contractid=112",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "居间合同",
+                    "pathName": "packageA/contract/detail",
+                    "query": "sa_contractid=178",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "经销项目",
+                    "pathName": "packageA/contract/detail",
+                    "query": "sa_contractid=182",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "直销",
+                    "pathName": "packageA/contract/detail",
+                    "query": "sa_contractid=181",
+                    "launchMode": "default",
+                    "scene": null
                 }
                 }
             ]
             ]
         }
         }

+ 0 - 1
utils/Http.js

@@ -2,7 +2,6 @@
 const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
 const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
 // const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
 // const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
 
 
-
 let count = null;
 let count = null;
 class HTTP {
 class HTTP {
     request({
     request({