From fbb59b99ff330794ecceb6abde3318d01fdccda4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 19 Sep 2023 17:37:50 +0700 Subject: [PATCH] no message --- src/modules/05_placement/components/Main.vue | 30 ++--- .../components/PersonalList/Detail.vue | 8 +- .../components/PersonalList/OrgTree.vue | 119 +----------------- .../components/PersonalList/Table.vue | 43 +------ .../components/PersonalList/TableDetail.vue | 81 +----------- 5 files changed, 17 insertions(+), 264 deletions(-) diff --git a/src/modules/05_placement/components/Main.vue b/src/modules/05_placement/components/Main.vue index 374cf980c..5d249d31b 100644 --- a/src/modules/05_placement/components/Main.vue +++ b/src/modules/05_placement/components/Main.vue @@ -100,10 +100,6 @@ const columns = ref([ ]); // ข้อมูลตาราง (จำลอง) const rows = ref([]); -// const yearValue = ref(0); // เพิ่มตัวแปรในโมดูล - -// let OriginalData = ref([]); -// let UpdataData = ref([]); const searchYear = ref(); const yearOptions = reactive([{ 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([{ id: "all", name: "ทั้งห const addedExamTimeValues: Set = 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(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) => { { DataStore.DataMainOrig = res.data.result; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -141,11 +141,7 @@ const fetchPlacementData = async () => {
- +
diff --git a/src/modules/05_placement/components/PersonalList/OrgTree.vue b/src/modules/05_placement/components/PersonalList/OrgTree.vue index 2c0971330..58c139186 100644 --- a/src/modules/05_placement/components/PersonalList/OrgTree.vue +++ b/src/modules/05_placement/components/PersonalList/OrgTree.vue @@ -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([ ]); 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 () => { - { - - - - - - diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index ed14797ed..ccfda3080 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -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(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(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(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" /> + @@ -1005,14 +976,6 @@ const pagination = ref({ v-model="scope.selected" /> -