บรรจุ ทดลองงาน
This commit is contained in:
parent
a8fdca1138
commit
4cfcc2d018
21 changed files with 113 additions and 199 deletions
|
|
@ -57,6 +57,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -263,7 +264,7 @@ const clickNext = async () => {
|
|||
/**
|
||||
* กดดูข้อมูลต่อไป
|
||||
*/
|
||||
const getData = () => {
|
||||
async function getData() {
|
||||
const row = rows.value[rowIndex.value];
|
||||
certificateNo.value = row.certificateNo;
|
||||
issuer.value = row.issuer;
|
||||
|
|
@ -271,12 +272,12 @@ const getData = () => {
|
|||
expireDate.value = row.expireDate;
|
||||
certificateType.value = row.certificateType;
|
||||
id.value = row.id;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คปุ่มดูข้อมูล ย้อน กับ ต่อไป ว่าต้องแสดงไหม
|
||||
*/
|
||||
const checkRowPage = () => {
|
||||
async function checkRowPage() {
|
||||
editRow.value = false;
|
||||
next.value = true;
|
||||
previous.value = true;
|
||||
|
|
@ -286,7 +287,7 @@ const checkRowPage = () => {
|
|||
if (rowIndex.value - 1 < 0) {
|
||||
previous.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* กดปุ่มแก้ไขใน dialog
|
||||
|
|
@ -302,7 +303,7 @@ const clickEdit = () => {
|
|||
*/
|
||||
const clickAdd = async () => {
|
||||
editRow.value = false;
|
||||
await addData();
|
||||
addData();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -310,9 +311,9 @@ const clickAdd = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
if (modalEdit.value) {
|
||||
await dialogConfirm($q, () => editData());
|
||||
dialogConfirm($q, () => editData());
|
||||
} else {
|
||||
await dialogConfirm($q, () => saveData());
|
||||
dialogConfirm($q, () => saveData());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -326,8 +327,8 @@ const saveData = async () => {
|
|||
id: id.value,
|
||||
certificateNo: certificateNo.value,
|
||||
issuer: issuer.value,
|
||||
issueDate: new Date(issueDate.value),
|
||||
expireDate: new Date(expireDate.value),
|
||||
issueDate: convertDateToAPI(new Date(issueDate.value)),
|
||||
expireDate: convertDateToAPI(new Date(expireDate.value)),
|
||||
certificateType: certificateType.value,
|
||||
})
|
||||
.then(async () => {
|
||||
|
|
@ -353,8 +354,8 @@ const editData = async () => {
|
|||
id: id.value,
|
||||
certificateNo: certificateNo.value,
|
||||
issuer: issuer.value,
|
||||
issueDate: new Date(issueDate.value),
|
||||
expireDate: new Date(expireDate.value),
|
||||
issueDate: convertDateToAPI(new Date(issueDate.value)),
|
||||
expireDate: convertDateToAPI(new Date(expireDate.value)),
|
||||
certificateType: certificateType.value,
|
||||
})
|
||||
.then(async () => {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ const {
|
|||
hideLoader,
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -444,15 +445,15 @@ const saveData = async () => {
|
|||
durationYear: Number(durationYear.value),
|
||||
other: other.value,
|
||||
fundName: fundName.value,
|
||||
finishDate: dateToISO(finishDate.value),
|
||||
finishDate: convertDateToAPI(finishDate.value),
|
||||
startDate:
|
||||
isDate.value == "true"
|
||||
? new Date(startDate2.value)
|
||||
: new Date(`${startDate.value}-01-01`),
|
||||
? convertDateToAPI(new Date(startDate2.value))
|
||||
: convertDateToAPI(new Date(`${startDate.value}-01-01`)),
|
||||
endDate:
|
||||
isDate.value == "true"
|
||||
? new Date(endDate2.value)
|
||||
: new Date(`${endDate.value}-01-01`),
|
||||
? convertDateToAPI(new Date(endDate2.value))
|
||||
: convertDateToAPI(new Date(`${endDate.value}-01-01`)),
|
||||
isDate: isDate.value == "true",
|
||||
})
|
||||
.then(async () => {
|
||||
|
|
@ -492,12 +493,12 @@ const editData = async () => {
|
|||
finishDate: new Date(finishDate.value),
|
||||
startDate:
|
||||
isDate.value == "true"
|
||||
? new Date(startDate2.value)
|
||||
: new Date(`${startDate.value}-01-01`),
|
||||
? convertDateToAPI(new Date(startDate2.value))
|
||||
: convertDateToAPI(new Date(`${startDate.value}-01-01`)),
|
||||
endDate:
|
||||
isDate.value == "true"
|
||||
? new Date(endDate2.value)
|
||||
: new Date(`${endDate.value}-01-01`),
|
||||
? convertDateToAPI(new Date(endDate2.value))
|
||||
: convertDateToAPI(new Date(`${endDate.value}-01-01`)),
|
||||
isDate: isDate.value == "true",
|
||||
})
|
||||
.then(async () => {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -208,7 +209,7 @@ const editData = async () => {
|
|||
nationality: informaData.value.nationality,
|
||||
race: informaData.value.race,
|
||||
religion: informaData.value.religionId,
|
||||
birthDate: informaData.value.dateOfBirth,
|
||||
birthDate: convertDateToAPI(informaData.value.dateOfBirth),
|
||||
bloodGroup: informaData.value.bloodGroupId,
|
||||
relationship: informaData.value.relationshipId,
|
||||
telephoneNumber: informaData.value.telephone,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue