fix: worker display number, expire date
This commit is contained in:
parent
1c3d4388f0
commit
d05eae23a9
2 changed files with 11 additions and 3 deletions
|
|
@ -394,6 +394,7 @@ async function assignWorkerToSelectedWorker() {
|
|||
if (quotationFormData.value.customerBranchId) {
|
||||
const retEmp = await customerStore.fetchBranchEmployee(
|
||||
quotationFormData.value.customerBranchId,
|
||||
{ passport: true },
|
||||
);
|
||||
if (retEmp) {
|
||||
workerList.value = retEmp.data.result;
|
||||
|
|
@ -560,7 +561,9 @@ watch(
|
|||
history.pushState({}, '', url.toString());
|
||||
|
||||
if (!v) return;
|
||||
const retEmp = await customerStore.fetchBranchEmployee(v);
|
||||
const retEmp = await customerStore.fetchBranchEmployee(v, {
|
||||
passport: true,
|
||||
});
|
||||
if (retEmp) {
|
||||
workerList.value = retEmp.data.result;
|
||||
}
|
||||
|
|
@ -702,7 +705,9 @@ async function searchEmployee(text: string) {
|
|||
fallback-img="/images/employee-avatar.png"
|
||||
:rows="
|
||||
selectedWorker.map((e: Employee) => ({
|
||||
foreignRefNo: '123456789',
|
||||
foreignRefNo: e.employeePassport
|
||||
? e.employeePassport[0]?.number || '-'
|
||||
: '-',
|
||||
employeeName:
|
||||
$i18n.locale === 'eng'
|
||||
? `${e.firstNameEN} ${e.lastNameEN}`
|
||||
|
|
@ -711,7 +716,9 @@ async function searchEmployee(text: string) {
|
|||
gender: e.gender,
|
||||
age: calculateAge(e.dateOfBirth),
|
||||
nationality: optionStore.mapOption(e.nationality),
|
||||
documentExpireDate: '1234',
|
||||
documentExpireDate: e.employeePassport
|
||||
? dateFormat(e.employeePassport[0]?.expireDate) || '-'
|
||||
: '-',
|
||||
imgUrl: `${baseUrl}/customer/${e.id}/image/${e.selectedImage}`,
|
||||
status: e.status,
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ const useCustomerStore = defineStore('api-customer', () => {
|
|||
query?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
passport?: boolean;
|
||||
},
|
||||
) {
|
||||
const params = new URLSearchParams();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue