Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
b8d0a5230c
11 changed files with 1997 additions and 326 deletions
|
|
@ -14,6 +14,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* api ตำแหน่ง
|
* api ตำแหน่ง
|
||||||
*/
|
*/
|
||||||
|
positionEmployeePosition,
|
||||||
listPositionEmployeePositionHistory: `${positionEmployeePosition}history`,
|
listPositionEmployeePositionHistory: `${positionEmployeePosition}history`,
|
||||||
listPositionEmployeePositionHistoryId: (id: string) =>
|
listPositionEmployeePositionHistoryId: (id: string) =>
|
||||||
`${positionEmployeePosition}history/${id}`,
|
`${positionEmployeePosition}history/${id}`,
|
||||||
|
|
@ -23,6 +24,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* api ด้านของตำแหน่ง
|
* api ด้านของตำแหน่ง
|
||||||
*/
|
*/
|
||||||
|
positionEmployeePositionSide,
|
||||||
listPositionEmployeePositionSideHistory: `${positionEmployeePositionSide}history`,
|
listPositionEmployeePositionSideHistory: `${positionEmployeePositionSide}history`,
|
||||||
listPositionEmployeePositionSideHistoryId: (id: string) =>
|
listPositionEmployeePositionSideHistoryId: (id: string) =>
|
||||||
`${positionEmployeePositionSide}history/${id}`,
|
`${positionEmployeePositionSide}history/${id}`,
|
||||||
|
|
@ -32,6 +34,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* api กลุ่มงาน
|
* api กลุ่มงาน
|
||||||
*/
|
*/
|
||||||
|
positionEmployeeGroup,
|
||||||
listPositionEmployeeGroupHistory: `${positionEmployeeGroup}history`,
|
listPositionEmployeeGroupHistory: `${positionEmployeeGroup}history`,
|
||||||
listPositionEmployeeGroupHistoryId: (id: string) =>
|
listPositionEmployeeGroupHistoryId: (id: string) =>
|
||||||
`${positionEmployeeGroup}history/${id}`,
|
`${positionEmployeeGroup}history/${id}`,
|
||||||
|
|
@ -41,6 +44,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* api สายงาน
|
* api สายงาน
|
||||||
*/
|
*/
|
||||||
|
positionEmployeeLine,
|
||||||
listPositionEmployeeLineHistory: `${positionEmployeeLine}history`,
|
listPositionEmployeeLineHistory: `${positionEmployeeLine}history`,
|
||||||
listPositionEmployeeLineHistoryId: (id: string) =>
|
listPositionEmployeeLineHistoryId: (id: string) =>
|
||||||
`${positionEmployeeLine}history/${id}`,
|
`${positionEmployeeLine}history/${id}`,
|
||||||
|
|
@ -50,6 +54,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* api ระดับชั้นงาน
|
* api ระดับชั้นงาน
|
||||||
*/
|
*/
|
||||||
|
positionEmployeeLevel,
|
||||||
listPositionEmployeeLevelHistory: `${positionEmployeeLevel}history`,
|
listPositionEmployeeLevelHistory: `${positionEmployeeLevel}history`,
|
||||||
listPositionEmployeeLevelHistoryId: (id: string) =>
|
listPositionEmployeeLevelHistoryId: (id: string) =>
|
||||||
`${positionEmployeeLevel}history/${id}`,
|
`${positionEmployeeLevel}history/${id}`,
|
||||||
|
|
@ -59,6 +64,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* api สถานะของตำแหน่ง
|
* api สถานะของตำแหน่ง
|
||||||
*/
|
*/
|
||||||
|
positionEmployeeStatus,
|
||||||
listPositionEmployeeStatusHistory: `${positionEmployeeStatus}history`,
|
listPositionEmployeeStatusHistory: `${positionEmployeeStatus}history`,
|
||||||
listPositionEmployeeStatusHistoryId: (id: string) =>
|
listPositionEmployeeStatusHistoryId: (id: string) =>
|
||||||
`${positionEmployeeStatus}history/${id}`,
|
`${positionEmployeeStatus}history/${id}`,
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,12 @@ const { loaderPage } = dataStore;
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
||||||
const store = useManageDataStore();
|
const store = useManageDataStore();
|
||||||
const { manageData, changeManageColumns } = store;
|
const {
|
||||||
|
manageData,
|
||||||
|
changeManageColumns,
|
||||||
|
getPositionEmployeeGroup,
|
||||||
|
dataPositionEmployeeGroup,
|
||||||
|
} = store;
|
||||||
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
||||||
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
||||||
|
|
@ -363,37 +368,42 @@ const $q = useQuasar();
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชัน get data ล่าสุด
|
* ฟังก์ชัน get data ล่าสุด
|
||||||
*/
|
*/
|
||||||
const fetchData = async () => {
|
const fetchData = async (load: boolean = false) => {
|
||||||
await props.fetchDataComponent();
|
await props.fetchDataComponent();
|
||||||
rows.value.splice(0);
|
const result = await getPositionEmployeeGroup(false, load);
|
||||||
showLoader();
|
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
await http
|
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||||
.get(config.API.listPositionEmployeeGroupHistory)
|
rows.value = result.data;
|
||||||
.then((res) => {
|
updateData.value = false;
|
||||||
let data = res.data.result;
|
// rows.value.splice(0);
|
||||||
version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
// showLoader();
|
||||||
idVersion.value = data.id; //เลข id ใน mongodb
|
// await http
|
||||||
data.items.map((e: RequestItemsHistoryObject) => {
|
// .get(config.API.listPositionEmployeeGroupHistory)
|
||||||
rows.value.push({
|
// .then((res) => {
|
||||||
id: e.id,
|
// let data = res.data.result;
|
||||||
name: e.name,
|
// version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
createdAt: e.createdAt,
|
// idVersion.value = data.id; //เลข id ใน mongodb
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
// data.items.map((e: RequestItemsHistoryObject) => {
|
||||||
lastUpdateFullName: e.lastUpdateFullName,
|
// rows.value.push({
|
||||||
isActive: e.isActive,
|
// id: e.id,
|
||||||
createdFullName: e.createdFullName,
|
// name: e.name,
|
||||||
createdUserId: e.createdUserId,
|
// createdAt: e.createdAt,
|
||||||
lastUpdateUserId: e.lastUpdateUserId,
|
// lastUpdatedAt: e.lastUpdatedAt,
|
||||||
});
|
// lastUpdateFullName: e.lastUpdateFullName,
|
||||||
});
|
// isActive: e.isActive,
|
||||||
})
|
// createdFullName: e.createdFullName,
|
||||||
.catch((e) => {
|
// createdUserId: e.createdUserId,
|
||||||
messageError($q, e);
|
// lastUpdateUserId: e.lastUpdateUserId,
|
||||||
})
|
// });
|
||||||
.finally(() => {
|
// });
|
||||||
updateData.value = false;
|
// })
|
||||||
hideLoader();
|
// .catch((e) => {
|
||||||
});
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// updateData.value = false;
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,12 @@ const { loaderPage } = dataStore;
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
||||||
const store = useManageDataStore();
|
const store = useManageDataStore();
|
||||||
const { manageData, changeManageColumns } = store;
|
const {
|
||||||
|
manageData,
|
||||||
|
changeManageColumns,
|
||||||
|
getPositionEmployeeLevel,
|
||||||
|
dataPositionEmployeeLevel,
|
||||||
|
} = store;
|
||||||
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
||||||
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
||||||
|
|
@ -362,37 +367,43 @@ const $q = useQuasar();
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชัน get data ล่าสุด
|
* ฟังก์ชัน get data ล่าสุด
|
||||||
*/
|
*/
|
||||||
const fetchData = async () => {
|
const fetchData = async (load: boolean = false) => {
|
||||||
await props.fetchDataComponent();
|
await props.fetchDataComponent();
|
||||||
rows.value.splice(0);
|
const result = await getPositionEmployeeLevel(false, load);
|
||||||
showLoader();
|
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
await http
|
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||||
.get(config.API.listPositionEmployeeLevelHistory)
|
rows.value = result.data;
|
||||||
.then((res) => {
|
updateData.value = false;
|
||||||
let data = res.data.result;
|
|
||||||
version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
// rows.value.splice(0);
|
||||||
idVersion.value = data.id; //เลข id ใน mongodb
|
// showLoader();
|
||||||
data.items.map((e: RequestItemsHistoryObject) => {
|
// await http
|
||||||
rows.value.push({
|
// .get(config.API.listPositionEmployeeLevelHistory)
|
||||||
id: e.id,
|
// .then((res) => {
|
||||||
name: e.name,
|
// let data = res.data.result;
|
||||||
createdAt: e.createdAt,
|
// version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
// idVersion.value = data.id; //เลข id ใน mongodb
|
||||||
lastUpdateFullName: e.lastUpdateFullName,
|
// data.items.map((e: RequestItemsHistoryObject) => {
|
||||||
isActive: e.isActive,
|
// rows.value.push({
|
||||||
createdFullName: e.createdFullName,
|
// id: e.id,
|
||||||
createdUserId: e.createdUserId,
|
// name: e.name,
|
||||||
lastUpdateUserId: e.lastUpdateUserId,
|
// createdAt: e.createdAt,
|
||||||
});
|
// lastUpdatedAt: e.lastUpdatedAt,
|
||||||
});
|
// lastUpdateFullName: e.lastUpdateFullName,
|
||||||
})
|
// isActive: e.isActive,
|
||||||
.catch((e) => {
|
// createdFullName: e.createdFullName,
|
||||||
messageError($q, e);
|
// createdUserId: e.createdUserId,
|
||||||
})
|
// lastUpdateUserId: e.lastUpdateUserId,
|
||||||
.finally(() => {
|
// });
|
||||||
updateData.value = false;
|
// });
|
||||||
hideLoader();
|
// })
|
||||||
});
|
// .catch((e) => {
|
||||||
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// updateData.value = false;
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,12 @@ const { loaderPage } = dataStore;
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
||||||
const store = useManageDataStore();
|
const store = useManageDataStore();
|
||||||
const { manageData, changeManageColumns } = store;
|
const {
|
||||||
|
manageData,
|
||||||
|
changeManageColumns,
|
||||||
|
getPositionEmployeeLine,
|
||||||
|
dataPositionEmployeeLine,
|
||||||
|
} = store;
|
||||||
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
||||||
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
||||||
|
|
@ -363,37 +368,42 @@ const $q = useQuasar();
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชัน get data ล่าสุด
|
* ฟังก์ชัน get data ล่าสุด
|
||||||
*/
|
*/
|
||||||
const fetchData = async () => {
|
const fetchData = async (load: boolean = false) => {
|
||||||
await props.fetchDataComponent();
|
await props.fetchDataComponent();
|
||||||
rows.value.splice(0);
|
const result = await getPositionEmployeeLine(false, load);
|
||||||
showLoader();
|
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
await http
|
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||||
.get(config.API.listPositionEmployeeLineHistory)
|
rows.value = result.data;
|
||||||
.then((res) => {
|
updateData.value = false;
|
||||||
let data = res.data.result;
|
// rows.value.splice(0);
|
||||||
version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
// showLoader();
|
||||||
idVersion.value = data.id; //เลข id ใน mongodb
|
// await http
|
||||||
data.items.map((e: RequestItemsHistoryObject) => {
|
// .get(config.API.listPositionEmployeeLineHistory)
|
||||||
rows.value.push({
|
// .then((res) => {
|
||||||
id: e.id,
|
// let data = res.data.result;
|
||||||
name: e.name,
|
// version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
createdAt: e.createdAt,
|
// idVersion.value = data.id; //เลข id ใน mongodb
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
// data.items.map((e: RequestItemsHistoryObject) => {
|
||||||
lastUpdateFullName: e.lastUpdateFullName,
|
// rows.value.push({
|
||||||
isActive: e.isActive,
|
// id: e.id,
|
||||||
createdFullName: e.createdFullName,
|
// name: e.name,
|
||||||
createdUserId: e.createdUserId,
|
// createdAt: e.createdAt,
|
||||||
lastUpdateUserId: e.lastUpdateUserId,
|
// lastUpdatedAt: e.lastUpdatedAt,
|
||||||
});
|
// lastUpdateFullName: e.lastUpdateFullName,
|
||||||
});
|
// isActive: e.isActive,
|
||||||
})
|
// createdFullName: e.createdFullName,
|
||||||
.catch((e) => {
|
// createdUserId: e.createdUserId,
|
||||||
messageError($q, e);
|
// lastUpdateUserId: e.lastUpdateUserId,
|
||||||
})
|
// });
|
||||||
.finally(() => {
|
// });
|
||||||
updateData.value = false;
|
// })
|
||||||
hideLoader();
|
// .catch((e) => {
|
||||||
});
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// updateData.value = false;
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,12 @@ const { loaderPage } = dataStore;
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
||||||
const store = useManageDataStore();
|
const store = useManageDataStore();
|
||||||
const { manageData, changeManageColumns } = store;
|
const {
|
||||||
|
manageData,
|
||||||
|
changeManageColumns,
|
||||||
|
getPositionEmployee,
|
||||||
|
dataPositionEmployee,
|
||||||
|
} = store;
|
||||||
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
||||||
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
||||||
|
|
@ -399,38 +404,43 @@ const $q = useQuasar();
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชัน get data ล่าสุด
|
* ฟังก์ชัน get data ล่าสุด
|
||||||
*/
|
*/
|
||||||
const fetchData = async () => {
|
const fetchData = async (load: boolean = false) => {
|
||||||
await props.fetchDataComponent();
|
await props.fetchDataComponent();
|
||||||
rows.value.splice(0);
|
const result = await getPositionEmployee(false, load);
|
||||||
showLoader();
|
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
await http
|
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||||
.get(config.API.listPositionEmployeePositionHistory)
|
rows.value = result.data;
|
||||||
.then((res) => {
|
updateData.value = false;
|
||||||
let data = res.data.result;
|
// rows.value.splice(0);
|
||||||
version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
// showLoader();
|
||||||
idVersion.value = data.id; //เลข id ใน mongodb
|
// await http
|
||||||
data.items.map((e: RequestItemsHistoryObject) => {
|
// .get(config.API.listPositionEmployeePositionHistory)
|
||||||
rows.value.push({
|
// .then((res) => {
|
||||||
id: e.id,
|
// let data = res.data.result;
|
||||||
name: e.name,
|
// version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
createdAt: e.createdAt,
|
// idVersion.value = data.id; //เลข id ใน mongodb
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
// data.items.map((e: RequestItemsHistoryObject) => {
|
||||||
lastUpdateFullName: e.lastUpdateFullName,
|
// rows.value.push({
|
||||||
isActive: e.isActive,
|
// id: e.id,
|
||||||
createdFullName: e.createdFullName,
|
// name: e.name,
|
||||||
createdUserId: e.createdUserId,
|
// createdAt: e.createdAt,
|
||||||
lastUpdateUserId: e.lastUpdateUserId,
|
// lastUpdatedAt: e.lastUpdatedAt,
|
||||||
note: e.note,
|
// lastUpdateFullName: e.lastUpdateFullName,
|
||||||
});
|
// isActive: e.isActive,
|
||||||
});
|
// createdFullName: e.createdFullName,
|
||||||
})
|
// createdUserId: e.createdUserId,
|
||||||
.catch((e) => {
|
// lastUpdateUserId: e.lastUpdateUserId,
|
||||||
messageError($q, e);
|
// note: e.note,
|
||||||
})
|
// });
|
||||||
.finally(() => {
|
// });
|
||||||
updateData.value = false;
|
// })
|
||||||
hideLoader();
|
// .catch((e) => {
|
||||||
});
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// updateData.value = false;
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,12 @@ const { loaderPage } = dataStore;
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
||||||
const store = useManageDataStore();
|
const store = useManageDataStore();
|
||||||
const { manageData, changeManageColumns } = store;
|
const {
|
||||||
|
manageData,
|
||||||
|
changeManageColumns,
|
||||||
|
getPositionEmployeeSide,
|
||||||
|
dataPositionEmployeeSide,
|
||||||
|
} = store;
|
||||||
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
||||||
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
||||||
|
|
@ -399,38 +404,43 @@ const $q = useQuasar();
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชัน get data ล่าสุด
|
* ฟังก์ชัน get data ล่าสุด
|
||||||
*/
|
*/
|
||||||
const fetchData = async () => {
|
const fetchData = async (load: boolean = false) => {
|
||||||
await props.fetchDataComponent();
|
await props.fetchDataComponent();
|
||||||
rows.value.splice(0);
|
const result = await getPositionEmployeeSide(false, load);
|
||||||
showLoader();
|
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
await http
|
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||||
.get(config.API.listPositionEmployeePositionSideHistory)
|
rows.value = result.data;
|
||||||
.then((res) => {
|
updateData.value = false;
|
||||||
let data = res.data.result;
|
// rows.value.splice(0);
|
||||||
version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
// showLoader();
|
||||||
idVersion.value = data.id; //เลข id ใน mongodb
|
// await http
|
||||||
data.items.map((e: RequestItemsHistoryObject) => {
|
// .get(config.API.listPositionEmployeePositionSideHistory)
|
||||||
rows.value.push({
|
// .then((res) => {
|
||||||
id: e.id,
|
// let data = res.data.result;
|
||||||
name: e.name,
|
// version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
createdAt: e.createdAt,
|
// idVersion.value = data.id; //เลข id ใน mongodb
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
// data.items.map((e: RequestItemsHistoryObject) => {
|
||||||
lastUpdateFullName: e.lastUpdateFullName,
|
// rows.value.push({
|
||||||
isActive: e.isActive,
|
// id: e.id,
|
||||||
createdFullName: e.createdFullName,
|
// name: e.name,
|
||||||
createdUserId: e.createdUserId,
|
// createdAt: e.createdAt,
|
||||||
lastUpdateUserId: e.lastUpdateUserId,
|
// lastUpdatedAt: e.lastUpdatedAt,
|
||||||
note: e.note,
|
// lastUpdateFullName: e.lastUpdateFullName,
|
||||||
});
|
// isActive: e.isActive,
|
||||||
});
|
// createdFullName: e.createdFullName,
|
||||||
})
|
// createdUserId: e.createdUserId,
|
||||||
.catch((e) => {
|
// lastUpdateUserId: e.lastUpdateUserId,
|
||||||
messageError($q, e);
|
// note: e.note,
|
||||||
})
|
// });
|
||||||
.finally(() => {
|
// });
|
||||||
updateData.value = false;
|
// })
|
||||||
hideLoader();
|
// .catch((e) => {
|
||||||
});
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// updateData.value = false;
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,12 @@ const { loaderPage } = dataStore;
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
|
||||||
const store = useManageDataStore();
|
const store = useManageDataStore();
|
||||||
const { manageData, changeManageColumns } = store;
|
const {
|
||||||
|
manageData,
|
||||||
|
changeManageColumns,
|
||||||
|
getPositionEmployeeStatus,
|
||||||
|
dataPositionEmployeeStatus,
|
||||||
|
} = store;
|
||||||
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
||||||
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history
|
||||||
|
|
@ -363,37 +368,42 @@ const $q = useQuasar();
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชัน get data ล่าสุด
|
* ฟังก์ชัน get data ล่าสุด
|
||||||
*/
|
*/
|
||||||
const fetchData = async () => {
|
const fetchData = async (load: boolean = false) => {
|
||||||
await props.fetchDataComponent();
|
await props.fetchDataComponent();
|
||||||
rows.value.splice(0);
|
const result = await getPositionEmployeeStatus(false, load);
|
||||||
showLoader();
|
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
await http
|
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||||
.get(config.API.listPositionEmployeeStatusHistory)
|
rows.value = result.data;
|
||||||
.then((res) => {
|
updateData.value = false;
|
||||||
let data = res.data.result;
|
// rows.value.splice(0);
|
||||||
version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
// showLoader();
|
||||||
idVersion.value = data.id; //เลข id ใน mongodb
|
// await http
|
||||||
data.items.map((e: RequestItemsHistoryObject) => {
|
// .get(config.API.listPositionEmployeeStatusHistory)
|
||||||
rows.value.push({
|
// .then((res) => {
|
||||||
id: e.id,
|
// let data = res.data.result;
|
||||||
name: e.name,
|
// version.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
createdAt: e.createdAt,
|
// idVersion.value = data.id; //เลข id ใน mongodb
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
// data.items.map((e: RequestItemsHistoryObject) => {
|
||||||
lastUpdateFullName: e.lastUpdateFullName,
|
// rows.value.push({
|
||||||
isActive: e.isActive,
|
// id: e.id,
|
||||||
createdFullName: e.createdFullName,
|
// name: e.name,
|
||||||
createdUserId: e.createdUserId,
|
// createdAt: e.createdAt,
|
||||||
lastUpdateUserId: e.lastUpdateUserId,
|
// lastUpdatedAt: e.lastUpdatedAt,
|
||||||
});
|
// lastUpdateFullName: e.lastUpdateFullName,
|
||||||
});
|
// isActive: e.isActive,
|
||||||
})
|
// createdFullName: e.createdFullName,
|
||||||
.catch((e) => {
|
// createdUserId: e.createdUserId,
|
||||||
messageError($q, e);
|
// lastUpdateUserId: e.lastUpdateUserId,
|
||||||
})
|
// });
|
||||||
.finally(() => {
|
// });
|
||||||
updateData.value = false;
|
// })
|
||||||
hideLoader();
|
// .catch((e) => {
|
||||||
});
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// updateData.value = false;
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,13 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import type { RequestItemsHistoryObject } from "@/modules/01_metadata/interface/request/person/Prefix";
|
import type { RequestItemsHistoryObject } from "@/modules/01_metadata/interface/request/person/Prefix";
|
||||||
import type { RequestItemsHistoryObject as InsigniaResponse } from "@/modules/01_metadata/interface/request/insignia/Insignia";
|
import type { RequestItemsHistoryObject as InsigniaResponse } from "@/modules/01_metadata/interface/request/insignia/Insignia";
|
||||||
import type { RequestItemsHistoryObject as InsigniaTypeResponse } from "@/modules/01_metadata/interface/request/insignia/InsigniaType";
|
import type { RequestItemsHistoryObject as InsigniaTypeResponse } from "@/modules/01_metadata/interface/request/insignia/InsigniaType";
|
||||||
|
import type { RequestItemsHistoryObject as positionEmployeeResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Position";
|
||||||
|
import type { RequestItemsHistoryObject as positionEmployeeSideResponse } from "@/modules/01_metadata/interface/request/positionEmployee/PositionSide";
|
||||||
|
import type { RequestItemsHistoryObject as positionEmployeeGroupResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Group";
|
||||||
|
import type { RequestItemsHistoryObject as positionEmployeeLineResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Line";
|
||||||
|
import type { RequestItemsHistoryObject as positionEmployeeLevelResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Level";
|
||||||
|
import type { RequestItemsHistoryObject as positionEmployeeStatusResponse } from "@/modules/01_metadata/interface/request/positionEmployee/Status";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { success, messageError, showLoader, hideLoader } = mixin;
|
const { success, messageError, showLoader, hideLoader } = mixin;
|
||||||
|
|
@ -18,6 +25,18 @@ export const useManageDataStore = defineStore("manage", () => {
|
||||||
const draftInsignia = ref<InsigniaResponse[]>([]); //list data table
|
const draftInsignia = ref<InsigniaResponse[]>([]); //list data table
|
||||||
const dataInsigniaType = ref<InsigniaTypeResponse[]>([]); //list data table
|
const dataInsigniaType = ref<InsigniaTypeResponse[]>([]); //list data table
|
||||||
const draftInsigniaType = ref<InsigniaTypeResponse[]>([]); //list data table
|
const draftInsigniaType = ref<InsigniaTypeResponse[]>([]); //list data table
|
||||||
|
const dataPositionEmployee = ref<positionEmployeeResponse[]>([]); //list data table
|
||||||
|
const draftPositionEmployee = ref<positionEmployeeResponse[]>([]); //list data table
|
||||||
|
const dataPositionEmployeeSide = ref<positionEmployeeSideResponse[]>([]); //list data table
|
||||||
|
const draftPositionEmployeeSide = ref<positionEmployeeSideResponse[]>([]); //list data table
|
||||||
|
const dataPositionEmployeeGroup = ref<positionEmployeeGroupResponse[]>([]); //list data table
|
||||||
|
const draftPositionEmployeeGroup = ref<positionEmployeeGroupResponse[]>([]); //list data table
|
||||||
|
const dataPositionEmployeeLine = ref<positionEmployeeLineResponse[]>([]); //list data table
|
||||||
|
const draftPositionEmployeeLine = ref<positionEmployeeLineResponse[]>([]); //list data table
|
||||||
|
const dataPositionEmployeeLevel = ref<positionEmployeeLevelResponse[]>([]); //list data table
|
||||||
|
const draftPositionEmployeeLevel = ref<positionEmployeeLevelResponse[]>([]); //list data table
|
||||||
|
const dataPositionEmployeeStatus = ref<positionEmployeeStatusResponse[]>([]); //list data table
|
||||||
|
const draftPositionEmployeeStatus = ref<positionEmployeeStatusResponse[]>([]); //list data table
|
||||||
|
|
||||||
const storeIdVersion = ref<string>(""); //id data ใน mongodb
|
const storeIdVersion = ref<string>(""); //id data ใน mongodb
|
||||||
const storeVersion = ref<string>("published"); //รายการข้อมูลล่าสุดได้เผยแพร่หรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
const storeVersion = ref<string>("published"); //รายการข้อมูลล่าสุดได้เผยแพร่หรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
|
|
@ -333,6 +352,180 @@ export const useManageDataStore = defineStore("manage", () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getPositionEmployee = async (
|
||||||
|
selector: boolean = false,
|
||||||
|
newFetch: boolean = false
|
||||||
|
) => {
|
||||||
|
if (dataPositionEmployee.value.length === 0) {
|
||||||
|
await fetchPositionEmployee(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployee.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (newFetch) {
|
||||||
|
await fetchPositionEmployee(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployee.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployee.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPositionEmployeeSide = async (
|
||||||
|
selector: boolean = false,
|
||||||
|
newFetch: boolean = false
|
||||||
|
) => {
|
||||||
|
if (dataPositionEmployeeSide.value.length === 0) {
|
||||||
|
await fetchPositionEmployeeSide(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeSide.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (newFetch) {
|
||||||
|
await fetchPositionEmployeeSide(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeSide.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeSide.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPositionEmployeeGroup = async (
|
||||||
|
selector: boolean = false,
|
||||||
|
newFetch: boolean = false
|
||||||
|
) => {
|
||||||
|
if (dataPositionEmployeeGroup.value.length === 0) {
|
||||||
|
await fetchPositionEmployeeGroup(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeGroup.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (newFetch) {
|
||||||
|
await fetchPositionEmployeeGroup(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeGroup.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeGroup.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPositionEmployeeLine = async (
|
||||||
|
selector: boolean = false,
|
||||||
|
newFetch: boolean = false
|
||||||
|
) => {
|
||||||
|
if (dataPositionEmployeeLine.value.length === 0) {
|
||||||
|
await fetchPositionEmployeeLine(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeLine.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (newFetch) {
|
||||||
|
await fetchPositionEmployeeLine(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeLine.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeLine.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPositionEmployeeLevel = async (
|
||||||
|
selector: boolean = false,
|
||||||
|
newFetch: boolean = false
|
||||||
|
) => {
|
||||||
|
if (dataPositionEmployeeLevel.value.length === 0) {
|
||||||
|
await fetchPositionEmployeeLevel(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeLevel.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (newFetch) {
|
||||||
|
await fetchPositionEmployeeLevel(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeLevel.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeLevel.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPositionEmployeeStatus = async (
|
||||||
|
selector: boolean = false,
|
||||||
|
newFetch: boolean = false
|
||||||
|
) => {
|
||||||
|
if (dataPositionEmployeeStatus.value.length === 0) {
|
||||||
|
await fetchPositionEmployeeStatus(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeStatus.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (newFetch) {
|
||||||
|
await fetchPositionEmployeeStatus(true, selector);
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeStatus.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
data: draftPositionEmployeeStatus.value,
|
||||||
|
version: storeVersion.value,
|
||||||
|
idversion: storeIdVersion.value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const fetchPrefix = async (loader: boolean, selector: boolean) => {
|
const fetchPrefix = async (loader: boolean, selector: boolean) => {
|
||||||
let apiPrefix = "";
|
let apiPrefix = "";
|
||||||
if (loader) {
|
if (loader) {
|
||||||
|
|
@ -465,9 +658,9 @@ export const useManageDataStore = defineStore("manage", () => {
|
||||||
.get(apiInsigniaType)
|
.get(apiInsigniaType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
let rows: RequestItemsHistoryObject[] = [];
|
let rows: InsigniaTypeResponse[] = [];
|
||||||
if (selector) {
|
if (selector) {
|
||||||
data.map((e: RequestItemsHistoryObject) => {
|
data.map((e: InsigniaTypeResponse) => {
|
||||||
rows.push({
|
rows.push({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
name: e.name,
|
name: e.name,
|
||||||
|
|
@ -484,7 +677,7 @@ export const useManageDataStore = defineStore("manage", () => {
|
||||||
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
||||||
|
|
||||||
data.items.map((e: RequestItemsHistoryObject) => {
|
data.items.map((e: InsigniaTypeResponse) => {
|
||||||
rows.push({
|
rows.push({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
name: e.name,
|
name: e.name,
|
||||||
|
|
@ -513,10 +706,415 @@ export const useManageDataStore = defineStore("manage", () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const fetchPositionEmployee = async (loader: boolean, selector: boolean) => {
|
||||||
|
let apiPositionEmployee = "";
|
||||||
|
if (loader) {
|
||||||
|
showLoader();
|
||||||
|
}
|
||||||
|
if (selector) {
|
||||||
|
apiPositionEmployee = config.API.positionEmployeePosition;
|
||||||
|
} else {
|
||||||
|
apiPositionEmployee = config.API.listPositionEmployeePositionHistory;
|
||||||
|
}
|
||||||
|
await http
|
||||||
|
.get(apiPositionEmployee)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
let rows: positionEmployeeResponse[] = [];
|
||||||
|
if (selector) {
|
||||||
|
data.map((e: positionEmployeeResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
note: e.note,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
|
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
||||||
|
|
||||||
|
data.items.map((e: positionEmployeeResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
note: e.note,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
draftPositionEmployee.value = rows;
|
||||||
|
if (loader) {
|
||||||
|
dataPositionEmployee.value = rows;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (loader) {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchPositionEmployeeSide = async (
|
||||||
|
loader: boolean,
|
||||||
|
selector: boolean
|
||||||
|
) => {
|
||||||
|
let apiPositionEmployeeSide = "";
|
||||||
|
if (loader) {
|
||||||
|
showLoader();
|
||||||
|
}
|
||||||
|
if (selector) {
|
||||||
|
apiPositionEmployeeSide = config.API.positionEmployeePositionSide;
|
||||||
|
} else {
|
||||||
|
apiPositionEmployeeSide =
|
||||||
|
config.API.listPositionEmployeePositionSideHistory;
|
||||||
|
}
|
||||||
|
await http
|
||||||
|
.get(apiPositionEmployeeSide)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
let rows: positionEmployeeSideResponse[] = [];
|
||||||
|
if (selector) {
|
||||||
|
data.map((e: positionEmployeeSideResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
note: e.note,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
|
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
||||||
|
|
||||||
|
data.items.map((e: positionEmployeeSideResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
note: e.note,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
draftPositionEmployeeSide.value = rows;
|
||||||
|
if (loader) {
|
||||||
|
dataPositionEmployeeSide.value = rows;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (loader) {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchPositionEmployeeGroup = async (
|
||||||
|
loader: boolean,
|
||||||
|
selector: boolean
|
||||||
|
) => {
|
||||||
|
let apiPositionEmployeeGroup = "";
|
||||||
|
if (loader) {
|
||||||
|
showLoader();
|
||||||
|
}
|
||||||
|
if (selector) {
|
||||||
|
apiPositionEmployeeGroup = config.API.positionEmployeeGroup;
|
||||||
|
} else {
|
||||||
|
apiPositionEmployeeGroup = config.API.listPositionEmployeeGroupHistory;
|
||||||
|
}
|
||||||
|
await http
|
||||||
|
.get(apiPositionEmployeeGroup)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
let rows: positionEmployeeGroupResponse[] = [];
|
||||||
|
if (selector) {
|
||||||
|
data.map((e: positionEmployeeGroupResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
|
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
||||||
|
|
||||||
|
data.items.map((e: positionEmployeeGroupResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
draftPositionEmployeeGroup.value = rows;
|
||||||
|
if (loader) {
|
||||||
|
dataPositionEmployeeGroup.value = rows;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (loader) {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchPositionEmployeeLine = async (
|
||||||
|
loader: boolean,
|
||||||
|
selector: boolean
|
||||||
|
) => {
|
||||||
|
let apiPositionEmployeeLine = "";
|
||||||
|
if (loader) {
|
||||||
|
showLoader();
|
||||||
|
}
|
||||||
|
if (selector) {
|
||||||
|
apiPositionEmployeeLine = config.API.positionEmployeeLine;
|
||||||
|
} else {
|
||||||
|
apiPositionEmployeeLine = config.API.listPositionEmployeeLineHistory;
|
||||||
|
}
|
||||||
|
await http
|
||||||
|
.get(apiPositionEmployeeLine)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
let rows: positionEmployeeLineResponse[] = [];
|
||||||
|
if (selector) {
|
||||||
|
data.map((e: positionEmployeeLineResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
|
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
||||||
|
|
||||||
|
data.items.map((e: positionEmployeeLineResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
draftPositionEmployeeLine.value = rows;
|
||||||
|
if (loader) {
|
||||||
|
dataPositionEmployeeLine.value = rows;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (loader) {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchPositionEmployeeLevel = async (
|
||||||
|
loader: boolean,
|
||||||
|
selector: boolean
|
||||||
|
) => {
|
||||||
|
let apiPositionEmployeeLevel = "";
|
||||||
|
if (loader) {
|
||||||
|
showLoader();
|
||||||
|
}
|
||||||
|
if (selector) {
|
||||||
|
apiPositionEmployeeLevel = config.API.positionEmployeeLevel;
|
||||||
|
} else {
|
||||||
|
apiPositionEmployeeLevel = config.API.listPositionEmployeeLevelHistory;
|
||||||
|
}
|
||||||
|
await http
|
||||||
|
.get(apiPositionEmployeeLevel)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
let rows: positionEmployeeLevelResponse[] = [];
|
||||||
|
if (selector) {
|
||||||
|
data.map((e: positionEmployeeLevelResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
|
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
||||||
|
|
||||||
|
data.items.map((e: positionEmployeeLevelResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
draftPositionEmployeeLevel.value = rows;
|
||||||
|
if (loader) {
|
||||||
|
dataPositionEmployeeLevel.value = rows;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (loader) {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchPositionEmployeeStatus = async (
|
||||||
|
loader: boolean,
|
||||||
|
selector: boolean
|
||||||
|
) => {
|
||||||
|
let apiPositionEmployeeStatus = "";
|
||||||
|
if (loader) {
|
||||||
|
showLoader();
|
||||||
|
}
|
||||||
|
if (selector) {
|
||||||
|
apiPositionEmployeeStatus = config.API.positionEmployeeStatus;
|
||||||
|
} else {
|
||||||
|
apiPositionEmployeeStatus = config.API.listPositionEmployeeStatusHistory;
|
||||||
|
}
|
||||||
|
await http
|
||||||
|
.get(apiPositionEmployeeStatus)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
let rows: positionEmployeeStatusResponse[] = [];
|
||||||
|
if (selector) {
|
||||||
|
data.map((e: positionEmployeeStatusResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storeVersion.value = data.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||||
|
storeIdVersion.value = data.id; //เลข id ใน mongodb
|
||||||
|
|
||||||
|
data.items.map((e: positionEmployeeStatusResponse) => {
|
||||||
|
rows.push({
|
||||||
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
|
isActive: e.isActive,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdUserId: e.createdUserId,
|
||||||
|
lastUpdateUserId: e.lastUpdateUserId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
draftPositionEmployeeStatus.value = rows;
|
||||||
|
if (loader) {
|
||||||
|
dataPositionEmployeeStatus.value = rows;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (loader) {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dataPrefix,
|
dataPrefix,
|
||||||
dataInsignia,
|
dataInsignia,
|
||||||
dataInsigniaType,
|
dataInsigniaType,
|
||||||
|
dataPositionEmployee,
|
||||||
|
dataPositionEmployeeSide,
|
||||||
|
dataPositionEmployeeGroup,
|
||||||
|
dataPositionEmployeeLine,
|
||||||
|
dataPositionEmployeeLevel,
|
||||||
|
dataPositionEmployeeStatus,
|
||||||
storeIdVersion,
|
storeIdVersion,
|
||||||
storeVersion,
|
storeVersion,
|
||||||
manageData,
|
manageData,
|
||||||
|
|
@ -526,5 +1124,11 @@ export const useManageDataStore = defineStore("manage", () => {
|
||||||
changeManageColumns,
|
changeManageColumns,
|
||||||
getInsignia,
|
getInsignia,
|
||||||
getInsigniaType,
|
getInsigniaType,
|
||||||
|
getPositionEmployee,
|
||||||
|
getPositionEmployeeSide,
|
||||||
|
getPositionEmployeeGroup,
|
||||||
|
getPositionEmployeeLine,
|
||||||
|
getPositionEmployeeLevel,
|
||||||
|
getPositionEmployeeStatus,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -11,16 +11,14 @@ const close = async () => {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-toolbar class="header-main">
|
<q-toolbar class="q-py-md">
|
||||||
<q-toolbar-title class="header-text">{{ title }}</q-toolbar-title>
|
<q-toolbar-title class="header-text">{{ title }}</q-toolbar-title>
|
||||||
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
|
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.header-main {
|
|
||||||
padding: 16px 0px 16px 27px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-text {
|
.header-text {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -2,6 +2,7 @@ import type { zipCodeOption } from "../../components/exams_other/profileType";
|
||||||
interface DataOption {
|
interface DataOption {
|
||||||
id: number | string;
|
id: number | string;
|
||||||
name: string;
|
name: string;
|
||||||
|
disable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Pagination {
|
interface Pagination {
|
||||||
|
|
@ -32,5 +33,10 @@ interface AddressOps {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface treeTab {
|
||||||
|
id: string;
|
||||||
|
label: string;
|
||||||
|
children: treeTab[];
|
||||||
|
}
|
||||||
|
|
||||||
export type { DataOption, InformationOps , AddressOps, Pagination ,EduOps };
|
export type { DataOption, treeTab, InformationOps, AddressOps, Pagination, EduOps };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue