diff --git a/src/modules/05_placement/components/PersonalList/PersonalListPage.vue b/src/modules/05_placement/components/PersonalList/PersonalListPage.vue index 2606b1863..3b6bad130 100644 --- a/src/modules/05_placement/components/PersonalList/PersonalListPage.vue +++ b/src/modules/05_placement/components/PersonalList/PersonalListPage.vue @@ -53,7 +53,7 @@ async function getStat() { disclaim: statCard.disclaim, report: statCard.report, }; - DataStore.checkLoad(1); + // DataStore.checkLoad(1); }) .catch((e) => { messageError($q, e); diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 77986cc21..bf40e39be 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -378,8 +378,10 @@ async function getTable() { // รายชื่อทั้งหมด await filterpositionCandidate(rowData); - rows.value = rowData; + // rows.value = rowData; rowsAwait.value = rowData; + await onUpdateNewRows(typeEmployee.value,positionCandidate.value) + // รายชื่อไปยังหน่วยงาน rowsFilter.value = await rows.value.filter( @@ -394,7 +396,7 @@ async function getTable() { e.nodeName !== null && e.reportingDate !== null ); - await DataStore.checkLoad(1); + // await DataStore.checkLoad(1); // insertAvatar(rows.value); }) .catch((e) => { @@ -419,8 +421,6 @@ async function filterpositionCandidate(data: any) { arr.findIndex((e: any) => e.id === item.id) === index ); positionCandidateData.value.push(...uniqueData); - - console.log(positionCandidateData.value); } /** ยืนยันการผ่อนผัน*/ @@ -756,7 +756,12 @@ function openModalOrder(val: boolean) { modalOrder.value = val; } -function onUpdateNewRows(type: string, pos: string) { +const typeEmployee = ref(""); +const positionCandidate = ref(""); + +async function onUpdateNewRows(type: string, pos: string) { + typeEmployee.value = type; + positionCandidate.value = pos; const data = onSearchDataTable( filter.value, rowsAwait.value, diff --git a/src/modules/05_placement/components/PersonalList/TableView.vue b/src/modules/05_placement/components/PersonalList/TableView.vue index af2c13b4b..568e9c2f4 100644 --- a/src/modules/05_placement/components/PersonalList/TableView.vue +++ b/src/modules/05_placement/components/PersonalList/TableView.vue @@ -20,7 +20,6 @@ const bmaOfficerOption = ref([ ]); const positionCandidate = ref(""); -const positionCandidateOptions = ref([]); const props = defineProps({ inputfilter: String, @@ -120,6 +119,10 @@ const props = defineProps({ roleAdmin: Boolean, }); +const positionCandidateOptions = ref( + props?.positionCandidateData || [] +); + const pagination = ref({ sortBy: "examNumber", descending: false, diff --git a/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue b/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue index b614c5cdb..bba6aa29e 100644 --- a/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue +++ b/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue @@ -17,14 +17,18 @@ const mixin = useCounterMixin(); const { dialogConfirm, onSearchDataTable } = mixin; const dataMapToSend = computed(() => { - return selected.value.map((i: any) => ({ - id: i.id, - profileId: null, - prefix: null, - firstName: null, - lastName: null, - citizenId: null, - })); + const firstSelected = selected.value[0]; + return firstSelected + ? firstSelected.directors.map((i: any) => ({ + id: firstSelected.id, + profileId: i.profileId, + prefix: i.prefix, + firstName: i.firstName, + lastName: i.lastName, + citizenId: i.citizenId, + rootId: i.rootId, + })) + : []; }); const filterKeyword = defineModel("filterKeyword", { required: true }); @@ -89,6 +93,9 @@ const columns = ref([ field: "status", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return convertText(row.status); + }, }, ]); @@ -224,11 +231,6 @@ watchEffect(() => { 1 }} -
- {{ - props.row.status ? convertText(props.row.status) : "-" - }} -
{{ col.value ? col.value : "-" }} diff --git a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue index 2320af0d5..538682ffe 100644 --- a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue +++ b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue @@ -280,8 +280,10 @@ function onAddPerson() { actFullName: item.actFullName, posNo: item.posNo, role: member.value, + rootId: item.orgRootId, })); - rows.value = [...rows.value, ...data]; + + rows.value.push(...data); const roleOrder: Record<"chairman" | "committee" | "caregiver", number> = { chairman: 0, committee: 1, @@ -294,6 +296,7 @@ function onAddPerson() { roleOrder[b.role as keyof typeof roleOrder] ); }); + close(); } @@ -365,25 +368,24 @@ function changeFormData() { function onSubmit() { const body = { topic: topic.value, - persons: rows.value.map( - ({ prefix, firstName, lastName, citizenId, ...newData }) => newData - ), + persons: rows.value.map(({ ...newData }) => newData), }; - dialogConfirm($q, () => { + + dialogConfirm($q, async () => { showLoader(); - http + await http .put(config.API.appointMain + `/${id.value}`, body) - .then(async (res) => { + .then(async () => { await getData(); success($q, "บันทึกข้อมูลสำเร็จ"); isSave.value = false; - hideLoader(); }) .catch((e) => { messageError($q, e); - hideLoader(); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); }); } @@ -446,17 +448,11 @@ async function onAct() { selected.value = []; } -function resetFilter() { - pagination.value.page = 1; - filterKeyword.value = ""; - getPerson(); -} watch( () => modal.value, () => { if (modal.value) { filterKeyword.value = ""; - optionsTypeMain.value = optionsType.value; const optionData = optionsType.value; const caregiverCount = rows.value.filter( diff --git a/src/modules/05_placement/components/probation/MainAppoint.vue b/src/modules/05_placement/components/probation/MainAppoint.vue index 7c29cb8d6..d0d6620a7 100644 --- a/src/modules/05_placement/components/probation/MainAppoint.vue +++ b/src/modules/05_placement/components/probation/MainAppoint.vue @@ -77,6 +77,9 @@ const columns = ref([ field: "status", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return convertText(row.status); + }, }, ]); @@ -285,9 +288,6 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
-
- {{ props.row.status ? convertText(props.row.status) : "-" }} -
{{ col.value ? col.value : "-" }} diff --git a/src/modules/05_placement/interface/request/Main.ts b/src/modules/05_placement/interface/request/Main.ts index e59bf4781..1d405f3e7 100644 --- a/src/modules/05_placement/interface/request/Main.ts +++ b/src/modules/05_placement/interface/request/Main.ts @@ -96,6 +96,7 @@ interface AppointMainRows { topic: string; commandNo: string; status: string; + directors: any[]; } interface FormAppointData { @@ -130,6 +131,7 @@ interface MemBerType { posNo: string; actFullName: string; isDirector?: boolean; + orgRootId?: string; } interface FormDataAppoint { diff --git a/src/modules/18_command/components/DialogCreateCommand.vue b/src/modules/18_command/components/DialogCreateCommand.vue index 1bfc31e58..8911e824e 100644 --- a/src/modules/18_command/components/DialogCreateCommand.vue +++ b/src/modules/18_command/components/DialogCreateCommand.vue @@ -275,7 +275,6 @@ async function fetchCommandType() { (v: ListCommand) => v.code == props.commandTypeCode ); commandType.value = commandOp.value[0].id; - console.log("🚀 ~ fetchCommandType ~ commandType.value:", commandType.value); } /**