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