ปรับทะเบียนประวัติ

This commit is contained in:
Warunee Tamkoo 2024-02-12 22:53:51 +07:00
parent 31296b343c
commit e26b83f0bb
5 changed files with 76 additions and 46 deletions

View file

@ -25,11 +25,12 @@
@click="selectData(props)" @click="selectData(props)"
class="cursor-pointer" class="cursor-pointer"
> >
<div <div v-if="col.name == 'issueDate'" class="table_ellipsis">
v-if="col.name == 'issueDate' || col.name == 'refCommandDate'" {{
class="table_ellipsis" props.row.isDate == "true"
> ? date2Thai(props.row.issueDate2)
{{ col.value == null ? null : date2Thai(col.value) }} : col.value + 543
}}
</div> </div>
<div v-else class="table_ellipsis"> <div v-else class="table_ellipsis">
{{ col.value }} {{ col.value }}
@ -89,7 +90,6 @@
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<datepicker <datepicker
v-if="isDate === 'false'" v-if="isDate === 'false'"
menu-class-name="modalfix" menu-class-name="modalfix"
@ -573,6 +573,7 @@ const fetchData = async () => {
id: e.id, id: e.id,
issuer: e.issuer, issuer: e.issuer,
detail: e.detail, detail: e.detail,
isDate: e.isDate == null ? null : e.isDate.toString(),
issueDate: new Date(e.issueDate).getFullYear(), issueDate: new Date(e.issueDate).getFullYear(),
issueDate2: new Date(e.issueDate), issueDate2: new Date(e.issueDate),
refCommandNo: e.refCommandNo == "" ? "-" : e.refCommandNo, refCommandNo: e.refCommandNo == "" ? "-" : e.refCommandNo,
@ -619,6 +620,7 @@ const getData = () => {
const row = rows.value[rowIndex.value]; const row = rows.value[rowIndex.value];
issuer.value = row.issuer; issuer.value = row.issuer;
detail.value = row.detail; detail.value = row.detail;
isDate.value = row.isDate;
issueDate.value = row.issueDate; issueDate.value = row.issueDate;
issueDate2.value = row.issueDate2; issueDate2.value = row.issueDate2;
refCommandNo.value = row.refCommandNo; refCommandNo.value = row.refCommandNo;
@ -684,6 +686,7 @@ const saveData = async () => {
id: id.value, id: id.value,
issuer: issuer.value, issuer: issuer.value,
detail: detail.value, detail: detail.value,
isDate: isDate.value == "true" ? true : false,
issueDate: issueDate:
isDate.value == "true" isDate.value == "true"
? dateToISO(issueDate2.value) ? dateToISO(issueDate2.value)
@ -717,6 +720,7 @@ const editData = async () => {
id: id.value, id: id.value,
issuer: issuer.value, issuer: issuer.value,
detail: detail.value, detail: detail.value,
isDate: isDate.value == "true" ? true : false,
issueDate: issueDate:
isDate.value == "true" isDate.value == "true"
? dateToISO(issueDate2.value) ? dateToISO(issueDate2.value)
@ -806,8 +810,11 @@ const selectData = async (props: DataProps) => {
issuer.value = props.row.issuer; issuer.value = props.row.issuer;
detail.value = props.row.detail; detail.value = props.row.detail;
issueDate.value = props.row.issueDate; issueDate.value = props.row.issueDate;
isDate.value = props.row.isDate;
issueDate2.value = props.row.issueDate2;
refCommandNo.value = props.row.refCommandNo; refCommandNo.value = props.row.refCommandNo;
refCommandDate.value = props.row.refCommandDate == '-' ? null:props.row.refCommandDate; refCommandDate.value =
props.row.refCommandDate == "-" ? null : props.row.refCommandDate;
id.value = props.row.id; id.value = props.row.id;
await checkRowPage(); await checkRowPage();
}; };

View file

@ -1141,16 +1141,16 @@ const fetchData = async () => {
id: e.id, id: e.id,
level: e.educationLevel, level: e.educationLevel,
levelId: e.educationLevelId, levelId: e.educationLevelId,
positionPath: e.positionPath ? e.positionPath : "-", positionPath: e.positionPath,
isEducation: e.isEducation, isEducation: e.isEducation,
institute: e.institute ? e.institute : "-", institute: e.institute,
degree: e.degree ? e.degree : "-", degree: e.degree,
field: e.field ? e.field : "-", field: e.field,
gpa: e.gpa ? e.gpa : "-", gpa: e.gpa,
country: e.country ? e.country : "-", country: e.country,
duration: e.duration ? e.duration : "-", duration: e.duration,
durationYear: e.durationYear, durationYear: e.durationYear,
other: e.other ? e.other : "-", other: e.other,
fundName: e.fundName, fundName: e.fundName,
isDate: e.isDate == null ? null : e.isDate.toString(), isDate: e.isDate == null ? null : e.isDate.toString(),
finishDate: e.finishDate ? new Date(e.finishDate) : null, finishDate: e.finishDate ? new Date(e.finishDate) : null,

View file

@ -526,9 +526,9 @@ const volume = ref<string>();
const section = ref<string>(); const section = ref<string>();
const page = ref<string>(); const page = ref<string>();
const receiveDate = ref<Date>(new Date()); const receiveDate = ref<Date>(new Date());
const dateAnnounce = ref<Date | null|string>(null); const dateAnnounce = ref<Date | null | string>(null);
const refCommandNo = ref<string>(); const refCommandNo = ref<string>();
const refCommandDate = ref<Date | null|string>(new Date()); const refCommandDate = ref<Date | null | string>(new Date());
const myForm = ref<any>(); //form data input const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog const edit = ref<boolean>(false); // dialog
const modal = ref<boolean>(false); //modal add detail const modal = ref<boolean>(false); //modal add detail
@ -969,17 +969,17 @@ const fetchData = async () => {
insignia: e.insignia == null ? null : e.insignia.name, insignia: e.insignia == null ? null : e.insignia.name,
insigniaId: e.insignia == null ? null : e.insignia.id, insigniaId: e.insignia == null ? null : e.insignia.id,
insigniaType: e.insigniaType, insigniaType: e.insigniaType,
year: e.year ? e.year : "-", year: e.year,
no: e.no ? e.no : "-", no: e.no,
issue: e.issue ? e.issue : "-", issue: e.issue,
volumeNo: e.volumeNo ? e.volumeNo : "-", volumeNo: e.volumeNo,
volume: e.volume ? e.volume : "-", volume: e.volume,
section: e.section ? e.section : "-", section: e.section,
page: e.page ? e.page : "-", page: e.page,
receiveDate: new Date(e.receiveDate), receiveDate: new Date(e.receiveDate),
dateAnnounce: e.dateAnnounce ? new Date(e.dateAnnounce) : "-", dateAnnounce: e.dateAnnounce,
refCommandNo: e.refCommandNo ? e.refCommandNo : "-", refCommandNo: e.refCommandNo,
refCommandDate: e.refCommandDate ? new Date(e.refCommandDate) : "-", refCommandDate: e.refCommandDate,
createdFullName: e.createdFullName, createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt), createdAt: new Date(e.createdAt),
}); });
@ -1102,10 +1102,14 @@ const saveData = async () => {
section: section.value, section: section.value,
page: page.value, page: page.value,
receiveDate: dateToISO(receiveDate.value), receiveDate: dateToISO(receiveDate.value),
dateAnnounce: dateAnnounce.value ? dateToISO(dateAnnounce.value as Date) : null, dateAnnounce: dateAnnounce.value
? dateToISO(dateAnnounce.value as Date)
: null,
refCommandNo: refCommandNo.value, refCommandNo: refCommandNo.value,
refCommandDate: refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
}) })
.then((res) => { .then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
@ -1138,10 +1142,14 @@ const editData = async () => {
section: section.value, section: section.value,
page: page.value, page: page.value,
receiveDate: dateToISO(receiveDate.value), receiveDate: dateToISO(receiveDate.value),
dateAnnounce: dateAnnounce.value ? dateToISO(dateAnnounce.value as Date) : null, dateAnnounce: dateAnnounce.value
? dateToISO(dateAnnounce.value as Date)
: null,
refCommandNo: refCommandNo.value, refCommandNo: refCommandNo.value,
refCommandDate: refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
}) })
.then((res) => { .then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
@ -1229,9 +1237,11 @@ const selectData = async (props: DataProps) => {
section.value = props.row.section; section.value = props.row.section;
page.value = props.row.page; page.value = props.row.page;
receiveDate.value = props.row.receiveDate; receiveDate.value = props.row.receiveDate;
dateAnnounce.value = props.row.dateAnnounce == '-' ? null:props.row.dateAnnounce; dateAnnounce.value =
props.row.dateAnnounce == "-" ? null : props.row.dateAnnounce;
refCommandNo.value = props.row.refCommandNo; refCommandNo.value = props.row.refCommandNo;
refCommandDate.value = props.row.refCommandDate == '-'? null:props.row.refCommandDate; refCommandDate.value =
props.row.refCommandDate == "-" ? null : props.row.refCommandDate;
id.value = props.row.id; id.value = props.row.id;
await checkRowPage(); await checkRowPage();
}; };

View file

@ -1157,13 +1157,13 @@ const clickSave = async () => {
myFormAdd.value.validate().then(async (result: boolean) => { myFormAdd.value.validate().then(async (result: boolean) => {
if (result) { if (result) {
if (modalEdit.value) { if (modalEdit.value) {
await dialogConfirm($q, () => { // await dialogConfirm($q, () => {
editData(); editData();
}); // });
} else { } else {
await dialogConfirm($q, () => { // await dialogConfirm($q, () => {
saveData(); saveData();
}); // });
} }
} }
}); });

View file

@ -23,18 +23,26 @@
@click="selectData(props)" @click="selectData(props)"
class="cursor-pointer" class="cursor-pointer"
> >
<div <div v-if="col.name == 'startDate'" class="table_ellipsis">
v-if=" {{
col.name == 'startDate' || props.row.isDate == "true"
col.name == 'endDate' || ? date2Thai(props.row.startDate2)
col.name == 'dateOrder' : col.value + 543
" }}
class="table_ellipsis" </div>
> <div v-else-if="col.name == 'endDate'" class="table_ellipsis">
{{
props.row.isDate == "true"
? date2Thai(props.row.endDate2)
: col.value + 543
}}
</div>
<div v-else-if="col.name == 'dateOrder'" class="table_ellipsis">
{{ date2Thai(col.value) }} {{ date2Thai(col.value) }}
</div> </div>
<div v-else-if="col.name == 'yearly'" class="table_ellipsis"> <div v-else-if="col.name == 'yearly'" class="table_ellipsis">
{{ col.value + 543 }} {{ col.value ? col.value + 543 : "" }}
</div> </div>
<div v-else class="table_ellipsis"> <div v-else class="table_ellipsis">
{{ col.value }} {{ col.value }}
@ -958,6 +966,7 @@ const getData = () => {
department.value = row.department; department.value = row.department;
numberOrder.value = row.numberOrder; numberOrder.value = row.numberOrder;
dateOrder.value = row.dateOrder; dateOrder.value = row.dateOrder;
isDate.value = row.isDate;
startDate.value = row.startDate; startDate.value = row.startDate;
endDate.value = row.endDate; endDate.value = row.endDate;
startDate2.value = row.startDate2; startDate2.value = row.startDate2;
@ -1029,6 +1038,7 @@ const saveData = async () => {
department: department.value, department: department.value,
numberOrder: numberOrder.value, numberOrder: numberOrder.value,
dateOrder: dateOrder.value, dateOrder: dateOrder.value,
isDate: isDate.value == "true" ? true : false,
startDate: startDate:
isDate.value == "true" isDate.value == "true"
? dateToISO(startDate2.value) ? dateToISO(startDate2.value)
@ -1161,8 +1171,11 @@ const selectData = async (props: DataProps) => {
department.value = props.row.department; department.value = props.row.department;
numberOrder.value = props.row.numberOrder; numberOrder.value = props.row.numberOrder;
dateOrder.value = props.row.dateOrder; dateOrder.value = props.row.dateOrder;
isDate.value = props.row.isDate;
startDate.value = props.row.startDate; startDate.value = props.row.startDate;
endDate.value = props.row.endDate; endDate.value = props.row.endDate;
startDate2.value = props.row.startDate2;
endDate2.value = props.row.endDate2;
id.value = props.row.id; id.value = props.row.id;
await checkRowPage(); await checkRowPage();
}; };