diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 17cdc587a..10cb37f18 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -374,34 +374,34 @@ const menuList = readonly([ }, ], }, - // { - // key: 9, - // icon: "mdi-calendar", - // activeIcon: "mdi-calendar", - // label: "การลา", - // path: "leave", - // role: "coin", - // children: [ - // { - // key: 9.1, - // label: "รายการลงเวลาปฏิบัติงาน", - // path: "/work-list", - // role: "coin", - // }, - // { - // key: 9.2, - // label: "รายการลา", - // path: "/leave-list", - // role: "coin", - // }, - // { - // key: 9.3, - // label: "รายงานสถิติ", - // path: "/statistics-report", - // role: "coin", - // }, - // ], - // }, + { + key: 9, + icon: "mdi-calendar", + activeIcon: "mdi-calendar", + label: "การลา", + path: "leave", + role: "coin", + children: [ + { + key: 9.1, + label: "รายการลงเวลาปฏิบัติงาน", + path: "/work-list", + role: "coin", + }, + { + key: 9.2, + label: "รายการลา", + path: "/leave-list", + role: "coin", + }, + { + key: 9.3, + label: "รายงานสถิติ", + path: "/statistics-report", + role: "coin", + }, + ], + }, ]); const tabList = readonly([ diff --git a/src/interface/request/main/main.ts.rej b/src/interface/request/main/main.ts.rej new file mode 100644 index 000000000..a4c8b102d --- /dev/null +++ b/src/interface/request/main/main.ts.rej @@ -0,0 +1,134 @@ +diff a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts (rejected hunks) +@@ -374,104 +374,34 @@ + }, + ], + }, +- // { +- // key: 8, +- // icon: "mdi-medal-outline", +- // activeIcon: "mdi-medal", +- // label: "เครื่องราชฯ", +- // path: "insignia", +- // role: "insignia", +- // children: [ +- // { +- // key: 8.1, +- // label: "เครื่องราชฯ", +- // path: "", +- // role: "insignia", +- // children: [ +- // { +- // label: "รอบการเสนอขอ", +- // path: "insigniaProposals", +- // role: "insignia", +- // }, +- // { +- // label: "จัดการคำขอ", +- // path: "insigniaManage", +- // role: "insignia", +- // }, +- // { +- // label: "บันทึกผลการได้รับพระราช...", +- // path: "insigniaRecord", +- // role: "insignia", +- // }, +- // { +- // label: "บันทึกผลการจ่ายใบกำกับ", +- // path: "VatInsignia", +- // role: "insignia", +- // }, +- +- // { +- // label: "จัดสรรเครื่องราชฯ", +- // path: "insigniaAllocate", +- // role: "insignia", +- // }, +- // { +- // label: "รายงาน", +- // path: "insigniaReport", +- // role: "insignia", +- // }, +- // ], +- // }, +- // { +- // key: 8.2, +- // label: "เหรียญจักรพรรดิมาลา", +- // path: "", +- // role: "coin", +- // children: [ +- // { +- // label: "รอบการเสนอขอ", +- // path: "coinProposals", +- // role: "coin", +- // }, +- // { +- // label: "จัดการคำขอ", +- // path: "coinManage", +- // role: "coin", +- // }, +- // { +- // label: "บันทึกผลการได้รับพระราชทานเหรียญจักรพรรดิมาลา", +- // path: "coinReceive", +- // role: "coin", +- // }, +- // { +- // label: "บันทึกผลการจ่ายใบกำกับ", +- // path: "coinPayment", +- // role: "coin", +- // }, +- // { +- // label: +- // "รายชื่อที่ยื่นคำร้องขอแก้ไขข้อมูลการขอพระราชทานเหรียญจักรพรรดิมาลา", +- // path: "coinRequest", +- // role: "coin", +- // }, +- // // { +- // // label: "ประวัติการยื่นขอ", +- // // path: "coinHistory", +- // // role: "coin", +- // // }, +- // { +- // label: "จัดสรรเหรียญตรา", +- // path: "coinAllocate", +- // role: "coin", +- // }, +- // { +- // label: "รายงาน", +- // path: "coinReport", +- // role: "coin", +- // }, +- // ], +- // }, +- // ], +- // }, ++ { ++ key: 9, ++ icon: "mdi-calendar", ++ activeIcon: "mdi-calendar", ++ label: "การลา", ++ path: "leave", ++ role: "coin", ++ children: [ ++ { ++ key: 9.1, ++ label: "รายการลงเวลาปฏิบัติงาน", ++ path: "/work-list", ++ role: "coin", ++ }, ++ { ++ key: 9.2, ++ label: "รายการลา", ++ path: "/leave-list", ++ role: "coin", ++ }, ++ { ++ key: 9.3, ++ label: "รายงานสถิติ", ++ path: "/statistics-report", ++ role: "coin", ++ }, ++ ], ++ }, + ]); + + const tabList = readonly([ diff --git a/src/modules/02_organizational/views/MainTreeEmployee.vue b/src/modules/02_organizational/views/MainTreeEmployee.vue index 477442124..4f508331a 100644 --- a/src/modules/02_organizational/views/MainTreeEmployee.vue +++ b/src/modules/02_organizational/views/MainTreeEmployee.vue @@ -1394,7 +1394,12 @@ const clickSave = async () => { myForm.value!.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { - await editData(); + if (selected.value == null) { + fails($q, "กรุณาเลือกหน่วยงาน"); + } else { + // console.log("save"); + await editData(); + } } else { if (selected.value == "") { fails($q, "กรุณาเลือกหน่วยงาน"); @@ -1402,7 +1407,6 @@ const clickSave = async () => { // console.log("save"); await saveData(); } - // await saveData(); } } }); @@ -1500,6 +1504,7 @@ const editData = async () => { isActive: isActive.value, isCondition: isCondition.value, conditionNote: conditionNote.value, + organizationId: organizationId.value, }) .then((res) => { success($q, "บันทึกข้อมูลร่างสำเร็จ"); diff --git a/src/modules/03_recruiting/components/Career.vue b/src/modules/03_recruiting/components/Career.vue index 206b83811..97aeb80c3 100644 --- a/src/modules/03_recruiting/components/Career.vue +++ b/src/modules/03_recruiting/components/Career.vue @@ -48,6 +48,13 @@ + @@ -317,6 +324,7 @@ const editRow = ref(false); //เช็คมีการแก้ไ const checkValidate = ref(false); //validate data ผ่านหรือไม่ const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); +const total = ref("-"); const rows = ref([]); const filter = ref(""); //search data table const { messageError, showLoader, hideLoader } = mixin; @@ -480,12 +488,56 @@ const calDate = async () => { }${dayDiff > 0 ? dayDiff + " วัน " : ""}`; }; +const calDateSplit = async (startDate: Date, endDate: Date) => { + let _startDate = new Date(startDate.toISOString().substr(0, 10)); + let _endDate = new Date(endDate.toISOString().substr(0, 10)); + _endDate.setDate(_endDate.getDate() + 1); + if (_startDate > _endDate) { + const swap = _startDate; + _startDate = _endDate; + _endDate = swap; + } + const startYear = _startDate.getFullYear(); + const february = + (startYear % 4 === 0 && startYear % 100 !== 0) || startYear % 400 === 0 + ? 29 + : 28; + const daysInMonth = [31, february, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + let yearDiff = _endDate.getFullYear() - startYear; + let monthDiff = _endDate.getMonth() - _startDate.getMonth(); + if (monthDiff < 0) { + yearDiff--; + monthDiff += 12; + } + let dayDiff = _endDate.getDate() - _startDate.getDate(); + if (dayDiff < 0) { + if (monthDiff > 0) { + monthDiff--; + } else { + yearDiff--; + monthDiff = 11; + } + dayDiff += daysInMonth[_startDate.getMonth()]; + } + var obj = { + yearDiff: yearDiff, + monthDiff: monthDiff, + dayDiff: dayDiff, + }; + return obj; +}; + const fetchData = async () => { showLoader(); await http .get(config.API.candidateCareer(candidateId.value)) .then((res) => { const data = res.data.result; + var yearDiff = 0; + var monthDiff = 0; + var dayDiff = 0; + total.value = "-"; rows.value = []; data.map((r: any) => { rows.value.push({ @@ -493,6 +545,24 @@ const fetchData = async () => { startDate: new Date(r.durationStart), endDate: new Date(r.durationEnd), }); + calDateSplit(new Date(r.durationStart), new Date(r.durationEnd)).then( + (d) => { + yearDiff = yearDiff + d.yearDiff; + monthDiff = monthDiff + d.monthDiff; + dayDiff = dayDiff + d.dayDiff; + if (dayDiff > 30) { + dayDiff = dayDiff % 30; + monthDiff = monthDiff + parseInt((dayDiff / 30).toString()); + } + if (monthDiff > 12) { + monthDiff = monthDiff % 12; + yearDiff = yearDiff + parseInt((monthDiff / 12).toString()); + } + total.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${ + monthDiff > 0 ? monthDiff + " เดือน " : "" + }${dayDiff > 0 ? dayDiff + " วัน " : ""}`; + } + ); }); }) .catch((e) => { diff --git a/src/modules/03_recruiting/components/Education.vue b/src/modules/03_recruiting/components/Education.vue index 9a545b3c9..898bdc7c5 100644 --- a/src/modules/03_recruiting/components/Education.vue +++ b/src/modules/03_recruiting/components/Education.vue @@ -27,9 +27,10 @@ v-model="defaultEducation.educationLevelExamId" :rules="[(val) => !!val || `${'กรุณาเลือก วุฒิที่ใช้สมัครสอบ'}`]" :label="`${'วุฒิที่ใช้สมัครสอบ'}`" + @update:model-value="(value) => checkInputName()" /> -
+
(true); +const showEducationName = ref(true); const myform = ref({}); const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); @@ -276,6 +278,17 @@ const fetchData = async () => { }); }; +const checkInputName = () => { + showEducationName.value = + props.educationLevelOptions.filter( + (x) => + x.id == defaultEducation.value.educationLevelExamId && + (x.name == "ปริญญาตรี" || x.name == "ปริญญาโท" || x.name == "ปริญญาเอก") + ).length == 0 + ? false + : true; +}; + const getClass = (val: boolean) => { return { "full-width inputgreen cursor-pointer": val, diff --git a/src/modules/03_recruiting/components/Information.vue b/src/modules/03_recruiting/components/Information.vue index 23526e63c..6f8b56e88 100644 --- a/src/modules/03_recruiting/components/Information.vue +++ b/src/modules/03_recruiting/components/Information.vue @@ -136,6 +136,7 @@ week-start="0" :max-date="new Date()" :disabled="!(status == 'checkRegister' || status == 'payment')" + @update:modelValue="selectBirthDate" > -
+
@@ -518,7 +552,14 @@ const clickDelete = (id: string) => {
{{ fullname }}
- +
@@ -531,7 +572,13 @@ const clickDelete = (id: string) => { - + {{ op.label @@ -543,8 +590,16 @@ const clickDelete = (id: string) => {
- + @@ -552,47 +607,99 @@ const clickDelete = (id: string) => { - +