Compare commits

..

No commits in common. "59d016b329cddf848bf293c00d297337bd35f554" and "56aa655326a91c9aa3186672f6bfd90511bfafcd" have entirely different histories.

5 changed files with 16 additions and 27 deletions

View File

@ -2,20 +2,20 @@
<!-- <view class="text-danger px-10">{{ attrs.name }} {{ attrs.title }} {{ attrs.type }}</view> --> <!-- <view class="text-danger px-10">{{ attrs.name }} {{ attrs.title }} {{ attrs.type }}</view> -->
<form-datepicker v-if="attrs.type === 'date'" v-bind="attrs" :form="form" :disableChange="disableChange" <form-datepicker v-if="attrs.type === 'date'" v-bind="attrs" :form="form" :disableChange="disableChange"
@change="change" /> @change="change" />
<form-input v-else-if="attrs.type === 'input' || attrs.type === 'hisCardNo'" v-bind="attrs" :form="form" <form-input v-else-if="attrs.type === 'input'" v-bind="attrs" :form="form" :disableChange="disableChange"
:disableChange="disableChange" @change="change" /> @change="change" />
<form-radio v-else-if="attrs.type === 'radio'" v-bind="attrs" :form="form" :disableChange="disableChange" <form-radio v-else-if="attrs.type === 'radio'" v-bind="attrs" :form="form" :disableChange="disableChange"
@change="change" /> @change="change" />
<form-region v-else-if="attrs.type === 'region'" v-bind="attrs" :form="form" :disableChange="disableChange" <form-region v-else-if="attrs.type === 'region'" v-bind="attrs" :form="form" :disableChange="disableChange"
@change="change" /> @change="change" />
<form-select v-else-if="attrs.type === 'select'" v-bind="attrs" :form="form" :disableChange="disableChange" <form-select v-else-if="attrs.type === 'select'" v-bind="attrs" :form="form" :disableChange="disableChange"
@change="change" /> @change="change" />
<form-evaluated-joint v-else-if="attrs.type === 'evaluatedJoint'" v-bind="attrs" :form="form" <form-evaluated-joint v-else-if="attrs.type === 'evaluatedJoint'" v-bind="attrs" :form="form" :disableChange="disableChange"
:disableChange="disableChange" @change="change" /> @change="change" />
<form-exercise-level v-else-if="attrs.type === 'exerciseLevel'" v-bind="attrs" :form="form" <form-exercise-level v-else-if="attrs.type === 'exerciseLevel'" v-bind="attrs" :form="form" :disableChange="disableChange"
:disableChange="disableChange" @change="change" /> @change="change" />
<form-select-and-other v-else-if="attrs.type === 'selectAndOther'" v-bind="attrs" :form="form" <form-select-and-other v-else-if="attrs.type === 'selectAndOther'" v-bind="attrs" :form="form" :disableChange="disableChange"
:disableChange="disableChange" @change="change" /> @change="change" />
<form-textarea v-else-if="attrs.type === 'textarea'" v-bind="attrs" :form="form" :disableChange="disableChange" <form-textarea v-else-if="attrs.type === 'textarea'" v-bind="attrs" :form="form" :disableChange="disableChange"
@change="change" /> @change="change" />
<form-mult-disease v-else-if="attrs.type === 'selfMultipleDiseases'" v-bind="attrs" :form="form" @change="change" <form-mult-disease v-else-if="attrs.type === 'selfMultipleDiseases'" v-bind="attrs" :form="form" @change="change"

View File

@ -1,7 +1,7 @@
<template> <template>
<template v-for="item in formItems" :key="item.title"> <template v-for="item in formItems" :key="item.title">
<form-cell v-if="item.cellType === 'formCellItem'" v-bind="item" :form="form" :disableChange="isDisableChange(item)" <form-cell v-if="item.cellType === 'formCellItem'" v-bind="item" :form="form"
@change="change" @addRule="addRule" /> :disableChange="isDisableChange(item)" @change="change" @addRule="addRule" />
</template> </template>
<form-cell /> <form-cell />
</template> </template>
@ -33,7 +33,7 @@ const props = defineProps({
} }
}) })
const formCellType = ['input', 'select', 'date', 'radio', 'region', 'textarea', 'multiSelectAndOther', 'selectAndOther', 'selfMultipleDiseases', 'files', 'diagnosis', 'positiveFind', 'evaluatedJoint', 'exerciseLevel', 'hisCardNo']; const formCellType = ['input', 'select', 'date', 'radio', 'region', 'textarea', 'multiSelectAndOther', 'selectAndOther', 'selfMultipleDiseases', 'files', 'diagnosis', 'positiveFind', 'evaluatedJoint', 'exerciseLevel'];
const formCellTitle = ['surgicalHistory']; const formCellTitle = ['surgicalHistory'];
const customCellType = ['BMI', 'bloodPressure']; const customCellType = ['BMI', 'bloodPressure'];
const disabledMap = computed(() => props.disableTitles.reduce((m, i) => { const disabledMap = computed(() => props.disableTitles.reduce((m, i) => {

View File

@ -30,7 +30,7 @@ import dayjs from 'dayjs';
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';
import { toast, confirm as uniConfirm, loading as waiting, hideLoading } from '@/utils/widget'; import { toast, confirm as uniConfirm } from '@/utils/widget';
import validate from '@/utils/validate'; import validate from '@/utils/validate';
import { set } from "@/utils/cache"; import { set } from "@/utils/cache";
@ -131,7 +131,7 @@ function change({ title, value }) {
async function queryHisArchives() { async function queryHisArchives() {
if (queryingHisArchives.value) return; if (queryingHisArchives.value) return;
waiting()
const matchedPlans = archiveQueryPlans.value.filter(isQueryPlanSatisfied); const matchedPlans = archiveQueryPlans.value.filter(isQueryPlanSatisfied);
if (!matchedPlans.length) { if (!matchedPlans.length) {
hisArchive.value = null; hisArchive.value = null;
@ -185,7 +185,6 @@ async function queryHisArchives() {
// //
} }
} finally { } finally {
hideLoading()
queryingHisArchives.value = false; queryingHisArchives.value = false;
} }
} }
@ -455,7 +454,7 @@ async function getArchives() {
} }
async function getBaseForm() { async function getBaseForm() {
const res = await api('getTeamBaseInfo', { corpId: corpId.value, teamId: teamId.value, queryHisTitles: queryHisTitles.value }); const res = await api('getTeamBaseInfo', { corpId: corpId.value, teamId: teamId.value });
if (res && res.success) { if (res && res.success) {
teamFormItems.value = Array.isArray(res.data) ? res.data : []; teamFormItems.value = Array.isArray(res.data) ? res.data : [];
// const mobileIndex = formItems.value.findIndex(item => item.title === 'mobile'); // const mobileIndex = formItems.value.findIndex(item => item.title === 'mobile');

View File

@ -222,12 +222,10 @@ async function auth() {
async function getCustomers() { async function getCustomers() {
if (loading) return; if (loading) return;
loading = true; loading = true
await getExternalUserId(props.corpId)
const res = await api("getMiniAppCustomers", { const res = await api("getMiniAppCustomers", {
miniAppId: account.value.openid, miniAppId: account.value.openid,
corpId: props.corpId, corpId: props.corpId,
externalUserId: externalUserId.value
}, false); }, false);
if (res && res.success) { if (res && res.success) {
customers.value = res && Array.isArray(res.data) ? res.data : []; customers.value = res && Array.isArray(res.data) ? res.data : [];

View File

@ -14,7 +14,6 @@ export default defineStore("accountStore", () => {
const isIMInitialized = ref(false); const isIMInitialized = ref(false);
const openid = ref(""); const openid = ref("");
const externalUserId = ref(''); const externalUserId = ref('');
const externalUserIdMap = ref({});
const teams = ref([]); const teams = ref([]);
const hasImCorpId = computed(() => { const hasImCorpId = computed(() => {
// 正式环境IM账号优先 暂时只有wpLgjyawAA8N0gWmXgyJq8wpjGcOT7fg机构的才开启IM账号 // 正式环境IM账号优先 暂时只有wpLgjyawAA8N0gWmXgyJq8wpjGcOT7fg机构的才开启IM账号
@ -165,16 +164,9 @@ export default defineStore("accountStore", () => {
externalUserId.value = ''; externalUserId.value = '';
return return
}; };
const key = `${normalizedCorpId}_${unionid}_${openid}_${miniAppId}`;
if (externalUserIdMap.value[key]) {
return externalUserIdMap.value[key]
}
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId: normalizedCorpId, miniAppId }, false); const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId: normalizedCorpId, miniAppId }, false);
const id = res && res.success && typeof res.data === 'string' && res.data.trim() ? res.data.trim() : ''; const id = res && res.success && typeof res.data === 'string' && res.data.trim() ? res.data.trim() : '';
externalUserId.value = id; externalUserId.value = id;
if (id) {
externalUserIdMap.value[key] = id;
}
return id; return id;
} }