refactor(04): i18n

This commit is contained in:
puriphatt 2024-08-16 17:08:59 +07:00
parent c1a8e18429
commit 4fedd3ad6a
4 changed files with 48 additions and 24 deletions

View file

@ -216,7 +216,7 @@ defineEmits<{
size="xs" size="xs"
class="q-pl-lg" class="q-pl-lg"
v-model="attributes.showTotalPrice" v-model="attributes.showTotalPrice"
:label="$t('service.showTotalPrice')" :label="$t('productService.service.showTotalPrice')"
style="color: hsl(var(--text-mute-2))" style="color: hsl(var(--text-mute-2))"
:disable="readonly" :disable="readonly"
/> />

View file

@ -159,10 +159,19 @@ export default {
attachment: 'Attachment', attachment: 'Attachment',
}, },
}, },
service: { productService: {
title: 'Service', group: {
showTotalPrice: 'Show Total Price', addTitle: 'Add Product and Service Group',
},
type: {
addTitle: 'Add Product and Service Type',
},
service: {
title: 'Service',
showTotalPrice: 'Show Total Price',
},
}, },
backend: { backend: {
sameBranchCodeExists: 'This Head Office Abbreviation is already in use.', sameBranchCodeExists: 'This Head Office Abbreviation is already in use.',
}, },

View file

@ -163,10 +163,19 @@ export default {
attachment: 'เอกสารเพิ่มเติม', attachment: 'เอกสารเพิ่มเติม',
}, },
}, },
service: { productService: {
title: 'บริการ', group: {
showTotalPrice: 'แสดงราคารวม', addTitle: 'เพิ่มกลุ่มสินค้าและบริการ',
},
type: {
addTitle: 'เพิ่มประเภทสินค้าและบริการ',
},
service: {
title: 'บริการ',
showTotalPrice: 'แสดงราคารวม',
},
}, },
backend: { backend: {
sameBranchCodeExists: 'ตัวย่อสำนักงานใหญ่นี้ถูกใช้แล้ว', sameBranchCodeExists: 'ตัวย่อสำนักงานใหญ่นี้ถูกใช้แล้ว',
}, },

View file

@ -123,7 +123,7 @@ const stat = ref<
{ {
icon: 'mdi-server-network', icon: 'mdi-server-network',
count: 0, count: 0,
label: 'service.title', label: 'productService.service.title',
mode: 'service', mode: 'service',
color: 'orange', color: 'orange',
}, },
@ -976,7 +976,7 @@ function assignFormDataProduct(data: ProductList) {
agentPrice: data.agentPrice, agentPrice: data.agentPrice,
price: data.price, price: data.price,
process: data.process, process: data.process,
detail: data.detail === '' ? '-' : data.detail, detail: data.detail,
name: data.name, name: data.name,
code: data.code, code: data.code,
image: undefined, image: undefined,
@ -2811,7 +2811,7 @@ watch(
: 'app-text-muted' : 'app-text-muted'
" "
> >
{{ $t('service.title') }} {{ $t('productService.service.title') }}
</div> </div>
</q-tab> </q-tab>
<q-tab <q-tab
@ -2988,7 +2988,12 @@ watch(
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="col">{{ props.row.name }}</div> <div class="col ellipsis" style="max-width: 20vw">
{{ props.row.name }}
<q-tooltip>
{{ props.row.name }}
</q-tooltip>
</div>
<div class="col app-text-muted"> <div class="col app-text-muted">
{{ props.row.code }} {{ props.row.code }}
</div> </div>
@ -3008,7 +3013,7 @@ watch(
) )
" "
> >
{{ props.row.detail }} {{ props.row.detail || '-' }}
</q-td> </q-td>
<q-td <q-td
v-if=" v-if="
@ -3044,35 +3049,35 @@ watch(
" "
> >
<div <div
class="row q-gutter-x-md no-wrap items-center text-right" class="row full-width q-gutter-x-md no-wrap items-center text-right"
> >
<div <div
class="tags tags-color-orange col-3 column ellipsis-2-lines" class="tags tags-color-orange col column ellipsis-2-lines"
:class="{ :class="{
disable: props.row.status === 'INACTIVE', disable: props.row.status === 'INACTIVE',
}" }"
style="min-width: 50px" style="min-width: 50px"
> >
<div class="col-4 app-text-muted-2"> <div class="col app-text-muted-2 text-caption">
{{ $t('salePrice') }} {{ $t('salePrice') }}
</div> </div>
<div class="col-4 text-weight-bold"> <div class="col text-weight-bold">
฿{{ ฿{{
formatNumberDecimal(props.row.price || 0, 2) formatNumberDecimal(props.row.price || 0, 2)
}} }}
</div> </div>
</div> </div>
<div <div
class="tags tags-color-purple col-3 column ellipsis-2-lines" class="tags tags-color-purple col column ellipsis-2-lines"
:class="{ :class="{
disable: props.row.status === 'INACTIVE', disable: props.row.status === 'INACTIVE',
}" }"
style="min-width: 50px" style="min-width: 50px"
> >
<div class="col-4 app-text-muted-2"> <div class="col app-text-muted-2 text-caption">
{{ $t('agentPrice') }} {{ $t('agentPrice') }}
</div> </div>
<div class="col-4 text-weight-bold"> <div class="col text-weight-bold">
฿{{ ฿{{
formatNumberDecimal( formatNumberDecimal(
props.row.agentPrice || 0, props.row.agentPrice || 0,
@ -3082,16 +3087,16 @@ watch(
</div> </div>
</div> </div>
<div <div
class="tags tags-color-pink col-3 column ellipsis-2-lines" class="tags tags-color-pink col-4 column ellipsis-2-lines"
:class="{ :class="{
disable: props.row.status === 'INACTIVE', disable: props.row.status === 'INACTIVE',
}" }"
style="min-width: 50px" style="min-width: 50px"
> >
<div class="col-4 app-text-muted-2"> <div class="col app-text-muted-2 text-caption">
{{ $t('processingPrice') }} {{ $t('processingPrice') }}
</div> </div>
<div class="col-4"> <div class="col">
฿{{ ฿{{
formatNumberDecimal( formatNumberDecimal(
props.row.serviceCharge || 0, props.row.serviceCharge || 0,
@ -3431,10 +3436,11 @@ watch(
</div> </div>
</div> </div>
<!-- add group, add type -->
<DialogForm <DialogForm
v-model:modal="dialogInputForm" v-model:modal="dialogInputForm"
noAddress noAddress
:title="$t('addProduct')" :title="$t(`productService.${productMode}.addTitle`)"
:submit="() => (productMode === 'type' ? submitType() : submitGroup())" :submit="() => (productMode === 'type' ? submitType() : submitGroup())"
:close="clearFormGroup" :close="clearFormGroup"
> >
@ -4292,7 +4298,7 @@ watch(
no-address no-address
height="95vh" height="95vh"
:isEdit="infoServiceEdit" :isEdit="infoServiceEdit"
:title="$t('service.title')" :title="$t('productService.service.title')"
v-model:modal="dialogServiceEdit" v-model:modal="dialogServiceEdit"
:submit=" :submit="
() => { () => {