รายละเอียดทะเบียนประวัติลูกจ้าง
This commit is contained in:
parent
bdc7ab8df3
commit
1e02f42b58
26 changed files with 2419 additions and 1031 deletions
|
|
@ -366,7 +366,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขผลก
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -595,34 +597,36 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileAssessmentId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileAssessmentId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
name: e.name,
|
id: e.id,
|
||||||
point1Total: e.point1Total,
|
name: e.name,
|
||||||
point1: e.point1,
|
point1Total: e.point1Total,
|
||||||
point2Total: e.point2Total,
|
point1: e.point1,
|
||||||
point2: e.point2,
|
point2Total: e.point2Total,
|
||||||
pointSumTotal: e.pointSumTotal,
|
point2: e.point2,
|
||||||
pointSum: e.pointSum,
|
pointSumTotal: e.pointSumTotal,
|
||||||
date: new Date(e.date),
|
pointSum: e.pointSum,
|
||||||
createdAt: new Date(e.createdAt),
|
date: new Date(e.date),
|
||||||
createdFullName: e.createdFullName,
|
createdAt: new Date(e.createdAt),
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -712,29 +716,31 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileAssessmentId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileAssessmentId(profileId.value), {
|
||||||
name: name.value,
|
id: id.value,
|
||||||
point1Total: point1Total.value,
|
name: name.value,
|
||||||
point1: point1.value,
|
point1Total: point1Total.value,
|
||||||
point2Total: point2Total.value,
|
point1: point1.value,
|
||||||
point2: point2.value,
|
point2Total: point2Total.value,
|
||||||
pointSumTotal: pointSumTotal.value,
|
point2: point2.value,
|
||||||
pointSum: pointSum.value,
|
pointSumTotal: pointSumTotal.value,
|
||||||
date: dateToISO(date.value),
|
pointSum: pointSum.value,
|
||||||
})
|
date: dateToISO(date.value),
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -360,29 +362,31 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileHonorId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileHonorId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
issuer: e.issuer,
|
id: e.id,
|
||||||
detail: e.detail,
|
issuer: e.issuer,
|
||||||
issueDate: new Date(e.issueDate),
|
detail: e.detail,
|
||||||
createdAt: new Date(e.createdAt),
|
issueDate: new Date(e.issueDate),
|
||||||
createdFullName: e.createdFullName,
|
createdAt: new Date(e.createdAt),
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -467,24 +471,26 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileHonorId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileHonorId(profileId.value), {
|
||||||
issuer: issuer.value,
|
id: id.value,
|
||||||
detail: detail.value,
|
issuer: issuer.value,
|
||||||
issueDate: dateToISO(issueDate.value),
|
detail: detail.value,
|
||||||
})
|
issueDate: dateToISO(issueDate.value),
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -363,7 +363,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขวิน
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -545,31 +547,33 @@ const filterSelector = (val: string, update: Function, refData: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileDisId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileDisId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
level: e.level,
|
id: e.id,
|
||||||
detail: e.detail,
|
level: e.level,
|
||||||
refCommandNo: e.refCommandNo,
|
detail: e.detail,
|
||||||
refCommandDate: new Date(e.refCommandDate),
|
refCommandNo: e.refCommandNo,
|
||||||
date: new Date(e.date),
|
refCommandDate: new Date(e.refCommandDate),
|
||||||
createdFullName: e.createdFullName,
|
date: new Date(e.date),
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -656,26 +660,28 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileDisId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileDisId(profileId.value), {
|
||||||
level: level.value,
|
id: id.value,
|
||||||
detail: detail.value,
|
level: level.value,
|
||||||
refCommandNo: refCommandNo.value,
|
detail: detail.value,
|
||||||
refCommandDate: dateToISO(refCommandDate.value),
|
refCommandNo: refCommandNo.value,
|
||||||
date: dateToISO(date.value),
|
refCommandDate: dateToISO(refCommandDate.value),
|
||||||
})
|
date: dateToISO(date.value),
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
:changeBtn="changeBtn"
|
:changeBtn="changeBtn"
|
||||||
:disable="statusEdit"
|
:disable="statusEdit"
|
||||||
:save="uploadData"
|
:save="uploadData"
|
||||||
|
:addEmployee="statusAdd()"
|
||||||
/>
|
/>
|
||||||
<div class="row col-12 q-pt-sm">
|
<div class="row col-12 q-pt-sm">
|
||||||
<q-card bordered flat class="full-width">
|
<q-card bordered flat class="full-width">
|
||||||
|
|
@ -153,6 +154,10 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => console.log("not function"),
|
default: () => console.log("not function"),
|
||||||
},
|
},
|
||||||
|
statusAdd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["update:statusEdit"]);
|
const emit = defineEmits(["update:statusEdit"]);
|
||||||
|
|
||||||
|
|
@ -162,7 +167,9 @@ const $q = useQuasar(); // show dialog
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { success, messageError } = mixin;
|
const { success, messageError } = mixin;
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const edit = ref<boolean>(false);
|
const edit = ref<boolean>(false);
|
||||||
const uploader = ref<any>();
|
const uploader = ref<any>();
|
||||||
const files = ref<any>([]);
|
const files = ref<any>([]);
|
||||||
|
|
@ -171,22 +178,37 @@ const name = ref<string>("");
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getData();
|
await getData();
|
||||||
|
defaultAdd();
|
||||||
});
|
});
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profilePaperId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profilePaperId(profileId.value))
|
||||||
const data = res.data.result;
|
.then((res) => {
|
||||||
files.value = data;
|
const data = res.data.result;
|
||||||
})
|
files.value = data;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(() => {
|
})
|
||||||
loaderPage(false);
|
.finally(() => {
|
||||||
});
|
loaderPage(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusAdd = () => props.statusAdd;
|
||||||
|
|
||||||
|
const defaultAdd = () => {
|
||||||
|
if (props.statusAdd) {
|
||||||
|
edit.value = props.statusAdd;
|
||||||
|
name.value = "";
|
||||||
|
if (uploader.value !== null) {
|
||||||
|
uploader.value.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteData = async (id: string) => {
|
const deleteData = async (id: string) => {
|
||||||
|
|
@ -206,31 +228,33 @@ const deleteData = async (id: string) => {
|
||||||
|
|
||||||
const uploadData = async () => {
|
const uploadData = async () => {
|
||||||
if (file.value.length > 0) {
|
if (file.value.length > 0) {
|
||||||
const blob = file.value.slice(0, file.value[0].size);
|
if (profileId.value !== "") {
|
||||||
const newFile = new File(blob, name.value, {
|
const blob = file.value.slice(0, file.value[0].size);
|
||||||
type: file.value[0].type,
|
const newFile = new File(blob, name.value, {
|
||||||
});
|
type: file.value[0].type,
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("avatar", newFile);
|
|
||||||
formData.append("moss", "newFile");
|
|
||||||
console.log(formData);
|
|
||||||
loaderPage(true);
|
|
||||||
await http
|
|
||||||
.post(config.API.profilePaperId(profileId.value), formData)
|
|
||||||
.then((res) => {
|
|
||||||
const data = res.data.result;
|
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
uploader.value.reset();
|
|
||||||
name.value = "";
|
|
||||||
edit.value = false;
|
|
||||||
emit("update:statusEdit", false);
|
|
||||||
await getData();
|
|
||||||
});
|
});
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("avatar", newFile);
|
||||||
|
formData.append("moss", "newFile");
|
||||||
|
console.log(formData);
|
||||||
|
loaderPage(true);
|
||||||
|
await http
|
||||||
|
.post(config.API.profilePaperId(profileId.value), formData)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
uploader.value.reset();
|
||||||
|
name.value = "";
|
||||||
|
edit.value = false;
|
||||||
|
emit("update:statusEdit", false);
|
||||||
|
await getData();
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// modalError(
|
// modalError(
|
||||||
// $q,
|
// $q,
|
||||||
|
|
|
||||||
|
|
@ -506,7 +506,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -960,42 +962,44 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileEduId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileEduId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
level: e.educationLevel,
|
id: e.id,
|
||||||
levelId: e.educationLevelId,
|
level: e.educationLevel,
|
||||||
positionPath: e.positionPath,
|
levelId: e.educationLevelId,
|
||||||
positionPathId: e.positionPathId,
|
positionPath: e.positionPath,
|
||||||
institute: e.institute,
|
positionPathId: e.positionPathId,
|
||||||
degree: e.degree,
|
institute: e.institute,
|
||||||
field: e.field,
|
degree: e.degree,
|
||||||
gpa: e.gpa,
|
field: e.field,
|
||||||
country: e.country,
|
gpa: e.gpa,
|
||||||
duration: e.duration,
|
country: e.country,
|
||||||
durationYear: e.durationYear,
|
duration: e.duration,
|
||||||
other: e.other,
|
durationYear: e.durationYear,
|
||||||
fundName: e.fundName,
|
other: e.other,
|
||||||
finishDate: new Date(e.finishDate),
|
fundName: e.fundName,
|
||||||
startDate: new Date(e.startDate).getFullYear(),
|
finishDate: new Date(e.finishDate),
|
||||||
endDate: new Date(e.endDate).getFullYear(),
|
startDate: new Date(e.startDate).getFullYear(),
|
||||||
createdFullName: e.createdFullName,
|
endDate: new Date(e.endDate).getFullYear(),
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1090,43 +1094,46 @@ const clickSave = async () => {
|
||||||
/**
|
/**
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
// const filter = OpsFilter.value.levelOptions.filter(
|
if (profileId.value !== "") {
|
||||||
// (r: any) => r.id == levelId.value
|
// const filter = OpsFilter.value.levelOptions.filter(
|
||||||
// );
|
// (r: any) => r.id == levelId.value
|
||||||
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
|
// );
|
||||||
// (r: any) => r.id == positionPathId.value
|
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
|
||||||
// );
|
// (r: any) => r.id == positionPathId.value
|
||||||
loaderPage(true);
|
// );
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileEduId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileEduId(profileId.value), {
|
||||||
// educationLevel: filter[0].name,
|
id: id.value,
|
||||||
educationLevelId: levelId.value,
|
// educationLevel: filter[0].name,
|
||||||
positionPathId: positionPathId.value,
|
educationLevelId: levelId.value,
|
||||||
institute: institute.value,
|
positionPathId: positionPathId.value,
|
||||||
degree: degree.value,
|
institute: institute.value,
|
||||||
field: field.value,
|
degree: degree.value,
|
||||||
gpa: gpa.value,
|
field: field.value,
|
||||||
country: country.value,
|
gpa: gpa.value,
|
||||||
duration: duration.value,
|
country: country.value,
|
||||||
durationYear: durationYear.value,
|
duration: duration.value,
|
||||||
other: other.value,
|
durationYear: durationYear.value,
|
||||||
fundName: fundName.value,
|
other: other.value,
|
||||||
finishDate: dateToISO(finishDate.value),
|
fundName: fundName.value,
|
||||||
startDate: new Date(`${startDate.value}-01-01`),
|
finishDate: dateToISO(finishDate.value),
|
||||||
endDate: new Date(`${endDate.value}-01-01`),
|
startDate: new Date(`${startDate.value}-01-01`),
|
||||||
})
|
endDate: new Date(`${endDate.value}-01-01`),
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@
|
||||||
header="ข้อมูลที่อยู่"
|
header="ข้อมูลที่อยู่"
|
||||||
icon="mdi-map-marker"
|
icon="mdi-map-marker"
|
||||||
:save="saveData"
|
:save="saveData"
|
||||||
:history="true"
|
:history="!statusAdd()"
|
||||||
:changeBtn="changeBtn"
|
:changeBtn="changeBtn"
|
||||||
:disable="statusEdit"
|
:disable="statusEdit"
|
||||||
:cancel="refreshData"
|
:cancel="refreshData"
|
||||||
:historyClick="clickHistory"
|
:historyClick="clickHistory"
|
||||||
|
:addEmployee="statusAdd()"
|
||||||
/>
|
/>
|
||||||
<q-form ref="myform">
|
<q-form ref="myform">
|
||||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||||
|
|
@ -311,6 +312,10 @@ const props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
statusAdd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["update:statusEdit"]);
|
const emit = defineEmits(["update:statusEdit"]);
|
||||||
|
|
||||||
|
|
@ -507,8 +512,28 @@ const visibleColumnsHistory = ref<String[]>([
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getNewData();
|
await getNewData();
|
||||||
emit("update:statusEdit", false);
|
emit("update:statusEdit", false);
|
||||||
|
defaultAdd();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const statusAdd = () => props.statusAdd;
|
||||||
|
|
||||||
|
const defaultAdd = () => {
|
||||||
|
if (props.statusAdd) {
|
||||||
|
edit.value = props.statusAdd;
|
||||||
|
addressData.value = {
|
||||||
|
address: null,
|
||||||
|
provinceId: null,
|
||||||
|
districtId: null,
|
||||||
|
subdistrictId: null,
|
||||||
|
addressC: null,
|
||||||
|
provinceIdC: null,
|
||||||
|
districtIdC: null,
|
||||||
|
subdistrictIdC: null,
|
||||||
|
same: "0",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const filterSelector = (val: any, update: Function, refData: string) => {
|
const filterSelector = (val: any, update: Function, refData: string) => {
|
||||||
switch (refData) {
|
switch (refData) {
|
||||||
case "provinceOps":
|
case "provinceOps":
|
||||||
|
|
@ -556,37 +581,39 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
||||||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
||||||
*/
|
*/
|
||||||
const clickHistory = async () => {
|
const clickHistory = async () => {
|
||||||
modalHistory.value = true;
|
if (route.params.id) {
|
||||||
loaderPage(true);
|
modalHistory.value = true;
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileAdrsHisId(route.params.id.toString()))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileAdrsHisId(route.params.id.toString()))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rowsHistory.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: RequestItemsHistoryObject) => {
|
rowsHistory.value = [];
|
||||||
rowsHistory.value.push({
|
data.map((e: RequestItemsHistoryObject) => {
|
||||||
currentAddress: e.currentAddress,
|
rowsHistory.value.push({
|
||||||
currentDistrict: e.currentDistrict,
|
currentAddress: e.currentAddress,
|
||||||
currentProvince: e.currentProvince,
|
currentDistrict: e.currentDistrict,
|
||||||
currentSubDistrict: e.currentSubDistrict,
|
currentProvince: e.currentProvince,
|
||||||
currentZipCode: e.currentZipCode,
|
currentSubDistrict: e.currentSubDistrict,
|
||||||
registrationSame: e.registrationSame,
|
currentZipCode: e.currentZipCode,
|
||||||
registrationAddress: e.registrationAddress,
|
registrationSame: e.registrationSame,
|
||||||
registrationDistrict: e.registrationDistrict,
|
registrationAddress: e.registrationAddress,
|
||||||
registrationProvince: e.registrationProvince,
|
registrationDistrict: e.registrationDistrict,
|
||||||
registrationSubDistrict: e.registrationSubDistrict,
|
registrationProvince: e.registrationProvince,
|
||||||
registrationZipCode: e.registrationZipCode,
|
registrationSubDistrict: e.registrationSubDistrict,
|
||||||
createdFullName: e.createdFullName,
|
registrationZipCode: e.registrationZipCode,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const refreshData = async () => {
|
const refreshData = async () => {
|
||||||
|
|
@ -606,27 +633,29 @@ const getNewData = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (route.params.id) {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileAdrsId(route.params.id.toString()))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileAdrsId(route.params.id.toString()))
|
||||||
const data: ResponseObject = res.data.result;
|
.then((res) => {
|
||||||
addressData.value.address = data.registrationAddress;
|
const data: ResponseObject = res.data.result;
|
||||||
addressData.value.addressC = data.currentAddress;
|
addressData.value.address = data.registrationAddress;
|
||||||
addressData.value.districtId = data.registrationDistrictId;
|
addressData.value.addressC = data.currentAddress;
|
||||||
addressData.value.districtIdC = data.currentDistrictId;
|
addressData.value.districtId = data.registrationDistrictId;
|
||||||
addressData.value.provinceId = data.registrationProvinceId;
|
addressData.value.districtIdC = data.currentDistrictId;
|
||||||
addressData.value.provinceIdC = data.currentProvinceId;
|
addressData.value.provinceId = data.registrationProvinceId;
|
||||||
addressData.value.subdistrictId = data.registrationSubDistrictId;
|
addressData.value.provinceIdC = data.currentProvinceId;
|
||||||
addressData.value.subdistrictIdC = data.currentSubDistrictId;
|
addressData.value.subdistrictId = data.registrationSubDistrictId;
|
||||||
addressData.value.same = data.registrationSame ? "1" : "0";
|
addressData.value.subdistrictIdC = data.currentSubDistrictId;
|
||||||
})
|
addressData.value.same = data.registrationSame ? "1" : "0";
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(() => {
|
})
|
||||||
loaderPage(false);
|
.finally(() => {
|
||||||
});
|
loaderPage(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const editData = async () => {
|
const editData = async () => {
|
||||||
|
|
@ -676,12 +705,34 @@ const editData = async () => {
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
await myform.value.validate().then(async (success: boolean) => {
|
await myform.value.validate().then(async (success: boolean) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
await editData();
|
if (props.statusAdd) {
|
||||||
|
await addData();
|
||||||
|
} else {
|
||||||
|
await editData();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const addData = async () => {
|
||||||
|
// loaderPage(true);
|
||||||
|
// await http
|
||||||
|
// .put(config.API.profileInforId(route.params.id.toString()), body)
|
||||||
|
// .then((res) => {
|
||||||
|
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
// })
|
||||||
|
// .catch((e) => {
|
||||||
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(async () => {
|
||||||
|
// edit.value = false;
|
||||||
|
// emit("update:statusEdit", false);
|
||||||
|
// await fetchData();
|
||||||
|
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
const selectProvince = async (e: string | null, name: string) => {
|
const selectProvince = async (e: string | null, name: string) => {
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
if (name == "1") {
|
if (name == "1") {
|
||||||
|
|
|
||||||
|
|
@ -285,6 +285,10 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
statusAdd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -316,7 +320,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขใบอ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -484,31 +490,33 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileCertId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileCertId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
certificateNo: e.certificateNo,
|
id: e.id,
|
||||||
issuer: e.issuer,
|
certificateNo: e.certificateNo,
|
||||||
issueDate: new Date(e.issueDate),
|
issuer: e.issuer,
|
||||||
expireDate: new Date(e.expireDate),
|
issueDate: new Date(e.issueDate),
|
||||||
certificateType: e.certificateType,
|
expireDate: new Date(e.expireDate),
|
||||||
createdFullName: e.createdFullName,
|
certificateType: e.certificateType,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -595,26 +603,28 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileCertId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileCertId(profileId.value), {
|
||||||
certificateNo: certificateNo.value,
|
id: id.value,
|
||||||
issuer: issuer.value,
|
certificateNo: certificateNo.value,
|
||||||
issueDate: dateToISO(issueDate.value),
|
issuer: issuer.value,
|
||||||
expireDate: dateToISO(expireDate.value),
|
issueDate: dateToISO(issueDate.value),
|
||||||
certificateType: certificateType.value,
|
expireDate: dateToISO(expireDate.value),
|
||||||
})
|
certificateType: certificateType.value,
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@
|
||||||
header="ข้อมูลครอบครัว"
|
header="ข้อมูลครอบครัว"
|
||||||
icon="mdi-account-group"
|
icon="mdi-account-group"
|
||||||
:save="saveData"
|
:save="saveData"
|
||||||
:history="true"
|
:history="!statusAdd()"
|
||||||
:changeBtn="changeBtn"
|
:changeBtn="changeBtn"
|
||||||
:disable="statusEdit"
|
:disable="statusEdit"
|
||||||
:cancel="refreshData"
|
:cancel="refreshData"
|
||||||
:historyClick="historyData"
|
:historyClick="historyData"
|
||||||
|
:addEmployee="statusAdd()"
|
||||||
/>
|
/>
|
||||||
<q-form ref="myform" class="col-12">
|
<q-form ref="myform" class="col-12">
|
||||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||||
|
|
@ -784,6 +785,10 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => console.log("not function"),
|
default: () => console.log("not function"),
|
||||||
},
|
},
|
||||||
|
statusAdd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["update:statusEdit"]);
|
const emit = defineEmits(["update:statusEdit"]);
|
||||||
|
|
||||||
|
|
@ -835,8 +840,37 @@ onMounted(async () => {
|
||||||
await fetchPrefix();
|
await fetchPrefix();
|
||||||
await fetchData();
|
await fetchData();
|
||||||
emit("update:statusEdit", false);
|
emit("update:statusEdit", false);
|
||||||
|
defaultAdd();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const statusAdd = () => props.statusAdd;
|
||||||
|
|
||||||
|
const defaultAdd = () => {
|
||||||
|
if (props.statusAdd) {
|
||||||
|
edit.value = props.statusAdd;
|
||||||
|
familyData.value = {
|
||||||
|
prefixC: null,
|
||||||
|
prefixIdC: null,
|
||||||
|
firstnameC: null,
|
||||||
|
lastnameC: null,
|
||||||
|
lastnameCOld: null,
|
||||||
|
occupationC: null,
|
||||||
|
prefixM: null,
|
||||||
|
prefixIdM: null,
|
||||||
|
firstnameM: null,
|
||||||
|
lastnameM: null,
|
||||||
|
occupationM: null,
|
||||||
|
prefixF: null,
|
||||||
|
prefixIdF: null,
|
||||||
|
firstnameF: null,
|
||||||
|
lastnameF: null,
|
||||||
|
occupationF: null,
|
||||||
|
same: "0",
|
||||||
|
childrens: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const historyData = async () => {
|
const historyData = async () => {
|
||||||
await fetchHistory();
|
await fetchHistory();
|
||||||
};
|
};
|
||||||
|
|
@ -955,53 +989,55 @@ const fetchHistory = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (route.params.id) {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileFamiId(route.params.id.toString()))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileFamiId(route.params.id.toString()))
|
||||||
const data: ResponseObject = res.data.result;
|
.then((res) => {
|
||||||
familyData.value.prefixC = "";
|
const data: ResponseObject = res.data.result;
|
||||||
familyData.value.prefixIdC = data.couplePrefixId;
|
familyData.value.prefixC = "";
|
||||||
familyData.value.firstnameC = data.coupleFirstName;
|
familyData.value.prefixIdC = data.couplePrefixId;
|
||||||
familyData.value.lastnameC = data.coupleLastName;
|
familyData.value.firstnameC = data.coupleFirstName;
|
||||||
familyData.value.lastnameCOld = data.coupleLastNameOld;
|
familyData.value.lastnameC = data.coupleLastName;
|
||||||
familyData.value.occupationC = data.coupleCareer;
|
familyData.value.lastnameCOld = data.coupleLastNameOld;
|
||||||
familyData.value.prefixM = "";
|
familyData.value.occupationC = data.coupleCareer;
|
||||||
familyData.value.prefixIdM = data.fatherPrefixId;
|
familyData.value.prefixM = "";
|
||||||
|
familyData.value.prefixIdM = data.fatherPrefixId;
|
||||||
|
|
||||||
familyData.value.firstnameM = data.fatherFirstName;
|
familyData.value.firstnameM = data.fatherFirstName;
|
||||||
familyData.value.lastnameM = data.fatherLastName;
|
familyData.value.lastnameM = data.fatherLastName;
|
||||||
familyData.value.occupationM = data.fatherCareer;
|
familyData.value.occupationM = data.fatherCareer;
|
||||||
familyData.value.prefixF = "";
|
familyData.value.prefixF = "";
|
||||||
familyData.value.prefixIdF = data.motherPrefixId;
|
familyData.value.prefixIdF = data.motherPrefixId;
|
||||||
|
|
||||||
familyData.value.firstnameF = data.motherFirstName;
|
familyData.value.firstnameF = data.motherFirstName;
|
||||||
familyData.value.lastnameF = data.motherLastName;
|
familyData.value.lastnameF = data.motherLastName;
|
||||||
familyData.value.occupationF = data.motherCareer;
|
familyData.value.occupationF = data.motherCareer;
|
||||||
familyData.value.same = data.couple ? "1" : "0";
|
familyData.value.same = data.couple ? "1" : "0";
|
||||||
|
|
||||||
if (data.childrens.length > 0) {
|
if (data.childrens.length > 0) {
|
||||||
let dataChild: childrenFamily[] = [];
|
let dataChild: childrenFamily[] = [];
|
||||||
data.childrens.map((row: childrenFamily, index: number) => {
|
data.childrens.map((row: childrenFamily, index: number) => {
|
||||||
dataChild.push({
|
dataChild.push({
|
||||||
id: `${index + 1}`,
|
id: `${index + 1}`,
|
||||||
childrenPrefixId: row.childrenPrefixId,
|
childrenPrefixId: row.childrenPrefixId,
|
||||||
childrenFirstName: row.childrenFirstName,
|
childrenFirstName: row.childrenFirstName,
|
||||||
childrenLastName: row.childrenLastName,
|
childrenLastName: row.childrenLastName,
|
||||||
childrenCareer: row.childrenCareer,
|
childrenCareer: row.childrenCareer,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
familyData.value.childrens = dataChild;
|
||||||
familyData.value.childrens = dataChild;
|
} else {
|
||||||
} else {
|
familyData.value.childrens = [];
|
||||||
familyData.value.childrens = [];
|
}
|
||||||
}
|
})
|
||||||
})
|
.catch((e) => {
|
||||||
.catch((e) => {
|
messageError($q, e);
|
||||||
messageError($q, e);
|
})
|
||||||
})
|
.finally(async () => {
|
||||||
.finally(async () => {
|
loaderPage(false);
|
||||||
loaderPage(false);
|
});
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const editData = async () => {
|
const editData = async () => {
|
||||||
|
|
@ -1040,10 +1076,32 @@ const editData = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const addData = async () => {
|
||||||
|
// loaderPage(true);
|
||||||
|
// await http
|
||||||
|
// .put(config.API.profileInforId(route.params.id.toString()), body)
|
||||||
|
// .then((res) => {
|
||||||
|
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
// })
|
||||||
|
// .catch((e) => {
|
||||||
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(async () => {
|
||||||
|
// edit.value = false;
|
||||||
|
// emit("update:statusEdit", false);
|
||||||
|
// await fetchData();
|
||||||
|
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
await myform.value?.validate().then(async (success: boolean) => {
|
await myform.value?.validate().then(async (success: boolean) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
await editData();
|
if (props.statusAdd) {
|
||||||
|
await addData();
|
||||||
|
} else {
|
||||||
|
await editData();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@
|
||||||
header="ข้อมูลส่วนตัว"
|
header="ข้อมูลส่วนตัว"
|
||||||
icon="mdi-account"
|
icon="mdi-account"
|
||||||
:save="saveData"
|
:save="saveData"
|
||||||
:history="true"
|
:history="!statusAdd()"
|
||||||
:changeBtn="changeBtn"
|
:changeBtn="changeBtn"
|
||||||
:disable="statusEdit"
|
:disable="statusEdit"
|
||||||
:cancel="onCancel"
|
:cancel="onCancel"
|
||||||
:historyClick="clickHistory"
|
:historyClick="clickHistory"
|
||||||
|
:addEmployee="statusAdd()"
|
||||||
/>
|
/>
|
||||||
<q-form ref="myform" class="col-12">
|
<q-form ref="myform" class="col-12">
|
||||||
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-sm">
|
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-sm">
|
||||||
|
|
@ -438,6 +439,10 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => console.log("not function"),
|
default: () => console.log("not function"),
|
||||||
},
|
},
|
||||||
|
statusAdd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["update:statusEdit"]);
|
const emit = defineEmits(["update:statusEdit"]);
|
||||||
|
|
||||||
|
|
@ -692,8 +697,36 @@ onMounted(async () => {
|
||||||
await fetchPerson();
|
await fetchPerson();
|
||||||
await fetchData();
|
await fetchData();
|
||||||
emit("update:statusEdit", false);
|
emit("update:statusEdit", false);
|
||||||
|
defaultAdd();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const statusAdd = () => props.statusAdd;
|
||||||
|
|
||||||
|
const defaultAdd = () => {
|
||||||
|
if (props.statusAdd) {
|
||||||
|
edit.value = props.statusAdd;
|
||||||
|
informaData.value = {
|
||||||
|
cardid: null,
|
||||||
|
age: null,
|
||||||
|
prefix: null,
|
||||||
|
prefixId: null,
|
||||||
|
firstname: null,
|
||||||
|
lastname: null,
|
||||||
|
birthDate: null,
|
||||||
|
genderId: null,
|
||||||
|
bloodId: null,
|
||||||
|
nationality: null,
|
||||||
|
ethnicity: null,
|
||||||
|
statusId: null,
|
||||||
|
religionId: null,
|
||||||
|
tel: null,
|
||||||
|
employeeType: null,
|
||||||
|
employeeClass: null,
|
||||||
|
profileType: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const onCancel = async () => {
|
const onCancel = async () => {
|
||||||
if (myform.value != null) {
|
if (myform.value != null) {
|
||||||
myform.value.reset();
|
myform.value.reset();
|
||||||
|
|
@ -821,50 +854,52 @@ const checkCitizen = async (id: string) => {
|
||||||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
||||||
*/
|
*/
|
||||||
const clickHistory = async () => {
|
const clickHistory = async () => {
|
||||||
modalHistory.value = true;
|
if (route.params.id) {
|
||||||
loaderPage(true);
|
modalHistory.value = true;
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileInforHisId(route.params.id.toString()))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileInforHisId(route.params.id.toString()))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rowsHistory.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: RequestItemsHistoryObject) => {
|
rowsHistory.value = [];
|
||||||
rowsHistory.value.push({
|
data.map((e: RequestItemsHistoryObject) => {
|
||||||
citizenId: e.citizenId,
|
rowsHistory.value.push({
|
||||||
prefix: e.prefix,
|
citizenId: e.citizenId,
|
||||||
firstName: e.firstName,
|
prefix: e.prefix,
|
||||||
lastName: e.lastName,
|
firstName: e.firstName,
|
||||||
birthDate: new Date(e.birthDate),
|
lastName: e.lastName,
|
||||||
gender: e.gender,
|
birthDate: new Date(e.birthDate),
|
||||||
relationship: e.relationship,
|
gender: e.gender,
|
||||||
bloodGroup: e.bloodGroup,
|
relationship: e.relationship,
|
||||||
nationality: e.nationality,
|
bloodGroup: e.bloodGroup,
|
||||||
race: e.race,
|
nationality: e.nationality,
|
||||||
religion: e.religion,
|
race: e.race,
|
||||||
telephoneNumber: e.telephoneNumber,
|
religion: e.religion,
|
||||||
employeeType:
|
telephoneNumber: e.telephoneNumber,
|
||||||
e.employeeType == "gov"
|
employeeType:
|
||||||
? "งบประมาณเงินอุดหนุนรัฐบาล"
|
e.employeeType == "gov"
|
||||||
: e.employeeType == "bkk"
|
? "งบประมาณเงินอุดหนุนรัฐบาล"
|
||||||
? "งบประมาณกรุงเทพมหานคร"
|
: e.employeeType == "bkk"
|
||||||
: "-",
|
? "งบประมาณกรุงเทพมหานคร"
|
||||||
employeeClass:
|
: "-",
|
||||||
e.employeeClass == "perm"
|
employeeClass:
|
||||||
? "ลูกจ้างประจำ"
|
e.employeeClass == "perm"
|
||||||
: e.employeeClass == "temp"
|
? "ลูกจ้างประจำ"
|
||||||
? "ลูกจ้างชั่วคราว"
|
: e.employeeClass == "temp"
|
||||||
: "-",
|
? "ลูกจ้างชั่วคราว"
|
||||||
createdFullName: e.createdFullName,
|
: "-",
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const filterSelector = (val: any, update: Function, refData: string) => {
|
const filterSelector = (val: any, update: Function, refData: string) => {
|
||||||
|
|
@ -961,44 +996,49 @@ const calRetire = async (birth: Date) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (route.params.id) {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileInforId(route.params.id.toString()))
|
await http
|
||||||
.then(async (res: any) => {
|
.get(config.API.profileInforId(route.params.id.toString()))
|
||||||
const data: ResponseObject = res.data.result;
|
.then(async (res: any) => {
|
||||||
defaultCitizenData.value = data.citizenId;
|
const data: ResponseObject = res.data.result;
|
||||||
informaData.value.cardid = data.citizenId;
|
defaultCitizenData.value = data.citizenId;
|
||||||
informaData.value.prefix = "";
|
informaData.value.cardid = data.citizenId;
|
||||||
informaData.value.prefixId = data.prefixId;
|
informaData.value.prefix = "";
|
||||||
informaData.value.firstname = data.firstName;
|
informaData.value.prefixId = data.prefixId;
|
||||||
informaData.value.lastname = data.lastName;
|
informaData.value.firstname = data.firstName;
|
||||||
informaData.value.birthDate = new Date(data.birthDate);
|
informaData.value.lastname = data.lastName;
|
||||||
informaData.value.genderId = data.genderId;
|
informaData.value.birthDate = new Date(data.birthDate);
|
||||||
informaData.value.bloodId = data.bloodGroupId;
|
informaData.value.genderId = data.genderId;
|
||||||
informaData.value.nationality = data.nationality;
|
informaData.value.bloodId = data.bloodGroupId;
|
||||||
informaData.value.ethnicity = data.race;
|
informaData.value.nationality = data.nationality;
|
||||||
informaData.value.statusId = data.relationshipId;
|
informaData.value.ethnicity = data.race;
|
||||||
informaData.value.religionId = data.religionId;
|
informaData.value.statusId = data.relationshipId;
|
||||||
informaData.value.tel = data.telephoneNumber;
|
informaData.value.religionId = data.religionId;
|
||||||
informaData.value.age = data.age;
|
informaData.value.tel = data.telephoneNumber;
|
||||||
informaData.value.employeeType = data.employeeType;
|
informaData.value.age = data.age;
|
||||||
informaData.value.employeeClass = data.employeeClass;
|
informaData.value.employeeType = data.employeeType;
|
||||||
informaData.value.profileType = data.profileType;
|
informaData.value.employeeClass = data.employeeClass;
|
||||||
dateBefore.value = new Date(data.birthDate);
|
informaData.value.profileType = data.profileType;
|
||||||
same.value = data.changeName == true ? "1" : "0";
|
dateBefore.value = new Date(data.birthDate);
|
||||||
await calRetire(new Date(dateToISO(new Date(data.birthDate))));
|
same.value = data.changeName == true ? "1" : "0";
|
||||||
if (data.profileType == "officer" && columnsHistory.value.length >= 15) {
|
await calRetire(new Date(dateToISO(new Date(data.birthDate))));
|
||||||
columnsHistory.value.splice(13, 1);
|
if (
|
||||||
columnsHistory.value.splice(12, 1);
|
data.profileType == "officer" &&
|
||||||
}
|
columnsHistory.value.length >= 15
|
||||||
})
|
) {
|
||||||
.catch((e) => {
|
columnsHistory.value.splice(13, 1);
|
||||||
messageError($q, e);
|
columnsHistory.value.splice(12, 1);
|
||||||
})
|
}
|
||||||
.finally(async () => {
|
})
|
||||||
// loaderPage(false);
|
.catch((e) => {
|
||||||
await props.fetchDataProfile();
|
messageError($q, e);
|
||||||
});
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
// loaderPage(false);
|
||||||
|
await props.fetchDataProfile();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const editData = async () => {
|
const editData = async () => {
|
||||||
|
|
@ -1039,11 +1079,33 @@ const editData = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const addData = async () => {
|
||||||
|
// loaderPage(true);
|
||||||
|
// await http
|
||||||
|
// .put(config.API.profileInforId(route.params.id.toString()), body)
|
||||||
|
// .then((res) => {
|
||||||
|
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
// })
|
||||||
|
// .catch((e) => {
|
||||||
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(async () => {
|
||||||
|
// edit.value = false;
|
||||||
|
// emit("update:statusEdit", false);
|
||||||
|
// await fetchData();
|
||||||
|
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
if (myform.value != null) {
|
if (myform.value != null) {
|
||||||
await myform.value.validate().then(async (success: boolean) => {
|
await myform.value.validate().then(async (success: boolean) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
await editData();
|
if (props.statusAdd) {
|
||||||
|
await addData();
|
||||||
|
} else {
|
||||||
|
await editData();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const file = ref<string | null>(null);
|
const file = ref<string | null>(null);
|
||||||
const fileUpload = ref<any>([]);
|
const fileUpload = ref<any>([]);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
|
|
@ -538,32 +540,34 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileChangeNameId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileChangeNameId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
prefix: e.prefix,
|
id: e.id,
|
||||||
prefixId: e.prefixId,
|
prefix: e.prefix,
|
||||||
firstName: e.firstName,
|
prefixId: e.prefixId,
|
||||||
lastName: e.lastName,
|
firstName: e.firstName,
|
||||||
status: e.status,
|
lastName: e.lastName,
|
||||||
file: e.file,
|
status: e.status,
|
||||||
createdFullName: e.createdFullName,
|
file: e.file,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -665,44 +669,19 @@ const clickSave = async () => {
|
||||||
if (modalEdit.value) {
|
if (modalEdit.value) {
|
||||||
await editData();
|
await editData();
|
||||||
} else {
|
} else {
|
||||||
await saveData();
|
await checkSave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
const checkSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
|
||||||
*/
|
|
||||||
const saveData = async () => {
|
|
||||||
if (fileUpload.value.length > 0) {
|
if (fileUpload.value.length > 0) {
|
||||||
const blob = fileUpload.value.slice(0, fileUpload.value[0].size);
|
if (profileId.value !== "") {
|
||||||
const newFile = new File(blob, nameFile.value, {
|
await saveData();
|
||||||
type: fileUpload.value[0].type,
|
} else {
|
||||||
});
|
await saveDataEmployee();
|
||||||
const formData = new FormData();
|
}
|
||||||
formData.append("", newFile);
|
|
||||||
if (prefixId.value != undefined)
|
|
||||||
formData.append("prefixId", prefixId.value);
|
|
||||||
if (firstName.value != undefined)
|
|
||||||
formData.append("firstName", firstName.value);
|
|
||||||
if (lastName.value != undefined)
|
|
||||||
formData.append("lastName", lastName.value);
|
|
||||||
if (status.value != undefined) formData.append("status", status.value);
|
|
||||||
loaderPage(true);
|
|
||||||
await http
|
|
||||||
.post(config.API.profileChangeNameId(profileId.value), formData)
|
|
||||||
.then((res) => {
|
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
||||||
modal.value = false;
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
await fetchData();
|
|
||||||
await props.fetchDataInformation();
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
dialogMessage(
|
dialogMessage(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -718,6 +697,41 @@ const saveData = async () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* บันทึกเพิ่มข้อมูล
|
||||||
|
*/
|
||||||
|
const saveData = async () => {
|
||||||
|
const blob = fileUpload.value.slice(0, fileUpload.value[0].size);
|
||||||
|
const newFile = new File(blob, nameFile.value, {
|
||||||
|
type: fileUpload.value[0].type,
|
||||||
|
});
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("", newFile);
|
||||||
|
if (prefixId.value != undefined) formData.append("prefixId", prefixId.value);
|
||||||
|
if (firstName.value != undefined)
|
||||||
|
formData.append("firstName", firstName.value);
|
||||||
|
if (lastName.value != undefined) formData.append("lastName", lastName.value);
|
||||||
|
if (status.value != undefined) formData.append("status", status.value);
|
||||||
|
loaderPage(true);
|
||||||
|
await http
|
||||||
|
.post(config.API.profileChangeNameId(profileId.value), formData)
|
||||||
|
.then((res) => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
modal.value = false;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await fetchData();
|
||||||
|
await props.fetchDataInformation();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const saveDataEmployee = async () => {
|
||||||
|
console.log("saveDataEmployee");
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* บันทึกแก้ไขข้อมูล
|
* บันทึกแก้ไขข้อมูล
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
size="12px"
|
size="12px"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
v-if="edit"
|
v-if="edit && !addEmployee"
|
||||||
:color="!edit ? 'grey-7' : 'red'"
|
:color="!edit ? 'grey-7' : 'red'"
|
||||||
@click="ClickCancel"
|
@click="ClickCancel"
|
||||||
icon="mdi-undo"
|
icon="mdi-undo"
|
||||||
|
|
@ -125,6 +125,7 @@ const props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
defualt: false,
|
defualt: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
disable: {
|
disable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
defualt: false,
|
defualt: false,
|
||||||
|
|
@ -157,6 +158,10 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => console.log("not function"),
|
default: () => console.log("not function"),
|
||||||
},
|
},
|
||||||
|
addEmployee: {
|
||||||
|
type: Boolean,
|
||||||
|
defualt: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["update:edit"]);
|
const emit = defineEmits(["update:edit"]);
|
||||||
|
|
|
||||||
|
|
@ -454,7 +454,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขเคร
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -816,38 +818,40 @@ const fetchInsignia = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileInsignId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileInsignId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
insignia: e.insignia,
|
id: e.id,
|
||||||
insigniaId: e.insigniaId,
|
insignia: e.insignia,
|
||||||
insigniaType: e.insigniaType,
|
insigniaId: e.insigniaId,
|
||||||
year: e.year,
|
insigniaType: e.insigniaType,
|
||||||
no: e.no,
|
year: e.year,
|
||||||
issue: e.issue,
|
no: e.no,
|
||||||
volumeNo: e.volumeNo,
|
issue: e.issue,
|
||||||
volume: e.volume,
|
volumeNo: e.volumeNo,
|
||||||
section: e.section,
|
volume: e.volume,
|
||||||
page: e.page,
|
section: e.section,
|
||||||
receiveDate: new Date(e.receiveDate),
|
page: e.page,
|
||||||
dateAnnounce: new Date(e.dateAnnounce),
|
receiveDate: new Date(e.receiveDate),
|
||||||
createdFullName: e.createdFullName,
|
dateAnnounce: new Date(e.dateAnnounce),
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -940,32 +944,34 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileInsignId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileInsignId(profileId.value), {
|
||||||
insigniaId: insigniaId.value,
|
id: id.value,
|
||||||
insigniaType: insigniaType.value,
|
insigniaId: insigniaId.value,
|
||||||
year: year.value,
|
insigniaType: insigniaType.value,
|
||||||
no: no.value,
|
year: year.value,
|
||||||
issue: issue.value,
|
no: no.value,
|
||||||
volumeNo: volumeNo.value,
|
issue: issue.value,
|
||||||
volume: volume.value,
|
volumeNo: volumeNo.value,
|
||||||
section: section.value,
|
volume: volume.value,
|
||||||
page: page.value,
|
section: section.value,
|
||||||
receiveDate: dateToISO(receiveDate.value),
|
page: page.value,
|
||||||
dateAnnounce: dateToISO(dateAnnounce.value),
|
receiveDate: dateToISO(receiveDate.value),
|
||||||
})
|
dateAnnounce: dateToISO(dateAnnounce.value),
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -263,11 +263,7 @@
|
||||||
>
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -280,9 +276,7 @@
|
||||||
class="table_ellipsis"
|
class="table_ellipsis"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
col.value == null
|
col.value == null ? "" : col.value.toLocaleString("en-US")
|
||||||
? ""
|
|
||||||
: col.value.toLocaleString("en-US")
|
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
|
@ -442,7 +436,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขการ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filterTotal = ref<string>("");
|
const filterTotal = ref<string>("");
|
||||||
const rowsTotal = ref<RequestItemsTotalObject[]>([]); //select data history
|
const rowsTotal = ref<RequestItemsTotalObject[]>([]); //select data history
|
||||||
|
|
@ -712,34 +708,36 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
rows.value = [];
|
if (profileId.value !== "") {
|
||||||
loaderPage(true);
|
rows.value = [];
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileLeaveId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileLeaveId(profileId.value))
|
||||||
const data = res.data.result;
|
.then((res) => {
|
||||||
// console.log(data);
|
const data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
// console.log(data);
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
typeLeave: e.typeLeave,
|
id: e.id,
|
||||||
dateStartLeave: new Date(e.dateStartLeave),
|
typeLeave: e.typeLeave,
|
||||||
dateEndLeave: new Date(e.dateEndLeave),
|
dateStartLeave: new Date(e.dateStartLeave),
|
||||||
numLeave: e.numLeave,
|
dateEndLeave: new Date(e.dateEndLeave),
|
||||||
sumLeave: e.sumLeave,
|
numLeave: e.numLeave,
|
||||||
totalLeave: e.totalLeave,
|
sumLeave: e.sumLeave,
|
||||||
status: e.status,
|
totalLeave: e.totalLeave,
|
||||||
reason: e.reason,
|
status: e.status,
|
||||||
typeLeaveId: e.typeLeaveId,
|
reason: e.reason,
|
||||||
|
typeLeaveId: e.typeLeaveId,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const filterSelector = (val: any, update: Function, filtername: string) => {
|
const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||||
|
|
@ -960,30 +958,31 @@ const clickSave = async () => {
|
||||||
// * บันทึกเพิ่มข้อมูล
|
// * บันทึกเพิ่มข้อมูล
|
||||||
// */
|
// */
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
|
if (profileId.value !== "") {
|
||||||
|
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
|
||||||
loaderPage(true);
|
loaderPage(true);
|
||||||
await http
|
await http
|
||||||
.post(config.API.profileLeaveId(profileId.value), {
|
.post(config.API.profileLeaveId(profileId.value), {
|
||||||
dateStartLeave: dateToISO(dateRange.value[0]),
|
dateStartLeave: dateToISO(dateRange.value[0]),
|
||||||
dateEndLeave: dateToISO(dateRange.value[1]),
|
dateEndLeave: dateToISO(dateRange.value[1]),
|
||||||
numLeave: numLeave.value,
|
numLeave: numLeave.value,
|
||||||
sumLeave: numUsedLeave.value,
|
sumLeave: numUsedLeave.value,
|
||||||
totalLeave: sum,
|
totalLeave: sum,
|
||||||
status: statLeave.value,
|
status: statLeave.value,
|
||||||
reason: reason.value,
|
reason: reason.value,
|
||||||
typeLeaveId: typeLeave.value,
|
typeLeaveId: typeLeave.value,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
modalAdd.value = false;
|
modalAdd.value = false;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await fetchData();
|
await fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
|
|
@ -1182,28 +1181,30 @@ const addData = async () => {
|
||||||
* @param row ข้อมูล row ที่ดูประวัติการแก้ไข
|
* @param row ข้อมูล row ที่ดูประวัติการแก้ไข
|
||||||
*/
|
*/
|
||||||
const clickTotal = async () => {
|
const clickTotal = async () => {
|
||||||
rowsTotal.value = [];
|
if (profileId.value !== "") {
|
||||||
loaderPage(true);
|
rowsTotal.value = [];
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileLeaveTotalId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileLeaveTotalId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
data.map((e: ResponseTotalObject) => {
|
let data = res.data.result;
|
||||||
rowsTotal.value.push({
|
data.map((e: ResponseTotalObject) => {
|
||||||
typeLeaveId: e.typeLeaveId,
|
rowsTotal.value.push({
|
||||||
totalLeave: e.totalLeave,
|
typeLeaveId: e.typeLeaveId,
|
||||||
limitLeave: e.limitLeave,
|
totalLeave: e.totalLeave,
|
||||||
remainLeave: e.remainLeave,
|
limitLeave: e.limitLeave,
|
||||||
typeLeave: e.typeLeave,
|
remainLeave: e.remainLeave,
|
||||||
|
typeLeave: e.typeLeave,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขอื่
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -302,28 +304,30 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileOtherId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileOtherId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
date: new Date(e.date),
|
id: e.id,
|
||||||
detail: e.detail,
|
date: new Date(e.date),
|
||||||
createdFullName: e.createdFullName,
|
detail: e.detail,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -407,23 +411,25 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileOtherId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileOtherId(profileId.value), {
|
||||||
date: date.value,
|
id: id.value,
|
||||||
detail: detail.value,
|
date: date.value,
|
||||||
})
|
detail: detail.value,
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -486,12 +486,8 @@
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right">
|
||||||
<q-btn
|
<q-btn unelevated label="บันทึก" color="public" @click="Retire"
|
||||||
unelevated
|
><!-- icon="mdi-content-save-outline"
|
||||||
label="บันทึก"
|
|
||||||
color="public"
|
|
||||||
@click="Retire"
|
|
||||||
><!-- icon="mdi-content-save-outline"
|
|
||||||
<q-tooltip>บันทึก</q-tooltip> -->
|
<q-tooltip>บันทึก</q-tooltip> -->
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
|
|
@ -500,35 +496,75 @@
|
||||||
<full-loader :visibility="loader"></full-loader>
|
<full-loader :visibility="loader"></full-loader>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted, defineAsyncComponent } from "vue";
|
||||||
import { useDataStore } from "@/stores/data";
|
import { useDataStore } from "@/stores/data";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import EducationVue from "@/modules/04_registry/components/Education.vue";
|
|
||||||
import TrainVue from "@/modules/04_registry/components/Train.vue";
|
|
||||||
import InsigniaVue from "@/modules/04_registry/components/Insignia.vue";
|
|
||||||
import CoinedVue from "@/modules/04_registry/components/Coin.vue";
|
|
||||||
import AssessmentVue from "@/modules/04_registry/components/Assessment.vue";
|
|
||||||
import SalaryVue from "@/modules/04_registry/components/Salary.vue";
|
|
||||||
import SalaryEmployeeVue from "@/modules/04_registry/components/SalaryEmployee.vue";
|
|
||||||
import DisciplineVue from "@/modules/04_registry/components/Discipline.vue";
|
|
||||||
import LeaveVue from "@/modules/04_registry/components/Leave.vue";
|
|
||||||
import TalentVue from "@/modules/04_registry/components/Talent.vue";
|
|
||||||
import WorkVue from "@/modules/04_registry/components/Work.vue";
|
|
||||||
import RecordVue from "@/modules/04_registry/components/Record.vue";
|
|
||||||
import OtherVue from "@/modules/04_registry/components/Other.vue";
|
|
||||||
import DocumentVue from "@/modules/04_registry/components/Document.vue";
|
|
||||||
import Certicate from "@/modules/04_registry/components/Information/Certicate.vue";
|
|
||||||
import Information from "@/modules/04_registry/components/Information/Information.vue";
|
|
||||||
import Government from "@/modules/04_registry/components/Information/Government.vue";
|
|
||||||
import Address from "@/modules/04_registry/components/Information/Address.vue";
|
|
||||||
import Family from "@/modules/04_registry/components/Information/Family.vue";
|
|
||||||
import OldName from "@/modules/04_registry/components/Information/OldName.vue";
|
import OldName from "@/modules/04_registry/components/Information/OldName.vue";
|
||||||
import type { DataOption } from "@/modules/04_registry/interface/index/Main";
|
import type { DataOption } from "@/modules/04_registry/interface/index/Main";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
const EducationVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Education.vue")
|
||||||
|
);
|
||||||
|
const TrainVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Train.vue")
|
||||||
|
);
|
||||||
|
const InsigniaVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Insignia.vue")
|
||||||
|
);
|
||||||
|
const CoinedVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Coin.vue")
|
||||||
|
);
|
||||||
|
const AssessmentVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Assessment.vue")
|
||||||
|
);
|
||||||
|
const SalaryVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Salary.vue")
|
||||||
|
);
|
||||||
|
const SalaryEmployeeVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/SalaryEmployee.vue")
|
||||||
|
);
|
||||||
|
const DisciplineVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Discipline.vue")
|
||||||
|
);
|
||||||
|
const LeaveVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Leave.vue")
|
||||||
|
);
|
||||||
|
const TalentVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Talent.vue")
|
||||||
|
);
|
||||||
|
const WorkVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Work.vue")
|
||||||
|
);
|
||||||
|
const RecordVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Record.vue")
|
||||||
|
);
|
||||||
|
const OtherVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Other.vue")
|
||||||
|
);
|
||||||
|
const DocumentVue = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Document.vue")
|
||||||
|
);
|
||||||
|
const Certicate = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Information/Certicate.vue")
|
||||||
|
);
|
||||||
|
const Information = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Information/Information.vue")
|
||||||
|
);
|
||||||
|
const Government = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Information/Government.vue")
|
||||||
|
);
|
||||||
|
const Address = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Information/Address.vue")
|
||||||
|
);
|
||||||
|
const Family = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registry/components/Information/Family.vue")
|
||||||
|
);
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = useDataStore();
|
const store = useDataStore();
|
||||||
const { changeTab, loaderPage } = store;
|
const { changeTab, loaderPage } = store;
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,9 @@ const tittleHistory = ref<string>(
|
||||||
);
|
);
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
|
|
@ -351,29 +353,31 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileNopaidId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileNopaidId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
date: new Date(e.date),
|
id: e.id,
|
||||||
detail: e.detail,
|
date: new Date(e.date),
|
||||||
reference: e.reference,
|
detail: e.detail,
|
||||||
createdFullName: e.createdFullName,
|
reference: e.reference,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -458,24 +462,26 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileNopaidId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileNopaidId(profileId.value), {
|
||||||
date: dateToISO(date.value),
|
id: id.value,
|
||||||
detail: detail.value,
|
date: dateToISO(date.value),
|
||||||
reference: reference.value,
|
detail: detail.value,
|
||||||
})
|
reference: reference.value,
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -500,6 +500,10 @@ const props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
statusAdd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -822,7 +826,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขตำแ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<ResponseObjectEmployee[]>([]);
|
const rows = ref<ResponseObjectEmployee[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -1328,45 +1334,47 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
loaderPage(true);
|
||||||
await http
|
if (profileId.value !== "") {
|
||||||
.get(config.API.profileSalaryEmployeeId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileSalaryEmployeeId(profileId.value))
|
||||||
const data = res.data.result;
|
.then((res) => {
|
||||||
// console.log(data);
|
const data = res.data.result;
|
||||||
rows.value = [];
|
// console.log(data);
|
||||||
data.map((e: ResponseObjectEmployee) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObjectEmployee) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
date: new Date(e.date),
|
id: e.id,
|
||||||
amount: e.amount,
|
date: new Date(e.date),
|
||||||
positionSalaryAmount: e.positionSalaryAmount,
|
amount: e.amount,
|
||||||
mouthSalaryAmount: e.mouthSalaryAmount,
|
positionSalaryAmount: e.positionSalaryAmount,
|
||||||
oc: e.oc,
|
mouthSalaryAmount: e.mouthSalaryAmount,
|
||||||
ocId: e.ocId,
|
oc: e.oc,
|
||||||
posNo: e.posNo,
|
ocId: e.ocId,
|
||||||
posNoId: e.posNoId,
|
posNo: e.posNo,
|
||||||
posNoEmployee: e.posNoEmployee,
|
posNoId: e.posNoId,
|
||||||
positionEmployeeGroup: e.positionEmployeeGroup,
|
posNoEmployee: e.posNoEmployee,
|
||||||
positionEmployeeGroupId: e.positionEmployeeGroupId,
|
positionEmployeeGroup: e.positionEmployeeGroup,
|
||||||
positionEmployeeLevel: e.positionEmployeeLevel,
|
positionEmployeeGroupId: e.positionEmployeeGroupId,
|
||||||
positionEmployeeLevelId: e.positionEmployeeLevelId,
|
positionEmployeeLevel: e.positionEmployeeLevel,
|
||||||
positionEmployeePosition: e.positionEmployeePosition,
|
positionEmployeeLevelId: e.positionEmployeeLevelId,
|
||||||
positionEmployeePositionId: e.positionEmployeePositionId,
|
positionEmployeePosition: e.positionEmployeePosition,
|
||||||
positionEmployeePositionSide: e.positionEmployeePositionSide,
|
positionEmployeePositionId: e.positionEmployeePositionId,
|
||||||
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
|
positionEmployeePositionSide: e.positionEmployeePositionSide,
|
||||||
salaryClass: e.salaryClass,
|
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
|
||||||
salaryRef: e.salaryRef,
|
salaryClass: e.salaryClass,
|
||||||
createdFullName: e.createdFullName,
|
salaryRef: e.salaryRef,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchPositionNumber = async (id: string) => {
|
const fetchPositionNumber = async (id: string) => {
|
||||||
|
|
@ -1548,33 +1556,35 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileSalaryEmployeeId(profileId.value), {
|
await http
|
||||||
amount: amount.value,
|
.post(config.API.profileSalaryEmployeeId(profileId.value), {
|
||||||
date: dateToISO(date.value),
|
amount: amount.value,
|
||||||
positionSalaryAmount: positionSalaryAmount.value,
|
date: dateToISO(date.value),
|
||||||
mouthSalaryAmount: mouthSalaryAmount.value,
|
positionSalaryAmount: positionSalaryAmount.value,
|
||||||
ocId: agencyId.value,
|
mouthSalaryAmount: mouthSalaryAmount.value,
|
||||||
// posNoId: posNoId.value,
|
ocId: agencyId.value,
|
||||||
posNoEmployee: posNoEmployee.value,
|
// posNoId: posNoId.value,
|
||||||
positionEmployeeGroupId: employeeGroupId.value,
|
posNoEmployee: posNoEmployee.value,
|
||||||
positionEmployeeLevelId: employeeLevelId.value,
|
positionEmployeeGroupId: employeeGroupId.value,
|
||||||
positionEmployeePositionId: employeePositionId.value,
|
positionEmployeeLevelId: employeeLevelId.value,
|
||||||
positionEmployeePositionSideId: employeePositionSideId.value,
|
positionEmployeePositionId: employeePositionId.value,
|
||||||
salaryClass: salaryClass.value,
|
positionEmployeePositionSideId: employeePositionSideId.value,
|
||||||
salaryRef: salaryRef.value,
|
salaryClass: salaryClass.value,
|
||||||
})
|
salaryRef: salaryRef.value,
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขควา
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -506,32 +508,34 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileAbiliId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileAbiliId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
field: e.field,
|
id: e.id,
|
||||||
detail: e.detail,
|
field: e.field,
|
||||||
remark: e.remark,
|
detail: e.detail,
|
||||||
dateStart: new Date(e.dateStart),
|
remark: e.remark,
|
||||||
dateEnd: new Date(e.dateEnd),
|
dateStart: new Date(e.dateStart),
|
||||||
reference: e.reference,
|
dateEnd: new Date(e.dateEnd),
|
||||||
createdFullName: e.createdFullName,
|
reference: e.reference,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -619,27 +623,29 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileAbiliId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileAbiliId(profileId.value), {
|
||||||
field: field.value,
|
id: id.value,
|
||||||
detail: detail.value,
|
field: field.value,
|
||||||
remark: remark.value,
|
detail: detail.value,
|
||||||
dateStart: dateToISO(dateStart.value),
|
remark: remark.value,
|
||||||
dateEnd: dateToISO(dateEnd.value),
|
dateStart: dateToISO(dateStart.value),
|
||||||
reference: reference.value,
|
dateEnd: dateToISO(dateEnd.value),
|
||||||
})
|
reference: reference.value,
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขการ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -751,36 +753,38 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileTrainId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileTrainId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
name: e.name,
|
id: e.id,
|
||||||
topic: e.topic,
|
name: e.name,
|
||||||
yearly: e.yearly,
|
topic: e.topic,
|
||||||
place: e.place,
|
yearly: e.yearly,
|
||||||
duration: e.duration,
|
place: e.place,
|
||||||
department: e.department,
|
duration: e.duration,
|
||||||
numberOrder: e.numberOrder,
|
department: e.department,
|
||||||
dateOrder: e.dateOrder,
|
numberOrder: e.numberOrder,
|
||||||
startDate: new Date(e.startDate),
|
dateOrder: e.dateOrder,
|
||||||
endDate: new Date(e.endDate),
|
startDate: new Date(e.startDate),
|
||||||
createdFullName: e.createdFullName,
|
endDate: new Date(e.endDate),
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -872,31 +876,33 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileTrainId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileTrainId(profileId.value), {
|
||||||
name: name.value,
|
id: id.value,
|
||||||
topic: topic.value,
|
name: name.value,
|
||||||
yearly: yearly.value,
|
topic: topic.value,
|
||||||
place: place.value,
|
yearly: yearly.value,
|
||||||
duration: duration.value,
|
place: place.value,
|
||||||
department: department.value,
|
duration: duration.value,
|
||||||
numberOrder: numberOrder.value,
|
department: department.value,
|
||||||
dateOrder: dateOrder.value,
|
numberOrder: numberOrder.value,
|
||||||
startDate: dateToISO(startDate.value),
|
dateOrder: dateOrder.value,
|
||||||
endDate: dateToISO(endDate.value),
|
startDate: dateToISO(startDate.value),
|
||||||
})
|
endDate: dateToISO(endDate.value),
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขปฏิ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -426,30 +428,32 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.get(config.API.profileDutyId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileDutyId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
dateStart: new Date(e.dateStart),
|
id: e.id,
|
||||||
dateEnd: new Date(e.dateEnd),
|
dateStart: new Date(e.dateStart),
|
||||||
detail: e.detail,
|
dateEnd: new Date(e.dateEnd),
|
||||||
reference: e.reference,
|
detail: e.detail,
|
||||||
createdFullName: e.createdFullName,
|
reference: e.reference,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loaderPage(false);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -535,25 +539,27 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
loaderPage(true);
|
if (profileId.value !== "") {
|
||||||
await http
|
loaderPage(true);
|
||||||
.post(config.API.profileDutyId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileDutyId(profileId.value), {
|
||||||
dateStart: dateToISO(dateStart.value),
|
id: id.value,
|
||||||
dateEnd: dateToISO(dateEnd.value),
|
dateStart: dateToISO(dateStart.value),
|
||||||
detail: detail.value,
|
dateEnd: dateToISO(dateEnd.value),
|
||||||
reference: reference.value,
|
detail: detail.value,
|
||||||
})
|
reference: reference.value,
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ interface Information {
|
||||||
prefixId: string | null;
|
prefixId: string | null;
|
||||||
firstname: string | null;
|
firstname: string | null;
|
||||||
lastname: string | null;
|
lastname: string | null;
|
||||||
birthDate: Date;
|
birthDate: Date | null;
|
||||||
genderId: string | null;
|
genderId: string | null;
|
||||||
bloodId: string | null;
|
bloodId: string | null;
|
||||||
nationality: string | null;
|
nationality: string | null;
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,10 @@ const tittleHistory = ref<string>("ประวัติแก้ไขใบอ
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
const filterHistory = ref<string>(""); //search data table history
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||||
// const profileId = ref<string>(route.params.id.toString());
|
// const profileId = ref<string>(
|
||||||
const profileId = ref<string>('');
|
// route.params.id ? route.params.id.toString() : ""
|
||||||
|
// );
|
||||||
|
const profileId = ref<string>("");
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<RequestItemsObject[]>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
|
|
@ -226,34 +228,39 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// await fetchData();
|
// await fetchData();
|
||||||
|
if (route.params.id) {
|
||||||
|
profileId.value = route.params.id.toString();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
showLoader();
|
if (profileId.value != "") {
|
||||||
await http
|
showLoader();
|
||||||
.get(config.API.profileCertId(profileId.value))
|
await http
|
||||||
.then((res) => {
|
.get(config.API.profileCertId(profileId.value))
|
||||||
let data = res.data.result;
|
.then((res) => {
|
||||||
rows.value = [];
|
let data = res.data.result;
|
||||||
data.map((e: ResponseObject) => {
|
rows.value = [];
|
||||||
rows.value.push({
|
data.map((e: ResponseObject) => {
|
||||||
id: e.id,
|
rows.value.push({
|
||||||
certificateNo: e.certificateNo,
|
id: e.id,
|
||||||
issuer: e.issuer,
|
certificateNo: e.certificateNo,
|
||||||
issueDate: new Date(e.issueDate),
|
issuer: e.issuer,
|
||||||
expireDate: new Date(e.expireDate),
|
issueDate: new Date(e.issueDate),
|
||||||
certificateType: e.certificateType,
|
expireDate: new Date(e.expireDate),
|
||||||
createdFullName: e.createdFullName,
|
certificateType: e.certificateType,
|
||||||
createdAt: new Date(e.createdAt),
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: new Date(e.createdAt),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -340,26 +347,28 @@ const clickSave = async () => {
|
||||||
* บันทึกเพิ่มข้อมูล
|
* บันทึกเพิ่มข้อมูล
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
showLoader();
|
if (profileId.value !== "") {
|
||||||
await http
|
showLoader();
|
||||||
.post(config.API.profileCertId(profileId.value), {
|
await http
|
||||||
id: id.value,
|
.post(config.API.profileCertId(profileId.value), {
|
||||||
certificateNo: certificateNo.value,
|
id: id.value,
|
||||||
issuer: issuer.value,
|
certificateNo: certificateNo.value,
|
||||||
issueDate: dateToISO(issueDate.value),
|
issuer: issuer.value,
|
||||||
expireDate: dateToISO(expireDate.value),
|
issueDate: dateToISO(issueDate.value),
|
||||||
certificateType: certificateType.value,
|
expireDate: dateToISO(expireDate.value),
|
||||||
})
|
certificateType: certificateType.value,
|
||||||
.then((res) => {
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then((res) => {
|
||||||
modal.value = false;
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
modal.value = false;
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.finally(async () => {
|
})
|
||||||
await fetchData();
|
.finally(async () => {
|
||||||
});
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,16 @@
|
||||||
/**
|
/**
|
||||||
* Router ระบบทะเบียนประวัติลูกจ้าง (registryEmployee)
|
* Router ระบบทะเบียนประวัติลูกจ้าง (registryEmployee)
|
||||||
*/
|
*/
|
||||||
|
import { defineAsyncComponent } from "vue";
|
||||||
|
|
||||||
const Main = () => import("@/modules/08_registryEmployee/views/Main.vue");
|
// const Main = () => import("@/modules/08_registryEmployee/views/Main.vue");
|
||||||
// const Detail = () =>
|
// const Detail = () => import("@/modules/08_registryEmployee/views/Detail.vue");
|
||||||
// import("@/modules/08_registryEmployee/components/Profile.vue");
|
const Main = defineAsyncComponent(
|
||||||
|
() => import("@/modules/08_registryEmployee/views/Main.vue")
|
||||||
|
);
|
||||||
|
const Detail = defineAsyncComponent(
|
||||||
|
() => import("@/modules/08_registryEmployee/views/Detail.vue")
|
||||||
|
);
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
|
|
@ -23,8 +29,18 @@ export default [
|
||||||
// component: Detail,
|
// component: Detail,
|
||||||
// meta: {
|
// meta: {
|
||||||
// Auth: true,
|
// Auth: true,
|
||||||
// Key: [9],
|
// Key: [10],
|
||||||
// Role: "registryEmployeeDetails",
|
// Role: "registryEmployeeDetails",
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
|
{
|
||||||
|
path: "/registryEmployee/add",
|
||||||
|
name: "registryEmployeeAdd",
|
||||||
|
component: Detail,
|
||||||
|
meta: {
|
||||||
|
Auth: true,
|
||||||
|
Key: [11],
|
||||||
|
Role: "registryEmployee",
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
1012
src/modules/08_registryEmployee/views/Detail.vue
Normal file
1012
src/modules/08_registryEmployee/views/Detail.vue
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -169,6 +169,7 @@ import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import type { QInput, QForm } from "quasar";
|
import type { QInput, QForm } from "quasar";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
|
@ -187,6 +188,7 @@ const $q = useQuasar();
|
||||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||||
const { dialogMessage, messageError, showLoader, hideLoader } = mixin;
|
const { dialogMessage, messageError, showLoader, hideLoader } = mixin;
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
const myForm = ref<QForm>();
|
const myForm = ref<QForm>();
|
||||||
const filterRef = ref<QInput>();
|
const filterRef = ref<QInput>();
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
|
|
@ -488,6 +490,10 @@ onMounted(async () => {
|
||||||
await nodeTree();
|
await nodeTree();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const next = (id: string) => {
|
||||||
|
router.push(`/registryEmployee/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
const paginationLabel = (start: number, end: number, total: number) => {
|
const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
// if (props.paging == true)
|
// if (props.paging == true)
|
||||||
// return " " + start + " ใน " + end + " จากจำนวน " + total + " รายการ";
|
// return " " + start + " ใน " + end + " จากจำนวน " + total + " รายการ";
|
||||||
|
|
@ -528,7 +534,10 @@ const clickClose = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickAdd = () => {
|
const clickAdd = () => {
|
||||||
modal.value = true;
|
// modal.value = true;
|
||||||
|
|
||||||
|
router.push(`/registryEmployee/add`);
|
||||||
|
// router.push(`/placement/detail`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickDelete = (id: string) => {
|
const clickDelete = (id: string) => {
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ const options = ref<optionType[]>([
|
||||||
* ให้แสดง แทปด้านขวา เมื่อเข้าหน้า รายละเอียดทะเบียนประวัติ
|
* ให้แสดง แทปด้านขวา เมื่อเข้าหน้า รายละเอียดทะเบียนประวัติ
|
||||||
*/
|
*/
|
||||||
const tabScroll = () => {
|
const tabScroll = () => {
|
||||||
return route.name == "registryDetail";
|
return route.name == "registryDetail" || route.name == "registryEmployeeAdd";
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -96,8 +96,11 @@ const toggleBtnLeft = () => {
|
||||||
*/
|
*/
|
||||||
const onScroll = (scroll: ScrollType) => {
|
const onScroll = (scroll: ScrollType) => {
|
||||||
const { position } = scroll;
|
const { position } = scroll;
|
||||||
updateScroll(position);
|
if (route.name == "PlacementPersonalDetail") {
|
||||||
updateScrollPlacement(position);
|
updateScrollPlacement(position);
|
||||||
|
} else {
|
||||||
|
updateScroll(position);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -154,7 +157,10 @@ const updateScroll = (position: number) => {
|
||||||
* ให้แสดง แทปด้านขวา เมื่อเข้าหน้า รายละเอียดทะเบียนประวัติ และ rightActive เท่ากับ true
|
* ให้แสดง แทปด้านขวา เมื่อเข้าหน้า รายละเอียดทะเบียนประวัติ และ rightActive เท่ากับ true
|
||||||
*/
|
*/
|
||||||
const activeBtn = () => {
|
const activeBtn = () => {
|
||||||
return route.name == "registryDetail" && rightActive.value;
|
return (
|
||||||
|
(route.name == "registryDetail" || route.name == "registryEmployeeAdd") &&
|
||||||
|
rightActive.value
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -218,6 +224,9 @@ const myEventHandler = (e: any, setSCroll: boolean) => {
|
||||||
*/
|
*/
|
||||||
const activeMenu = (path: string) => {
|
const activeMenu = (path: string) => {
|
||||||
if (path == "dashboard" && route.fullPath == "/") return true;
|
if (path == "dashboard" && route.fullPath == "/") return true;
|
||||||
|
|
||||||
|
if (path == "registry" && route.fullPath.includes("registryEmployee"))
|
||||||
|
return false;
|
||||||
const bool = route.fullPath.includes(path);
|
const bool = route.fullPath.includes(path);
|
||||||
return bool;
|
return bool;
|
||||||
};
|
};
|
||||||
|
|
@ -780,9 +789,9 @@ if (keycloak.tokenParsed != null) {
|
||||||
<!-- เมนูปกติ -->
|
<!-- เมนูปกติ -->
|
||||||
<q-item
|
<q-item
|
||||||
class="text-weight-medium menu"
|
class="text-weight-medium menu"
|
||||||
|
:active="activeMenu(menuItem.path)"
|
||||||
active-class="text-primary active-item text-weight-bold menuActive"
|
active-class="text-primary active-item text-weight-bold menuActive"
|
||||||
:to="{ name: `${menuItem.path}` }"
|
:to="{ name: `${menuItem.path}` }"
|
||||||
:active="activeMenu(menuItem.path)"
|
|
||||||
clickable
|
clickable
|
||||||
v-ripple
|
v-ripple
|
||||||
dense
|
dense
|
||||||
|
|
@ -898,7 +907,8 @@ if (keycloak.tokenParsed != null) {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.menuSub .q-item__section--avatar, .menu .q-item__section--avatar{
|
.menuSub .q-item__section--avatar,
|
||||||
|
.menu .q-item__section--avatar {
|
||||||
min-width: 0px;
|
min-width: 0px;
|
||||||
}
|
}
|
||||||
.menu {
|
.menu {
|
||||||
|
|
@ -927,11 +937,11 @@ if (keycloak.tokenParsed != null) {
|
||||||
/* .menuSubAct {
|
/* .menuSubAct {
|
||||||
background: #1e2529d9;
|
background: #1e2529d9;
|
||||||
} */
|
} */
|
||||||
.expan2 .menuSubHover{
|
.expan2 .menuSubHover {
|
||||||
padding-left: 30%;
|
padding-left: 30%;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
.menuSubHover{
|
.menuSubHover {
|
||||||
padding-left: 25%;
|
padding-left: 25%;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
|
|
@ -1005,7 +1015,7 @@ if (keycloak.tokenParsed != null) {
|
||||||
background-color: #a8bbbf;
|
background-color: #a8bbbf;
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-card__actions .q-btn--rectangle{
|
.q-card__actions .q-btn--rectangle {
|
||||||
padding: 0 14px !important;
|
padding: 0 14px !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue