Compare commits
2 Commits
56aa655326
...
59d016b329
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59d016b329 | ||
|
|
482d20e0fc |
@ -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'" v-bind="attrs" :form="form" :disableChange="disableChange"
|
<form-input v-else-if="attrs.type === 'input' || attrs.type === 'hisCardNo'" v-bind="attrs" :form="form"
|
||||||
@change="change" />
|
:disableChange="disableChange" @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" :disableChange="disableChange"
|
<form-evaluated-joint v-else-if="attrs.type === 'evaluatedJoint'" v-bind="attrs" :form="form"
|
||||||
@change="change" />
|
:disableChange="disableChange" @change="change" />
|
||||||
<form-exercise-level v-else-if="attrs.type === 'exerciseLevel'" v-bind="attrs" :form="form" :disableChange="disableChange"
|
<form-exercise-level v-else-if="attrs.type === 'exerciseLevel'" v-bind="attrs" :form="form"
|
||||||
@change="change" />
|
:disableChange="disableChange" @change="change" />
|
||||||
<form-select-and-other v-else-if="attrs.type === 'selectAndOther'" v-bind="attrs" :form="form" :disableChange="disableChange"
|
<form-select-and-other v-else-if="attrs.type === 'selectAndOther'" v-bind="attrs" :form="form"
|
||||||
@change="change" />
|
:disableChange="disableChange" @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"
|
||||||
|
|||||||
@ -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"
|
<form-cell v-if="item.cellType === 'formCellItem'" v-bind="item" :form="form" :disableChange="isDisableChange(item)"
|
||||||
:disableChange="isDisableChange(item)" @change="change" @addRule="addRule" />
|
@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'];
|
const formCellType = ['input', 'select', 'date', 'radio', 'region', 'textarea', 'multiSelectAndOther', 'selectAndOther', 'selfMultipleDiseases', 'files', 'diagnosis', 'positiveFind', 'evaluatedJoint', 'exerciseLevel', 'hisCardNo'];
|
||||||
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) => {
|
||||||
|
|||||||
@ -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 } from '@/utils/widget';
|
import { toast, confirm as uniConfirm, loading as waiting, hideLoading } 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,6 +185,7 @@ async function queryHisArchives() {
|
|||||||
// 选择“修改信息”时留在当前步骤继续填写。
|
// 选择“修改信息”时留在当前步骤继续填写。
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
hideLoading()
|
||||||
queryingHisArchives.value = false;
|
queryingHisArchives.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -454,7 +455,7 @@ async function getArchives() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getBaseForm() {
|
async function getBaseForm() {
|
||||||
const res = await api('getTeamBaseInfo', { corpId: corpId.value, teamId: teamId.value });
|
const res = await api('getTeamBaseInfo', { corpId: corpId.value, teamId: teamId.value, queryHisTitles: queryHisTitles.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');
|
||||||
|
|||||||
@ -222,10 +222,12 @@ 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 : [];
|
||||||
|
|||||||
@ -14,6 +14,7 @@ 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账号
|
||||||
@ -164,9 +165,16 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user