zhaoxiaohai 2 år sedan
förälder
incheckning
7ff2227451

+ 390 - 344
packageA/setclient/addAndEditor.js

@@ -1,348 +1,394 @@
 let _Http = getApp().globalData.http,
-    count = null;
+	count = null;
 
 Page({
-    data: {
-        showAll: false,
-        repetitionShow: false,
-        repetitionList: [],
-        isSubmit: false,
-        form: [{
-            label: "企业名称",
-            error: false,
-            errMsg: "",
-            type: "textarea",
-            value: "",
-            placeholder: "企业全称",
-            valueName: "enterprisename",
-            checking: "base",
-            slot: "info",
-            required: true
-        }, {
-            label: "客户类型",
-            error: false,
-            errMsg: "",
-            type: "option",
-            optionNmae: "customertypemx",
-            optionType: "radio", //复选   radio 单选
-            value: "",
-            placeholder: "客户类型",
-            valueName: "type",
-            checking: "base",
-            required: true
-        }, {
-            label: "客户级别",
-            error: false,
-            errMsg: "",
-            type: "option",
-            optionNmae: "agentgrade",
-            optionType: "radio", //复选   radio 单选
-            value: "",
-            placeholder: "客户数字级别",
-            valueName: "grade",
-            checking: "base",
-            required: false
-        }, {
-            label: "企业简称",
-            error: false,
-            errMsg: "",
-            type: "textarea",
-            value: "",
-            placeholder: "企业简称",
-            valueName: "abbreviation",
-            checking: "base",
-            required: false
-        }, {
-            label: "统一社会信用代码",
-            error: false,
-            errMsg: "",
-            type: "textarea",
-            value: "",
-            placeholder: "企业税号/注册号/营业执照号码",
-            valueName: "taxno",
-            checking: "base",
-            required: false
-        }, {
-            label: "法定代表人",
-            error: false,
-            errMsg: "",
-            type: "text",
-            value: "",
-            placeholder: "企业法人",
-            valueName: "contact",
-            checking: "base",
-            required: false
-        }, {
-            label: "所属行业",
-            error: false,
-            errMsg: "",
-            type: "option", //自定义选择  配合预定接口
-            optionNmae: "industry", //选择类型
-            optionType: "radio", //复选   radio 单选
-            value: "",
-            placeholder: "企业所属行业",
-            valueName: "industry",
-            checking: "base",
-            required: false
-        }, {
-            label: "省市县",
-            error: false,
-            errMsg: "",
-            type: "region",
-            value: [],
-            placeholder: "省/市/县",
-            valueName: "region",
-            required: false
-        }, {
-            label: "企业地址",
-            error: false,
-            errMsg: "",
-            type: "textarea",
-            value: "",
-            placeholder: "企业所在地址",
-            valueName: "address",
-            checking: "base",
-            required: false
-        }],
-        content: {
-            "sa_customersid": 0, //新增是传0
-            "parentid": 0, //上级客户ID,默认或没有上级的时候传0
-            "sys_enterpriseid": 0, //合作企业档案ID,新增是传0,更新
-            "sa_customerpoolid": 0, //客户池(公海池)ID,默认或没有的时候传0
-            "source": "", //客户来源
-            ispublic: 0, //是否为公海客户
-        },
-        disabled: true,
-        countDown: "", //查重倒计时
-    },
-    queryClient() {
-        let data = this.selectComponent("#Form").query();
-        if (data.enterprisename == '') {
-            wx.showToast({
-                title: `您还未填写企业名称`,
-                icon: "none"
-            });
-        } else {
-            this.setData({
-                form: this.selectComponent("#Form").data.form,
-            })
-            this.selectComponent("#Info").queryClient(data.enterprisename)
-        }
-    },
-    /* 工商查询 */
-    introduce({
-        detail
-    }) {
-        let item = detail;
-        let data = {
-            enterprisename: item.companyName, //企业名称
-            taxno: item.taxNum, //税号
-            contact: item.legalPerson, //法人
-            region: [item.regProvince, item.regCity, item.regArea], //地区
-            address: item.address, //地区
-        }
-        this.setData({
-            form: this.data.form.map(v => {
-                if (data[v.valueName]) v.value = data[v.valueName];
-                return v
-            })
-        })
-    },
-    setOption(item) {
-        let i = this.data.form.findIndex(v => v.valueName == item.valueName);
-        this.setData({
-            [`form[${i}]`]: item
-        })
-    },
-    onLoad(options) {
-        if (options.data) {
-            let data = JSON.parse(options.data);
-            this.setData({
-                disabled: false,
-                content: {
-                    sa_customersid: data.sa_customersid,
-                    parentid: data.parentid,
-                    sys_enterpriseid: data.sys_enterpriseid,
-                    sa_customerpoolid: data.sa_customerpoolid,
-                    source: data.source,
-                },
-                form: this.data.form.map(v => {
-                    if (v.valueName != 'region') {
-                        v.value = data[v.valueName];
-                    } else {
-                        v.value = data.province ? [data.province, data.city, data.county] : []
-                    }
-                    return v
-                })
-            })
-        }
-    },
-    repClose() {
-        if (this.data.isSubmit) {
-            let that = this;
-            wx.showModal({
-                title: '提示',
-                content: `是否继续创建客户`,
-                complete: (res) => {
-                    if (res.confirm) that.handleSubmit(true);
-                }
-            })
-        }
-        this.setData({
-            repetitionShow: false,
-            isSubmit: false
-        })
-    },
-    /* 表单必填项是否完成 */
-    onConfirm({
-        detail
-    }) {
-        this.setData({
-            disabled: detail
-        })
-    },
-    // 是否显示全部
-    onChange({
-        detail
-    }) {
-        this.setData({
-            showAll: detail
-        })
-    },
-    /* 查询是否重复 */
-    async queryRepetition(e) {
-        let {
-            enterprisename,
-            taxno,
-            address
-        } = this.selectComponent("#Form").query();
-        if (enterprisename == '') return wx.showToast({
-            title: `您还未填写企业名称`,
-            icon: "none"
-        });
-        let res = await this.handleQueryRepetition({
-            sa_customersid: this.data.content.sa_customersid,
-            enterprisename,
-            taxno,
-            address
-        });
-        console.log("查询重复", res)
-        if (res.msg != '成功') return wx.showToast({
-            title: res.msg,
-            icon: "none"
-        });
-        this.setData({
-            countDown: 6
-        });
-        count = setInterval(() => {
-            let countDown = this.data.countDown;
-            if (countDown == 0) {
-                clearInterval(count);
-                this.setData({
-                    countDown: ""
-                })
-            } else {
-                countDown--;
-                this.setData({
-                    countDown
-                })
-            }
-        }, 1000)
-        if (res.total == 0) {
-            wx.showToast({
-                title: '未查询到疑似重复的客户信息',
-                icon: "none"
-            })
-        } else {
-            wx.showToast({
-                title: `查询到${res.total}条疑似重复客户信息`,
-                icon: "none"
-            })
-            this.setData({
-                repetitionShow: true,
-                repetitionList: res.data
-            })
-        }
-    },
-    /* 处理查重 */
-    handleQueryRepetition(content) {
-        return _Http.basic({
-            "id": 20221208172002,
-            content
-        })
-    },
-    async submit() {
-        let data = this.selectComponent("#Form").submit();
-        let query = await this.handleQueryRepetition({
-            sa_customersid: this.data.content.sa_customersid,
-            enterprisename: data.enterprisename,
-            taxno: data.taxno,
-            address: data.address
-        });
-        if (query.total != 0) {
-            wx.showToast({
-                title: `查询到${query.total}条疑似重复客户信息`,
-                icon: "none"
-            })
-            this.setData({
-                repetitionShow: true,
-                repetitionList: query.data,
-                isSubmit: true
-            })
-        } else {
-            this.handleSubmit();
-        }
-    },
-    handleSubmit(tag = false) {
-        let data = this.selectComponent("#Form").submit();
-        if (data.region.length != 0) {
-            data.province = data.region[0]
-            data.city = data.region[1]
-            data.county = data.region[2]
-        };
-        delete(data.region);
-        _Http.basic({
-            "id": 20221012163902,
-            "content": {
-                ...this.data.content,
-                ...data,
-            }
-        }).then(res => {
-            console.log("新建客户", res)
-            if (res.msg != '成功') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            })
-            wx.showToast({
-                title: '保存成功',
-                icon: "none"
-            })
-            //绑定疑似重复标签
-            if (tag) _Http.basic({
-                "id": 20220929090901,
-                "content": {
-                    "ownertable": "sa_customers",
-                    "ownerid": res.data.sa_customersid,
-                    "datatag": ["疑似重复"]
-                }
-            })
-            setTimeout(() => {
-                getCurrentPages().forEach(v => {
-                    switch (v.__route__) {
-                        case 'packageA/setclient/index':
-                            v.getList(true);
-                            break;
-                        case 'packageA/setclient/detail':
-                            v.getDetail();
-                            wx.navigateBack()
-                            break;
-                    }
-                })
-                let pages = getCurrentPages();
-                if (pages[pages.length - 2].__route__ == 'packageA/setclient/index') wx.redirectTo({
-                    url: '/packageA/setclient/detail?id=' + res.data.sa_customersid,
-                })
-            }, tag ? 500 : 300)
-        })
-    },
+	data: {
+		showAll: false,
+		repetitionShow: false,
+		repetitionList: [],
+		isSubmit: false,
+		form: [{
+			label: "客户名称",
+			error: false,
+			errMsg: "",
+			type: "textarea",
+			value: "",
+			placeholder: "企业全称",
+			valueName: "enterprisename",
+			checking: "base",
+			slot: "info",
+			required: true
+		}, {
+			label: "客户类型",
+			error: false,
+			errMsg: "",
+			type: "option",
+			optionNmae: "customertypemx",
+			optionType: "radio", //复选   radio 单选
+			value: "",
+			placeholder: "客户类型",
+			valueName: "type",
+			checking: "base",
+			required: true
+		}, {
+			label: "客户来源",
+			error: false,
+			errMsg: "",
+			type: "textarea",
+			value: "",
+			placeholder: "客户来源",
+			valueName: "source",
+			checking: "base",
+			required: false
+		}, {
+			label: "客户等级",
+			error: false,
+			errMsg: "",
+			type: "option",
+			optionNmae: "agentgrade",
+			optionType: "radio", //复选   radio 单选
+			value: "",
+			placeholder: "客户等级",
+			valueName: "grade",
+			checking: "base",
+			required: false
+		}, {
+			label: "企业简称",
+			error: false,
+			errMsg: "",
+			type: "textarea",
+			value: "",
+			placeholder: "企业简称",
+			valueName: "abbreviation",
+			checking: "base",
+			required: false
+		}, {
+			label: "企业税号",
+			error: false,
+			errMsg: "",
+			type: "textarea",
+			value: "",
+			placeholder: "企业税号",
+			valueName: "taxno",
+			checking: "base",
+			required: false
+		}, {
+			label: "法人",
+			error: false,
+			errMsg: "",
+			type: "text",
+			value: "",
+			placeholder: "企业法人",
+			valueName: "contact",
+			checking: "base",
+			required: false
+		}, {
+			label: "所属行业",
+			error: false,
+			errMsg: "",
+			type: "option", //自定义选择  配合预定接口
+			optionNmae: "industry", //选择类型
+			optionType: "radio", //复选   radio 单选
+			value: "",
+			placeholder: "企业所属行业",
+			valueName: "industry",
+			checking: "base",
+			required: false
+		}, {
+			label: "省市县",
+			error: false,
+			errMsg: "",
+			type: "region",
+			value: [],
+			placeholder: "省/市/县",
+			valueName: "region",
+			required: false
+		}, {
+			label: "企业地址",
+			error: false,
+			errMsg: "",
+			type: "textarea",
+			value: "",
+			placeholder: "企业所在地址",
+			valueName: "address",
+			checking: "base",
+			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: {
+			"sa_customersid": 0, //新增是传0
+			"parentid": 0, //上级客户ID,默认或没有上级的时候传0
+			"sys_enterpriseid": 0, //合作企业档案ID,新增是传0,更新
+			"sa_customerpoolid": 0, //客户池(公海池)ID,默认或没有的时候传0
+			"source": "", //客户来源
+			ispublic: 0, //是否为公海客户
+		},
+		disabled: true,
+		countDown: "", //查重倒计时
+	},
+	queryClient() {
+		let data = this.selectComponent("#Form").query();
+		if (data.enterprisename == '') {
+			wx.showToast({
+				title: `您还未填写企业名称`,
+				icon: "none"
+			});
+		} else {
+			this.setData({
+				form: this.selectComponent("#Form").data.form,
+			})
+			this.selectComponent("#Info").queryClient(data.enterprisename)
+		}
+	},
+	/* 工商查询 */
+	introduce({
+		detail
+	}) {
+		let item = detail;
+		let data = {
+			enterprisename: item.companyName, //企业名称
+			taxno: item.taxNum, //税号
+			contact: item.legalPerson, //法人
+			region: [item.regProvince, item.regCity, item.regArea], //地区
+			address: item.address, //地区
+		}
+		this.setData({
+			form: this.data.form.map(v => {
+				if (data[v.valueName]) v.value = data[v.valueName];
+				return v
+			})
+		})
+	},
+	setOption(item) {
+		let i = this.data.form.findIndex(v => v.valueName == item.valueName);
+		this.setData({
+			[`form[${i}]`]: item
+		})
+	},
+	onLoad(options) {
+		if (options.data) {
+			let data = JSON.parse(options.data);
+			this.setData({
+				disabled: false,
+				content: {
+					sa_customersid: data.sa_customersid,
+					parentid: data.parentid,
+					sys_enterpriseid: data.sys_enterpriseid,
+					sa_customerpoolid: data.sa_customerpoolid,
+					source: data.source,
+				},
+				form: this.data.form.map(v => {
+					if (v.valueName != 'region') {
+						v.value = data[v.valueName];
+					} else {
+						v.value = data.province ? [data.province, data.city, data.county] : []
+					}
+					return v
+				})
+			})
+		}
+	},
+	repClose() {
+		if (this.data.isSubmit) {
+			let that = this;
+			wx.showModal({
+				title: '提示',
+				content: `是否继续创建客户`,
+				complete: (res) => {
+					if (res.confirm) that.handleSubmit(true);
+				}
+			})
+		}
+		this.setData({
+			repetitionShow: false,
+			isSubmit: false
+		})
+	},
+	/* 表单必填项是否完成 */
+	onConfirm({
+		detail
+	}) {
+		this.setData({
+			disabled: detail
+		})
+	},
+	// 是否显示全部
+	onChange({
+		detail
+	}) {
+		this.setData({
+			showAll: detail
+		})
+	},
+	/* 查询是否重复 */
+	async queryRepetition(e) {
+		let {
+			enterprisename,
+			taxno,
+			address
+		} = this.selectComponent("#Form").query();
+		if (enterprisename == '') return wx.showToast({
+			title: `您还未填写企业名称`,
+			icon: "none"
+		});
+		let res = await this.handleQueryRepetition({
+			sa_customersid: this.data.content.sa_customersid,
+			enterprisename,
+			taxno,
+			address
+		});
+		console.log("查询重复", res)
+		if (res.msg != '成功') return wx.showToast({
+			title: res.msg,
+			icon: "none"
+		});
+		this.setData({
+			countDown: 6
+		});
+		count = setInterval(() => {
+			let countDown = this.data.countDown;
+			if (countDown == 0) {
+				clearInterval(count);
+				this.setData({
+					countDown: ""
+				})
+			} else {
+				countDown--;
+				this.setData({
+					countDown
+				})
+			}
+		}, 1000)
+		if (res.total == 0) {
+			wx.showToast({
+				title: '未查询到疑似重复的客户信息',
+				icon: "none"
+			})
+		} else {
+			wx.showToast({
+				title: `查询到${res.total}条疑似重复客户信息`,
+				icon: "none"
+			})
+			this.setData({
+				repetitionShow: true,
+				repetitionList: res.data
+			})
+		}
+	},
+	/* 处理查重 */
+	handleQueryRepetition(content) {
+		return _Http.basic({
+			"id": 20221208172002,
+			content
+		})
+	},
+	async submit() {
+		let data = this.selectComponent("#Form").submit();
+		let query = await this.handleQueryRepetition({
+			sa_customersid: this.data.content.sa_customersid,
+			enterprisename: data.enterprisename,
+			taxno: data.taxno,
+			address: data.address
+		});
+		if (query.total != 0) {
+			wx.showToast({
+				title: `查询到${query.total}条疑似重复客户信息`,
+				icon: "none"
+			})
+			this.setData({
+				repetitionShow: true,
+				repetitionList: query.data,
+				isSubmit: true
+			})
+		} else {
+			this.handleSubmit();
+		}
+	},
+	handleSubmit(tag = false) {
+		let data = this.selectComponent("#Form").submit();
+		if (data.region.length != 0) {
+			data.province = data.region[0]
+			data.city = data.region[1]
+			data.county = data.region[2]
+		};
+		if (data.parentid) data.parentid = data.parentid[1][0]
+		delete(data.region);
+		_Http.basic({
+			"id": 20221012163902,
+			"content": {
+				...this.data.content,
+				...data,
+			}
+		}).then(res => {
+			console.log("新建客户", res)
+			if (res.msg != '成功') return wx.showToast({
+				title: res.data,
+				icon: "none"
+			})
+			wx.showToast({
+				title: '保存成功',
+				icon: "none"
+			})
+			//绑定疑似重复标签
+			if (tag) _Http.basic({
+				"id": 20220929090901,
+				"content": {
+					"ownertable": "sa_customers",
+					"ownerid": res.data.sa_customersid,
+					"datatag": ["疑似重复"]
+				}
+			})
+			setTimeout(() => {
+				getCurrentPages().forEach(v => {
+					switch (v.__route__) {
+						case 'packageA/setclient/index':
+							v.getList(true);
+							break;
+						case 'packageA/setclient/detail':
+							v.getDetail();
+							wx.navigateBack()
+							break;
+					}
+				})
+				let pages = getCurrentPages();
+				if (pages[pages.length - 2].__route__ == 'packageA/setclient/index') wx.redirectTo({
+					url: '/packageA/setclient/detail?id=' + res.data.sa_customersid,
+				})
+			}, tag ? 500 : 300)
+		})
+	},
 })

+ 1 - 1
packageA/setclient/addAndEditor.json

@@ -2,5 +2,5 @@
     "usingComponents": {
         "information": "./modules/information/index"
     },
-    "navigationBarTitleText": "编辑客户"
+    "navigationBarTitleText": "设置客户"
 }

+ 429 - 428
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,346 +112,347 @@ Page({
                             }
                         }
                     })}`,
-                })
-                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.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: "作废"
-                    }].concat(tabbarList);
-                    if (isLeader && res.data.ispublic == 1) tabbarList = tabbarList.concat([{
-                        icon: "icon-dibu-fenxiang",
-                        label: "分享"
-                    }, {
-                        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() {}
+				})
+				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);
+					if (isLeader && res.data.ispublic == 1) tabbarList = tabbarList.concat([{
+						icon: "icon-dibu-fenxiang",
+						label: "分享"
+					}, {
+						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() {}
 })

+ 1 - 1
packageA/setclient/index.js

@@ -23,7 +23,7 @@ Page({
         }],
         content: {
             nocache: true,
-            "type": 0,
+            "type": 1,
             deleted: 0,
             "pageNumber": 1,
             "pageSize": 20,

+ 82 - 41
packageA/setclient/modules/address/add/index.js

@@ -56,7 +56,8 @@ Page({
             "workaddress": 1,
             "isdefault": 0, //是否默认地址
             "isprimary": 0 //是否为主地址
-        }
+        },
+        tags: []
     },
     onLoad(options) {
         if (options.sys_enterpriseid) this.setData({
@@ -70,14 +71,40 @@ Page({
                     ...item
                 },
                 "content.isdefault": item.isdefault,
-                'form[0].value': item.name,
-                'form[1].value': item.phonenumber,
-                'form[2].value': [item.province, item.city, item.county],
-                'form[3].value': item.address,
+                'form[0].value': [item.province, item.city, item.county],
+                'form[1].value': item.address,
+                tags: item.tag,
                 'content.isdefault': item.isdefault,
                 "disabled": false
             })
         };
+        _Http.basic({
+            "id": 20220929085401,
+            "content": {
+                "ownertable": "sys_enterprise_contacts",
+                "ownerid": 0
+            }
+        }).then(res => {
+            console.log("数据标签", res)
+            this.setData({
+                tagList: res.data.option
+            })
+        })
+    },
+    selectTag(e) {
+        const {
+            tag
+        } = e.currentTarget.dataset.item;
+        let i = this.data.tags.findIndex(v => tag == v);
+        if (i == -1) {
+            this.data.tags.push(tag);
+        } else {
+            this.data.tags.splice(i, 1)
+        };
+        this.setData({
+            tags: this.data.tags
+        })
+
     },
     /* 提交数据 */
     submit() {
@@ -100,42 +127,56 @@ Page({
                 title: res.data,
                 icon: "none"
             });
-            wx.showToast({
-                title: '保存成功',
-                icon: "none"
-            });
-            setTimeout(() => {
-                getCurrentPages().forEach(v => {
-                    //更新列表
-                    if (v.selectComponent("#Address")) {
-                        let page = v.selectComponent("#Address"),
-                            list = res.data.isdefault == 0 ? page.data.list : page.data.list.map(v => {
-                                v.isdefault = 0;
-                                return v;
-                            }),
-                            index = list.findIndex(value => value.contactsid == res.data.contactsid);
-                        if (index != -1) {
-                            //列表中存在说明是编辑,返回上一级页面并更新数据
-                            list[index] = res.data;
-                            page.setData({
-                                list
-                            });
-                        } else {
-                            //列表中不存在说明是新增,返回上一级页面更新数据 并进入详情
-                            list.push(res.data);
-                            page.setData({
-                                list,
-                                "content.total": page.data.content.total + 1
-                            });
-                        }
-                        if (res.data.isdefault == 1) setTimeout(() => {
-                            page.selectComponent("#List").initRadio();
-                        }, 200)
-                        wx.navigateBack();
-                    };
-                    if ("packageA/setclient/modules/address/search/index" == v.__route__) v.getList(true);
-                })
-            }, 300)
+            _Http.basic({
+                "id": 20220929090901,
+                "content": {
+                    "ownertable": "sys_enterprise_contacts",
+                    "ownerid": res.data.contactsid,
+                    "datatag": this.data.tags
+                }
+            }).then(s => {
+                console.log("设置地址标签", s)
+                wx.showToast({
+                    title: '保存成功',
+                    icon: "none"
+                });
+                res.data.tag = this.data.tags;
+                setTimeout(() => {
+                    getCurrentPages().forEach(v => {
+                        //更新列表
+                        if (v.selectComponent("#Address")) {
+                            let page = v.selectComponent("#Address"),
+                                list = res.data.isdefault == 0 ? page.data.list : page.data.list.map(v => {
+                                    v.isdefault = 0;
+                                    return v;
+                                }),
+                                index = list.findIndex(value => value.contactsid == res.data.contactsid);
+                            if (index != -1) {
+                                //列表中存在说明是编辑,返回上一级页面并更新数据
+                                list[index] = res.data;
+                                page.setData({
+                                    list
+                                });
+                            } else {
+                                //列表中不存在说明是新增,返回上一级页面更新数据 并进入详情
+                                list.push(res.data);
+                                page.setData({
+                                    list,
+                                    "content.total": page.data.content.total + 1
+                                });
+                            }
+                            if (res.data.isdefault == 1) setTimeout(() => {
+                                page.selectComponent("#List").initRadio();
+                            }, 200)
+                            wx.navigateBack();
+                        };
+                        if ("packageA/setclient/modules/address/search/index" == v.__route__) v.getList(true);
+                    })
+                }, 300)
+            })
+
+
+
         })
     },
     /* 设置默认 */

+ 34 - 0
packageA/setclient/modules/address/add/index.scss

@@ -1,3 +1,37 @@
+.types {
+    background-color: #fff;
+    padding: 20rpx 30rpx;
+    box-sizing: border-box;
+    display: flex;
+
+    .title {
+        width: 200rpx;
+        font-size: 28rpx;
+        color: #666;
+        flex-shrink: 0;
+    }
+
+    .tags {
+        display: flex;
+        flex-wrap: wrap;
+
+        .tag {
+            padding: 8rpx 15rpx;
+            border-radius: 16rpx;
+            border: 1rpx solid #ddd;
+            font-size: 26rpx;
+            margin-right: 15rpx;
+            margin-bottom: 15rpx;
+            color: #999;
+        }
+
+        .active {
+            color: var(--assist);
+            border-color: var(--assist) ;
+        }
+    }
+}
+
 .radio-box {
     display: flex;
     padding-left: 20rpx;

+ 11 - 1
packageA/setclient/modules/address/add/index.wxml

@@ -1,8 +1,18 @@
 <Yl_field id='Form' form="{{form}}" bind:onConfirm='onConfirm' />
+
+<view class="types">
+    <view class="title">地址类型</view>
+
+    <view class="tags">
+        <view class="tag {{pre.query(tags,item.tag)?'active':''}}" wx:for="{{tagList}}" wx:key="sys_systemtagdetailid" data-item="{{item}}" bindtap="selectTag">{{item.tag}}</view>
+    </view>
+</view>
 <view class="radio-box">
     <van-checkbox icon-size='14' label-class='radio' value="{{ content.isdefault == 1 }}" bind:change="checkboxChange">设置为默认地址</van-checkbox>
 </view>
 
 <view class="footer">
     <van-button custom-class='but' disabled='{{disabled}}' bindtap="submit">保存</van-button>
-</view>
+</view>
+
+<wxs src="../../../../../utils/wxmlQueryPer.wxs" module="pre" />

+ 24 - 1
packageA/setclient/modules/address/index.js

@@ -52,13 +52,36 @@ Component({
                     "content.total": res.total,
                     sys_enterpriseid: id
                 })
+                this.getTags();
                 setTimeout(() => {
                     this.selectComponent("#List").initRadio();
                 }, 300)
 
             })
         },
-
+        /* 获取列表标签 */
+        getTags() {
+            let list = this.data.list,
+                ownerids = list.map(v => v.contactsid);
+            _Http.basic({
+                "id": 20221018102001,
+                "content": {
+                    nocache: true,
+                    "ownertable": "sys_enterprise_contacts",
+                    ownerids
+                }
+            }).then(res => {
+                console.log("地址标签", res)
+                for (let key in res.data) {
+                    let index = list.findIndex(v => v.contactsid == key);
+                    list[index].tags = res.data[key]
+                };
+                this.setData({
+                    list
+                })
+                console.log(list)
+            })
+        },
         toSearch() {
             wx.navigateTo({
                 url: '/packageA/setclient/modules/address/search/index?perams=' + JSON.stringify({

+ 21 - 0
packageA/setclient/modules/address/list/index.scss

@@ -19,6 +19,27 @@
             padding-right: 30rpx;
         }
 
+        .tags {
+            display: flex;
+            font-size: 24rpx;
+            flex-wrap: wrap;
+
+            .tag {
+                flex-shrink: 0;
+                margin-top: 6rpx;
+                background: #FAAB16;
+                color: #ffffff;
+                margin-right: 10rpx;
+                display: flex;
+                align-items: center;
+                height: 40rpx;
+                font-size: 20rpx;
+                padding: 0 10rpx;
+                border-radius: 20rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+            }
+        }
+
         .detail-add {
             font-size: 24rpx;
             font-family: PingFang SC-Regular, PingFang SC;

+ 3 - 3
packageA/setclient/modules/address/list/index.wxml

@@ -4,9 +4,9 @@
             <view class="label">
                 <text class="iconfont icon-a-wodemendianxinxidizhi" style="color: #3874F6;" /> {{item.province + item.city + item.county + item.address}}
             </view>
-      <!--       <view class="detail-add">
-                {{item.name}}:{{item.phonenumber}}
-            </view> -->
+            <view class="tags">
+                <view class="tag" wx:for="{{item.tag}}" wx:key="index">{{item}}</view>
+            </view>
         </view>
         <view class="editor">
             <van-radio icon-size='14' label-class='radio' name="{{item.contactsid}}">默认收货地址</van-radio>

+ 5 - 1
packageA/setclient/modules/contacts/index.js

@@ -1,7 +1,11 @@
 const _Http = getApp().globalData.http;
 Component({
     properties: {
-        disabled: Boolean
+        disabled: Boolean,
+        path: {
+            type: String,
+            value: ""
+        }
     },
     data: {
         list: [],

+ 1 - 1
packageA/setclient/modules/contacts/index.wxml

@@ -6,7 +6,7 @@
         <navigator url="#" class="but" bindtap="toSearch">
             <van-icon name="search" />
         </navigator>
-        <navigator wx:if="{{disabled}}" url="/packageA/setclient/modules/contacts/quickly/index?sys_enterpriseid={{sys_enterpriseid}}" class="but">
+        <navigator wx:if="{{disabled}}" url="{{path+'?sys_enterpriseid='+sys_enterpriseid||'/packageA/setclient/modules/contacts/quickly/index?sys_enterpriseid='+sys_enterpriseid}}" class="but">
             <van-icon name="plus" />
         </navigator>
     </view>

+ 1 - 0
packageA/setclient/modules/trace/index.js

@@ -10,6 +10,7 @@ Component({
 
     data: {
         content: {
+            nocache: true,
             pageNumber: 1,
             pageSize: 10,
             pageTotal: 1,