refactor: เปลี่ยนรูปรูปของลูกจ้าง
This commit is contained in:
parent
e6824716a1
commit
7469fa17d1
1 changed files with 31 additions and 97 deletions
|
|
@ -341,7 +341,8 @@ const formDataEmployeeOwner = ref<{
|
||||||
subDistrictId: string;
|
subDistrictId: string;
|
||||||
zipCode: string;
|
zipCode: string;
|
||||||
}>();
|
}>();
|
||||||
const formDataEmployee = ref<EmployeeCreate>({
|
const formDataEmployee = ref<EmployeeCreate >({
|
||||||
|
code:'',
|
||||||
image: null,
|
image: null,
|
||||||
customerBranchId: '',
|
customerBranchId: '',
|
||||||
nrcNo: '',
|
nrcNo: '',
|
||||||
|
|
@ -723,6 +724,7 @@ function clearFormEmployee() {
|
||||||
formDataEmployeeOwner.value = undefined;
|
formDataEmployeeOwner.value = undefined;
|
||||||
|
|
||||||
formDataEmployee.value = {
|
formDataEmployee.value = {
|
||||||
|
code:'',
|
||||||
image: null,
|
image: null,
|
||||||
customerBranchId: '',
|
customerBranchId: '',
|
||||||
nrcNo: '',
|
nrcNo: '',
|
||||||
|
|
@ -1221,7 +1223,10 @@ async function assignFormDataEmployee(id: string) {
|
||||||
zipCode: foundBranch.zipCode,
|
zipCode: foundBranch.zipCode,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
formDataEmployee.value = {
|
formDataEmployee.value = {
|
||||||
|
code: foundEmployee.code,
|
||||||
image: null,
|
image: null,
|
||||||
customerBranchId: foundEmployee.customerBranchId,
|
customerBranchId: foundEmployee.customerBranchId,
|
||||||
nrcNo: foundEmployee.nrcNo,
|
nrcNo: foundEmployee.nrcNo,
|
||||||
|
|
@ -2169,86 +2174,6 @@ watch([inputSearch, currentStatus], async () => {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</q-table>
|
</q-table>
|
||||||
|
|
||||||
<!-- <UsersDetailCardComponent
|
|
||||||
v-for="i in listCustomer"
|
|
||||||
:key="i.id"
|
|
||||||
class="hover-card"
|
|
||||||
:color="i.customerType === 'CORP' ? 'purple' : 'green'"
|
|
||||||
:metadata="{
|
|
||||||
id: i.id,
|
|
||||||
disabled:
|
|
||||||
i.status === 'ACTIVE' || i.status === 'CREATED',
|
|
||||||
}"
|
|
||||||
:badge="i.branch"
|
|
||||||
:list="{
|
|
||||||
id: i.id,
|
|
||||||
imageUrl: i.imageUrl,
|
|
||||||
type: i.customerType,
|
|
||||||
name: i.customerName === '' ? '-' : i.customerName,
|
|
||||||
code: i.code,
|
|
||||||
status: i.status,
|
|
||||||
|
|
||||||
detail: [
|
|
||||||
{
|
|
||||||
label: 'customerNameTh',
|
|
||||||
value: i.customerName,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'customerNameEn',
|
|
||||||
value: i.customerNameEN,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}"
|
|
||||||
@enter-card="
|
|
||||||
() => {
|
|
||||||
currentCustomerName = i.customerName;
|
|
||||||
customerType = i.customerType;
|
|
||||||
currentCustomerUrlImage = i.imageUrl;
|
|
||||||
currentCustomerId = i.id;
|
|
||||||
|
|
||||||
const { branch, ...payload } = i;
|
|
||||||
currentCustomer = payload;
|
|
||||||
isMainPage = false;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
@update-card="
|
|
||||||
() => {
|
|
||||||
if (!listCustomer) return;
|
|
||||||
|
|
||||||
customerType = i.customerType;
|
|
||||||
const { branch, ...payload } = i;
|
|
||||||
currentCustomer = payload;
|
|
||||||
|
|
||||||
currentCustomerId = i.id;
|
|
||||||
|
|
||||||
assignFormData(i.id);
|
|
||||||
|
|
||||||
infoDrawerEdit = true;
|
|
||||||
openDialogInputForm('INFO', i.id);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
@view-card="
|
|
||||||
() => {
|
|
||||||
const { branch, ...payload } = i;
|
|
||||||
currentCustomer = payload;
|
|
||||||
|
|
||||||
currentCustomerId = i.id;
|
|
||||||
customerType = i.customerType;
|
|
||||||
assignFormData(i.id);
|
|
||||||
openDialogInputForm('INFO', i.id);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
@delete-card="deleteCustomerById(i.id)"
|
|
||||||
@toggle-status="
|
|
||||||
() => {
|
|
||||||
toggleStatusCustomer(
|
|
||||||
i.id,
|
|
||||||
i.status === 'ACTIVE' ? true : false,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -2618,9 +2543,9 @@ watch([inputSearch, currentStatus], async () => {
|
||||||
code: props.row.code,
|
code: props.row.code,
|
||||||
name:
|
name:
|
||||||
$i18n.locale === 'en-US'
|
$i18n.locale === 'en-US'
|
||||||
? `${props.row.firstName} ${props.row.lastName} `.trim()
|
? `${props.row.firstNameEN} ${props.row.lastNameEN} `.trim()
|
||||||
: `${props.row.firstNameEN} ${props.row.lastNameEN} `.trim(),
|
: `${props.row.firstName} ${props.row.lastName} `.trim() ,
|
||||||
img: props.row.imageUrl,
|
img: props.row.profileImageUrl,
|
||||||
male: props.row.gender === 'male',
|
male: props.row.gender === 'male',
|
||||||
female: props.row.gender === 'female',
|
female: props.row.gender === 'female',
|
||||||
detail: [
|
detail: [
|
||||||
|
|
@ -3879,20 +3804,29 @@ watch([inputSearch, currentStatus], async () => {
|
||||||
<template #person-card>
|
<template #person-card>
|
||||||
<div class="q-ma-md">
|
<div class="q-ma-md">
|
||||||
<AppBox class="surface-1" style="padding: 0">
|
<AppBox class="surface-1" style="padding: 0">
|
||||||
<!-- <PersonCard -->
|
<PersonCard
|
||||||
<!-- :can-edit-profile="infoDrawerEmployeeEdit" -->
|
:can-edit-profile="infoDrawerEmployeeEdit"
|
||||||
<!-- no-hover -->
|
no-hover
|
||||||
<!-- no-action -->
|
no-action
|
||||||
<!-- no-detail -->
|
no-detail
|
||||||
|
:data="
|
||||||
|
{
|
||||||
|
name:formDataEmployee.firstName + ' ' + formDataEmployee.lastName,
|
||||||
|
code:formDataEmployee.code ,
|
||||||
|
male: formDataEmployee.gender === 'male',
|
||||||
|
female: formDataEmployee.gender === 'female',
|
||||||
|
img: profileUrl || undefined,
|
||||||
|
|
||||||
<!-- :list="infoEmployeePersonCard ? infoEmployeePersonCard : []" -->
|
}
|
||||||
<!-- :gridColumns="1" -->
|
"
|
||||||
<!-- @edit-profile=" -->
|
:list="infoEmployeePersonCard ? infoEmployeePersonCard : []"
|
||||||
<!-- () => { -->
|
:gridColumns="1"
|
||||||
<!-- inputFile.click(); -->
|
@edit-profile="
|
||||||
<!-- } -->
|
() => {
|
||||||
<!-- " -->
|
inputFile.click();
|
||||||
<!-- /> -->
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
</AppBox>
|
</AppBox>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue