fix(04): Service
This commit is contained in:
parent
d41a2ad010
commit
68038c5a09
5 changed files with 165 additions and 45 deletions
|
|
@ -266,16 +266,6 @@ const formDataProductService = ref<ServiceCreate>({
|
|||
registeredBranchId: '',
|
||||
});
|
||||
|
||||
const serviceTab = [
|
||||
{
|
||||
name: 'serviceInformation',
|
||||
label: 'serviceInformation',
|
||||
},
|
||||
{
|
||||
name: 'workInformation',
|
||||
label: 'workInformation',
|
||||
},
|
||||
];
|
||||
const hideStat = ref(false);
|
||||
|
||||
const tbColumn = {
|
||||
|
|
@ -1054,9 +1044,10 @@ function assignFormDataProductServiceCreate() {
|
|||
|
||||
async function submitService() {
|
||||
assignFormDataProductServiceCreate();
|
||||
formDataProductService.value.image = imageProduct.value;
|
||||
formDataProductService.value.productTypeId = currentIdType.value;
|
||||
|
||||
if (profileFileImg.value)
|
||||
formDataProductService.value.image = profileFileImg.value;
|
||||
if (dialogService.value) {
|
||||
formDataProductService.value.productTypeId = currentIdType.value;
|
||||
|
||||
|
|
@ -2935,7 +2926,8 @@ watch(
|
|||
? 'mdi-shopping'
|
||||
: 'mdi-server-network'
|
||||
"
|
||||
style="color: var(--teal-10); top: 10%"
|
||||
style="top: 10%"
|
||||
:style="`color: var(--${productAndServiceTab === 'product' ? 'teal-10' : 'orange-5'})`"
|
||||
/>
|
||||
</template>
|
||||
</q-img>
|
||||
|
|
@ -3775,7 +3767,7 @@ watch(
|
|||
:toggleTitle="$t('formDialogTitleUseStatus')"
|
||||
:img="profileUrl || '/images/product-avatar-add.png'"
|
||||
fallbackCover="/images/product-banner.png"
|
||||
bgColor="#ebf1ee"
|
||||
:bgColor="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`"
|
||||
:menu="[
|
||||
{
|
||||
icon: 'mdi-office-building-outline',
|
||||
|
|
@ -3893,7 +3885,7 @@ watch(
|
|||
:toggleTitle="$t('formDialogTitleUseStatus')"
|
||||
:img="profileUrl || '/images/product-avatar.png'"
|
||||
fallbackCover="/images/product-banner.png"
|
||||
bgColor="#ebf1ee"
|
||||
:bgColor="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`"
|
||||
:menu="[
|
||||
{
|
||||
icon: 'mdi-office-building-outline',
|
||||
|
|
@ -4039,15 +4031,20 @@ watch(
|
|||
useToggle
|
||||
hideActive
|
||||
:toggleTitle="$t('formDialogTitleUseStatus')"
|
||||
:img="profileUrl || '/images/product-avatar-add.png'"
|
||||
fallbackCover="/images/product-banner.png"
|
||||
bgColor="#ebf1ee"
|
||||
:img="profileUrl || '/images/service-avatar-add.png'"
|
||||
fallbackCover="/images/service-banner.png"
|
||||
:bgColor="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`"
|
||||
:menu="[
|
||||
{
|
||||
icon: 'mdi-office-building-outline',
|
||||
color: 'hsl(var(--info-bg))',
|
||||
bgColor: 'var(--surface-1)',
|
||||
},
|
||||
{
|
||||
icon: 'mdi-briefcase-outline',
|
||||
color: 'hsl(var(--info-bg))',
|
||||
bgColor: 'var(--surface-1)',
|
||||
},
|
||||
]"
|
||||
@view="imageDialog = true"
|
||||
@edit="refImageUpload && refImageUpload.browse()"
|
||||
|
|
@ -4128,6 +4125,7 @@ watch(
|
|||
<div
|
||||
class="col-2 surface-1 q-mx-lg q-mb-lg rounded bordered row"
|
||||
v-if="currentServiceTab === 1"
|
||||
style="overflow: hidden"
|
||||
>
|
||||
<FormServiceProperties
|
||||
v-model:service-attributes="formDataProductService.attributes"
|
||||
|
|
@ -4167,10 +4165,12 @@ watch(
|
|||
}
|
||||
"
|
||||
>
|
||||
<ServiceProperties
|
||||
v-model:properties-option="propertiesOption"
|
||||
v-model:form-service-properties="tempValueProperties"
|
||||
/>
|
||||
<div class="q-pa-lg full-height">
|
||||
<ServiceProperties
|
||||
v-model:properties-option="propertiesOption"
|
||||
v-model:form-service-properties="tempValueProperties"
|
||||
/>
|
||||
</div>
|
||||
</DialogForm>
|
||||
|
||||
<!-- manage work name -->
|
||||
|
|
@ -4200,7 +4200,6 @@ watch(
|
|||
height="95vh"
|
||||
:isEdit="infoServiceEdit"
|
||||
:title="$t('service')"
|
||||
:tabs-list="serviceTab"
|
||||
v-model:modal="dialogServiceEdit"
|
||||
:submit="
|
||||
() => {
|
||||
|
|
@ -4229,7 +4228,123 @@ watch(
|
|||
"
|
||||
:delete-data="() => deleteServiceById()"
|
||||
>
|
||||
<template #prepend>
|
||||
<div class="q-mx-lg q-mt-lg">
|
||||
<ProfileBanner
|
||||
hideFade
|
||||
useToggle
|
||||
hideActive
|
||||
:readonly="!infoServiceEdit"
|
||||
:toggleTitle="$t('formDialogTitleUseStatus')"
|
||||
:img="profileUrl || '/images/service-avatar-add.png'"
|
||||
fallbackCover="/images/service-banner.png"
|
||||
:bgColor="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`"
|
||||
:menu="[
|
||||
{
|
||||
icon: 'mdi-office-building-outline',
|
||||
color: 'hsl(var(--info-bg))',
|
||||
bgColor: 'var(--surface-1)',
|
||||
},
|
||||
{
|
||||
icon: 'mdi-briefcase-outline',
|
||||
color: 'hsl(var(--info-bg))',
|
||||
bgColor: 'var(--surface-1)',
|
||||
},
|
||||
]"
|
||||
@view="imageDialog = true"
|
||||
@edit="refImageUpload && refImageUpload.browse()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="col surface-1 q-mx-lg q-mt-lg q-mb-md rounded bordered scroll row relative-position"
|
||||
id="group-form"
|
||||
>
|
||||
<div
|
||||
class="col"
|
||||
style="height: 100%; max-height: 100; overflow-y: auto"
|
||||
v-if="$q.screen.gt.sm"
|
||||
>
|
||||
<div class="q-py-md q-pl-md q-pr-sm">
|
||||
<q-item
|
||||
v-for="v in 2"
|
||||
:key="v"
|
||||
dense
|
||||
clickable
|
||||
class="no-padding items-center rounded full-width"
|
||||
:class="{ 'q-mt-xs': v > 1 }"
|
||||
active-class="product-form-active"
|
||||
:active="currentServiceTab === v"
|
||||
@click="currentServiceTab = v"
|
||||
>
|
||||
<span class="full-width q-py-sm" style="padding-inline: 20px">
|
||||
{{ v === 1 ? $t('serviceInformation') : $t('workInformation') }}
|
||||
</span>
|
||||
</q-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="col-12 col-md-10 q-py-md q-pr-md q-pl-sm"
|
||||
id="customer-form-content"
|
||||
style="height: 100%; max-height: 100%; overflow-y: auto"
|
||||
>
|
||||
<BasicInformation
|
||||
v-if="currentServiceTab === 1"
|
||||
:readonly="!infoServiceEdit"
|
||||
dense
|
||||
service
|
||||
v-model:options-branch="branchOption"
|
||||
v-model:registered-branch-id="
|
||||
formDataProductService.registeredBranchId
|
||||
"
|
||||
v-model:service-code="formDataProductService.code"
|
||||
v-model:service-description="formDataProductService.detail"
|
||||
v-model:service-name-th="formDataProductService.name"
|
||||
/>
|
||||
|
||||
<FormServiceWork
|
||||
v-if="currentServiceTab === 2"
|
||||
:readonly="!infoServiceEdit"
|
||||
v-model:work-items="workItems"
|
||||
dense
|
||||
@addProduct="
|
||||
async (index) => {
|
||||
await fetchListOfProductIsAdd(currentIdType);
|
||||
currentWorkIndex = index;
|
||||
dialogTotalProduct = true;
|
||||
}
|
||||
"
|
||||
@manage-work-name="
|
||||
() => {
|
||||
manageWorkNameDialog = true;
|
||||
}
|
||||
"
|
||||
@work-properties="
|
||||
(index) => {
|
||||
currentWorkIndex = index;
|
||||
tempValueProperties = workItems[index].attributes;
|
||||
openPropertiesDialog('work');
|
||||
}
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="col-2 surface-1 q-mx-lg q-mb-lg rounded bordered row"
|
||||
v-if="currentServiceTab === 1"
|
||||
style="overflow: hidden"
|
||||
>
|
||||
<FormServiceProperties
|
||||
:readonly="!infoServiceEdit"
|
||||
v-model:service-attributes="formDataProductService.attributes"
|
||||
@service-properties="
|
||||
() => {
|
||||
tempValueProperties = formDataProductService.attributes;
|
||||
openPropertiesDialog('service');
|
||||
}
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<!-- <template #prepend>
|
||||
<ProfileUpload
|
||||
prefix-id="form-dialog-service"
|
||||
isService
|
||||
|
|
@ -4294,7 +4409,7 @@ watch(
|
|||
}
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</template> -->
|
||||
</DialogForm>
|
||||
|
||||
<q-dialog v-model="holdDialog" position="bottom">
|
||||
|
|
@ -4464,13 +4579,17 @@ watch(
|
|||
@save="handleImageUpload"
|
||||
>
|
||||
<template #error>
|
||||
<div class="full-height full-width" style="background: white">
|
||||
<div class="full-height full-width" style="background: var(--surface-1)">
|
||||
<div
|
||||
class="full-height full-width flex justify-center items-center"
|
||||
style="background: #ebf1ee"
|
||||
:style="`background: ${
|
||||
dialogProduct || dialogProductEdit
|
||||
? `hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`
|
||||
: `hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`
|
||||
}`"
|
||||
>
|
||||
<q-img
|
||||
src="/images/product-avatar.png"
|
||||
:src="`/images/${dialogProduct || dialogProductEdit ? 'product' : 'service'}-avatar.png`"
|
||||
fit="contain"
|
||||
style="height: 100%"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue