รายละเอียดทะเบียนประวัติลูกจ้าง
This commit is contained in:
parent
bdc7ab8df3
commit
1e02f42b58
26 changed files with 2419 additions and 1031 deletions
|
|
@ -366,7 +366,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขผลก
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -595,34 +597,36 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAssessmentId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
point1Total: e.point1Total,
|
||||
point1: e.point1,
|
||||
point2Total: e.point2Total,
|
||||
point2: e.point2,
|
||||
pointSumTotal: e.pointSumTotal,
|
||||
pointSum: e.pointSum,
|
||||
date: new Date(e.date),
|
||||
createdAt: new Date(e.createdAt),
|
||||
createdFullName: e.createdFullName,
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAssessmentId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
point1Total: e.point1Total,
|
||||
point1: e.point1,
|
||||
point2Total: e.point2Total,
|
||||
point2: e.point2,
|
||||
pointSumTotal: e.pointSumTotal,
|
||||
pointSum: e.pointSum,
|
||||
date: new Date(e.date),
|
||||
createdAt: new Date(e.createdAt),
|
||||
createdFullName: e.createdFullName,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -712,29 +716,31 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileAssessmentId(profileId.value), {
|
||||
id: id.value,
|
||||
name: name.value,
|
||||
point1Total: point1Total.value,
|
||||
point1: point1.value,
|
||||
point2Total: point2Total.value,
|
||||
point2: point2.value,
|
||||
pointSumTotal: pointSumTotal.value,
|
||||
pointSum: pointSum.value,
|
||||
date: dateToISO(date.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileAssessmentId(profileId.value), {
|
||||
id: id.value,
|
||||
name: name.value,
|
||||
point1Total: point1Total.value,
|
||||
point1: point1.value,
|
||||
point2Total: point2Total.value,
|
||||
point2: point2.value,
|
||||
pointSumTotal: pointSumTotal.value,
|
||||
pointSum: pointSum.value,
|
||||
date: dateToISO(date.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -244,7 +244,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -360,29 +362,31 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileHonorId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
issuer: e.issuer,
|
||||
detail: e.detail,
|
||||
issueDate: new Date(e.issueDate),
|
||||
createdAt: new Date(e.createdAt),
|
||||
createdFullName: e.createdFullName,
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileHonorId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
issuer: e.issuer,
|
||||
detail: e.detail,
|
||||
issueDate: new Date(e.issueDate),
|
||||
createdAt: new Date(e.createdAt),
|
||||
createdFullName: e.createdFullName,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -467,24 +471,26 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileHonorId(profileId.value), {
|
||||
id: id.value,
|
||||
issuer: issuer.value,
|
||||
detail: detail.value,
|
||||
issueDate: dateToISO(issueDate.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileHonorId(profileId.value), {
|
||||
id: id.value,
|
||||
issuer: issuer.value,
|
||||
detail: detail.value,
|
||||
issueDate: dateToISO(issueDate.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -363,7 +363,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขวิน
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -545,31 +547,33 @@ const filterSelector = (val: string, update: Function, refData: string) => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileDisId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
level: e.level,
|
||||
detail: e.detail,
|
||||
refCommandNo: e.refCommandNo,
|
||||
refCommandDate: new Date(e.refCommandDate),
|
||||
date: new Date(e.date),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileDisId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
level: e.level,
|
||||
detail: e.detail,
|
||||
refCommandNo: e.refCommandNo,
|
||||
refCommandDate: new Date(e.refCommandDate),
|
||||
date: new Date(e.date),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -656,26 +660,28 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileDisId(profileId.value), {
|
||||
id: id.value,
|
||||
level: level.value,
|
||||
detail: detail.value,
|
||||
refCommandNo: refCommandNo.value,
|
||||
refCommandDate: dateToISO(refCommandDate.value),
|
||||
date: dateToISO(date.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileDisId(profileId.value), {
|
||||
id: id.value,
|
||||
level: level.value,
|
||||
detail: detail.value,
|
||||
refCommandNo: refCommandNo.value,
|
||||
refCommandDate: dateToISO(refCommandDate.value),
|
||||
date: dateToISO(date.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:save="uploadData"
|
||||
:addEmployee="statusAdd()"
|
||||
/>
|
||||
<div class="row col-12 q-pt-sm">
|
||||
<q-card bordered flat class="full-width">
|
||||
|
|
@ -153,6 +154,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -162,7 +167,9 @@ const $q = useQuasar(); // show dialog
|
|||
const mixin = useCounterMixin();
|
||||
const route = useRoute();
|
||||
const { success, messageError } = mixin;
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const edit = ref<boolean>(false);
|
||||
const uploader = ref<any>();
|
||||
const files = ref<any>([]);
|
||||
|
|
@ -171,22 +178,37 @@ const name = ref<string>("");
|
|||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
defaultAdd();
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profilePaperId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
files.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profilePaperId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
files.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const statusAdd = () => props.statusAdd;
|
||||
|
||||
const defaultAdd = () => {
|
||||
if (props.statusAdd) {
|
||||
edit.value = props.statusAdd;
|
||||
name.value = "";
|
||||
if (uploader.value !== null) {
|
||||
uploader.value.reset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
|
|
@ -206,31 +228,33 @@ const deleteData = async (id: string) => {
|
|||
|
||||
const uploadData = async () => {
|
||||
if (file.value.length > 0) {
|
||||
const blob = file.value.slice(0, file.value[0].size);
|
||||
const newFile = new File(blob, name.value, {
|
||||
type: file.value[0].type,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("avatar", newFile);
|
||||
formData.append("moss", "newFile");
|
||||
console.log(formData);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profilePaperId(profileId.value), formData)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
uploader.value.reset();
|
||||
name.value = "";
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await getData();
|
||||
if (profileId.value !== "") {
|
||||
const blob = file.value.slice(0, file.value[0].size);
|
||||
const newFile = new File(blob, name.value, {
|
||||
type: file.value[0].type,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("avatar", newFile);
|
||||
formData.append("moss", "newFile");
|
||||
console.log(formData);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profilePaperId(profileId.value), formData)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
uploader.value.reset();
|
||||
name.value = "";
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await getData();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// modalError(
|
||||
// $q,
|
||||
|
|
|
|||
|
|
@ -506,7 +506,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -960,42 +962,44 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileEduId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
level: e.educationLevel,
|
||||
levelId: e.educationLevelId,
|
||||
positionPath: e.positionPath,
|
||||
positionPathId: e.positionPathId,
|
||||
institute: e.institute,
|
||||
degree: e.degree,
|
||||
field: e.field,
|
||||
gpa: e.gpa,
|
||||
country: e.country,
|
||||
duration: e.duration,
|
||||
durationYear: e.durationYear,
|
||||
other: e.other,
|
||||
fundName: e.fundName,
|
||||
finishDate: new Date(e.finishDate),
|
||||
startDate: new Date(e.startDate).getFullYear(),
|
||||
endDate: new Date(e.endDate).getFullYear(),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileEduId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
level: e.educationLevel,
|
||||
levelId: e.educationLevelId,
|
||||
positionPath: e.positionPath,
|
||||
positionPathId: e.positionPathId,
|
||||
institute: e.institute,
|
||||
degree: e.degree,
|
||||
field: e.field,
|
||||
gpa: e.gpa,
|
||||
country: e.country,
|
||||
duration: e.duration,
|
||||
durationYear: e.durationYear,
|
||||
other: e.other,
|
||||
fundName: e.fundName,
|
||||
finishDate: new Date(e.finishDate),
|
||||
startDate: new Date(e.startDate).getFullYear(),
|
||||
endDate: new Date(e.endDate).getFullYear(),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1090,43 +1094,46 @@ const clickSave = async () => {
|
|||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
|
||||
const saveData = async () => {
|
||||
// const filter = OpsFilter.value.levelOptions.filter(
|
||||
// (r: any) => r.id == levelId.value
|
||||
// );
|
||||
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
|
||||
// (r: any) => r.id == positionPathId.value
|
||||
// );
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileEduId(profileId.value), {
|
||||
id: id.value,
|
||||
// educationLevel: filter[0].name,
|
||||
educationLevelId: levelId.value,
|
||||
positionPathId: positionPathId.value,
|
||||
institute: institute.value,
|
||||
degree: degree.value,
|
||||
field: field.value,
|
||||
gpa: gpa.value,
|
||||
country: country.value,
|
||||
duration: duration.value,
|
||||
durationYear: durationYear.value,
|
||||
other: other.value,
|
||||
fundName: fundName.value,
|
||||
finishDate: dateToISO(finishDate.value),
|
||||
startDate: new Date(`${startDate.value}-01-01`),
|
||||
endDate: new Date(`${endDate.value}-01-01`),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
// const filter = OpsFilter.value.levelOptions.filter(
|
||||
// (r: any) => r.id == levelId.value
|
||||
// );
|
||||
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
|
||||
// (r: any) => r.id == positionPathId.value
|
||||
// );
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileEduId(profileId.value), {
|
||||
id: id.value,
|
||||
// educationLevel: filter[0].name,
|
||||
educationLevelId: levelId.value,
|
||||
positionPathId: positionPathId.value,
|
||||
institute: institute.value,
|
||||
degree: degree.value,
|
||||
field: field.value,
|
||||
gpa: gpa.value,
|
||||
country: country.value,
|
||||
duration: duration.value,
|
||||
durationYear: durationYear.value,
|
||||
other: other.value,
|
||||
fundName: fundName.value,
|
||||
finishDate: dateToISO(finishDate.value),
|
||||
startDate: new Date(`${startDate.value}-01-01`),
|
||||
endDate: new Date(`${endDate.value}-01-01`),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
header="ข้อมูลที่อยู่"
|
||||
icon="mdi-map-marker"
|
||||
:save="saveData"
|
||||
:history="true"
|
||||
:history="!statusAdd()"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="refreshData"
|
||||
:historyClick="clickHistory"
|
||||
:addEmployee="statusAdd()"
|
||||
/>
|
||||
<q-form ref="myform">
|
||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
|
|
@ -311,6 +312,10 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -507,8 +512,28 @@ const visibleColumnsHistory = ref<String[]>([
|
|||
onMounted(async () => {
|
||||
await getNewData();
|
||||
emit("update:statusEdit", false);
|
||||
defaultAdd();
|
||||
});
|
||||
|
||||
const statusAdd = () => props.statusAdd;
|
||||
|
||||
const defaultAdd = () => {
|
||||
if (props.statusAdd) {
|
||||
edit.value = props.statusAdd;
|
||||
addressData.value = {
|
||||
address: null,
|
||||
provinceId: null,
|
||||
districtId: null,
|
||||
subdistrictId: null,
|
||||
addressC: null,
|
||||
provinceIdC: null,
|
||||
districtIdC: null,
|
||||
subdistrictIdC: null,
|
||||
same: "0",
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const filterSelector = (val: any, update: Function, refData: string) => {
|
||||
switch (refData) {
|
||||
case "provinceOps":
|
||||
|
|
@ -556,37 +581,39 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
||||
*/
|
||||
const clickHistory = async () => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAdrsHisId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
data.map((e: RequestItemsHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
currentAddress: e.currentAddress,
|
||||
currentDistrict: e.currentDistrict,
|
||||
currentProvince: e.currentProvince,
|
||||
currentSubDistrict: e.currentSubDistrict,
|
||||
currentZipCode: e.currentZipCode,
|
||||
registrationSame: e.registrationSame,
|
||||
registrationAddress: e.registrationAddress,
|
||||
registrationDistrict: e.registrationDistrict,
|
||||
registrationProvince: e.registrationProvince,
|
||||
registrationSubDistrict: e.registrationSubDistrict,
|
||||
registrationZipCode: e.registrationZipCode,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (route.params.id) {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAdrsHisId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
data.map((e: RequestItemsHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
currentAddress: e.currentAddress,
|
||||
currentDistrict: e.currentDistrict,
|
||||
currentProvince: e.currentProvince,
|
||||
currentSubDistrict: e.currentSubDistrict,
|
||||
currentZipCode: e.currentZipCode,
|
||||
registrationSame: e.registrationSame,
|
||||
registrationAddress: e.registrationAddress,
|
||||
registrationDistrict: e.registrationDistrict,
|
||||
registrationProvince: e.registrationProvince,
|
||||
registrationSubDistrict: e.registrationSubDistrict,
|
||||
registrationZipCode: e.registrationZipCode,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const refreshData = async () => {
|
||||
|
|
@ -606,27 +633,29 @@ const getNewData = async () => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAdrsId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
const data: ResponseObject = res.data.result;
|
||||
addressData.value.address = data.registrationAddress;
|
||||
addressData.value.addressC = data.currentAddress;
|
||||
addressData.value.districtId = data.registrationDistrictId;
|
||||
addressData.value.districtIdC = data.currentDistrictId;
|
||||
addressData.value.provinceId = data.registrationProvinceId;
|
||||
addressData.value.provinceIdC = data.currentProvinceId;
|
||||
addressData.value.subdistrictId = data.registrationSubDistrictId;
|
||||
addressData.value.subdistrictIdC = data.currentSubDistrictId;
|
||||
addressData.value.same = data.registrationSame ? "1" : "0";
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
if (route.params.id) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAdrsId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
const data: ResponseObject = res.data.result;
|
||||
addressData.value.address = data.registrationAddress;
|
||||
addressData.value.addressC = data.currentAddress;
|
||||
addressData.value.districtId = data.registrationDistrictId;
|
||||
addressData.value.districtIdC = data.currentDistrictId;
|
||||
addressData.value.provinceId = data.registrationProvinceId;
|
||||
addressData.value.provinceIdC = data.currentProvinceId;
|
||||
addressData.value.subdistrictId = data.registrationSubDistrictId;
|
||||
addressData.value.subdistrictIdC = data.currentSubDistrictId;
|
||||
addressData.value.same = data.registrationSame ? "1" : "0";
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const editData = async () => {
|
||||
|
|
@ -676,12 +705,34 @@ const editData = async () => {
|
|||
const saveData = async () => {
|
||||
await myform.value.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
await editData();
|
||||
if (props.statusAdd) {
|
||||
await addData();
|
||||
} else {
|
||||
await editData();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .put(config.API.profileInforId(route.params.id.toString()), body)
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// edit.value = false;
|
||||
// emit("update:statusEdit", false);
|
||||
// await fetchData();
|
||||
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
// });
|
||||
};
|
||||
|
||||
const selectProvince = async (e: string | null, name: string) => {
|
||||
if (e != null) {
|
||||
if (name == "1") {
|
||||
|
|
|
|||
|
|
@ -285,6 +285,10 @@ const props = defineProps({
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
|
|
@ -316,7 +320,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขใบอ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -484,31 +490,33 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileCertId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
certificateNo: e.certificateNo,
|
||||
issuer: e.issuer,
|
||||
issueDate: new Date(e.issueDate),
|
||||
expireDate: new Date(e.expireDate),
|
||||
certificateType: e.certificateType,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileCertId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
certificateNo: e.certificateNo,
|
||||
issuer: e.issuer,
|
||||
issueDate: new Date(e.issueDate),
|
||||
expireDate: new Date(e.expireDate),
|
||||
certificateType: e.certificateType,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -595,26 +603,28 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileCertId(profileId.value), {
|
||||
id: id.value,
|
||||
certificateNo: certificateNo.value,
|
||||
issuer: issuer.value,
|
||||
issueDate: dateToISO(issueDate.value),
|
||||
expireDate: dateToISO(expireDate.value),
|
||||
certificateType: certificateType.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileCertId(profileId.value), {
|
||||
id: id.value,
|
||||
certificateNo: certificateNo.value,
|
||||
issuer: issuer.value,
|
||||
issueDate: dateToISO(issueDate.value),
|
||||
expireDate: dateToISO(expireDate.value),
|
||||
certificateType: certificateType.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
header="ข้อมูลครอบครัว"
|
||||
icon="mdi-account-group"
|
||||
:save="saveData"
|
||||
:history="true"
|
||||
:history="!statusAdd()"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="refreshData"
|
||||
:historyClick="historyData"
|
||||
:addEmployee="statusAdd()"
|
||||
/>
|
||||
<q-form ref="myform" class="col-12">
|
||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
|
|
@ -784,6 +785,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -835,8 +840,37 @@ onMounted(async () => {
|
|||
await fetchPrefix();
|
||||
await fetchData();
|
||||
emit("update:statusEdit", false);
|
||||
defaultAdd();
|
||||
});
|
||||
|
||||
const statusAdd = () => props.statusAdd;
|
||||
|
||||
const defaultAdd = () => {
|
||||
if (props.statusAdd) {
|
||||
edit.value = props.statusAdd;
|
||||
familyData.value = {
|
||||
prefixC: null,
|
||||
prefixIdC: null,
|
||||
firstnameC: null,
|
||||
lastnameC: null,
|
||||
lastnameCOld: null,
|
||||
occupationC: null,
|
||||
prefixM: null,
|
||||
prefixIdM: null,
|
||||
firstnameM: null,
|
||||
lastnameM: null,
|
||||
occupationM: null,
|
||||
prefixF: null,
|
||||
prefixIdF: null,
|
||||
firstnameF: null,
|
||||
lastnameF: null,
|
||||
occupationF: null,
|
||||
same: "0",
|
||||
childrens: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const historyData = async () => {
|
||||
await fetchHistory();
|
||||
};
|
||||
|
|
@ -955,53 +989,55 @@ const fetchHistory = async () => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileFamiId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
const data: ResponseObject = res.data.result;
|
||||
familyData.value.prefixC = "";
|
||||
familyData.value.prefixIdC = data.couplePrefixId;
|
||||
familyData.value.firstnameC = data.coupleFirstName;
|
||||
familyData.value.lastnameC = data.coupleLastName;
|
||||
familyData.value.lastnameCOld = data.coupleLastNameOld;
|
||||
familyData.value.occupationC = data.coupleCareer;
|
||||
familyData.value.prefixM = "";
|
||||
familyData.value.prefixIdM = data.fatherPrefixId;
|
||||
if (route.params.id) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileFamiId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
const data: ResponseObject = res.data.result;
|
||||
familyData.value.prefixC = "";
|
||||
familyData.value.prefixIdC = data.couplePrefixId;
|
||||
familyData.value.firstnameC = data.coupleFirstName;
|
||||
familyData.value.lastnameC = data.coupleLastName;
|
||||
familyData.value.lastnameCOld = data.coupleLastNameOld;
|
||||
familyData.value.occupationC = data.coupleCareer;
|
||||
familyData.value.prefixM = "";
|
||||
familyData.value.prefixIdM = data.fatherPrefixId;
|
||||
|
||||
familyData.value.firstnameM = data.fatherFirstName;
|
||||
familyData.value.lastnameM = data.fatherLastName;
|
||||
familyData.value.occupationM = data.fatherCareer;
|
||||
familyData.value.prefixF = "";
|
||||
familyData.value.prefixIdF = data.motherPrefixId;
|
||||
familyData.value.firstnameM = data.fatherFirstName;
|
||||
familyData.value.lastnameM = data.fatherLastName;
|
||||
familyData.value.occupationM = data.fatherCareer;
|
||||
familyData.value.prefixF = "";
|
||||
familyData.value.prefixIdF = data.motherPrefixId;
|
||||
|
||||
familyData.value.firstnameF = data.motherFirstName;
|
||||
familyData.value.lastnameF = data.motherLastName;
|
||||
familyData.value.occupationF = data.motherCareer;
|
||||
familyData.value.same = data.couple ? "1" : "0";
|
||||
familyData.value.firstnameF = data.motherFirstName;
|
||||
familyData.value.lastnameF = data.motherLastName;
|
||||
familyData.value.occupationF = data.motherCareer;
|
||||
familyData.value.same = data.couple ? "1" : "0";
|
||||
|
||||
if (data.childrens.length > 0) {
|
||||
let dataChild: childrenFamily[] = [];
|
||||
data.childrens.map((row: childrenFamily, index: number) => {
|
||||
dataChild.push({
|
||||
id: `${index + 1}`,
|
||||
childrenPrefixId: row.childrenPrefixId,
|
||||
childrenFirstName: row.childrenFirstName,
|
||||
childrenLastName: row.childrenLastName,
|
||||
childrenCareer: row.childrenCareer,
|
||||
if (data.childrens.length > 0) {
|
||||
let dataChild: childrenFamily[] = [];
|
||||
data.childrens.map((row: childrenFamily, index: number) => {
|
||||
dataChild.push({
|
||||
id: `${index + 1}`,
|
||||
childrenPrefixId: row.childrenPrefixId,
|
||||
childrenFirstName: row.childrenFirstName,
|
||||
childrenLastName: row.childrenLastName,
|
||||
childrenCareer: row.childrenCareer,
|
||||
});
|
||||
});
|
||||
});
|
||||
familyData.value.childrens = dataChild;
|
||||
} else {
|
||||
familyData.value.childrens = [];
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
familyData.value.childrens = dataChild;
|
||||
} else {
|
||||
familyData.value.childrens = [];
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const editData = async () => {
|
||||
|
|
@ -1040,10 +1076,32 @@ const editData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .put(config.API.profileInforId(route.params.id.toString()), body)
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// edit.value = false;
|
||||
// emit("update:statusEdit", false);
|
||||
// await fetchData();
|
||||
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
// });
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
await myform.value?.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
await editData();
|
||||
if (props.statusAdd) {
|
||||
await addData();
|
||||
} else {
|
||||
await editData();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
header="ข้อมูลส่วนตัว"
|
||||
icon="mdi-account"
|
||||
:save="saveData"
|
||||
:history="true"
|
||||
:history="!statusAdd()"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="onCancel"
|
||||
:historyClick="clickHistory"
|
||||
:addEmployee="statusAdd()"
|
||||
/>
|
||||
<q-form ref="myform" class="col-12">
|
||||
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-sm">
|
||||
|
|
@ -438,6 +439,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -692,8 +697,36 @@ onMounted(async () => {
|
|||
await fetchPerson();
|
||||
await fetchData();
|
||||
emit("update:statusEdit", false);
|
||||
defaultAdd();
|
||||
});
|
||||
|
||||
const statusAdd = () => props.statusAdd;
|
||||
|
||||
const defaultAdd = () => {
|
||||
if (props.statusAdd) {
|
||||
edit.value = props.statusAdd;
|
||||
informaData.value = {
|
||||
cardid: null,
|
||||
age: null,
|
||||
prefix: null,
|
||||
prefixId: null,
|
||||
firstname: null,
|
||||
lastname: null,
|
||||
birthDate: null,
|
||||
genderId: null,
|
||||
bloodId: null,
|
||||
nationality: null,
|
||||
ethnicity: null,
|
||||
statusId: null,
|
||||
religionId: null,
|
||||
tel: null,
|
||||
employeeType: null,
|
||||
employeeClass: null,
|
||||
profileType: null,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const onCancel = async () => {
|
||||
if (myform.value != null) {
|
||||
myform.value.reset();
|
||||
|
|
@ -821,50 +854,52 @@ const checkCitizen = async (id: string) => {
|
|||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
||||
*/
|
||||
const clickHistory = async () => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileInforHisId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
data.map((e: RequestItemsHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
citizenId: e.citizenId,
|
||||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
birthDate: new Date(e.birthDate),
|
||||
gender: e.gender,
|
||||
relationship: e.relationship,
|
||||
bloodGroup: e.bloodGroup,
|
||||
nationality: e.nationality,
|
||||
race: e.race,
|
||||
religion: e.religion,
|
||||
telephoneNumber: e.telephoneNumber,
|
||||
employeeType:
|
||||
e.employeeType == "gov"
|
||||
? "งบประมาณเงินอุดหนุนรัฐบาล"
|
||||
: e.employeeType == "bkk"
|
||||
? "งบประมาณกรุงเทพมหานคร"
|
||||
: "-",
|
||||
employeeClass:
|
||||
e.employeeClass == "perm"
|
||||
? "ลูกจ้างประจำ"
|
||||
: e.employeeClass == "temp"
|
||||
? "ลูกจ้างชั่วคราว"
|
||||
: "-",
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (route.params.id) {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileInforHisId(route.params.id.toString()))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
data.map((e: RequestItemsHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
citizenId: e.citizenId,
|
||||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
birthDate: new Date(e.birthDate),
|
||||
gender: e.gender,
|
||||
relationship: e.relationship,
|
||||
bloodGroup: e.bloodGroup,
|
||||
nationality: e.nationality,
|
||||
race: e.race,
|
||||
religion: e.religion,
|
||||
telephoneNumber: e.telephoneNumber,
|
||||
employeeType:
|
||||
e.employeeType == "gov"
|
||||
? "งบประมาณเงินอุดหนุนรัฐบาล"
|
||||
: e.employeeType == "bkk"
|
||||
? "งบประมาณกรุงเทพมหานคร"
|
||||
: "-",
|
||||
employeeClass:
|
||||
e.employeeClass == "perm"
|
||||
? "ลูกจ้างประจำ"
|
||||
: e.employeeClass == "temp"
|
||||
? "ลูกจ้างชั่วคราว"
|
||||
: "-",
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const filterSelector = (val: any, update: Function, refData: string) => {
|
||||
|
|
@ -961,44 +996,49 @@ const calRetire = async (birth: Date) => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileInforId(route.params.id.toString()))
|
||||
.then(async (res: any) => {
|
||||
const data: ResponseObject = res.data.result;
|
||||
defaultCitizenData.value = data.citizenId;
|
||||
informaData.value.cardid = data.citizenId;
|
||||
informaData.value.prefix = "";
|
||||
informaData.value.prefixId = data.prefixId;
|
||||
informaData.value.firstname = data.firstName;
|
||||
informaData.value.lastname = data.lastName;
|
||||
informaData.value.birthDate = new Date(data.birthDate);
|
||||
informaData.value.genderId = data.genderId;
|
||||
informaData.value.bloodId = data.bloodGroupId;
|
||||
informaData.value.nationality = data.nationality;
|
||||
informaData.value.ethnicity = data.race;
|
||||
informaData.value.statusId = data.relationshipId;
|
||||
informaData.value.religionId = data.religionId;
|
||||
informaData.value.tel = data.telephoneNumber;
|
||||
informaData.value.age = data.age;
|
||||
informaData.value.employeeType = data.employeeType;
|
||||
informaData.value.employeeClass = data.employeeClass;
|
||||
informaData.value.profileType = data.profileType;
|
||||
dateBefore.value = new Date(data.birthDate);
|
||||
same.value = data.changeName == true ? "1" : "0";
|
||||
await calRetire(new Date(dateToISO(new Date(data.birthDate))));
|
||||
if (data.profileType == "officer" && columnsHistory.value.length >= 15) {
|
||||
columnsHistory.value.splice(13, 1);
|
||||
columnsHistory.value.splice(12, 1);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
// loaderPage(false);
|
||||
await props.fetchDataProfile();
|
||||
});
|
||||
if (route.params.id) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileInforId(route.params.id.toString()))
|
||||
.then(async (res: any) => {
|
||||
const data: ResponseObject = res.data.result;
|
||||
defaultCitizenData.value = data.citizenId;
|
||||
informaData.value.cardid = data.citizenId;
|
||||
informaData.value.prefix = "";
|
||||
informaData.value.prefixId = data.prefixId;
|
||||
informaData.value.firstname = data.firstName;
|
||||
informaData.value.lastname = data.lastName;
|
||||
informaData.value.birthDate = new Date(data.birthDate);
|
||||
informaData.value.genderId = data.genderId;
|
||||
informaData.value.bloodId = data.bloodGroupId;
|
||||
informaData.value.nationality = data.nationality;
|
||||
informaData.value.ethnicity = data.race;
|
||||
informaData.value.statusId = data.relationshipId;
|
||||
informaData.value.religionId = data.religionId;
|
||||
informaData.value.tel = data.telephoneNumber;
|
||||
informaData.value.age = data.age;
|
||||
informaData.value.employeeType = data.employeeType;
|
||||
informaData.value.employeeClass = data.employeeClass;
|
||||
informaData.value.profileType = data.profileType;
|
||||
dateBefore.value = new Date(data.birthDate);
|
||||
same.value = data.changeName == true ? "1" : "0";
|
||||
await calRetire(new Date(dateToISO(new Date(data.birthDate))));
|
||||
if (
|
||||
data.profileType == "officer" &&
|
||||
columnsHistory.value.length >= 15
|
||||
) {
|
||||
columnsHistory.value.splice(13, 1);
|
||||
columnsHistory.value.splice(12, 1);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
// loaderPage(false);
|
||||
await props.fetchDataProfile();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const editData = async () => {
|
||||
|
|
@ -1039,11 +1079,33 @@ const editData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .put(config.API.profileInforId(route.params.id.toString()), body)
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// edit.value = false;
|
||||
// emit("update:statusEdit", false);
|
||||
// await fetchData();
|
||||
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
// });
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
if (myform.value != null) {
|
||||
await myform.value.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
await editData();
|
||||
if (props.statusAdd) {
|
||||
await addData();
|
||||
} else {
|
||||
await editData();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -362,7 +362,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const file = ref<string | null>(null);
|
||||
const fileUpload = ref<any>([]);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
|
|
@ -538,32 +540,34 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileChangeNameId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
prefix: e.prefix,
|
||||
prefixId: e.prefixId,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
status: e.status,
|
||||
file: e.file,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileChangeNameId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
prefix: e.prefix,
|
||||
prefixId: e.prefixId,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
status: e.status,
|
||||
file: e.file,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -665,44 +669,19 @@ const clickSave = async () => {
|
|||
if (modalEdit.value) {
|
||||
await editData();
|
||||
} else {
|
||||
await saveData();
|
||||
await checkSave();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
const checkSave = async () => {
|
||||
if (fileUpload.value.length > 0) {
|
||||
const blob = fileUpload.value.slice(0, fileUpload.value[0].size);
|
||||
const newFile = new File(blob, nameFile.value, {
|
||||
type: fileUpload.value[0].type,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("", newFile);
|
||||
if (prefixId.value != undefined)
|
||||
formData.append("prefixId", prefixId.value);
|
||||
if (firstName.value != undefined)
|
||||
formData.append("firstName", firstName.value);
|
||||
if (lastName.value != undefined)
|
||||
formData.append("lastName", lastName.value);
|
||||
if (status.value != undefined) formData.append("status", status.value);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileChangeNameId(profileId.value), formData)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await props.fetchDataInformation();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
await saveData();
|
||||
} else {
|
||||
await saveDataEmployee();
|
||||
}
|
||||
} else {
|
||||
dialogMessage(
|
||||
$q,
|
||||
|
|
@ -718,6 +697,41 @@ const saveData = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
const blob = fileUpload.value.slice(0, fileUpload.value[0].size);
|
||||
const newFile = new File(blob, nameFile.value, {
|
||||
type: fileUpload.value[0].type,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("", newFile);
|
||||
if (prefixId.value != undefined) formData.append("prefixId", prefixId.value);
|
||||
if (firstName.value != undefined)
|
||||
formData.append("firstName", firstName.value);
|
||||
if (lastName.value != undefined) formData.append("lastName", lastName.value);
|
||||
if (status.value != undefined) formData.append("status", status.value);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileChangeNameId(profileId.value), formData)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await props.fetchDataInformation();
|
||||
});
|
||||
};
|
||||
|
||||
const saveDataEmployee = async () => {
|
||||
console.log("saveDataEmployee");
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
size="12px"
|
||||
flat
|
||||
round
|
||||
v-if="edit"
|
||||
v-if="edit && !addEmployee"
|
||||
:color="!edit ? 'grey-7' : 'red'"
|
||||
@click="ClickCancel"
|
||||
icon="mdi-undo"
|
||||
|
|
@ -125,6 +125,7 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
|
||||
disable: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
|
|
@ -157,6 +158,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
addEmployee: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:edit"]);
|
||||
|
|
|
|||
|
|
@ -454,7 +454,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขเคร
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -816,38 +818,40 @@ const fetchInsignia = async () => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileInsignId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
insignia: e.insignia,
|
||||
insigniaId: e.insigniaId,
|
||||
insigniaType: e.insigniaType,
|
||||
year: e.year,
|
||||
no: e.no,
|
||||
issue: e.issue,
|
||||
volumeNo: e.volumeNo,
|
||||
volume: e.volume,
|
||||
section: e.section,
|
||||
page: e.page,
|
||||
receiveDate: new Date(e.receiveDate),
|
||||
dateAnnounce: new Date(e.dateAnnounce),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileInsignId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
insignia: e.insignia,
|
||||
insigniaId: e.insigniaId,
|
||||
insigniaType: e.insigniaType,
|
||||
year: e.year,
|
||||
no: e.no,
|
||||
issue: e.issue,
|
||||
volumeNo: e.volumeNo,
|
||||
volume: e.volume,
|
||||
section: e.section,
|
||||
page: e.page,
|
||||
receiveDate: new Date(e.receiveDate),
|
||||
dateAnnounce: new Date(e.dateAnnounce),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -940,32 +944,34 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileInsignId(profileId.value), {
|
||||
id: id.value,
|
||||
insigniaId: insigniaId.value,
|
||||
insigniaType: insigniaType.value,
|
||||
year: year.value,
|
||||
no: no.value,
|
||||
issue: issue.value,
|
||||
volumeNo: volumeNo.value,
|
||||
volume: volume.value,
|
||||
section: section.value,
|
||||
page: page.value,
|
||||
receiveDate: dateToISO(receiveDate.value),
|
||||
dateAnnounce: dateToISO(dateAnnounce.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileInsignId(profileId.value), {
|
||||
id: id.value,
|
||||
insigniaId: insigniaId.value,
|
||||
insigniaType: insigniaType.value,
|
||||
year: year.value,
|
||||
no: no.value,
|
||||
issue: issue.value,
|
||||
volumeNo: volumeNo.value,
|
||||
volume: volume.value,
|
||||
section: section.value,
|
||||
page: page.value,
|
||||
receiveDate: dateToISO(receiveDate.value),
|
||||
dateAnnounce: dateToISO(dateAnnounce.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -263,11 +263,7 @@
|
|||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
|
@ -280,9 +276,7 @@
|
|||
class="table_ellipsis"
|
||||
>
|
||||
{{
|
||||
col.value == null
|
||||
? ""
|
||||
: col.value.toLocaleString("en-US")
|
||||
col.value == null ? "" : col.value.toLocaleString("en-US")
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
|
|
@ -442,7 +436,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขการ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filterTotal = ref<string>("");
|
||||
const rowsTotal = ref<RequestItemsTotalObject[]>([]); //select data history
|
||||
|
|
@ -712,34 +708,36 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
rows.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
typeLeave: e.typeLeave,
|
||||
dateStartLeave: new Date(e.dateStartLeave),
|
||||
dateEndLeave: new Date(e.dateEndLeave),
|
||||
numLeave: e.numLeave,
|
||||
sumLeave: e.sumLeave,
|
||||
totalLeave: e.totalLeave,
|
||||
status: e.status,
|
||||
reason: e.reason,
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
if (profileId.value !== "") {
|
||||
rows.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
typeLeave: e.typeLeave,
|
||||
dateStartLeave: new Date(e.dateStartLeave),
|
||||
dateEndLeave: new Date(e.dateEndLeave),
|
||||
numLeave: e.numLeave,
|
||||
sumLeave: e.sumLeave,
|
||||
totalLeave: e.totalLeave,
|
||||
status: e.status,
|
||||
reason: e.reason,
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||
|
|
@ -960,30 +958,31 @@ const clickSave = async () => {
|
|||
// * บันทึกเพิ่มข้อมูล
|
||||
// */
|
||||
const saveData = async () => {
|
||||
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
|
||||
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileLeaveId(profileId.value), {
|
||||
dateStartLeave: dateToISO(dateRange.value[0]),
|
||||
dateEndLeave: dateToISO(dateRange.value[1]),
|
||||
numLeave: numLeave.value,
|
||||
sumLeave: numUsedLeave.value,
|
||||
totalLeave: sum,
|
||||
status: statLeave.value,
|
||||
reason: reason.value,
|
||||
typeLeaveId: typeLeave.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileLeaveId(profileId.value), {
|
||||
dateStartLeave: dateToISO(dateRange.value[0]),
|
||||
dateEndLeave: dateToISO(dateRange.value[1]),
|
||||
numLeave: numLeave.value,
|
||||
sumLeave: numUsedLeave.value,
|
||||
totalLeave: sum,
|
||||
status: statLeave.value,
|
||||
reason: reason.value,
|
||||
typeLeaveId: typeLeave.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// /**
|
||||
|
|
@ -1182,28 +1181,30 @@ const addData = async () => {
|
|||
* @param row ข้อมูล row ที่ดูประวัติการแก้ไข
|
||||
*/
|
||||
const clickTotal = async () => {
|
||||
rowsTotal.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveTotalId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
data.map((e: ResponseTotalObject) => {
|
||||
rowsTotal.value.push({
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
totalLeave: e.totalLeave,
|
||||
limitLeave: e.limitLeave,
|
||||
remainLeave: e.remainLeave,
|
||||
typeLeave: e.typeLeave,
|
||||
if (profileId.value !== "") {
|
||||
rowsTotal.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveTotalId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
data.map((e: ResponseTotalObject) => {
|
||||
rowsTotal.value.push({
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
totalLeave: e.totalLeave,
|
||||
limitLeave: e.limitLeave,
|
||||
remainLeave: e.remainLeave,
|
||||
typeLeave: e.typeLeave,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// /**
|
||||
|
|
|
|||
|
|
@ -213,7 +213,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขอื่
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -302,28 +304,30 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileOtherId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
date: new Date(e.date),
|
||||
detail: e.detail,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileOtherId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
date: new Date(e.date),
|
||||
detail: e.detail,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -407,23 +411,25 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileOtherId(profileId.value), {
|
||||
id: id.value,
|
||||
date: date.value,
|
||||
detail: detail.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileOtherId(profileId.value), {
|
||||
id: id.value,
|
||||
date: date.value,
|
||||
detail: detail.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -486,12 +486,8 @@
|
|||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="Retire"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-btn unelevated label="บันทึก" color="public" @click="Retire"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
|
|
@ -500,35 +496,75 @@
|
|||
<full-loader :visibility="loader"></full-loader>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ref, onMounted, defineAsyncComponent } from "vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import EducationVue from "@/modules/04_registry/components/Education.vue";
|
||||
import TrainVue from "@/modules/04_registry/components/Train.vue";
|
||||
import InsigniaVue from "@/modules/04_registry/components/Insignia.vue";
|
||||
import CoinedVue from "@/modules/04_registry/components/Coin.vue";
|
||||
import AssessmentVue from "@/modules/04_registry/components/Assessment.vue";
|
||||
import SalaryVue from "@/modules/04_registry/components/Salary.vue";
|
||||
import SalaryEmployeeVue from "@/modules/04_registry/components/SalaryEmployee.vue";
|
||||
import DisciplineVue from "@/modules/04_registry/components/Discipline.vue";
|
||||
import LeaveVue from "@/modules/04_registry/components/Leave.vue";
|
||||
import TalentVue from "@/modules/04_registry/components/Talent.vue";
|
||||
import WorkVue from "@/modules/04_registry/components/Work.vue";
|
||||
import RecordVue from "@/modules/04_registry/components/Record.vue";
|
||||
import OtherVue from "@/modules/04_registry/components/Other.vue";
|
||||
import DocumentVue from "@/modules/04_registry/components/Document.vue";
|
||||
import Certicate from "@/modules/04_registry/components/Information/Certicate.vue";
|
||||
import Information from "@/modules/04_registry/components/Information/Information.vue";
|
||||
import Government from "@/modules/04_registry/components/Information/Government.vue";
|
||||
import Address from "@/modules/04_registry/components/Information/Address.vue";
|
||||
import Family from "@/modules/04_registry/components/Information/Family.vue";
|
||||
|
||||
import OldName from "@/modules/04_registry/components/Information/OldName.vue";
|
||||
import type { DataOption } from "@/modules/04_registry/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const EducationVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Education.vue")
|
||||
);
|
||||
const TrainVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Train.vue")
|
||||
);
|
||||
const InsigniaVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Insignia.vue")
|
||||
);
|
||||
const CoinedVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Coin.vue")
|
||||
);
|
||||
const AssessmentVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Assessment.vue")
|
||||
);
|
||||
const SalaryVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Salary.vue")
|
||||
);
|
||||
const SalaryEmployeeVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/SalaryEmployee.vue")
|
||||
);
|
||||
const DisciplineVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Discipline.vue")
|
||||
);
|
||||
const LeaveVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Leave.vue")
|
||||
);
|
||||
const TalentVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Talent.vue")
|
||||
);
|
||||
const WorkVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Work.vue")
|
||||
);
|
||||
const RecordVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Record.vue")
|
||||
);
|
||||
const OtherVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Other.vue")
|
||||
);
|
||||
const DocumentVue = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Document.vue")
|
||||
);
|
||||
const Certicate = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Information/Certicate.vue")
|
||||
);
|
||||
const Information = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Information/Information.vue")
|
||||
);
|
||||
const Government = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Information/Government.vue")
|
||||
);
|
||||
const Address = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Information/Address.vue")
|
||||
);
|
||||
const Family = defineAsyncComponent(
|
||||
() => import("@/modules/04_registry/components/Information/Family.vue")
|
||||
);
|
||||
|
||||
const $q = useQuasar();
|
||||
const store = useDataStore();
|
||||
const { changeTab, loaderPage } = store;
|
||||
|
|
|
|||
|
|
@ -234,7 +234,9 @@ const tittleHistory = ref<string>(
|
|||
);
|
||||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
|
|
@ -351,29 +353,31 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileNopaidId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
date: new Date(e.date),
|
||||
detail: e.detail,
|
||||
reference: e.reference,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileNopaidId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
date: new Date(e.date),
|
||||
detail: e.detail,
|
||||
reference: e.reference,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -458,24 +462,26 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileNopaidId(profileId.value), {
|
||||
id: id.value,
|
||||
date: dateToISO(date.value),
|
||||
detail: detail.value,
|
||||
reference: reference.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileNopaidId(profileId.value), {
|
||||
id: id.value,
|
||||
date: dateToISO(date.value),
|
||||
detail: detail.value,
|
||||
reference: reference.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -500,6 +500,10 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
|
|
@ -822,7 +826,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขตำแ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<ResponseObjectEmployee[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -1328,45 +1334,47 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
|
|||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileSalaryEmployeeId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObjectEmployee) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
date: new Date(e.date),
|
||||
amount: e.amount,
|
||||
positionSalaryAmount: e.positionSalaryAmount,
|
||||
mouthSalaryAmount: e.mouthSalaryAmount,
|
||||
oc: e.oc,
|
||||
ocId: e.ocId,
|
||||
posNo: e.posNo,
|
||||
posNoId: e.posNoId,
|
||||
posNoEmployee: e.posNoEmployee,
|
||||
positionEmployeeGroup: e.positionEmployeeGroup,
|
||||
positionEmployeeGroupId: e.positionEmployeeGroupId,
|
||||
positionEmployeeLevel: e.positionEmployeeLevel,
|
||||
positionEmployeeLevelId: e.positionEmployeeLevelId,
|
||||
positionEmployeePosition: e.positionEmployeePosition,
|
||||
positionEmployeePositionId: e.positionEmployeePositionId,
|
||||
positionEmployeePositionSide: e.positionEmployeePositionSide,
|
||||
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
|
||||
salaryClass: e.salaryClass,
|
||||
salaryRef: e.salaryRef,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
await http
|
||||
.get(config.API.profileSalaryEmployeeId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObjectEmployee) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
date: new Date(e.date),
|
||||
amount: e.amount,
|
||||
positionSalaryAmount: e.positionSalaryAmount,
|
||||
mouthSalaryAmount: e.mouthSalaryAmount,
|
||||
oc: e.oc,
|
||||
ocId: e.ocId,
|
||||
posNo: e.posNo,
|
||||
posNoId: e.posNoId,
|
||||
posNoEmployee: e.posNoEmployee,
|
||||
positionEmployeeGroup: e.positionEmployeeGroup,
|
||||
positionEmployeeGroupId: e.positionEmployeeGroupId,
|
||||
positionEmployeeLevel: e.positionEmployeeLevel,
|
||||
positionEmployeeLevelId: e.positionEmployeeLevelId,
|
||||
positionEmployeePosition: e.positionEmployeePosition,
|
||||
positionEmployeePositionId: e.positionEmployeePositionId,
|
||||
positionEmployeePositionSide: e.positionEmployeePositionSide,
|
||||
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
|
||||
salaryClass: e.salaryClass,
|
||||
salaryRef: e.salaryRef,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const fetchPositionNumber = async (id: string) => {
|
||||
|
|
@ -1548,33 +1556,35 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileSalaryEmployeeId(profileId.value), {
|
||||
amount: amount.value,
|
||||
date: dateToISO(date.value),
|
||||
positionSalaryAmount: positionSalaryAmount.value,
|
||||
mouthSalaryAmount: mouthSalaryAmount.value,
|
||||
ocId: agencyId.value,
|
||||
// posNoId: posNoId.value,
|
||||
posNoEmployee: posNoEmployee.value,
|
||||
positionEmployeeGroupId: employeeGroupId.value,
|
||||
positionEmployeeLevelId: employeeLevelId.value,
|
||||
positionEmployeePositionId: employeePositionId.value,
|
||||
positionEmployeePositionSideId: employeePositionSideId.value,
|
||||
salaryClass: salaryClass.value,
|
||||
salaryRef: salaryRef.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileSalaryEmployeeId(profileId.value), {
|
||||
amount: amount.value,
|
||||
date: dateToISO(date.value),
|
||||
positionSalaryAmount: positionSalaryAmount.value,
|
||||
mouthSalaryAmount: mouthSalaryAmount.value,
|
||||
ocId: agencyId.value,
|
||||
// posNoId: posNoId.value,
|
||||
posNoEmployee: posNoEmployee.value,
|
||||
positionEmployeeGroupId: employeeGroupId.value,
|
||||
positionEmployeeLevelId: employeeLevelId.value,
|
||||
positionEmployeePositionId: employeePositionId.value,
|
||||
positionEmployeePositionSideId: employeePositionSideId.value,
|
||||
salaryClass: salaryClass.value,
|
||||
salaryRef: salaryRef.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -314,7 +314,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขควา
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -506,32 +508,34 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAbiliId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
field: e.field,
|
||||
detail: e.detail,
|
||||
remark: e.remark,
|
||||
dateStart: new Date(e.dateStart),
|
||||
dateEnd: new Date(e.dateEnd),
|
||||
reference: e.reference,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileAbiliId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
field: e.field,
|
||||
detail: e.detail,
|
||||
remark: e.remark,
|
||||
dateStart: new Date(e.dateStart),
|
||||
dateEnd: new Date(e.dateEnd),
|
||||
reference: e.reference,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -619,27 +623,29 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileAbiliId(profileId.value), {
|
||||
id: id.value,
|
||||
field: field.value,
|
||||
detail: detail.value,
|
||||
remark: remark.value,
|
||||
dateStart: dateToISO(dateStart.value),
|
||||
dateEnd: dateToISO(dateEnd.value),
|
||||
reference: reference.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileAbiliId(profileId.value), {
|
||||
id: id.value,
|
||||
field: field.value,
|
||||
detail: detail.value,
|
||||
remark: remark.value,
|
||||
dateStart: dateToISO(dateStart.value),
|
||||
dateEnd: dateToISO(dateEnd.value),
|
||||
reference: reference.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -459,7 +459,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขการ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -751,36 +753,38 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileTrainId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
topic: e.topic,
|
||||
yearly: e.yearly,
|
||||
place: e.place,
|
||||
duration: e.duration,
|
||||
department: e.department,
|
||||
numberOrder: e.numberOrder,
|
||||
dateOrder: e.dateOrder,
|
||||
startDate: new Date(e.startDate),
|
||||
endDate: new Date(e.endDate),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileTrainId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
topic: e.topic,
|
||||
yearly: e.yearly,
|
||||
place: e.place,
|
||||
duration: e.duration,
|
||||
department: e.department,
|
||||
numberOrder: e.numberOrder,
|
||||
dateOrder: e.dateOrder,
|
||||
startDate: new Date(e.startDate),
|
||||
endDate: new Date(e.endDate),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -872,31 +876,33 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileTrainId(profileId.value), {
|
||||
id: id.value,
|
||||
name: name.value,
|
||||
topic: topic.value,
|
||||
yearly: yearly.value,
|
||||
place: place.value,
|
||||
duration: duration.value,
|
||||
department: department.value,
|
||||
numberOrder: numberOrder.value,
|
||||
dateOrder: dateOrder.value,
|
||||
startDate: dateToISO(startDate.value),
|
||||
endDate: dateToISO(endDate.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileTrainId(profileId.value), {
|
||||
id: id.value,
|
||||
name: name.value,
|
||||
topic: topic.value,
|
||||
yearly: yearly.value,
|
||||
place: place.value,
|
||||
duration: duration.value,
|
||||
department: department.value,
|
||||
numberOrder: numberOrder.value,
|
||||
dateOrder: dateOrder.value,
|
||||
startDate: dateToISO(startDate.value),
|
||||
endDate: dateToISO(endDate.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -283,7 +283,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขปฏิ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -426,30 +428,32 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileDutyId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
dateStart: new Date(e.dateStart),
|
||||
dateEnd: new Date(e.dateEnd),
|
||||
detail: e.detail,
|
||||
reference: e.reference,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileDutyId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
dateStart: new Date(e.dateStart),
|
||||
dateEnd: new Date(e.dateEnd),
|
||||
detail: e.detail,
|
||||
reference: e.reference,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -535,25 +539,27 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileDutyId(profileId.value), {
|
||||
id: id.value,
|
||||
dateStart: dateToISO(dateStart.value),
|
||||
dateEnd: dateToISO(dateEnd.value),
|
||||
detail: detail.value,
|
||||
reference: reference.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileDutyId(profileId.value), {
|
||||
id: id.value,
|
||||
dateStart: dateToISO(dateStart.value),
|
||||
dateEnd: dateToISO(dateEnd.value),
|
||||
detail: detail.value,
|
||||
reference: reference.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ interface Information {
|
|||
prefixId: string | null;
|
||||
firstname: string | null;
|
||||
lastname: string | null;
|
||||
birthDate: Date;
|
||||
birthDate: Date | null;
|
||||
genderId: string | null;
|
||||
bloodId: string | null;
|
||||
nationality: string | null;
|
||||
|
|
|
|||
|
|
@ -60,8 +60,10 @@ const tittleHistory = ref<string>("ประวัติแก้ไขใบอ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
// const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>('');
|
||||
// const profileId = ref<string>(
|
||||
// route.params.id ? route.params.id.toString() : ""
|
||||
// );
|
||||
const profileId = ref<string>("");
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -226,34 +228,39 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
|||
|
||||
onMounted(async () => {
|
||||
// await fetchData();
|
||||
if (route.params.id) {
|
||||
profileId.value = route.params.id.toString();
|
||||
}
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileCertId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
certificateNo: e.certificateNo,
|
||||
issuer: e.issuer,
|
||||
issueDate: new Date(e.issueDate),
|
||||
expireDate: new Date(e.expireDate),
|
||||
certificateType: e.certificateType,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value != "") {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileCertId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
certificateNo: e.certificateNo,
|
||||
issuer: e.issuer,
|
||||
issueDate: new Date(e.issueDate),
|
||||
expireDate: new Date(e.expireDate),
|
||||
certificateType: e.certificateType,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -340,26 +347,28 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileCertId(profileId.value), {
|
||||
id: id.value,
|
||||
certificateNo: certificateNo.value,
|
||||
issuer: issuer.value,
|
||||
issueDate: dateToISO(issueDate.value),
|
||||
expireDate: dateToISO(expireDate.value),
|
||||
certificateType: certificateType.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileCertId(profileId.value), {
|
||||
id: id.value,
|
||||
certificateNo: certificateNo.value,
|
||||
issuer: issuer.value,
|
||||
issueDate: dateToISO(issueDate.value),
|
||||
expireDate: dateToISO(expireDate.value),
|
||||
certificateType: certificateType.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
/**
|
||||
* Router ระบบทะเบียนประวัติลูกจ้าง (registryEmployee)
|
||||
*/
|
||||
import { defineAsyncComponent } from "vue";
|
||||
|
||||
const Main = () => import("@/modules/08_registryEmployee/views/Main.vue");
|
||||
// const Detail = () =>
|
||||
// import("@/modules/08_registryEmployee/components/Profile.vue");
|
||||
// const Main = () => import("@/modules/08_registryEmployee/views/Main.vue");
|
||||
// const Detail = () => import("@/modules/08_registryEmployee/views/Detail.vue");
|
||||
const Main = defineAsyncComponent(
|
||||
() => import("@/modules/08_registryEmployee/views/Main.vue")
|
||||
);
|
||||
const Detail = defineAsyncComponent(
|
||||
() => import("@/modules/08_registryEmployee/views/Detail.vue")
|
||||
);
|
||||
|
||||
export default [
|
||||
{
|
||||
|
|
@ -23,8 +29,18 @@ export default [
|
|||
// component: Detail,
|
||||
// meta: {
|
||||
// Auth: true,
|
||||
// Key: [9],
|
||||
// Key: [10],
|
||||
// Role: "registryEmployeeDetails",
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: "/registryEmployee/add",
|
||||
name: "registryEmployeeAdd",
|
||||
component: Detail,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11],
|
||||
Role: "registryEmployee",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
1012
src/modules/08_registryEmployee/views/Detail.vue
Normal file
1012
src/modules/08_registryEmployee/views/Detail.vue
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -169,6 +169,7 @@ import { ref, onMounted } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QInput, QForm } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -187,6 +188,7 @@ const $q = useQuasar();
|
|||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogMessage, messageError, showLoader, hideLoader } = mixin;
|
||||
|
||||
const router = useRouter();
|
||||
const myForm = ref<QForm>();
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
|
|
@ -488,6 +490,10 @@ onMounted(async () => {
|
|||
await nodeTree();
|
||||
});
|
||||
|
||||
const next = (id: string) => {
|
||||
router.push(`/registryEmployee/${id}`);
|
||||
};
|
||||
|
||||
const paginationLabel = (start: number, end: number, total: number) => {
|
||||
// if (props.paging == true)
|
||||
// return " " + start + " ใน " + end + " จากจำนวน " + total + " รายการ";
|
||||
|
|
@ -528,7 +534,10 @@ const clickClose = async () => {
|
|||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
modal.value = true;
|
||||
// modal.value = true;
|
||||
|
||||
router.push(`/registryEmployee/add`);
|
||||
// router.push(`/placement/detail`);
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue