From d67e6e13dda618d29b8ae3064aabf6b1e566b99f Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 25 Jun 2024 09:35:06 +0000 Subject: [PATCH] fix: new service & work properties --- .../04_product-service/BasicInformation.vue | 20 +- .../FormServiceProperties.vue | 63 ++++ .../04_product-service/FormServiceWork.vue | 2 +- .../WorkManagementComponent.vue | 291 ++++++++++-------- src/i18n/en-US/product-service.ts | 6 + src/i18n/th-th/product-service.ts | 6 + src/pages/04_product-service/MainPage.vue | 113 ++++--- 7 files changed, 312 insertions(+), 189 deletions(-) create mode 100644 src/components/04_product-service/FormServiceProperties.vue diff --git a/src/components/04_product-service/BasicInformation.vue b/src/components/04_product-service/BasicInformation.vue index 075e836d..8eb4e5d5 100644 --- a/src/components/04_product-service/BasicInformation.vue +++ b/src/components/04_product-service/BasicInformation.vue @@ -106,25 +106,7 @@ defineEmits<{ class="col-9" :label="$t('serviceName')" v-model="serviceName" - > - - + />
+import useOptionStore from 'src/stores/options'; +import { Attributes } from 'src/stores/product-service/types'; +import { Icon } from '@iconify/vue'; + +const optionStore = useOptionStore(); + +defineProps<{ + readonly?: boolean; +}>(); + +const serviceAttributes = defineModel('serviceAttributes', { + required: true, +}); + +defineEmits<{ + (e: 'serviceProperties'): void; +}>(); + + diff --git a/src/components/04_product-service/FormServiceWork.vue b/src/components/04_product-service/FormServiceWork.vue index 69d9d1c3..b2e916f9 100644 --- a/src/components/04_product-service/FormServiceWork.vue +++ b/src/components/04_product-service/FormServiceWork.vue @@ -50,7 +50,7 @@ function confirmDelete(items: unknown[], index: number) {
-
- {{ $t('productInWork') }} {{ workIndex + 1 }} - + +
+
+ {{ $t('propertiesInWork') }} {{ workIndex + 1 }} + + + {{ $t('properties') }} + +
+ +
+
+
+ {{ optionStore.mapOption(p.fieldName ?? '') }} +
+
+
+ {{ $t('noProperties') }} +
+
-
+ +
+ {{ $t('productInWork') }} {{ workIndex + 1 }} + +
+ +
-
- - +
+
+ + - - {{ index + 1 }} - + + {{ index + 1 }} + -
-
- -
-
- - {{ - $i18n.locale === 'en-US' ? product.nameEn : product.name - }} - +
+
+ +
+
+ {{ $i18n.locale === 'en-US' ? product.nameEn : product.name }} - - -
- {{ product.code }} + + {{ + $i18n.locale === 'en-US' + ? product.nameEn + : product.name + }} + + +
+ {{ product.code }} +
+ +
+ + ฿ {{ formatNumberDecimal(product.price, 2) }} + + + {{ $t('processTime') }} + + + {{ product.process }} {{ $t('day') }} + +
-
- - ฿ {{ formatNumberDecimal(product.price, 2) }} - - - {{ $t('processTime') }} - - - {{ product.process }} {{ $t('day') }} - -
+
- - +
+
+ {{ $t('noProduct') }}
diff --git a/src/i18n/en-US/product-service.ts b/src/i18n/en-US/product-service.ts index fea3aaac..c1e34332 100644 --- a/src/i18n/en-US/product-service.ts +++ b/src/i18n/en-US/product-service.ts @@ -49,6 +49,10 @@ export default { addWork: 'Add work', properties: 'Properties', + noProperties: 'No Properties', + serviceProperties: 'Service Properties', + workProperties: 'Work Properties', + propertiesInWork: 'Properties in work', text: 'Text', number: 'Number', date: 'Date', @@ -61,4 +65,6 @@ export default { telMaxLength: 'Max Length', addSelection: 'Add Selection', selectAll: 'Select All', + + noProduct: 'No Product', }; diff --git a/src/i18n/th-th/product-service.ts b/src/i18n/th-th/product-service.ts index 1575a436..a93917f2 100644 --- a/src/i18n/th-th/product-service.ts +++ b/src/i18n/th-th/product-service.ts @@ -49,6 +49,10 @@ export default { addWork: 'เพิ่มงานใหม่', properties: 'คุณสมบัติ', + noProperties: 'ยังไม่มีคุณสมบัติ', + serviceProperties: 'คุณสมบัติของบริการ', + workProperties: 'คุณสมบัติของงาน', + propertiesInWork: 'คุณสมบัติภายในงาน', text: 'ข้อความ', number: 'ตัวเลข', date: 'วันที่', @@ -61,4 +65,6 @@ export default { telMaxLength: 'จำนวนหลัก', addSelection: 'เพิ่มตัวเลือก', selectAll: 'เลือกทั้งหมด', + + noProduct: 'ยังไม่มีสินค้า', }; diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index 1ab24b82..224976dc 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -18,6 +18,7 @@ import FormServiceWork from 'src/components/04_product-service/FormServiceWork.v import ServiceProperties from 'src/components/04_product-service/ServiceProperties.vue'; import WorkNameManagement from 'src/components/04_product-service/WorkNameManagement.vue'; import useOptionStore from 'src/stores/options'; +import FormServiceProperties from 'src/components/04_product-service/FormServiceProperties.vue'; import { Status } from 'src/stores/types'; import NoData from 'components/NoData.vue'; @@ -1789,6 +1790,7 @@ watch(currentStatus, async () => { { /> - +
@@ -1914,6 +1933,7 @@ watch(currentStatus, async () => { { /> - +