@@ -380,7 +298,7 @@ const route = useRoute();
const router = useRouter();
const mixin = useCounterMixin();
-const personId = route.params.id;
+const dataId = route.params.id.toString();
const {
date2Thai,
dialogMessage,
@@ -404,6 +322,7 @@ const date = ref(null);
const reason = ref("");
const responseData = ref({
+ personId: "",
avataPath: "",
createdAt: new Date(),
date: new Date(),
@@ -461,10 +380,11 @@ onMounted(async () => {
const getData = async () => {
showLoader();
await http
- .get(config.API.dischargeByid(personId.toString()))
+ .get(config.API.dischargeByid(dataId))
.then((res: any) => {
const data = res.data.result;
+ responseData.value.personId = data.profileId;
responseData.value.createdAt = data.createdAt;
responseData.value.date =
data.date !== null ? new Date(data.date) : new Date();
@@ -500,37 +420,6 @@ const getData = async () => {
});
};
-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();
- // });
-};
-
const conditionSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
@@ -563,7 +452,7 @@ const saveData = async () => {
};
showLoader();
await http
- .put(config.API.dischargeByid(personId.toString()), body)
+ .put(config.API.dischargeByid(dataId), body)
.then((res: any) => {
// const data = res.data.result;
// console.log(data);
diff --git a/src/modules/06_retirement/components/DismissOrder/outRegistry.vue b/src/modules/06_retirement/components/DismissOrder/outRegistry.vue
index b05ebdda3..33535a08b 100644
--- a/src/modules/06_retirement/components/DismissOrder/outRegistry.vue
+++ b/src/modules/06_retirement/components/DismissOrder/outRegistry.vue
@@ -25,7 +25,7 @@
icon-right="mdi-open-in-new"
class="q-px-sm"
label="ดูข้อมูลทะเบียนประวัติ"
- @click="router.push(`/registry/${personId}`)"
+ @click="router.push(`/registry/${responseData.personId}`)"
/>
@@ -66,88 +66,6 @@