refactor: add required validation to quotation selection and enhance button disable logic in credit and debit note forms
This commit is contained in:
parent
a6a997e55f
commit
ea1c1b71fc
5 changed files with 8 additions and 3 deletions
|
|
@ -29,6 +29,7 @@ const quotationId = defineModel<string>('quotationId', {
|
||||||
<section class="col-12 row q-col-gutter-sm">
|
<section class="col-12 row q-col-gutter-sm">
|
||||||
<SelectQuotation
|
<SelectQuotation
|
||||||
for="select-quotation"
|
for="select-quotation"
|
||||||
|
required
|
||||||
class="col"
|
class="col"
|
||||||
v-model:value="quotationId"
|
v-model:value="quotationId"
|
||||||
:label="$t('general.select', { msg: $t('quotation.title') })"
|
:label="$t('general.select', { msg: $t('quotation.title') })"
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ const quotationId = defineModel<string>('quotationId', {
|
||||||
<section class="col-12 row q-col-gutter-sm">
|
<section class="col-12 row q-col-gutter-sm">
|
||||||
<SelectQuotation
|
<SelectQuotation
|
||||||
for="select-quotation"
|
for="select-quotation"
|
||||||
|
required
|
||||||
class="col"
|
class="col"
|
||||||
v-model:value="quotationId"
|
v-model:value="quotationId"
|
||||||
:label="$t('general.select', { msg: $t('quotation.title') })"
|
:label="$t('general.select', { msg: $t('quotation.title') })"
|
||||||
|
|
|
||||||
|
|
@ -807,6 +807,7 @@ onMounted(async () => {
|
||||||
<!-- @click="submit" -->
|
<!-- @click="submit" -->
|
||||||
<SaveButton
|
<SaveButton
|
||||||
v-if="!readonly"
|
v-if="!readonly"
|
||||||
|
:disabled="taskListGroup.length === 0"
|
||||||
type="submit"
|
type="submit"
|
||||||
@click.stop="(e) => refForm?.submit(e)"
|
@click.stop="(e) => refForm?.submit(e)"
|
||||||
:label="$t('creditNote.label.submit')"
|
:label="$t('creditNote.label.submit')"
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,8 @@ const detail = defineModel<string>('detail');
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
class="col"
|
class="col"
|
||||||
v-model="detail"
|
:model-value="readonly ? detail || '-' : detail"
|
||||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
@update:model-value="(v) => (detail = v?.toString())"
|
||||||
></q-input>
|
></q-input>
|
||||||
</main>
|
</main>
|
||||||
</q-expansion-item>
|
</q-expansion-item>
|
||||||
|
|
|
||||||
|
|
@ -987,7 +987,6 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- #TODO add openProductDialog at @add-product-->
|
<!-- #TODO add openProductDialog at @add-product-->
|
||||||
|
|
||||||
<ProductExpansion
|
<ProductExpansion
|
||||||
v-if="view === null"
|
v-if="view === null"
|
||||||
:readonly
|
:readonly
|
||||||
|
|
@ -1179,6 +1178,9 @@ onMounted(async () => {
|
||||||
|
|
||||||
<SaveButton
|
<SaveButton
|
||||||
v-if="!readonly && pageState.mode === 'create'"
|
v-if="!readonly && pageState.mode === 'create'"
|
||||||
|
:disabled="
|
||||||
|
selectedWorkerItem.length === 0 && productService.length === 0
|
||||||
|
"
|
||||||
@click="submit"
|
@click="submit"
|
||||||
:label="true ? $t('debitNote.label.submit') : $t('general.save')"
|
:label="true ? $t('debitNote.label.submit') : $t('general.save')"
|
||||||
:icon="
|
:icon="
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue