refactor: quotation
This commit is contained in:
parent
66b30b9e3f
commit
e4b9e186a8
3 changed files with 86 additions and 7 deletions
|
|
@ -26,6 +26,10 @@ defineProps<{
|
||||||
prefixId: string;
|
prefixId: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
defineEmits<{
|
||||||
|
(e: 'addCustomer'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
async function filter(
|
async function filter(
|
||||||
val: string,
|
val: string,
|
||||||
update: (...args: unknown[]) => void,
|
update: (...args: unknown[]) => void,
|
||||||
|
|
@ -123,7 +127,11 @@ async function filter(
|
||||||
@filter="(val, update) => filter(val, update, 'customer')"
|
@filter="(val, update) => filter(val, update, 'customer')"
|
||||||
>
|
>
|
||||||
<template #option="{ scope }">
|
<template #option="{ scope }">
|
||||||
<q-item clickable v-if="scope.index === 0">
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-if="scope.index === 0"
|
||||||
|
@click.stop="$emit('addCustomer')"
|
||||||
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
{{ $t('general.add', { text: $t('quotation.newCustomer') }) }}
|
{{ $t('general.add', { text: $t('quotation.newCustomer') }) }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
@ -136,6 +144,14 @@ async function filter(
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #noOption>
|
||||||
|
<q-item clickable @click.stop="$emit('addCustomer')">
|
||||||
|
<q-item-section>
|
||||||
|
{{ $t('general.add', { text: $t('quotation.newCustomer') }) }}
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
</SelectInput>
|
</SelectInput>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import useLoader from 'stores/loader';
|
||||||
import ProfileMenu from './ProfileMenu.vue';
|
import ProfileMenu from './ProfileMenu.vue';
|
||||||
import DrawerComponent from './DrawerComponent.vue';
|
import DrawerComponent from './DrawerComponent.vue';
|
||||||
import useUserStore from 'stores/user';
|
import useUserStore from 'stores/user';
|
||||||
import { CanvasComponent, FormDialog } from 'components/index';
|
import { CanvasComponent, DialogForm } from 'components/index';
|
||||||
import useOptionStore from 'stores/options';
|
import useOptionStore from 'stores/options';
|
||||||
import { dialog } from 'stores/utils';
|
import { dialog } from 'stores/utils';
|
||||||
import { setLocale } from 'src/utils/datetime';
|
import { setLocale } from 'src/utils/datetime';
|
||||||
|
|
@ -475,7 +475,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-page-container>
|
</q-page-container>
|
||||||
|
|
||||||
<FormDialog
|
<DialogForm
|
||||||
width="800px"
|
width="800px"
|
||||||
height="550px"
|
height="550px"
|
||||||
v-model:modal="canvasModal"
|
v-model:modal="canvasModal"
|
||||||
|
|
@ -497,7 +497,7 @@ onMounted(async () => {
|
||||||
style="color: hsl(var(--text-mute))"
|
style="color: hsl(var(--text-mute))"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</FormDialog>
|
</DialogForm>
|
||||||
|
|
||||||
<global-loading :visibility="visible" />
|
<global-loading :visibility="visible" />
|
||||||
</q-layout>
|
</q-layout>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,22 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { QSelect } from 'quasar';
|
import { QSelect, useQuasar } from 'quasar';
|
||||||
|
|
||||||
import WorkerItem from 'components/05_quotation/WorkerItem.vue';
|
import WorkerItem from 'components/05_quotation/WorkerItem.vue';
|
||||||
import QuotationFormInfo from './QuotationFormInfo.vue';
|
import QuotationFormInfo from './QuotationFormInfo.vue';
|
||||||
import { AddButton, SaveButton } from 'components/button';
|
import { AddButton, SaveButton } from 'components/button';
|
||||||
import ToggleButton from 'src/components/button/ToggleButton.vue';
|
import ToggleButton from 'src/components/button/ToggleButton.vue';
|
||||||
import ProductItem from 'src/components/05_quotation/ProductItem.vue';
|
import ProductItem from 'src/components/05_quotation/ProductItem.vue';
|
||||||
|
import { setLocale } from 'src/utils/datetime';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const { locale } = useI18n();
|
||||||
|
const $q = useQuasar();
|
||||||
|
|
||||||
const selectedBranchIssuer = ref('');
|
const selectedBranchIssuer = ref('');
|
||||||
const selectedCustomer = ref('');
|
const selectedCustomer = ref('');
|
||||||
const toggleWorker = ref(true);
|
const toggleWorker = ref(true);
|
||||||
|
|
@ -26,10 +31,60 @@ const dueDate = ref('');
|
||||||
const payType = ref('');
|
const payType = ref('');
|
||||||
const paySplitCount = ref(1);
|
const paySplitCount = ref(1);
|
||||||
const payBank = ref('');
|
const payBank = ref('');
|
||||||
|
|
||||||
|
function changeMode(mode: string) {
|
||||||
|
if (mode === 'light') {
|
||||||
|
localStorage.setItem('currentTheme', 'light');
|
||||||
|
$q.dark.set(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode === 'dark') {
|
||||||
|
localStorage.setItem('currentTheme', 'dark');
|
||||||
|
$q.dark.set(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode === 'baseOnDevice') {
|
||||||
|
localStorage.setItem('currentTheme', 'baseOnDevice');
|
||||||
|
if (
|
||||||
|
window.matchMedia &&
|
||||||
|
window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||||
|
) {
|
||||||
|
$q.dark.set(true);
|
||||||
|
} else {
|
||||||
|
$q.dark.set(false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const getCurLang = localStorage.getItem('currentLanguage');
|
||||||
|
if (getCurLang === 'English') {
|
||||||
|
locale.value = 'eng';
|
||||||
|
setLocale('en-gb');
|
||||||
|
}
|
||||||
|
if (getCurLang === 'ไทย') {
|
||||||
|
locale.value = 'tha';
|
||||||
|
setLocale('th');
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCurTheme = localStorage.getItem('currentTheme');
|
||||||
|
if (
|
||||||
|
getCurTheme === 'light' ||
|
||||||
|
getCurTheme === 'dark' ||
|
||||||
|
getCurTheme === 'baseOnDevice'
|
||||||
|
) {
|
||||||
|
changeMode(getCurTheme);
|
||||||
|
} else {
|
||||||
|
changeMode('light');
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="fullscreen column">
|
<div class="fullscreen column surface-0">
|
||||||
<div class="color-bar">
|
<div class="color-bar">
|
||||||
<div class="blue-segment"></div>
|
<div class="blue-segment"></div>
|
||||||
<div class="orange-segment"></div>
|
<div class="orange-segment"></div>
|
||||||
|
|
@ -357,4 +412,12 @@ const payBank = ref('');
|
||||||
:deep(.q-editor__toolbar-group):nth-child(2) {
|
:deep(.q-editor__toolbar-group):nth-child(2) {
|
||||||
margin-left: auto !important;
|
margin-left: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.q-editor__toolbar.row.no-wrap.scroll-x) {
|
||||||
|
background-color: var(--surface-2) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.q-editor__toolbar) {
|
||||||
|
border-color: var(--surface-3) !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue