diff --git a/pages/archive/archive-result.vue b/pages/archive/archive-result.vue index be1ddd3..e6ce3be 100644 --- a/pages/archive/archive-result.vue +++ b/pages/archive/archive-result.vue @@ -73,6 +73,7 @@ const { account } = storeToRefs(useAccount()); const { memberJob, memberList: list } = useJob(); const qrcode = ref(''); const corpId = ref('') +const customerId = ref('') const friends = computed(() => { const memberList = Array.isArray(team.value?.memberList) ? team.value.memberList : []; @@ -99,10 +100,19 @@ async function getQrcode(userid) { } } -async function getTeam(corpId, teamId) { +async function getTeam(corpId, teamId, customerId) { const res = await api('getTeamData', { teamId, corpId }); if (res && res.data) { team.value = res.data; + const qrcode = team.value && Array.isArray(team.value.qrcodes) ? team.value.qrcodes[0] : null; + const healthTempList = qrcode && Array.isArray(qrcode.healthTempList) ? qrcode.healthTempList : []; + const types = healthTempList.filter(i => typeof i.templateType === 'string' && i.templateType.trim() && i.archiveRecommend === true).map(i => i.templateType); + if (types.length && customerId) { + const nextType = types[0]; + const nextTypes = types.slice(1); + const url = `/pages/health/record?type=${nextType}&teamId=${teamId}&corpId=${corpId}&customerId=${customerId}&nextTypes=${nextTypes.join(',')}` + uni.navigateTo({ url }); + } } else { toast(res?.message || '获取团队信息失败') } @@ -113,9 +123,10 @@ function backHome() { } useLoad(options => { + customerId.value = options.customerId || ''; corpId.value = options.corpId; if (options.teamId && options.corpId) { - getTeam(options.corpId, options.teamId); + getTeam(options.corpId, options.teamId, options.customerId); } }) diff --git a/pages/archive/edit-archive.vue b/pages/archive/edit-archive.vue index 8bdca6e..08919b7 100644 --- a/pages/archive/edit-archive.vue +++ b/pages/archive/edit-archive.vue @@ -164,7 +164,7 @@ async function addArchive() { if (res && res.success) { uni.$emit('reloadTeamCustomers') uni.redirectTo({ - url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}` + url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}&customerId=${res.data.id}` }) } else { toast(res?.message || '新增档案失败'); diff --git a/pages/health/list.vue b/pages/health/list.vue index 138753e..abfb968 100644 --- a/pages/health/list.vue +++ b/pages/health/list.vue @@ -115,7 +115,7 @@ const page = ref(1); const more = ref(false) const loading = ref(false); const qrcode = computed(() => team.value && Array.isArray(team.value.qrcodes) ? team.value.qrcodes[0] : null) -const healthTempList = computed(() => qrcode.value && Array.isArray(qrcode.value.healthTempList) ? qrcode.value.healthTempList.map(i => ({ label: tempType[i.templateType], value: i.templateType })).filter(i => i.label) : []) +const healthTempList = computed(() => qrcode.value && Array.isArray(qrcode.value.healthTempList) ? qrcode.value.healthTempList.map(i => ({ enable: i.enable, label: tempType[i.templateType], value: i.templateType })).filter(i => i.label && i.enable) : []) const tempShowField = ref(null); const config = { diff --git a/pages/health/record.vue b/pages/health/record.vue index 7b5e3a5..51c4952 100644 --- a/pages/health/record.vue +++ b/pages/health/record.vue @@ -43,6 +43,7 @@ const type = ref(''); const visible = ref(false); const timeTitle = ref(''); const canEdit = ref(false) +const nextTypes = ref([]); const formData = computed(() => ({ ...record.value, ...form.value })); const displayFormItems = computed(() => { @@ -90,12 +91,25 @@ async function addHealthRecord() { const res = await api('addMedicalRecord', data); if (res && res.success) { await toast('保存成功'); + const isFill = await fillNext(); + if(isFill) return; uni.navigateBack(); } else { toast(res?.message || '保存失败'); } } +async function fillNext() { + const nextType = nextTypes.value[0]; + const types = nextTypes.value.slice(1); + if (nextType) { + const url = `/pages/health/record?type=${nextType}&teamId=${teamId.value}&corpId=${corpId.value}&customerId=${customerId.value}&nextTypes=${types.join(',')}` + uni.redirectTo({ url }); + return true + } + return false +} + async function updateHealthRecord() { if (Object.keys(form.value).length === 0) { uni.navigateBack(); @@ -162,6 +176,8 @@ onLoad(options => { customerId.value = options.customerId || ''; corpId.value = options.corpId; teamId.value = options.teamId; + const nextTypeStr = typeof options.nextTypes === 'string' ? options.nextTypes : ''; + nextTypes.value = nextTypeStr.split(','); uni.setNavigationBarTitle({ title: id.value ? '编辑健康档案' : '新增健康档案' }) }) useLoad(options => { diff --git a/pages/home/team-head.vue b/pages/home/team-head.vue index 12b5916..ec1d916 100644 --- a/pages/home/team-head.vue +++ b/pages/home/team-head.vue @@ -22,7 +22,7 @@
- {{ currentTeam.leaderCorp || currentTeam.corpName || '' }} + {{ currentTeam.licenseHospitalName || currentTeam.leaderCorp || currentTeam.corpName || '' }} @@ -49,7 +49,7 @@ {{ item.name }} - {{ item.leaderCorp || item.corpName || '' }} + {{ item.licenseHospitalName || item.leaderCorp || item.corpName || '' }}