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