Merge commit 'fd1485930c' into develop
This commit is contained in:
commit
022e3d3ff7
5 changed files with 295 additions and 124 deletions
|
|
@ -31,4 +31,6 @@ export default {
|
|||
|
||||
orgPosExecutiveById: (id: string) => `${orgPos}/executive/${id}`,
|
||||
orgPosHistory: (id: string) => `${orgPos}/history/${id}`,
|
||||
|
||||
orgSalaryPosition:`${orgPos}/position?keyword=&type=ALL`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@
|
|||
(val: string) => !!val || `${'กรุณาเลือกตำแหน่งประเภท'}`,
|
||||
]"
|
||||
:label="`${'ตำแหน่งประเภท'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
@update:modelValue="updateSelectType"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -335,6 +335,15 @@
|
|||
option-value="id"
|
||||
hide-bottom-space
|
||||
use-input
|
||||
:display-value="
|
||||
positionTypeOptions.find(
|
||||
(x) => x.id == positionTypeId
|
||||
)
|
||||
? positionTypeOptions.find(
|
||||
(x) => x.id == positionTypeId
|
||||
)?.name
|
||||
: null
|
||||
"
|
||||
input-debounce="0"
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, '4'
|
||||
|
|
@ -361,6 +370,15 @@
|
|||
hide-bottom-space
|
||||
use-input
|
||||
input-debounce="0"
|
||||
:display-value="
|
||||
positionLevelOptions.find(
|
||||
(x) => x.id == positionLevelId
|
||||
)
|
||||
? positionLevelOptions.find(
|
||||
(x) => x.id == positionLevelId
|
||||
)?.name
|
||||
: null
|
||||
"
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, '6'
|
||||
)"
|
||||
|
|
@ -709,6 +727,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 +770,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 +1521,8 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
|||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchPosition();
|
||||
// await fetchPosition();
|
||||
await getPosition();
|
||||
// await nodeTree();
|
||||
await fetchData();
|
||||
});
|
||||
|
|
@ -1590,88 +1614,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) {
|
||||
|
|
@ -1709,8 +1733,8 @@ const fetchData = async () => {
|
|||
positionPathSideName: e.positionPathSideName,
|
||||
positionType: e.positionType,
|
||||
positionTypeId: e.positionTypeId,
|
||||
positionLevel: e.positionLevel,
|
||||
positionLevelId: e.positionLevelId,
|
||||
positionLevel: e.positionLevel,
|
||||
positionExecutive: e.positionExecutive,
|
||||
positionExecutiveId: e.positionExecutiveId,
|
||||
positionExecutiveName: e.positionExecutiveName,
|
||||
|
|
@ -1737,48 +1761,48 @@ const fetchData = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
const onSelected = async (id: string) => {
|
||||
await fetchPositionNumber(id);
|
||||
};
|
||||
// const onSelected = async (id: string) => {
|
||||
// await fetchPositionNumber(id);
|
||||
// };
|
||||
|
||||
const fetchOrganization = async (id: string) => {
|
||||
if (selected.value != "") {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.organizationName(id))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
ocId.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
// const fetchOrganization = async (id: string) => {
|
||||
// if (selected.value != "") {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.organizationName(id))
|
||||
// .then((res) => {
|
||||
// let data = res.data.result;
|
||||
// ocId.value = data;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
// };
|
||||
|
||||
const fetchPositionNumber = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.getPositionNumberIdByOcId(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: DataOption) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
posNoOptions.value = option;
|
||||
posNoOptionsFilter.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
// const fetchPositionNumber = async (id: string) => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.getPositionNumberIdByOcId(id))
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// let option: DataOption[] = [];
|
||||
// data.map((r: DataOption) => {
|
||||
// option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
// });
|
||||
// posNoOptions.value = option;
|
||||
// posNoOptionsFilter.value = option;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* กดดูข้อมูลก่อนหน้า
|
||||
|
|
@ -1809,7 +1833,7 @@ const getData = async () => {
|
|||
amount.value = row.amount;
|
||||
positionSalaryAmount.value = row.positionSalaryAmount;
|
||||
mouthSalaryAmount.value = row.mouthSalaryAmount;
|
||||
await onSelected(row.ocId);
|
||||
// await onSelected(row.ocId);
|
||||
selected.value = row.ocId;
|
||||
positionName.value = row.positionName;
|
||||
posNoId.value = row.posNoId;
|
||||
|
|
@ -1824,7 +1848,7 @@ const getData = async () => {
|
|||
salaryRef.value = row.salaryRef;
|
||||
refCommandNo.value = row.refCommandNo;
|
||||
id.value = row.id;
|
||||
await fetchPositionNumber(row.ocId);
|
||||
// await fetchPositionNumber(row.ocId);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -2193,6 +2217,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 +2327,121 @@ 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();
|
||||
if (positionTypeId.value) {
|
||||
let optionPositionLevels: DataOption[] = [];
|
||||
|
||||
const listLevel = dataLevel.value.find(
|
||||
(e: any) => e.id === positionTypeId.value
|
||||
);
|
||||
levelOpsMain.value = listLevel.posLevels.map((r: any) => {
|
||||
optionPositionLevels.push({
|
||||
id: r.id.toString(),
|
||||
name: r.posLevelName.toString(),
|
||||
});
|
||||
});
|
||||
|
||||
positionLevelOptions.value = optionPositionLevels;
|
||||
positionLevelOptionsFilter.value = optionPositionLevels;
|
||||
}
|
||||
});
|
||||
}
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
if (modal.value == true) {
|
||||
positionTypeOptions.value = [];
|
||||
positionLevelOptions.value = [];
|
||||
positionLevelOptionsFilter.value = [];
|
||||
fetchType();
|
||||
}
|
||||
}
|
||||
);
|
||||
</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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ async function copyLink(name: string) {
|
|||
.then((res) => {
|
||||
const link = res.data.downloadUrl;
|
||||
navigator.clipboard.writeText(link);
|
||||
success($q, "คัดลอก URL สำเร็จ");
|
||||
success($q, "คัดลอกลิงก์สำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -298,7 +298,7 @@ onMounted(async () => {
|
|||
icon="mdi-clipboard-outline"
|
||||
@click="copyLink(file.pathName)"
|
||||
>
|
||||
<q-tooltip>คัดลอกลิ้งก์</q-tooltip>
|
||||
<q-tooltip>คัดลอกลิงก์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
//Convert to an array and store
|
||||
const calcFormat = calcFormatTmp.split("-");
|
||||
//Subtract each member of our array from the default date
|
||||
const days_passed = Number(Math.abs(Number(calcFormat[0])) - 1);
|
||||
const days_passed = Number(Math.abs(Number(calcFormat[0])));
|
||||
const months_passed = Number(Math.abs(Number(calcFormat[1])) - 1);
|
||||
const years_passed = Number(Math.abs(Number(calcFormat[2])) - 1970);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue