no message

This commit is contained in:
Kittapath 2023-07-11 10:41:31 +07:00
parent dc05b4740c
commit cf343f7b8f
19 changed files with 2595 additions and 2416 deletions

View file

@ -597,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);
});
}
};
/**
@ -714,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();
});
}
};
/**

View file

@ -489,32 +489,34 @@ 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),
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
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),
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
createdAt: new Date(e.createdAt),
createdFullName: e.createdFullName,
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
}
};
/**
@ -601,27 +603,29 @@ 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),
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.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),
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

View file

@ -589,33 +589,35 @@ 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,
unStigma: e.unStigma,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : 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,
unStigma: e.unStigma,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : 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);
});
}
};
/**
@ -703,28 +705,30 @@ 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,
unStigma: unStigma.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : 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,
unStigma: unStigma.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value),
date: dateToISO(date.value),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

View file

@ -176,19 +176,21 @@ onMounted(async () => {
});
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 deleteData = async (id: string) => {
@ -207,39 +209,41 @@ 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) {
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,
});
} else {
// modalError(
// $q,
// "",
// ""
// );
getData();
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,
// "",
// ""
// );
getData();
}
}
};

View file

@ -1112,45 +1112,47 @@ 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,
isEducation: e.isEducation,
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,
isDate: e.isDate.toString(),
finishDate: new Date(e.finishDate),
startDate: new Date(e.startDate).getFullYear(),
endDate: new Date(e.endDate).getFullYear(),
startDate2: new Date(e.startDate),
endDate2: new Date(e.endDate),
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,
isEducation: e.isEducation,
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,
isDate: e.isDate.toString(),
finishDate: new Date(e.finishDate),
startDate: new Date(e.startDate).getFullYear(),
endDate: new Date(e.endDate).getFullYear(),
startDate2: new Date(e.startDate),
endDate2: 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);
});
}
};
/**
@ -1255,43 +1257,45 @@ const saveData = async () => {
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
// (r: any) => r.id == isEducation.value
// );
loaderPage(true);
await http
.post(config.API.profileEduId(profileId.value), {
id: id.value,
// educationLevel: filter[0].name,
educationLevelId: levelId.value,
isEducation: isEducation.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,
isDate: isDate.value == "true" ? true : false,
finishDate: dateToISO(finishDate.value),
startDate:
isDate.value == "true"
? dateToISO(startDate2.value)
: new Date(`${startDate.value}-01-01`),
endDate:
isDate.value == "true"
? dateToISO(endDate2.value)
: 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) {
loaderPage(true);
await http
.post(config.API.profileEduId(profileId.value), {
id: id.value,
// educationLevel: filter[0].name,
educationLevelId: levelId.value,
isEducation: isEducation.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,
isDate: isDate.value == "true" ? true : false,
finishDate: dateToISO(finishDate.value),
startDate:
isDate.value == "true"
? dateToISO(startDate2.value)
: new Date(`${startDate.value}-01-01`),
endDate:
isDate.value == "true"
? dateToISO(endDate2.value)
: new Date(`${endDate.value}-01-01`),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

View file

@ -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":
@ -675,10 +700,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 {
}
});

View file

@ -486,31 +486,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);
});
}
};
/**

View file

@ -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">
@ -1114,6 +1115,10 @@ const props = defineProps({
type: Function,
default: () => console.log("not function"),
},
statusAdd: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(["update:statusEdit"]);
@ -1171,8 +1176,43 @@ 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,
citizenIdC: null,
liveC: null,
prefixM: null,
prefixIdM: null,
firstnameM: null,
lastnameM: null,
occupationM: null,
citizenIdM: null,
liveM: null,
prefixF: null,
prefixIdF: null,
firstnameF: null,
lastnameF: null,
occupationF: null,
citizenIdF: null,
liveF: null,
same: "0",
childrens: [],
};
}
};
const historyData = async () => {
await fetchHistory();
};
@ -1400,10 +1440,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 {
}
});

View file

@ -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">
@ -439,6 +440,10 @@ const props = defineProps({
type: Function,
default: () => console.log("not function"),
},
statusAdd: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(["update:statusEdit"]);
@ -693,8 +698,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: new Date(),
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();
@ -1045,11 +1078,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 {
}
});

View file

@ -939,41 +939,43 @@ 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),
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
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),
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
}
};
/**
@ -1068,35 +1070,37 @@ 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),
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.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),
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

View file

@ -717,33 +717,35 @@ 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) {
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) => {
@ -966,28 +968,30 @@ 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) {
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();
});
}
};
// /**
@ -1187,27 +1191,29 @@ const addData = async () => {
*/
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) {
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);
});
}
};
// /**

View file

@ -304,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);
});
}
};
/**
@ -409,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();
});
}
};
/**

View file

@ -478,32 +478,34 @@ 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,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
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,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
}
};
/**
@ -590,27 +592,29 @@ 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,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.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,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

View file

@ -909,7 +909,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 ? 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[]>([]);
@ -1512,51 +1514,53 @@ const fetchPosition = async () => {
};
const fetchData = async () => {
loaderPage(true);
await http
.get(config.API.profileSalaryId(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),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
if (profileId.value) {
loaderPage(true);
await http
.get(config.API.profileSalaryId(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),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
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 onSelected = async (id: string) => {
@ -1762,36 +1766,38 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
await http
.post(config.API.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
amount: amount.value,
positionSalaryAmount: positionSalaryAmount.value,
mouthSalaryAmount: mouthSalaryAmount.value,
ocId: selected.value,
positionId: positionId.value,
posNoId: posNoId.value,
positionLineId: positionLineId.value,
positionPathSideId: positionPathSideId.value,
positionTypeId: positionTypeId.value,
positionLevelId: positionLevelId.value,
positionExecutiveId: positionExecutiveId.value,
positionExecutiveSideId: positionExecutiveSideId.value,
salaryClass: salaryClass.value,
salaryRef: salaryRef.value,
refCommandNo: refCommandNo.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.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
amount: amount.value,
positionSalaryAmount: positionSalaryAmount.value,
mouthSalaryAmount: mouthSalaryAmount.value,
ocId: selected.value,
positionId: positionId.value,
posNoId: posNoId.value,
positionLineId: positionLineId.value,
positionPathSideId: positionPathSideId.value,
positionTypeId: positionTypeId.value,
positionLevelId: positionLevelId.value,
positionExecutiveId: positionExecutiveId.value,
positionExecutiveSideId: positionExecutiveSideId.value,
salaryClass: salaryClass.value,
salaryRef: salaryRef.value,
refCommandNo: refCommandNo.value,
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

View file

@ -918,7 +918,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 ? 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[]>([]);
@ -1466,48 +1468,50 @@ 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,
refCommandNo: e.refCommandNo,
// refCommandDate: new Date(e.refCommandDate),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
if (profileId.value) {
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,
refCommandNo: e.refCommandNo,
// refCommandDate: new Date(e.refCommandDate),
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) => {
@ -1691,34 +1695,36 @@ 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,
refCommandNo: refCommandNo.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,
refCommandNo: refCommandNo.value,
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

File diff suppressed because it is too large Load diff

View file

@ -354,30 +354,32 @@ 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,
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,
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);
});
}
};
/**
@ -463,25 +465,27 @@ 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,
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,
reference: reference.value,
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**

View file

@ -753,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);
});
}
};
/**
@ -874,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();
});
}
};
/**

View file

@ -554,33 +554,35 @@ 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,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
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,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
}
};
/**
@ -668,28 +670,30 @@ 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,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.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,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**