Adding registration date and multiple addresses for contacts and leads.
This commit is contained in:
@@ -8,6 +8,7 @@ import CustomerMoodFace from '@/components/CustomerMoodFace.vue';
|
||||
import ExcelImportFlow from '@/components/ExcelImportFlow.vue';
|
||||
import PhoneContactsImport from '@/components/PhoneContactsImport.vue';
|
||||
import {
|
||||
UiBusyOverlay,
|
||||
UiButton,
|
||||
UiDropdownMenu,
|
||||
UiModal,
|
||||
@@ -52,6 +53,8 @@ const moodFilter = computed<PersonMood | 'all'>(() => {
|
||||
const q = ref(typeof route.query.q === 'string' ? route.query.q : '');
|
||||
const loading = ref(false);
|
||||
const busy = ref(false);
|
||||
const pageBusy = ref(false);
|
||||
const busyMessage = ref('لطفاً صبر کنید…');
|
||||
const error = ref('');
|
||||
const importMsg = ref('');
|
||||
const people = ref<PaginatedResponse<PersonDto> | null>(null);
|
||||
@@ -208,6 +211,8 @@ async function setMoodFor(person: PersonDto, mood: PersonMood) {
|
||||
|
||||
async function exportExcel() {
|
||||
busy.value = true;
|
||||
pageBusy.value = true;
|
||||
busyMessage.value = 'در حال تهیه خروجی اکسل…';
|
||||
importMsg.value = '';
|
||||
error.value = '';
|
||||
try {
|
||||
@@ -227,6 +232,7 @@ async function exportExcel() {
|
||||
error.value = 'خروجی اکسل ناموفق بود.';
|
||||
} finally {
|
||||
busy.value = false;
|
||||
pageBusy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,6 +245,7 @@ const importPath = computed(() =>
|
||||
|
||||
function onImportStart() {
|
||||
busy.value = true;
|
||||
pageBusy.value = false;
|
||||
importMsg.value = '';
|
||||
error.value = '';
|
||||
}
|
||||
@@ -258,6 +265,8 @@ async function onImportDone(data: ImportContactsResult) {
|
||||
|
||||
function onPhoneImportStart() {
|
||||
busy.value = true;
|
||||
pageBusy.value = true;
|
||||
busyMessage.value = 'در حال ورود مخاطبین گوشی…';
|
||||
importMsg.value = '';
|
||||
error.value = '';
|
||||
}
|
||||
@@ -279,6 +288,7 @@ function onPhoneImportFail(message: string) {
|
||||
|
||||
function onPhoneImportSettled() {
|
||||
busy.value = false;
|
||||
pageBusy.value = false;
|
||||
}
|
||||
|
||||
function onImportFail(message: string) {
|
||||
@@ -287,6 +297,7 @@ function onImportFail(message: string) {
|
||||
|
||||
function onImportSettled() {
|
||||
busy.value = false;
|
||||
pageBusy.value = false;
|
||||
}
|
||||
|
||||
watch(
|
||||
@@ -302,12 +313,13 @@ onMounted(load);
|
||||
|
||||
<template>
|
||||
<section class="page" @click="closePopups">
|
||||
<UiBusyOverlay :open="pageBusy" :message="busyMessage" />
|
||||
<UiPageHeader
|
||||
title="مخاطبین"
|
||||
lead="مدیریت و مشاهده اشخاص و شرکتها"
|
||||
>
|
||||
<template #actions>
|
||||
<UiButton variant="ghost" size="sm" :disabled="busy" @click.stop="exportExcel">
|
||||
<UiButton variant="ghost" size="sm" :disabled="busy" :loading="pageBusy && busyMessage.includes('خروجی')" @click.stop="exportExcel">
|
||||
<span class="btn-full">خروجی اکسل</span>
|
||||
<span class="btn-short">خروجی</span>
|
||||
</UiButton>
|
||||
@@ -320,10 +332,12 @@ onMounted(load);
|
||||
@fail="onImportFail"
|
||||
@settled="onImportSettled"
|
||||
>
|
||||
<UiButton variant="ghost" size="sm" :disabled="busy">
|
||||
<span class="btn-full">ورود از اکسل</span>
|
||||
<span class="btn-short">ورود</span>
|
||||
</UiButton>
|
||||
<template #default="{ loading }">
|
||||
<UiButton variant="ghost" size="sm" :disabled="busy" :loading="loading">
|
||||
<span class="btn-full">ورود از اکسل</span>
|
||||
<span class="btn-short">ورود</span>
|
||||
</UiButton>
|
||||
</template>
|
||||
</ExcelImportFlow>
|
||||
<PhoneContactsImport
|
||||
v-if="tab === 'people'"
|
||||
|
||||
Reference in New Issue
Block a user