Update edit-archive.vue
This commit is contained in:
parent
0378c0523c
commit
2c9be532dd
@ -10,7 +10,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<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()" />
|
||||
</template>
|
||||
</full-page>
|
||||
@ -57,6 +57,7 @@ const tempRef = ref(null);
|
||||
const verifyVisible = ref(false);
|
||||
const visible = ref(false);
|
||||
const referenceCustomer = ref(null)
|
||||
const healthTypes = ref([]);
|
||||
|
||||
const formData = computed(() => {
|
||||
return { ...customer.value, ...form.value, mobile: account.value?.mobile }
|
||||
@ -164,7 +165,17 @@ async function addArchive() {
|
||||
set('home-invite-team-info', { teamId: teamId.value })
|
||||
if (res && res.success) {
|
||||
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 {
|
||||
toast(res?.message || '新增档案失败');
|
||||
}
|
||||
@ -205,6 +216,7 @@ async function init() {
|
||||
visible.value = true;
|
||||
}
|
||||
getExternalUserId(corpId.value);
|
||||
getTeam(corpId.value, teamId.value)
|
||||
}
|
||||
await getBaseForm();
|
||||
if (!customerId.value) {
|
||||
@ -285,18 +297,18 @@ async function getTeam(corpId, teamId, customerId) {
|
||||
const team = res.data;
|
||||
const qrcode = team && Array.isArray(team.qrcodes) ? team.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(',')}&source=afterArchive`
|
||||
uni.redirectTo({ url });
|
||||
return
|
||||
healthTypes.value = 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(',')}&source=afterArchive`
|
||||
// uni.redirectTo({ url });
|
||||
// return
|
||||
// }
|
||||
}
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: `/pages/archive/archive-result?corpId=${corpId}&teamId=${teamId}&customerId=${customerId}`
|
||||
})
|
||||
// uni.redirectTo({
|
||||
// url: `/pages/archive/archive-result?corpId=${corpId}&teamId=${teamId}&customerId=${customerId}`
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user