API PosEmpTemp

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-02-20 15:21:53 +07:00
parent 28b25d31e2
commit 4ef4d225b9
9 changed files with 52 additions and 36 deletions

View file

@ -4,6 +4,7 @@ const organization = `${env.API_URI}/org`;
const orgPos = `${env.API_URI}/org/pos`; const orgPos = `${env.API_URI}/org/pos`;
const orgProfile = `${env.API_URI}/org/profile`; const orgProfile = `${env.API_URI}/org/profile`;
const orgEmployeePos = `${env.API_URI}/org/employee/pos`; const orgEmployeePos = `${env.API_URI}/org/employee/pos`;
const orgEmployeePosTemp = `${env.API_URI}/org/employee-temp/pos`;
const orgAct = `${env.API_URI}/org/act`; const orgAct = `${env.API_URI}/org/act`;
const orgPosAct = `${env.API_URI}/org/pos/act`; const orgPosAct = `${env.API_URI}/org/pos/act`;
const workflow = `${env.API_URI}/org/workflow`; const workflow = `${env.API_URI}/org/workflow`;
@ -104,12 +105,36 @@ export default {
orgProfileEmp: `${orgEmployeePos}/profile`, orgProfileEmp: `${orgEmployeePos}/profile`,
orgSearchProfileEmp: `${orgProfile}-employee/search`, orgSearchProfileEmp: `${orgProfile}-employee/search`,
/** ข้อมูลตำแหน่งลูกจ้างชั่วคราว*/
orgEmployeePosTemp: `${orgEmployeePosTemp}/position`,
orgEmployeePosByIdTemp: (id: string) =>
`${orgEmployeePosTemp}/position/${id}`,
orgEmployeeTypeTemp: `${orgEmployeePosTemp}/type`,
orgEmployeeTypeByIdTemp: (id: string) => `${orgEmployeePos}/type/${id}`,
orgEmployeelevelTemp: `${orgEmployeePosTemp}/level`,
orgEmployeelevelByIdTemp: (id: string) => `${orgEmployeePosTemp}/level/${id}`,
/** อัตรากำลังลูกจ้างชัวคราว*/
orgSummaryEmpTemp: `${orgEmployeePosTemp}/summary`,
orgReportEmpTemp: (report: string) =>
`${orgEmployeePosTemp}/report/${report}`,
orgDeleteProfileEmpTemp: (id: string) =>
`${orgEmployeePosTemp}/profile/delete/${id}`,
orgPosMasterByIdEmpTemp: (id: string) => `${orgEmployeePosTemp}/master/${id}`,
orgPosMasterListEmpTemp: `${orgEmployeePosTemp}/master/list`,
orgPosMasterEmpTemp: `${orgEmployeePosTemp}/master`,
orgPosSortEmpTemp: `${orgEmployeePosTemp}/sort`,
orgPosPositionEmpByIdTemp: (id: string) =>
`${orgEmployeePosTemp}/position/${id}`,
orgPosMoveEmpTemp: `${orgEmployeePosTemp}/move`,
orgProfileEmpTemp: `${orgEmployeePosTemp}/profile`,
orgSearchProfileEmpTemp: `${orgProfile}-employee-temp/search`,
orgProfileById: (id: string, type: string) => orgProfileById: (id: string, type: string) =>
`${orgProfile}${type}/admin/${id}`, `${orgProfile}${type}/admin/${id}`,
orgDeceasedProfile: `${orgPos}/profile/search`, orgDeceasedProfile: `${orgPos}/profile/search`,
//
orgCheckAvatar: (id: string) => `${orgProfile}/avatar/profileId-admin/${id}`, orgCheckAvatar: (id: string) => `${orgProfile}/avatar/profileId-admin/${id}`,
orgCheckAvatarAdmin: (id: string) => orgCheckAvatarAdmin: (id: string) =>
`${orgProfile}/avatar/profileid-admin/${id}`, `${orgProfile}/avatar/profileid-admin/${id}`,
@ -125,22 +150,16 @@ export default {
orgAct, orgAct,
orgPosAct, orgPosAct,
/** /** รายการคำร้องขอแก้ไขทะเบียนประวัติ*/
*
*/
requestEdit: `${orgProfile}/edit/`, requestEdit: `${orgProfile}/edit/`,
requestEditByType: (type: string) => `${orgProfile}${type}/edit/`, requestEditByType: (type: string) => `${orgProfile}${type}/edit/`,
/** /** ข้อมูลการพัฒนารายบุคคล IDP*/
* IDP
*/
requestDevelopmentEdit: `${orgProfile}/development-request/`, requestDevelopmentEdit: `${orgProfile}/development-request/`,
requestDevelopmentEditByType: (type: string) => requestDevelopmentEditByType: (type: string) =>
`${orgProfile}${type}/development-request/`, `${orgProfile}${type}/development-request/`,
/** /** รายการเมนู*/
*
*/
orgPermissions: `${organization}/permission/menu`, orgPermissions: `${organization}/permission/menu`,
orgPermissionsSys: `${organization}/permission`, orgPermissionsSys: `${organization}/permission`,
@ -150,9 +169,7 @@ export default {
orgPosReport: `${orgPos}/report/draft`, orgPosReport: `${orgPos}/report/draft`,
orgPosReportAct: `${orgPos}/act/report/draft`, orgPosReportAct: `${orgPos}/act/report/draft`,
/** /** workflow*/
* workflow
*/
workflow: `${workflow}/`, workflow: `${workflow}/`,
workflowKeycloakSystem: (type: string) => workflowKeycloakSystem: (type: string) =>
`${workflow}/keycloak/isofficer/${type}`, `${workflow}/keycloak/isofficer/${type}`,

View file

@ -64,8 +64,8 @@ async function onSubmit() {
showLoader(); showLoader();
try { try {
const url = !isEditCheck.value const url = !isEditCheck.value
? config.API.orgEmployeePos ? config.API.orgEmployeePosTemp
: config.API.orgEmployeePosById(props?.data?.id); : config.API.orgEmployeePosByIdTemp(props?.data?.id);
await http[!isEditCheck.value ? "post" : "put"](url, body); await http[!isEditCheck.value ? "post" : "put"](url, body);
await props.emitSearch?.(formDataPos.posName, "positionName"); await props.emitSearch?.(formDataPos.posName, "positionName");
await success($q, "บันทีกข้อมูลสำเร็จ"); await success($q, "บันทีกข้อมูลสำเร็จ");
@ -95,7 +95,7 @@ function close() {
async function fetchType() { async function fetchType() {
showLoader(); showLoader();
await http await http
.get(config.API.orgEmployeeType) .get(config.API.orgEmployeeTypeTemp)
.then((res) => { .then((res) => {
posTypeMain.value = res.data.result; posTypeMain.value = res.data.result;
posTypeOp.value = res.data.result.map((e: OptionType) => ({ posTypeOp.value = res.data.result.map((e: OptionType) => ({

View file

@ -142,7 +142,7 @@ const visibleColumns = ref<string[]>([
async function fetchPosition(id: string) { async function fetchPosition(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.orgPosPositionEmpById(id)) .get(config.API.orgPosPositionEmpByIdTemp(id))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
@ -193,8 +193,8 @@ function onSubmit() {
try { try {
const url = const url =
props.actionType === "ADD" props.actionType === "ADD"
? config.API.orgPosMasterEmp ? config.API.orgPosMasterEmpTemp
: config.API.orgPosMasterByIdEmp(props.rowId); : config.API.orgPosMasterByIdEmpTemp(props.rowId);
await http[props.actionType === "ADD" ? "post" : "put"](url, body); await http[props.actionType === "ADD" ? "post" : "put"](url, body);
await props.getSummary?.(); await props.getSummary?.();
await props.fetchDataTable?.( await props.fetchDataTable?.(
@ -223,7 +223,7 @@ async function searchInput() {
showLoader(); showLoader();
await http await http
.get( .get(
config.API.orgEmployeePos + config.API.orgEmployeePosTemp +
`?keyword=${search.value.trim()}&type=${type.value}` `?keyword=${search.value.trim()}&type=${type.value}`
) )
.then((res) => { .then((res) => {
@ -273,7 +273,7 @@ function deletePos(id: string) {
dialogRemove($q, () => { dialogRemove($q, () => {
showLoader(); showLoader();
http http
.delete(config.API.orgEmployeePosById(id)) .delete(config.API.orgEmployeePosByIdTemp(id))
.then(async () => { .then(async () => {
await searchInput(); await searchInput();
await success($q, "ลบข้อมูลสำเร็จ"); await success($q, "ลบข้อมูลสำเร็จ");

View file

@ -123,7 +123,7 @@ function onClickMovePos() {
}; };
showLoader(); showLoader();
await http await http
.post(config.API.orgPosMoveEmp, body) .post(config.API.orgPosMoveEmpTemp, body)
.then(async () => { .then(async () => {
await props.fetchDataTree?.(store.activeId); await props.fetchDataTree?.(store.activeId);
await success($q, "ย้ายตำแหน่งสำเร็จ"); await success($q, "ย้ายตำแหน่งสำเร็จ");

View file

@ -207,7 +207,7 @@ function close() {
async function fetchType() { async function fetchType() {
showLoader(); showLoader();
await http await http
.get(config.API.orgEmployeeType) .get(config.API.orgEmployeeTypeTemp)
.then((res) => { .then((res) => {
dataLevel.value = res.data.result; dataLevel.value = res.data.result;
typeOpsMain.value = res.data.result.map((e: OptionType) => ({ typeOpsMain.value = res.data.result.map((e: OptionType) => ({
@ -276,7 +276,7 @@ function onSubmit() {
}; };
showLoader(); showLoader();
http http
.post(config.API.orgProfileEmp, body) .post(config.API.orgProfileEmpTemp, body)
.then(async () => { .then(async () => {
await props.fetchDataTable?.(store.treeId, store.level, false); await props.fetchDataTable?.(store.treeId, store.level, false);
await props.getSummary(); await props.getSummary();
@ -315,7 +315,7 @@ function searchData() {
keyword: formData.personal, // keyword: formData.personal, //
}; };
http http
.post(config.API.orgSearchProfileEmp, reqBody) .post(config.API.orgSearchProfileEmpTemp, reqBody)
.then((res) => { .then((res) => {
totalPage.value = Math.ceil(res.data.result.total / pageSize.value); totalPage.value = Math.ceil(res.data.result.total / pageSize.value);
const list = res.data.result.data.map((e: SelectPerson) => ({ const list = res.data.result.data.map((e: SelectPerson) => ({
@ -621,7 +621,6 @@ watch(
map-options map-options
:options="columnsResult" :options="columnsResult"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />

View file

@ -65,7 +65,7 @@ function save() {
const dataId = data.map((item: DataSortPos) => item.id); const dataId = data.map((item: DataSortPos) => item.id);
showLoader(); showLoader();
http http
.post(config.API.orgPosSortEmp, { .post(config.API.orgPosSortEmpTemp, {
id: store.treeId, id: store.treeId,
type: store.level, type: store.level,
sortId: dataId, sortId: dataId,
@ -90,7 +90,7 @@ function save() {
function getData() { function getData() {
showLoader(); showLoader();
http http
.post(config.API.orgPosMasterListEmp, { .post(config.API.orgPosMasterListEmpTemp, {
id: store.treeId, id: store.treeId,
type: store.level, type: store.level,
isAll: false, isAll: false,

View file

@ -107,7 +107,7 @@ const listMenu = ref<ListMenu[]>([
const documentItems = ref<DataDocumentList[]>([ const documentItems = ref<DataDocumentList[]>([
{ {
name: "รายงานสรุปจำนวนกรอบอัตรากำลังของลูกจ้างประจำกรุงเทพมหานคร", name: "รายงานสรุปจำนวนกรอบอัตรากำลังของลูกจ้างประจำกรุงเทพมหานคร",
val: "report4-employee", val: "report4-employee-temp",
}, },
]); ]);
@ -198,7 +198,7 @@ function onClickDelete(id: string) {
dialogRemove($q, async () => { dialogRemove($q, async () => {
showLoader(); showLoader();
await http await http
.delete(config.API.orgPosMasterByIdEmp(id)) .delete(config.API.orgPosMasterByIdEmpTemp(id))
.then(async () => { .then(async () => {
await props.fetchDataTable?.( await props.fetchDataTable?.(
reqMaster.value.id, reqMaster.value.id,
@ -271,7 +271,7 @@ function removePerson(id: string) {
async () => { async () => {
showLoader(); showLoader();
await http await http
.post(config.API.orgDeleteProfileEmp(id)) .post(config.API.orgDeleteProfileEmpTemp(id))
.then(async () => { .then(async () => {
await props.fetchDataTable?.( await props.fetchDataTable?.(
reqMaster.value.id, reqMaster.value.id,
@ -307,7 +307,7 @@ function onClickInherit(id: string) {
function getSummary() { function getSummary() {
showLoader(); showLoader();
http http
.post(config.API.orgSummaryEmp, { .post(config.API.orgSummaryEmpTemp, {
id: reqMaster.value.id, //*Id node id: reqMaster.value.id, //*Id node
type: reqMaster.value.type, //*node type: reqMaster.value.type, //*node
isNode: reqMaster.value.isAll, //* node isNode: reqMaster.value.isAll, //* node

View file

@ -54,7 +54,7 @@ function updateSelected(data: DataTree) {
props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true); props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
/** ดึงข้อมูลสถิติจำนวนด้านบน*/ /** ดึงข้อมูลสถิติจำนวนด้านบน*/
http http
.post(config.API.orgSummaryEmp, { .post(config.API.orgSummaryEmpTemp, {
id: data.orgTreeId, //*Id node id: data.orgTreeId, //*Id node
type: data.orgLevel, //*node type: data.orgLevel, //*node
isNode: false, //* node isNode: false, //* node

View file

@ -97,7 +97,7 @@ function fetchDataTable(id: string, level: number, action: boolean) {
} }
posMaster.value = []; posMaster.value = [];
http http
.post(config.API.orgPosMasterListEmp, reqMaster) .post(config.API.orgPosMasterListEmpTemp, reqMaster)
.then(async (res) => { .then(async (res) => {
const dataMain: PosMaster[] = []; const dataMain: PosMaster[] = [];
totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize); totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
@ -129,7 +129,7 @@ function fetchDataTable(id: string, level: number, action: boolean) {
*/ */
function getSummary() { function getSummary() {
http http
.post(config.API.orgSummaryEmp, { .post(config.API.orgSummaryEmpTemp, {
id: reqMaster.id, //*Id node id: reqMaster.id, //*Id node
type: reqMaster.type, //*node type: reqMaster.type, //*node
isNode: reqMaster.isAll, //* node isNode: reqMaster.isAll, //* node