fix: quotation select

This commit is contained in:
puriphatt 2024-10-04 09:45:05 +07:00
parent bab448f47b
commit 05779c760c
5 changed files with 18 additions and 11 deletions

View file

@ -17,13 +17,15 @@ const agentPrice = defineModel<boolean>('agentPrice');
const branchOption = ref(); const branchOption = ref();
const customerOption = ref(); const customerOption = ref();
defineProps<{ const props = defineProps<{
outlined?: boolean; outlined?: boolean;
readonly?: boolean; readonly?: boolean;
separator?: boolean; separator?: boolean;
employee?: boolean; employee?: boolean;
title?: string; title?: string;
inputOnly?: boolean; inputOnly?: boolean;
onCreate?: boolean;
}>(); }>();
defineEmits<{ defineEmits<{
@ -83,14 +85,14 @@ onMounted(async () => {
await init('', 'customer'); await init('', 'customer');
}); });
// watch( watch(
// () => branchId.value, () => branchId.value,
// async (v) => { async (v) => {
// if (v) { if (v && props.onCreate) {
// customerBranchId.value = ''; customerBranchId.value = '';
// } }
// }, },
// ); );
</script> </script>
<template> <template>
<div class="row"> <div class="row">
@ -133,6 +135,7 @@ onMounted(async () => {
<SelectInput <SelectInput
:readonly :readonly
incremental incremental
:disable="!branchId"
v-model="customerBranchId" v-model="customerBranchId"
class="col-md col-12" class="col-md col-12"
id="quotation-customer" id="quotation-customer"

View file

@ -158,7 +158,7 @@ const currentTab = defineModel<string>('currentTab');
class="col full-height column full-width" class="col full-height column full-width"
:class="{ :class="{
dark: $q.dark.isActive, dark: $q.dark.isActive,
'surface-0': !employee, 'surface-2': !employee,
'surface-tab': employee || tabsList, 'surface-tab': employee || tabsList,
}" }"
:style="`background: ${bgColor} !important`" :style="`background: ${bgColor} !important`"

View file

@ -145,7 +145,7 @@ function reset() {
<!-- body --> <!-- body -->
<div <div
class="col form-body full-width" class="col form-body full-width"
:class="`${bgColor || 'surface-0'} ${$q.dark.isActive && 'dark'}`" :class="`${bgColor || 'surface-2'} ${$q.dark.isActive && 'dark'}`"
> >
<slot></slot> <slot></slot>
<slot name="info"></slot> <slot name="info"></slot>

View file

@ -25,6 +25,7 @@ const props = withDefaults(
clearable?: boolean; clearable?: boolean;
incremental?: boolean; incremental?: boolean;
fillInput?: boolean; fillInput?: boolean;
disable?: boolean;
rules?: ((value: string) => string | true)[]; rules?: ((value: string) => string | true)[];
}>(), }>(),
@ -34,6 +35,7 @@ const props = withDefaults(
optionValue: 'value', optionValue: 'value',
hideSelected: true, hideSelected: true,
fillInput: true, fillInput: true,
disable: false,
}, },
); );
@ -65,6 +67,7 @@ watch(
:placeholder="placeholder" :placeholder="placeholder"
outlined outlined
:clearable :clearable
:disable
use-input use-input
emit-value emit-value
map-options map-options

View file

@ -860,6 +860,7 @@ watch(() => pageState.currentTab, fetchQuotationList);
style="height: 100%; max-height: 100%; overflow-y: auto" style="height: 100%; max-height: 100%; overflow-y: auto"
> >
<FormAbout <FormAbout
on-create
v-model:branch-id="branchId" v-model:branch-id="branchId"
v-model:customer-branch-id="quotationFormData.customerBranchId" v-model:customer-branch-id="quotationFormData.customerBranchId"
@add-customer="triggerSelectTypeCustomerd()" @add-customer="triggerSelectTypeCustomerd()"