no message
This commit is contained in:
parent
47e96ddec5
commit
4a93fe3386
3 changed files with 210 additions and 78 deletions
|
|
@ -31,4 +31,6 @@ export default {
|
||||||
|
|
||||||
orgPosExecutiveById: (id: string) => `${orgPos}/executive/${id}`,
|
orgPosExecutiveById: (id: string) => `${orgPos}/executive/${id}`,
|
||||||
orgPosHistory: (id: string) => `${orgPos}/history/${id}`,
|
orgPosHistory: (id: string) => `${orgPos}/history/${id}`,
|
||||||
|
|
||||||
|
orgSalaryPosition:`${orgPos}/position?keyword=&type=ALL`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,7 @@
|
||||||
(val: string) => !!val || `${'กรุณาเลือกตำแหน่งประเภท'}`,
|
(val: string) => !!val || `${'กรุณาเลือกตำแหน่งประเภท'}`,
|
||||||
]"
|
]"
|
||||||
:label="`${'ตำแหน่งประเภท'}`"
|
:label="`${'ตำแหน่งประเภท'}`"
|
||||||
@update:modelValue="clickEditRow"
|
@update:modelValue="updateSelectType"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -709,6 +709,8 @@ import type { ResponseObject } from "@/modules/04_registry/interface/response/Sa
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
treeTab,
|
treeTab,
|
||||||
|
OptionType,
|
||||||
|
OptionLevel,
|
||||||
} from "@/modules/04_registry/interface/index/Main";
|
} from "@/modules/04_registry/interface/index/Main";
|
||||||
import HistoryTable from "@/components/TableHistory.vue";
|
import HistoryTable from "@/components/TableHistory.vue";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -750,6 +752,9 @@ const orgName = ref<string>();
|
||||||
const agencyName = ref<string>();
|
const agencyName = ref<string>();
|
||||||
const cLevel = ref<string>();
|
const cLevel = ref<string>();
|
||||||
|
|
||||||
|
const levelOpsMain = ref<DataOption[]>([]);
|
||||||
|
const typeOpsMain = ref<DataOption[]>([]);
|
||||||
|
const dataLevel = ref<any>();
|
||||||
const positionName = ref<string>();
|
const positionName = ref<string>();
|
||||||
const positionLineName = ref<string>();
|
const positionLineName = ref<string>();
|
||||||
const positionPathSideName = ref<string>();
|
const positionPathSideName = ref<string>();
|
||||||
|
|
@ -1498,7 +1503,9 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchPosition();
|
// await fetchPosition();
|
||||||
|
await getPosition();
|
||||||
|
await fetchType();
|
||||||
// await nodeTree();
|
// await nodeTree();
|
||||||
await fetchData();
|
await fetchData();
|
||||||
});
|
});
|
||||||
|
|
@ -1590,88 +1597,88 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||||
/**
|
/**
|
||||||
* get รายการ ตำแหน่ง
|
* get รายการ ตำแหน่ง
|
||||||
*/
|
*/
|
||||||
const fetchPosition = async () => {
|
// const fetchPosition = async () => {
|
||||||
showLoader();
|
// showLoader();
|
||||||
await http
|
// await http
|
||||||
.get(config.API.position)
|
// .get(config.API.position)
|
||||||
.then((res) => {
|
// .then((res) => {
|
||||||
const data = res.data.result;
|
// const data = res.data.result;
|
||||||
let optionpositionpaths: DataOption[] = [];
|
// let optionpositionpaths: DataOption[] = [];
|
||||||
data.positionPaths.map((r: any) => {
|
// data.positionPaths.map((r: any) => {
|
||||||
optionpositionpaths.push({
|
// optionpositionpaths.push({
|
||||||
id: r.id.toString(),
|
// id: r.id.toString(),
|
||||||
name: r.name.toString(),
|
// name: r.name.toString(),
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
positionOptions.value = optionpositionpaths;
|
// positionOptions.value = optionpositionpaths;
|
||||||
positionOptionsFilter.value = optionpositionpaths;
|
// positionOptionsFilter.value = optionpositionpaths;
|
||||||
|
|
||||||
let optionPositionPathSides: DataOption[] = [];
|
// let optionPositionPathSides: DataOption[] = [];
|
||||||
data.positionPathSides.map((r: any) => {
|
// data.positionPathSides.map((r: any) => {
|
||||||
optionPositionPathSides.push({
|
// optionPositionPathSides.push({
|
||||||
id: r.id.toString(),
|
// id: r.id.toString(),
|
||||||
name: r.name.toString(),
|
// name: r.name.toString(),
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
positionSideOptions.value = optionPositionPathSides;
|
// positionSideOptions.value = optionPositionPathSides;
|
||||||
positionSideOptionsFilter.value = optionPositionPathSides;
|
// positionSideOptionsFilter.value = optionPositionPathSides;
|
||||||
|
|
||||||
let optionPositionTypes: DataOption[] = [];
|
// let optionPositionTypes: DataOption[] = [];
|
||||||
data.positionTypes.map((r: any) => {
|
// data.positionTypes.map((r: any) => {
|
||||||
optionPositionTypes.push({
|
// optionPositionTypes.push({
|
||||||
id: r.id.toString(),
|
// id: r.id.toString(),
|
||||||
name: r.name.toString(),
|
// name: r.name.toString(),
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
positionTypeOptions.value = optionPositionTypes;
|
// positionTypeOptions.value = optionPositionTypes;
|
||||||
positionTypeOptionsFilter.value = optionPositionTypes;
|
// positionTypeOptionsFilter.value = optionPositionTypes;
|
||||||
|
|
||||||
let optionPositionLines: DataOption[] = [];
|
// let optionPositionLines: DataOption[] = [];
|
||||||
data.positionLines.map((r: any) => {
|
// data.positionLines.map((r: any) => {
|
||||||
optionPositionLines.push({
|
// optionPositionLines.push({
|
||||||
id: r.id.toString(),
|
// id: r.id.toString(),
|
||||||
name: r.name.toString(),
|
// name: r.name.toString(),
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
positionLineOptions.value = optionPositionLines;
|
// positionLineOptions.value = optionPositionLines;
|
||||||
positionLineOptionsFilter.value = optionPositionLines;
|
// positionLineOptionsFilter.value = optionPositionLines;
|
||||||
|
|
||||||
let optionPositionExecutives: DataOption[] = [];
|
// let optionPositionExecutives: DataOption[] = [];
|
||||||
data.positionExecutives.map((r: any) => {
|
// data.positionExecutives.map((r: any) => {
|
||||||
optionPositionExecutives.push({
|
// optionPositionExecutives.push({
|
||||||
id: r.id.toString(),
|
// id: r.id.toString(),
|
||||||
name: r.name.toString(),
|
// name: r.name.toString(),
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
positionExecutiveOptions.value = optionPositionExecutives;
|
// positionExecutiveOptions.value = optionPositionExecutives;
|
||||||
positionExecutiveOptionsFilter.value = optionPositionExecutives;
|
// positionExecutiveOptionsFilter.value = optionPositionExecutives;
|
||||||
|
|
||||||
let optionPositionExecutiveSides: DataOption[] = [];
|
// let optionPositionExecutiveSides: DataOption[] = [];
|
||||||
data.positionExecutiveSides.map((r: any) => {
|
// data.positionExecutiveSides.map((r: any) => {
|
||||||
optionPositionExecutiveSides.push({
|
// optionPositionExecutiveSides.push({
|
||||||
id: r.id.toString(),
|
// id: r.id.toString(),
|
||||||
name: r.name.toString(),
|
// name: r.name.toString(),
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
positionExecutiveSideOptions.value = optionPositionExecutiveSides;
|
// positionExecutiveSideOptions.value = optionPositionExecutiveSides;
|
||||||
positionExecutiveSideOptionsFilter.value = optionPositionExecutiveSides;
|
// positionExecutiveSideOptionsFilter.value = optionPositionExecutiveSides;
|
||||||
|
|
||||||
let optionPositionLevels: DataOption[] = [];
|
// let optionPositionLevels: DataOption[] = [];
|
||||||
data.positionLevels.map((r: any) => {
|
// data.positionLevels.map((r: any) => {
|
||||||
optionPositionLevels.push({
|
// optionPositionLevels.push({
|
||||||
id: r.id.toString(),
|
// id: r.id.toString(),
|
||||||
name: r.name.toString(),
|
// name: r.name.toString(),
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
positionLevelOptions.value = optionPositionLevels;
|
// positionLevelOptions.value = optionPositionLevels;
|
||||||
positionLevelOptionsFilter.value = optionPositionLevels;
|
// positionLevelOptionsFilter.value = optionPositionLevels;
|
||||||
})
|
// })
|
||||||
.catch((e: any) => {})
|
// .catch((e: any) => {})
|
||||||
.finally(() => {
|
// .finally(() => {
|
||||||
// hideLoader();
|
// // hideLoader();
|
||||||
store.isLoad++;
|
// store.isLoad++;
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
if (profileId.value) {
|
if (profileId.value) {
|
||||||
|
|
@ -2193,6 +2200,24 @@ const clickEditRow = () => {
|
||||||
editRow.value = true;
|
editRow.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function updateSelectType(val: string) {
|
||||||
|
editRow.value = true;
|
||||||
|
|
||||||
|
let optionPositionLevels: DataOption[] = [];
|
||||||
|
|
||||||
|
const listLevel = dataLevel.value.find((e: any) => e.id === val);
|
||||||
|
levelOpsMain.value = listLevel.posLevels.map((r: any) => {
|
||||||
|
optionPositionLevels.push({
|
||||||
|
id: r.id.toString(),
|
||||||
|
name: r.posLevelName.toString(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
positionLevelOptions.value = optionPositionLevels;
|
||||||
|
positionLevelOptionsFilter.value = optionPositionLevels;
|
||||||
|
positionLevelId.value = "";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* เช็คว่ามีการแก้ไขข้อมูล
|
* เช็คว่ามีการแก้ไขข้อมูล
|
||||||
*/
|
*/
|
||||||
|
|
@ -2285,6 +2310,99 @@ const getClass = (val: boolean) => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
const resetFilter = () => {};
|
const resetFilter = () => {};
|
||||||
|
|
||||||
|
function getPosition() {
|
||||||
|
http
|
||||||
|
.get(config.API.orgSalaryPosition)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
const dataOp = res.data.result;
|
||||||
|
const dataLineOp = res.data.result;
|
||||||
|
|
||||||
|
let optionpositionpaths: DataOption[] = [];
|
||||||
|
let optionPositionLines: DataOption[] = [];
|
||||||
|
|
||||||
|
const usedIds = new Set();
|
||||||
|
const usedIdsLine = new Set();
|
||||||
|
|
||||||
|
dataOp.forEach((r: any) => {
|
||||||
|
const id = r.positionName.toString();
|
||||||
|
const name = r.positionName.toString();
|
||||||
|
|
||||||
|
if (!usedIds.has(id)) {
|
||||||
|
optionpositionpaths.push({
|
||||||
|
id: id,
|
||||||
|
name: name,
|
||||||
|
});
|
||||||
|
|
||||||
|
usedIds.add(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dataLineOp.forEach((r: any) => {
|
||||||
|
const id = r.positionField.toString();
|
||||||
|
const name = r.positionField.toString();
|
||||||
|
|
||||||
|
if (!usedIdsLine.has(id)) {
|
||||||
|
optionPositionLines.push({
|
||||||
|
id: id,
|
||||||
|
name: name,
|
||||||
|
});
|
||||||
|
|
||||||
|
usedIdsLine.add(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
positionOptions.value = optionpositionpaths;
|
||||||
|
positionOptionsFilter.value = optionpositionpaths;
|
||||||
|
|
||||||
|
positionLineOptions.value = optionPositionLines;
|
||||||
|
positionLineOptionsFilter.value = optionPositionLines;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
store.isLoad++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchType() {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.orgPosType)
|
||||||
|
.then((res) => {
|
||||||
|
dataLevel.value = res.data.result;
|
||||||
|
|
||||||
|
let optionPositionTypes: DataOption[] = [];
|
||||||
|
|
||||||
|
typeOpsMain.value = res.data.result.map((e: OptionType) => ({
|
||||||
|
id: e.id,
|
||||||
|
name: e.posTypeName,
|
||||||
|
}));
|
||||||
|
positionTypeOptions.value = typeOpsMain.value;
|
||||||
|
|
||||||
|
res.data.result.map((r: any) => {
|
||||||
|
optionPositionTypes.push({
|
||||||
|
id: r.id.toString(),
|
||||||
|
name: r.posTypeName.toString(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
positionTypeOptions.value = optionPositionTypes;
|
||||||
|
positionTypeOptionsFilter.value = optionPositionTypes;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// watch(()=>modal.value,()=>{
|
||||||
|
// if(modal.value == true){
|
||||||
|
// getPosition()
|
||||||
|
// }
|
||||||
|
// })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.modalfix {
|
.modalfix {
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,16 @@ interface DisciplineOps {
|
||||||
levelOptions: DataOption[];
|
levelOptions: DataOption[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface OptionType {
|
||||||
|
id: string;
|
||||||
|
posTypeName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OptionLevel {
|
||||||
|
id: string;
|
||||||
|
posLevelName: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
Pagination,
|
Pagination,
|
||||||
DataOption,
|
DataOption,
|
||||||
|
|
@ -81,4 +91,6 @@ export type {
|
||||||
InsigniaOps,
|
InsigniaOps,
|
||||||
DisciplineOps,
|
DisciplineOps,
|
||||||
DataOptionLeave,
|
DataOptionLeave,
|
||||||
|
OptionType,
|
||||||
|
OptionLevel,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue