Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into me
This commit is contained in:
commit
98b6a8365e
28 changed files with 1082 additions and 1085 deletions
|
|
@ -29,7 +29,6 @@ const config = ref<any>({
|
|||
// API_PROBATION_URI: "https://ehr.joolsoft.com/v1",
|
||||
API_PROBATION_URI: "https://bmaehr.joolsoft.com/nodeapi/v1",
|
||||
// API_PROBATION_URI: "http://192.168.1.151:7776/v1",
|
||||
API_DASHBOARD_URI: "http://192.168.1.9:6026/api/v1",
|
||||
},
|
||||
test: {
|
||||
API_URI: "http://localhost:5010/api/v1",
|
||||
|
|
@ -78,10 +77,6 @@ const API_PROBATION_URI = ref<string>(
|
|||
config.value[env.value].API_PROBATION_URI
|
||||
);
|
||||
|
||||
const API_DASHBOARD_URI = ref<string>(
|
||||
config.value[env.value].API_DASHBOARD_URI
|
||||
);
|
||||
|
||||
export default {
|
||||
env: env.value,
|
||||
config: config.value,
|
||||
|
|
@ -96,5 +91,4 @@ export default {
|
|||
MEET_URI: MEET_URI.value,
|
||||
API_RETIREMENT_URI: API_RETIREMENT_URI.value,
|
||||
API_PROBATION_URI: API_PROBATION_URI.value,
|
||||
API_DASHBOARD_URI: API_DASHBOARD_URI.value,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,8 +44,16 @@ const $q = useQuasar();
|
|||
const store = useProfileDataStore();
|
||||
const { profileData, changeProfileColumns } = store;
|
||||
const mixin = useCounterMixin();
|
||||
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const {
|
||||
success,
|
||||
dateToISO,
|
||||
date2Thai,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
const levelId = ref<string>();
|
||||
|
|
@ -549,30 +557,20 @@ const editData = async () => {
|
|||
* ลบลบข้อมูล
|
||||
*/
|
||||
const clickDelete = async () => {
|
||||
$q.dialog({
|
||||
title: `ลบข้อมูล`,
|
||||
message: `ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
||||
cancel: "ยกเลิก",
|
||||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.placementEducationId(id.value))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await props.fetch();
|
||||
rows.value = props.data;
|
||||
});
|
||||
dialogRemove($q, async () => await deletePlacementEducation());
|
||||
};
|
||||
const deletePlacementEducation = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.placementEducationId(id.value))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.onCancel(async () => {
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await props.fetch();
|
||||
rows.value = props.data;
|
||||
});
|
||||
|
|
@ -666,17 +664,26 @@ const addData = () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
if (editRow.value == true) {
|
||||
$q.dialog({
|
||||
title: `ข้อมูลมีการแก้ไข`,
|
||||
message: `ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`,
|
||||
cancel: "ยกเลิก",
|
||||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
edit.value = false;
|
||||
await checkRowPage();
|
||||
await getData();
|
||||
});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await checkRowPage();
|
||||
await getData();
|
||||
},
|
||||
`ข้อมูลมีการแก้ไข`,
|
||||
`ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: `ข้อมูลมีการแก้ไข`,
|
||||
// message: `ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`,
|
||||
// cancel: "ยกเลิก",
|
||||
// ok: "ยืนยัน",
|
||||
// persistent: true,
|
||||
// }).onOk(async () => {
|
||||
// edit.value = false;
|
||||
// await checkRowPage();
|
||||
// await getData();
|
||||
// });
|
||||
} else {
|
||||
edit.value = false;
|
||||
await checkRowPage();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,14 @@ import config from "@/app.config";
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { date2Thai, hideLoader, messageError, showLoader, success } = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
const {
|
||||
date2Thai,
|
||||
hideLoader,
|
||||
messageError,
|
||||
showLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
|
||||
|
|
@ -204,16 +211,21 @@ const clickEditRow = () => {
|
|||
|
||||
const closeModal = () => {
|
||||
if (editDataStatus.value == true) {
|
||||
$q.dialog({
|
||||
title: `ข้อมูลมีการแก้ไข`,
|
||||
message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
cancel: "ยกเลิก",
|
||||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
}).onOk(() => {
|
||||
editDataStatus.value = false;
|
||||
closeAndClear();
|
||||
});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => closeAndClear(),
|
||||
"ข้อมูลมีการแก้ไข",
|
||||
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: `ข้อมูลมีการแก้ไข`,
|
||||
// message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
// cancel: "ยกเลิก",
|
||||
// ok: "ยืนยัน",
|
||||
// persistent: true,
|
||||
// }).onOk(() => {
|
||||
// closeAndClear();
|
||||
// });
|
||||
} else {
|
||||
closeAndClear();
|
||||
}
|
||||
|
|
@ -234,6 +246,7 @@ const closeAndClear = async () => {
|
|||
// dataForm.salaryAmount = null;
|
||||
// dataForm.mouthSalaryAmount = null;
|
||||
// dataForm.positionSalaryAmount = null;
|
||||
editDataStatus.value = false;
|
||||
};
|
||||
// ตำแหน่งเลขที่
|
||||
const posNoOptions = ref<Object[]>([
|
||||
|
|
@ -431,32 +444,53 @@ function findByPerson(element: any): any {
|
|||
return null;
|
||||
}
|
||||
const clearPosition = () => {
|
||||
console.log(personal.value);
|
||||
$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();
|
||||
});
|
||||
// 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();
|
||||
await http
|
||||
.post(config.API.clearPosition(personal.value.personalId), {})
|
||||
.then(() => {
|
||||
success($q, "คืนตำแหน่งสำเร็จ");
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
|
||||
.catch((e: Object) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await closeAndClear();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,14 @@ const files = ref<any>(null);
|
|||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const $q = useQuasar(); // show dialog
|
||||
|
||||
const { messageError, showLoader, hideLoader, dateText, success } = mixin;
|
||||
const {
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dateText,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const examId = route.params.examId;
|
||||
|
|
@ -273,84 +280,85 @@ const appointModal = ref<boolean>(false);
|
|||
const saveDeferment = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
const formData = new FormData();
|
||||
formData.append("personalId", personalId.value);
|
||||
formData.append("note", userNote.value);
|
||||
formData.append("files", files.value[0]);
|
||||
$q.dialog({
|
||||
title: "ยืนยันการขอผ่อนผัน",
|
||||
message: "ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
const: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
showLoader();
|
||||
console.log("ยืนยันการขอผ่อนผัน");
|
||||
await http
|
||||
.post(config.API.deferment(), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
props.statCard();
|
||||
userNote.value = "";
|
||||
modalDefermentDisclaim.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await postDeferment(),
|
||||
"ยืนยันการขอผ่อนผัน",
|
||||
"ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการขอผ่อนผัน",
|
||||
// message: "ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// const: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {})
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
}
|
||||
});
|
||||
};
|
||||
const postDeferment = async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("personalId", personalId.value);
|
||||
formData.append("note", userNote.value);
|
||||
formData.append("files", files.value[0]);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.deferment(), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
props.statCard();
|
||||
userNote.value = "";
|
||||
modalDefermentDisclaim.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const saveDisclaim = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
// showLoader();
|
||||
const dataPost = {
|
||||
note: userNote.value,
|
||||
personId: personalId.value,
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการสละสิทธิ์",
|
||||
message: "ต้องการยืนยันการสละสิทธิ์ข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
const: "negative",
|
||||
},
|
||||
})
|
||||
.onOk(async () => {
|
||||
showLoader();
|
||||
console.log("ยืนยันการสละสิทธิ์");
|
||||
await http
|
||||
.post(config.API.disclaimF(), {
|
||||
note: dataPost.note,
|
||||
personalId: dataPost.personId,
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
props.statCard();
|
||||
userNote.value = "";
|
||||
modalDefermentDisclaim.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await postDisclaimf(),
|
||||
"ยืนยันการสละสิทธิ์",
|
||||
"ต้องการยืนยันการสละสิทธิ์ข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
const postDisclaimf = async () => {
|
||||
const dataPost = {
|
||||
note: userNote.value,
|
||||
personId: personalId.value,
|
||||
};
|
||||
showLoader();
|
||||
console.log("ยืนยันการสละสิทธิ์");
|
||||
await http
|
||||
.post(config.API.disclaimF(), {
|
||||
note: dataPost.note,
|
||||
personalId: dataPost.personId,
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
props.statCard();
|
||||
userNote.value = "";
|
||||
modalDefermentDisclaim.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const clickEditRow = () => {
|
||||
editRow.value = true;
|
||||
|
|
@ -371,7 +379,6 @@ const selectData = (pid: string) => {
|
|||
router.push("/placement/personal-detail/" + pid);
|
||||
}
|
||||
};
|
||||
|
||||
const getNumFile = ref(0);
|
||||
const dataInfo = reactive({
|
||||
reason: "",
|
||||
|
|
@ -456,19 +463,19 @@ const clickCloseSendModal = () => {
|
|||
|
||||
const clickClose = async () => {
|
||||
userNote.value = "";
|
||||
|
||||
if (editRow.value == true) {
|
||||
$q.dialog({
|
||||
title: `ข้อมูลมีการแก้ไข`,
|
||||
message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
cancel: "ยกเลิก",
|
||||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
modalDefermentDisclaim.value = false;
|
||||
modalwaitInfo.value = false;
|
||||
modal.value = false;
|
||||
files.value = null;
|
||||
});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
modalDefermentDisclaim.value = false;
|
||||
modalwaitInfo.value = false;
|
||||
modal.value = false;
|
||||
files.value = null;
|
||||
},
|
||||
`ข้อมูลมีการแก้ไข`,
|
||||
`ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`
|
||||
);
|
||||
} else {
|
||||
modalDefermentDisclaim.value = false;
|
||||
modalwaitInfo.value = false;
|
||||
|
|
@ -587,6 +594,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
:saveNoDraft="true"
|
||||
:role-admin="roleAdmin"
|
||||
:displayAdd="displayAdd"
|
||||
row-key="fullname"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props">
|
||||
|
|
@ -604,21 +612,21 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
v-else-if="col.name === 'fullName'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
<div
|
||||
class="row col-12 text-no-wrap items-center"
|
||||
style="width: 270px"
|
||||
>
|
||||
<img
|
||||
v-if="props.row.avatar == null"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-4 img-info"
|
||||
/>
|
||||
<img v-else :src="props.row.avatar" class="col-4 img-info" />
|
||||
<div class="col-4">
|
||||
<q-item v-ripple>
|
||||
<q-item-section avatar>
|
||||
<img
|
||||
v-if="props.row.avatar == null"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-4 img-info"
|
||||
/>
|
||||
<img v-else :src="props.row.avatar" class="col-4 img-info" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<div class="text-weight-medium">{{ props.row.name }}</div>
|
||||
<div class="text-weight-light">{{ props.row.idCard }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-else-if="col.name === 'examNumber'">
|
||||
<div class="text-weight-medium">
|
||||
|
|
|
|||
|
|
@ -106,11 +106,10 @@
|
|||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-p-sm">
|
||||
</q-card-section>
|
||||
<q-card-section class="q-p-sm"> </q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
|
||||
<!-- Dialog เลือก Image -->
|
||||
<q-dialog v-model="dialogImage" persistent>
|
||||
<q-card style="width: 100vw; max-width: 60vw">
|
||||
|
|
@ -219,6 +218,7 @@ const {
|
|||
success,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
|
@ -399,17 +399,7 @@ const fetchDataDelete = async (id: string) => {
|
|||
};
|
||||
|
||||
const deletePhoto = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ลบข้อมูล",
|
||||
"ต้องการทำการลบข้อมูลนี้ใช่หรือไม่",
|
||||
"delete",
|
||||
undefined,
|
||||
"red",
|
||||
() => fetchDataDelete(id),
|
||||
undefined,
|
||||
false
|
||||
);
|
||||
dialogRemove($q, () => fetchDataDelete(id));
|
||||
};
|
||||
|
||||
const selectAvatarHistory = async () => {
|
||||
|
|
|
|||
|
|
@ -602,6 +602,7 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
dateToISO,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const profileStore = useProfileDataStore();
|
||||
|
|
@ -936,15 +937,11 @@ const conditionSave = async () => {
|
|||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success) => {
|
||||
if (success) {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => await saveData(),
|
||||
undefined
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ const {
|
|||
success,
|
||||
messageError,
|
||||
date2Thai,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const selected = ref<ResponseRow[]>([]);
|
||||
|
|
@ -202,7 +203,7 @@ const fecthlistRecevice = async () => {
|
|||
list.push({
|
||||
personalId: e.id ?? "",
|
||||
citizenId: e.citizenId ?? "-",
|
||||
fullname: e.prefix+e.firstname + " " + e.lastname,
|
||||
fullname: e.prefix + e.firstname + " " + e.lastname,
|
||||
organizationName:
|
||||
e.organizationName +
|
||||
" " +
|
||||
|
|
@ -265,17 +266,7 @@ const openModalTree = (id: string) => {
|
|||
};
|
||||
|
||||
const openDelete = (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ลบข้อมูล",
|
||||
"ต้องการทำการลบข้อมูลนี้ใช่หรือไม่",
|
||||
"delete",
|
||||
undefined,
|
||||
"red",
|
||||
async () => await fetchDataDelete(id),
|
||||
undefined,
|
||||
false
|
||||
);
|
||||
dialogRemove($q, async () => await fetchDataDelete(id));
|
||||
};
|
||||
|
||||
const fetchDataDelete = async (id: string) => {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,14 @@ import config from "@/app.config";
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { date2Thai, hideLoader, messageError, showLoader, success } = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
const {
|
||||
date2Thai,
|
||||
hideLoader,
|
||||
messageError,
|
||||
showLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
|
||||
|
|
@ -205,16 +212,15 @@ const clickEditRow = () => {
|
|||
|
||||
const closeModal = () => {
|
||||
if (editDataStatus.value == true) {
|
||||
$q.dialog({
|
||||
title: `ข้อมูลมีการแก้ไข`,
|
||||
message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
cancel: "ยกเลิก",
|
||||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
}).onOk(() => {
|
||||
editDataStatus.value = false;
|
||||
closeAndClear();
|
||||
});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
editDataStatus.value = false;
|
||||
await closeAndClear();
|
||||
},
|
||||
`ข้อมูลมีการแก้ไข`,
|
||||
`ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`
|
||||
);
|
||||
} else {
|
||||
closeAndClear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
dialogMessage,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -62,7 +63,6 @@ const resetFilter = () => {
|
|||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
|
||||
const rows = ref<relocationType[]>([]);
|
||||
const rows2 = ref<any[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -122,7 +122,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
]);
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -214,7 +213,7 @@ const getData = async () => {
|
|||
dateOfBirth: date2Thai(item.dateOfBirth),
|
||||
gender: item.gender,
|
||||
status: item.status,
|
||||
statusText:statusText(item.status),
|
||||
statusText: statusText(item.status),
|
||||
recruitDate: item.recruitDate,
|
||||
positionNumber: item.positionNumber,
|
||||
positionPath: item.positionPath,
|
||||
|
|
@ -289,15 +288,13 @@ const deleteData = async (id: string) => {
|
|||
};
|
||||
|
||||
const clickDelete = async (name: string, id: string) => {
|
||||
dialogMessage(
|
||||
dialogRemove(
|
||||
$q,
|
||||
`ลบข้อมูลของ ${name}`,
|
||||
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
||||
"delete",
|
||||
"ยืนยัน",
|
||||
"red",
|
||||
async () => await deleteData(id),
|
||||
async () => await getData()
|
||||
async () => {
|
||||
await deleteData(id);
|
||||
await getData();
|
||||
},
|
||||
`ลบข้อมูลของ ${name}`
|
||||
);
|
||||
};
|
||||
const closeModalTree = async () => {
|
||||
|
|
@ -413,7 +410,9 @@ onMounted(async () => {
|
|||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{
|
||||
props.row.organizationName !== null ? props.row.organizationName : "-"
|
||||
props.row.organizationName !== null
|
||||
? props.row.organizationName
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
|
|
@ -440,16 +439,14 @@ onMounted(async () => {
|
|||
<div class="text-weight-medium">-</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-td>
|
||||
<q-td
|
||||
key="dateOfBirth"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{
|
||||
props.row.dateOfBirth !== null
|
||||
? props.row.dateOfBirth
|
||||
: "-"
|
||||
props.row.dateOfBirth !== null ? props.row.dateOfBirth : "-"
|
||||
}}
|
||||
</q-td>
|
||||
<q-td
|
||||
|
|
@ -595,7 +592,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="id"
|
||||
|
|
@ -610,7 +607,6 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -621,7 +617,6 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="no" :props="props">
|
||||
|
|
@ -633,10 +628,7 @@ onMounted(async () => {
|
|||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="organizationName"
|
||||
:props="props"
|
||||
>
|
||||
<q-td key="organizationName" :props="props">
|
||||
<div
|
||||
v-if="
|
||||
props.row.organizationName !== null ||
|
||||
|
|
@ -645,7 +637,11 @@ onMounted(async () => {
|
|||
>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.organizationName !== null ? props.row.organizationName : "-" }}
|
||||
{{
|
||||
props.row.organizationName !== null
|
||||
? props.row.organizationName
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
|
|
@ -675,7 +671,6 @@ onMounted(async () => {
|
|||
<q-td key="dateOfBirth" :props="props">
|
||||
{{ props.row.dateOfBirth }}
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,14 @@ import config from "@/app.config";
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { date2Thai, hideLoader, messageError, showLoader, success } = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
const {
|
||||
date2Thai,
|
||||
hideLoader,
|
||||
messageError,
|
||||
showLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
|
||||
|
|
@ -205,16 +212,15 @@ const clickEditRow = () => {
|
|||
|
||||
const closeModal = () => {
|
||||
if (editDataStatus.value == true) {
|
||||
$q.dialog({
|
||||
title: `ข้อมูลมีการแก้ไข`,
|
||||
message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
cancel: "ยกเลิก",
|
||||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
}).onOk(() => {
|
||||
editDataStatus.value = false;
|
||||
closeAndClear();
|
||||
});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
editDataStatus.value = false;
|
||||
closeAndClear();
|
||||
},
|
||||
`ข้อมูลมีการแก้ไข`,
|
||||
`ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`
|
||||
);
|
||||
} else {
|
||||
closeAndClear();
|
||||
}
|
||||
|
|
@ -319,7 +325,6 @@ const selectedPosition = async (data: any) => {
|
|||
positionPathSideArr.length > 1 || positionPathSideArr.length == 0
|
||||
? ""
|
||||
: positionPathSideArr[0].value;
|
||||
|
||||
}
|
||||
|
||||
// positionType Options
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
|
|
@ -39,7 +40,7 @@ const id = ref<string>("");
|
|||
const prefix = ref<string>("");
|
||||
const prefixId = ref<string>("");
|
||||
const firstname = ref<string>("");
|
||||
const citizenId = ref<string>("")
|
||||
const citizenId = ref<string>("");
|
||||
const lastname = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
|
|
@ -54,14 +55,14 @@ const amount = ref<number>();
|
|||
const amountOld = ref<number>();
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const dateOfBirth = ref<Date>()
|
||||
const genderId = ref<string>("")
|
||||
const nationality = ref<string>("")
|
||||
const race = ref<string>("")
|
||||
const religionId = ref<string>("")
|
||||
const bloodGroupId = ref<string>("")
|
||||
const relationshipId = ref<string>("")
|
||||
const telephoneNumber = ref<string>("")
|
||||
const dateOfBirth = ref<Date>();
|
||||
const genderId = ref<string>("");
|
||||
const nationality = ref<string>("");
|
||||
const race = ref<string>("");
|
||||
const religionId = ref<string>("");
|
||||
const bloodGroupId = ref<string>("");
|
||||
const relationshipId = ref<string>("");
|
||||
const telephoneNumber = ref<string>("");
|
||||
const positionNumberOld = ref<string>("");
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const isActive = ref<string>("");
|
||||
|
|
@ -116,7 +117,7 @@ const getData = async () => {
|
|||
.get(config.API.relocationDetail(personId))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
citizenId.value = data.citizenId
|
||||
citizenId.value = data.citizenId;
|
||||
fullname.value = `${data.prefix}${data.firstname} ${data.lastname}`;
|
||||
prefixId.value = data.prefixId;
|
||||
prefix.value = data.prefix;
|
||||
|
|
@ -165,31 +166,27 @@ const conditionSave = async () => {
|
|||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success: any) => {
|
||||
if (success) {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => await saveData(),
|
||||
undefined
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const cancelBtn = () => {
|
||||
edit.value=!edit
|
||||
getData()
|
||||
}
|
||||
edit.value = !edit;
|
||||
getData();
|
||||
};
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
educationOld: educationOld.value,
|
||||
prefixId:prefixId.value,
|
||||
citizenId:citizenId.value,
|
||||
firstname:firstname.value,
|
||||
lastname:lastname.value,
|
||||
prefixId: prefixId.value,
|
||||
citizenId: citizenId.value,
|
||||
firstname: firstname.value,
|
||||
lastname: lastname.value,
|
||||
reason: reason.value,
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
|
|
@ -197,14 +194,14 @@ const saveData = async () => {
|
|||
positionNumberOld: positionNumberOld.value,
|
||||
amount: amount.value,
|
||||
amountOld: amountOld.value,
|
||||
dateOfBirth:dateOfBirth.value ,
|
||||
genderId:genderId.value ,
|
||||
nationality:nationality.value ,
|
||||
race:race.value ,
|
||||
religionId:religionId.value ,
|
||||
bloodGroupId:bloodGroupId.value ,
|
||||
relationshipId:relationshipId.value ,
|
||||
telephoneNumber:telephoneNumber.value ,
|
||||
dateOfBirth: dateOfBirth.value,
|
||||
genderId: genderId.value,
|
||||
nationality: nationality.value,
|
||||
race: race.value,
|
||||
religionId: religionId.value,
|
||||
bloodGroupId: bloodGroupId.value,
|
||||
relationshipId: relationshipId.value,
|
||||
telephoneNumber: telephoneNumber.value,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -363,22 +360,22 @@ onMounted(async () => {
|
|||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="text-weight-bold text-grey">วุฒิการศึกษา</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="educationOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วุฒิ/สาขา'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-weight-bold text-grey">วุฒิการศึกษา</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="educationOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วุฒิ/สาขา'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 row items-center">
|
||||
<div class="col-12 q-pb-sm"><q-separator /></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
dialogMessage,
|
||||
|
||||
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -258,16 +257,18 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
|
||||
//--------------(ปุ่มลบ)----------------//
|
||||
|
||||
const openDetail = (id:string) => {
|
||||
router.push(`/repatriate/detail/${id}`)
|
||||
}
|
||||
const openDetail = (id: string) => {
|
||||
router.push(`/repatriate/detail/${id}`);
|
||||
};
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => (modal.value = false);
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = rows.value.filter(
|
||||
(item: officerType) =>
|
||||
item.status == "WAITTING" || item.status == "PENDING" || item.status == "APPROVE"
|
||||
item.status == "WAITTING" ||
|
||||
item.status == "PENDING" ||
|
||||
item.status == "APPROVE"
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
|
@ -280,7 +281,7 @@ const getData = async () => {
|
|||
console.log("data==>", data);
|
||||
rows.value = data.map((item: officerType) => ({
|
||||
id: item.id,
|
||||
fullname:`${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
fullname: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
position: item.position,
|
||||
posNo: item.posNo,
|
||||
positionLevel: item.positionLevel,
|
||||
|
|
@ -288,7 +289,7 @@ const getData = async () => {
|
|||
organization: item.organization,
|
||||
reason: item.reason,
|
||||
status: item.status,
|
||||
statusText:statusText(item.status),
|
||||
statusText: statusText(item.status),
|
||||
date: item.date,
|
||||
salary: item.salary,
|
||||
positionTypeOld: item.positionTypeOld,
|
||||
|
|
@ -296,9 +297,8 @@ const getData = async () => {
|
|||
positionNumberOld: item.positionNumberOld,
|
||||
organizationPositionOld: item.organizationPositionOld,
|
||||
isActive: item.isActive,
|
||||
})
|
||||
);
|
||||
console.log(rows.value )
|
||||
}));
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
|
|
@ -330,35 +330,23 @@ const saveOrder = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
const deleteData = async (id:string) => {
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.repatriationMainDelete(id))
|
||||
.then((res)=>{
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
}
|
||||
.delete(config.API.repatriationMainDelete(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const clickDelete = async (name:string,id:string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
`ลบข้อมูลของ ${name}`,
|
||||
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
||||
"delete",
|
||||
"ยืนยัน",
|
||||
"red",
|
||||
async () => await deleteData(id)
|
||||
,
|
||||
async () => await getData()
|
||||
|
||||
);
|
||||
const clickDelete = async (name: string, id: string) => {
|
||||
dialogRemove($q, async () => await deleteData(id), `ลบข้อมูลของ ${name}`);
|
||||
};
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
|
|
@ -441,26 +429,50 @@ onMounted(async () => {
|
|||
<q-td key="no" :props="props" @click="openDetail(props.row.id)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="position"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
<q-td key="positionLevel" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="positionLevel"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.positionLevel }}
|
||||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="organizationPositionOld"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="organization"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="statusText"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.statusText }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
|
|
@ -471,9 +483,9 @@ onMounted(async () => {
|
|||
flat
|
||||
round
|
||||
dense
|
||||
@click="clickDelete(props.row.fullname,props.row.id)"
|
||||
@click="clickDelete(props.row.fullname, props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
@ -580,13 +592,13 @@ onMounted(async () => {
|
|||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props">
|
||||
{{ props.row.statusText }}
|
||||
|
|
|
|||
|
|
@ -1,254 +1,112 @@
|
|||
<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
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียดการส่งตัวกลับ {{ fullname }}
|
||||
</div>
|
||||
<q-card bordered class="row col-12 text-dark">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-subtitle2">{{ fullname }}</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
outline
|
||||
color="blue"
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
icon-right="mdi-open-in-new"
|
||||
class="q-px-sm"
|
||||
label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="router.push(`/registry/${personId}`)"
|
||||
/>
|
||||
รายละเอียดการส่งตัวกลับ {{ fullname }}
|
||||
</div>
|
||||
<q-card bordered class="row col-12 text-dark">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-subtitle2">{{ fullname }}</div>
|
||||
<q-space />
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
||||
<q-img src="@/assets/avatar_user.jpg" />
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12 q-pl-md">
|
||||
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ positionTypeOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">ระดับ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ positionLevelOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สังกัด</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ organizationPositionOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
<q-space />
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="blue"
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-open-in-new"
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="router.push(`/registry/${personId}`)"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
@click="conditionSave"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="cancelBtn"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-form ref="myForm">
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
||||
<q-img src="@/assets/avatar_user.jpg" />
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12 q-pl-md">
|
||||
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ positionTypeOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-xs-12 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">ระดับ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ positionLevelOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สังกัด</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ organizationPositionOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
<q-space />
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
@click="conditionSave"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="cancelBtn"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-form ref="myForm">
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-12 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="text-weight-bold text-grey">
|
||||
ตำแหน่งและหน่วยงานเดิม
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="organizationPositionOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่ง/สังกัด'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionTypeOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่งประเภท'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionLevelOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ระดับ'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="posNo"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เลขที่'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<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"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-6 col-sm-6 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="organization"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกโอนไปสังกัด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'โอนไปสังกัด'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 row items-center">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="date"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตั้งแต่วัน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
:style="
|
||||
edit
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<div class="text-weight-bold text-grey">
|
||||
ตำแหน่งและหน่วยงานเดิม
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
|
@ -259,255 +117,392 @@
|
|||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="reason"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกหมายเหตุ '}`]"
|
||||
v-model="organizationPositionOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'หมายเหตุ '}`"
|
||||
:label="`${'ตำแหน่ง/สังกัด'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionTypeOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่งประเภท'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionLevelOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ระดับ'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="posNo"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เลขที่'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<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"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-6 col-sm-6 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="organization"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกโอนไปสังกัด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'โอนไปสังกัด'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 row items-center">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="date"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตั้งแต่วัน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
:style="
|
||||
edit
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="reason"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกหมายเหตุ '}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'หมายเหตุ '}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
// import type {
|
||||
// TypeFile,
|
||||
// ResponseDataDetail,
|
||||
// } from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const edit = ref<boolean>(false);
|
||||
const personId = route.params.id as string;
|
||||
const {
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
} = mixin;
|
||||
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const name = ref<string>("นายสมคิด ยอดใจ");
|
||||
const level = ref<string>("ชำนาญการพิเศษ");
|
||||
const institution = ref<string>("ฝ่ายบริหารงานทั่วไป");
|
||||
const fullname = ref<string>("");
|
||||
const id = ref<string>("");
|
||||
const prefix = ref<string>("");
|
||||
const firstName = ref<string>("");
|
||||
const lastName = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
const positionLevel = ref<string>("");
|
||||
const createdAt = ref<string>("");
|
||||
const organization = ref<string>("");
|
||||
const reason = ref<string>("");
|
||||
const status = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const salary = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const positionNumberOld = ref<string>("");
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const isActive = ref<string>("");
|
||||
// const responseData = ref<ResponseDataDetail>({
|
||||
// createdAt: new Date(),
|
||||
// date: new Date(),
|
||||
// id: "",
|
||||
// organization: "",
|
||||
// organizationPositionOld: "",
|
||||
// positionLevelOld: "",
|
||||
// positionNumberOld: "",
|
||||
// positionTypeOld: "",
|
||||
// reason: "",
|
||||
// salary: 0,
|
||||
// status: "",
|
||||
// });
|
||||
|
||||
// const rows = ref<TypeFile[]>([]);
|
||||
// const columns = ref<QTableProps["columns"]>([
|
||||
// {
|
||||
// name: "no",
|
||||
// align: "left",
|
||||
// label: "ลำดับ",
|
||||
// sortable: true,
|
||||
// field: "no",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "fileName",
|
||||
// align: "left",
|
||||
// label: "ชื่อไฟล์",
|
||||
// sortable: true,
|
||||
// field: "fileName",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "btnMicrosoft",
|
||||
// align: "right",
|
||||
// label: "ปุ่ม",
|
||||
// sortable: true,
|
||||
// field: "btnMicrosoft",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// ]);
|
||||
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.repatriationDetail(personId))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
(fullname.value = `${data.prefix}${data.firstName} ${data.lastName}`),
|
||||
(id.value = data.id);
|
||||
prefix.value = data.prefix;
|
||||
firstName.value = data.firstName;
|
||||
lastName.value = data.lastName;
|
||||
position.value = data.position;
|
||||
posNo.value = data.posNo;
|
||||
positionLevel.value = data.positionLevel;
|
||||
createdAt.value = data.createdAt;
|
||||
organization.value = data.organization;
|
||||
reason.value = data.reason;
|
||||
status.value = data.status;
|
||||
date.value = data.date;
|
||||
salary.value = data.salary;
|
||||
positionTypeOld.value = data.positionTypeOld;
|
||||
positionLevelOld.value = data.positionLevelOld;
|
||||
positionNumberOld.value = data.positionNumberOld;
|
||||
organizationPositionOld.value = data.organizationPositionOld;
|
||||
isActive.value = data.isActive;
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
// import type {
|
||||
// TypeFile,
|
||||
// ResponseDataDetail,
|
||||
// } from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const edit = ref<boolean>(false);
|
||||
const personId = route.params.id as string;
|
||||
const {
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const name = ref<string>("นายสมคิด ยอดใจ");
|
||||
const level = ref<string>("ชำนาญการพิเศษ");
|
||||
const institution = ref<string>("ฝ่ายบริหารงานทั่วไป");
|
||||
const fullname = ref<string>("");
|
||||
const id = ref<string>("");
|
||||
const prefix = ref<string>("");
|
||||
const firstName = ref<string>("");
|
||||
const lastName = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
const positionLevel = ref<string>("");
|
||||
const createdAt = ref<string>("");
|
||||
const organization = ref<string>("");
|
||||
const reason = ref<string>("");
|
||||
const status = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const salary = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const positionNumberOld = ref<string>("");
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const isActive = ref<string>("");
|
||||
// const responseData = ref<ResponseDataDetail>({
|
||||
// createdAt: new Date(),
|
||||
// date: new Date(),
|
||||
// id: "",
|
||||
// organization: "",
|
||||
// organizationPositionOld: "",
|
||||
// positionLevelOld: "",
|
||||
// positionNumberOld: "",
|
||||
// positionTypeOld: "",
|
||||
// reason: "",
|
||||
// salary: 0,
|
||||
// status: "",
|
||||
// });
|
||||
|
||||
// const rows = ref<TypeFile[]>([]);
|
||||
// const columns = ref<QTableProps["columns"]>([
|
||||
// {
|
||||
// name: "no",
|
||||
// align: "left",
|
||||
// label: "ลำดับ",
|
||||
// sortable: true,
|
||||
// field: "no",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "fileName",
|
||||
// align: "left",
|
||||
// label: "ชื่อไฟล์",
|
||||
// sortable: true,
|
||||
// field: "fileName",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "btnMicrosoft",
|
||||
// align: "right",
|
||||
// label: "ปุ่ม",
|
||||
// sortable: true,
|
||||
// field: "btnMicrosoft",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// ]);
|
||||
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.repatriationDetail(personId))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
(fullname.value = `${data.prefix}${data.firstName} ${data.lastName}`),
|
||||
(id.value = data.id);
|
||||
prefix.value = data.prefix;
|
||||
firstName.value = data.firstName;
|
||||
lastName.value = data.lastName;
|
||||
position.value = data.position;
|
||||
posNo.value = data.posNo;
|
||||
positionLevel.value = data.positionLevel;
|
||||
createdAt.value = data.createdAt;
|
||||
organization.value = data.organization;
|
||||
reason.value = data.reason;
|
||||
status.value = data.status;
|
||||
date.value = data.date;
|
||||
salary.value = data.salary;
|
||||
positionTypeOld.value = data.positionTypeOld;
|
||||
positionLevelOld.value = data.positionLevelOld;
|
||||
positionNumberOld.value = data.positionNumberOld;
|
||||
organizationPositionOld.value = data.organizationPositionOld;
|
||||
isActive.value = data.isActive;
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
//
|
||||
const conditionSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success: any) => {
|
||||
if (success) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await saveData(),
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const cancelBtn = () => {
|
||||
edit.value = !edit;
|
||||
getData();
|
||||
};
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
reason: reason.value,
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
date: date.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
positionLevelOld: positionLevelOld.value,
|
||||
positionNumberOld: posNo.value,
|
||||
amountOld: salary.value,
|
||||
};
|
||||
//
|
||||
const conditionSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success: any) => {
|
||||
if (success) {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => await saveData(),
|
||||
undefined
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const cancelBtn = () => {
|
||||
edit.value=!edit
|
||||
getData()
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.repatriationMainEdit(personId.toString()), body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// const confirmMessage = async () => {
|
||||
// dialogMessage(
|
||||
// $q,
|
||||
// "ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
||||
// "ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที",
|
||||
// "mdi-help-circle-outline",
|
||||
// "ยืนยัน",
|
||||
// "primary",
|
||||
// () => sendConfirm(),
|
||||
// undefined
|
||||
// );
|
||||
// };
|
||||
// const sendConfirm = async () => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.transferConfirmId(personId.toString()))
|
||||
// .then((res: any) => {
|
||||
// // const data = res.data.result;
|
||||
// // console.log(data);
|
||||
// success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// await getData();
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
border-radius: 5px;
|
||||
height: 70px;
|
||||
}
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
reason: reason.value,
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
date: date.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
positionLevelOld: positionLevelOld.value,
|
||||
positionNumberOld: posNo.value,
|
||||
amountOld: salary.value,
|
||||
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.repatriationMainEdit(personId.toString()), body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// const confirmMessage = async () => {
|
||||
// dialogMessage(
|
||||
// $q,
|
||||
// "ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
||||
// "ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที",
|
||||
// "mdi-help-circle-outline",
|
||||
// "ยืนยัน",
|
||||
// "primary",
|
||||
// () => sendConfirm(),
|
||||
// undefined
|
||||
// );
|
||||
// };
|
||||
// const sendConfirm = async () => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.transferConfirmId(personId.toString()))
|
||||
// .then((res: any) => {
|
||||
// // const data = res.data.result;
|
||||
// // console.log(data);
|
||||
// success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// await getData();
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
border-radius: 5px;
|
||||
height: 70px;
|
||||
}
|
||||
.text-top {
|
||||
color: gray;
|
||||
font-weight: 400;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.text-detail {
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
||||
.text-top {
|
||||
color: gray;
|
||||
font-weight: 400;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.text-detail {
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ const pagination = ref({
|
|||
});
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { dateText } = mixin;
|
||||
const { dateText, dialogRemove } = mixin;
|
||||
|
||||
// แปลงเวลา ค.ศ ให้เป็น พ.ศ
|
||||
const textDate = (value: Date) => {
|
||||
|
|
@ -489,20 +489,7 @@ const redirectToPage = (id?: number) => {
|
|||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
// await deleteData(id);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogRemove($q);
|
||||
};
|
||||
|
||||
// const deleteData = async (id: string) => {
|
||||
|
|
|
|||
|
|
@ -388,6 +388,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const myForm = ref<QForm | null>(null);
|
||||
|
|
@ -511,15 +512,11 @@ const getData = async () => {
|
|||
};
|
||||
|
||||
const confirmMessage = async () => {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await sendConfirm(),
|
||||
"ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
||||
"ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที",
|
||||
"mdi-help-circle-outline",
|
||||
"ยืนยัน",
|
||||
"primary",
|
||||
() => sendConfirm(),
|
||||
undefined
|
||||
"ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที"
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -545,15 +542,11 @@ const conditionSave = async () => {
|
|||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success) => {
|
||||
if (success) {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => await saveData(),
|
||||
undefined
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ const edit = ref<boolean>(false);
|
|||
const personId = route.params.id as string;
|
||||
const {
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
dialogConfirm,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
|
|
@ -415,24 +415,20 @@ const conditionSave = async () => {
|
|||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success: any) => {
|
||||
if (success) {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => await saveData(),
|
||||
undefined
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const cancelBtn = () => {
|
||||
edit.value=!edit
|
||||
getData()
|
||||
}
|
||||
edit.value = !edit;
|
||||
getData();
|
||||
};
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const checkSelected = computed(() => {
|
|||
return true;
|
||||
}
|
||||
});
|
||||
const firstName = ref<string>("")
|
||||
const firstName = ref<string>("");
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
|
@ -32,9 +32,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogMessage,
|
||||
|
||||
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -259,16 +257,18 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
|
||||
//--------------(ปุ่มลบ)----------------//
|
||||
|
||||
const openDetail = (id:string) => {
|
||||
router.push(`/help-government/detail/${id}`)
|
||||
}
|
||||
const openDetail = (id: string) => {
|
||||
router.push(`/help-government/detail/${id}`);
|
||||
};
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => (modal.value = false);
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = rows.value.filter(
|
||||
(item: officerType) =>
|
||||
item.status == "WAITTING" || item.status == "PENDING" || item.status == "APPROVE"
|
||||
item.status == "WAITTING" ||
|
||||
item.status == "PENDING" ||
|
||||
item.status == "APPROVE"
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
|
@ -281,7 +281,7 @@ const getData = async () => {
|
|||
console.log("data==>", data);
|
||||
rows.value = data.map((item: officerType) => ({
|
||||
id: item.id,
|
||||
fullname:`${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
fullname: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
position: item.position,
|
||||
posNo: item.posNo,
|
||||
positionLevel: item.positionLevel,
|
||||
|
|
@ -289,7 +289,7 @@ const getData = async () => {
|
|||
organization: item.organization,
|
||||
reason: item.reason,
|
||||
status: item.status,
|
||||
statusText:statusText(item.status),
|
||||
statusText: statusText(item.status),
|
||||
date: item.date,
|
||||
salary: item.salary,
|
||||
positionTypeOld: item.positionTypeOld,
|
||||
|
|
@ -297,9 +297,8 @@ const getData = async () => {
|
|||
positionNumberOld: item.positionNumberOld,
|
||||
organizationPositionOld: item.organizationPositionOld,
|
||||
isActive: item.isActive,
|
||||
})
|
||||
);
|
||||
console.log(rows.value )
|
||||
}));
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
|
|
@ -331,35 +330,23 @@ const saveOrder = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
const deleteData = async (id:string) => {
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.officerMainDelete(id))
|
||||
.then((res)=>{
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
}
|
||||
.delete(config.API.officerMainDelete(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const clickDelete = async (name:string,id:string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
`ลบข้อมูลของ ${name}`,
|
||||
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
||||
"delete",
|
||||
"ยืนยัน",
|
||||
"red",
|
||||
async () => await deleteData(id)
|
||||
,
|
||||
async () => await getData()
|
||||
|
||||
);
|
||||
const clickDelete = async (name: string, id: string) => {
|
||||
dialogRemove($q, async () => await deleteData(id));
|
||||
};
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
|
|
@ -442,26 +429,50 @@ onMounted(async () => {
|
|||
<q-td key="no" :props="props" @click="openDetail(props.row.id)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="position"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
<q-td key="positionLevel" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="positionLevel"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.positionLevel }}
|
||||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="organizationPositionOld"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="organization"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="statusText"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.statusText }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
|
|
@ -472,9 +483,9 @@ onMounted(async () => {
|
|||
flat
|
||||
round
|
||||
dense
|
||||
@click="clickDelete(props.row.fullname,props.row.id)"
|
||||
@click="clickDelete(props.row.fullname, props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
@ -581,13 +592,13 @@ onMounted(async () => {
|
|||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props">
|
||||
{{ props.row.statusText }}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
dateToISO,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
|
|
@ -292,29 +293,18 @@ const putformData = () => {
|
|||
other_training: Number(other_training.value),
|
||||
commander_dated: dateToISO(dateAutherise.value),
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
console.log("บันทึกข้อมูล", data);
|
||||
await http
|
||||
.post(config.API.createformCommader(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
|
||||
dialogConfirm($q, async () => {
|
||||
await http
|
||||
.post(config.API.createformCommader(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
dateToISO,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
|
@ -99,7 +100,7 @@ const fecthAssign = async (id: string) => {
|
|||
evaluate_no.value = res.data.data.evaluate_no;
|
||||
start_date.value = res.data.data.start_date;
|
||||
date_finish.value = res.data.data.end_date;
|
||||
round.value = res.data.data.evaluate_no
|
||||
round.value = res.data.data.evaluate_no;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -217,29 +218,41 @@ const putformData = () => {
|
|||
other_training: Number(other_training.value),
|
||||
commander_dated: dateToISO(dateAutherise.value),
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
console.log("บันทึกข้อมูล", data);
|
||||
await http
|
||||
.post(config.API.createformCommader(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm($q, async () => {
|
||||
await http
|
||||
.post(config.API.createformCommader(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
});
|
||||
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการบันทึกข้อมูล",
|
||||
// message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// color: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {
|
||||
// console.log("บันทึกข้อมูล", data);
|
||||
// await http
|
||||
// .post(config.API.createformCommader(assignId.value), data)
|
||||
// .then((res: any) => {
|
||||
// console.log(res);
|
||||
// success($q, "บันทึกสำเร็จ");
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// });
|
||||
// })
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ const {
|
|||
hideLoader,
|
||||
dateToISO,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
|
|
@ -396,33 +397,44 @@ const putformData = () => {
|
|||
chairman_dated: dateToISO(dateAutherise.value),
|
||||
develop_result: develop_result.value,
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
console.log("บันทึกข้อมูล", data);
|
||||
await http
|
||||
.post(config.API.createformChairman(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchEvaluate(assignId.value, round.value);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm($q, async () => {
|
||||
await http
|
||||
.post(config.API.createformChairman(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
});
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการบันทึกข้อมูล",
|
||||
// message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// color: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {
|
||||
// console.log("บันทึกข้อมูล", data);
|
||||
// await http
|
||||
// .post(config.API.createformChairman(assignId.value), data)
|
||||
// .then((res: any) => {
|
||||
// console.log(res);
|
||||
// success($q, "บันทึกสำเร็จ");
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// console.log(e);
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// fetchEvaluate(assignId.value, round.value);
|
||||
// });
|
||||
// })
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ const {
|
|||
hideLoader,
|
||||
dateToISO,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
|
@ -330,33 +331,17 @@ const putformData = () => {
|
|||
chairman_dated: dateToISO(dateAutherise.value),
|
||||
develop_result: develop_result.value,
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
console.log("บันทึกข้อมูล", data);
|
||||
await http
|
||||
.post(config.API.createformChairman(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchEvaluate(assignId.value, round.value);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm($q, async () => {
|
||||
await http
|
||||
.post(config.API.createformChairman(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const {
|
|||
success,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
|
|
@ -106,20 +107,7 @@ const optionDirector = ref<any>([]);
|
|||
const savaForm = async () => {
|
||||
await myForm.value!.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
postData();
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm($q, async () => await postData());
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ const {
|
|||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const { ratingColors } = probationStore;
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
|
|
@ -370,21 +371,7 @@ const putformData = () => {
|
|||
assessor_dated: dateToISO(dateAutherise.value),
|
||||
// commander_dated: dateAutherise.value,
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
console.log("บันทึกข้อมูล", data);
|
||||
saveformdata(data);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm($q, async () => await saveformdata(data));
|
||||
};
|
||||
const saveformdata = async (data: any) => {
|
||||
await http
|
||||
|
|
|
|||
|
|
@ -14,7 +14,14 @@ const route = useRoute();
|
|||
const router = useRouter();
|
||||
const probationStore = useProbationDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, notifyError, dateToISO, messageError } = mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
success,
|
||||
notifyError,
|
||||
dateToISO,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const { ratingColors } = probationStore;
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
|
||||
|
|
@ -289,21 +296,7 @@ const putformData = () => {
|
|||
assessor_dated: dateToISO(dateAutherise.value),
|
||||
// commander_dated: dateAutherise.value,
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
console.log("บันทึกข้อมูล", data);
|
||||
saveformdata(data);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
dialogConfirm($q, async () => await saveformdata(data));
|
||||
};
|
||||
const saveformdata = async (data: any) => {
|
||||
await http
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ const getData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const clickDelete = async (name: string, id: string) => {
|
||||
const clickDelete = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
`ลบข้อมูล`,
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ const getData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const clickDelete = async (name: string, id: string) => {
|
||||
const clickDelete = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
`ลบข้อมูล`,
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ const getData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const clickDelete = async (name: string, id: string) => {
|
||||
const clickDelete = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
`ลบข้อมูล`,
|
||||
|
|
@ -265,6 +265,7 @@ const deleteData = async (id: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
|
@ -423,6 +424,7 @@ const saveOrder = async () => {
|
|||
<q-td key="statustext" :props="props">
|
||||
{{ props.row.statustext }}
|
||||
</q-td>
|
||||
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -441,12 +441,21 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
});
|
||||
};
|
||||
|
||||
const dialogRemove = (q: any, ok?: Function, cancel?: Function) => {
|
||||
const dialogRemove = (
|
||||
q: any,
|
||||
ok?: Function,
|
||||
title?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||
cancel?: Function
|
||||
) => {
|
||||
q.dialog({
|
||||
component: CustomComponent,
|
||||
componentProps: {
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
title: title && title != null ? title : "ยืนยันการลบข้อมูล",
|
||||
message:
|
||||
desc && desc != null
|
||||
? desc
|
||||
: "ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
icon: "delete",
|
||||
color: "red",
|
||||
textOk: "ตกลง",
|
||||
|
|
@ -792,6 +801,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
// common dialog
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
dialogMessageNotify
|
||||
dialogMessageNotify,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue