แก้ไขหน้า form การลา

This commit is contained in:
AnandaTon 2023-12-14 10:32:32 +07:00
parent 7777b27cda
commit 5cc7e2aeb3
15 changed files with 118 additions and 126 deletions

View file

@ -240,12 +240,10 @@ export const useLeaveStore = defineStore("Leave", () => {
const dateAppoint = ref<Date>() //วันที่เข้ารับราชการ
const salary = ref<number>(0) //เงินเดือนปัจจุบัน
const salaryText = ref<string>("") //เงินเดือนปัจจุบัน(ภาษาไทย)
const leaveLast = ref<Date>()
const leaveLast = ref<any>()
const restDayCurrentTotal = ref<string>("")
//ดึงข้อมูล profile จาก API
async function fetchProfile() {
console.log("profile")
await http
.post(config.API.leaveProfile(), { type: typeId.value })
.then((res: any) => {
@ -265,9 +263,8 @@ export const useLeaveStore = defineStore("Leave", () => {
dateAppoint.value = data.dateAppoint
salary.value = data.salary
salaryText.value = data.salaryText
leaveLast.value = data.leaveLast && date2Thai(data.leaveLast)
leaveLast.value = date2Thai(data.leaveLast) !== "0001-01-01T00:00:00" ? date2Thai(data.leaveLast) : "-"
restDayCurrentTotal.value = data.restDayCurrentTotal
console.log(data)
})
.catch((e: any) => {
messageError($q, e)