2024-04-22 13:42:02 +07:00
|
|
|
<script setup lang="ts">
|
2024-06-10 16:00:52 +07:00
|
|
|
import { computed, ref, watch } from 'vue';
|
2024-06-06 17:10:58 +07:00
|
|
|
import { storeToRefs } from 'pinia';
|
2024-04-22 12:16:17 +07:00
|
|
|
|
2024-06-07 14:19:35 +07:00
|
|
|
import { Pagination } from 'src/stores/types';
|
|
|
|
|
import useCustomerStore from 'src/stores/customer';
|
2024-06-10 11:25:38 +00:00
|
|
|
import useEmployeeStore from 'src/stores/employee';
|
2024-06-07 14:19:35 +07:00
|
|
|
|
2024-06-14 09:22:34 +07:00
|
|
|
import { Status } from 'src/stores/types';
|
|
|
|
|
|
2024-06-13 14:56:31 +07:00
|
|
|
import ButtonAddComponent from 'src/components/ButtonAddCompoent.vue';
|
2024-06-10 11:25:38 +00:00
|
|
|
import PersonCard from 'components/home/PersonCard.vue';
|
2024-04-23 11:15:25 +00:00
|
|
|
import UsersDetailCardComponent from 'src/components/UsersDetailCardComponent.vue';
|
2024-04-22 13:42:02 +07:00
|
|
|
import SelectorList from 'components/SelectorList.vue';
|
|
|
|
|
import StatCardComponent from 'components/StatCardComponent.vue';
|
|
|
|
|
import TooltipComponent from 'components/TooltipComponent.vue';
|
|
|
|
|
import AddButton from 'components/AddButton.vue';
|
|
|
|
|
import AppBox from 'components/app/AppBox.vue';
|
2024-04-22 16:21:34 +07:00
|
|
|
import ItemCard from 'src/components/ItemCard.vue';
|
|
|
|
|
import FormDialog from 'src/components/FormDialog.vue';
|
|
|
|
|
import ProfileUpload from 'src/components/ProfileUpload.vue';
|
2024-04-22 17:00:30 +07:00
|
|
|
import BasicInformation from 'src/components/03_customer-management/BasicInformation.vue';
|
2024-04-23 11:37:27 +07:00
|
|
|
import TabComponent from 'src/components/TabComponent.vue';
|
2024-04-23 11:45:42 +07:00
|
|
|
import FormAddress from 'src/components/02_personnel-management/FormAddress.vue';
|
2024-04-23 13:51:32 +07:00
|
|
|
import AboutComponent from 'src/components/03_customer-management/AboutComponent.vue';
|
|
|
|
|
import ContactComponent from 'src/components/03_customer-management/ContactInformation.vue';
|
|
|
|
|
import OtherInformation from 'src/components/03_customer-management/OtherInformation.vue';
|
2024-04-23 13:41:11 +07:00
|
|
|
import FormBusiness from 'src/components/03_customer-management/FormBusiness.vue';
|
2024-04-23 11:15:25 +00:00
|
|
|
import DrawerInfo from 'src/components/DrawerInfo.vue';
|
|
|
|
|
import InfoForm from 'src/components/02_personnel-management/InfoForm.vue';
|
2024-06-07 11:58:27 +07:00
|
|
|
import CustomerInfoComponent from 'src/components/03_customer-management/CustomerInfoComponent.vue';
|
2024-06-18 13:29:45 +07:00
|
|
|
import NoData from 'components/NoData.vue';
|
|
|
|
|
|
2024-06-07 18:04:08 +07:00
|
|
|
import {
|
|
|
|
|
CustomerCreate,
|
|
|
|
|
CustomerStats,
|
|
|
|
|
Customer,
|
|
|
|
|
CustomerUpdate,
|
|
|
|
|
CustomerBranch,
|
2024-06-10 14:10:34 +07:00
|
|
|
CustomerBranchCreate,
|
2024-06-11 11:24:37 +07:00
|
|
|
CustomerType,
|
2024-06-07 18:04:08 +07:00
|
|
|
} from 'stores/customer/types';
|
2024-06-12 08:40:07 +00:00
|
|
|
import {
|
|
|
|
|
EmployeeCreate,
|
|
|
|
|
Employee,
|
|
|
|
|
EmployeeWork,
|
|
|
|
|
EmployeeCheckup,
|
|
|
|
|
EmployeeOther,
|
|
|
|
|
} from 'stores/employee/types';
|
2024-06-07 14:19:35 +07:00
|
|
|
import { onMounted } from 'vue';
|
2024-06-10 11:25:38 +00:00
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
import FormPerson from 'src/components/02_personnel-management/FormPerson.vue';
|
|
|
|
|
import FormEmployeeHealthCheck from 'src/components/03_customer-management/FormEmployeeHealthCheck.vue';
|
2024-06-10 11:25:38 +00:00
|
|
|
import FormEmployeeWorkHistory from 'src/components/03_customer-management/FormEmployeeWorkHistory.vue';
|
|
|
|
|
import FormEmployeeOther from 'src/components/03_customer-management/FormEmployeeOther.vue';
|
|
|
|
|
import FormEmployeePassport from 'src/components/03_customer-management/FormEmployeePassport.vue';
|
|
|
|
|
import FormEmployeeVisa from 'src/components/03_customer-management/FormEmployeeVisa.vue';
|
2024-06-13 13:33:47 +07:00
|
|
|
import { Icon } from '@iconify/vue';
|
2024-06-10 11:25:38 +00:00
|
|
|
import { dialog, calculateAge } from 'src/stores/utils';
|
2024-06-10 16:00:52 +07:00
|
|
|
import { useI18n } from 'vue-i18n';
|
2024-06-07 14:56:51 +07:00
|
|
|
|
2024-06-10 16:00:52 +07:00
|
|
|
const { t, locale } = useI18n();
|
2024-06-06 17:10:58 +07:00
|
|
|
const userCustomer = useCustomerStore();
|
2024-06-10 14:10:34 +07:00
|
|
|
const {
|
|
|
|
|
create,
|
|
|
|
|
getStatsCustomer,
|
|
|
|
|
fetchList,
|
|
|
|
|
editById,
|
|
|
|
|
fetchListById,
|
|
|
|
|
createBranch,
|
|
|
|
|
deleteBranchById,
|
2024-06-10 16:02:14 +07:00
|
|
|
editBranchById,
|
2024-06-11 12:27:58 +00:00
|
|
|
fetchListBranch,
|
2024-06-13 10:07:20 +00:00
|
|
|
fetchListBranchById,
|
2024-06-10 14:10:34 +07:00
|
|
|
} = userCustomer;
|
2024-06-10 11:25:38 +00:00
|
|
|
const employeeStore = useEmployeeStore();
|
2024-04-23 17:20:31 +07:00
|
|
|
const formData = ref<CustomerCreate>({
|
2024-06-06 17:10:58 +07:00
|
|
|
status: 'CREATED',
|
2024-06-18 10:44:07 +07:00
|
|
|
personName: '',
|
2024-04-23 17:20:31 +07:00
|
|
|
customerType: 'CORP',
|
|
|
|
|
customerName: '',
|
|
|
|
|
customerNameEN: '',
|
2024-06-06 17:10:58 +07:00
|
|
|
taxNo: '',
|
2024-04-23 17:20:31 +07:00
|
|
|
customerBranch: [
|
|
|
|
|
{
|
|
|
|
|
address: '',
|
2024-04-24 10:23:19 +07:00
|
|
|
addressEN: '',
|
|
|
|
|
provinceId: '',
|
|
|
|
|
districtId: '',
|
|
|
|
|
subDistrictId: '',
|
2024-04-23 17:20:31 +07:00
|
|
|
zipCode: '',
|
|
|
|
|
email: '',
|
|
|
|
|
telephoneNo: '',
|
2024-04-24 10:23:19 +07:00
|
|
|
name: '',
|
2024-06-06 17:10:58 +07:00
|
|
|
status: 'CREATED',
|
2024-04-24 10:23:19 +07:00
|
|
|
taxNo: '',
|
|
|
|
|
nameEN: '',
|
|
|
|
|
legalPersonNo: '',
|
2024-04-23 17:20:31 +07:00
|
|
|
registerName: '',
|
2024-06-06 17:10:58 +07:00
|
|
|
registerDate: new Date(),
|
2024-04-23 17:20:31 +07:00
|
|
|
authorizedCapital: '',
|
2024-04-24 10:23:19 +07:00
|
|
|
employmentOffice: '',
|
|
|
|
|
bussinessType: '',
|
|
|
|
|
bussinessTypeEN: '',
|
|
|
|
|
jobPosition: '',
|
|
|
|
|
jobPositionEN: '',
|
|
|
|
|
jobDescription: '',
|
|
|
|
|
saleEmployee: '',
|
2024-06-07 14:19:35 +07:00
|
|
|
payDate: new Date(),
|
|
|
|
|
wageRate: 0,
|
2024-04-23 17:20:31 +07:00
|
|
|
},
|
|
|
|
|
],
|
2024-06-10 16:02:14 +07:00
|
|
|
image: null,
|
|
|
|
|
});
|
2024-06-10 16:00:52 +07:00
|
|
|
|
2024-06-18 13:29:45 +07:00
|
|
|
const inputSearch = ref<string>();
|
2024-06-10 16:00:52 +07:00
|
|
|
const fieldSelectedCustomer = ref<{ label: string; value: string }>({
|
|
|
|
|
label: t('all'),
|
|
|
|
|
value: 'all',
|
2024-04-23 17:20:31 +07:00
|
|
|
});
|
|
|
|
|
|
2024-06-13 10:07:20 +00:00
|
|
|
const currentEmployee = ref<Employee | undefined>();
|
|
|
|
|
const currentEmployeeCode = ref('');
|
2024-06-12 08:40:07 +00:00
|
|
|
const isEmployeeEdit = ref(false);
|
2024-06-13 10:07:20 +00:00
|
|
|
const formDataEmployeeSameAddr = ref(true);
|
2024-06-07 12:24:09 +00:00
|
|
|
const formDataEmployeeTab = ref('personalInfo');
|
2024-06-12 08:40:07 +00:00
|
|
|
const infoDrawerEmployee = ref(false);
|
|
|
|
|
const infoDrawerEmployeeEdit = ref(false);
|
|
|
|
|
const infoEmployeePersonCard = ref();
|
2024-06-12 09:57:34 +00:00
|
|
|
const statsEmployee = ref(0);
|
2024-06-13 11:07:04 +00:00
|
|
|
const statsEmployeeGender = ref<{ male: number; female: number }>();
|
2024-06-13 10:07:20 +00:00
|
|
|
const formDataEmployeeOwner = ref<{
|
|
|
|
|
id: string;
|
|
|
|
|
address: string;
|
|
|
|
|
addressEN: string;
|
|
|
|
|
provinceId: string;
|
|
|
|
|
districtId: string;
|
|
|
|
|
subDistrictId: string;
|
|
|
|
|
zipCode: string;
|
|
|
|
|
}>();
|
2024-06-10 11:25:38 +00:00
|
|
|
const formDataEmployee = ref<EmployeeCreate>({
|
2024-06-11 05:01:58 +00:00
|
|
|
image: null,
|
|
|
|
|
customerBranchId: '',
|
2024-06-07 12:24:09 +00:00
|
|
|
nrcNo: '',
|
2024-06-11 05:01:58 +00:00
|
|
|
dateOfBirth: null,
|
2024-06-10 11:25:38 +00:00
|
|
|
gender: '',
|
|
|
|
|
nationality: '',
|
|
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
firstName: '',
|
|
|
|
|
firstNameEN: '',
|
|
|
|
|
lastName: '',
|
|
|
|
|
lastNameEN: '',
|
2024-06-10 11:25:38 +00:00
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
addressEN: '',
|
2024-06-10 11:25:38 +00:00
|
|
|
address: '',
|
2024-06-07 12:24:09 +00:00
|
|
|
zipCode: '',
|
2024-06-10 11:25:38 +00:00
|
|
|
|
|
|
|
|
passportType: '',
|
|
|
|
|
passportNumber: '',
|
2024-06-11 05:01:58 +00:00
|
|
|
passportIssueDate: null,
|
|
|
|
|
passportExpiryDate: null,
|
2024-06-10 11:25:38 +00:00
|
|
|
passportIssuingCountry: '',
|
|
|
|
|
passportIssuingPlace: '',
|
|
|
|
|
previousPassportReference: '',
|
|
|
|
|
|
|
|
|
|
visaType: '',
|
|
|
|
|
visaNumber: '',
|
2024-06-11 05:01:58 +00:00
|
|
|
visaIssueDate: null,
|
|
|
|
|
visaExpiryDate: null,
|
2024-06-10 11:25:38 +00:00
|
|
|
visaIssuingPlace: '',
|
2024-06-11 05:01:58 +00:00
|
|
|
visaStayUntilDate: null,
|
2024-06-10 11:25:38 +00:00
|
|
|
tm6Number: '',
|
2024-06-11 05:01:58 +00:00
|
|
|
entryDate: null,
|
2024-06-10 11:25:38 +00:00
|
|
|
workerStatus: '',
|
|
|
|
|
|
|
|
|
|
subDistrictId: '',
|
|
|
|
|
districtId: '',
|
|
|
|
|
provinceId: '',
|
|
|
|
|
|
|
|
|
|
employeeWork: [
|
2024-06-11 07:34:10 +00:00
|
|
|
{
|
|
|
|
|
workEndDate: null,
|
|
|
|
|
workPermitExpireDate: null,
|
|
|
|
|
workPermitIssuDate: null,
|
|
|
|
|
workPermitNo: '',
|
|
|
|
|
workplace: '',
|
|
|
|
|
jobType: '',
|
|
|
|
|
positionName: '',
|
|
|
|
|
ownerName: '',
|
|
|
|
|
remark: '',
|
|
|
|
|
},
|
2024-06-10 11:25:38 +00:00
|
|
|
],
|
|
|
|
|
employeeCheckup: [
|
2024-06-11 07:34:10 +00:00
|
|
|
{
|
|
|
|
|
coverageExpireDate: null,
|
|
|
|
|
coverageStartDate: null,
|
|
|
|
|
insuranceCompany: '',
|
|
|
|
|
medicalBenefitScheme: '',
|
|
|
|
|
remark: '',
|
|
|
|
|
hospitalName: '',
|
|
|
|
|
provinceId: '',
|
|
|
|
|
checkupResult: '',
|
|
|
|
|
checkupType: '',
|
|
|
|
|
},
|
2024-06-10 11:25:38 +00:00
|
|
|
],
|
|
|
|
|
employeeOtherInfo: {
|
|
|
|
|
citizenId: '',
|
|
|
|
|
fatherFirstName: '',
|
|
|
|
|
fatherLastName: '',
|
|
|
|
|
fatherFirstNameEN: '',
|
|
|
|
|
fatherLastNameEN: '',
|
2024-06-11 12:27:58 +00:00
|
|
|
fatherBirthPlace: '',
|
2024-06-10 11:25:38 +00:00
|
|
|
|
|
|
|
|
motherFirstName: '',
|
|
|
|
|
motherLastName: '',
|
|
|
|
|
motherFirstNameEN: '',
|
|
|
|
|
motherLastNameEN: '',
|
2024-06-11 12:27:58 +00:00
|
|
|
motherBirthPlace: '',
|
2024-06-10 11:25:38 +00:00
|
|
|
},
|
2024-06-07 12:24:09 +00:00
|
|
|
});
|
|
|
|
|
|
2024-04-23 17:20:31 +07:00
|
|
|
const indexTab = ref<number>(0);
|
2024-04-22 16:21:34 +07:00
|
|
|
const statusToggle = ref<boolean>(false);
|
|
|
|
|
const profileSubmit = ref<boolean>(false);
|
|
|
|
|
const profileFile = ref<File | undefined>(undefined);
|
|
|
|
|
const profileUrl = ref<string | null>('');
|
2024-04-23 11:15:25 +00:00
|
|
|
const infoDrawer = ref(false);
|
2024-06-06 10:28:59 +00:00
|
|
|
const infoDrawerEdit = ref(false);
|
2024-06-07 11:58:27 +07:00
|
|
|
const isMainPage = ref<boolean>(true);
|
2024-06-07 14:19:35 +07:00
|
|
|
const statsCustomerType = ref<CustomerStats>();
|
|
|
|
|
const currentCustomerId = ref<string>('');
|
2024-06-10 12:00:16 +07:00
|
|
|
const dialogInputCustomerBranchForm = ref<boolean>(false);
|
2024-06-07 18:04:08 +07:00
|
|
|
const currentCustomer = ref<Customer>();
|
2024-06-12 16:21:33 +07:00
|
|
|
|
|
|
|
|
const currentBranch = ref<{ name: string; code: string }>({
|
|
|
|
|
name: '',
|
|
|
|
|
code: '',
|
|
|
|
|
});
|
|
|
|
|
|
2024-06-10 12:00:16 +07:00
|
|
|
const branch = ref<CustomerBranch[]>();
|
|
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
const currentPageCustomer = ref<number>(1);
|
|
|
|
|
const maxPageCustomer = ref<number>(1);
|
|
|
|
|
const pageSizeCustomer = ref<number>(30);
|
|
|
|
|
|
2024-06-13 11:58:51 +07:00
|
|
|
const currentPageEmployee = ref<number>(1);
|
|
|
|
|
const maxPageEmployee = ref<number>(1);
|
|
|
|
|
const pageSizeEmployee = ref<number>(30);
|
|
|
|
|
|
2024-06-10 16:02:14 +07:00
|
|
|
const currentBranchId = ref<string>('');
|
2024-06-10 12:00:16 +07:00
|
|
|
const currentCustomerName = ref<string>('');
|
2024-06-11 11:24:37 +07:00
|
|
|
const currentCustomerUrlImage = ref<string | null>(null);
|
2024-06-13 13:33:47 +07:00
|
|
|
const genderselector = ref<string>('');
|
2024-06-07 18:04:08 +07:00
|
|
|
|
2024-06-18 13:29:45 +07:00
|
|
|
const totalCustomer = ref<number>(0);
|
|
|
|
|
|
2024-06-14 13:03:20 +07:00
|
|
|
const currentStatus = ref<Status | 'All'>('All');
|
|
|
|
|
|
2024-04-22 16:21:34 +07:00
|
|
|
const inputFile = (() => {
|
|
|
|
|
const element = document.createElement('input');
|
|
|
|
|
element.type = 'file';
|
|
|
|
|
element.accept = 'image/*';
|
|
|
|
|
|
|
|
|
|
const reader = new FileReader();
|
|
|
|
|
reader.addEventListener('load', () => {
|
|
|
|
|
if (typeof reader.result === 'string') profileUrl.value = reader.result;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
element.addEventListener('change', () => {
|
|
|
|
|
profileFile.value = element.files?.[0];
|
|
|
|
|
if (profileFile.value) {
|
|
|
|
|
reader.readAsDataURL(profileFile.value);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return element;
|
|
|
|
|
})();
|
|
|
|
|
|
2024-06-07 18:04:08 +07:00
|
|
|
const listCustomer = ref<(Customer & { branch: CustomerBranch[] })[]>();
|
2024-06-10 11:25:38 +00:00
|
|
|
const listEmployee = ref();
|
2024-06-07 14:19:35 +07:00
|
|
|
|
2024-04-22 16:21:34 +07:00
|
|
|
const itemCard = [
|
|
|
|
|
{
|
|
|
|
|
icon: 'mdi:office-building',
|
2024-06-11 15:31:00 +07:00
|
|
|
text: 'customerLegalEntity',
|
2024-04-22 16:21:34 +07:00
|
|
|
color: 'var(--purple-8)',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: 'heroicons:user-solid',
|
2024-06-11 15:31:00 +07:00
|
|
|
text: 'customerNaturalPerson',
|
2024-04-22 16:21:34 +07:00
|
|
|
color: 'var(--green-9)',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const customerStats = [
|
2024-04-22 13:42:02 +07:00
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
count: 2,
|
2024-06-11 11:24:37 +07:00
|
|
|
name: 'CORP',
|
2024-04-22 13:42:02 +07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
count: 3,
|
2024-06-11 11:24:37 +07:00
|
|
|
name: 'PERS',
|
2024-04-22 13:42:02 +07:00
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
const employeeTab = [
|
|
|
|
|
{
|
|
|
|
|
name: 'personalInfo',
|
|
|
|
|
label: 'personalInfo',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'healthCheck',
|
|
|
|
|
label: 'healthCheck',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'workHistory',
|
|
|
|
|
label: 'workHistory',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'other',
|
|
|
|
|
label: 'other',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2024-06-11 15:31:00 +07:00
|
|
|
const fieldCustomer = ref([
|
|
|
|
|
'all',
|
|
|
|
|
'customerLegalEntity',
|
|
|
|
|
'customerNaturalPerson',
|
|
|
|
|
]);
|
2024-06-10 16:00:52 +07:00
|
|
|
|
2024-04-22 16:21:34 +07:00
|
|
|
const dialogCustomerType = ref<boolean>(false);
|
|
|
|
|
const dialogInputForm = ref<boolean>(false);
|
2024-06-07 12:24:09 +00:00
|
|
|
const dialogEmployee = ref<boolean>(false);
|
2024-04-22 16:21:34 +07:00
|
|
|
|
2024-06-10 16:02:14 +07:00
|
|
|
const infoDrawerBranch = ref<boolean>(false);
|
|
|
|
|
|
2024-04-22 13:42:02 +07:00
|
|
|
const selectorLabel = ref<string>('');
|
|
|
|
|
const selectorList = computed(() => [
|
2024-06-07 14:19:35 +07:00
|
|
|
{
|
|
|
|
|
label: 'EMPLOYER',
|
|
|
|
|
count:
|
|
|
|
|
(statsCustomerType.value?.CORP ?? 0) +
|
|
|
|
|
(statsCustomerType.value?.PERS ?? 0),
|
|
|
|
|
},
|
2024-06-10 11:25:38 +00:00
|
|
|
{
|
|
|
|
|
label: 'EMPLOYEE',
|
2024-06-12 09:57:34 +00:00
|
|
|
count: statsEmployee.value ?? 0,
|
2024-06-10 11:25:38 +00:00
|
|
|
},
|
2024-04-22 13:42:02 +07:00
|
|
|
]);
|
2024-04-22 16:21:34 +07:00
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
const customerType = ref<CustomerType>('CORP');
|
2024-04-22 16:21:34 +07:00
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
function triggerCreate(type: CustomerType) {
|
2024-04-22 16:21:34 +07:00
|
|
|
customerType.value = type;
|
|
|
|
|
openDialogInputForm();
|
|
|
|
|
dialogCustomerType.value = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function openDialogCustomerType() {
|
2024-06-07 12:24:09 +00:00
|
|
|
if (selectorLabel.value === 'EMPLOYER') {
|
|
|
|
|
dialogCustomerType.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (selectorLabel.value === 'EMPLOYEE') {
|
|
|
|
|
dialogEmployee.value = true;
|
|
|
|
|
}
|
2024-04-22 16:21:34 +07:00
|
|
|
}
|
|
|
|
|
|
2024-06-12 08:40:07 +00:00
|
|
|
async function openDialogInputForm(
|
|
|
|
|
action: 'FORM' | 'INFO' = 'FORM',
|
|
|
|
|
id?: string,
|
|
|
|
|
) {
|
2024-04-23 11:15:25 +00:00
|
|
|
if (action === 'INFO') {
|
|
|
|
|
if (!id) return;
|
2024-06-12 08:40:07 +00:00
|
|
|
if (selectorLabel.value === 'EMPLOYER') infoDrawer.value = true;
|
|
|
|
|
if (selectorLabel.value === 'EMPLOYEE') {
|
|
|
|
|
await assignFormDataEmployee(id);
|
|
|
|
|
infoDrawerEmployee.value = true;
|
|
|
|
|
infoDrawerEmployeeEdit.value = false;
|
|
|
|
|
const employee = currentEmployee.value;
|
|
|
|
|
infoEmployeePersonCard.value = employee
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
id: employee.id,
|
|
|
|
|
img: `${employee.profileImageUrl}`,
|
|
|
|
|
name:
|
|
|
|
|
locale.value === 'en-US'
|
|
|
|
|
? `${employee.firstNameEN} ${employee.lastNameEN}`
|
|
|
|
|
: `${employee.firstName} ${employee.lastName}`,
|
|
|
|
|
male: employee.gender === 'male',
|
|
|
|
|
female: employee.gender === 'female',
|
|
|
|
|
badge: employee.code,
|
|
|
|
|
disabled: employee.status === 'INACTIVE',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: [];
|
|
|
|
|
|
|
|
|
|
const code = currentEmployee.value?.code.split('-')[0];
|
|
|
|
|
const result = await fetchListBranch({
|
|
|
|
|
includeCustomer: true,
|
|
|
|
|
query: code,
|
|
|
|
|
pageSize: 30,
|
|
|
|
|
});
|
2024-06-13 10:07:20 +00:00
|
|
|
if (result) employeeStore.ownerOption = result.result;
|
2024-06-12 08:40:07 +00:00
|
|
|
}
|
2024-04-23 11:15:25 +00:00
|
|
|
} else {
|
2024-06-12 08:40:07 +00:00
|
|
|
if (selectorLabel.value === 'EMPLOYER') dialogInputForm.value = true;
|
|
|
|
|
if (selectorLabel.value === 'EMPLOYEE') {
|
|
|
|
|
if (!id) return;
|
|
|
|
|
await assignFormDataEmployee(id);
|
2024-06-13 03:50:14 +00:00
|
|
|
const code = currentEmployee.value?.code.split('-')[0];
|
|
|
|
|
|
|
|
|
|
const result = await fetchListBranch({
|
|
|
|
|
includeCustomer: true,
|
|
|
|
|
query: code,
|
|
|
|
|
pageSize: 30,
|
|
|
|
|
});
|
2024-06-13 10:07:20 +00:00
|
|
|
if (result) employeeStore.ownerOption = result.result;
|
2024-06-12 08:40:07 +00:00
|
|
|
dialogEmployee.value = true;
|
|
|
|
|
}
|
2024-04-23 11:15:25 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onClose() {
|
|
|
|
|
infoDrawer.value = false;
|
2024-06-10 16:02:14 +07:00
|
|
|
infoDrawerEdit.value = false;
|
|
|
|
|
dialogInputForm.value = false;
|
|
|
|
|
clearForm();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onCloseBranch() {
|
|
|
|
|
infoDrawerBranch.value = false;
|
|
|
|
|
infoDrawerEdit.value = false;
|
2024-04-23 11:15:25 +00:00
|
|
|
dialogInputForm.value = false;
|
2024-06-07 18:04:08 +07:00
|
|
|
clearForm();
|
2024-04-22 16:21:34 +07:00
|
|
|
}
|
2024-06-06 17:10:58 +07:00
|
|
|
|
|
|
|
|
function clearForm() {
|
|
|
|
|
dialogInputForm.value = false;
|
|
|
|
|
formData.value = {
|
|
|
|
|
status: 'CREATED',
|
|
|
|
|
customerType: 'CORP',
|
|
|
|
|
customerName: '',
|
|
|
|
|
customerNameEN: '',
|
2024-06-18 10:44:07 +07:00
|
|
|
personName: '',
|
2024-06-06 17:10:58 +07:00
|
|
|
taxNo: '',
|
|
|
|
|
customerBranch: [
|
|
|
|
|
{
|
|
|
|
|
address: '',
|
|
|
|
|
addressEN: '',
|
|
|
|
|
provinceId: '',
|
|
|
|
|
districtId: '',
|
|
|
|
|
subDistrictId: '',
|
|
|
|
|
zipCode: '',
|
|
|
|
|
email: '',
|
|
|
|
|
telephoneNo: '',
|
|
|
|
|
name: '',
|
|
|
|
|
status: 'CREATED',
|
|
|
|
|
taxNo: '',
|
|
|
|
|
nameEN: '',
|
|
|
|
|
legalPersonNo: '',
|
|
|
|
|
registerName: '',
|
2024-06-07 14:47:37 +07:00
|
|
|
registerDate: new Date(),
|
2024-06-06 17:10:58 +07:00
|
|
|
authorizedCapital: '',
|
|
|
|
|
employmentOffice: '',
|
|
|
|
|
bussinessType: '',
|
|
|
|
|
bussinessTypeEN: '',
|
|
|
|
|
jobPosition: '',
|
|
|
|
|
jobPositionEN: '',
|
|
|
|
|
jobDescription: '',
|
|
|
|
|
saleEmployee: '',
|
2024-06-07 14:19:35 +07:00
|
|
|
payDate: new Date(),
|
|
|
|
|
wageRate: 0,
|
2024-06-06 17:10:58 +07:00
|
|
|
},
|
|
|
|
|
],
|
2024-06-10 16:02:14 +07:00
|
|
|
image: null,
|
2024-06-06 17:10:58 +07:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-11 12:27:58 +00:00
|
|
|
function clearFormEmployee() {
|
2024-06-12 08:40:07 +00:00
|
|
|
profileUrl.value = null;
|
|
|
|
|
profileSubmit.value = false;
|
|
|
|
|
dialogEmployee.value = false;
|
|
|
|
|
isEmployeeEdit.value = false;
|
|
|
|
|
infoDrawerEmployee.value = false;
|
|
|
|
|
infoDrawerEmployeeEdit.value = false;
|
2024-06-13 10:07:20 +00:00
|
|
|
formDataEmployeeSameAddr.value = true;
|
|
|
|
|
currentEmployeeCode.value = '';
|
|
|
|
|
|
|
|
|
|
currentEmployee.value = undefined;
|
|
|
|
|
formDataEmployeeOwner.value = undefined;
|
|
|
|
|
|
2024-06-11 12:27:58 +00:00
|
|
|
formDataEmployee.value = {
|
|
|
|
|
image: null,
|
|
|
|
|
customerBranchId: '',
|
|
|
|
|
nrcNo: '',
|
|
|
|
|
dateOfBirth: null,
|
|
|
|
|
gender: '',
|
|
|
|
|
nationality: '',
|
|
|
|
|
firstName: '',
|
|
|
|
|
firstNameEN: '',
|
|
|
|
|
lastName: '',
|
|
|
|
|
lastNameEN: '',
|
|
|
|
|
addressEN: '',
|
|
|
|
|
address: '',
|
|
|
|
|
zipCode: '',
|
|
|
|
|
passportType: '',
|
|
|
|
|
passportNumber: '',
|
|
|
|
|
passportIssueDate: null,
|
|
|
|
|
passportExpiryDate: null,
|
|
|
|
|
passportIssuingCountry: '',
|
|
|
|
|
passportIssuingPlace: '',
|
|
|
|
|
previousPassportReference: '',
|
|
|
|
|
visaType: '',
|
|
|
|
|
visaNumber: '',
|
|
|
|
|
visaIssueDate: null,
|
|
|
|
|
visaExpiryDate: null,
|
|
|
|
|
visaIssuingPlace: '',
|
|
|
|
|
visaStayUntilDate: null,
|
|
|
|
|
tm6Number: '',
|
|
|
|
|
entryDate: null,
|
|
|
|
|
workerStatus: '',
|
|
|
|
|
subDistrictId: '',
|
|
|
|
|
districtId: '',
|
|
|
|
|
provinceId: '',
|
|
|
|
|
employeeWork: [
|
|
|
|
|
{
|
|
|
|
|
workEndDate: null,
|
|
|
|
|
workPermitExpireDate: null,
|
|
|
|
|
workPermitIssuDate: null,
|
|
|
|
|
workPermitNo: '',
|
|
|
|
|
workplace: '',
|
|
|
|
|
jobType: '',
|
|
|
|
|
positionName: '',
|
|
|
|
|
ownerName: '',
|
|
|
|
|
remark: '',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
employeeCheckup: [
|
|
|
|
|
{
|
|
|
|
|
coverageExpireDate: null,
|
|
|
|
|
coverageStartDate: null,
|
|
|
|
|
insuranceCompany: '',
|
|
|
|
|
medicalBenefitScheme: '',
|
|
|
|
|
remark: '',
|
|
|
|
|
hospitalName: '',
|
|
|
|
|
provinceId: '',
|
|
|
|
|
checkupResult: '',
|
|
|
|
|
checkupType: '',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
employeeOtherInfo: {
|
|
|
|
|
citizenId: '',
|
|
|
|
|
fatherFirstName: '',
|
|
|
|
|
fatherLastName: '',
|
|
|
|
|
fatherFirstNameEN: '',
|
|
|
|
|
fatherLastNameEN: '',
|
|
|
|
|
fatherBirthPlace: '',
|
|
|
|
|
|
|
|
|
|
motherFirstName: '',
|
|
|
|
|
motherLastName: '',
|
|
|
|
|
motherFirstNameEN: '',
|
|
|
|
|
motherLastNameEN: '',
|
|
|
|
|
motherBirthPlace: '',
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-10 16:17:38 +07:00
|
|
|
function deleteCustomerById(id: string) {
|
|
|
|
|
dialog({
|
|
|
|
|
color: 'negative',
|
|
|
|
|
icon: 'mdi-alert',
|
|
|
|
|
title: t('deleteConfirmTitle'),
|
|
|
|
|
actionText: t('ok'),
|
|
|
|
|
persistent: true,
|
|
|
|
|
message: t('deleteConfirmMessage'),
|
|
|
|
|
action: async () => {
|
|
|
|
|
await userCustomer.deleteById(id);
|
|
|
|
|
|
|
|
|
|
const resultList = await fetchList({ includeBranch: true });
|
|
|
|
|
|
|
|
|
|
if (resultList) listCustomer.value = resultList.result;
|
|
|
|
|
infoDrawer.value = false;
|
|
|
|
|
},
|
|
|
|
|
cancel: () => {},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deleteBranchId(id: string) {
|
|
|
|
|
dialog({
|
|
|
|
|
color: 'negative',
|
|
|
|
|
icon: 'mdi-alert',
|
|
|
|
|
title: t('deleteConfirmTitle'),
|
|
|
|
|
actionText: t('ok'),
|
|
|
|
|
persistent: true,
|
|
|
|
|
message: t('deleteConfirmMessage'),
|
|
|
|
|
action: async () => {
|
|
|
|
|
await userCustomer.deleteBranchById(id);
|
|
|
|
|
|
|
|
|
|
const result = await fetchListById(currentCustomerId.value);
|
|
|
|
|
|
|
|
|
|
if (result) branch.value = result.branch;
|
|
|
|
|
infoDrawerBranch.value = false;
|
|
|
|
|
},
|
|
|
|
|
cancel: () => {},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-06 17:10:58 +07:00
|
|
|
async function onSubmit() {
|
2024-06-11 05:01:58 +00:00
|
|
|
if (selectorLabel.value === 'EMPLOYER') {
|
|
|
|
|
await create({
|
|
|
|
|
...formData.value,
|
|
|
|
|
customerType: customerType.value === 'CORP' ? 'CORP' : 'PERS',
|
|
|
|
|
image: profileSubmit.value ? profileFile.value ?? null : null,
|
|
|
|
|
});
|
|
|
|
|
clearForm();
|
|
|
|
|
const resultList = await fetchList({ includeBranch: true });
|
2024-06-10 11:11:19 +07:00
|
|
|
|
2024-06-11 05:01:58 +00:00
|
|
|
if (resultList) listCustomer.value = resultList.result;
|
|
|
|
|
}
|
2024-06-10 11:25:38 +00:00
|
|
|
|
|
|
|
|
if (selectorLabel.value === 'EMPLOYEE') {
|
2024-06-13 03:50:14 +00:00
|
|
|
const isOk = await checkEmployeeForm();
|
|
|
|
|
if (isOk) {
|
|
|
|
|
await employeeStore.create({
|
|
|
|
|
...formDataEmployee.value,
|
|
|
|
|
image: profileSubmit.value ? profileFile.value ?? null : null,
|
|
|
|
|
});
|
|
|
|
|
const resultList = await employeeStore.fetchList();
|
|
|
|
|
if (resultList) listEmployee.value = resultList.result;
|
2024-06-12 08:40:07 +00:00
|
|
|
|
2024-06-13 03:50:14 +00:00
|
|
|
const resultStatsEmployee = await employeeStore.getStatsEmployee();
|
|
|
|
|
if (resultStatsEmployee) statsEmployee.value = resultStatsEmployee;
|
2024-06-12 09:57:34 +00:00
|
|
|
|
2024-06-13 03:50:14 +00:00
|
|
|
clearFormEmployee();
|
|
|
|
|
}
|
2024-06-10 11:25:38 +00:00
|
|
|
}
|
2024-06-06 17:10:58 +07:00
|
|
|
}
|
2024-06-06 10:28:59 +00:00
|
|
|
|
2024-06-10 12:00:16 +07:00
|
|
|
async function onSubmitCustomerBranch() {
|
|
|
|
|
dialogInputCustomerBranchForm.value = false;
|
2024-06-10 14:10:34 +07:00
|
|
|
// await createBranch();
|
|
|
|
|
|
|
|
|
|
for (const item of formData.value.customerBranch || []) {
|
|
|
|
|
await createBranch({
|
|
|
|
|
...item,
|
|
|
|
|
customerId: currentCustomerId.value,
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-06-10 12:00:16 +07:00
|
|
|
clearForm();
|
|
|
|
|
const result = await fetchListById(currentCustomerId.value);
|
|
|
|
|
if (result) {
|
|
|
|
|
currentCustomerName.value = result.customerName;
|
|
|
|
|
currentCustomerUrlImage.value = result.imageUrl;
|
|
|
|
|
branch.value = result.branch;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-10 16:02:14 +07:00
|
|
|
const resultSearch = ref<(Customer & { branch: CustomerBranch[] })[]>();
|
2024-06-13 11:48:08 +07:00
|
|
|
const resultSearchEmployee = ref();
|
2024-06-10 16:02:14 +07:00
|
|
|
|
|
|
|
|
async function searchCustomer() {
|
|
|
|
|
const resultList = await fetchList({
|
|
|
|
|
query: inputSearch.value,
|
|
|
|
|
includeBranch: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (resultList) {
|
|
|
|
|
resultSearch.value = resultList.result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-13 11:48:08 +07:00
|
|
|
async function searchEmployee() {
|
|
|
|
|
const resultList = await employeeStore.fetchList({
|
|
|
|
|
query: inputSearch.value,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (resultList) {
|
|
|
|
|
resultSearchEmployee.value = resultList.result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
async function fetchListCustomer() {
|
|
|
|
|
const resultList = await fetchList({
|
|
|
|
|
includeBranch: true,
|
|
|
|
|
page: currentPageCustomer.value,
|
|
|
|
|
pageSize: pageSizeCustomer.value,
|
2024-06-14 13:03:20 +07:00
|
|
|
status:
|
|
|
|
|
currentStatus.value === 'All'
|
|
|
|
|
? undefined
|
|
|
|
|
: currentStatus.value === 'ACTIVE'
|
|
|
|
|
? 'ACTIVE'
|
|
|
|
|
: 'INACTIVE',
|
2024-06-11 11:24:37 +07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (resultList) {
|
|
|
|
|
currentPageCustomer.value = resultList.page;
|
|
|
|
|
maxPageCustomer.value = Math.ceil(
|
|
|
|
|
resultList.total / pageSizeCustomer.value,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
listCustomer.value = resultList.result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-17 10:02:51 +07:00
|
|
|
async function fetchListEmployee(param?: {
|
|
|
|
|
gender?: string;
|
|
|
|
|
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE' | undefined;
|
|
|
|
|
}) {
|
2024-06-13 11:07:04 +00:00
|
|
|
const resultListEmployee = await employeeStore.fetchList(param);
|
2024-06-13 11:58:51 +07:00
|
|
|
if (resultListEmployee) {
|
|
|
|
|
currentPageEmployee.value = resultListEmployee.page;
|
|
|
|
|
maxPageEmployee.value = Math.ceil(
|
|
|
|
|
resultListEmployee.total / pageSizeEmployee.value,
|
|
|
|
|
);
|
|
|
|
|
listEmployee.value = resultListEmployee.result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-07 18:04:08 +07:00
|
|
|
async function onSubmitEdit(id: string) {
|
2024-06-12 08:40:07 +00:00
|
|
|
if (selectorLabel.value === 'EMPLOYER') {
|
|
|
|
|
if (!formData.value) return;
|
|
|
|
|
|
|
|
|
|
const tempValue: CustomerUpdate = {
|
|
|
|
|
status: 'ACTIVE',
|
|
|
|
|
customerType: formData.value.customerType,
|
|
|
|
|
customerName: formData.value.customerName,
|
|
|
|
|
customerNameEN: formData.value.customerNameEN,
|
|
|
|
|
customerBranch: formData.value.customerBranch,
|
|
|
|
|
taxNo: formData.value.taxNo,
|
2024-06-18 10:44:07 +07:00
|
|
|
personName: formData.value.personName,
|
2024-06-12 08:40:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await editById(id, tempValue);
|
|
|
|
|
infoDrawer.value = false;
|
|
|
|
|
fetchListCustomer();
|
|
|
|
|
clearForm();
|
|
|
|
|
}
|
2024-06-07 18:04:08 +07:00
|
|
|
|
2024-06-12 08:40:07 +00:00
|
|
|
if (selectorLabel.value === 'EMPLOYEE') {
|
2024-06-13 03:50:14 +00:00
|
|
|
const isOk = await checkEmployeeForm();
|
|
|
|
|
if (isOk) {
|
|
|
|
|
if (!formDataEmployee.value) return;
|
2024-06-12 08:40:07 +00:00
|
|
|
|
2024-06-13 03:50:14 +00:00
|
|
|
await employeeStore.editById(id, {
|
|
|
|
|
...formDataEmployee.value,
|
|
|
|
|
image: profileSubmit.value ? profileFile.value ?? null : null,
|
|
|
|
|
});
|
2024-06-12 08:40:07 +00:00
|
|
|
|
2024-06-13 03:50:14 +00:00
|
|
|
const resultList = await employeeStore.fetchList();
|
|
|
|
|
if (resultList) listEmployee.value = resultList.result;
|
2024-06-12 08:40:07 +00:00
|
|
|
|
2024-06-13 03:50:14 +00:00
|
|
|
clearFormEmployee();
|
|
|
|
|
}
|
2024-06-12 08:40:07 +00:00
|
|
|
}
|
2024-06-07 18:04:08 +07:00
|
|
|
}
|
|
|
|
|
|
2024-06-10 11:25:38 +00:00
|
|
|
async function onDelete(id: string) {
|
|
|
|
|
if (!id) return;
|
|
|
|
|
dialog({
|
|
|
|
|
color: 'negative',
|
|
|
|
|
icon: 'mdi-alert',
|
|
|
|
|
title: t('deleteConfirmTitle'),
|
|
|
|
|
actionText: t('ok'),
|
|
|
|
|
persistent: true,
|
|
|
|
|
message: t('deleteConfirmMessage'),
|
|
|
|
|
action: async () => {
|
|
|
|
|
await employeeStore.deleteById(id);
|
|
|
|
|
const resultList = await employeeStore.fetchList();
|
|
|
|
|
if (resultList) listEmployee.value = resultList.result;
|
2024-06-12 08:54:16 +00:00
|
|
|
clearFormEmployee();
|
2024-06-10 11:25:38 +00:00
|
|
|
},
|
|
|
|
|
cancel: () => {},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-10 16:02:14 +07:00
|
|
|
async function submitBranch() {
|
|
|
|
|
if (formData.value.customerBranch?.[0]) {
|
2024-06-12 15:35:05 +07:00
|
|
|
delete formData.value.customerBranch[0]['id'];
|
|
|
|
|
|
2024-06-10 16:02:14 +07:00
|
|
|
await editBranchById(currentBranchId.value, {
|
|
|
|
|
...formData.value.customerBranch[0],
|
|
|
|
|
customerId: currentCustomerId.value,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const result = await fetchListById(currentCustomerId.value);
|
|
|
|
|
|
|
|
|
|
if (result) {
|
|
|
|
|
branch.value = result.branch;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
infoDrawerBranch.value = false;
|
2024-06-11 11:24:37 +07:00
|
|
|
|
2024-06-10 16:02:14 +07:00
|
|
|
clearForm();
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-06 10:28:59 +00:00
|
|
|
function undo() {
|
2024-06-12 09:16:21 +00:00
|
|
|
if (selectorLabel.value === 'EMPLOYER') infoDrawerEdit.value = false;
|
|
|
|
|
|
|
|
|
|
if (selectorLabel.value === 'EMPLOYEE') {
|
|
|
|
|
if (!currentEmployee.value) return;
|
|
|
|
|
infoDrawerEmployeeEdit.value = false;
|
|
|
|
|
assignFormDataEmployee(currentEmployee.value.id);
|
|
|
|
|
}
|
2024-06-06 10:28:59 +00:00
|
|
|
}
|
2024-06-07 14:19:35 +07:00
|
|
|
|
2024-06-11 12:27:58 +00:00
|
|
|
async function employeeFilterOwnerBranch(
|
|
|
|
|
val: string,
|
|
|
|
|
update: (...args: unknown[]) => void,
|
|
|
|
|
) {
|
|
|
|
|
update(async () => {
|
|
|
|
|
const result = await fetchListBranch({
|
|
|
|
|
includeCustomer: true,
|
|
|
|
|
query: val,
|
|
|
|
|
pageSize: 30,
|
|
|
|
|
});
|
2024-06-13 10:07:20 +00:00
|
|
|
if (result) employeeStore.ownerOption = result.result;
|
2024-06-11 12:27:58 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-07 18:04:08 +07:00
|
|
|
async function assignFormData(data: Customer & { branch: CustomerBranch[] }) {
|
|
|
|
|
formData.value = {
|
|
|
|
|
status: 'CREATED',
|
|
|
|
|
customerType: data.customerType,
|
|
|
|
|
customerName: data.customerName,
|
|
|
|
|
customerNameEN: data.customerNameEN,
|
2024-06-18 10:44:07 +07:00
|
|
|
personName: data.personName,
|
2024-06-07 18:04:08 +07:00
|
|
|
taxNo: data.taxNo,
|
|
|
|
|
customerBranch: [],
|
2024-06-10 16:02:14 +07:00
|
|
|
image: null,
|
2024-06-07 18:04:08 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
data.branch.forEach((v) => {
|
|
|
|
|
formData.value.customerBranch?.push({
|
2024-06-12 09:53:19 +07:00
|
|
|
id: v.id,
|
2024-06-07 18:04:08 +07:00
|
|
|
address: v.address,
|
|
|
|
|
addressEN: v.addressEN,
|
|
|
|
|
provinceId: v.province.id,
|
|
|
|
|
districtId: v.district.id,
|
|
|
|
|
subDistrictId: v.subDistrict.id,
|
|
|
|
|
zipCode: v.zipCode,
|
|
|
|
|
email: v.email,
|
|
|
|
|
telephoneNo: v.telephoneNo,
|
|
|
|
|
name: v.name,
|
|
|
|
|
status: undefined,
|
|
|
|
|
taxNo: v.taxNo,
|
|
|
|
|
nameEN: v.nameEN,
|
|
|
|
|
legalPersonNo: v.legalPersonNo,
|
|
|
|
|
registerName: v.registerName,
|
|
|
|
|
registerDate: new Date(v.registerDate),
|
|
|
|
|
authorizedCapital: v.authorizedCapital,
|
|
|
|
|
employmentOffice: v.employmentOffice,
|
|
|
|
|
bussinessType: v.bussinessType,
|
|
|
|
|
bussinessTypeEN: v.bussinessTypeEN,
|
|
|
|
|
jobPosition: v.jobPosition,
|
|
|
|
|
jobPositionEN: v.jobPositionEN,
|
|
|
|
|
jobDescription: v.jobDescription,
|
|
|
|
|
saleEmployee: v.saleEmployee,
|
|
|
|
|
payDate: new Date(v.payDate),
|
|
|
|
|
wageRate: v.wageRate,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-12 08:40:07 +00:00
|
|
|
async function assignFormDataEmployee(id: string) {
|
|
|
|
|
if (!listEmployee.value) return;
|
|
|
|
|
const foundEmployee = listEmployee.value.find((x: Employee) => x.id === id);
|
|
|
|
|
|
|
|
|
|
if (foundEmployee) {
|
|
|
|
|
const fetchCheckup = await employeeStore.fetchCheckup(foundEmployee.id);
|
|
|
|
|
const fetchWork = await employeeStore.fetchWork(foundEmployee.id);
|
|
|
|
|
const fetchOther = await employeeStore.fetchOther(foundEmployee.id);
|
|
|
|
|
|
|
|
|
|
const employeeCheckup =
|
|
|
|
|
fetchCheckup &&
|
|
|
|
|
fetchCheckup.map((i: EmployeeCheckup) => ({
|
|
|
|
|
coverageExpireDate: i.coverageExpireDate,
|
|
|
|
|
coverageStartDate: i.coverageStartDate,
|
|
|
|
|
insuranceCompany: i.insuranceCompany,
|
|
|
|
|
medicalBenefitScheme: i.medicalBenefitScheme,
|
|
|
|
|
remark: i.remark,
|
|
|
|
|
hospitalName: i.hospitalName,
|
|
|
|
|
provinceId: i.provinceId,
|
|
|
|
|
checkupResult: i.checkupResult,
|
|
|
|
|
checkupType: i.checkupType,
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const employeeWork =
|
|
|
|
|
fetchWork &&
|
|
|
|
|
fetchWork.map((i: EmployeeWork) => ({
|
|
|
|
|
workEndDate: i.workEndDate,
|
|
|
|
|
workPermitExpireDate: i.workPermitExpireDate,
|
|
|
|
|
workPermitIssuDate: i.workPermitIssuDate,
|
|
|
|
|
workPermitNo: i.workPermitNo,
|
|
|
|
|
workplace: i.workplace,
|
|
|
|
|
jobType: i.jobType,
|
|
|
|
|
positionName: i.positionName,
|
|
|
|
|
ownerName: i.ownerName,
|
|
|
|
|
remark: i.remark,
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const employeeOther = fetchOther && {
|
|
|
|
|
motherBirthPlace: fetchOther.motherBirthPlace,
|
|
|
|
|
motherLastNameEN: fetchOther.motherLastNameEN,
|
|
|
|
|
motherFirstNameEN: fetchOther.motherFirstNameEN,
|
|
|
|
|
fatherLastNameEN: fetchOther.fatherLastNameEN,
|
|
|
|
|
fatherFirstNameEN: fetchOther.fatherFirstNameEN,
|
|
|
|
|
motherLastName: fetchOther.motherLastName,
|
|
|
|
|
motherFirstName: fetchOther.motherFirstName,
|
|
|
|
|
fatherLastName: fetchOther.fatherLastName,
|
|
|
|
|
fatherFirstName: fetchOther.fatherFirstName,
|
|
|
|
|
fatherBirthPlace: fetchOther.fatherBirthPlace,
|
|
|
|
|
citizenId: fetchOther.citizenId,
|
|
|
|
|
};
|
|
|
|
|
|
2024-06-12 08:48:04 +00:00
|
|
|
formDataEmployeeTab.value = 'personalInfo';
|
2024-06-13 10:07:20 +00:00
|
|
|
currentEmployeeCode.value = foundEmployee.code;
|
2024-06-12 08:40:07 +00:00
|
|
|
currentEmployee.value = foundEmployee;
|
|
|
|
|
profileUrl.value = foundEmployee.profileImageUrl;
|
2024-06-13 10:07:20 +00:00
|
|
|
|
2024-06-13 04:16:40 +00:00
|
|
|
foundEmployee.profileImageUrl
|
|
|
|
|
? (profileSubmit.value = true)
|
|
|
|
|
: (profileSubmit.value = false);
|
2024-06-12 08:40:07 +00:00
|
|
|
isEmployeeEdit.value = true;
|
|
|
|
|
|
2024-06-13 10:07:20 +00:00
|
|
|
const foundBranch = await fetchListBranchById(
|
|
|
|
|
foundEmployee.customerBranchId,
|
|
|
|
|
);
|
|
|
|
|
formDataEmployeeOwner.value = {
|
|
|
|
|
id: foundBranch.id,
|
|
|
|
|
address: foundBranch.address,
|
|
|
|
|
addressEN: foundBranch.addressEN,
|
|
|
|
|
provinceId: foundBranch.provinceId,
|
|
|
|
|
districtId: foundBranch.districtId,
|
|
|
|
|
subDistrictId: foundBranch.subDistrictId,
|
|
|
|
|
zipCode: foundBranch.zipCode,
|
|
|
|
|
};
|
|
|
|
|
|
2024-06-12 08:40:07 +00:00
|
|
|
formDataEmployee.value = {
|
|
|
|
|
image: foundEmployee.profileImageUrl,
|
|
|
|
|
customerBranchId: foundEmployee.customerBranchId,
|
|
|
|
|
nrcNo: foundEmployee.nrcNo,
|
|
|
|
|
dateOfBirth: foundEmployee.dateOfBirth,
|
|
|
|
|
gender: foundEmployee.gender,
|
|
|
|
|
nationality: foundEmployee.nationality,
|
|
|
|
|
firstName: foundEmployee.firstName,
|
|
|
|
|
firstNameEN: foundEmployee.firstNameEN,
|
|
|
|
|
lastName: foundEmployee.lastName,
|
|
|
|
|
lastNameEN: foundEmployee.lastNameEN,
|
|
|
|
|
addressEN: foundEmployee.addressEN,
|
|
|
|
|
address: foundEmployee.address,
|
|
|
|
|
zipCode: foundEmployee.zipCode,
|
|
|
|
|
passportType: foundEmployee.passportType,
|
|
|
|
|
passportNumber: foundEmployee.passportNumber,
|
|
|
|
|
passportIssueDate: foundEmployee.passportIssueDate,
|
|
|
|
|
passportExpiryDate: foundEmployee.passportExpiryDate,
|
|
|
|
|
passportIssuingCountry: foundEmployee.passportIssuingCountry,
|
|
|
|
|
passportIssuingPlace: foundEmployee.passportIssuingPlace,
|
|
|
|
|
previousPassportReference: foundEmployee.previousPassportReference,
|
|
|
|
|
visaType: foundEmployee.visaType,
|
|
|
|
|
visaNumber: foundEmployee.visaNumber,
|
|
|
|
|
visaIssueDate: foundEmployee.visaIssueDate,
|
|
|
|
|
visaExpiryDate: foundEmployee.visaExpiryDate,
|
|
|
|
|
visaIssuingPlace: foundEmployee.visaIssuingPlace,
|
|
|
|
|
visaStayUntilDate: foundEmployee.visaStayUntilDate,
|
|
|
|
|
tm6Number: foundEmployee.tm6Number,
|
|
|
|
|
entryDate: foundEmployee.entryDate,
|
|
|
|
|
workerStatus: foundEmployee.workerStatus,
|
|
|
|
|
subDistrictId: foundEmployee.subDistrictId,
|
|
|
|
|
districtId: foundEmployee.districtId,
|
|
|
|
|
provinceId: foundEmployee.provinceId,
|
|
|
|
|
|
|
|
|
|
employeeWork: employeeWork,
|
|
|
|
|
employeeCheckup: employeeCheckup,
|
|
|
|
|
employeeOtherInfo: employeeOther,
|
|
|
|
|
};
|
2024-06-13 10:07:20 +00:00
|
|
|
|
|
|
|
|
if (foundBranch.address === foundEmployee.address) {
|
|
|
|
|
formDataEmployeeSameAddr.value = true;
|
|
|
|
|
} else {
|
|
|
|
|
formDataEmployeeSameAddr.value = false;
|
|
|
|
|
}
|
2024-06-12 08:40:07 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-13 03:50:14 +00:00
|
|
|
async function checkEmployeeForm() {
|
|
|
|
|
const formData = formDataEmployee.value;
|
|
|
|
|
let forget = false;
|
|
|
|
|
|
|
|
|
|
for (const [key, val] of Object.entries(formData)) {
|
|
|
|
|
if (key === 'workerStatus') continue;
|
|
|
|
|
if (key === 'image') continue;
|
|
|
|
|
|
|
|
|
|
if (val === '' || val === null) {
|
|
|
|
|
forget = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (forget) {
|
|
|
|
|
return await new Promise((resolve) => {
|
|
|
|
|
dialog({
|
|
|
|
|
color: 'warning',
|
|
|
|
|
icon: 'mdi-alert',
|
|
|
|
|
title: t('warning'),
|
|
|
|
|
actionText: t('ok'),
|
|
|
|
|
persistent: true,
|
|
|
|
|
message: t('warningForgetInput'),
|
|
|
|
|
action: () => {
|
|
|
|
|
resolve(true);
|
|
|
|
|
},
|
|
|
|
|
cancel: () => {
|
|
|
|
|
resolve(false);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else return true;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-07 14:19:35 +07:00
|
|
|
onMounted(async () => {
|
|
|
|
|
const resultStats = await getStatsCustomer();
|
|
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
const resultList = await fetchList({
|
|
|
|
|
includeBranch: true,
|
|
|
|
|
page: 1,
|
|
|
|
|
pageSize: pageSizeCustomer.value,
|
|
|
|
|
});
|
2024-06-07 14:19:35 +07:00
|
|
|
|
2024-06-18 13:29:45 +07:00
|
|
|
if (resultStats) {
|
|
|
|
|
totalCustomer.value = resultStats.CORP + resultStats.PERS;
|
|
|
|
|
|
|
|
|
|
statsCustomerType.value = resultStats;
|
|
|
|
|
}
|
2024-06-07 14:19:35 +07:00
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
if (resultList) listCustomer.value = resultList.result;
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
(statsCustomerType.value?.CORP ?? 0) +
|
|
|
|
|
(statsCustomerType.value?.PERS ?? 0) >
|
|
|
|
|
0
|
|
|
|
|
) {
|
|
|
|
|
selectorLabel.value = 'EMPLOYER';
|
|
|
|
|
}
|
2024-06-07 14:19:35 +07:00
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
if (resultList) {
|
|
|
|
|
currentPageCustomer.value = resultList.page;
|
|
|
|
|
maxPageCustomer.value = Math.ceil(
|
|
|
|
|
resultList.total / pageSizeCustomer.value,
|
|
|
|
|
);
|
|
|
|
|
listCustomer.value = resultList.result;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-12 09:57:34 +00:00
|
|
|
const resultStatsEmployee = await employeeStore.getStatsEmployee();
|
|
|
|
|
if (resultStatsEmployee) statsEmployee.value = resultStatsEmployee;
|
|
|
|
|
|
2024-06-13 11:07:04 +00:00
|
|
|
const resultStatsEmployeeGender =
|
|
|
|
|
await employeeStore.getStatsEmployeeGender();
|
|
|
|
|
if (resultStatsEmployeeGender)
|
|
|
|
|
statsEmployeeGender.value = resultStatsEmployeeGender;
|
|
|
|
|
|
2024-06-13 11:58:51 +07:00
|
|
|
const resultListEmployee = await employeeStore.fetchList({
|
|
|
|
|
page: 1,
|
|
|
|
|
pageSize: pageSizeEmployee.value,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (resultListEmployee) {
|
|
|
|
|
maxPageEmployee.value = Math.ceil(
|
|
|
|
|
resultListEmployee.total / pageSizeEmployee.value,
|
|
|
|
|
);
|
|
|
|
|
listEmployee.value = resultListEmployee.result;
|
|
|
|
|
}
|
2024-06-11 12:27:58 +00:00
|
|
|
|
|
|
|
|
const resultOption = await fetch('/option/option.json');
|
|
|
|
|
employeeStore.globalOption = await resultOption.json();
|
2024-06-10 11:25:38 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
watch(locale, () => {
|
|
|
|
|
fieldSelectedCustomer.value = {
|
2024-06-14 11:05:41 +00:00
|
|
|
label: `${fieldSelectedCustomer.value.label}`,
|
2024-06-10 11:25:38 +00:00
|
|
|
value: fieldSelectedCustomer.value?.value,
|
|
|
|
|
};
|
2024-06-07 14:19:35 +07:00
|
|
|
});
|
2024-06-10 16:00:52 +07:00
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
watch(currentPageCustomer, async () => {
|
2024-06-13 11:58:51 +07:00
|
|
|
await fetchListCustomer();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
watch(currentPageEmployee, async () => {
|
|
|
|
|
await fetchListEmployee();
|
2024-06-11 11:24:37 +07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
watch(fieldSelectedCustomer, async () => {
|
|
|
|
|
let resultList;
|
|
|
|
|
|
|
|
|
|
if (fieldSelectedCustomer.value.value === 'all') {
|
|
|
|
|
resultList = await fetchList({ includeBranch: true });
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-11 15:31:00 +07:00
|
|
|
if (fieldSelectedCustomer.value.value === 'customerLegalEntity') {
|
2024-06-11 11:24:37 +07:00
|
|
|
resultList = await fetchList({ includeBranch: true, customerType: 'CORP' });
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-11 15:31:00 +07:00
|
|
|
if (fieldSelectedCustomer.value.value === 'customerNaturalPerson') {
|
2024-06-11 11:24:37 +07:00
|
|
|
resultList = await fetchList({ includeBranch: true, customerType: 'PERS' });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resultList) {
|
|
|
|
|
listCustomer.value = resultList.result;
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-06-13 10:07:20 +00:00
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => formDataEmployeeOwner.value,
|
|
|
|
|
(e) => {
|
|
|
|
|
if (!e) return;
|
|
|
|
|
if (formDataEmployeeSameAddr.value) {
|
|
|
|
|
formDataEmployee.value.address = e.address;
|
|
|
|
|
formDataEmployee.value.addressEN = e.addressEN;
|
|
|
|
|
formDataEmployee.value.provinceId = e.provinceId;
|
|
|
|
|
formDataEmployee.value.districtId = e.districtId;
|
|
|
|
|
formDataEmployee.value.subDistrictId = e.subDistrictId;
|
|
|
|
|
formDataEmployee.value.zipCode = e.zipCode;
|
|
|
|
|
}
|
|
|
|
|
formDataEmployee.value.customerBranchId = e.id;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => formDataEmployeeSameAddr.value,
|
|
|
|
|
(isSame) => {
|
|
|
|
|
if (!formDataEmployeeOwner.value) return;
|
|
|
|
|
if (isSame) {
|
|
|
|
|
formDataEmployee.value.address = formDataEmployeeOwner.value.address;
|
|
|
|
|
formDataEmployee.value.addressEN = formDataEmployeeOwner.value.addressEN;
|
|
|
|
|
formDataEmployee.value.provinceId =
|
|
|
|
|
formDataEmployeeOwner.value.provinceId;
|
|
|
|
|
formDataEmployee.value.districtId =
|
|
|
|
|
formDataEmployeeOwner.value.districtId;
|
|
|
|
|
formDataEmployee.value.subDistrictId =
|
|
|
|
|
formDataEmployeeOwner.value.subDistrictId;
|
|
|
|
|
formDataEmployee.value.zipCode = formDataEmployeeOwner.value.zipCode;
|
|
|
|
|
}
|
|
|
|
|
formDataEmployee.value.customerBranchId = formDataEmployeeOwner.value.id;
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-06-13 11:07:04 +00:00
|
|
|
|
|
|
|
|
watch(genderselector, async (gender) => {
|
|
|
|
|
await fetchListEmployee({ gender: gender });
|
|
|
|
|
});
|
2024-06-14 13:03:20 +07:00
|
|
|
|
|
|
|
|
watch(currentStatus, async () => {
|
|
|
|
|
if (selectorLabel.value === 'EMPLOYER') {
|
|
|
|
|
await fetchListCustomer();
|
2024-06-17 10:02:51 +07:00
|
|
|
} else {
|
|
|
|
|
await fetchListEmployee({
|
|
|
|
|
status:
|
|
|
|
|
currentStatus.value === 'All'
|
|
|
|
|
? undefined
|
|
|
|
|
: currentStatus.value === 'ACTIVE'
|
|
|
|
|
? 'ACTIVE'
|
|
|
|
|
: 'INACTIVE',
|
|
|
|
|
});
|
2024-06-14 13:03:20 +07:00
|
|
|
}
|
|
|
|
|
});
|
2024-06-18 13:29:45 +07:00
|
|
|
|
|
|
|
|
watch(selectorLabel, async () => {
|
|
|
|
|
if (inputSearch.value) {
|
|
|
|
|
inputSearch.value = undefined;
|
|
|
|
|
resultSearch.value = undefined;
|
|
|
|
|
resultSearchEmployee.value = undefined;
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-04-22 13:42:02 +07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2024-06-14 09:22:34 +07:00
|
|
|
<ButtonAddComponent style="z-index: 999" v-if="selectorLabel === 'EMPLOYER'">
|
2024-06-13 14:56:31 +07:00
|
|
|
<q-fab-action
|
2024-06-14 13:37:11 +07:00
|
|
|
id="add-customer-legal-entity"
|
2024-06-13 14:56:31 +07:00
|
|
|
style="color: white; background-color: hsla(var(--purple-11-hsl))"
|
|
|
|
|
@click="triggerCreate('CORP')"
|
|
|
|
|
padding="xs"
|
|
|
|
|
icon="mdi-office-building"
|
|
|
|
|
:label="$t('add') + ' ' + $t('customerLegalEntity')"
|
|
|
|
|
external-label
|
|
|
|
|
label-position="left"
|
|
|
|
|
/>
|
|
|
|
|
<q-fab-action
|
2024-06-14 13:37:11 +07:00
|
|
|
id="add-customer-natural-person"
|
2024-06-13 14:56:31 +07:00
|
|
|
:label="$t('add') + ' ' + $t('customerNaturalPerson')"
|
|
|
|
|
external-label
|
|
|
|
|
label-position="left"
|
|
|
|
|
@click="triggerCreate('PERS')"
|
|
|
|
|
style="color: white; background-color: hsla(var(--teal-9-hsl))"
|
|
|
|
|
padding="xs"
|
|
|
|
|
icon="mdi-account-plus"
|
|
|
|
|
></q-fab-action>
|
|
|
|
|
</ButtonAddComponent>
|
|
|
|
|
|
2024-06-14 09:22:34 +07:00
|
|
|
<ButtonAddComponent style="z-index: 999" v-if="selectorLabel === 'EMPLOYEE'">
|
2024-06-13 17:13:09 +07:00
|
|
|
<q-fab-action
|
|
|
|
|
:label="$t('add') + ' ' + $t('EMPLOYEE')"
|
|
|
|
|
external-label
|
|
|
|
|
label-position="left"
|
|
|
|
|
@click="openDialogCustomerType()"
|
|
|
|
|
color="primary"
|
|
|
|
|
padding="xs"
|
|
|
|
|
icon="mdi-account-plus"
|
|
|
|
|
></q-fab-action>
|
|
|
|
|
</ButtonAddComponent>
|
|
|
|
|
|
2024-06-07 13:59:36 +07:00
|
|
|
<div class="column q-pb-lg">
|
2024-04-22 13:42:02 +07:00
|
|
|
<div class="text-h6 text-weight-bold q-mb-md">
|
2024-04-22 16:21:34 +07:00
|
|
|
{{ $t('customerManagement') }}
|
2024-04-22 13:42:02 +07:00
|
|
|
</div>
|
|
|
|
|
|
2024-06-07 13:59:36 +07:00
|
|
|
<div v-if="isMainPage">
|
|
|
|
|
<div class="row full-width q-mb-md no-wrap">
|
|
|
|
|
<SelectorList
|
2024-06-07 12:24:09 +00:00
|
|
|
clickable
|
2024-06-07 13:59:36 +07:00
|
|
|
:list="selectorList"
|
|
|
|
|
v-model:selector="selectorLabel"
|
2024-06-12 15:35:05 +07:00
|
|
|
class="q-mr-md col-3"
|
2024-06-07 13:59:36 +07:00
|
|
|
/>
|
2024-04-22 13:42:02 +07:00
|
|
|
|
2024-06-07 13:59:36 +07:00
|
|
|
<!-- stat -->
|
|
|
|
|
<AppBox bordered class="column full-width">
|
|
|
|
|
<div class="row q-pb-sm justify-between items-center">
|
|
|
|
|
<div class="text-weight-bold text-subtitle1">
|
2024-06-07 12:24:09 +00:00
|
|
|
{{
|
|
|
|
|
selectorLabel === 'EMPLOYER'
|
|
|
|
|
? $t('customerEmployerStatTitle')
|
|
|
|
|
: $t('customerEmployeeStatTitle')
|
|
|
|
|
}}
|
2024-06-07 13:59:36 +07:00
|
|
|
</div>
|
2024-04-24 10:23:50 +07:00
|
|
|
</div>
|
2024-06-12 15:35:05 +07:00
|
|
|
<div class="row full-width" style="overflow-x: auto">
|
2024-06-07 13:59:36 +07:00
|
|
|
<StatCardComponent
|
2024-06-12 08:48:04 +00:00
|
|
|
v-if="customerStats && selectorLabel === 'EMPLOYER'"
|
2024-06-07 13:59:36 +07:00
|
|
|
labelI18n
|
|
|
|
|
:branch="
|
|
|
|
|
customerStats.map((v) => ({
|
2024-06-07 14:19:35 +07:00
|
|
|
count:
|
2024-06-11 11:24:37 +07:00
|
|
|
v.name === 'CORP'
|
2024-06-07 14:19:35 +07:00
|
|
|
? statsCustomerType?.CORP ?? 0
|
|
|
|
|
: statsCustomerType?.PERS ?? 0,
|
2024-06-11 12:55:46 +07:00
|
|
|
label:
|
|
|
|
|
v.name === 'CORP'
|
|
|
|
|
? 'customerLegalEntity'
|
|
|
|
|
: 'customerNaturalPerson',
|
2024-06-11 11:24:37 +07:00
|
|
|
color: v.name === 'CORP' ? 'purple' : 'green',
|
2024-06-07 13:59:36 +07:00
|
|
|
}))
|
|
|
|
|
"
|
|
|
|
|
:dark="$q.dark.isActive"
|
|
|
|
|
class="no-wrap"
|
|
|
|
|
/>
|
2024-06-12 08:48:04 +00:00
|
|
|
|
|
|
|
|
<StatCardComponent
|
|
|
|
|
v-if="customerStats && selectorLabel === 'EMPLOYEE'"
|
|
|
|
|
labelI18n
|
2024-06-12 09:57:34 +00:00
|
|
|
:branch="[
|
|
|
|
|
{
|
|
|
|
|
label: 'EMPLOYEE',
|
|
|
|
|
count: statsEmployee,
|
|
|
|
|
color: 'pink',
|
|
|
|
|
},
|
|
|
|
|
]"
|
2024-06-12 08:48:04 +00:00
|
|
|
:dark="$q.dark.isActive"
|
|
|
|
|
class="no-wrap"
|
|
|
|
|
/>
|
2024-06-07 13:59:36 +07:00
|
|
|
</div>
|
|
|
|
|
</AppBox>
|
|
|
|
|
</div>
|
2024-04-22 13:42:02 +07:00
|
|
|
|
2024-06-07 13:59:36 +07:00
|
|
|
<!-- main -->
|
|
|
|
|
<AppBox bordered class="column" style="width: 100%; min-height: 70vh">
|
2024-06-17 04:15:56 +00:00
|
|
|
<div class="row q-pb-md">
|
2024-06-10 16:00:52 +07:00
|
|
|
<div class="col">
|
|
|
|
|
<q-select
|
2024-06-17 15:34:39 +07:00
|
|
|
id="select-userType"
|
|
|
|
|
for="select-userType"
|
2024-06-11 12:27:58 +00:00
|
|
|
v-if="selectorLabel === 'EMPLOYER'"
|
2024-06-10 16:00:52 +07:00
|
|
|
v-model="fieldSelectedCustomer"
|
|
|
|
|
style="width: 150px"
|
|
|
|
|
outlined
|
|
|
|
|
:options="fieldCustomer.map((v) => ({ label: $t(v), value: v }))"
|
|
|
|
|
:label="$t('customerCardUserType')"
|
|
|
|
|
dense
|
|
|
|
|
/>
|
2024-06-13 13:33:47 +07:00
|
|
|
<q-btn-toggle
|
|
|
|
|
v-else
|
|
|
|
|
v-model="genderselector"
|
|
|
|
|
id="btn-mode"
|
2024-06-13 11:07:04 +00:00
|
|
|
class="no-shadow"
|
|
|
|
|
padding="0px"
|
|
|
|
|
toggle-color="grey-3"
|
2024-06-13 13:33:47 +07:00
|
|
|
size="xs"
|
|
|
|
|
:options="[
|
|
|
|
|
{ value: 'female', slot: 'female' },
|
|
|
|
|
{ value: 'male', slot: 'male' },
|
|
|
|
|
]"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:female>
|
|
|
|
|
<div
|
2024-06-13 11:07:04 +00:00
|
|
|
class="bordered-t bordered-l bordered-b q-px-md q-py-sm app-text-female text-weight-medium text-body2 row items-center"
|
|
|
|
|
@click="
|
|
|
|
|
async () => {
|
|
|
|
|
if (genderselector === 'female') {
|
|
|
|
|
await fetchListEmployee();
|
|
|
|
|
genderselector = '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
"
|
2024-06-13 13:33:47 +07:00
|
|
|
>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="mdi-gender-female"
|
|
|
|
|
class="q-mr-sm"
|
|
|
|
|
size="18px"
|
|
|
|
|
/>
|
2024-06-13 11:07:04 +00:00
|
|
|
<div v-if="statsEmployeeGender">
|
|
|
|
|
{{ statsEmployeeGender.female }} คน
|
|
|
|
|
</div>
|
2024-06-13 13:33:47 +07:00
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-06-13 11:07:04 +00:00
|
|
|
|
2024-06-13 13:33:47 +07:00
|
|
|
<template v-slot:male>
|
|
|
|
|
<div
|
2024-06-13 11:07:04 +00:00
|
|
|
class="bordered q-px-md q-py-sm app-text-male text-weight-medium text-body2 row items-center"
|
|
|
|
|
@click="
|
|
|
|
|
async () => {
|
|
|
|
|
if (genderselector === 'male') {
|
|
|
|
|
await fetchListEmployee();
|
|
|
|
|
genderselector = '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
"
|
2024-06-13 13:33:47 +07:00
|
|
|
>
|
|
|
|
|
<q-icon name="mdi-gender-male" class="q-mr-sm" size="18px" />
|
2024-06-13 11:07:04 +00:00
|
|
|
<div v-if="statsEmployeeGender">
|
|
|
|
|
{{ statsEmployeeGender.male }} คน
|
|
|
|
|
</div>
|
2024-06-13 13:33:47 +07:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</q-btn-toggle>
|
2024-06-10 16:00:52 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<q-input
|
2024-06-14 15:55:23 +07:00
|
|
|
for="input-search"
|
2024-06-10 16:00:52 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
style="width: 250px"
|
|
|
|
|
:label="$t('search')"
|
|
|
|
|
class="q-mr-lg"
|
|
|
|
|
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
|
|
|
|
|
v-model="inputSearch"
|
2024-06-18 13:29:45 +07:00
|
|
|
debounce="200"
|
2024-06-13 11:48:08 +07:00
|
|
|
@update:model-value="
|
|
|
|
|
selectorLabel === 'EMPLOYEE' ? searchEmployee() : searchCustomer()
|
|
|
|
|
"
|
2024-06-10 16:00:52 +07:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<q-btn
|
2024-06-14 15:55:23 +07:00
|
|
|
id="btn-status"
|
2024-06-10 16:00:52 +07:00
|
|
|
icon="mdi-tune-vertical-variant"
|
|
|
|
|
size="sm"
|
|
|
|
|
:color="$q.dark.isActive ? 'dark' : 'white'"
|
|
|
|
|
:text-color="$q.dark.isActive ? 'white' : 'dark'"
|
|
|
|
|
class="bordered rounded"
|
|
|
|
|
unelevated
|
|
|
|
|
>
|
|
|
|
|
<q-menu class="bordered">
|
|
|
|
|
<q-list v-close-popup dense>
|
|
|
|
|
<q-item
|
2024-06-14 15:55:23 +07:00
|
|
|
id="btn-status-all"
|
2024-06-10 16:00:52 +07:00
|
|
|
clickable
|
|
|
|
|
class="flex items-center"
|
2024-06-14 13:03:20 +07:00
|
|
|
@click="currentStatus = 'All'"
|
2024-06-10 16:00:52 +07:00
|
|
|
>
|
|
|
|
|
{{ $t('all') }}
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item
|
2024-06-14 15:55:23 +07:00
|
|
|
id="btn-status-active"
|
2024-06-10 16:00:52 +07:00
|
|
|
clickable
|
|
|
|
|
class="flex items-center"
|
2024-06-14 13:03:20 +07:00
|
|
|
@click="currentStatus = 'ACTIVE'"
|
2024-06-10 16:00:52 +07:00
|
|
|
>
|
|
|
|
|
{{ $t('statusACTIVE') }}
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item
|
2024-06-14 15:55:23 +07:00
|
|
|
id="btn-status-inactive"
|
2024-06-10 16:00:52 +07:00
|
|
|
clickable
|
|
|
|
|
class="flex items-center"
|
2024-06-14 13:03:20 +07:00
|
|
|
@click="currentStatus = 'INACTIVE'"
|
2024-06-10 16:00:52 +07:00
|
|
|
>
|
|
|
|
|
{{ $t('statusINACTIVE') }}
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-06-10 11:25:38 +00:00
|
|
|
<template
|
|
|
|
|
v-if="
|
2024-06-18 13:29:45 +07:00
|
|
|
listCustomer && totalCustomer > 0 && selectorLabel === 'EMPLOYER'
|
2024-06-10 11:25:38 +00:00
|
|
|
"
|
|
|
|
|
>
|
2024-06-07 13:59:36 +07:00
|
|
|
<div
|
2024-06-18 13:29:45 +07:00
|
|
|
v-if="
|
|
|
|
|
listCustomer.length === 0 ||
|
|
|
|
|
(resultSearch?.length === 0 && inputSearch !== undefined)
|
|
|
|
|
"
|
|
|
|
|
class="row full-width items-center justify-center"
|
|
|
|
|
style="min-height: 250px"
|
|
|
|
|
>
|
|
|
|
|
<NoData />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
v-if="listCustomer.length !== 0 && resultSearch?.length !== 0"
|
2024-06-07 12:24:09 +00:00
|
|
|
class="row full-width customer-row"
|
2024-06-13 17:13:09 +07:00
|
|
|
:style="`grid-template-columns: repeat(${$q.screen.lt.sm ? '2' : $q.screen.lt.md ? '3' : $q.screen.lt.lg ? '5' : '6'}, 1fr)`"
|
2024-06-11 11:24:37 +07:00
|
|
|
style="min-height: 250px"
|
2024-06-07 13:59:36 +07:00
|
|
|
>
|
2024-06-07 12:24:09 +00:00
|
|
|
<UsersDetailCardComponent
|
2024-06-18 13:29:45 +07:00
|
|
|
v-for="i in inputSearch !== undefined
|
|
|
|
|
? resultSearch ?? []
|
|
|
|
|
: listCustomer"
|
2024-06-07 12:24:09 +00:00
|
|
|
:key="i.id"
|
2024-06-10 12:00:16 +07:00
|
|
|
class="hover-card"
|
2024-06-07 12:24:09 +00:00
|
|
|
:color="i.customerType === 'CORP' ? 'purple' : 'green'"
|
|
|
|
|
:metadata="{ id: '1', disabled: false }"
|
|
|
|
|
:badge="i.branch"
|
|
|
|
|
:list="{
|
|
|
|
|
id: i.id,
|
|
|
|
|
imageUrl: i.imageUrl,
|
2024-06-11 11:24:37 +07:00
|
|
|
type: i.customerType,
|
2024-06-07 12:24:09 +00:00
|
|
|
name: i.customerName === '' ? '-' : i.customerName,
|
|
|
|
|
code: i.code,
|
|
|
|
|
|
|
|
|
|
detail: [
|
|
|
|
|
{
|
|
|
|
|
label: 'customerNameTh',
|
|
|
|
|
value: i.customerName,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'customerNameEn',
|
|
|
|
|
value: i.customerNameEN,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}"
|
|
|
|
|
@enter-card="
|
|
|
|
|
() => {
|
2024-06-11 11:24:37 +07:00
|
|
|
customerType = i.customerType;
|
2024-06-11 09:43:46 +07:00
|
|
|
currentCustomerUrlImage = i.imageUrl;
|
2024-06-07 12:24:09 +00:00
|
|
|
currentCustomerId = i.id;
|
2024-06-11 11:24:37 +07:00
|
|
|
|
|
|
|
|
const { branch, ...payload } = i;
|
|
|
|
|
currentCustomer = payload;
|
2024-06-07 12:24:09 +00:00
|
|
|
isMainPage = false;
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
@update-card="
|
|
|
|
|
() => {
|
|
|
|
|
if (!listCustomer) return;
|
2024-06-07 18:04:08 +07:00
|
|
|
|
2024-06-12 09:36:11 +07:00
|
|
|
customerType = i.customerType;
|
2024-06-11 12:55:46 +07:00
|
|
|
const { branch, ...payload } = i;
|
|
|
|
|
currentCustomer = payload;
|
|
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
currentCustomerId = i.id;
|
2024-06-07 18:04:08 +07:00
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
assignFormData(i);
|
2024-06-11 12:55:46 +07:00
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
infoDrawerEdit = true;
|
|
|
|
|
openDialogInputForm('INFO', i.id);
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
@view-card="
|
|
|
|
|
() => {
|
2024-06-11 12:55:46 +07:00
|
|
|
const { branch, ...payload } = i;
|
|
|
|
|
currentCustomer = payload;
|
|
|
|
|
|
2024-06-10 16:17:38 +07:00
|
|
|
currentCustomerId = i.id;
|
2024-06-11 11:24:37 +07:00
|
|
|
customerType = i.customerType;
|
2024-06-07 12:24:09 +00:00
|
|
|
assignFormData(i);
|
|
|
|
|
openDialogInputForm('INFO', i.id);
|
|
|
|
|
}
|
|
|
|
|
"
|
2024-06-10 16:17:38 +07:00
|
|
|
@delete-card="deleteCustomerById(i.id)"
|
2024-06-07 12:24:09 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-18 13:29:45 +07:00
|
|
|
|
|
|
|
|
<div v-if="listCustomer.length !== 0" class="row flex-center q-pt-md">
|
2024-06-11 11:24:37 +07:00
|
|
|
<q-pagination
|
2024-06-13 11:58:51 +07:00
|
|
|
claess="pagination"
|
2024-06-11 11:24:37 +07:00
|
|
|
v-model="currentPageCustomer"
|
|
|
|
|
:max="maxPageCustomer"
|
|
|
|
|
direction-links
|
2024-06-13 11:58:51 +07:00
|
|
|
active-color="primary"
|
2024-06-11 11:24:37 +07:00
|
|
|
gutter="sm"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-07 12:24:09 +00:00
|
|
|
</template>
|
|
|
|
|
|
2024-06-10 11:25:38 +00:00
|
|
|
<template
|
|
|
|
|
v-if="
|
2024-06-18 13:29:45 +07:00
|
|
|
listEmployee && statsEmployee > 0 && selectorLabel === 'EMPLOYEE'
|
2024-06-10 11:25:38 +00:00
|
|
|
"
|
|
|
|
|
>
|
2024-06-18 13:29:45 +07:00
|
|
|
<div
|
|
|
|
|
v-if="
|
|
|
|
|
listEmployee.length === 0 || resultSearchEmployee?.length === 0
|
|
|
|
|
"
|
|
|
|
|
class="row full-width items-center justify-center"
|
|
|
|
|
style="min-height: 250px"
|
|
|
|
|
>
|
|
|
|
|
<NoData />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="listEmployee.length !== 0">
|
2024-06-10 11:25:38 +00:00
|
|
|
<PersonCard
|
|
|
|
|
:list="
|
2024-06-18 13:29:45 +07:00
|
|
|
(!!inputSearch ? resultSearchEmployee ?? [] : listEmployee).map(
|
2024-06-13 11:48:08 +07:00
|
|
|
(v: Employee) => ({
|
|
|
|
|
img: v.profileImageUrl,
|
|
|
|
|
id: v.id,
|
|
|
|
|
name:
|
|
|
|
|
$i18n.locale === 'en-US'
|
|
|
|
|
? `${v.firstNameEN} ${v.lastNameEN}`
|
|
|
|
|
: `${v.firstName} ${v.lastName}`,
|
|
|
|
|
male: v.gender === 'male',
|
|
|
|
|
female: v.gender === 'female',
|
|
|
|
|
badge: v.code,
|
|
|
|
|
detail: [
|
|
|
|
|
{
|
|
|
|
|
label: $t('personnelCardNationality'),
|
|
|
|
|
value: v.nationality,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: $t('personnelCardAge'),
|
|
|
|
|
value: calculateAge(v.dateOfBirth),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}),
|
|
|
|
|
) || []
|
2024-06-10 11:25:38 +00:00
|
|
|
"
|
2024-06-12 08:40:07 +00:00
|
|
|
@update-card="openDialogInputForm"
|
|
|
|
|
@enter-card="openDialogInputForm"
|
2024-06-10 11:25:38 +00:00
|
|
|
@delete-card="onDelete"
|
|
|
|
|
/>
|
2024-06-13 11:58:51 +07:00
|
|
|
|
2024-06-18 13:29:45 +07:00
|
|
|
<div class="row flex-center q-pt-md">
|
|
|
|
|
<q-pagination
|
|
|
|
|
claess="pagination"
|
|
|
|
|
v-model="currentPageEmployee"
|
|
|
|
|
:max="maxPageEmployee"
|
|
|
|
|
direction-links
|
|
|
|
|
active-color="primary"
|
|
|
|
|
gutter="sm"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-13 11:58:51 +07:00
|
|
|
</div>
|
2024-06-10 11:25:38 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template
|
|
|
|
|
v-if="
|
2024-06-18 13:29:45 +07:00
|
|
|
(totalCustomer === 0 && selectorLabel === 'EMPLOYER') ||
|
|
|
|
|
(statsEmployee === 0 && selectorLabel === 'EMPLOYEE')
|
2024-06-10 11:25:38 +00:00
|
|
|
"
|
|
|
|
|
>
|
2024-06-07 12:24:09 +00:00
|
|
|
<TooltipComponent
|
|
|
|
|
class="self-end"
|
|
|
|
|
:title="
|
|
|
|
|
selectorLabel === 'EMPLOYER'
|
|
|
|
|
? 'customerEmployerTooltipTitle'
|
|
|
|
|
: 'customerEmployeeTooltipTitle'
|
2024-06-07 18:04:08 +07:00
|
|
|
"
|
2024-06-07 12:24:09 +00:00
|
|
|
:caption="
|
|
|
|
|
selectorLabel === 'EMPLOYER'
|
|
|
|
|
? 'customerEmployerTooltipCaption'
|
|
|
|
|
: 'customerEmployeeTooltipCaption'
|
2024-06-07 14:56:51 +07:00
|
|
|
"
|
2024-06-07 12:24:09 +00:00
|
|
|
imgSrc="personnel-table-"
|
2024-04-22 13:42:02 +07:00
|
|
|
/>
|
2024-06-07 12:24:09 +00:00
|
|
|
|
|
|
|
|
<div class="row items-center justify-center" style="flex-grow: 1">
|
|
|
|
|
<AddButton
|
|
|
|
|
:label="
|
|
|
|
|
selectorLabel === 'EMPLOYER'
|
|
|
|
|
? 'customerEmployerAdd'
|
|
|
|
|
: 'customerEmployeeAdd'
|
|
|
|
|
"
|
|
|
|
|
@trigger="() => openDialogCustomerType()"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-06-07 13:59:36 +07:00
|
|
|
</AppBox>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
2024-06-07 14:40:01 +07:00
|
|
|
<CustomerInfoComponent
|
2024-06-11 11:24:37 +07:00
|
|
|
:customer-type="customerType"
|
2024-06-07 14:40:01 +07:00
|
|
|
:customer-id="currentCustomerId"
|
2024-06-11 11:24:37 +07:00
|
|
|
@back="
|
|
|
|
|
() => {
|
|
|
|
|
isMainPage = true;
|
|
|
|
|
currentCustomerUrlImage = null;
|
|
|
|
|
clearForm();
|
|
|
|
|
}
|
|
|
|
|
"
|
2024-06-10 12:00:16 +07:00
|
|
|
@dialog="dialogInputCustomerBranchForm = true"
|
2024-06-10 16:02:14 +07:00
|
|
|
@viewDetail="
|
|
|
|
|
(v) => {
|
2024-06-11 11:24:37 +07:00
|
|
|
currentBranchId = v[0].id;
|
|
|
|
|
|
2024-06-12 16:21:33 +07:00
|
|
|
currentBranch = {
|
|
|
|
|
name: v[0].name,
|
|
|
|
|
code: v[0].code,
|
|
|
|
|
};
|
|
|
|
|
|
2024-06-11 11:24:37 +07:00
|
|
|
if (!!currentCustomer && !!v) {
|
|
|
|
|
assignFormData({ ...currentCustomer, branch: v });
|
|
|
|
|
}
|
2024-06-12 16:21:33 +07:00
|
|
|
infoDrawerBranch = true;
|
2024-06-10 16:02:14 +07:00
|
|
|
}
|
|
|
|
|
"
|
2024-06-10 12:00:16 +07:00
|
|
|
v-model:branch="branch"
|
|
|
|
|
v-model:currentCustomerName="currentCustomerName"
|
|
|
|
|
v-model:currentCustomerUrlImage="currentCustomerUrlImage"
|
2024-06-07 14:40:01 +07:00
|
|
|
/>
|
2024-06-07 13:59:36 +07:00
|
|
|
</div>
|
2024-06-07 11:58:27 +07:00
|
|
|
</div>
|
2024-04-22 16:21:34 +07:00
|
|
|
|
|
|
|
|
<FormDialog
|
|
|
|
|
v-model:modal="dialogCustomerType"
|
|
|
|
|
:title="$t('customerCardUserType')"
|
|
|
|
|
no-footer
|
|
|
|
|
no-app-box
|
2024-06-18 11:53:34 +00:00
|
|
|
max-width="80%"
|
2024-04-22 16:21:34 +07:00
|
|
|
>
|
|
|
|
|
<template #body>
|
|
|
|
|
<div class="row q-gutter-xl q-pa-sm">
|
|
|
|
|
<ItemCard
|
2024-06-11 11:24:37 +07:00
|
|
|
class="col"
|
2024-04-22 16:21:34 +07:00
|
|
|
v-for="i in itemCard"
|
|
|
|
|
:key="i.text"
|
|
|
|
|
:icon="i.icon"
|
|
|
|
|
:text="i.text"
|
|
|
|
|
:color="i.color"
|
2024-04-22 13:42:02 +07:00
|
|
|
@trigger="
|
|
|
|
|
() => {
|
2024-06-12 09:24:22 +07:00
|
|
|
triggerCreate(i.text === 'customerLegalEntity' ? 'CORP' : 'PERS');
|
2024-04-22 13:42:02 +07:00
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-04-22 16:21:34 +07:00
|
|
|
</template>
|
|
|
|
|
</FormDialog>
|
|
|
|
|
|
2024-04-22 16:43:24 +07:00
|
|
|
<FormDialog
|
|
|
|
|
v-model:modal="dialogInputForm"
|
2024-06-07 12:24:09 +00:00
|
|
|
:title="$t('customerEmployerAdd')"
|
2024-04-22 16:43:24 +07:00
|
|
|
:customer-label="customerType"
|
2024-06-06 17:10:58 +07:00
|
|
|
:submit="
|
|
|
|
|
() => {
|
|
|
|
|
onSubmit();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
:close="() => {}"
|
2024-04-22 16:43:24 +07:00
|
|
|
>
|
2024-04-22 16:21:34 +07:00
|
|
|
<template #prepend>
|
|
|
|
|
<ProfileUpload
|
|
|
|
|
v-model:url-profile="profileUrl"
|
|
|
|
|
v-model:status-toggle="statusToggle"
|
|
|
|
|
v-model:profile-submit="profileSubmit"
|
|
|
|
|
@input-file="inputFile.click()"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-04-22 17:00:30 +07:00
|
|
|
<template #information>
|
2024-06-06 17:10:58 +07:00
|
|
|
<BasicInformation
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
:type-customer="customerType"
|
|
|
|
|
v-model:customer-name="formData.customerName"
|
|
|
|
|
v-model:customer-name-en="formData.customerNameEN"
|
2024-06-18 10:44:07 +07:00
|
|
|
v-model:person-name="formData.personName"
|
2024-06-06 17:10:58 +07:00
|
|
|
v-model:tax-no="formData.taxNo"
|
|
|
|
|
/>
|
2024-04-22 17:00:30 +07:00
|
|
|
</template>
|
2024-04-23 11:37:27 +07:00
|
|
|
|
|
|
|
|
<template #address>
|
2024-04-23 11:45:42 +07:00
|
|
|
<!-- <FormCustomerBranch separator dense outlined /> -->
|
|
|
|
|
|
2024-04-24 09:19:05 +07:00
|
|
|
<div class="col-3 app-text-muted">
|
|
|
|
|
• {{ $t('formDialogCustomerBranch') }}
|
|
|
|
|
</div>
|
2024-04-23 11:45:42 +07:00
|
|
|
|
2024-06-06 16:03:47 +07:00
|
|
|
<div class="col-12 row bordered q-pt-none rounded">
|
2024-04-23 17:20:31 +07:00
|
|
|
<TabComponent
|
|
|
|
|
v-model:customer-branch="formData.customerBranch"
|
2024-04-24 09:19:05 +07:00
|
|
|
v-model:tab-index="indexTab"
|
2024-04-23 17:20:31 +07:00
|
|
|
>
|
2024-04-23 11:45:42 +07:00
|
|
|
<template #address>
|
2024-04-23 17:20:31 +07:00
|
|
|
<FormAddress
|
2024-06-17 12:57:57 +07:00
|
|
|
:id="indexTab"
|
2024-04-23 17:20:31 +07:00
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:address="formData.customerBranch[indexTab].address"
|
|
|
|
|
v-model:address-e-n="formData.customerBranch[indexTab].addressEN"
|
|
|
|
|
v-model:province-id="formData.customerBranch[indexTab].provinceId"
|
|
|
|
|
v-model:district-id="formData.customerBranch[indexTab].districtId"
|
|
|
|
|
v-model:sub-district-id="
|
|
|
|
|
formData.customerBranch[indexTab].subDistrictId
|
|
|
|
|
"
|
|
|
|
|
v-model:zip-code="formData.customerBranch[indexTab].zipCode"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
2024-04-23 13:41:11 +07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #businessInformation>
|
2024-04-23 17:20:31 +07:00
|
|
|
<FormBusiness
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
2024-06-06 17:10:58 +07:00
|
|
|
v-model:employment-office="
|
|
|
|
|
formData.customerBranch[indexTab].employmentOffice
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessType
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type-en="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessTypeEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position="
|
|
|
|
|
formData.customerBranch[indexTab].jobPosition
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position-en="
|
|
|
|
|
formData.customerBranch[indexTab].jobPositionEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-description="
|
|
|
|
|
formData.customerBranch[indexTab].jobDescription
|
|
|
|
|
"
|
|
|
|
|
v-model:sale-employee="
|
|
|
|
|
formData.customerBranch[indexTab].saleEmployee
|
|
|
|
|
"
|
|
|
|
|
v-model:pay-date="formData.customerBranch[indexTab].payDate"
|
2024-06-07 14:19:35 +07:00
|
|
|
v-model:wage-rate="formData.customerBranch[indexTab].wageRate"
|
2024-04-23 17:20:31 +07:00
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
2024-04-23 11:45:42 +07:00
|
|
|
</template>
|
2024-04-23 13:51:32 +07:00
|
|
|
<template #about>
|
2024-04-23 17:20:31 +07:00
|
|
|
<AboutComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
2024-06-06 17:10:58 +07:00
|
|
|
:type-customer="customerType"
|
|
|
|
|
v-model:tax-no="formData.customerBranch[indexTab].taxNo"
|
2024-04-23 17:20:31 +07:00
|
|
|
v-model:customer-name="formData.customerBranch[indexTab].name"
|
|
|
|
|
v-model:customer-english-name="
|
|
|
|
|
formData.customerBranch[indexTab].nameEN
|
|
|
|
|
"
|
|
|
|
|
v-model:authorized-capital="
|
|
|
|
|
formData.customerBranch[indexTab].authorizedCapital
|
|
|
|
|
"
|
|
|
|
|
v-model:register-name="
|
|
|
|
|
formData.customerBranch[indexTab].registerName
|
|
|
|
|
"
|
|
|
|
|
v-model:register-date="
|
|
|
|
|
formData.customerBranch[indexTab].registerDate
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
2024-06-06 16:03:47 +07:00
|
|
|
bordered
|
2024-04-23 17:20:31 +07:00
|
|
|
separator
|
|
|
|
|
/>
|
2024-04-23 13:51:32 +07:00
|
|
|
</template>
|
|
|
|
|
<template #contactInformation>
|
2024-04-23 17:20:31 +07:00
|
|
|
<ContactComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:mail="formData.customerBranch[indexTab].email"
|
|
|
|
|
v-model:telephone="formData.customerBranch[indexTab].telephoneNo"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
/>
|
2024-04-23 13:51:32 +07:00
|
|
|
</template>
|
|
|
|
|
<template #otherDocuments>
|
2024-04-23 17:20:31 +07:00
|
|
|
<OtherInformation
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
2024-04-23 13:51:32 +07:00
|
|
|
</template>
|
2024-04-23 11:45:42 +07:00
|
|
|
</TabComponent>
|
|
|
|
|
</div>
|
2024-04-23 11:37:27 +07:00
|
|
|
</template>
|
2024-04-22 16:21:34 +07:00
|
|
|
</FormDialog>
|
2024-04-23 11:15:25 +00:00
|
|
|
|
2024-06-13 10:07:20 +00:00
|
|
|
<!-- Employee Form -->
|
2024-06-07 12:24:09 +00:00
|
|
|
<FormDialog
|
|
|
|
|
employee
|
2024-06-12 09:08:43 +00:00
|
|
|
disabledRule
|
2024-06-10 11:25:38 +00:00
|
|
|
addressSeparator
|
2024-06-13 10:07:20 +00:00
|
|
|
v-model:modal="dialogEmployee"
|
2024-06-07 12:24:09 +00:00
|
|
|
:noAddress="formDataEmployeeTab !== 'personalInfo'"
|
2024-06-11 07:34:10 +00:00
|
|
|
:noPaddingTab="
|
|
|
|
|
formDataEmployeeTab === 'healthCheck' ||
|
|
|
|
|
formDataEmployeeTab === 'workHistory'
|
|
|
|
|
"
|
2024-06-07 12:24:09 +00:00
|
|
|
v-model:tabs-list="employeeTab"
|
2024-06-18 02:00:10 +00:00
|
|
|
v-model:current-tab="formDataEmployeeTab"
|
2024-06-07 12:24:09 +00:00
|
|
|
v-model:same-with-employer="formDataEmployeeSameAddr"
|
|
|
|
|
v-model:address="formDataEmployee.address"
|
|
|
|
|
v-model:addressEN="formDataEmployee.addressEN"
|
|
|
|
|
v-model:provinceId="formDataEmployee.provinceId"
|
|
|
|
|
v-model:districtId="formDataEmployee.districtId"
|
|
|
|
|
v-model:subDistrictId="formDataEmployee.subDistrictId"
|
|
|
|
|
v-model:zipCode="formDataEmployee.zipCode"
|
|
|
|
|
:title="$t('customerEmployeeAdd')"
|
|
|
|
|
:submit="
|
|
|
|
|
() => {
|
2024-06-12 08:40:07 +00:00
|
|
|
isEmployeeEdit
|
|
|
|
|
? currentEmployee && onSubmitEdit(currentEmployee.id)
|
|
|
|
|
: onSubmit();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
:close="
|
|
|
|
|
() => {
|
|
|
|
|
clearFormEmployee();
|
2024-06-07 12:24:09 +00:00
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<template #prepend>
|
|
|
|
|
<ProfileUpload
|
|
|
|
|
v-model:url-profile="profileUrl"
|
|
|
|
|
v-model:status-toggle="statusToggle"
|
|
|
|
|
v-model:profile-submit="profileSubmit"
|
|
|
|
|
@input-file="inputFile.click()"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-06-10 11:25:38 +00:00
|
|
|
<template #information>
|
|
|
|
|
<BasicInformation
|
|
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
|
|
|
|
employee
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
2024-06-11 12:27:58 +00:00
|
|
|
:employee-owner-option="employeeStore.ownerOption"
|
2024-06-13 10:07:20 +00:00
|
|
|
v-model:customer-branch="formDataEmployeeOwner"
|
|
|
|
|
v-model:employee-id="currentEmployeeCode"
|
2024-06-10 11:25:38 +00:00
|
|
|
v-model:nrc-no="formDataEmployee.nrcNo"
|
2024-06-18 10:44:07 +07:00
|
|
|
v-model:person-name="formData.personName"
|
2024-06-11 12:27:58 +00:00
|
|
|
@filter-owner-branch="employeeFilterOwnerBranch"
|
2024-06-10 11:25:38 +00:00
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
<template #person>
|
|
|
|
|
<FormPerson
|
|
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
employee
|
|
|
|
|
separator
|
|
|
|
|
v-model:firstName="formDataEmployee.firstName"
|
|
|
|
|
v-model:lastName="formDataEmployee.lastName"
|
|
|
|
|
v-model:firstNameEN="formDataEmployee.firstNameEN"
|
|
|
|
|
v-model:lastNameEN="formDataEmployee.lastNameEN"
|
|
|
|
|
v-model:gender="formDataEmployee.gender"
|
2024-06-10 11:25:38 +00:00
|
|
|
v-model:birthDate="formDataEmployee.dateOfBirth"
|
2024-06-07 12:24:09 +00:00
|
|
|
v-model:nationality="formDataEmployee.nationality"
|
|
|
|
|
/>
|
2024-06-11 07:34:10 +00:00
|
|
|
|
2024-06-07 12:24:09 +00:00
|
|
|
<FormEmployeeHealthCheck
|
2024-06-11 07:34:10 +00:00
|
|
|
v-if="
|
|
|
|
|
formDataEmployeeTab === 'healthCheck' &&
|
|
|
|
|
formDataEmployee.employeeCheckup
|
|
|
|
|
"
|
2024-06-07 12:24:09 +00:00
|
|
|
dense
|
|
|
|
|
outlined
|
2024-06-11 07:34:10 +00:00
|
|
|
v-model:employee-checkup="formDataEmployee.employeeCheckup"
|
2024-06-11 12:27:58 +00:00
|
|
|
v-model:checkup-type-option="employeeStore.globalOption.tha.nationality"
|
|
|
|
|
v-model:medical-benefit-option="
|
|
|
|
|
employeeStore.globalOption.tha.typeInsurance
|
|
|
|
|
"
|
|
|
|
|
v-model:insurance-company-option="
|
|
|
|
|
employeeStore.globalOption.tha.insurancePlace
|
|
|
|
|
"
|
2024-06-10 11:25:38 +00:00
|
|
|
/>
|
|
|
|
|
<FormEmployeeWorkHistory
|
|
|
|
|
v-if="formDataEmployeeTab === 'workHistory'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
2024-06-11 07:34:10 +00:00
|
|
|
v-model:employee-work="formDataEmployee.employeeWork"
|
2024-06-11 12:27:58 +00:00
|
|
|
v-model:position-name-option="employeeStore.globalOption.tha.position"
|
|
|
|
|
v-model:job-type-option="employeeStore.globalOption.tha.businessType"
|
|
|
|
|
v-model:workplace-option="employeeStore.globalOption.tha.area"
|
2024-06-10 11:25:38 +00:00
|
|
|
/>
|
|
|
|
|
<FormEmployeeOther
|
|
|
|
|
v-if="
|
|
|
|
|
formDataEmployeeTab === 'other' && formDataEmployee.employeeOtherInfo
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model:employee-other="formDataEmployee.employeeOtherInfo"
|
2024-06-07 12:24:09 +00:00
|
|
|
/>
|
|
|
|
|
</template>
|
2024-06-10 11:25:38 +00:00
|
|
|
<template #by-type>
|
|
|
|
|
<FormEmployeePassport
|
2024-06-07 12:24:09 +00:00
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
2024-06-10 11:25:38 +00:00
|
|
|
employee
|
2024-06-07 12:24:09 +00:00
|
|
|
separator
|
2024-06-10 11:25:38 +00:00
|
|
|
v-model:passport-type="formDataEmployee.passportType"
|
|
|
|
|
v-model:passport-number="formDataEmployee.passportNumber"
|
|
|
|
|
v-model:passport-issue-date="formDataEmployee.passportIssueDate"
|
|
|
|
|
v-model:passport-expiry-date="formDataEmployee.passportExpiryDate"
|
2024-06-11 12:27:58 +00:00
|
|
|
v-model:passport-issuing-place="formDataEmployee.passportIssuingPlace"
|
2024-06-10 11:25:38 +00:00
|
|
|
v-model:passport-issuing-country="
|
|
|
|
|
formDataEmployee.passportIssuingCountry
|
|
|
|
|
"
|
|
|
|
|
v-model:previous-passport-reference="
|
|
|
|
|
formDataEmployee.previousPassportReference
|
|
|
|
|
"
|
2024-06-11 12:27:58 +00:00
|
|
|
v-model:passport-type-option="
|
|
|
|
|
employeeStore.globalOption.tha.nationality
|
|
|
|
|
"
|
|
|
|
|
v-model:passport-issuing-country-option="
|
|
|
|
|
employeeStore.globalOption.tha.nationality
|
|
|
|
|
"
|
2024-06-10 11:25:38 +00:00
|
|
|
/>
|
|
|
|
|
<FormEmployeeVisa
|
|
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
employee
|
|
|
|
|
v-model:visa-type="formDataEmployee.visaType"
|
|
|
|
|
v-model:visa-number="formDataEmployee.visaNumber"
|
|
|
|
|
v-model:visa-issue-date="formDataEmployee.visaIssueDate"
|
|
|
|
|
v-model:visa-expiry-date="formDataEmployee.visaExpiryDate"
|
|
|
|
|
v-model:visa-issuing-place="formDataEmployee.visaIssuingPlace"
|
|
|
|
|
v-model:visa-stay-until-date="formDataEmployee.visaStayUntilDate"
|
|
|
|
|
v-model:tm6-number="formDataEmployee.tm6Number"
|
|
|
|
|
v-model:entry-date="formDataEmployee.entryDate"
|
2024-06-11 12:27:58 +00:00
|
|
|
v-model:visa-type-option="employeeStore.globalOption.tha.nationality"
|
2024-06-07 12:24:09 +00:00
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</FormDialog>
|
|
|
|
|
|
2024-06-10 11:25:38 +00:00
|
|
|
<FormDialog
|
|
|
|
|
v-model:modal="dialogInputCustomerBranchForm"
|
|
|
|
|
:title="$t('formDialogTitleCreateSubBranch')"
|
|
|
|
|
:submit="
|
|
|
|
|
() => {
|
|
|
|
|
onSubmitCustomerBranch();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
:close="() => {}"
|
|
|
|
|
>
|
|
|
|
|
<template #address>
|
|
|
|
|
<!-- <FormCustomerBranch separator dense outlined /> -->
|
|
|
|
|
|
|
|
|
|
<div class="col-3 app-text-muted">
|
|
|
|
|
• {{ $t('formDialogCustomerBranch') }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12 row bordered q-pt-none rounded">
|
|
|
|
|
<TabComponent
|
|
|
|
|
v-model:customer-branch="formData.customerBranch"
|
|
|
|
|
v-model:tab-index="indexTab"
|
|
|
|
|
>
|
|
|
|
|
<template #address>
|
|
|
|
|
<FormAddress
|
2024-06-17 12:57:57 +07:00
|
|
|
:id="indexTab"
|
2024-06-10 11:25:38 +00:00
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:address="formData.customerBranch[indexTab].address"
|
|
|
|
|
v-model:address-e-n="formData.customerBranch[indexTab].addressEN"
|
|
|
|
|
v-model:province-id="formData.customerBranch[indexTab].provinceId"
|
|
|
|
|
v-model:district-id="formData.customerBranch[indexTab].districtId"
|
|
|
|
|
v-model:sub-district-id="
|
|
|
|
|
formData.customerBranch[indexTab].subDistrictId
|
|
|
|
|
"
|
|
|
|
|
v-model:zip-code="formData.customerBranch[indexTab].zipCode"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #businessInformation>
|
|
|
|
|
<FormBusiness
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:employment-office="
|
|
|
|
|
formData.customerBranch[indexTab].employmentOffice
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessType
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type-en="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessTypeEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position="
|
|
|
|
|
formData.customerBranch[indexTab].jobPosition
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position-en="
|
|
|
|
|
formData.customerBranch[indexTab].jobPositionEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-description="
|
|
|
|
|
formData.customerBranch[indexTab].jobDescription
|
|
|
|
|
"
|
|
|
|
|
v-model:sale-employee="
|
|
|
|
|
formData.customerBranch[indexTab].saleEmployee
|
|
|
|
|
"
|
|
|
|
|
v-model:pay-date="formData.customerBranch[indexTab].payDate"
|
|
|
|
|
v-model:wage-rate="formData.customerBranch[indexTab].wageRate"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #about>
|
|
|
|
|
<AboutComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
:type-customer="customerType"
|
|
|
|
|
v-model:tax-no="formData.customerBranch[indexTab].taxNo"
|
|
|
|
|
v-model:customer-name="formData.customerBranch[indexTab].name"
|
|
|
|
|
v-model:customer-english-name="
|
|
|
|
|
formData.customerBranch[indexTab].nameEN
|
|
|
|
|
"
|
|
|
|
|
v-model:authorized-capital="
|
|
|
|
|
formData.customerBranch[indexTab].authorizedCapital
|
|
|
|
|
"
|
|
|
|
|
v-model:register-name="
|
|
|
|
|
formData.customerBranch[indexTab].registerName
|
|
|
|
|
"
|
|
|
|
|
v-model:register-date="
|
|
|
|
|
formData.customerBranch[indexTab].registerDate
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
bordered
|
|
|
|
|
separator
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #contactInformation>
|
|
|
|
|
<ContactComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:mail="formData.customerBranch[indexTab].email"
|
|
|
|
|
v-model:telephone="formData.customerBranch[indexTab].telephoneNo"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #otherDocuments>
|
|
|
|
|
<OtherInformation
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</TabComponent>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</FormDialog>
|
|
|
|
|
|
2024-06-10 12:00:16 +07:00
|
|
|
<FormDialog
|
|
|
|
|
v-model:modal="dialogInputCustomerBranchForm"
|
|
|
|
|
:title="$t('formDialogTitleCreateSubBranch')"
|
|
|
|
|
:submit="
|
|
|
|
|
() => {
|
|
|
|
|
onSubmitCustomerBranch();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
:close="() => {}"
|
|
|
|
|
>
|
|
|
|
|
<template #address>
|
|
|
|
|
<!-- <FormCustomerBranch separator dense outlined /> -->
|
|
|
|
|
|
|
|
|
|
<div class="col-3 app-text-muted">
|
|
|
|
|
• {{ $t('formDialogCustomerBranch') }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12 row bordered q-pt-none rounded">
|
|
|
|
|
<TabComponent
|
|
|
|
|
v-model:customer-branch="formData.customerBranch"
|
|
|
|
|
v-model:tab-index="indexTab"
|
|
|
|
|
>
|
|
|
|
|
<template #address>
|
|
|
|
|
<FormAddress
|
2024-06-17 12:57:57 +07:00
|
|
|
:id="indexTab"
|
2024-06-10 12:00:16 +07:00
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:address="formData.customerBranch[indexTab].address"
|
|
|
|
|
v-model:address-e-n="formData.customerBranch[indexTab].addressEN"
|
|
|
|
|
v-model:province-id="formData.customerBranch[indexTab].provinceId"
|
|
|
|
|
v-model:district-id="formData.customerBranch[indexTab].districtId"
|
|
|
|
|
v-model:sub-district-id="
|
|
|
|
|
formData.customerBranch[indexTab].subDistrictId
|
|
|
|
|
"
|
|
|
|
|
v-model:zip-code="formData.customerBranch[indexTab].zipCode"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #businessInformation>
|
|
|
|
|
<FormBusiness
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:employment-office="
|
|
|
|
|
formData.customerBranch[indexTab].employmentOffice
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessType
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type-en="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessTypeEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position="
|
|
|
|
|
formData.customerBranch[indexTab].jobPosition
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position-en="
|
|
|
|
|
formData.customerBranch[indexTab].jobPositionEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-description="
|
|
|
|
|
formData.customerBranch[indexTab].jobDescription
|
|
|
|
|
"
|
|
|
|
|
v-model:sale-employee="
|
|
|
|
|
formData.customerBranch[indexTab].saleEmployee
|
|
|
|
|
"
|
|
|
|
|
v-model:pay-date="formData.customerBranch[indexTab].payDate"
|
|
|
|
|
v-model:wage-rate="formData.customerBranch[indexTab].wageRate"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #about>
|
|
|
|
|
<AboutComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
:type-customer="customerType"
|
|
|
|
|
v-model:tax-no="formData.customerBranch[indexTab].taxNo"
|
|
|
|
|
v-model:customer-name="formData.customerBranch[indexTab].name"
|
|
|
|
|
v-model:customer-english-name="
|
|
|
|
|
formData.customerBranch[indexTab].nameEN
|
|
|
|
|
"
|
|
|
|
|
v-model:authorized-capital="
|
|
|
|
|
formData.customerBranch[indexTab].authorizedCapital
|
|
|
|
|
"
|
|
|
|
|
v-model:register-name="
|
|
|
|
|
formData.customerBranch[indexTab].registerName
|
|
|
|
|
"
|
|
|
|
|
v-model:register-date="
|
|
|
|
|
formData.customerBranch[indexTab].registerDate
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
bordered
|
|
|
|
|
separator
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #contactInformation>
|
|
|
|
|
<ContactComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:mail="formData.customerBranch[indexTab].email"
|
|
|
|
|
v-model:telephone="formData.customerBranch[indexTab].telephoneNo"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #otherDocuments>
|
|
|
|
|
<OtherInformation
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined && formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</TabComponent>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</FormDialog>
|
|
|
|
|
|
2024-06-10 16:02:14 +07:00
|
|
|
<!-- DRAWER INFO ของ นายจ้าง -->
|
2024-04-23 11:15:25 +00:00
|
|
|
<DrawerInfo
|
2024-06-17 17:58:32 +07:00
|
|
|
:title="
|
|
|
|
|
$t(
|
|
|
|
|
currentCustomer?.customerType === 'CORP'
|
|
|
|
|
? 'formTitleCustomer'
|
|
|
|
|
: 'formTitleCustomerNaturalPerson',
|
|
|
|
|
{ msg: currentCustomer?.customerName },
|
|
|
|
|
)
|
|
|
|
|
"
|
2024-04-23 11:15:25 +00:00
|
|
|
v-model:drawer-open="infoDrawer"
|
2024-06-12 16:21:33 +07:00
|
|
|
:badgeLabel="currentCustomer?.code"
|
2024-06-06 10:28:59 +00:00
|
|
|
:undo="() => undo()"
|
|
|
|
|
:isEdit="infoDrawerEdit"
|
|
|
|
|
:close="() => onClose()"
|
|
|
|
|
:editData="() => (infoDrawerEdit = true)"
|
2024-06-07 18:04:08 +07:00
|
|
|
:submit="() => onSubmitEdit(currentCustomerId)"
|
2024-06-10 16:17:38 +07:00
|
|
|
:deleteData="
|
|
|
|
|
() => {
|
|
|
|
|
deleteCustomerById(currentCustomerId);
|
|
|
|
|
}
|
|
|
|
|
"
|
2024-04-23 11:15:25 +00:00
|
|
|
>
|
|
|
|
|
<template #info>
|
2024-06-06 10:28:59 +00:00
|
|
|
<InfoForm>
|
2024-04-23 11:15:25 +00:00
|
|
|
<template #person-card>
|
|
|
|
|
<div class="q-ma-md">
|
|
|
|
|
<AppBox class="surface-1" style="padding: 0">
|
|
|
|
|
<UsersDetailCardComponent
|
2024-06-17 17:58:32 +07:00
|
|
|
:hideButton="true"
|
2024-06-11 12:55:46 +07:00
|
|
|
v-if="!!currentCustomer"
|
2024-04-23 11:15:25 +00:00
|
|
|
no-bg
|
|
|
|
|
no-detail
|
|
|
|
|
no-hover
|
2024-06-11 12:55:46 +07:00
|
|
|
:color="
|
|
|
|
|
currentCustomer.customerType === 'CORP' ? 'purple' : 'green'
|
|
|
|
|
"
|
2024-04-23 11:15:25 +00:00
|
|
|
:metadata="{ id: '1', disabled: false }"
|
|
|
|
|
:list="{
|
2024-06-11 12:55:46 +07:00
|
|
|
id: '1',
|
|
|
|
|
type: currentCustomer.customerType,
|
|
|
|
|
name: currentCustomer.customerName,
|
|
|
|
|
imageUrl: currentCustomer.imageUrl,
|
2024-04-23 11:15:25 +00:00
|
|
|
code: 'HQ006',
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
</AppBox>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-06-06 10:28:59 +00:00
|
|
|
<template #information>
|
|
|
|
|
<BasicInformation
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
2024-06-07 18:04:08 +07:00
|
|
|
:type-customer="customerType"
|
|
|
|
|
v-model:customer-name="formData.customerName"
|
|
|
|
|
v-model:customer-name-en="formData.customerNameEN"
|
2024-06-18 10:44:07 +07:00
|
|
|
v-model:person-name="formData.personName"
|
2024-06-07 18:04:08 +07:00
|
|
|
v-model:tax-no="formData.taxNo"
|
2024-06-06 10:28:59 +00:00
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #address>
|
|
|
|
|
<div class="col-3 app-text-muted">
|
|
|
|
|
• {{ $t('formDialogCustomerBranch') }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12 row bordered q-pt-none rounded">
|
|
|
|
|
<TabComponent
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
v-model:customer-branch="formData.customerBranch"
|
|
|
|
|
v-model:tab-index="indexTab"
|
|
|
|
|
>
|
|
|
|
|
<template #address>
|
|
|
|
|
<FormAddress
|
2024-06-17 12:57:57 +07:00
|
|
|
:id="indexTab"
|
2024-06-06 10:28:59 +00:00
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:address="formData.customerBranch[indexTab].address"
|
|
|
|
|
v-model:address-e-n="
|
|
|
|
|
formData.customerBranch[indexTab].addressEN
|
|
|
|
|
"
|
|
|
|
|
v-model:province-id="
|
|
|
|
|
formData.customerBranch[indexTab].provinceId
|
|
|
|
|
"
|
|
|
|
|
v-model:district-id="
|
|
|
|
|
formData.customerBranch[indexTab].districtId
|
|
|
|
|
"
|
|
|
|
|
v-model:sub-district-id="
|
|
|
|
|
formData.customerBranch[indexTab].subDistrictId
|
|
|
|
|
"
|
|
|
|
|
v-model:zip-code="formData.customerBranch[indexTab].zipCode"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #businessInformation>
|
|
|
|
|
<FormBusiness
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
2024-06-07 18:04:08 +07:00
|
|
|
v-model:employment-office="
|
|
|
|
|
formData.customerBranch[indexTab].employmentOffice
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessType
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type-en="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessTypeEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position="
|
|
|
|
|
formData.customerBranch[indexTab].jobPosition
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position-en="
|
|
|
|
|
formData.customerBranch[indexTab].jobPositionEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-description="
|
|
|
|
|
formData.customerBranch[indexTab].jobDescription
|
|
|
|
|
"
|
|
|
|
|
v-model:sale-employee="
|
|
|
|
|
formData.customerBranch[indexTab].saleEmployee
|
|
|
|
|
"
|
|
|
|
|
v-model:pay-date="formData.customerBranch[indexTab].payDate"
|
|
|
|
|
v-model:wage-rate="formData.customerBranch[indexTab].wageRate"
|
2024-06-06 10:28:59 +00:00
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #about>
|
|
|
|
|
<AboutComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
2024-06-10 16:02:14 +07:00
|
|
|
:type-customer="customerType"
|
|
|
|
|
v-model:customer-name="formData.customerBranch[indexTab].name"
|
|
|
|
|
v-model:customer-english-name="
|
|
|
|
|
formData.customerBranch[indexTab].nameEN
|
|
|
|
|
"
|
|
|
|
|
v-model:authorized-capital="
|
|
|
|
|
formData.customerBranch[indexTab].authorizedCapital
|
|
|
|
|
"
|
|
|
|
|
v-model:register-name="
|
|
|
|
|
formData.customerBranch[indexTab].registerName
|
|
|
|
|
"
|
|
|
|
|
v-model:register-date="
|
|
|
|
|
formData.customerBranch[indexTab].registerDate
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
bordered
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #contactInformation>
|
|
|
|
|
<ContactComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:mail="formData.customerBranch[indexTab].email"
|
|
|
|
|
v-model:telephone="
|
|
|
|
|
formData.customerBranch[indexTab].telephoneNo
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #otherDocuments>
|
|
|
|
|
<OtherInformation
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</TabComponent>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</InfoForm>
|
|
|
|
|
</template>
|
|
|
|
|
</DrawerInfo>
|
|
|
|
|
|
|
|
|
|
<!-- DRAWER INFO ของ สาขา -->
|
|
|
|
|
<DrawerInfo
|
2024-06-12 16:21:33 +07:00
|
|
|
:title="$t('formTitleBranch', { msg: currentBranch.name })"
|
2024-06-10 16:02:14 +07:00
|
|
|
v-model:drawer-open="infoDrawerBranch"
|
2024-06-12 16:21:33 +07:00
|
|
|
:badgeLabel="currentBranch.code"
|
2024-06-10 16:02:14 +07:00
|
|
|
badgeClass="app-bg-pers"
|
|
|
|
|
:undo="() => undo()"
|
|
|
|
|
:isEdit="infoDrawerEdit"
|
|
|
|
|
:close="() => onCloseBranch()"
|
|
|
|
|
:editData="() => (infoDrawerEdit = true)"
|
2024-06-10 16:17:38 +07:00
|
|
|
:deleteData="() => deleteBranchId(currentBranchId)"
|
2024-06-10 16:02:14 +07:00
|
|
|
:submit="
|
|
|
|
|
() => {
|
|
|
|
|
submitBranch();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<template #info>
|
|
|
|
|
<InfoForm>
|
|
|
|
|
<template #person-card>
|
|
|
|
|
<div class="q-ma-md">
|
|
|
|
|
<AppBox class="surface-1" style="padding: 0">
|
|
|
|
|
<UsersDetailCardComponent
|
2024-06-17 17:58:32 +07:00
|
|
|
:hideButton="true"
|
2024-06-11 12:55:46 +07:00
|
|
|
v-if="!!currentCustomer"
|
2024-06-10 16:02:14 +07:00
|
|
|
no-bg
|
|
|
|
|
no-detail
|
|
|
|
|
no-hover
|
2024-06-11 12:55:46 +07:00
|
|
|
:color="
|
|
|
|
|
currentCustomer.customerType === 'CORP' ? 'purple' : 'green'
|
|
|
|
|
"
|
2024-06-10 16:02:14 +07:00
|
|
|
:metadata="{ id: '1', disabled: false }"
|
|
|
|
|
:list="{
|
2024-06-11 12:55:46 +07:00
|
|
|
id: '1',
|
|
|
|
|
type: currentCustomer.customerType,
|
|
|
|
|
name: currentCustomer.customerName,
|
|
|
|
|
imageUrl: currentCustomer.imageUrl,
|
2024-06-10 16:02:14 +07:00
|
|
|
code: 'HQ006',
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
</AppBox>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #information>
|
|
|
|
|
<BasicInformation
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
:readonly="true"
|
|
|
|
|
:type-customer="customerType"
|
|
|
|
|
v-model:customer-name="formData.customerName"
|
|
|
|
|
v-model:customer-name-en="formData.customerNameEN"
|
2024-06-18 10:44:07 +07:00
|
|
|
v-model:person-name="formData.personName"
|
2024-06-10 16:02:14 +07:00
|
|
|
v-model:tax-no="formData.taxNo"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #address>
|
|
|
|
|
<div class="col-3 app-text-muted">
|
|
|
|
|
• {{ $t('formDialogCustomerBranch') }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12 row bordered q-pt-none rounded">
|
|
|
|
|
<TabComponent
|
|
|
|
|
:readonly="true"
|
|
|
|
|
v-model:customer-branch="formData.customerBranch"
|
|
|
|
|
v-model:tab-index="indexTab"
|
|
|
|
|
>
|
|
|
|
|
<template #address>
|
|
|
|
|
<FormAddress
|
2024-06-17 12:57:57 +07:00
|
|
|
:id="indexTab"
|
2024-06-10 16:02:14 +07:00
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:address="formData.customerBranch[indexTab].address"
|
|
|
|
|
v-model:address-e-n="
|
|
|
|
|
formData.customerBranch[indexTab].addressEN
|
|
|
|
|
"
|
|
|
|
|
v-model:province-id="
|
|
|
|
|
formData.customerBranch[indexTab].provinceId
|
|
|
|
|
"
|
|
|
|
|
v-model:district-id="
|
|
|
|
|
formData.customerBranch[indexTab].districtId
|
|
|
|
|
"
|
|
|
|
|
v-model:sub-district-id="
|
|
|
|
|
formData.customerBranch[indexTab].subDistrictId
|
|
|
|
|
"
|
|
|
|
|
v-model:zip-code="formData.customerBranch[indexTab].zipCode"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #businessInformation>
|
|
|
|
|
<FormBusiness
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:employment-office="
|
|
|
|
|
formData.customerBranch[indexTab].employmentOffice
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessType
|
|
|
|
|
"
|
|
|
|
|
v-model:bussiness-type-en="
|
|
|
|
|
formData.customerBranch[indexTab].bussinessTypeEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position="
|
|
|
|
|
formData.customerBranch[indexTab].jobPosition
|
|
|
|
|
"
|
|
|
|
|
v-model:job-position-en="
|
|
|
|
|
formData.customerBranch[indexTab].jobPositionEN
|
|
|
|
|
"
|
|
|
|
|
v-model:job-description="
|
|
|
|
|
formData.customerBranch[indexTab].jobDescription
|
|
|
|
|
"
|
|
|
|
|
v-model:sale-employee="
|
|
|
|
|
formData.customerBranch[indexTab].saleEmployee
|
|
|
|
|
"
|
|
|
|
|
v-model:pay-date="formData.customerBranch[indexTab].payDate"
|
|
|
|
|
v-model:wage-rate="formData.customerBranch[indexTab].wageRate"
|
|
|
|
|
separator
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #about>
|
|
|
|
|
<AboutComponent
|
|
|
|
|
v-if="formData.customerBranch?.[0]"
|
|
|
|
|
:type-customer="customerType"
|
2024-06-06 10:28:59 +00:00
|
|
|
v-model:customer-name="formData.customerBranch[indexTab].name"
|
|
|
|
|
v-model:customer-english-name="
|
|
|
|
|
formData.customerBranch[indexTab].nameEN
|
|
|
|
|
"
|
|
|
|
|
v-model:authorized-capital="
|
|
|
|
|
formData.customerBranch[indexTab].authorizedCapital
|
|
|
|
|
"
|
|
|
|
|
v-model:register-name="
|
|
|
|
|
formData.customerBranch[indexTab].registerName
|
|
|
|
|
"
|
|
|
|
|
v-model:register-date="
|
|
|
|
|
formData.customerBranch[indexTab].registerDate
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
bordered
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #contactInformation>
|
|
|
|
|
<ContactComponent
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
v-model:mail="formData.customerBranch[indexTab].email"
|
|
|
|
|
v-model:telephone="
|
|
|
|
|
formData.customerBranch[indexTab].telephoneNo
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #otherDocuments>
|
|
|
|
|
<OtherInformation
|
|
|
|
|
v-if="
|
|
|
|
|
indexTab !== undefined &&
|
|
|
|
|
formData.customerBranch?.[indexTab]
|
|
|
|
|
"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="!infoDrawerEdit"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</TabComponent>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-04-23 11:15:25 +00:00
|
|
|
</InfoForm>
|
|
|
|
|
</template>
|
|
|
|
|
</DrawerInfo>
|
2024-06-12 08:40:07 +00:00
|
|
|
|
|
|
|
|
<!-- Employee Info -->
|
|
|
|
|
<DrawerInfo
|
|
|
|
|
:title="
|
|
|
|
|
currentEmployee
|
|
|
|
|
? $i18n.locale === 'en-US'
|
|
|
|
|
? `${currentEmployee.firstNameEN} ${currentEmployee.lastNameEN}`
|
|
|
|
|
: `${currentEmployee.firstName} ${currentEmployee.lastName}`
|
|
|
|
|
: '-'
|
|
|
|
|
"
|
|
|
|
|
v-model:drawer-open="infoDrawerEmployee"
|
|
|
|
|
:is-edit="infoDrawerEmployeeEdit"
|
|
|
|
|
:editData="() => (infoDrawerEmployeeEdit = true)"
|
2024-06-12 09:16:21 +00:00
|
|
|
:undo="undo"
|
|
|
|
|
:close="clearFormEmployee"
|
2024-06-12 08:54:16 +00:00
|
|
|
:deleteData="
|
|
|
|
|
() => {
|
|
|
|
|
currentEmployee && onDelete(currentEmployee.id);
|
|
|
|
|
}
|
|
|
|
|
"
|
2024-06-12 08:40:07 +00:00
|
|
|
:submit="
|
|
|
|
|
() => {
|
|
|
|
|
currentEmployee && onSubmitEdit(currentEmployee.id);
|
|
|
|
|
}
|
|
|
|
|
"
|
2024-06-13 10:07:20 +00:00
|
|
|
bg-color="surface-tab"
|
2024-06-12 08:40:07 +00:00
|
|
|
>
|
|
|
|
|
<InfoForm
|
|
|
|
|
v-if="employeeStore.globalOption"
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
:noAddress="formDataEmployeeTab !== 'personalInfo'"
|
|
|
|
|
:noPaddingTab="
|
|
|
|
|
formDataEmployeeTab === 'healthCheck' ||
|
|
|
|
|
formDataEmployeeTab === 'workHistory'
|
|
|
|
|
"
|
2024-06-13 10:07:20 +00:00
|
|
|
v-model:same-with-employer="formDataEmployeeSameAddr"
|
2024-06-12 08:40:07 +00:00
|
|
|
v-model:tabs-list="employeeTab"
|
|
|
|
|
v-model:employee-tab="formDataEmployeeTab"
|
|
|
|
|
v-model:address="formDataEmployee.address"
|
|
|
|
|
v-model:addressEN="formDataEmployee.addressEN"
|
|
|
|
|
v-model:provinceId="formDataEmployee.provinceId"
|
|
|
|
|
v-model:districtId="formDataEmployee.districtId"
|
|
|
|
|
v-model:subDistrictId="formDataEmployee.subDistrictId"
|
|
|
|
|
v-model:zipCode="formDataEmployee.zipCode"
|
2024-06-12 09:08:43 +00:00
|
|
|
disabledRule
|
2024-06-13 10:07:20 +00:00
|
|
|
employee
|
2024-06-12 08:40:07 +00:00
|
|
|
>
|
|
|
|
|
<template #person-card>
|
|
|
|
|
<div class="q-ma-md">
|
|
|
|
|
<AppBox class="surface-1" style="padding: 0">
|
|
|
|
|
<PersonCard
|
|
|
|
|
no-hover
|
|
|
|
|
no-action
|
|
|
|
|
no-detail
|
|
|
|
|
no-bg
|
|
|
|
|
:list="infoEmployeePersonCard"
|
|
|
|
|
:gridColumns="1"
|
|
|
|
|
/>
|
|
|
|
|
</AppBox>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #information>
|
|
|
|
|
<BasicInformation
|
2024-06-13 10:07:20 +00:00
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
2024-06-12 08:40:07 +00:00
|
|
|
employee
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
:employee-owner-option="employeeStore.ownerOption"
|
2024-06-13 10:07:20 +00:00
|
|
|
v-model:customer-branch="formDataEmployeeOwner"
|
|
|
|
|
v-model:employee-id="currentEmployeeCode"
|
2024-06-12 08:40:07 +00:00
|
|
|
v-model:nrc-no="formDataEmployee.nrcNo"
|
2024-06-18 10:44:07 +07:00
|
|
|
v-model:person-name="formData.personName"
|
2024-06-12 08:40:07 +00:00
|
|
|
@filter-owner-branch="employeeFilterOwnerBranch"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #person>
|
|
|
|
|
<FormPerson
|
|
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
employee
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
v-model:firstName="formDataEmployee.firstName"
|
|
|
|
|
v-model:lastName="formDataEmployee.lastName"
|
|
|
|
|
v-model:firstNameEN="formDataEmployee.firstNameEN"
|
|
|
|
|
v-model:lastNameEN="formDataEmployee.lastNameEN"
|
|
|
|
|
v-model:gender="formDataEmployee.gender"
|
|
|
|
|
v-model:birthDate="formDataEmployee.dateOfBirth"
|
|
|
|
|
v-model:nationality="formDataEmployee.nationality"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<FormEmployeeHealthCheck
|
|
|
|
|
v-if="
|
|
|
|
|
formDataEmployeeTab === 'healthCheck' &&
|
|
|
|
|
formDataEmployee.employeeCheckup
|
|
|
|
|
"
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model:employee-checkup="formDataEmployee.employeeCheckup"
|
|
|
|
|
v-model:checkup-type-option="
|
|
|
|
|
employeeStore.globalOption.tha.nationality
|
|
|
|
|
"
|
|
|
|
|
v-model:medical-benefit-option="
|
|
|
|
|
employeeStore.globalOption.tha.typeInsurance
|
|
|
|
|
"
|
|
|
|
|
v-model:insurance-company-option="
|
|
|
|
|
employeeStore.globalOption.tha.insurancePlace
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
<FormEmployeeWorkHistory
|
|
|
|
|
v-if="formDataEmployeeTab === 'workHistory'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
v-model:employee-work="formDataEmployee.employeeWork"
|
|
|
|
|
v-model:position-name-option="employeeStore.globalOption.tha.position"
|
|
|
|
|
v-model:job-type-option="employeeStore.globalOption.tha.businessType"
|
|
|
|
|
v-model:workplace-option="employeeStore.globalOption.tha.area"
|
|
|
|
|
/>
|
|
|
|
|
<FormEmployeeOther
|
|
|
|
|
v-if="
|
|
|
|
|
formDataEmployeeTab === 'other' &&
|
|
|
|
|
formDataEmployee.employeeOtherInfo
|
|
|
|
|
"
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model:employee-other="formDataEmployee.employeeOtherInfo"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #by-type>
|
|
|
|
|
<FormEmployeePassport
|
|
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
employee
|
|
|
|
|
separator
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
v-model:passport-type="formDataEmployee.passportType"
|
|
|
|
|
v-model:passport-number="formDataEmployee.passportNumber"
|
|
|
|
|
v-model:passport-issue-date="formDataEmployee.passportIssueDate"
|
|
|
|
|
v-model:passport-expiry-date="formDataEmployee.passportExpiryDate"
|
|
|
|
|
v-model:passport-issuing-place="formDataEmployee.passportIssuingPlace"
|
|
|
|
|
v-model:passport-issuing-country="
|
|
|
|
|
formDataEmployee.passportIssuingCountry
|
|
|
|
|
"
|
|
|
|
|
v-model:previous-passport-reference="
|
|
|
|
|
formDataEmployee.previousPassportReference
|
|
|
|
|
"
|
|
|
|
|
v-model:passport-type-option="
|
|
|
|
|
employeeStore.globalOption.tha.nationality
|
|
|
|
|
"
|
|
|
|
|
v-model:passport-issuing-country-option="
|
|
|
|
|
employeeStore.globalOption.tha.nationality
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
<FormEmployeeVisa
|
|
|
|
|
v-if="formDataEmployeeTab === 'personalInfo'"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
employee
|
|
|
|
|
:readonly="!infoDrawerEmployeeEdit"
|
|
|
|
|
v-model:visa-type="formDataEmployee.visaType"
|
|
|
|
|
v-model:visa-number="formDataEmployee.visaNumber"
|
|
|
|
|
v-model:visa-issue-date="formDataEmployee.visaIssueDate"
|
|
|
|
|
v-model:visa-expiry-date="formDataEmployee.visaExpiryDate"
|
|
|
|
|
v-model:visa-issuing-place="formDataEmployee.visaIssuingPlace"
|
|
|
|
|
v-model:visa-stay-until-date="formDataEmployee.visaStayUntilDate"
|
|
|
|
|
v-model:tm6-number="formDataEmployee.tm6Number"
|
|
|
|
|
v-model:entry-date="formDataEmployee.entryDate"
|
|
|
|
|
v-model:visa-type-option="employeeStore.globalOption.tha.nationality"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</InfoForm>
|
|
|
|
|
</DrawerInfo>
|
2024-04-22 13:42:02 +07:00
|
|
|
</template>
|
2024-04-22 12:16:17 +07:00
|
|
|
|
2024-04-23 11:15:25 +00:00
|
|
|
<style scoped>
|
|
|
|
|
.customer-row {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: var(--size-6);
|
2024-06-10 12:00:16 +07:00
|
|
|
transition: 0.3s ease-in-out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hover-card:hover {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
box-shadow: var(--shadow-3);
|
2024-04-23 11:15:25 +00:00
|
|
|
}
|
|
|
|
|
</style>
|