diff --git a/public/images/product-service-group-banner.png b/public/images/product-service-group-banner.png new file mode 100644 index 00000000..297ef281 Binary files /dev/null and b/public/images/product-service-group-banner.png differ diff --git a/src/components/04_product-service/BasicInformation.vue b/src/components/04_product-service/BasicInformation.vue index 698a1938..f166cbc8 100644 --- a/src/components/04_product-service/BasicInformation.vue +++ b/src/components/04_product-service/BasicInformation.vue @@ -7,6 +7,7 @@ import { ref } from 'vue'; const remark = defineModel('remark'); const detail = defineModel('detail'); const name = defineModel('name'); +const code = defineModel('code'); const serviceCode = defineModel('serviceCode'); const serviceName = defineModel('serviceNameTh'); @@ -37,130 +38,153 @@ const branchFilter = selectFilterOptionRefMod( diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index fc433013..edc88395 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -28,6 +28,9 @@ import InfoForm from 'components/02_personnel-management/InfoForm.vue'; import NoData from 'components/NoData.vue'; import PaginationComponent from 'src/components/PaginationComponent.vue'; import TreeCompoent from 'src/components/TreeCompoent.vue'; +import DialogForm from 'src/components/DialogForm.vue'; +import ProfileBanner from 'src/components/ProfileBanner.vue'; +import SideMenu from 'src/components/SideMenu.vue'; import useFlowStore from 'src/stores/flow'; import useMyBranchStore from 'src/stores/my-branch'; @@ -159,14 +162,14 @@ const treeProductTypeAndGroup = computed(() => { type: 'group', children: item.id === currentIdGrop.value - ? recordTreeProductType.value[currentIdGrop.value]?.map((x) => ({ + ? (recordTreeProductType.value[currentIdGrop.value]?.map((x) => ({ ...x, type: 'type', - })) ?? [] - : recordTreeProductType.value[item.id]?.map((x) => ({ + })) ?? []) + : (recordTreeProductType.value[item.id]?.map((x) => ({ ...x, type: 'type', - })) ?? item._count.type > 0 + })) ?? item._count.type > 0) ? [ { id: '', @@ -416,6 +419,9 @@ const currentIdType = ref(''); const currentIdService = ref(''); const currentIdProduct = ref(''); +const currentStatusGroup = ref('CREATED'); +const currentStatusType = ref('CREATED'); + const branchOption = ref<{ id: string; name: string }[]>([]); const currentStatus = ref('All'); @@ -688,9 +694,10 @@ async function toggleStatusType(id: string, status: Status) { } async function toggleStatusGroup(id: string, status: Status) { - await editProductService(id, { + const res = await editProductService(id, { status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', }); + if (res) currentStatusGroup.value = res.status; await fetchListGroups(); flowStore.rotate(); @@ -858,6 +865,8 @@ function undoProductGroup() { function assignFormDataGroup(data: ProductGroup) { previousValue.value = data; + currentStatusGroup.value = data.status; + currentIdGrop.value = data.id; formDataGroup.value = { remark: data.remark, @@ -975,7 +984,7 @@ function clearFormGroup() { name: '', code: '', }; - + currentStatusGroup.value = 'CREATED'; dialogInputForm.value = false; } @@ -3311,23 +3320,82 @@ watch( - - - + +
+
+
+ +
+
+
+ +
+
+ - + + +