forked from verdnatura/salix-front
feat: refs #8194 created VnSelectWorker component and use it in Lilium
This commit is contained in:
parent
71c26c2fa7
commit
2b235e93e7
|
@ -0,0 +1,106 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
const $props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: [String, Number, Object],
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
optionValue: {
|
||||||
|
type: String,
|
||||||
|
default: 'id',
|
||||||
|
},
|
||||||
|
optionLabel: {
|
||||||
|
type: String,
|
||||||
|
default: 'name',
|
||||||
|
},
|
||||||
|
fields: {
|
||||||
|
type: Array,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
sortBy: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
exprBuilder: {
|
||||||
|
type: Function,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
hasAvatar: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
hasInfo: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
noOne: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const value = computed({
|
||||||
|
get() {
|
||||||
|
return $props.modelValue;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
emit('update:modelValue', val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnSelect
|
||||||
|
:label="t($props.label)"
|
||||||
|
v-model="value"
|
||||||
|
:url="$props.url"
|
||||||
|
:option-value="$props.optionValue"
|
||||||
|
:option-label="$props.optionLabel"
|
||||||
|
:fields="$props.fields"
|
||||||
|
:params="$props.params"
|
||||||
|
:sort-by="$props.sortBy"
|
||||||
|
:expr-builder="$props.exprBuilder"
|
||||||
|
:no-one="$props.noOne"
|
||||||
|
hide-selected
|
||||||
|
>
|
||||||
|
<template #prepend v-if="hasAvatar">
|
||||||
|
<VnAvatar :worker-id="value" color="primary" :title="title" />
|
||||||
|
</template>
|
||||||
|
<template #append v-if="hasInfo">
|
||||||
|
<QIcon name="info" class="cursor-pointer">
|
||||||
|
<QTooltip>{{ t('Responsible for approving invoices') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</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>
|
||||||
|
</template>
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -103,17 +104,18 @@ const exprBuilder = (param, value) => {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
url="Workers/search"
|
|
||||||
v-model="data.salesPersonFk"
|
|
||||||
:label="t('customer.summary.salesPerson')"
|
:label="t('customer.summary.salesPerson')"
|
||||||
|
v-model="data.salesPersonFk"
|
||||||
|
:url="'Workers/search'"
|
||||||
|
:option-value="'id'"
|
||||||
|
:option-label="'nickname'"
|
||||||
|
:fields="['id', 'name', 'nickname']"
|
||||||
:params="{
|
:params="{
|
||||||
departmentCodes: ['VT', 'shopping'],
|
departmentCodes: ['VT', 'shopping'],
|
||||||
}"
|
}"
|
||||||
:fields="['id', 'nickname']"
|
:sort-by="'nickname ASC'"
|
||||||
sort-by="nickname ASC"
|
:has-avatar="true"
|
||||||
option-label="nickname"
|
|
||||||
option-value="id"
|
|
||||||
:rules="validate('client.salesPersonFk')"
|
:rules="validate('client.salesPersonFk')"
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
emit-value
|
emit-value
|
||||||
|
@ -126,18 +128,7 @@ const exprBuilder = (param, value) => {
|
||||||
:title="title"
|
:title="title"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #option="scope">
|
</VnSelectWorker>
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption
|
|
||||||
>{{ scope.opt?.nickname }},
|
|
||||||
{{ scope.opt?.code }}</QItemLabel
|
|
||||||
>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.contactChannelFk"
|
v-model="data.contactChannelFk"
|
||||||
:options="contactChannels"
|
:options="contactChannels"
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
defineProps({
|
defineProps({
|
||||||
|
@ -65,19 +66,19 @@ const exprBuilder = (param, value) => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-sm">
|
<QItem class="q-mb-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
url="Workers/search"
|
:label="t('Salesperson')"
|
||||||
|
v-model="params.salesPersonFk"
|
||||||
|
:url="'Workers/search'"
|
||||||
|
:option-value="'id'"
|
||||||
|
:option-label="'name'"
|
||||||
|
:fields="['id', 'name', 'nickname']"
|
||||||
:params="{
|
:params="{
|
||||||
departmentCodes: ['VT'],
|
departmentCodes: ['VT'],
|
||||||
}"
|
}"
|
||||||
auto-load
|
:sort-by="'nickname ASC'"
|
||||||
:label="t('Salesperson')"
|
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
v-model="params.salesPersonFk"
|
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
sort-by="nickname ASC"
|
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
|
@ -86,18 +87,7 @@ const exprBuilder = (param, value) => {
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
>
|
/>
|
||||||
<template #option="{ itemProps, opt }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ opt.nickname }},{{ opt.code }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template></VnSelect
|
|
||||||
>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-sm">
|
<QItem class="q-mb-sm">
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
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';
|
||||||
|
@ -12,6 +11,7 @@ import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
import CustomerFilter from './CustomerFilter.vue';
|
import CustomerFilter from './CustomerFilter.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -421,40 +421,21 @@ function handleLocation(data, location) {
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
url="Workers/search"
|
|
||||||
v-model="data.salesPersonFk"
|
|
||||||
:label="t('customer.summary.salesPerson')"
|
:label="t('customer.summary.salesPerson')"
|
||||||
|
v-model="data.salesPersonFk"
|
||||||
|
:url="'Workers/search'"
|
||||||
|
:option-value="'id'"
|
||||||
|
:option-label="'nickname'"
|
||||||
|
:fields="['id', 'name', 'nickname']"
|
||||||
:params="{
|
:params="{
|
||||||
departmentCodes: ['VT', 'shopping'],
|
departmentCodes: ['VT', 'shopping'],
|
||||||
}"
|
}"
|
||||||
:fields="['id', 'nickname', 'code']"
|
:sort-by="'nickname ASC'"
|
||||||
sort-by="nickname ASC"
|
:has-avatar="true"
|
||||||
option-label="nickname"
|
|
||||||
option-value="id"
|
|
||||||
emit-value
|
emit-value
|
||||||
auto-load
|
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
|
||||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||||
v-model="data.location"
|
v-model="data.location"
|
||||||
|
|
|
@ -6,6 +6,7 @@ import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -48,14 +49,13 @@ const { t } = useI18n();
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('department.bossDepartment')"
|
:label="t('department.bossDepartment')"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
option-value="id"
|
:option-value="'id'"
|
||||||
option-label="name"
|
:option-label="'name'"
|
||||||
hide-selected
|
:fields="['id', 'name', 'nickname']"
|
||||||
map-options
|
|
||||||
:rules="validate('department.workerFk')"
|
:rules="validate('department.workerFk')"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
|
|
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -145,33 +146,20 @@ const decrement = (paramsObj, key) => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('params.requesterFk')"
|
:label="t('params.requesterFk')"
|
||||||
v-model="params.requesterFk"
|
v-model="params.requesterFkk"
|
||||||
|
:url="'Workers/search'"
|
||||||
|
:option-value="'id'"
|
||||||
|
:option-label="'name'"
|
||||||
|
:fields="['id', 'name', 'nickname']"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="Workers/search"
|
:sort-by="'name ASC'"
|
||||||
:fields="['id', 'name']"
|
|
||||||
order="name ASC"
|
|
||||||
:params="{ departmentCodes: ['VT'] }"
|
:params="{ departmentCodes: ['VT'] }"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
hide-selected
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
/>
|
||||||
<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>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import { dateRange } from 'src/filters';
|
import { dateRange } from 'src/filters';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
defineProps({ dataKey: { type: String, required: true } });
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
const { t, te } = useI18n();
|
const { t, te } = useI18n();
|
||||||
|
@ -108,33 +109,19 @@ const getLocale = (label) => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
rounded
|
rounded
|
||||||
:label="t('globals.params.salesPersonFk')"
|
:label="t('globals.params.salesPersonFk')"
|
||||||
v-model="params.salesPersonFk"
|
v-model="params.salesPersonFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
|
:option-value="'id'"
|
||||||
|
:option-label="'name'"
|
||||||
|
:fields="['id', 'name', 'nickname']"
|
||||||
:params="{ departmentCodes: ['VT'] }"
|
:params="{ departmentCodes: ['VT'] }"
|
||||||
is-outlined
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
:no-one="true"
|
:no-one="true"
|
||||||
>
|
/>
|
||||||
<template #option="{ opt, itemProps }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
|
||||||
<QItemLabel
|
|
||||||
v-if="opt.code"
|
|
||||||
class="text-grey text-caption"
|
|
||||||
>
|
|
||||||
{{ `${opt.nickname}, ${opt.code}` }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -61,28 +62,18 @@ const sourceList = ref([]);
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('salesPerson')"
|
:label="t('globals.salesPerson')"
|
||||||
v-model="params.workerFk"
|
v-model="params.workerFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
:filter="{ departmentCodes: ['VT'] }"
|
:option-value="'id'"
|
||||||
sort-by="nickname ASC"
|
:option-label="'nickname'"
|
||||||
option-label="nickname"
|
:fields="['id', 'name', 'nickname']"
|
||||||
|
:sort-by="'nickname ASC'"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
/>
|
||||||
<template #option="{ itemProps, opt }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ opt.nickname }},{{ opt.code }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
v-model="params.from"
|
v-model="params.from"
|
||||||
:label="t('fromLanded')"
|
:label="t('fromLanded')"
|
||||||
|
|
|
@ -4,6 +4,7 @@ import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -31,29 +32,19 @@ const emit = defineEmits(['search']);
|
||||||
<template #body="{ params }">
|
<template #body="{ params }">
|
||||||
<QItem class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('Worker')"
|
:label="t('Worker')"
|
||||||
v-model="params.workerFk"
|
v-model="params.workerFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
sort-by="nickname ASC"
|
:option-value="'id'"
|
||||||
option-value="id"
|
:option-label="'nickname'"
|
||||||
option-label="nickname"
|
:fields="['id', 'name', 'nickname']"
|
||||||
|
:sort-by="'nickname ASC'"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
>
|
/>
|
||||||
<template #option="{ itemProps, opt }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ opt.nickname }},{{ opt.code }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
|
|
|
@ -11,6 +11,7 @@ import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnInputTime from 'components/common/VnInputTime.vue';
|
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -94,26 +95,15 @@ const onSave = (data, response) => {
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('Worker')"
|
:label="t('worker')"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
sort-by="nickname ASC"
|
:option-value="'id'"
|
||||||
option-value="id"
|
:option-label="'nickname'"
|
||||||
option-label="nickname"
|
:fields="['id', 'name', 'nickname']"
|
||||||
:input-debounce="0"
|
:sort-by="'nickname ASC'"
|
||||||
>
|
/>
|
||||||
<template #option="{ itemProps, opt }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ opt.nickname }}, {{ opt.code }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Vehicle')"
|
:label="t('Vehicle')"
|
||||||
v-model="data.vehicleFk"
|
v-model="data.vehicleFk"
|
||||||
|
|
|
@ -5,6 +5,7 @@ import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -30,31 +31,17 @@ const companySizes = [
|
||||||
:rules="validate('supplier.nickname')"
|
:rules="validate('supplier.nickname')"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('supplier.basicData.workerFk')"
|
:label="t('supplier.basicData.workerFk')"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
sort-by="nickname ASC"
|
:option-value="'id'"
|
||||||
|
:option-label="'name'"
|
||||||
|
:fields="['id', 'name', 'nickname']"
|
||||||
|
:sort-by="'nickname ASC'"
|
||||||
|
:has-info="true"
|
||||||
:rules="validate('supplier.workerFk')"
|
:rules="validate('supplier.workerFk')"
|
||||||
>
|
/>
|
||||||
<template #append>
|
|
||||||
<QIcon name="info" class="cursor-pointer">
|
|
||||||
<QTooltip>{{
|
|
||||||
t('Responsible for approving invoices')
|
|
||||||
}}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</template>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ scope.opt?.nickname }}, {{ scope.opt?.id }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('supplier.basicData.size')"
|
:label="t('supplier.basicData.size')"
|
||||||
v-model="data.companySize"
|
v-model="data.companySize"
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onRequestCreated']);
|
const emit = defineEmits(['onRequestCreated']);
|
||||||
|
|
||||||
|
@ -46,29 +47,15 @@ const onStateFkChange = (formData) => (formData.userFk = user.value.id);
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('expedition.worker')"
|
:label="t('expedition.worker')"
|
||||||
v-model="data.userFk"
|
v-model="data.userFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
fields=" ['id', 'name']"
|
:option-value="'id'"
|
||||||
sort-by="name ASC"
|
:option-label="'name'"
|
||||||
hide-selected
|
:fields="['id', 'name', 'nickname']"
|
||||||
option-label="name"
|
:sort-by="'name ASC'"
|
||||||
option-value="id"
|
/>
|
||||||
>
|
|
||||||
<template #option="{ opt, itemProps }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ opt.name }}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ opt.nickname }}, {{ opt.code }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template></VnSelect
|
|
||||||
>
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModelPopup>
|
</FormModelPopup>
|
||||||
|
|
|
@ -14,6 +14,7 @@ import FormModel from 'components/FormModel.vue';
|
||||||
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
||||||
import VnRadio from 'src/components/common/VnRadio.vue';
|
import VnRadio from 'src/components/common/VnRadio.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const user = useState().getUser();
|
const user = useState().getUser();
|
||||||
|
@ -149,27 +150,15 @@ async function autofillBic(worker) {
|
||||||
hide-selected
|
hide-selected
|
||||||
:rules="validate('Worker.company')"
|
:rules="validate('Worker.company')"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('worker.summary.boss')"
|
:label="t('worker.summary.boss')"
|
||||||
v-model="data.bossFk"
|
v-model="data.bossFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
option-value="id"
|
:option-value="'id'"
|
||||||
option-label="name"
|
:option-label="'name'"
|
||||||
hide-selected
|
:fields="['id', 'name', 'nickname']"
|
||||||
:rules="validate('Worker.boss')"
|
:rules="validate('Worker.boss')"
|
||||||
>
|
/>
|
||||||
<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>
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -15,6 +15,7 @@ import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||||
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
import WorkerFilter from './WorkerFilter.vue';
|
import WorkerFilter from './WorkerFilter.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -260,26 +261,14 @@ async function autofillBic(worker) {
|
||||||
option-label="code"
|
option-label="code"
|
||||||
hide-selected
|
hide-selected
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('worker.summary.boss')"
|
:label="t('worker.summary.boss')"
|
||||||
v-model="data.bossFk"
|
v-model="data.bossFk"
|
||||||
url="Workers/search"
|
:url="'Workers/search'"
|
||||||
option-value="id"
|
:option-value="'id'"
|
||||||
option-label="name"
|
:option-label="'name'"
|
||||||
hide-selected
|
:fields="['id', 'name', 'nickname']"
|
||||||
>
|
/>
|
||||||
<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>
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
|
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
|
||||||
|
|
Loading…
Reference in New Issue