refactor: edit name defineModel

This commit is contained in:
Thanaphon Frappet 2024-10-02 14:04:23 +07:00
parent 882b5fb753
commit d7a99d2ee2
13 changed files with 241 additions and 269 deletions

View file

@ -8,7 +8,7 @@ const codeSubBranch = defineModel<string>('codeSubBranch');
const taxNo = defineModel<string>('taxNo'); const taxNo = defineModel<string>('taxNo');
const name = defineModel<string>('name'); const name = defineModel<string>('name');
const abbreviation = defineModel<string>('abbreviation'); const abbreviation = defineModel<string>('abbreviation');
const nameEN = defineModel<string>('nameEN'); const nameEN = defineModel<string>('nameEn');
const typeBranch = defineModel<string>('typeBranch'); const typeBranch = defineModel<string>('typeBranch');
const virtual = defineModel<boolean>('virtual'); const virtual = defineModel<boolean>('virtual');

View file

@ -32,7 +32,7 @@ const importNationality = defineModel<string | null | undefined>(
); );
const trainingPlace = defineModel<string | null | undefined>('trainingPlace'); const trainingPlace = defineModel<string | null | undefined>('trainingPlace');
const checkpoint = defineModel<string | null | undefined>('checkPoint'); const checkpoint = defineModel<string | null | undefined>('checkPoint');
const checkpointEN = defineModel<string | null | undefined>('checkPointEN'); const checkpointEN = defineModel<string | null | undefined>('checkPointEn');
const agencyFile = defineModel<File[]>('agencyFile'); const agencyFile = defineModel<File[]>('agencyFile');
const agencyFileList = const agencyFileList =
defineModel<{ name: string; url: string }[]>('agencyFileList'); defineModel<{ name: string; url: string }[]>('agencyFileList');

View file

@ -11,15 +11,15 @@ const optionStore = useOptionStore();
const prefixName = defineModel<string | null>('prefixName'); const prefixName = defineModel<string | null>('prefixName');
const firstName = defineModel<string>('firstName'); const firstName = defineModel<string>('firstName');
const lastName = defineModel<string>('lastName'); const lastName = defineModel<string>('lastName');
const firstNameEN = defineModel<string>('firstNameEN'); const firstNameEN = defineModel<string>('firstNameEn');
const lastNameEN = defineModel<string>('lastNameEN'); const lastNameEN = defineModel<string>('lastNameEn');
const telephoneNo = defineModel<string>('telephoneNo'); const telephoneNo = defineModel<string>('telephoneNo');
const email = defineModel<string>('email'); const email = defineModel<string>('email');
const gender = defineModel<string>('gender'); const gender = defineModel<string>('gender');
const birthDate = defineModel<Date | string | null>('birthDate'); const birthDate = defineModel<Date | string | null>('birthDate');
const nationality = defineModel<string>('nationality'); const nationality = defineModel<string>('nationality');
const midName = defineModel<string | null>('midName'); const midName = defineModel<string | null>('midName');
const midNameEN = defineModel<string | null>('midNameEN'); const midNameEN = defineModel<string | null>('midNameEn');
const citizenId = defineModel<string>('citizenId'); const citizenId = defineModel<string>('citizenId');
const citizenIssue = defineModel<Date | null>('citizenIssue'); const citizenIssue = defineModel<Date | null>('citizenIssue');
const citizenExpire = defineModel<Date | null>('citizenExpire'); const citizenExpire = defineModel<Date | null>('citizenExpire');

View file

@ -216,6 +216,7 @@ defineEmits<{
<q-td> <q-td>
<q-btn <q-btn
:id="`btn-eye-${props.row.firstName}`"
icon="mdi-eye-outline" icon="mdi-eye-outline"
size="sm" size="sm"
dense dense
@ -223,9 +224,8 @@ defineEmits<{
flat flat
@click.stop="$emit('view', props.row)" @click.stop="$emit('view', props.row)"
/> />
<KebabAction <KebabAction
:id-name="props.row.code" :id-name="props.row.firstName"
:status="props.row.status" :status="props.row.status"
@view="$emit('view', props.row)" @view="$emit('view', props.row)"
@edit="$emit('edit', props.row)" @edit="$emit('edit', props.row)"

View file

@ -1507,7 +1507,7 @@ watch(currentHq, () => {
} }
" "
@delete="triggerDelete(props.row.id)" @delete="triggerDelete(props.row.id)"
@changeStatus=" @change-status="
async () => { async () => {
const res = await triggerChangeStatus( const res = await triggerChangeStatus(
props.row.id, props.row.id,
@ -1692,9 +1692,9 @@ watch(currentHq, () => {
> >
<ProfileBanner <ProfileBanner
active active
useToggle use-toggle
:title="formData.name" :title="formData.name"
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:caption=" :caption="
formTypeBranch === 'headOffice' formTypeBranch === 'headOffice'
? `${formData.code}` ? `${formData.code}`
@ -1702,7 +1702,7 @@ watch(currentHq, () => {
" "
v-model:toggle-status="formData.status" v-model:toggle-status="formData.status"
v-model:cover-url="imageUrl" v-model:cover-url="imageUrl"
:hideFade="imageUrl === '' || imageUrl === null" :hide-fade="imageUrl === '' || imageUrl === null"
:img="imageUrl || null" :img="imageUrl || null"
icon="mdi-office-building-outline" icon="mdi-office-building-outline"
:color="`hsla(var(${ :color="`hsla(var(${
@ -1862,13 +1862,13 @@ watch(currentHq, () => {
> >
<FormBranchInformation <FormBranchInformation
id="form-information" id="form-information"
v-model:branchCount="formLastSubBranch" v-model:branch-count="formLastSubBranch"
v-model:abbreviation="formData.code" v-model:abbreviation="formData.code"
v-model:code="formData.codeHeadOffice" v-model:code="formData.codeHeadOffice"
v-model:code-sub-branch="currentEdit.code" v-model:code-sub-branch="currentEdit.code"
v-model:taxNo="formData.taxNo" v-model:tax-no="formData.taxNo"
v-model:name="formData.name" v-model:name="formData.name"
v-model:nameEN="formData.nameEN" v-model:name-en="formData.nameEN"
v-model:type-branch="formTypeBranch" v-model:type-branch="formTypeBranch"
v-model:permit-no="formData.permitNo" v-model:permit-no="formData.permitNo"
v-model:permit-issue-date="formData.permitIssueDate" v-model:permit-issue-date="formData.permitIssueDate"
@ -2219,9 +2219,9 @@ watch(currentHq, () => {
v-model:abbreviation="formData.code" v-model:abbreviation="formData.code"
v-model:code="formData.codeHeadOffice" v-model:code="formData.codeHeadOffice"
v-model:code-sub-branch="currentEdit.code" v-model:code-sub-branch="currentEdit.code"
v-model:taxNo="formData.taxNo" v-model:tax-no="formData.taxNo"
v-model:name="formData.name" v-model:name="formData.name"
v-model:nameEN="formData.nameEN" v-model:name-en="formData.nameEN"
v-model:type-branch="formTypeBranch" v-model:type-branch="formTypeBranch"
v-model:permit-no="formData.permitNo" v-model:permit-no="formData.permitNo"
v-model:permit-issue-date="formData.permitIssueDate" v-model:permit-issue-date="formData.permitIssueDate"
@ -2355,7 +2355,7 @@ watch(currentHq, () => {
} }
} }
" "
@deleteFile=" @delete-file="
async (filename) => { async (filename) => {
const res = await branchStore.deleteByIdAttachment( const res = await branchStore.deleteByIdAttachment(
currentId, currentId,
@ -2523,7 +2523,7 @@ watch(currentHq, () => {
<QrCodeUploadDialog <QrCodeUploadDialog
ref="refQrCodeUpload" ref="refQrCodeUpload"
v-model:dialogState="qrCodeDialog" v-model:dialog-state="qrCodeDialog"
v-model:file="statusQrCodeFile as File" v-model:file="statusQrCodeFile as File"
v-model:image-url="statusQrCodeUrl" v-model:image-url="statusQrCodeUrl"
@save=" @save="
@ -2552,13 +2552,13 @@ watch(currentHq, () => {
<ImageUploadDialog <ImageUploadDialog
ref="refImageUpload" ref="refImageUpload"
v-model:dialogState="imageDialog" v-model:dialog-state="imageDialog"
v-model:file="profileFile" v-model:file="profileFile"
v-model:image-url="imageUrl" v-model:image-url="imageUrl"
v-model:data-list="imageList" v-model:data-list="imageList"
v-model:on-create-data-list="onCreateImageList" v-model:on-create-data-list="onCreateImageList"
:on-create="modal" :on-create="modal"
:hiddenFooter="!isImageEdit" :hidden-footer="!isImageEdit"
@add-image=" @add-image="
async (v) => { async (v) => {
if (!v) return; if (!v) return;

View file

@ -800,7 +800,7 @@ watch(
<div style="display: inline-block"> <div style="display: inline-block">
<StatCardComponent <StatCardComponent
v-if="typeStats && userData?.result" v-if="typeStats && userData?.result"
labelI18n label-i18n
:branch=" :branch="
currentTab === 'ALL' currentTab === 'ALL'
? Object.entries(typeStats).map(([key, val]) => ({ ? Object.entries(typeStats).map(([key, val]) => ({
@ -1509,7 +1509,7 @@ watch(
:category="$t('personnel.personnel')" :category="$t('personnel.personnel')"
bg-on bg-on
hide-action hide-action
:isEdit="infoDrawerEdit" :is-edit="infoDrawerEdit"
:title=" :title="
locale === 'eng' locale === 'eng'
? `${currentUser.firstNameEN} ${currentUser.lastNameEN}` ? `${currentUser.firstNameEN} ${currentUser.lastNameEN}`
@ -1544,7 +1544,7 @@ watch(
v-model:toggle-status="formData.status" v-model:toggle-status="formData.status"
hideFade hideFade
:menu="formMenuIcon" :menu="formMenuIcon"
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:title="`${locale === 'eng' ? `${formData.firstNameEN} ${formData.lastNameEN}` : `${formData.firstName} ${formData.lastName}`}`" :title="`${locale === 'eng' ? `${formData.firstNameEN} ${formData.lastNameEN}` : `${formData.firstName} ${formData.lastName}`}`"
:caption="userCode" :caption="userCode"
:img=" :img="
@ -1556,7 +1556,7 @@ watch(
female: '/no-img-female.png', female: '/no-img-female.png',
}[formData.gender] }[formData.gender]
" "
:fallbackImg=" :fallback-img="
{ {
male: '/no-img-man.png', male: '/no-img-man.png',
female: '/no-img-female.png', female: '/no-img-female.png',
@ -1709,20 +1709,20 @@ watch(
separator separator
:title="'form.field.basicInformation'" :title="'form.field.basicInformation'"
:readonly="!infoDrawerEdit" :readonly="!infoDrawerEdit"
:usernameReadonly="isEdit" :username-readonly="isEdit"
class="q-mb-xl" class="q-mb-xl"
/> />
<FormPerson <FormPerson
id="info-personal" id="info-personal"
v-model:firstName="formData.firstName" v-model:first-name="formData.firstName"
v-model:lastName="formData.lastName" v-model:last-name="formData.lastName"
v-model:midName="formData.middleName" v-model:mid-name="formData.middleName"
v-model:midNameEN="formData.middleNameEN" v-model:mid-name-en="formData.middleNameEN"
v-model:prefixName="formData.namePrefix" v-model:prefix-name="formData.namePrefix"
v-model:prefixNameEN="formData.namePrefix" v-model:prefix-name-en="formData.namePrefix"
v-model:firstNameEN="formData.firstNameEN" v-model:first-name-en="formData.firstNameEN"
v-model:lastNameEN="formData.lastNameEN" v-model:last-name-en="formData.lastNameEN"
v-model:telephone-no="formData.telephoneNo" v-model:telephone-no="formData.telephoneNo"
v-model:email="formData.email" v-model:email="formData.email"
v-model:gender="formData.gender" v-model:gender="formData.gender"
@ -1765,20 +1765,20 @@ watch(
separator separator
id="info-work" id="info-work"
:readonly="!infoDrawerEdit" :readonly="!infoDrawerEdit"
v-model:userType="formData.userType" v-model:user-type="formData.userType"
v-model:registrationNo="formData.registrationNo" v-model:registration-no="formData.registrationNo"
v-model:startDate="formData.startDate" v-model:start-date="formData.startDate"
v-model:retireDate="formData.retireDate" v-model:retire-date="formData.retireDate"
v-model:responsibleArea="formData.responsibleArea" v-model:responsible-area="formData.responsibleArea"
v-model:discountCondition="formData.discountCondition" v-model:discount-condition="formData.discountCondition"
v-model:sourceNationality="formData.sourceNationality" v-model:source-nationality="formData.sourceNationality"
v-model:importNationality="formData.importNationality" v-model:import-nationality="formData.importNationality"
v-model:trainingPlace="formData.trainingPlace" v-model:training-place="formData.trainingPlace"
v-model:checkpoint="formData.checkpoint" v-model:checkpoint="formData.checkpoint"
v-model:checkpointEN="formData.checkpointEN" v-model:checkpoint-en="formData.checkpointEN"
v-model:agencyFile="agencyFile" v-model:agency-file="agencyFile"
v-model:agencyFileList="agencyFileList" v-model:agency-file-list="agencyFileList"
v-model:userId="currentUser.id" v-model:user-id="currentUser.id"
/> />
</div> </div>
</div> </div>
@ -1924,12 +1924,12 @@ watch(
separator separator
:title="'form.field.basicInformation'" :title="'form.field.basicInformation'"
:usernameReadonly="isEdit" :usernameReadonly="isEdit"
v-model:hqId="hqId" v-model:hq-id="hqId"
v-model:brId="brId" v-model:br-id="brId"
v-model:userType="formData.userType" v-model:user-type="formData.userType"
v-model:userRole="formData.userRole" v-model:user-role="formData.userRole"
v-model:username="formData.username" v-model:username="formData.username"
v-model:userCode="userCode" v-model:user-code="userCode"
class="q-mb-xl" class="q-mb-xl"
/> />
<FormPerson <FormPerson
@ -1939,14 +1939,14 @@ watch(
outlined outlined
separator separator
:title="'personnel.form.personalInformation'" :title="'personnel.form.personalInformation'"
v-model:firstName="formData.firstName" v-model:first-name="formData.firstName"
v-model:lastName="formData.lastName" v-model:last-name="formData.lastName"
v-model:midName="formData.middleName" v-model:mid-name="formData.middleName"
v-model:midNameEN="formData.middleNameEN" v-model:mid-name-en="formData.middleNameEN"
v-model:prefixName="formData.namePrefix" v-model:prefix-name="formData.namePrefix"
v-model:prefixNameEN="formData.namePrefix" v-model:prefix-name-en="formData.namePrefix"
v-model:firstNameEN="formData.firstNameEN" v-model:first-name-en="formData.firstNameEN"
v-model:lastNameEN="formData.lastNameEN" v-model:last-name-en="formData.lastNameEN"
v-model:telephone-no="formData.telephoneNo" v-model:telephone-no="formData.telephoneNo"
v-model:email="formData.email" v-model:email="formData.email"
v-model:gender="formData.gender" v-model:gender="formData.gender"
@ -1979,18 +1979,18 @@ watch(
dense dense
outlined outlined
separator separator
v-model:userType="formData.userType" v-model:user-type="formData.userType"
v-model:registrationNo="formData.registrationNo" v-model:registration-no="formData.registrationNo"
v-model:startDate="formData.startDate" v-model:start-date="formData.startDate"
v-model:retireDate="formData.retireDate" v-model:retire-date="formData.retireDate"
v-model:responsibleArea="formData.responsibleArea" v-model:responsible-area="formData.responsibleArea"
v-model:discountCondition="formData.discountCondition" v-model:discount-condition="formData.discountCondition"
v-model:sourceNationality="formData.sourceNationality" v-model:source-nationality="formData.sourceNationality"
v-model:importNationality="formData.importNationality" v-model:import-nationality="formData.importNationality"
v-model:trainingPlace="formData.trainingPlace" v-model:training-place="formData.trainingPlace"
v-model:checkpoint="formData.checkpoint" v-model:checkpoint="formData.checkpoint"
v-model:checkpointEN="formData.checkpointEN" v-model:checkpoint-en="formData.checkpointEN"
v-model:agencyFile="agencyFile" v-model:agency-file="agencyFile"
/> />
</div> </div>
</div> </div>
@ -1998,7 +1998,7 @@ watch(
</DialogForm> </DialogForm>
<ImageUploadDialog <ImageUploadDialog
v-model:dialogState="imageDialog" v-model:dialog-state="imageDialog"
v-model:file="profileFileImg" v-model:file="profileFileImg"
v-model:image-url="urlProfile" v-model:image-url="urlProfile"
v-model:data-list="imageList" v-model:data-list="imageList"

View file

@ -735,22 +735,24 @@ watch([customerId, inputSearch, currentStatus], async () => {
" "
:customer-type="customerType" :customer-type="customerType"
v-model:citizen-id="customerBranchFormData.citizenId" v-model:citizen-id="customerBranchFormData.citizenId"
v-model:prefixName="customerBranchFormData.namePrefix" v-model:prefix-name="customerBranchFormData.namePrefix"
v-model:firstName="customerBranchFormData.firstName" v-model:first-name="customerBranchFormData.firstName"
v-model:lastName="customerBranchFormData.lastName" v-model:last-name="customerBranchFormData.lastName"
v-model:firstNameEN="customerBranchFormData.firstNameEN" v-model:first-name-en="customerBranchFormData.firstNameEN"
v-model:lastNameEN="customerBranchFormData.lastNameEN" v-model:last-name-en="customerBranchFormData.lastNameEN"
v-model:gender="customerBranchFormData.gender" v-model:gender="customerBranchFormData.gender"
v-model:birthDate="customerBranchFormData.birthDate" v-model:birth-date="customerBranchFormData.birthDate"
v-model:customerName="customerBranchFormData.customerName" v-model:customer-name="customerBranchFormData.customerName"
v-model:legalPersonNo="customerBranchFormData.legalPersonNo" v-model:legal-person-no="customerBranchFormData.legalPersonNo"
v-model:branchCode="customerBranchFormData.code" v-model:branch-code="customerBranchFormData.code"
v-model:registerName="customerBranchFormData.registerName" v-model:register-name="customerBranchFormData.registerName"
v-model:registerNameEN="customerBranchFormData.registerNameEN" v-model:register-name-en="customerBranchFormData.registerNameEN"
v-model:registerDate="customerBranchFormData.registerDate" v-model:register-date="customerBranchFormData.registerDate"
v-model:authorizedCapital="customerBranchFormData.authorizedCapital" v-model:authorized-capital="
v-model:telephoneNo="customerBranchFormData.telephoneNo" customerBranchFormData.authorizedCapital
v-model:codeCustomer="customerBranchFormData.codeCustomer" "
v-model:telephone-no="customerBranchFormData.telephoneNo"
v-model:code-customer="customerBranchFormData.codeCustomer"
/> />
<div <div
class="row q-col-gutter-sm q-mb-sm" class="row q-col-gutter-sm q-mb-sm"
@ -800,9 +802,7 @@ watch([customerId, inputSearch, currentStatus], async () => {
prefix-id="employer-branch" prefix-id="employer-branch"
:readonly="customerBranchFormState.dialogType === 'info'" :readonly="customerBranchFormState.dialogType === 'info'"
v-model:authorized-name="customerBranchFormData.authorizedName" v-model:authorized-name="customerBranchFormData.authorizedName"
v-model:authorized-name-e-n=" v-model:authorized-name-en="customerBranchFormData.authorizedNameEN"
customerBranchFormData.authorizedNameEN
"
/> />
<div class="row q-col-gutter-sm q-mb-sm" id="employer-branch-address"> <div class="row q-col-gutter-sm q-mb-sm" id="employer-branch-address">
<div class="col-12 text-weight-bold text-body1 row items-center"> <div class="col-12 text-weight-bold text-body1 row items-center">
@ -861,10 +861,10 @@ watch([customerId, inputSearch, currentStatus], async () => {
<EmployerFormContact <EmployerFormContact
class="q-mb-lg" class="q-mb-lg"
:readonly="customerBranchFormState.dialogType === 'info'" :readonly="customerBranchFormState.dialogType === 'info'"
v-model:contactName="customerBranchFormData.contactName" v-model:contact-name="customerBranchFormData.contactName"
v-model:email="customerBranchFormData.email" v-model:email="customerBranchFormData.email"
v-model:contactTel="customerBranchFormData.contactTel" v-model:contact-tel="customerBranchFormData.contactTel"
v-model:officeTel="customerBranchFormData.officeTel" v-model:office-tel="customerBranchFormData.officeTel"
v-model:agent="customerBranchFormData.agent" v-model:agent="customerBranchFormData.agent"
/> />
</div> </div>

View file

@ -807,7 +807,7 @@ const emptyCreateDialog = ref(false);
<div class="scroll"> <div class="scroll">
<StatCardComponent <StatCardComponent
v-if="customerStats" v-if="customerStats"
labelI18n label-i18n
:branch=" :branch="
customerStats && customerStats &&
(currentTab === 'employer' (currentTab === 'employer'
@ -1284,25 +1284,6 @@ const emptyCreateDialog = ref(false);
</q-tooltip> </q-tooltip>
</q-td> </q-td>
<q-td v-if="fieldSelected.includes('address')">
{{
locale === 'eng'
? `${props.row.branch[0].addressEN}, ${props.row.branch[0].mooEN && `${$t('form.moo')} ${props.row.branch[0].mooEN},`} ${props.row.branch[0].soiEN && `${$t('form.soi')} ${props.row.branch[0].soiEN},`} ${props.row.branch[0].moo && `${props.row.branch[0].streetEN} Rd,`} ${props.row.branch[0].subDistrict.nameEN}, ${props.row.branch[0].district.nameEN}, ${props.row.branch[0].province.nameEN} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
: `${props.row.branch[0].address}, ${props.row.branch[0].moo && `${$t('form.moo')} ${props.row.branch[0].moo},`} ${props.row.branch[0].soi && `${$t('form.soi')} ${props.row.branch[0].soi},`} ${props.row.branch[0].street && `${$t('form.road')} ${props.row.branch[0].street},`} ${props.row.branch[0].subDistrict.name}, ${props.row.branch[0].district.name}, ${props.row.branch[0].province.name} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
}}
<q-tooltip>
{{
locale === 'eng'
? `${props.row.branch[0].addressEN}, ${props.row.branch[0].mooEN && `${$t('form.moo')} ${props.row.branch[0].mooEN},`} ${props.row.branch[0].soiEN && `${$t('form.soi')} ${props.row.branch[0].soiEN},`} ${props.row.branch[0].moo && `${props.row.branch[0].streetEN} Rd,`} ${props.row.branch[0].subDistrict.nameEN}, ${props.row.branch[0].district.nameEN}, ${props.row.branch[0].province.nameEN} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
: `${props.row.branch[0].address}, ${props.row.branch[0].moo && `${$t('form.moo')} ${props.row.branch[0].moo},`} ${props.row.branch[0].soi && `${$t('form.soi')} ${props.row.branch[0].soi},`} ${props.row.branch[0].street && `${$t('form.road')} ${props.row.branch[0].street},`} ${props.row.branch[0].subDistrict.name}, ${props.row.branch[0].district.name}, ${props.row.branch[0].province.name} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
}}
</q-tooltip>
</q-td>
<q-td v-if="fieldSelected.includes('contactName')"> <q-td v-if="fieldSelected.includes('contactName')">
{{ props.row.branch[0]?.contactName || '-' }} {{ props.row.branch[0]?.contactName || '-' }}
</q-td> </q-td>
@ -1444,7 +1425,7 @@ const emptyCreateDialog = ref(false);
<template v-slot:item="props"> <template v-slot:item="props">
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<BranchCard <BranchCard
i18nKey="customer.table" i18n-key="customer.table"
class="surface-1" class="surface-1"
:virtual-branch="props.row.virtual" :virtual-branch="props.row.virtual"
:id="`branch-card-${props.row.name}`" :id="`branch-card-${props.row.name}`"
@ -1575,7 +1556,7 @@ const emptyCreateDialog = ref(false);
<template v-slot:action> <template v-slot:action>
<KebabAction <KebabAction
:status="props.row.status" :status="props.row.status"
:idName="props.row.name" :id-name="props.row.name"
@view=" @view="
() => { () => {
const { branch, ...payload } = props.row; const { branch, ...payload } = props.row;
@ -2082,19 +2063,23 @@ const emptyCreateDialog = ref(false);
" "
:customer-type="customerFormData.customerType" :customer-type="customerFormData.customerType"
v-model:registered-branch-id="customerFormData.registeredBranchId" v-model:registered-branch-id="customerFormData.registeredBranchId"
v-model:customerName="customerNameInfo" v-model:customer-name="customerNameInfo"
v-model:registerName=" v-model:register-name="
customerFormData.customerBranch[0].registerName customerFormData.customerBranch[0].registerName
" "
v-model:citizenId="customerFormData.customerBranch[0].citizenId" v-model:citizen-id="customerFormData.customerBranch[0].citizenId"
v-model:legalPersonNo=" v-model:legal-person-no="
customerFormData.customerBranch[0].legalPersonNo customerFormData.customerBranch[0].legalPersonNo
" "
v-model:businessType=" v-model:business-type="
customerFormData.customerBranch[0].businessType customerFormData.customerBranch[0].businessType
" "
v-model:jobPosition="customerFormData.customerBranch[0].jobPosition" v-model:job-position="
v-model:telephoneNo="customerFormData.customerBranch[0].telephoneNo" customerFormData.customerBranch[0].jobPosition
"
v-model:telephone-no="
customerFormData.customerBranch[0].telephoneNo
"
v-model:branch-options="registerAbleBranchOption" v-model:branch-options="registerAbleBranchOption"
/> />
<div class="row q-col-gutter-sm" id="form-branch-customer-branch"> <div class="row q-col-gutter-sm" id="form-branch-customer-branch">
@ -2554,15 +2539,15 @@ const emptyCreateDialog = ref(false);
title="customerEmployee.form.group.personalInfo" title="customerEmployee.form.group.personalInfo"
:readonly="!employeeFormState.isEmployeeEdit" :readonly="!employeeFormState.isEmployeeEdit"
v-model:open="employeeFormState.dialogModal" v-model:open="employeeFormState.dialogModal"
v-model:prefixName="currentFromDataEmployee.namePrefix" v-model:prefix-name="currentFromDataEmployee.namePrefix"
v-model:firstName="currentFromDataEmployee.firstName" v-model:first-name="currentFromDataEmployee.firstName"
v-model:lastName="currentFromDataEmployee.lastName" v-model:last-name="currentFromDataEmployee.lastName"
v-model:firstNameEN="currentFromDataEmployee.firstNameEN" v-model:first-name-en="currentFromDataEmployee.firstNameEN"
v-model:lastNameEN="currentFromDataEmployee.lastNameEN" v-model:last-name-en="currentFromDataEmployee.lastNameEN"
v-model:midName="currentFromDataEmployee.middleName" v-model:mid-name="currentFromDataEmployee.middleName"
v-model:midNameEN="currentFromDataEmployee.middleNameEN" v-model:mid-name-en="currentFromDataEmployee.middleNameEN"
v-model:gender="currentFromDataEmployee.gender" v-model:gender="currentFromDataEmployee.gender"
v-model:birthDate="currentFromDataEmployee.dateOfBirth" v-model:birth-date="currentFromDataEmployee.dateOfBirth"
v-model:nationality="currentFromDataEmployee.nationality" v-model:nationality="currentFromDataEmployee.nationality"
class="q-mb-xl" class="q-mb-xl"
/> />
@ -2782,14 +2767,14 @@ const emptyCreateDialog = ref(false);
dense dense
outlined outlined
v-model:current-index="employeeFormState.currentIndex" v-model:current-index="employeeFormState.currentIndex"
v-model:employeeCheckup="currentFromDataEmployee.employeeCheckup" v-model:employee-checkup="currentFromDataEmployee.employeeCheckup"
v-model:checkupTypeOption=" v-model:checkup-type-option="
optionStore.globalOption.insurancePlace optionStore.globalOption.insurancePlace
" "
v-model:medicalBenefitOption=" v-model:medical-benefit-option="
optionStore.globalOption.typeInsurance optionStore.globalOption.typeInsurance
" "
v-model:insuranceCompanyOption=" v-model:insurance-company-option="
optionStore.globalOption.insurancePlace optionStore.globalOption.insurancePlace
" "
@delete=" @delete="
@ -2917,7 +2902,7 @@ const emptyCreateDialog = ref(false);
v-model:on-create-data-list="onCreateImageList" v-model:on-create-data-list="onCreateImageList"
:on-create="customerFormState.dialogModal" :on-create="customerFormState.dialogModal"
:default-url="customerFormState.defaultCustomerImageUrl" :default-url="customerFormState.defaultCustomerImageUrl"
:hiddenFooter="!customerFormState.isImageEdit" :hidden-footer="!customerFormState.isImageEdit"
@add-image=" @add-image="
async (v) => { async (v) => {
if (!v) return; if (!v) return;
@ -3027,7 +3012,7 @@ const emptyCreateDialog = ref(false);
v-model:data-list="imageList" v-model:data-list="imageList"
v-model:on-create-data-list="onCreateImageList" v-model:on-create-data-list="onCreateImageList"
:on-create="employeeFormState.dialogModal" :on-create="employeeFormState.dialogModal"
:hiddenFooter="!employeeFormState.isImageEdit" :hidden-footer="!employeeFormState.isImageEdit"
@add-image=" @add-image="
async (v) => { async (v) => {
if (!v) return; if (!v) return;
@ -3116,12 +3101,12 @@ const emptyCreateDialog = ref(false);
? customerFormData.customerBranch[0]?.registerName ? customerFormData.customerBranch[0]?.registerName
: customerNameInfo : customerNameInfo
" "
:badgeLabel=" :badge-label="
customerFormData.customerType === 'CORP' customerFormData.customerType === 'CORP'
? $t('customer.employerLegalEntity') ? $t('customer.employerLegalEntity')
: $t('customer.employerNaturalPerson') : $t('customer.employerNaturalPerson')
" "
:badgeStyle=" :badge-style="
customerFormData.customerType === 'CORP' customerFormData.customerType === 'CORP'
? `color: var(--${$q.dark.isActive ? 'violet-10' : 'violet-11'}); background: hsl(var(--${$q.dark.isActive ? 'violet-10-hsl' : 'violet-11-hsl'})/0.15)` ? `color: var(--${$q.dark.isActive ? 'violet-10' : 'violet-11'}); background: hsl(var(--${$q.dark.isActive ? 'violet-10-hsl' : 'violet-11-hsl'})/0.15)`
: `color: var(--${$q.dark.isActive ? 'teal-8' : 'teal-10'}); background: hsl(var(--${$q.dark.isActive ? 'teal-8-hsl' : 'teal-10-hsl'})/0.15)` : `color: var(--${$q.dark.isActive ? 'teal-8' : 'teal-10'}); background: hsl(var(--${$q.dark.isActive ? 'teal-8-hsl' : 'teal-10-hsl'})/0.15)`
@ -3171,17 +3156,17 @@ const emptyCreateDialog = ref(false);
v-if="customerFormData.customerBranch !== undefined" v-if="customerFormData.customerBranch !== undefined"
:active="customerFormData.status !== 'INACTIVE'" :active="customerFormData.status !== 'INACTIVE'"
hide-fade hide-fade
useToggle use-toggle
v-model:toggle-status="customerFormData.status" v-model:toggle-status="customerFormData.status"
:menu="formMenuIcon" :menu="formMenuIcon"
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:fallback-cover="`/images/customer-${customerFormData.customerType}-banner-bg.jpg`" :fallback-cover="`/images/customer-${customerFormData.customerType}-banner-bg.jpg`"
:img=" :img="
`${baseUrl}/customer/${customerFormState.editCustomerId}/image/${customerFormData.selectedImage}`.concat( `${baseUrl}/customer/${customerFormState.editCustomerId}/image/${customerFormData.selectedImage}`.concat(
refreshImageState ? `?ts=${Date.now()}` : '', refreshImageState ? `?ts=${Date.now()}` : '',
) || null ) || null
" "
:fallbackImg="`/images/customer-${customerFormData.customerType}-avartar-${customerFormData.customerType === 'PERS' ? customerFormData.customerBranch[0]?.gender : 'male'}.png`" :fallback-img="`/images/customer-${customerFormData.customerType}-avartar-${customerFormData.customerType === 'PERS' ? customerFormData.customerBranch[0]?.gender : 'male'}.png`"
:color="`hsla(var(--${customerFormData.customerType === 'PERS' ? 'teal-10-hsl' : 'violet-11-hsl'})/1)`" :color="`hsla(var(--${customerFormData.customerType === 'PERS' ? 'teal-10-hsl' : 'violet-11-hsl'})/1)`"
:bg-color="`hsla(var(--${customerFormData.customerType === 'PERS' ? 'teal-10-hsl' : 'violet-11-hsl'})/0.1)`" :bg-color="`hsla(var(--${customerFormData.customerType === 'PERS' ? 'teal-10-hsl' : 'violet-11-hsl'})/0.1)`"
:icon=" :icon="
@ -3315,39 +3300,26 @@ const emptyCreateDialog = ref(false);
" "
:customer-type="customerFormData.customerType" :customer-type="customerFormData.customerType"
v-model:registered-branch-id="customerFormData.registeredBranchId" v-model:registered-branch-id="customerFormData.registeredBranchId"
v-model:customerName="customerNameInfo" v-model:customer-name="customerNameInfo"
v-model:registerName=" v-model:register-name="
customerFormData.customerBranch[0].registerName customerFormData.customerBranch[0].registerName
" "
v-model:citizenId="customerFormData.customerBranch[0].citizenId" v-model:citizen-id="customerFormData.customerBranch[0].citizenId"
v-model:legalPersonNo=" v-model:legal-person-no="
customerFormData.customerBranch[0].legalPersonNo customerFormData.customerBranch[0].legalPersonNo
" "
v-model:businessType=" v-model:business-type="
customerFormData.customerBranch[0].businessType customerFormData.customerBranch[0].businessType
" "
v-model:jobPosition=" v-model:job-position="
customerFormData.customerBranch[0].jobPosition customerFormData.customerBranch[0].jobPosition
" "
v-model:telephoneNo=" v-model:telephone-no="
customerFormData.customerBranch[0].telephoneNo customerFormData.customerBranch[0].telephoneNo
" "
v-model:branch-options="registerAbleBranchOption" v-model:branch-options="registerAbleBranchOption"
/> />
<!-- <div class="row q-col-gutter-sm q-mb-xl">
<UploadFile
id="form-upload-file-customer"
class="q-mb-xl"
hide-action
:dropdown-list="uploadFileList"
v-model:file="customerFormState.file"
@send-ocr="
(group: any, file: any) => ocrStore.sendOcr({ file })
"
/>
</div> -->
<div class="row q-col-gutter-sm" id="form-branch-customer-branch"> <div class="row q-col-gutter-sm" id="form-branch-customer-branch">
<div <div
class="col-12 text-weight-bold text-body1 row items-center q-mt-lg" class="col-12 text-weight-bold text-body1 row items-center q-mt-lg"
@ -3465,7 +3437,7 @@ const emptyCreateDialog = ref(false);
" "
> >
<EmployerFormBranch <EmployerFormBranch
prefixId="info" prefix-id="info"
v-if="!!customerFormState.editCustomerId" v-if="!!customerFormState.editCustomerId"
:index="idx" :index="idx"
:hide-action="customerFormData.status === 'INACTIVE'" :hide-action="customerFormData.status === 'INACTIVE'"
@ -3528,7 +3500,7 @@ const emptyCreateDialog = ref(false);
: `${employeeFormState.currentEmployee.firstName} ${employeeFormState.currentEmployee.lastName}` : `${employeeFormState.currentEmployee.firstName} ${employeeFormState.currentEmployee.lastName}`
: '-' : '-'
" "
:badgeClass=" :badge-class="
currentFromDataEmployee.gender === 'male' currentFromDataEmployee.gender === 'male'
? 'app-bg-male text-white' ? 'app-bg-male text-white'
: currentFromDataEmployee.gender === 'female' : currentFromDataEmployee.gender === 'female'
@ -3794,15 +3766,15 @@ const emptyCreateDialog = ref(false);
separator separator
title="customerEmployee.form.group.personalInfo" title="customerEmployee.form.group.personalInfo"
:readonly="!employeeFormState.isEmployeeEdit" :readonly="!employeeFormState.isEmployeeEdit"
v-model:prefixName="currentFromDataEmployee.namePrefix" v-model:prefix-name="currentFromDataEmployee.namePrefix"
v-model:firstName="currentFromDataEmployee.firstName" v-model:first-ame="currentFromDataEmployee.firstName"
v-model:lastName="currentFromDataEmployee.lastName" v-model:last-name="currentFromDataEmployee.lastName"
v-model:firstNameEN="currentFromDataEmployee.firstNameEN" v-model:first-name-en="currentFromDataEmployee.firstNameEN"
v-model:lastNameEN="currentFromDataEmployee.lastNameEN" v-model:last-name-en="currentFromDataEmployee.lastNameEN"
v-model:midName="currentFromDataEmployee.middleName" v-model:mid-name="currentFromDataEmployee.middleName"
v-model:midNameEN="currentFromDataEmployee.middleNameEN" v-model:mid-name-en="currentFromDataEmployee.middleNameEN"
v-model:gender="currentFromDataEmployee.gender" v-model:gender="currentFromDataEmployee.gender"
v-model:birthDate="currentFromDataEmployee.dateOfBirth" v-model:birth-date="currentFromDataEmployee.dateOfBirth"
v-model:nationality="currentFromDataEmployee.nationality" v-model:nationality="currentFromDataEmployee.nationality"
class="q-mb-xl" class="q-mb-xl"
/> />
@ -4034,7 +4006,7 @@ const emptyCreateDialog = ref(false);
v-model:medical-benefit-option=" v-model:medical-benefit-option="
optionStore.globalOption.typeInsurance optionStore.globalOption.typeInsurance
" "
v-model:insuranceCompanyOption=" v-model:insurance-company-option="
optionStore.globalOption.insurancePlace optionStore.globalOption.insurancePlace
" "
@save=" @save="

View file

@ -23,8 +23,8 @@ const citizenId = defineModel<string | undefined>('citizenId', {});
const prefixName = defineModel<string | null>('prefixName'); const prefixName = defineModel<string | null>('prefixName');
const firstName = defineModel<string>('firstName'); const firstName = defineModel<string>('firstName');
const lastName = defineModel<string>('lastName'); const lastName = defineModel<string>('lastName');
const firstNameEN = defineModel<string>('firstNameEN'); const firstNameEN = defineModel<string>('firstNameEn');
const lastNameEN = defineModel<string>('lastNameEN'); const lastNameEN = defineModel<string>('lastNameEn');
const gender = defineModel<string>('gender'); const gender = defineModel<string>('gender');
const birthDate = defineModel<Date | string | null>('birthDate'); const birthDate = defineModel<Date | string | null>('birthDate');
@ -33,7 +33,7 @@ const customerName = defineModel<string>('customerName');
const legalPersonNo = defineModel<string | undefined>('legalPersonNo', {}); const legalPersonNo = defineModel<string | undefined>('legalPersonNo', {});
const branchCode = defineModel<string | undefined>('branchCode', {}); const branchCode = defineModel<string | undefined>('branchCode', {});
const registerName = defineModel<string | undefined>('registerName', {}); const registerName = defineModel<string | undefined>('registerName', {});
const registerNameEN = defineModel<string | undefined>('registerNameEN', {}); const registerNameEN = defineModel<string | undefined>('registerNameEn', {});
const registerDate = defineModel<string | Date | null>('registerDate'); const registerDate = defineModel<string | Date | null>('registerDate');
const authorizedCapital = defineModel<string>('authorizedCapital', { const authorizedCapital = defineModel<string>('authorizedCapital', {
default: '0', default: '0',

View file

@ -4,7 +4,7 @@ defineProps<{
prefixId?: string; prefixId?: string;
}>(); }>();
const authorizedName = defineModel<string>('authorizedName'); const authorizedName = defineModel<string>('authorizedName');
const authorizedNameEN = defineModel<string>('authorizedNameEN'); const authorizedNameEN = defineModel<string>('authorizedNameEn');
</script> </script>
<template> <template>

View file

@ -6,7 +6,6 @@ import EmployerFormContact from './EmployerFormContact.vue';
import { CustomerCreate } from 'stores/customer/types'; import { CustomerCreate } from 'stores/customer/types';
import EmployerFormAbout from './EmployerFormAbout.vue'; import EmployerFormAbout from './EmployerFormAbout.vue';
import EmployerFormAuthorized from './EmployerFormAuthorized.vue'; import EmployerFormAuthorized from './EmployerFormAuthorized.vue';
import { useCustomerForm } from 'src/pages/03_customer-management/form';
import { waitAll } from 'src/stores/utils'; import { waitAll } from 'src/stores/utils';
import { import {
FormCitizen, FormCitizen,
@ -25,7 +24,6 @@ import {
} from 'components/button'; } from 'components/button';
import { UploadFileGroup } from 'src/components/upload-file/'; import { UploadFileGroup } from 'src/components/upload-file/';
import { uploadFileListCustomer, columnsAttachment } from '../../constant'; import { uploadFileListCustomer, columnsAttachment } from '../../constant';
import { group } from 'node:console';
const ocrStore = useOcrStore(); const ocrStore = useOcrStore();
const customerStore = useCustomerStore(); const customerStore = useCustomerStore();
@ -135,22 +133,22 @@ withDefaults(
:readonly="readonly" :readonly="readonly"
:customer-type="customerType" :customer-type="customerType"
v-model:citizen-id="item.citizenId" v-model:citizen-id="item.citizenId"
v-model:prefixName="item.namePrefix" v-model:prefix-name="item.namePrefix"
v-model:firstName="item.firstName" v-model:first-name="item.firstName"
v-model:lastName="item.lastName" v-model:last-name="item.lastName"
v-model:firstNameEN="item.firstNameEN" v-model:first-name-en="item.firstNameEN"
v-model:lastNameEN="item.lastNameEN" v-model:last-name-en="item.lastNameEN"
v-model:gender="item.gender" v-model:gender="item.gender"
v-model:birthDate="item.birthDate" v-model:birth-date="item.birthDate"
v-model:customerName="item.customerName" v-model:customer-name="item.customerName"
v-model:legalPersonNo="item.legalPersonNo" v-model:legal-person-no="item.legalPersonNo"
v-model:branchCode="item.code" v-model:branch-code="item.code"
v-model:registerName="item.registerName" v-model:register-name="item.registerName"
v-model:registerNameEN="item.registerNameEN" v-model:register-name-en="item.registerNameEN"
v-model:registerDate="item.registerDate" v-model:register-date="item.registerDate"
v-model:authorizedCapital="item.authorizedCapital" v-model:authorized-capital="item.authorizedCapital"
v-model:telephoneNo="item.telephoneNo" v-model:telephone-no="item.telephoneNo"
v-model:codeCustomer="item.codeCustomer" v-model:code-customer="item.codeCustomer"
/> />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="business"> <q-tab-panel name="business">
@ -163,7 +161,7 @@ withDefaults(
v-model:job-position="item.jobPosition" v-model:job-position="item.jobPosition"
v-model:job-description="item.jobDescription" v-model:job-description="item.jobDescription"
v-model:pay-date="item.payDate" v-model:pay-date="item.payDate"
v-model:pay-date-e-n="item.payDateEN" v-model:pay-date-en="item.payDateEN"
v-model:wage-rate="item.wageRate" v-model:wage-rate="item.wageRate"
v-model:wage-rate-text="item.wageRateText" v-model:wage-rate-text="item.wageRateText"
/> />
@ -173,7 +171,7 @@ withDefaults(
:prefix-id="prefixId || 'employer'" :prefix-id="prefixId || 'employer'"
:readonly="readonly" :readonly="readonly"
v-model:authorized-name="item.authorizedName" v-model:authorized-name="item.authorizedName"
v-model:authorized-name-e-n="item.authorizedNameEN" v-model:authorized-name-en="item.authorizedNameEN"
/> />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="address"> <q-tab-panel name="address">
@ -207,10 +205,10 @@ withDefaults(
<EmployerFormContact <EmployerFormContact
:readonly="readonly" :readonly="readonly"
:prefixId="prefixId" :prefixId="prefixId"
v-model:contactName="item.contactName" v-model:contact-name="item.contactName"
v-model:email="item.email" v-model:email="item.email"
v-model:contactTel="item.contactTel" v-model:contact-tel="item.contactTel"
v-model:officeTel="item.officeTel" v-model:office-tel="item.officeTel"
v-model:agent="item.agent" v-model:agent="item.agent"
/> />
</q-tab-panel> </q-tab-panel>

View file

@ -12,7 +12,7 @@ const bussinessType = defineModel<string>('bussinessType');
const jobPosition = defineModel<string>('jobPosition'); const jobPosition = defineModel<string>('jobPosition');
const jobDescription = defineModel<string>('jobDescription'); const jobDescription = defineModel<string>('jobDescription');
const payDate = defineModel<string>('payDate'); const payDate = defineModel<string>('payDate');
const payDateEN = defineModel<string>('payDateEN'); const payDateEN = defineModel<string>('payDateEn');
const wageRate = defineModel<number | string>('wageRate'); const wageRate = defineModel<number | string>('wageRate');
const wageRateText = defineModel<string>('wageRateText'); const wageRateText = defineModel<string>('wageRateText');

View file

@ -2029,7 +2029,7 @@ watch(
<KebabAction <KebabAction
:disable-delete="props.row.status !== 'CREATED'" :disable-delete="props.row.status !== 'CREATED'"
:status="props.row.status" :status="props.row.status"
:idName="props.row.name" :id-name="props.row.name"
@view=" @view="
async () => { async () => {
if (productMode === 'group') { if (productMode === 'group') {
@ -2064,7 +2064,7 @@ watch(
} }
} }
" "
@changeStatus=" @change-status="
async () => { async () => {
triggerChangeStatus( triggerChangeStatus(
props.row.id, props.row.id,
@ -2099,10 +2099,10 @@ watch(
}[productMode] || 'var(--pink-6-hsl)' }[productMode] || 'var(--pink-6-hsl)'
" "
:action="actionDisplay" :action="actionDisplay"
@toggleStatus=" @toggle-status="
triggerChangeStatus(props.row.id, props.row.status) triggerChangeStatus(props.row.id, props.row.status)
" "
@viewCard=" @view-card="
async () => { async () => {
if (productMode === 'group') { if (productMode === 'group') {
editByTree = 'group'; editByTree = 'group';
@ -2116,7 +2116,7 @@ watch(
} }
} }
" "
@updateCard=" @update-card="
async () => { async () => {
if (productMode === 'group') { if (productMode === 'group') {
clearFormGroup(); clearFormGroup();
@ -2128,7 +2128,7 @@ watch(
} }
} }
" "
@deleteCard=" @delete-card="
() => { () => {
if (productMode === 'group') { if (productMode === 'group') {
deleteProductById(props.row.id); deleteProductById(props.row.id);
@ -2711,7 +2711,7 @@ watch(
/> />
<KebabAction <KebabAction
:status="props.row.status" :status="props.row.status"
:idName="props.row.name" :id-name="props.row.name"
@view=" @view="
async () => { async () => {
await fetchListOfOptionBranch(); await fetchListOfOptionBranch();
@ -2755,7 +2755,7 @@ watch(
} }
} }
" "
@changeStatus=" @change-status="
() => { () => {
triggerChangeStatus( triggerChangeStatus(
props.row.id, props.row.id,
@ -2775,15 +2775,17 @@ watch(
:data="row" :data="row"
:key="row.id" :key="row.id"
:title="row.name" :title="row.name"
:isDisabled="row.status === 'INACTIVE' ? true : false" :is-disabled="
row.status === 'INACTIVE' ? true : false
"
:action="actionDisplay" :action="actionDisplay"
:priceDisplay="priceDisplay" :price-display="priceDisplay"
@toggleStatus=" @toggle-status="
() => { () => {
triggerChangeStatus(row.id, row.status, row.type); triggerChangeStatus(row.id, row.status, row.type);
} }
" "
@menuViewDetail=" @menu-view-detail="
async () => { async () => {
await fetchListOfOptionBranch(); await fetchListOfOptionBranch();
if (row.type === 'product') { if (row.type === 'product') {
@ -2799,7 +2801,7 @@ watch(
} }
} }
" "
@menuEdit=" @menu-edit="
async () => { async () => {
await fetchListOfOptionBranch(); await fetchListOfOptionBranch();
if (row.type === 'product') { if (row.type === 'product') {
@ -2816,7 +2818,7 @@ watch(
} }
} }
" "
@menuDelete=" @menu-delete="
() => { () => {
if (row.type === 'product') { if (row.type === 'product') {
deleteProductConfirm(row.id); deleteProductConfirm(row.id);
@ -2924,13 +2926,13 @@ watch(
> >
<ProfileBanner <ProfileBanner
readonly readonly
noImageAction no-image-action
active active
hideFade hide-fade
hideActive hide-active
useToggle use-toggle
:img="`/images/product-service-${productMode}-avatar-add.png`" :img="`/images/product-service-${productMode}-avatar-add.png`"
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:icon=" :icon="
productMode === 'group' productMode === 'group'
? 'mdi-folder-plus-outline' ? 'mdi-folder-plus-outline'
@ -2945,7 +2947,7 @@ watch(
bgColor: 'var(--surface-1)', bgColor: 'var(--surface-1)',
}, },
]" ]"
:fallbackCover="`/images/product-service-${productMode}-banner.png`" :fallback-cover="`/images/product-service-${productMode}-banner.png`"
:color="`hsla(var(${ :color="`hsla(var(${
productMode === 'group' productMode === 'group'
? '--pink-6' ? '--pink-6'
@ -3025,7 +3027,7 @@ watch(
<!-- edit group, edit type --> <!-- edit group, edit type -->
<DrawerInfo <DrawerInfo
ref="formDialogRef" ref="formDialogRef"
v-model:drawerOpen="drawerInfo" v-model:drawer-open="drawerInfo"
:title=" :title="
$t( $t(
editByTree === 'group' editByTree === 'group'
@ -3071,17 +3073,17 @@ watch(
}" }"
> >
<ProfileBanner <ProfileBanner
noImageAction no-image-action
:active="currentStatusGroupType !== 'INACTIVE'" :active="currentStatusGroupType !== 'INACTIVE'"
hideFade hide-fade
:useToggle="actionDisplay" :use-toggle="actionDisplay"
:readonly="!isEdit" :readonly="!isEdit"
:icon=" :icon="
editByTree === 'group' editByTree === 'group'
? 'mdi-folder-outline' ? 'mdi-folder-outline'
: 'mdi-folder-table-outline' : 'mdi-folder-table-outline'
" "
:fallbackCover="`/images/product-service-${editByTree}-banner.png`" :fallback-cover="`/images/product-service-${editByTree}-banner.png`"
v-model:toggle-status="currentStatusGroupType" v-model:toggle-status="currentStatusGroupType"
:color="`hsla(var(${ :color="`hsla(var(${
editByTree === 'group' editByTree === 'group'
@ -3099,7 +3101,7 @@ watch(
}-hsl)/0.1)`" }-hsl)/0.1)`"
:title="formDataGroup.name" :title="formDataGroup.name"
:caption="formDataGroup.code" :caption="formDataGroup.code"
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:menu="[ :menu="[
{ {
icon: 'mdi-office-building-outline', icon: 'mdi-office-building-outline',
@ -3198,7 +3200,7 @@ watch(
id="info-group" id="info-group"
dense dense
:readonly="!isEdit" :readonly="!isEdit"
:readOnlybranchOption="!readOnlybranchOption" :read-onlybranch-option="!readOnlybranchOption"
v-model:options-branch="branchOption" v-model:options-branch="branchOption"
v-model:registered-branch-id="formDataGroup.registeredBranchId" v-model:registered-branch-id="formDataGroup.registeredBranchId"
v-model:remark="formDataGroup.remark" v-model:remark="formDataGroup.remark"
@ -3215,11 +3217,11 @@ watch(
<!-- work product, product work --> <!-- work product, product work -->
<DialogForm <DialogForm
v-model:modal="dialogTotalProduct" v-model:modal="dialogTotalProduct"
:submitLabel="$t('general.select')" :submit-label="$t('general.select')"
noAddress no-address
noAppBox no-appBox
:title="$t('productService.product.allProduct')" :title="$t('productService.product.allProduct')"
:saveAmount="selectProduct.length" :save-amount="selectProduct.length"
:submit=" :submit="
() => { () => {
selectProduct.forEach((i) => { selectProduct.forEach((i) => {
@ -3331,7 +3333,7 @@ watch(
v-if="resultSearchProduct?.length === 0 || productIsAdd?.length === 0" v-if="resultSearchProduct?.length === 0 || productIsAdd?.length === 0"
> >
<NoData <NoData
:notFound="resultSearchProduct?.length === 0" :not-found="resultSearchProduct?.length === 0"
:text=" :text="
productIsAdd?.length === 0 productIsAdd?.length === 0
? $t('productService.product.noProduct') ? $t('productService.product.noProduct')
@ -3356,20 +3358,20 @@ watch(
<TotalProductCardComponent <TotalProductCardComponent
no-time-img no-time-img
:index="selectProduct.findIndex((v) => v.id === i.id)" :index="selectProduct.findIndex((v) => v.id === i.id)"
:isAddProduct="!!selectProduct.find((v) => v.id === i.id)" :is-add-product="!!selectProduct.find((v) => v.id === i.id)"
:action="false" :action="false"
:data="{ ...i, type: 'product' }" :data="{ ...i, type: 'product' }"
:title="i.name" :title="i.name"
:status="i.status === 'INACTIVE' ? true : false" :status="i.status === 'INACTIVE' ? true : false"
:priceDisplay="priceDisplay" :price-display="priceDisplay"
@menuViewDetail=" @menu-view-detail="
() => { () => {
currentIdProduct = i.id; currentIdProduct = i.id;
assignFormDataProduct(i); assignFormDataProduct(i);
dialogProductEdit = true; dialogProductEdit = true;
} }
" "
@menuEdit=" @menu-edit="
() => { () => {
currentIdProduct = i.id; currentIdProduct = i.id;
infoProductEdit = true; infoProductEdit = true;
@ -3377,7 +3379,7 @@ watch(
dialogProductEdit = true; dialogProductEdit = true;
} }
" "
@viewDetail=" @view-detail="
() => { () => {
currentIdProduct = i.id; currentIdProduct = i.id;
infoProductEdit = false; infoProductEdit = false;
@ -3426,13 +3428,13 @@ watch(
}" }"
> >
<ProfileBanner <ProfileBanner
hideFade hide-fade
useToggle use-toggle
hideActive hide-active
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:img="profileUrl || '/images/product-avatar-add.png'" :img="profileUrl || '/images/product-avatar-add.png'"
fallbackCover="/images/product-banner.png" fallback-cover="/images/product-banner.png"
:bgColor="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`" :bg-color="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`"
:menu="[ :menu="[
{ {
icon: 'mdi-office-building-outline', icon: 'mdi-office-building-outline',
@ -3454,7 +3456,7 @@ watch(
formDataProduct.status === 'CREATED' ? 'INACTIVE' : 'CREATED'; formDataProduct.status === 'CREATED' ? 'INACTIVE' : 'CREATED';
} }
" "
:tabsList=" :tabs-list="
$q.screen.gt.sm $q.screen.gt.sm
? false ? false
: [ : [
@ -3468,7 +3470,7 @@ watch(
}, },
] ]
" "
v-model:currentTab="productTab" v-model:current-tab="productTab"
/> />
</div> </div>
@ -3563,21 +3565,21 @@ watch(
> >
<ProfileBanner <ProfileBanner
hideFade hideFade
:useToggle="actionDisplay" :use-toggle="actionDisplay"
:active="formDataProduct.status !== 'INACTIVE'" :active="formDataProduct.status !== 'INACTIVE'"
:title="formDataProduct.name" :title="formDataProduct.name"
:caption="formDataProduct.code" :caption="formDataProduct.code"
icon="mdi-shopping-outline" icon="mdi-shopping-outline"
fallbackImg="/images/product-avatar.png" fallback-img="/images/product-avatar.png"
color="var(--teal-10)" color="var(--teal-10)"
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:img=" :img="
`${baseUrl}/product/${currentIdProduct}/image/${formDataProduct.selectedImage}`.concat( `${baseUrl}/product/${currentIdProduct}/image/${formDataProduct.selectedImage}`.concat(
refreshImageState ? `?ts=${Date.now()}` : '', refreshImageState ? `?ts=${Date.now()}` : '',
) || '/images/product-avatar.png' ) || '/images/product-avatar.png'
" "
fallbackCover="/images/product-banner.png" fallback-cover="/images/product-banner.png"
:bgColor="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`" :bg-color="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`"
:menu="[ :menu="[
{ {
icon: 'mdi-office-building-outline', icon: 'mdi-office-building-outline',
@ -3603,7 +3605,7 @@ watch(
); );
} }
" "
:tabsList=" :tabs-list="
$q.screen.gt.sm $q.screen.gt.sm
? false ? false
: [ : [
@ -3759,13 +3761,13 @@ watch(
}" }"
> >
<ProfileBanner <ProfileBanner
hideFade hide-fade
useToggle use-toggle
hideActive hide-active
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:img="profileUrl || '/images/service-avatar-add.png'" :img="profileUrl || '/images/service-avatar-add.png'"
fallbackCover="/images/service-banner.png" fallback-cover="/images/service-banner.png"
:bgColor="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`" :bg-color="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`"
:menu="[ :menu="[
{ {
icon: 'mdi-office-building-outline', icon: 'mdi-office-building-outline',
@ -3794,7 +3796,7 @@ watch(
: 'CREATED'; : 'CREATED';
} }
" "
:tabsList=" :tabs-list="
$q.screen.gt.sm $q.screen.gt.sm
? false ? false
: [ : [
@ -3808,7 +3810,7 @@ watch(
}, },
] ]
" "
v-model:currentTab="serviceTab" v-model:current-tab="serviceTab"
/> />
</div> </div>
@ -3915,7 +3917,7 @@ watch(
:tree-view="serviceTreeView" :tree-view="serviceTreeView"
:service="formDataProductService" :service="formDataProductService"
dense dense
@addProduct=" @add-product="
async (index) => { async (index) => {
await fetchListOfProductIsAdd(currentIdGrop); await fetchListOfProductIsAdd(currentIdGrop);
currentWorkIndex = index; currentWorkIndex = index;
@ -4027,7 +4029,7 @@ watch(
<div class="q-pa-lg full-height"> <div class="q-pa-lg full-height">
<WorkNameManagement <WorkNameManagement
ref="workNameRef" ref="workNameRef"
v-model:nameList="workNameItems" v-model:name-list="workNameItems"
@delete="confirmDeleteWork" @delete="confirmDeleteWork"
@edit="editWork" @edit="editWork"
@add="createWork" @add="createWork"
@ -4064,20 +4066,20 @@ watch(
}" }"
> >
<ProfileBanner <ProfileBanner
hideFade hide-fade
:useToggle="actionDisplay" :use-toggle="actionDisplay"
:title="formDataProductService.name" :title="formDataProductService.name"
:caption="formDataProductService.code" :caption="formDataProductService.code"
:active="formDataProductService.status !== 'INACTIVE'" :active="formDataProductService.status !== 'INACTIVE'"
:toggleTitle="$t('status.title')" :toggle-title="$t('status.title')"
:img=" :img="
`${baseUrl}/service/${currentIdService}/image/${formDataProductService.selectedImage}`.concat( `${baseUrl}/service/${currentIdService}/image/${formDataProductService.selectedImage}`.concat(
refreshImageState ? `?ts=${Date.now()}` : '', refreshImageState ? `?ts=${Date.now()}` : '',
) || '/images/service-avatar.png' ) || '/images/service-avatar.png'
" "
fallbackImg="/images/service-avatar.png" fallback-img="/images/service-avatar.png"
fallbackCover="/images/service-banner.png" fallback-cover="/images/service-banner.png"
:bgColor="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`" :bg-color="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`"
:menu="[ :menu="[
{ {
icon: 'mdi-office-building-outline', icon: 'mdi-office-building-outline',
@ -4108,7 +4110,7 @@ watch(
); );
} }
" "
:tabsList=" :tabs-list="
$q.screen.gt.sm $q.screen.gt.sm
? false ? false
: [ : [
@ -4267,8 +4269,8 @@ watch(
:readonly="!infoServiceEdit" :readonly="!infoServiceEdit"
v-model:work-items="workItems" v-model:work-items="workItems"
dense dense
:priceDisplay="priceDisplay" :price-display="priceDisplay"
@addProduct=" @add-product="
async (index) => { async (index) => {
await fetchListOfProductIsAdd(currentIdGrop); await fetchListOfProductIsAdd(currentIdGrop);
currentWorkIndex = index; currentWorkIndex = index;
@ -4451,7 +4453,7 @@ watch(
<ImageUploadDialog <ImageUploadDialog
ref="refImageUpload" ref="refImageUpload"
v-model:dialogState="imageDialog" v-model:dialog-state="imageDialog"
v-model:file="profileFileImg" v-model:file="profileFileImg"
v-model:image-url="profileUrl as string" v-model:image-url="profileUrl as string"
v-model:data-list="imageList" v-model:data-list="imageList"