ปรับฟอร์มลา
This commit is contained in:
parent
4ce525522b
commit
6bf4bdebaa
16 changed files with 217 additions and 175 deletions
|
|
@ -136,16 +136,14 @@ export const useLeaveStore = defineStore("Leave", () => {
|
|||
|
||||
/** รายการประเภทการลาของ ลาไปศึกษา ฝึกอบรม ปฎิบัติการวิจัย หรือดูงาน*/
|
||||
const optionsSpecific = ref<OptionData[]>([
|
||||
{ id: "s0", name: "ลาไปศึกษาต่อ", code: "s0" },
|
||||
{ id: "s1", name: "ลาฝึกอบรม", code: "s1" },
|
||||
{ id: "s2", name: "ลาปฎิบัติการวิจัย", code: "s2" },
|
||||
{ id: "s3", name: "ลาดูงาน", code: "s3" },
|
||||
{ id: "s1", name: "ลาไปศึกษาต่อ", code: "s1" },
|
||||
{ id: "s2", name: "ลาฝึกอบรม/ปฎิบัติการวิจัย/ดูงาน", code: "s2" },
|
||||
]);
|
||||
|
||||
/** รายการประเภทการลาของ ลาอุปสมบทหรือลาประกอบพิธีฮัจญ์*/
|
||||
const optionsOrdination = ref<OptionData[]>([
|
||||
{ id: 'b1', name: "ลาอุปสมบท", code: 'b1' },
|
||||
{ id: 'b2', name: "ลาประกอบพิธีฮัจญ์", code: 'b2' },
|
||||
{ id: "b1", name: "ลาอุปสมบท", code: "b1" },
|
||||
{ id: "b2", name: "ลาประกอบพิธีฮัจญ์", code: "b2" },
|
||||
]);
|
||||
|
||||
/** data table filter & column ของรายการลา */
|
||||
|
|
@ -202,13 +200,13 @@ export const useLeaveStore = defineStore("Leave", () => {
|
|||
*/
|
||||
function typeConvert(item: string, subitem: any) {
|
||||
// console.log('first',item)
|
||||
if (item !== "LV-006" && item !== "LV-008") {
|
||||
typeLeave.value = convertSubtitle(item);
|
||||
} else if (item === "LV-006") {
|
||||
typeLeave.value = convertSubtitleInfo(subitem);
|
||||
} else if (item === "LV-008") {
|
||||
typeLeave.value = convertSubtitleInfo2(subitem);
|
||||
}
|
||||
// if (item !== "LV-006" && item !== "LV-008") {
|
||||
typeLeave.value = convertSubtitle(item);
|
||||
// } else if (item === "LV-006") {
|
||||
// typeLeave.value = convertSubtitleInfo(subitem);
|
||||
// } else if (item === "LV-008") {
|
||||
// typeLeave.value = convertSubtitleInfo2(subitem);
|
||||
// }
|
||||
typeId.value = convertId(item);
|
||||
}
|
||||
|
||||
|
|
@ -288,9 +286,12 @@ export const useLeaveStore = defineStore("Leave", () => {
|
|||
restDayTotalOld.value = data.restDayTotalOld;
|
||||
birthDate.value = data.birthDate;
|
||||
dateAppoint.value = data.dateAppoint;
|
||||
salary.value = data.salary;
|
||||
salary.value = data.salary ? data.salary.toLocaleString("th-TH") : "";
|
||||
salaryText.value = data.salaryText;
|
||||
leaveLast.value = data.leaveLast != "0001-01-01T00:00:00" ? date2Thai(data.leaveLast) : "-";
|
||||
leaveLast.value =
|
||||
data.leaveLast != "0001-01-01T00:00:00"
|
||||
? date2Thai(data.leaveLast)
|
||||
: "-";
|
||||
restDayCurrentTotal.value = data.restDayCurrentTotal;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
|
|
@ -299,6 +300,23 @@ export const useLeaveStore = defineStore("Leave", () => {
|
|||
}
|
||||
|
||||
async function fetchProfileOld(data: any) {
|
||||
await http
|
||||
.post(config.API.leaveProfile(), { type: typeId.value })
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
leaveLimit.value = data.leaveLimit;
|
||||
leaveTotal.value = data.leaveTotal;
|
||||
leaveRemain.value = data.leaveRemain;
|
||||
restDayTotalOld.value = data.restDayTotalOld; //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา
|
||||
birthDate.value = data.birthDate; // วันเกิด
|
||||
dateAppoint.value = data.dateAppoint; // วันที่รับราชการ
|
||||
salary.value = data.salary ? data.salary.toLocaleString("th-TH") : "";
|
||||
salaryText.value = data.salaryText;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
|
||||
dateSendLeave.value = data.dateSendLeave;
|
||||
typeLeave.value = data.leaveTypeName;
|
||||
dear.value = data.dear;
|
||||
|
|
@ -306,15 +324,8 @@ export const useLeaveStore = defineStore("Leave", () => {
|
|||
positionName.value = data.positionName;
|
||||
positionLevelName.value = data.positionLevelName;
|
||||
organizationName.value = data.organizationName;
|
||||
leaveLimit.value = data.leaveLimit;
|
||||
leaveTotal.value = data.leaveTotal;
|
||||
leaveRemain.value = data.leaveRemain;
|
||||
restDayTotalOld.value = data.restDayTotalOld;
|
||||
birthDate.value = data.birthDate;
|
||||
dateAppoint.value = data.dateAppoint;
|
||||
salary.value = data.salary;
|
||||
salaryText.value = data.salaryText;
|
||||
leaveLast.value = data.leaveLast != "0001-01-01T00:00:00" ? date2Thai(data.leaveLast) : "-";
|
||||
leaveLast.value =
|
||||
data.leaveLast != "0001-01-01T00:00:00" ? date2Thai(data.leaveLast) : "-";
|
||||
restDayCurrentTotal.value = data.restDayCurrentTotal;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue