API PosEmpTemp
This commit is contained in:
parent
28b25d31e2
commit
4ef4d225b9
9 changed files with 52 additions and 36 deletions
|
|
@ -64,8 +64,8 @@ async function onSubmit() {
|
|||
showLoader();
|
||||
try {
|
||||
const url = !isEditCheck.value
|
||||
? config.API.orgEmployeePos
|
||||
: config.API.orgEmployeePosById(props?.data?.id);
|
||||
? config.API.orgEmployeePosTemp
|
||||
: config.API.orgEmployeePosByIdTemp(props?.data?.id);
|
||||
await http[!isEditCheck.value ? "post" : "put"](url, body);
|
||||
await props.emitSearch?.(formDataPos.posName, "positionName");
|
||||
await success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
|
|
@ -95,7 +95,7 @@ function close() {
|
|||
async function fetchType() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgEmployeeType)
|
||||
.get(config.API.orgEmployeeTypeTemp)
|
||||
.then((res) => {
|
||||
posTypeMain.value = res.data.result;
|
||||
posTypeOp.value = res.data.result.map((e: OptionType) => ({
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ const visibleColumns = ref<string[]>([
|
|||
async function fetchPosition(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgPosPositionEmpById(id))
|
||||
.get(config.API.orgPosPositionEmpByIdTemp(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
|
|
@ -193,8 +193,8 @@ function onSubmit() {
|
|||
try {
|
||||
const url =
|
||||
props.actionType === "ADD"
|
||||
? config.API.orgPosMasterEmp
|
||||
: config.API.orgPosMasterByIdEmp(props.rowId);
|
||||
? config.API.orgPosMasterEmpTemp
|
||||
: config.API.orgPosMasterByIdEmpTemp(props.rowId);
|
||||
await http[props.actionType === "ADD" ? "post" : "put"](url, body);
|
||||
await props.getSummary?.();
|
||||
await props.fetchDataTable?.(
|
||||
|
|
@ -223,7 +223,7 @@ async function searchInput() {
|
|||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.orgEmployeePos +
|
||||
config.API.orgEmployeePosTemp +
|
||||
`?keyword=${search.value.trim()}&type=${type.value}`
|
||||
)
|
||||
.then((res) => {
|
||||
|
|
@ -273,7 +273,7 @@ function deletePos(id: string) {
|
|||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.orgEmployeePosById(id))
|
||||
.delete(config.API.orgEmployeePosByIdTemp(id))
|
||||
.then(async () => {
|
||||
await searchInput();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ function onClickMovePos() {
|
|||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgPosMoveEmp, body)
|
||||
.post(config.API.orgPosMoveEmpTemp, body)
|
||||
.then(async () => {
|
||||
await props.fetchDataTree?.(store.activeId);
|
||||
await success($q, "ย้ายตำแหน่งสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ function close() {
|
|||
async function fetchType() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgEmployeeType)
|
||||
.get(config.API.orgEmployeeTypeTemp)
|
||||
.then((res) => {
|
||||
dataLevel.value = res.data.result;
|
||||
typeOpsMain.value = res.data.result.map((e: OptionType) => ({
|
||||
|
|
@ -276,7 +276,7 @@ function onSubmit() {
|
|||
};
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgProfileEmp, body)
|
||||
.post(config.API.orgProfileEmpTemp, body)
|
||||
.then(async () => {
|
||||
await props.fetchDataTable?.(store.treeId, store.level, false);
|
||||
await props.getSummary();
|
||||
|
|
@ -315,7 +315,7 @@ function searchData() {
|
|||
keyword: formData.personal, //นามสกุล ชื่อ สกุล เลขบัตร
|
||||
};
|
||||
http
|
||||
.post(config.API.orgSearchProfileEmp, reqBody)
|
||||
.post(config.API.orgSearchProfileEmpTemp, reqBody)
|
||||
.then((res) => {
|
||||
totalPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
||||
const list = res.data.result.data.map((e: SelectPerson) => ({
|
||||
|
|
@ -621,7 +621,6 @@ watch(
|
|||
map-options
|
||||
:options="columnsResult"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ function save() {
|
|||
const dataId = data.map((item: DataSortPos) => item.id);
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgPosSortEmp, {
|
||||
.post(config.API.orgPosSortEmpTemp, {
|
||||
id: store.treeId,
|
||||
type: store.level,
|
||||
sortId: dataId,
|
||||
|
|
@ -90,7 +90,7 @@ function save() {
|
|||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgPosMasterListEmp, {
|
||||
.post(config.API.orgPosMasterListEmpTemp, {
|
||||
id: store.treeId,
|
||||
type: store.level,
|
||||
isAll: false,
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ const listMenu = ref<ListMenu[]>([
|
|||
const documentItems = ref<DataDocumentList[]>([
|
||||
{
|
||||
name: "รายงานสรุปจำนวนกรอบอัตรากำลังของลูกจ้างประจำกรุงเทพมหานคร",
|
||||
val: "report4-employee",
|
||||
val: "report4-employee-temp",
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ function onClickDelete(id: string) {
|
|||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.orgPosMasterByIdEmp(id))
|
||||
.delete(config.API.orgPosMasterByIdEmpTemp(id))
|
||||
.then(async () => {
|
||||
await props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
|
|
@ -271,7 +271,7 @@ function removePerson(id: string) {
|
|||
async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgDeleteProfileEmp(id))
|
||||
.post(config.API.orgDeleteProfileEmpTemp(id))
|
||||
.then(async () => {
|
||||
await props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
|
|
@ -307,7 +307,7 @@ function onClickInherit(id: string) {
|
|||
function getSummary() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgSummaryEmp, {
|
||||
.post(config.API.orgSummaryEmpTemp, {
|
||||
id: reqMaster.value.id, //*Id node
|
||||
type: reqMaster.value.type, //*ประเภทnode
|
||||
isNode: reqMaster.value.isAll, //*นับทั้ง node ไหม
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ function updateSelected(data: DataTree) {
|
|||
props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
|
||||
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
|
||||
http
|
||||
.post(config.API.orgSummaryEmp, {
|
||||
.post(config.API.orgSummaryEmpTemp, {
|
||||
id: data.orgTreeId, //*Id node
|
||||
type: data.orgLevel, //*ประเภทnode
|
||||
isNode: false, //*นับทั้ง node ไหม
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ function fetchDataTable(id: string, level: number, action: boolean) {
|
|||
}
|
||||
posMaster.value = [];
|
||||
http
|
||||
.post(config.API.orgPosMasterListEmp, reqMaster)
|
||||
.post(config.API.orgPosMasterListEmpTemp, reqMaster)
|
||||
.then(async (res) => {
|
||||
const dataMain: PosMaster[] = [];
|
||||
totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
|
||||
|
|
@ -129,7 +129,7 @@ function fetchDataTable(id: string, level: number, action: boolean) {
|
|||
*/
|
||||
function getSummary() {
|
||||
http
|
||||
.post(config.API.orgSummaryEmp, {
|
||||
.post(config.API.orgSummaryEmpTemp, {
|
||||
id: reqMaster.id, //*Id node
|
||||
type: reqMaster.type, //*ประเภทnode
|
||||
isNode: reqMaster.isAll, //*นับทั้ง node ไหม
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue