Merge branch 'develop' into dev-tee
This commit is contained in:
commit
b3abe902fa
23 changed files with 1289 additions and 1927 deletions
|
|
@ -970,6 +970,7 @@ onMounted(async () => {
|
|||
await fetchOrganizationAgencyCode();
|
||||
await fetchPosition();
|
||||
await fetchData();
|
||||
await nodeTree();
|
||||
});
|
||||
|
||||
const onSelected = async (id: string) => {
|
||||
|
|
@ -1647,7 +1648,6 @@ const clickAdd = async () => {
|
|||
isActive.value = false;
|
||||
isCondition.value = false;
|
||||
conditionNote.value = "";
|
||||
await nodeTree();
|
||||
};
|
||||
|
||||
/**เมื่อเลือกใหม่
|
||||
|
|
|
|||
|
|
@ -100,10 +100,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<QTableProps["rows"]>([]);
|
||||
// const yearValue = ref<number>(0); // เพิ่มตัวแปรในโมดูล
|
||||
|
||||
// let OriginalData = ref<FormPlacementMainData[]>([]);
|
||||
// let UpdataData = ref<FormPlacementMainData[]>([]);
|
||||
const searchYear = ref();
|
||||
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
|
||||
|
|
@ -126,14 +122,11 @@ onMounted(async () => {
|
|||
const fetchPlacementData = async (val: number) => {
|
||||
showLoader();
|
||||
rows.value = [];
|
||||
http
|
||||
await http
|
||||
.get(config.API.MainDetail(val))
|
||||
.then(async (res) => {
|
||||
dataPlacement.value = res.data.result;
|
||||
DataStore.DataMainOrig = dataPlacement.value;
|
||||
console.log(DataStore.DataMainOrig);
|
||||
|
||||
// rows.value = DataStore.DataMainOrig;
|
||||
const dataArr: any = [];
|
||||
await DataStore.DataMainOrig.map((e: any) => {
|
||||
dataArr.push({
|
||||
|
|
@ -149,27 +142,25 @@ const fetchPlacementData = async (val: number) => {
|
|||
numberOfCandidates: e.numberOfCandidates,
|
||||
});
|
||||
});
|
||||
|
||||
rows.value = dataArr;
|
||||
|
||||
examTypeFilter();
|
||||
examTimeFilter();
|
||||
expiredAccountFilter();
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
filterKeyword.value = "";
|
||||
examTime.value = "all"
|
||||
examType.value = "all"
|
||||
expiredAccount.value = false
|
||||
examTime.value = "all";
|
||||
examType.value = "all";
|
||||
expiredAccount.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const fetchYearOptions = async () => {
|
||||
http
|
||||
await http
|
||||
.get(config.API.yearOptions())
|
||||
.then((res) => {
|
||||
const response = res.data.result;
|
||||
|
|
@ -179,7 +170,6 @@ const fetchYearOptions = async () => {
|
|||
}, "");
|
||||
searchYear.value = maxNumber;
|
||||
DataStore.DataMainYearSet(searchYear.value);
|
||||
// DataStore.DataMainYear = yearOptions.value;
|
||||
fetchPlacementData(searchYear.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -187,7 +177,6 @@ const fetchYearOptions = async () => {
|
|||
});
|
||||
};
|
||||
const filterYear = () => {
|
||||
// console.log("searchYear", searchYear.value);
|
||||
fetchPlacementData(searchYear.value);
|
||||
};
|
||||
|
||||
|
|
@ -210,7 +199,6 @@ const examTimeOP = reactive<DataOption1[]>([{ id: "all", name: "ทั้งห
|
|||
const addedExamTimeValues: Set<number> = new Set();
|
||||
|
||||
const examTimeFilter = async () => {
|
||||
// examTimeOP.push({ id: "all", name: "ทั้งหมด" });
|
||||
for (const data of dataPlacement.value) {
|
||||
const examOrder = data.examOrder;
|
||||
if (examOrder !== null && !addedExamTimeValues.has(examOrder)) {
|
||||
|
|
@ -274,12 +262,8 @@ const searchFilterTable = async () => {
|
|||
//----------------|บัญชีหมดอายุ|-----------------------------//
|
||||
const expiredAccount = ref<boolean>(false);
|
||||
const expiredAccountFilter = async () => {
|
||||
// const currentDate = new Date();
|
||||
const updatedRows = dataPlacement.value.map((data: any) => {
|
||||
// let expirationDate = new Date(data.accountExpirationDate);
|
||||
// let isExpired = currentDate > expirationDate;
|
||||
let isExpired = data.isExpired == expiredAccount;
|
||||
|
||||
return { ...data, isExpired };
|
||||
});
|
||||
await DataStore.DataMain(updatedRows);
|
||||
|
|
@ -427,7 +411,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ const fetchPlacementData = async () => {
|
|||
DataStore.DataMainOrig = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -141,11 +141,7 @@ const fetchPlacementData = async () => {
|
|||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm">
|
||||
<div>
|
||||
<AddTablePosition
|
||||
:statCard="getStat"
|
||||
class="q-pa-none"
|
||||
@get-stat="getStat"
|
||||
/>
|
||||
<AddTablePosition :statCard="getStat" class="q-pa-none" />
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -37,9 +37,6 @@ let dataForm = reactive({
|
|||
positionLineId: "",
|
||||
positionPathSideId: "",
|
||||
positionTypeId: "",
|
||||
// salaryAmount: null,
|
||||
// mouthSalaryAmount: null,
|
||||
// positionSalaryAmount: null,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -85,7 +82,6 @@ const loadTreeData = async () => {
|
|||
};
|
||||
|
||||
function filterByPersonIdNull(obj: any) {
|
||||
// console.log(obj);
|
||||
if (obj.name === null && obj.isCondition != true) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -102,8 +98,6 @@ const fetchplacementPosition = async () => {
|
|||
await http
|
||||
.get(config.API.placementPosition())
|
||||
.then((res: any) => {
|
||||
console.log("1221111111");
|
||||
|
||||
placementPosition.value = res.data.result;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
|
|
@ -164,8 +158,6 @@ const validateData = async () => {
|
|||
};
|
||||
|
||||
const saveAppoint = async () => {
|
||||
console.log("save", dataForm);
|
||||
|
||||
myFormPosition.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
const dataAppoint = await {
|
||||
|
|
@ -177,16 +169,12 @@ const saveAppoint = async () => {
|
|||
positionLineId: dataForm.positionLineId,
|
||||
positionPathSideId: dataForm.positionPathSideId,
|
||||
positionTypeId: dataForm.positionTypeId,
|
||||
// salaryAmount: dataForm.salaryAmount,
|
||||
// mouthSalaryAmount: dataForm.mouthSalaryAmount,
|
||||
// positionSalaryAmount: dataForm.positionSalaryAmount,
|
||||
};
|
||||
console.log("save appoint===>", dataAppoint);
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.placementPass(), dataAppoint)
|
||||
.then((res) => {
|
||||
console.log("respone=>", res);
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -194,7 +182,6 @@ const saveAppoint = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await closeAndClear();
|
||||
// await resetFilter();
|
||||
await fetchPublishFile();
|
||||
await loadTreeData();
|
||||
await fetchplacementPosition();
|
||||
|
|
@ -217,15 +204,6 @@ const closeModal = () => {
|
|||
"ข้อมูลมีการแก้ไข",
|
||||
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: `ข้อมูลมีการแก้ไข`,
|
||||
// message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
// cancel: "ยกเลิก",
|
||||
// ok: "ยืนยัน",
|
||||
// persistent: true,
|
||||
// }).onOk(() => {
|
||||
// closeAndClear();
|
||||
// });
|
||||
} else {
|
||||
closeAndClear();
|
||||
}
|
||||
|
|
@ -243,9 +221,6 @@ const closeAndClear = async () => {
|
|||
dataForm.positionLineId = "";
|
||||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
// dataForm.salaryAmount = null;
|
||||
// dataForm.mouthSalaryAmount = null;
|
||||
// dataForm.positionSalaryAmount = null;
|
||||
editDataStatus.value = false;
|
||||
};
|
||||
// ตำแหน่งเลขที่
|
||||
|
|
@ -292,10 +267,7 @@ const positionLevelOptions = ref<Object[]>([
|
|||
]);
|
||||
|
||||
const selectedPosition = async (data: any) => {
|
||||
// console.log("selecteds", data);
|
||||
if (data.name == null && selected.value != data.keyId) {
|
||||
// console.log("selecteds", data);
|
||||
|
||||
editDataStatus.value = true;
|
||||
selected.value = data.keyId;
|
||||
|
||||
|
|
@ -376,7 +348,6 @@ const selectedPosition = async (data: any) => {
|
|||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
}
|
||||
// console.log("dataForm", dataForm);
|
||||
};
|
||||
|
||||
const checkPosition = (val: string) => {
|
||||
|
|
@ -394,36 +365,28 @@ watch(props, () => {
|
|||
dataPersonal.map((data: any) => {
|
||||
personal.value = data;
|
||||
});
|
||||
console.log("personal", personal.value);
|
||||
}
|
||||
// console.log("draft===>", personal.value.draft);
|
||||
|
||||
if (
|
||||
personal.value &&
|
||||
personal.value.draft === false &&
|
||||
personal.value.positionNumber !== null
|
||||
) {
|
||||
// const findData = dataRespone.value.find(findByPerson);
|
||||
let findData: any = null;
|
||||
dataRespone.value.map((x: any) => {
|
||||
findData = findByPerson(x);
|
||||
// console.log(findData);
|
||||
|
||||
if (findData != null) {
|
||||
// console.log("findData===>", findData);
|
||||
selectedPosition(findData);
|
||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||
expanded.value.push(findData.keyId.slice(0, i));
|
||||
}
|
||||
}
|
||||
});
|
||||
// loadTreeData();
|
||||
// selectedPosition(findData.children.children.children)
|
||||
}
|
||||
});
|
||||
|
||||
function findByPerson(element: any): any {
|
||||
// console.log("searchTree element===>", element)
|
||||
if (
|
||||
element.positionNumId &&
|
||||
element.positionLineId === personal.value.positionLineId &&
|
||||
|
|
@ -444,37 +407,12 @@ function findByPerson(element: any): any {
|
|||
return null;
|
||||
}
|
||||
const clearPosition = () => {
|
||||
// console.log(personal.value);
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => postClearPosition(),
|
||||
"ยืนยันการคืนตำแหน่ง",
|
||||
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการคืนตำแหน่ง",
|
||||
// message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// const: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.clearPosition(personal.value.personalId), {})
|
||||
// .then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ"))
|
||||
// .catch((e: Object) => {
|
||||
// console.log(e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// await closeAndClear();
|
||||
// });
|
||||
// })
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
};
|
||||
const postClearPosition = async () => {
|
||||
showLoader();
|
||||
|
|
@ -485,7 +423,7 @@ const postClearPosition = async () => {
|
|||
})
|
||||
|
||||
.catch((e: Object) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
|
|
@ -540,8 +478,6 @@ const postClearPosition = async () => {
|
|||
</div>
|
||||
|
||||
<!--แสดง Total Count PositionNum-->
|
||||
<!-- <q-badge rounded color="grey-2" text-color="dark"
|
||||
:label="prop.node.totalPositionCount" /> -->
|
||||
<q-badge
|
||||
v-if="prop.node.totalPositionVacant > 0"
|
||||
rounded
|
||||
|
|
@ -790,55 +726,6 @@ const postClearPosition = async () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-sx-12 col-sm-12 col-md-12">
|
||||
<q-separator inset size="2px" class="q-my-md" />
|
||||
</div> -->
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="dataForm.salaryAmount"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="dataForm.positionSalaryAmount"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`,
|
||||
]"
|
||||
:label="`${'เงินประจำตำแหน่ง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="dataForm.mouthSalaryAmount"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`,
|
||||
]"
|
||||
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
</q-scroll-area>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -185,7 +185,6 @@ const convertBmaOfficer = (val: string) => {
|
|||
return "บุคคลภายนอก";
|
||||
}
|
||||
};
|
||||
|
||||
const convertContainStatus = (val: string) => {
|
||||
switch (val) {
|
||||
case "UN-CONTAIN":
|
||||
|
|
@ -216,7 +215,6 @@ const getTable = async () => {
|
|||
await http
|
||||
.get(config.API.personalList(examIdString))
|
||||
.then(async (res: any) => {
|
||||
console.log(res);
|
||||
dataRes.value = res.data.result;
|
||||
rowsAll.value = [];
|
||||
(rowsFilter.value = []),
|
||||
|
|
@ -252,7 +250,6 @@ const getTable = async () => {
|
|||
draft: convertDraft(data.draft),
|
||||
positionCandidate: data.positionCandidate,
|
||||
};
|
||||
|
||||
rowsAll.value.push(rowData);
|
||||
});
|
||||
|
||||
|
|
@ -266,7 +263,6 @@ const getTable = async () => {
|
|||
e.positionNumber !== null &&
|
||||
e.statusName == "เตรียมบรรจุ"
|
||||
);
|
||||
console.log(rowsFilter.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -277,7 +273,6 @@ const getTable = async () => {
|
|||
};
|
||||
|
||||
const appointModal = ref<boolean>(false);
|
||||
|
||||
const saveDeferment = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
|
|
@ -287,18 +282,6 @@ const saveDeferment = async () => {
|
|||
"ยืนยันการขอผ่อนผัน",
|
||||
"ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการขอผ่อนผัน",
|
||||
// message: "ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// const: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {})
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -314,7 +297,7 @@ const postDeferment = async () => {
|
|||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
|
|
@ -343,7 +326,6 @@ const postDisclaimf = async () => {
|
|||
personId: personalId.value,
|
||||
};
|
||||
showLoader();
|
||||
console.log("ยืนยันการสละสิทธิ์");
|
||||
await http
|
||||
.post(config.API.disclaimF(), {
|
||||
note: dataPost.note,
|
||||
|
|
@ -487,7 +469,6 @@ const displayAdd = ref<boolean>(true);
|
|||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
console.log("roleAdmin===>", roleAdmin.value);
|
||||
if (roleAdmin.value === false) {
|
||||
displayAdd.value = false;
|
||||
visibleColumns.value = [
|
||||
|
|
@ -506,18 +487,9 @@ onMounted(async () => {
|
|||
}
|
||||
await getTable();
|
||||
});
|
||||
// watch(rowsAll, () => {
|
||||
// props.statCard();
|
||||
// });
|
||||
// watchEffect(() => {
|
||||
// if (getTable()) {
|
||||
// props.statCard();
|
||||
// }
|
||||
// });
|
||||
|
||||
const containStatus = ref<boolean>(false);
|
||||
watch(containStatus, () => {
|
||||
// console.log("containStatus===>", containStatus.value);
|
||||
if (containStatus.value) {
|
||||
rows.value = rowsAll.value.filter((x: any) => x.statusId == "CONTAIN");
|
||||
} else {
|
||||
|
|
@ -534,7 +506,6 @@ const savelist = () => {
|
|||
personal_selected.value.push(e.personalId);
|
||||
});
|
||||
if (personal_selected.value) {
|
||||
// console.log(personal_selected.value);
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -545,11 +516,10 @@ const savelist = () => {
|
|||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
|
|
@ -851,6 +821,7 @@ const pagination = ref({
|
|||
:validate="validateData"
|
||||
/>
|
||||
</q-form>
|
||||
|
||||
<q-dialog v-model="modalDefermentDisclaim" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form ref="myForm">
|
||||
|
|
@ -1005,14 +976,6 @@ const pagination = ref({
|
|||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<!-- <template v-slot:body-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template> -->
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { success, showLoader, hideLoader, date2Thai, modalConfirm } = mixin;
|
||||
const save = ref<boolean>(true);
|
||||
const { showLoader, hideLoader, date2Thai } = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
|
|
@ -80,49 +80,12 @@ const myForm = ref<any>([]);
|
|||
const personalForm = ref<any>([]);
|
||||
const selection = ref<any>([]);
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
function isRequired(val: any): boolean | string {
|
||||
return !!val || "กรุณาเลือกไฟล์เอกสารหลักฐาน";
|
||||
}
|
||||
|
||||
watch(props, () => {
|
||||
if (props.Modal === true) {
|
||||
// console.log(props.getdetail);
|
||||
fetchData();
|
||||
}
|
||||
});
|
||||
|
||||
const validateData = () => {
|
||||
const selectedIds = personalForm.value.isProperty;
|
||||
|
||||
const selectedItems = personalForm.value.isProperty.filter(
|
||||
(item: any) => item.value === true
|
||||
// selectedIds.includes(item.value)
|
||||
);
|
||||
return (
|
||||
selectedItems.length > 0 || selectedItems.length === selectedIds.length
|
||||
);
|
||||
};
|
||||
|
||||
// const ClickSave = () => {
|
||||
// const isValid = validateData();
|
||||
|
||||
// if (isValid) {
|
||||
// // props.close();
|
||||
// // props.validate();
|
||||
// // putpersonalForm();
|
||||
// modalConfirm(
|
||||
// $q,
|
||||
// "การยืนยัน",
|
||||
// "ยืนยันการบันทึกการคัดกรองคุณสมบัติ",
|
||||
// putpersonalForm
|
||||
// );
|
||||
// } else {
|
||||
// success($q, "กรอกให้ครบ");
|
||||
// console.log();
|
||||
// }
|
||||
// };
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -164,24 +127,6 @@ const close = async () => {
|
|||
selection.value = [];
|
||||
rows.value = [];
|
||||
};
|
||||
const putpersonalForm = async () => {
|
||||
props.close();
|
||||
// await http
|
||||
// .put(
|
||||
// config.API.putProperty("0a846508-4932-40de-9a9e-5b519492217c"),
|
||||
// personalForm.value.isProperty
|
||||
// )
|
||||
// .then((res) => {
|
||||
// success($q, res.data.message);
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// console.log(e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// props.close();
|
||||
// props.validate();
|
||||
// });
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
|
|
@ -336,29 +281,7 @@ const putpersonalForm = async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<!-- <div class="contanier-box-mini"> -->
|
||||
<!-- <q-card bordered class="card-panding">
|
||||
<div class="col-12 row items-center q-pa-sm header-text">
|
||||
เอกสารเพิ่มเติม
|
||||
</div> -->
|
||||
<!-- <div v-for="(item, index) of personalForm.isProperty" :key="index" class="q-pa-sm">
|
||||
<q-checkbox size="xs" v-model="item.value" :val="item.value" :label="item.name" keep-color color="teal"
|
||||
:rules="[isRequired]" class="checkbox-group" />
|
||||
<q-separator />
|
||||
</div> -->
|
||||
<!-- </q-card>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- <q-separator />
|
||||
<div>
|
||||
<DialogFooter
|
||||
@click="ClickSave"
|
||||
:model="props.Modal"
|
||||
:editvisible="save"
|
||||
:validate="validateData"
|
||||
/>
|
||||
</div> -->
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -231,9 +231,7 @@ const getData = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
status: r.status ?? "",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${
|
||||
r.lastName ?? ""
|
||||
}`,
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
|
|||
|
|
@ -221,9 +221,7 @@ const getData = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
status: r.status ?? "",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${
|
||||
r.lastName ?? ""
|
||||
}`,
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,17 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "realReason",
|
||||
align: "left",
|
||||
|
|
@ -148,6 +159,7 @@ onMounted(async () => {
|
|||
}
|
||||
});
|
||||
|
||||
//นำข้อมูลจาก API มาแสดง
|
||||
const fecthlist = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -158,6 +170,7 @@ const fecthlist = async () => {
|
|||
data.map((r: ResponseItems) => {
|
||||
list.push({
|
||||
datetext: r.createdAt !== null ? date2Thai(r.createdAt) : "-",
|
||||
fullname: r.fullname ?? "",
|
||||
createdAt: new Date(r.createdAt),
|
||||
futureWork: !!r.futureWork,
|
||||
futureWorkReason: r.futureWorkReason ?? "",
|
||||
|
|
@ -184,6 +197,8 @@ const fecthlist = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
//เซฟเพื่อส่งไปออกคำสั่ง
|
||||
const saveAppoint = async () => {
|
||||
await myForm.value!.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
|
|
@ -218,6 +233,8 @@ const validationDate = (thaiDate: string | null) => {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
//แปลงเดือนจากตัวเลขเป็นภาษาอ่าน
|
||||
const convertThaiDateToNumeric = (thaiDate: string) => {
|
||||
const parts = thaiDate.split(" ");
|
||||
if (parts.length !== 3) return null;
|
||||
|
|
@ -326,6 +343,15 @@ const openModalCalendar = (rows: any) => {
|
|||
>
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="realReason"
|
||||
:props="props"
|
||||
|
|
@ -425,6 +451,7 @@ const openModalCalendar = (rows: any) => {
|
|||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- dialog กำหนดวันหนัดหมายสัมภาษณ์ -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form ref="myForm">
|
||||
|
|
|
|||
|
|
@ -228,9 +228,7 @@ const getData = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
status: r.status ?? "",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${
|
||||
r.lastName ?? ""
|
||||
}`,
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@ import { useRoute } from "vue-router";
|
|||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, success, showLoader, hideLoader } = mixin;
|
||||
const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin;
|
||||
const route = useRoute();
|
||||
|
||||
const type_params = route.params.type;
|
||||
const retireld_params = route.params.id;
|
||||
const props = defineProps({
|
||||
retireld: String,
|
||||
|
|
@ -65,57 +64,16 @@ const columns = ref<any["columns"]>([
|
|||
align: "left",
|
||||
},
|
||||
]);
|
||||
const rows = ref<any>([
|
||||
// {
|
||||
// fullname: "นายใจดี ยอดใจ",
|
||||
// position: "นักวิชาการพัสดุ",
|
||||
// level: "ปฎิบัติการ",
|
||||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
// {
|
||||
// fullname: "นายจักกริน บัณฑิต",
|
||||
// position: "นักวิชาการพัสดุ",
|
||||
// level: "ปฎิบัติการ",
|
||||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
// {
|
||||
// fullname: "นายจักกริน บัณฑิต",
|
||||
// position: "นักวิชาการพัสดุ",
|
||||
// level: "ปฎิบัติการ",
|
||||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
// {
|
||||
// fullname: "นายจักกริน บัณฑิต",
|
||||
// position: "นักวิชาการพัสดุ",
|
||||
// level: "ปฎิบัติการ",
|
||||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
// {
|
||||
// fullname: "นายจักกริน บัณฑิต",
|
||||
// position: "นักวิชาการพัสดุ",
|
||||
// level: "ปฎิบัติการ",
|
||||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
// {
|
||||
// fullname: "นายจักกริน บัณฑิต",
|
||||
// position: "นักวิชาการพัสดุ",
|
||||
// level: "ปฎิบัติการ",
|
||||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
// {
|
||||
// fullname: "นายจักกริน บัณฑิต",
|
||||
// position: "นักวิชาการพัสดุ",
|
||||
// level: "ปฎิบัติการ",
|
||||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
]);
|
||||
const rows = ref<any>([]);
|
||||
|
||||
watch(modal, () => {
|
||||
if (modal.value === true) {
|
||||
retireld.value = props.retireld;
|
||||
if (props.dataProfile.type === "OFFICER") {
|
||||
type.value = "officer";
|
||||
} else type.value = "all";
|
||||
if (props.dataProfile) {
|
||||
if (props.dataProfile.type === "OFFICER") {
|
||||
type.value = "officer";
|
||||
} else type.value = "all";
|
||||
}
|
||||
|
||||
fecthlistRetire();
|
||||
}
|
||||
|
|
@ -146,14 +104,11 @@ const findlist = async (id: string) => {
|
|||
{ criteriaType: "employee_class", criteriaValue: "perm" },
|
||||
];
|
||||
}
|
||||
// console.log(data);
|
||||
|
||||
await http
|
||||
.post(config.API.profileSearchNewOcIdType(id, type.value), {
|
||||
criterias: data,
|
||||
})
|
||||
.then((res) => {
|
||||
// console.log(res.data.result);
|
||||
rows.value = res.data.result.map((e: any) => ({
|
||||
id: e.id,
|
||||
fullname: e.fullname,
|
||||
|
|
@ -172,25 +127,13 @@ const findlist = async (id: string) => {
|
|||
|
||||
// putlist
|
||||
const clickAdd = (props: any) => {
|
||||
// console.log("props===>",props.row.id)
|
||||
if (retireld.value == undefined) {
|
||||
retireld.value = retireld_params;
|
||||
}
|
||||
|
||||
let data: any = props.row.id;
|
||||
// console.log("retireld & profileId", retireld.value, data);
|
||||
|
||||
$q.dialog({
|
||||
title: "ยืนยันการเพิ่มข้อมูล",
|
||||
message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
// console.log("เพิ่มข้อมูล");
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await http
|
||||
.put(config.API.profileRetire(retireld.value), { profileId: data })
|
||||
.then(() => {
|
||||
|
|
@ -201,12 +144,12 @@ const clickAdd = (props: any) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
// fecthlistRetire();
|
||||
modal.value = false;
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
},
|
||||
"ยืนยันการเพิ่มข้อมูล",
|
||||
"ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
// update retireld
|
||||
const updateListData = (retireld: string, pId: string) => {
|
||||
|
|
@ -294,9 +237,6 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>{{ props.rowIndex + 1 }}</q-td>
|
||||
<!-- <q-td key="order" :props="props">
|
||||
{{ props.row.order }}
|
||||
</q-td> -->
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,14 @@ const route = useRoute();
|
|||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, success, dialogConfirm } = mixin;
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const retireld_params = route.params.retirementId;
|
||||
const modalNote = ref<boolean>(false);
|
||||
|
|
@ -26,7 +33,6 @@ const filter = ref<string>("");
|
|||
const statusUpload = ref<boolean>();
|
||||
const modalEdit = ref<boolean>(false);
|
||||
const textReport = ref<string>("");
|
||||
|
||||
const columns = ref<any["columns"]>([
|
||||
{
|
||||
name: "order",
|
||||
|
|
@ -161,7 +167,6 @@ const fecthlistprofile = async (id: string) => {
|
|||
await http
|
||||
.get(config.API.listRetire(id))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
dataProfile.value = res.data.result;
|
||||
round.value = res.data.result.round;
|
||||
statusReport.value = res.data.result.json;
|
||||
|
|
@ -182,7 +187,6 @@ const fecthlistprofile = async (id: string) => {
|
|||
reason: e.reason,
|
||||
remove: e.remove,
|
||||
}));
|
||||
console.log(statusReport.value);
|
||||
if (statusReport.value == false) {
|
||||
fecthCheck(retireld.value);
|
||||
} else statusUpload.value = true;
|
||||
|
|
@ -194,6 +198,7 @@ const fecthlistprofile = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
// เช็คสถานะการอัพโหลด
|
||||
const fecthCheck = async (id: string) => {
|
||||
await http
|
||||
.get(config.API.checkfileupload(id))
|
||||
|
|
@ -201,21 +206,14 @@ const fecthCheck = async (id: string) => {
|
|||
statusUpload.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
});
|
||||
};
|
||||
// DelProfile
|
||||
const clickDelete = () => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
dialogRemove(
|
||||
$q,
|
||||
async () => {
|
||||
await http
|
||||
.post(config.API.removeProfile(), {
|
||||
retireProfileId: retireProfileId.value,
|
||||
|
|
@ -232,36 +230,16 @@ const clickDelete = () => {
|
|||
await fecthlistprofile(retireld.value);
|
||||
modalNote.value = false;
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
// note
|
||||
// const fetchReason = async (prop: string) => {
|
||||
// await http
|
||||
// .get(config.API.reasonId(prop))
|
||||
// .then((res: any) => {
|
||||
// console.log(res.data.result);
|
||||
// note.value = res.data.result.reason;
|
||||
// retireProfileId.value = res.data.result.id;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// });
|
||||
// };
|
||||
const saveNote = () => {
|
||||
console.log(retireProfileId.value, note.value);
|
||||
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูลข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
// แก้ไข้ข้อมูล
|
||||
const saveNote = () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await http
|
||||
.post(config.API.createnote(), {
|
||||
retireProfileId: retireProfileId.value,
|
||||
|
|
@ -278,15 +256,15 @@ const saveNote = () => {
|
|||
fecthlistprofile(retireld.value);
|
||||
modalNote.value = false;
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
|
||||
const UpdateListId = (retireld: string, pId: string) => {
|
||||
profileId.value = pId;
|
||||
fecthlistprofile(retireld);
|
||||
console.log("profileId", profileId.value);
|
||||
};
|
||||
const backHistory = () => {
|
||||
window.history.back();
|
||||
|
|
@ -299,13 +277,11 @@ const visibleNote = computed(() => {
|
|||
const uploadFile = async (event: any) => {
|
||||
showLoader();
|
||||
const selectedFile = event;
|
||||
console.log(selectedFile);
|
||||
const formdata = new FormData();
|
||||
formdata.append("file", selectedFile);
|
||||
|
||||
await http
|
||||
.put(config.API.fileRetirement(retireld.value.toString()), formdata)
|
||||
.then((res) => {
|
||||
.then(() => {
|
||||
success($q, "เพิ่มไฟล์สำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -326,9 +302,6 @@ const downloadAttachment = async (type: string, id: string) => {
|
|||
responseType: "blob",
|
||||
})
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: any[] = [];
|
||||
downloadFile(res, `${"รายชื่อผู้เกษียณอายุราชการ"}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -562,6 +535,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
statusUpload !== true
|
||||
"
|
||||
/>
|
||||
<q-th auto-width v-else></q-th>
|
||||
<q-th
|
||||
auto-width
|
||||
v-if="
|
||||
|
|
@ -572,6 +546,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
statusUpload !== true
|
||||
"
|
||||
/>
|
||||
<q-th auto-width v-else></q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -639,6 +614,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-tooltip>กรอกเหตุผล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width v-else></q-td>
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="
|
||||
|
|
@ -664,6 +640,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
><q-tooltip>ลบข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-td>
|
||||
<q-td auto-width v-else></q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
200
src/modules/06_retirement/components/ListRetirement/popupAdd.vue
Normal file
200
src/modules/06_retirement/components/ListRetirement/popupAdd.vue
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, messageError } = mixin;
|
||||
const router = useRouter();
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
},
|
||||
year: {
|
||||
type: Number,
|
||||
},
|
||||
rows: {
|
||||
type: Object,
|
||||
},
|
||||
actionOptio: {
|
||||
type: Object,
|
||||
},
|
||||
checkjson: {
|
||||
type: Boolean,
|
||||
},
|
||||
});
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const radio = ref<string>("");
|
||||
const actionOption = ref<any>([]);
|
||||
const action = ref<string>("");
|
||||
|
||||
// เพิ่มประกาศเกษียณอายุราชการ
|
||||
const clickAdd = () => {
|
||||
if (props.rows) {
|
||||
// ครั้งแรกจะเพิ่มเลย
|
||||
if (props.rows.length == 0) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
let data = { type: props.type, year: props.year };
|
||||
await cerateRetirement(data);
|
||||
},
|
||||
"ยืนยันการเพิ่มข้อมูลประกาศเกษียณ",
|
||||
"ต้องการเพิ่มข้อมูลประกาศเกษียณใช่หรือไม่ ?"
|
||||
);
|
||||
} else {
|
||||
modal.value = true;
|
||||
action.value = "";
|
||||
radio.value = "";
|
||||
if (props.actionOptio) {
|
||||
actionOption.value = props.actionOptio;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// เลือกรายการเพิ่ม
|
||||
const clickSelect = async (action: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
let data = {
|
||||
type: props.type,
|
||||
year: props.year,
|
||||
retireHistoryId: action,
|
||||
option: radio.value,
|
||||
};
|
||||
|
||||
await cerateRetirement(data);
|
||||
},
|
||||
"ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
|
||||
"ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
// เพิ่มรอบประกาศเกษียณอายุราชการ API
|
||||
const cerateRetirement = async (data: object) => {
|
||||
await http
|
||||
.post(config.API.createProfile(), data)
|
||||
.then((res) => {
|
||||
let response = res.data.result;
|
||||
let retirementId = response.id;
|
||||
router.push(`/retirement/${retirementId}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-plus"
|
||||
@click="clickAdd"
|
||||
:disable="checkjson"
|
||||
>
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
</q-btn>
|
||||
<q-dialog v-model="modal">
|
||||
<q-card style="width: 450px; max-width: 80vw">
|
||||
<q-card-section>
|
||||
<div class="text-h6">เพิ่มประกาศ</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
เลือกประกาศที่ต้องการเพิ่มข้อมูล
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<div class="q-pa-md">
|
||||
<q-list>
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="ADD"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศเพิ่มผู้เกษียณ</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="EDIT"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศแก้ไขข้อมูลผู้เกษียณ</q-item-label>
|
||||
<q-item-label v-if="radio === 'EDIT'">
|
||||
<q-select
|
||||
dense
|
||||
v-model="action"
|
||||
:options="actionOption"
|
||||
label="เลือกรอบ"
|
||||
option-label="round"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
||||
/>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="REMOVE"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศยกเลิกผู้เกษียณ</q-item-label>
|
||||
<q-item-label v-if="radio === 'REMOVE'">
|
||||
<q-select
|
||||
dense
|
||||
v-model="action"
|
||||
:options="actionOption"
|
||||
label="เลือกรอบ"
|
||||
option-label="round"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
||||
/></q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn flat label="ยกเลิก" color="red" v-close-popup />
|
||||
<q-btn
|
||||
flat
|
||||
label="ตกลง"
|
||||
@click="clickSelect(action)"
|
||||
:disable="radio === '' || (action === '' && radio !== 'ADD')"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
@ -9,18 +9,20 @@ import config from "@/app.config";
|
|||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, success ,date2Thai} = mixin;
|
||||
const { showLoader, hideLoader, messageError, success, date2Thai } = mixin;
|
||||
|
||||
const rows = ref<any>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "prefix",
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "คำนำหน้า",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "prefix",
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
|
|
@ -87,6 +89,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"positionType",
|
||||
|
|
@ -104,17 +107,15 @@ const fectListDecased = async () => {
|
|||
await http
|
||||
.get(config.API.listDeceased())
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
rows.value = res.data.result.map((e: any) => ({
|
||||
personalId: e.id,
|
||||
prefix: e.prefix,
|
||||
fullname: e.firstName + " " + e.lastName,
|
||||
fullname: `${e.prefix ?? ""}${e.firstName ?? ""} ${e.lastName ?? ""}`,
|
||||
positionType: e.positionType,
|
||||
position: e.positionLine,
|
||||
positionLevel: e.positionLevel,
|
||||
positionExecutive: e.positionExecutive,
|
||||
oc: e.organization,
|
||||
createdAt:date2Thai(e.createdAt),
|
||||
createdAt: date2Thai(e.createdAt),
|
||||
}));
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -125,8 +126,6 @@ const fectListDecased = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
|
@ -219,11 +218,8 @@ const pagination = ref({
|
|||
class="cursor-pointer"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
<!-- <q-td key="no" :props="props">
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td> -->
|
||||
<q-td key="prefix" :props="props">
|
||||
{{ props.row.prefix }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import type { requestSendNoti,DataCopyOrder,ResponseOrganiz } from "@/modules/06_retirement/interface/response/Deceased";
|
||||
import type {
|
||||
requestSendNoti,
|
||||
DataCopyOrder,
|
||||
ResponseOrganiz,
|
||||
} from "@/modules/06_retirement/interface/response/Deceased";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
|
@ -26,14 +30,11 @@ const props = defineProps({
|
|||
});
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const next = () => props.next();
|
||||
const previous = () => props.previous();
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
|
||||
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
|
|
@ -157,23 +158,22 @@ const editRows = ref<DataCopyOrder[]>([]);
|
|||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
// await getList();
|
||||
});
|
||||
|
||||
const getList = async () => {
|
||||
showLoader();
|
||||
await http.get(config.API.detailByidDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result
|
||||
console.log(data)
|
||||
}).catch((e) => {
|
||||
await http
|
||||
.get(config.API.detailByidDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
const listModal = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -203,14 +203,12 @@ const listModal = async (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailByidDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
let list: DataCopyOrder[] = [];
|
||||
data.map((r: any) => {
|
||||
let selectCopyOrder = [];
|
||||
|
|
@ -222,9 +220,9 @@ const getData = async () => {
|
|||
}
|
||||
|
||||
list.push({
|
||||
id:r.id,
|
||||
id: r.id,
|
||||
personalId: r.profileId ?? "",
|
||||
name:`${r.prefix}${r.firstName} ${r.lastName}`,
|
||||
name: `${r.prefix}${r.firstName} ${r.lastName}`,
|
||||
idCard: r.citizenId ?? "",
|
||||
position: r.positionName ?? "",
|
||||
unit: r.organizationName ?? "-",
|
||||
|
|
@ -252,22 +250,22 @@ const getData = async () => {
|
|||
};
|
||||
|
||||
const saveData = async () => {
|
||||
showLoader();
|
||||
const persons = selectedModal.value.map(item => ({ profileId: item.profileId }));
|
||||
const dataToSend = { Persons: persons };
|
||||
await http
|
||||
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
|
||||
.then((res) => {
|
||||
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
clickClose();
|
||||
getData();
|
||||
hideLoader();
|
||||
});
|
||||
showLoader();
|
||||
const persons = selectedModal.value.map((item) => ({
|
||||
profileId: item.profileId,
|
||||
}));
|
||||
const dataToSend = { Persons: persons };
|
||||
await http
|
||||
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
clickClose();
|
||||
getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
|
|
@ -299,11 +297,7 @@ const clickAdd = async () => {
|
|||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
console.log(id)
|
||||
dialogRemove(
|
||||
$q,
|
||||
() => deleteData(id),
|
||||
);
|
||||
dialogRemove($q, () => deleteData(id));
|
||||
};
|
||||
|
||||
const nodeTree = async () => {
|
||||
|
|
@ -339,7 +333,6 @@ const deleteData = async (id: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
// hideLoader();
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
|
@ -367,7 +360,7 @@ const fetchSaveCopyOrder = async () => {
|
|||
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.notiDeceased(profileId.value), {Persons:list})
|
||||
.put(config.API.notiDeceased(profileId.value), { Persons: list })
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
next();
|
||||
|
|
@ -377,7 +370,7 @@ const fetchSaveCopyOrder = async () => {
|
|||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
getData()
|
||||
getData();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -387,7 +380,7 @@ const updateData = (row: DataCopyOrder) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
|
|
@ -510,7 +503,6 @@ const updateData = (row: DataCopyOrder) => {
|
|||
</q-select>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
|
|
@ -537,7 +529,7 @@ const updateData = (row: DataCopyOrder) => {
|
|||
color="public"
|
||||
@click="saveDataCopyOrder"
|
||||
class="q-px-md"
|
||||
>
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -625,7 +617,6 @@ const updateData = (row: DataCopyOrder) => {
|
|||
:filter="filterModal"
|
||||
row-key="profileId"
|
||||
selection="multiple"
|
||||
|
||||
v-model:selected="selectedModal"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,89 @@
|
|||
<script setup lang="ts">
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
const fullName = ref<string>("");
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const detail = ref<any>([]);
|
||||
|
||||
onMounted(() => {
|
||||
fectdata();
|
||||
});
|
||||
|
||||
//นำข้อมูลจาก API มาแสดง
|
||||
const fectdata = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
detail.value = data;
|
||||
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
//กลับไปหน้า registry
|
||||
const redirectToRegistry = (id: string) => {
|
||||
router.push(`/registry/${id}`);
|
||||
};
|
||||
|
||||
//เปิดdetail ของ deceased
|
||||
const openDeceased = (id: string) => {
|
||||
router.push(`/deceased/detail/${id}`);
|
||||
};
|
||||
|
||||
//ไปหน้าถัดไป
|
||||
const nextPage = (page: string) => {
|
||||
window.open(page, "_blank");
|
||||
};
|
||||
|
||||
//downloadFile
|
||||
const downloadFile = (response: any, filename: string) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
const fileDownload = async (type: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.DeceasedReport(type, profileId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
downloadFile(
|
||||
res,
|
||||
`รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
|
|
@ -146,86 +232,7 @@
|
|||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const fullName = ref<string>("");
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const detail = ref<any>([]);
|
||||
|
||||
onMounted(() => {
|
||||
console.log(profileId.value);
|
||||
fectdata();
|
||||
});
|
||||
const fectdata = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
detail.value = data;
|
||||
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||
console.log(detail.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const redirectToRegistry = (id: string) => {
|
||||
console.log(id);
|
||||
router.push(`/registry/${id}`);
|
||||
};
|
||||
const openDeceased = (id: string) => {
|
||||
router.push(`/deceased/detail/${id}`);
|
||||
};
|
||||
const nextPage = (page: string) => {
|
||||
window.open(page, "_blank");
|
||||
};
|
||||
const downloadFile = (response: any, filename: string) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
const fileDownload = async (type: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.DeceasedReport(type, profileId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
downloadFile(
|
||||
res,
|
||||
`รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
border-radius: 5px;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,11 @@ import config from "@/app.config";
|
|||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
const RetirementData = useRetirementDataStore();
|
||||
const { statusText } = RetirementData;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const RetirementData = useRetirementDataStore();
|
||||
const { messageError, date2Thai, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const rows = ref<ResponseItems[]>([]);
|
||||
|
|
@ -157,17 +158,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "prefix",
|
||||
align: "left",
|
||||
label: "คำนำหน้า",
|
||||
sortable: true,
|
||||
field: "prefix",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
|
|
@ -250,7 +240,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"positionTypeOld",
|
||||
"positionLevelOld",
|
||||
|
|
@ -324,8 +313,8 @@ const fecthlist = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
sendDate: new Date(),
|
||||
status: r.status ?? "",
|
||||
statustext: status(r.status ?? ""),
|
||||
fullname: `${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -340,7 +329,7 @@ const fecthlist = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
//บันทึกคำสั่ง
|
||||
//ส่งไปออกคำสั่ง
|
||||
const saveOrder = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
|
|
@ -351,8 +340,6 @@ const saveOrder = async () => {
|
|||
await http
|
||||
.post(config.API.resignReport, body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
|
||||
closeModal();
|
||||
})
|
||||
|
|
@ -365,28 +352,6 @@ const saveOrder = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
//แปลงข้อความ status
|
||||
const status = (val: string) => {
|
||||
switch (val) {
|
||||
case "WAITTING":
|
||||
return "รอดำเนินการ";
|
||||
case "PENDING":
|
||||
return "เลือกตำแหน่งแล้ว";
|
||||
case "APPROVE":
|
||||
return "อนุมัติ";
|
||||
case "REJECT":
|
||||
return "ยับยั้ง";
|
||||
case "DELETE":
|
||||
return "ยกเลิกการลาออก";
|
||||
case "REPORT":
|
||||
return "ส่งรายชื่อไปออกคำสั่ง";
|
||||
case "DONE":
|
||||
return "ออกคำสั่งเสร็จแล้ว";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
|
||||
const pagination = ref({
|
||||
sortBy: "datetext",
|
||||
descending: true,
|
||||
|
|
@ -478,9 +443,6 @@ const pagination = ref({
|
|||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="prefix" :props="props">
|
||||
{{ props.row.prefix }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -11,12 +11,7 @@ import CurrencyInput from "@/components/CurruncyInput.vue";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import type {
|
||||
ResponseItems,
|
||||
TypeFile,
|
||||
} from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
import type { TypeFile } from "@/modules/06_retirement/interface/response/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
|
|
@ -149,7 +144,6 @@ const fetchData = async (id: string) => {
|
|||
.get(config.API.resingByid(id))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: TypeFile[] = [];
|
||||
if (data.docs.length > 0) {
|
||||
data.docs.map((doc: TypeFile) => {
|
||||
|
|
@ -172,29 +166,6 @@ const fetchData = async (id: string) => {
|
|||
location.value = data.location ?? "";
|
||||
status.value = data.status ?? "";
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const rowsFileDownload = ref<TypeFile[]>([
|
||||
{ fileName: "หนังสือลาออกจากราขการ", pathName: "" },
|
||||
]);
|
||||
const downloadAttachment = async (type: string, id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportResignList(type, id), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: TypeFile[] = [];
|
||||
downloadFile(res, `หนังสือลาออกจากราขการ.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
|
|
@ -327,8 +298,6 @@ const saveData = async () => {
|
|||
await http
|
||||
.put(config.API.resingByid(id.value), formData)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
|
|
@ -551,57 +520,6 @@ const statusOrder = (val: boolean) => {
|
|||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- <q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
แบบฟอร์มหนังสือขอลาออกจากราชการ
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
:rows="rowsFileDownload"
|
||||
:columns="columns"
|
||||
row-key="fileName"
|
||||
hide-header
|
||||
hide-bottom
|
||||
>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fileName" :props="props">
|
||||
{{ props.row.fileName }}
|
||||
</q-td>
|
||||
<q-td key="btnMicrosoft" :props="props">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="picture_as_pdf"
|
||||
@click="downloadAttachment('pdf', id)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-file-word"
|
||||
@click="downloadAttachment('docx', id)"
|
||||
>
|
||||
<q-tooltip>ไฟล์ WORD</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card> -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
|
|
@ -774,7 +692,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -790,7 +708,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -806,7 +724,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -822,22 +740,8 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="salary"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
|
|
@ -849,7 +753,7 @@ const statusOrder = (val: boolean) => {
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-4 row ">
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -867,7 +771,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 row ">
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -884,7 +788,7 @@ const statusOrder = (val: boolean) => {
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="!edit"
|
||||
:readonly="!edit"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -915,7 +819,7 @@ const statusOrder = (val: boolean) => {
|
|||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 row ">
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -932,7 +836,7 @@ const statusOrder = (val: boolean) => {
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="!edit"
|
||||
:readonly="!edit"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -1021,9 +925,6 @@ const statusOrder = (val: boolean) => {
|
|||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือก วันสุดท้ายที่ยับยั้ง'}`,
|
||||
]" -->
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -35,6 +35,7 @@ interface ResponseItems {
|
|||
suggestion: string;
|
||||
status: string;
|
||||
datetext: string | null;
|
||||
fullname: string;
|
||||
appointDate: any;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from 'vue'
|
||||
export const useDataStoreRetirement = defineStore("retirementDatastore", () => {
|
||||
const taboption = ref<any>([{ name: "officer", id: "officer", label: 'ขรก.กทม.สามัญ' },
|
||||
{ name: "employee", id: "employee", label: "ลูกจ้างประจำ" }])
|
||||
const tab = ref<any>("officer");
|
||||
const type = ref<string>("officer");
|
||||
const clickTab = (role: string) => {
|
||||
|
|
@ -9,6 +11,7 @@ export const useDataStoreRetirement = defineStore("retirementDatastore", () => {
|
|||
return {
|
||||
tab,
|
||||
type,
|
||||
clickTab
|
||||
clickTab,
|
||||
taboption
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,291 +1,6 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
ประกาศเกษียณอายุราชการ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<div class="row col-12">
|
||||
<q-tabs
|
||||
v-model="tab"
|
||||
dense
|
||||
class="text-grey"
|
||||
active-color="primary"
|
||||
active-class="bg-teal-1"
|
||||
indicator-color="primary"
|
||||
align="left"
|
||||
>
|
||||
<q-tab
|
||||
name="officer"
|
||||
label="ขรก.กทม.สามัญ"
|
||||
@click="clickTab('officer')"
|
||||
/>
|
||||
<q-tab
|
||||
name="employee"
|
||||
label="ลูกจ้างประจำ"
|
||||
@click="clickTab('employee')"
|
||||
/>
|
||||
</q-tabs>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
v-model="fiscalyear"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="yearOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
<div>
|
||||
<q-btn
|
||||
@click="clickAdd()"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-plus"
|
||||
:disable="checkjson == true"
|
||||
>
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- <q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable @click="clickAdd">
|
||||
<q-item-section>ขรก.กทม.สามัญ</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable @click="clickAdd">
|
||||
<q-item-section>ลูกจ้างประจำ</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu> -->
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-pt-sm">
|
||||
<q-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="name"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<!-- <q-th auto-width /> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="Date" :props="props">
|
||||
{{ props.row.Date }}
|
||||
</q-td>
|
||||
<q-td key="retireNumber" :props="props">
|
||||
{{ props.row.total }}
|
||||
</q-td>
|
||||
<q-td key="typeReport" :props="props">
|
||||
{{ props.row.typeReport }}
|
||||
</q-td>
|
||||
<!-- <q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="primary"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-dialog v-model="modal">
|
||||
<q-card style="width: 450px; max-width: 80vw">
|
||||
<q-card-section>
|
||||
<div class="text-h6">เพิ่มประกาศ</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
เลือกประกาศที่ต้องการเพิ่มข้อมูล
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<div class="q-pa-md">
|
||||
<q-list>
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="ADD"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศเพิ่มผู้เกษียณ</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="EDIT"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศแก้ไขข้อมูลผู้เกษียณ</q-item-label>
|
||||
<q-item-label v-if="radio === 'EDIT'">
|
||||
<q-select
|
||||
dense
|
||||
v-model="action"
|
||||
:options="actionOption"
|
||||
label="เลือกรอบ"
|
||||
option-label="round"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
||||
/>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="REMOVE"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศยกเลิกผู้เกษียณ</q-item-label>
|
||||
<q-item-label v-if="radio === 'REMOVE'">
|
||||
<q-select
|
||||
dense
|
||||
v-model="action"
|
||||
:options="actionOption"
|
||||
label="เลือกรอบ"
|
||||
option-label="round"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
||||
/></q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn flat label="ยกเลิก" color="red" v-close-popup />
|
||||
<q-btn
|
||||
flat
|
||||
label="ตกลง"
|
||||
@click="clickSelect(action)"
|
||||
:disable="radio === '' || (action === '' && radio !== 'ADD')"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, useAttrs, reactive, watch, computed } from "vue";
|
||||
import { onMounted, ref, useAttrs, reactive, watch } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
FormMainProbation,
|
||||
FormMainProbation2,
|
||||
} from "@/modules/05_placement/interface/request/Main";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -294,6 +9,8 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useDataStoreRetirement } from "@/modules/06_retirement/storeRetirement";
|
||||
import type { resMain } from "@/modules/06_retirement/interface/response/Main";
|
||||
import { storeToRefs } from "pinia";
|
||||
import popupAdd from "../components/ListRetirement/popupAdd.vue";
|
||||
|
||||
const useStoreRetire = useDataStoreRetirement();
|
||||
const { clickTab } = useStoreRetire;
|
||||
const { tab, type } = storeToRefs(useDataStoreRetirement());
|
||||
|
|
@ -302,17 +19,9 @@ const { messageError, date2Thai, showLoader, hideLoader, dialogConfirm } =
|
|||
mixin;
|
||||
const router = useRouter();
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const modal = ref<boolean>(false);
|
||||
const radio = ref<string>("");
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const fiscalyear = ref<number>();
|
||||
const actionOption = ref<resMain[]>([]);
|
||||
const action = ref<string>("");
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
|
|
@ -360,15 +69,19 @@ const columns = ref<QTableProps["columns"]>([
|
|||
// ข้อมูลตาราง (จำลอง)
|
||||
const currentYear = new Date().getFullYear();
|
||||
const rows = ref<resMain[]>([]);
|
||||
const visibleColumns2 = ref<string[]>(["no", "name", "retireNumber"]);
|
||||
const yearOptions = reactive<any[]>([]);
|
||||
|
||||
onMounted(() => {
|
||||
filteryear();
|
||||
});
|
||||
// หาปีปัจจุบัน
|
||||
const filteryear = () => {
|
||||
yearOptions.push({ id: currentYear, name: currentYear + 543 });
|
||||
fiscalyear.value = yearOptions[0].id;
|
||||
fetchRetirement(type.value, currentYear);
|
||||
};
|
||||
// ประกาศเกษียณอายุราชการ
|
||||
const fetchRetirement = async (type: string, year: any) => {
|
||||
radio.value = "";
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.retirement(type, year))
|
||||
|
|
@ -382,12 +95,12 @@ const fetchRetirement = async (type: string, year: any) => {
|
|||
retireNumber: items.round,
|
||||
total: items.total,
|
||||
round: items.round,
|
||||
typeReport: typeReportChangeName(items.typeReport),
|
||||
typeReport: typeReportChangeName(items.typeReport), // เปลี่ยนสถานะ
|
||||
json: items.json,
|
||||
document: items.document,
|
||||
}));
|
||||
actionOption.value = rows.value;
|
||||
rows.value.sort((a, b) => a.round - b.round);
|
||||
rows.value.sort((a, b) => a.round - b.round); // เรียงรอบมากไปน้อย
|
||||
checkststus(rows.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -397,156 +110,15 @@ const fetchRetirement = async (type: string, year: any) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
filteryear();
|
||||
});
|
||||
// หัวตาราง2
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "วันที่สร้าง",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "retireNumber",
|
||||
align: "left",
|
||||
label: "จำนวนผู้เกษียณ",
|
||||
sortable: true,
|
||||
field: "total",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows2 = ref<FormMainProbation2[]>([
|
||||
{
|
||||
no: "1",
|
||||
name: "นายใจดี ยอดใจ ",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
name: "นายจักกริน บัณฑิต",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
name: "นางสาวกัณฐิมา กาฬสินธุ์",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
name: "นางสาวเมขลา กระจ่างมนตรี",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
},
|
||||
{
|
||||
no: "5",
|
||||
name: "นางสาวฐิติรัตน์ พงษ์ศิริ",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
},
|
||||
]);
|
||||
|
||||
// const clickDelete = (id: string) => {
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการลบข้อมูล",
|
||||
// message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// color: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {})
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
// };
|
||||
|
||||
const clickAdd = () => {
|
||||
if (rows.value.length == 0) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
let data = { type: useStoreRetire.type, year: currentYear };
|
||||
await cerateRetirement(data);
|
||||
},
|
||||
"ยืนยันการเพิ่มข้อมูลประกาศเกษียณ",
|
||||
"ต้องการเพิ่มข้อมูลประกาศเกษียณใช่หรือไม่ ?"
|
||||
);
|
||||
} else {
|
||||
modal.value = true;
|
||||
action.value = "";
|
||||
radio.value = "";
|
||||
}
|
||||
};
|
||||
const cerateRetirement = async (data: object) => {
|
||||
await http
|
||||
.post(config.API.createProfile(), data)
|
||||
.then((res) => {
|
||||
let response = res.data.result;
|
||||
let retirementId = response.id;
|
||||
router.push(`/retirement/${retirementId}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
const clickSelect = async (action: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
let data = {
|
||||
type: useStoreRetire.type,
|
||||
year: currentYear,
|
||||
retireHistoryId: action,
|
||||
option: radio.value,
|
||||
};
|
||||
|
||||
await cerateRetirement(data);
|
||||
},
|
||||
"ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
|
||||
"ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
|
||||
const checkjson = ref<boolean>();
|
||||
|
||||
// เช็คสถานะ document ของประกาศเกษียณอายุราชการ
|
||||
const checkststus = (data: any) => {
|
||||
let jsonfasle = data.find((e: any) => e.document == false);
|
||||
|
||||
if (jsonfasle) {
|
||||
checkjson.value = true;
|
||||
} else checkjson.value = false;
|
||||
};
|
||||
const fiscalyear = ref<number>();
|
||||
// const fiscalyearOP = ref<any>([
|
||||
// { id: 1, name: "ทั้งหมด" },
|
||||
// { id: 2, name: "2565" },
|
||||
// { id: 3, name: "2565" },
|
||||
// ]);
|
||||
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
|
|
@ -555,17 +127,15 @@ const resetFilter = () => {
|
|||
filterKeyword.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef2 = ref<any>(null);
|
||||
const resetFilter2 = () => {
|
||||
filterKeyword2.value = "";
|
||||
filterRef2.value.focus();
|
||||
};
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
sortBy: "",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
|
|
@ -577,6 +147,7 @@ const nextPage = (prop: any) => {
|
|||
watch(type, () => {
|
||||
fetchRetirement(type.value, currentYear);
|
||||
});
|
||||
//เปลี่ยนสถานะ
|
||||
const typeReportChangeName = (val: string) => {
|
||||
switch (val) {
|
||||
case "EDIT":
|
||||
|
|
@ -590,6 +161,171 @@ const typeReportChangeName = (val: string) => {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
ประกาศเกษียณอายุราชการ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<div class="row col-12">
|
||||
<q-tabs
|
||||
dense
|
||||
v-model="tab"
|
||||
align="left"
|
||||
class="bg-white text-grey"
|
||||
active-color="primary"
|
||||
indicator-color="primary"
|
||||
>
|
||||
<div v-for="item in useStoreRetire.taboption">
|
||||
<q-tab
|
||||
:name="item.name"
|
||||
:label="item.label"
|
||||
@click="clickTab(item.name)"
|
||||
/>
|
||||
</div>
|
||||
</q-tabs>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-tab-panels v-model="tab" animated
|
||||
><q-tab-panel
|
||||
v-for="item in useStoreRetire.taboption"
|
||||
:key="item.name"
|
||||
:name="item.name"
|
||||
class="q-pa-none"
|
||||
>
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
v-model="fiscalyear"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="yearOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
<div>
|
||||
<popupAdd
|
||||
:type="useStoreRetire.type"
|
||||
:year="fiscalyear"
|
||||
:rows="rows"
|
||||
:actionOptio="actionOption"
|
||||
:checkjson="checkjson"
|
||||
/>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-pt-sm">
|
||||
<q-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="name"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="Date" :props="props">
|
||||
{{ props.row.Date }}
|
||||
</q-td>
|
||||
<q-td key="retireNumber" :props="props">
|
||||
{{ props.row.total }}
|
||||
</q-td>
|
||||
<q-td key="typeReport" :props="props">
|
||||
{{ props.row.typeReport }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="primary"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div></div></q-tab-panel
|
||||
></q-tab-panels>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.filter-card {
|
||||
|
|
|
|||
|
|
@ -235,13 +235,15 @@ const addNote = async (body: any) => {
|
|||
await http
|
||||
.put(config.API.noteAdd(props.roundId), body)
|
||||
.then(() => {
|
||||
success($q, "เพิ่มราชชื่อสำเร็จ");
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
props.close();
|
||||
if (props.close) {
|
||||
props.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue