refactor(04): show total price checkbox

This commit is contained in:
puriphatt 2024-08-16 15:33:07 +07:00
parent cc2e49f735
commit 5a3ae092c8
3 changed files with 15 additions and 3 deletions

View file

@ -28,7 +28,7 @@ function addWork() {
workItems.value.push({ workItems.value.push({
id: '', id: '',
name: '', name: '',
attributes: { additional: [] }, attributes: { additional: [], showTotalPrice: false },
product: [], product: [],
}); });
} }

View file

@ -209,7 +209,18 @@ defineEmits<{
class="q-py-xs text-weight-medium row justify-between items-center q-px-md" class="q-py-xs text-weight-medium row justify-between items-center q-px-md"
style="background-color: hsla(var(--info-bg) / 0.1)" style="background-color: hsla(var(--info-bg) / 0.1)"
> >
<span>{{ $t('productInWork') }} {{ workIndex + 1 }}</span> <span>
{{ $t('productInWork') }} {{ workIndex + 1 }}
<q-checkbox
size="xs"
class="q-pl-lg"
v-model="attributes.showTotalPrice"
:label="$t('service.showTotalPrice')"
style="color: hsl(var(--text-mute-2))"
:disable="readonly"
/>
</span>
<q-btn <q-btn
v-if="!readonly" v-if="!readonly"
id="btn-add-work-product" id="btn-add-work-product"
@ -271,7 +282,7 @@ defineEmits<{
<div class="row no-wrap"> <div class="row no-wrap">
<div class="bordered q-mx-md col-3 image-box"> <div class="bordered q-mx-md col-3 image-box">
<q-img <q-img
:src="`${baseUrl}/product/${product?.id}/image?ts=${Date.now()}`" :src="`${baseUrl}/product/${product?.id}/image`"
style="object-fit: cover; width: 100%; height: 100%" style="object-fit: cover; width: 100%; height: 100%"
> >
<template #error> <template #error>

View file

@ -66,6 +66,7 @@ export interface ServiceCreate {
} }
export interface Attributes { export interface Attributes {
showTotalPrice?: boolean;
additional: (PropString | PropNumber | PropDate | PropOptions)[]; additional: (PropString | PropNumber | PropDate | PropOptions)[];
} }