refactor: 05 => add disabledSubmit prop to DialogForm and improve handling in QuotationForm

This commit is contained in:
puriphatt 2025-02-03 10:14:51 +07:00
parent d268764024
commit e2bd6a6334
3 changed files with 4 additions and 0 deletions

View file

@ -23,6 +23,7 @@ defineProps<{
hideDelete?: boolean;
hideBtn?: boolean;
readonly?: boolean;
disabledSubmit?: boolean;
saveAmount?: number;
submitLabel?: string;
@ -235,6 +236,7 @@ const currentTab = defineModel<string>('currentTab');
id="btn-form-submit"
type="submit"
solid
:disabled="disabledSubmit"
:icon="submitIcon"
:label="submitLabel"
:amount="saveAmount"

View file

@ -823,6 +823,7 @@ function convertToTable(nodes: Node[]) {
return [];
};
const list = nodes.flatMap(_recursive).map((v) => v.value);
if (list.length === 0) return;
quotationFormData.value.paySplitCount = Math.max(
...list.map((v) => v.installmentNo || 0),

View file

@ -428,6 +428,7 @@ watch(
<template>
<div>
<DialogForm
:disabled-submit="countCheckedProducts(nodes) === 0"
bg-color="var(--surface-2)"
v-model:modal="model"
:title="$t('general.list', { msg: $t('productService.title') })"