feat: add installments validate

This commit is contained in:
Methapon2001 2024-12-20 09:40:16 +07:00
parent 85e27613e8
commit 1e660682a6
6 changed files with 35 additions and 31 deletions

View file

@ -23,6 +23,7 @@ const props = defineProps<{
readonly?: boolean;
separator?: boolean;
treeView?: boolean;
installments?: number;
priceDisplay?: {
price: boolean;
@ -188,9 +189,10 @@ watch(
:key="work.id"
:index="index"
:length="workItems.length"
:workIndex="index"
:readonly="readonly"
:priceDisplay="priceDisplay"
:work-index="index"
:readonly
:price-display
:installments
v-model:work-name="workItems[index].name"
v-model:product-items="work.product"
v-model:attributes="work.attributes"

View file

@ -18,7 +18,7 @@ const optionStore = useOptionStore();
const workflowStore = useWorkflowTemplate();
const { fetchListOfWork } = productServiceStore;
const { splitPay, workNameItems } = storeToRefs(productServiceStore);
const { workNameItems } = storeToRefs(productServiceStore);
const { data: workflowData } = storeToRefs(workflowStore);
@ -28,6 +28,7 @@ const props = withDefaults(
length: number;
index: number;
readonly?: boolean;
installments?: number;
priceDisplay?: {
price: boolean;
@ -445,7 +446,7 @@ watch(
<q-input
v-if="!readonly && $q.screen.gt.xs"
outlined
:max="splitPay"
:max="installments"
input-class="text-right no-padding"
for="input-bankbook"
hide-bottom-space
@ -454,12 +455,6 @@ watch(
type="number"
v-model="product.installmentNo"
min="0"
@update:model-value="
(v) => {
if (Number(v) > splitPay)
product.installmentNo = splitPay;
}
"
/>
</span>
</span>