diff --git a/pages/home/customer-archive.vue b/pages/home/customer-archive.vue index 2d18c8d..25464bd 100644 --- a/pages/home/customer-archive.vue +++ b/pages/home/customer-archive.vue @@ -147,8 +147,7 @@ function toHealthList() { if (canAuth.value) { toast("请先授权本服务团队"); } else { - const name = `${current.value.name} ${current.value.relationship ? `(${current.value.relationship})` : "" - }`; + const name = `${current.value.name} ${current.value.relationship || ""}`; uni.navigateTo({ url: `/pages/health/list?teamId=${props.team.teamId}&corpId=${props.corpId }&id=${current.value._id}&name=${encodeURIComponent(name)}`, @@ -169,10 +168,12 @@ function toManagePage() { async function auth() { await confirm(`是否授权${props.team.name}提供服务`); + const corpUserId = await getResponsiblePerson(); const res = await api("authCustomerToTeam", { corpId: props.corpId, teamId: props.team.teamId, id: current.value._id, + corpUserId }); if (res && res.success) { await toast("授权成功"); @@ -203,6 +204,12 @@ async function getCustomers() { loading = false } +async function getResponsiblePerson() { + const corpUserId = props.corpUserIds && props.corpUserIds[props.team.teamId] ? props.corpUserIds[props.team.teamId] : ""; + const res = await api('getResponsiblePerson', { corpId: props.corpId, externalUserId: externalUserId.value, teamId: props.team.teamId, corpUserId }); + return res && res.data ? res.data : '' +} + onMounted(() => { uni.$on("reloadTeamCustomers", getCustomers); }); diff --git a/pages/survey/components/survey-question.vue b/pages/survey/components/survey-question.vue index 243e895..13d37be 100644 --- a/pages/survey/components/survey-question.vue +++ b/pages/survey/components/survey-question.vue @@ -57,7 +57,7 @@ + class="flex-shrink-0 mx-10 py-12 leading-normal text-white text-center rounded bg-primary" @click="submit()"> 提交