- fix bug generate แนบท้ายไม่ generate ใหม่

- ปิด log
This commit is contained in:
Warunee Tamkoo 2023-09-20 00:58:45 +07:00
parent eea8ce1b6d
commit 3da536acb0
7 changed files with 132 additions and 479 deletions

View file

@ -118,7 +118,6 @@ const getData = async (id: string) => {
.get(config.API.personsselectedOrder(id))
.then((res) => {
const data = res.data.result;
// console.log(data);
let list: ResponseData[] = [];
data.map((r: ResponseData) => {
list.push({
@ -134,7 +133,6 @@ const getData = async (id: string) => {
monthSalaryAmount: r.monthSalaryAmount,
});
});
// console.log("list", list);
rows.value = list;
selected.value = rows.value;
})
@ -182,8 +180,6 @@ const deleteData = async (id: string) => {
await http
.delete(config.API.personsOrder(id))
.then((res) => {
// const data = res.data.result;
// console.log(res);
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
@ -199,10 +195,6 @@ const swapUp = async (id: string) => {
// id = personalId
await http
.put(config.API.swapUpOrder(id))
.then((res) => {
// const data = res.data.result;
// console.log(res);
})
.catch((e) => {
messageError($q, e);
})
@ -216,10 +208,6 @@ const swapDown = async (id: string) => {
// id = personalId
await http
.put(config.API.swapDownOrder(id))
.then((res) => {
// const data = res.data.result;
// console.log(res);
})
.catch((e) => {
messageError($q, e);
})
@ -249,7 +237,6 @@ const saveModal = () => {
};
const personalId = ref<string>("");
const selectModal = (e: any) => {
// console.log(e);
titleName.value = e.name;
personalId.value = e.personalId;
modalOpenClose(e.personalId);
@ -265,12 +252,10 @@ const modalOpenClose = async (personalId: string) => {
myForm.value?.reset();
};
const fetchSalary = async (personalId: string) => {
// console.log(personalId);
showLoader();
await http
.get(config.API.salaryOrder(personalId))
.then((res: any) => {
console.log(res);
const data = res.data.result;
modalData.value = {
salaryAmount:
@ -292,10 +277,8 @@ const fetchSalary = async (personalId: string) => {
? null
: data.monthSalaryAmount,
};
// console.log("data", modalData.value);
})
.catch((e) => {
// console.log(e);
messageError($q, e);
})
.finally(() => {
@ -318,11 +301,9 @@ const putSalary = async (salary: any) => {
await http
.put(config.API.salaryOrder(personalId.value), modalData.value)
.then((res: any) => {
// console.log(res);
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
// console.log(e);
messageError($q, e);
})
.finally(async () => {
@ -353,7 +334,6 @@ const fetchaddlist = async (id: string) => {
.get(config.API.personsOrder(id))
.then((res) => {
const data = res.data.result;
console.log(data);
let list = [];
list = data.map((r: ResponseData) => ({
education: r.education ?? "",
@ -408,7 +388,6 @@ const addlist = async (data: Object) => {
success($q, "บันทึกสำเร็จ");
})
.catch((e: any) => {
console.log(e);
messageError($q, e);
})
.finally(() => {
@ -418,8 +397,6 @@ const addlist = async (data: Object) => {
};
const save = async () => {
// console.log("save===>", rows.value);
// console.log(statuscode.value);
const check = rows.value.find((x: any) => x.salaryAmount == 0);
if (
(selected.value.length > 0 && !check) ||