feat: CustomerBalance
This commit is contained in:
parent
c727e5f669
commit
b66ff783be
|
@ -1,20 +1,18 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
const $props = defineProps({
|
defineProps({
|
||||||
name: { type: String, default: null },
|
name: { type: String, default: null },
|
||||||
|
tag: { type: String, default: null },
|
||||||
workerId: { type: Number, default: null },
|
workerId: { type: Number, default: null },
|
||||||
defaultName: { type: Boolean, default: false },
|
defaultName: { type: Boolean, default: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<slot name="link">
|
<slot name="link">
|
||||||
<span :class="{ link: $props.workerId }">
|
<span :class="{ link: workerId }">
|
||||||
{{ $props.defaultName ? $props.name ?? t('globals.system') : $props.name }}
|
{{ defaultName ? name ?? $t('globals.system') : tag ?? name }}
|
||||||
</span>
|
</span>
|
||||||
</slot>
|
</slot>
|
||||||
<WorkerDescriptorProxy v-if="$props.workerId" :id="$props.workerId" />
|
<WorkerDescriptorProxy v-if="workerId" :id="workerId" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -95,12 +95,7 @@ const columns = computed(() => [
|
||||||
label: t('Employee'),
|
label: t('Employee'),
|
||||||
columnField: {
|
columnField: {
|
||||||
component: 'userLink',
|
component: 'userLink',
|
||||||
attrs: ({ row }) => {
|
attrs: ({ row }) => ({ workerId: row.workerFk, tag: row.userName }),
|
||||||
return {
|
|
||||||
workerId: row.workerFk,
|
|
||||||
name: row.userName,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import { ref, computed, markRaw } from 'vue';
|
import { ref, computed, markRaw } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
|
@ -69,7 +70,7 @@ const columns = computed(() => [
|
||||||
optionFilter: 'firstName',
|
optionFilter: 'firstName',
|
||||||
useLike: false,
|
useLike: false,
|
||||||
},
|
},
|
||||||
create: true,
|
create: false,
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
|
@ -195,6 +196,8 @@ const columns = computed(() => [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'BusinessTypes',
|
url: 'BusinessTypes',
|
||||||
|
fields: ['code', 'description'],
|
||||||
|
sortBy: 'description ASC ',
|
||||||
optionLabel: 'description',
|
optionLabel: 'description',
|
||||||
optionValue: 'code',
|
optionValue: 'code',
|
||||||
},
|
},
|
||||||
|
@ -357,7 +360,7 @@ const columns = computed(() => [
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Client ticket list'),
|
title: t('Preview'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => viewSummary(row.id, CustomerSummary),
|
action: (row) => viewSummary(row.id, CustomerSummary),
|
||||||
|
@ -400,7 +403,7 @@ function handleLocation(data, location) {
|
||||||
url="Clients/filter"
|
url="Clients/filter"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Clients/createWithUser',
|
urlCreate: 'Clients/createWithUser',
|
||||||
title: 'Create client',
|
title: t('globals.pageTitles.customerCreate'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
active: true,
|
active: true,
|
||||||
|
@ -413,6 +416,39 @@ function handleLocation(data, location) {
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
|
<VnSelect
|
||||||
|
url="Workers/search"
|
||||||
|
v-model="data.salesPersonFk"
|
||||||
|
:label="t('customer.basicData.salesPerson')"
|
||||||
|
:params="{
|
||||||
|
departmentCodes: ['VT', 'shopping'],
|
||||||
|
}"
|
||||||
|
:fields="['id', 'nickname']"
|
||||||
|
sort-by="nickname ASC"
|
||||||
|
:use-like="false"
|
||||||
|
emit-value
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<VnAvatar
|
||||||
|
:worker-id="data.salesPersonFk"
|
||||||
|
color="primary"
|
||||||
|
:title="title"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption
|
||||||
|
>{{ scope.opt?.nickname }},
|
||||||
|
{{ scope.opt?.code }}</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
v-model="data.location"
|
v-model="data.location"
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
|
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
|
||||||
|
|
||||||
import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||||
// import FetchData from 'components/FetchData.vue';
|
|
||||||
import RouteDescriptorProxy from 'src/pages/Route/Card/RouteDescriptorProxy.vue';
|
import RouteDescriptorProxy from 'src/pages/Route/Card/RouteDescriptorProxy.vue';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import CustomerDescriptorProxy from '../Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Card/CustomerDescriptorProxy.vue';
|
||||||
|
@ -96,8 +95,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('Client ticket list'),
|
title: t('Client ticket list'),
|
||||||
icon: 'vn:lines',
|
icon: 'vn:lines',
|
||||||
action: ({ id }) =>
|
action: ({ id }) => router.push({ params: { id }, name: 'TicketSale' }),
|
||||||
router.push({ params: { id }, name: 'TicketSummary' }),
|
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue