fix: 问题修复
This commit is contained in:
parent
76a7bcbb19
commit
375d4a7a01
@ -1,4 +1,5 @@
|
||||
MP_API_BASE_URL=https://patient.youcan365.com
|
||||
MP_CACHE_PREFIX=development
|
||||
MP_WX_APP_ID=wx6ee11733526b4f04
|
||||
MP_SHARE_WX_APP_VERSION=2
|
||||
MP_TIM_SDK_APP_ID=1600126296
|
||||
@ -58,13 +58,14 @@ const { useLoad, useShow } = useGuard();
|
||||
const { account } = storeToRefs(useAccount());
|
||||
const corpId = ref('');
|
||||
const teamId = ref('');
|
||||
const corpUserId = ref('')
|
||||
const corpUserId = ref('');
|
||||
const referenceCustomerId = ref('');
|
||||
const enableHis = ref(false);
|
||||
const customers = ref([]);
|
||||
|
||||
function addArchive() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/archive/edit-archive?corpUserId=${corpUserId.value}&teamId=${teamId.value}&corpId=${corpId.value}`
|
||||
url: `/pages/archive/edit-archive?corpUserId=${corpUserId.value}&referenceCustomerId=${referenceCustomerId.value}&teamId=${teamId.value}&corpId=${corpId.value}`
|
||||
})
|
||||
}
|
||||
|
||||
@ -98,6 +99,7 @@ useLoad(options => {
|
||||
teamId.value = options.teamId;
|
||||
corpId.value = options.corpId;
|
||||
corpUserId.value = options.corpUserId;
|
||||
referenceCustomerId.value = options.referenceCustomerId || '';
|
||||
})
|
||||
|
||||
useShow(() => {
|
||||
|
||||
@ -44,6 +44,7 @@ const { getExternalUserId } = useAccount()
|
||||
const corpId = ref('');
|
||||
const corpName = ref('');
|
||||
const corpUserId = ref('');
|
||||
const referenceCustomerId = ref('');
|
||||
const customer = ref({});
|
||||
const customerId = ref('');
|
||||
const customers = ref([]);
|
||||
@ -55,6 +56,7 @@ const teamId = ref('');
|
||||
const tempRef = ref(null);
|
||||
const verifyVisible = ref(false);
|
||||
const visible = ref(false);
|
||||
const referenceCustomer = ref(null)
|
||||
|
||||
const formData = computed(() => {
|
||||
return { ...customer.value, ...form.value, mobile: account.value?.mobile }
|
||||
@ -147,6 +149,15 @@ async function addArchive() {
|
||||
params.personResponsibles = [{ corpUserId, teamId: teamId.value }]
|
||||
}
|
||||
}
|
||||
if (referenceCustomerId.value && !referenceCustomer.value) {
|
||||
await getReferenceCustomer();
|
||||
}
|
||||
if (referenceCustomer.value) {
|
||||
params.referenceCustomerId = referenceCustomer.value._id;
|
||||
params.referenceUserId = '';
|
||||
params.reference = referenceCustomer.value.name;
|
||||
params.referenceType = '客户';
|
||||
}
|
||||
loading.value = false;
|
||||
const res = await api('addCustomer', { params });
|
||||
if (res && res.success) {
|
||||
@ -226,7 +237,7 @@ async function getBaseForm() {
|
||||
}
|
||||
|
||||
async function getCustomer() {
|
||||
const res = await api('getCustomerByCustomerId', { customerId: customerId.value });
|
||||
const res = await api('getRefrencePeople', { customerId: customerId.value });
|
||||
if (res && res.success && res.data) {
|
||||
customer.value = res.data;
|
||||
setDisabledTitles(res.data)
|
||||
@ -264,27 +275,25 @@ async function unBindArchive() {
|
||||
}
|
||||
}
|
||||
|
||||
// async updateCustomer() {
|
||||
// if (Object.keys(this.form).length === 0) return this.editMemberId;
|
||||
// const { success, message } = await updateCustomer(
|
||||
// this.editMemberId,
|
||||
// this.form
|
||||
// );
|
||||
// if (success) return this.editMemberId;
|
||||
// this.widget.hideLoading();
|
||||
// this.widget.toast(message);
|
||||
// return Promise.reject();
|
||||
// },
|
||||
async function getReferenceCustomer() {
|
||||
const res = await api('getRefrencePeople', { corpId: corpId.value, id: referenceCustomerId.value });
|
||||
referenceCustomer.value = res && res.data ? res.data : null;
|
||||
}
|
||||
|
||||
|
||||
onLoad(options => {
|
||||
teamId.value = options.teamId;
|
||||
corpId.value = options.corpId;
|
||||
customerId.value = options.id || '';
|
||||
corpUserId.value = options.corpUserId || '';
|
||||
referenceCustomerId.value = options.referenceCustomerId || '';
|
||||
if (referenceCustomerId.value) {
|
||||
getReferenceCustomer();
|
||||
}
|
||||
uni.setNavigationBarTitle({ title: customerId.value ? '编辑档案' : '新增档案' })
|
||||
})
|
||||
|
||||
useLoad(options => {
|
||||
teamId.value = options.teamId;
|
||||
corpId.value = options.corpId;
|
||||
init();
|
||||
})
|
||||
|
||||
|
||||
@ -86,6 +86,10 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
referenceCustomerIds: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
customers: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
@ -162,8 +166,9 @@ function toggle(i) {
|
||||
|
||||
function toManagePage() {
|
||||
const corpUserId = props.corpUserIds && props.corpUserIds[props.team.teamId] ? props.corpUserIds[props.team.teamId] : "";
|
||||
const referenceCustomerId = props.referenceCustomerIds && props.referenceCustomerIds[props.team.teamId] ? props.referenceCustomerIds[props.team.teamId] : "";
|
||||
uni.navigateTo({
|
||||
url: `/pages/archive/archive-manage?corpUserId=${corpUserId}&corpId=${props.corpId}&teamId=${props.team.teamId}`,
|
||||
url: `/pages/archive/archive-manage?corpUserId=${corpUserId}&corpId=${props.corpId}&teamId=${props.team.teamId}&referenceCustomerId=${referenceCustomerId}`,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<team-head :team="team" :teams="teams" @changeTeam="changeTeam" />
|
||||
<!-- </template> -->
|
||||
<view class="home-section home-section--first">
|
||||
<customer-archive ref="archiveRef" :corpId="corpId" :corpUserIds="corpUserIds" :team="team"
|
||||
@update:customers="handleCustomersUpdate" />
|
||||
<customer-archive ref="archiveRef" :corpId="corpId" :corpUserIds="corpUserIds"
|
||||
:referenceCustomerIds="referenceCustomerIds" :team="team" @update:customers="handleCustomersUpdate" />
|
||||
</view>
|
||||
<view class="home-section">
|
||||
<team-guide :team="team" />
|
||||
@ -26,7 +26,7 @@
|
||||
<script setup>
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { onLoad, onShow, onShareAppMessage } from "@dcloudio/uni-app";
|
||||
// import useGuard from "@/hooks/useGuard";
|
||||
import useAccount from "@/store/account";
|
||||
import api from "@/utils/api";
|
||||
@ -46,6 +46,7 @@ import pageLoading from "./loading.vue";
|
||||
// const { useLoad, useShow } = useGuard();
|
||||
const { account } = storeToRefs(useAccount());
|
||||
const { login, getTeams } = useAccount();
|
||||
const shareAppVersion = env.MP_SHARE_WX_APP_VERSION;
|
||||
|
||||
const team = ref(null);
|
||||
const teams = ref([]);
|
||||
@ -54,6 +55,7 @@ const customers = ref([]);
|
||||
const consultRef = ref(null);
|
||||
const archiveRef = ref(null);
|
||||
const corpUserIds = ref({});
|
||||
const referenceCustomerIds = ref({});
|
||||
|
||||
const corpId = computed(() => team.value?.corpId);
|
||||
|
||||
@ -108,6 +110,9 @@ onShow(async () => {
|
||||
if (inviteTeam && inviteTeam.teamId && inviteTeam.corpUserId) {
|
||||
corpUserIds.value[inviteTeam.teamId] = inviteTeam.corpUserId;
|
||||
}
|
||||
if (inviteTeam && inviteTeam.teamId && inviteTeam.referenceCustomerId) {
|
||||
referenceCustomerIds.value[inviteTeam.teamId] = inviteTeam.referenceCustomerId;
|
||||
}
|
||||
if (account.value && account.value.openid) {
|
||||
getMatchTeams(inviteTeam && inviteTeam.teamId ? inviteTeam.teamId : '');
|
||||
} else {
|
||||
@ -121,6 +126,18 @@ onShow(async () => {
|
||||
}
|
||||
});
|
||||
|
||||
onShareAppMessage((res) => {
|
||||
if (team.value) {
|
||||
const customer = customers.value[0];
|
||||
const referenceCustomerId = customer ? customer._id : '';
|
||||
return {
|
||||
title: team.value.name,
|
||||
type: shareAppVersion || 0, // 0 正式版本 | 1 开发版本 | 2 体验版本
|
||||
path: `/pages/login/redirect-page?teamId=${team.value.teamId}&corpId=${team.value.corpId}&type=archive&referenceCustomerId=${referenceCustomerId}`
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
watch(account, (n, o) => {
|
||||
if (n && !o) {
|
||||
getMatchTeams();
|
||||
|
||||
@ -27,7 +27,7 @@ function copy() {
|
||||
})
|
||||
}
|
||||
|
||||
async function changeTeam({ teamId, corpId, corpUserId }) {
|
||||
async function changeTeam({ teamId, corpId, corpUserId, qrid, referenceCustomerId }) {
|
||||
loading.value = true;
|
||||
const res = await api("getTeamData", { teamId, corpId, withCorpName: true });
|
||||
loading.value = false;
|
||||
@ -43,6 +43,8 @@ async function changeTeam({ teamId, corpId, corpUserId }) {
|
||||
} else {
|
||||
set("invite-team-info", {
|
||||
corpUserId,
|
||||
qrid,
|
||||
referenceCustomerId,
|
||||
corpId: team.value.corpId,
|
||||
teamId: team.value.teamId,
|
||||
corpName: team.value.corpName,
|
||||
@ -79,6 +81,7 @@ async function bindTeam(corpUserId) {
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.q) {
|
||||
opts.value = JSON.stringify(options)
|
||||
const href =
|
||||
typeof options.q === "string" ? decodeURIComponent(options.q) : "";
|
||||
@ -89,6 +92,10 @@ onLoad((options) => {
|
||||
return acc;
|
||||
}, {});
|
||||
changeTeam(data);
|
||||
} else if (options.type === 'archive') {
|
||||
changeTeam(options);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
|
||||
@ -58,7 +58,8 @@ const urlsConfig = {
|
||||
updateMedicalRecord: 'updateMedicalRecord',
|
||||
getUnionidToExternalUserid: 'getUnionidToExternalUserid',
|
||||
getWxAppCustomerCount: "getWxAppCustomerCount",
|
||||
updateCustomer: 'update'
|
||||
updateCustomer: 'update',
|
||||
getRefrencePeople: 'getRefrencePeople',
|
||||
},
|
||||
wecom: {
|
||||
addContactWay: 'getCorpFriendQrcode'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user