Update edit-archive.vue

This commit is contained in:
huxuejian 2026-06-04 15:58:12 +08:00
parent 0378c0523c
commit 2c9be532dd

View File

@ -10,7 +10,7 @@
</view> </view>
</view> </view>
<template #footer> <template #footer>
<button-footer :showCancel="customerId ? true : false" cancelText="删除" confirmText="保存" @cancel="unBindArchive()" <button-footer :showCancel="customerId ? true : false" cancelText="删除" :confirmText="healthTypes.length?'下一步':'保存'" @cancel="unBindArchive()"
@confirm="confirm()" /> @confirm="confirm()" />
</template> </template>
</full-page> </full-page>
@ -57,6 +57,7 @@ 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 referenceCustomer = ref(null)
const healthTypes = ref([]);
const formData = computed(() => { const formData = computed(() => {
return { ...customer.value, ...form.value, mobile: account.value?.mobile } return { ...customer.value, ...form.value, mobile: account.value?.mobile }
@ -164,7 +165,17 @@ async function addArchive() {
set('home-invite-team-info', { teamId: teamId.value }) set('home-invite-team-info', { teamId: teamId.value })
if (res && res.success) { if (res && res.success) {
uni.$emit('reloadTeamCustomers') uni.$emit('reloadTeamCustomers')
getTeam(corpId.value, teamId.value, res.data.id); // getTeam(corpId.value, teamId.value, res.data.id);
if (healthTypes.value.length) {
const nextType = healthTypes.value[0];
const nextTypes = healthTypes.value.slice(1);
const url = `/pages/health/record?type=${nextType}&teamId=${teamId.value}&corpId=${corpId.value}&customerId=${res.data.id}&nextTypes=${nextTypes.join(',')}&source=afterArchive`
uni.redirectTo({ url });
} else {
uni.redirectTo({
url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}&customerId=${res.data.id}`
})
}
} else { } else {
toast(res?.message || '新增档案失败'); toast(res?.message || '新增档案失败');
} }
@ -205,6 +216,7 @@ async function init() {
visible.value = true; visible.value = true;
} }
getExternalUserId(corpId.value); getExternalUserId(corpId.value);
getTeam(corpId.value, teamId.value)
} }
await getBaseForm(); await getBaseForm();
if (!customerId.value) { if (!customerId.value) {
@ -285,18 +297,18 @@ async function getTeam(corpId, teamId, customerId) {
const team = res.data; const team = res.data;
const qrcode = team && Array.isArray(team.qrcodes) ? team.qrcodes[0] : null; const qrcode = team && Array.isArray(team.qrcodes) ? team.qrcodes[0] : null;
const healthTempList = qrcode && Array.isArray(qrcode.healthTempList) ? qrcode.healthTempList : []; 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); healthTypes.value = healthTempList.filter(i => typeof i.templateType === 'string' && i.templateType.trim() && i.archiveRecommend === true).map(i => i.templateType);
if (types.length && customerId) { // if (types.length && customerId) {
const nextType = types[0]; // const nextType = types[0];
const nextTypes = types.slice(1); // const nextTypes = types.slice(1);
const url = `/pages/health/record?type=${nextType}&teamId=${teamId}&corpId=${corpId}&customerId=${customerId}&nextTypes=${nextTypes.join(',')}&source=afterArchive` // const url = `/pages/health/record?type=${nextType}&teamId=${teamId}&corpId=${corpId}&customerId=${customerId}&nextTypes=${nextTypes.join(',')}&source=afterArchive`
uni.redirectTo({ url }); // uni.redirectTo({ url });
return // return
// }
} }
} // uni.redirectTo({
uni.redirectTo({ // url: `/pages/archive/archive-result?corpId=${corpId}&teamId=${teamId}&customerId=${customerId}`
url: `/pages/archive/archive-result?corpId=${corpId}&teamId=${teamId}&customerId=${customerId}` // })
})
} }