fix:API
This commit is contained in:
parent
6aa8a61b40
commit
99cba9f3bd
5 changed files with 37 additions and 9 deletions
|
|
@ -165,7 +165,6 @@ export default {
|
||||||
otherByid: (id: string) => `${placemenOther}/${id}`,
|
otherByid: (id: string) => `${placemenOther}/${id}`,
|
||||||
otherPositionUse: () => `${placemenOther}/use`,
|
otherPositionUse: () => `${placemenOther}/use`,
|
||||||
|
|
||||||
|
|
||||||
userPlacement: (id: string) => `${placement}/user/${id}`,
|
userPlacement: (id: string) => `${placement}/user/${id}`,
|
||||||
|
|
||||||
// orderForm
|
// orderForm
|
||||||
|
|
@ -184,4 +183,6 @@ export default {
|
||||||
|
|
||||||
//รายงาน
|
//รายงาน
|
||||||
placementReport: `${report}`,
|
placementReport: `${report}`,
|
||||||
|
|
||||||
|
transferAdmin: `${transfer}/admin`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -110,4 +110,6 @@ export default {
|
||||||
`${retirement}/${path}/admin-update/resign-info/${id}`,
|
`${retirement}/${path}/admin-update/resign-info/${id}`,
|
||||||
|
|
||||||
exRetirement: `${env.API_URI}/org/ex/retirement`,
|
exRetirement: `${env.API_URI}/org/ex/retirement`,
|
||||||
|
|
||||||
|
resignAdmin: (typeEmp: string) => `${retirement}/resign${typeEmp}/admin`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from "vue";
|
import { ref, reactive, computed } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
|
@ -16,11 +16,22 @@ import type { DataOption } from "@/modules/04_registryPerson/interface/index/Mai
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, dateToISO } =
|
const {
|
||||||
useCounterMixin();
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
date2Thai,
|
||||||
|
dateToISO,
|
||||||
|
pathRegistryEmp,
|
||||||
|
success,
|
||||||
|
} = useCounterMixin();
|
||||||
|
|
||||||
//props
|
//props
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
|
const profileId = ref<string>(route.params.id?.toString() ?? ""); //ProfileId
|
||||||
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? "")); //ประเภทข้าราชการ
|
||||||
|
|
||||||
|
const isEmployee = computed(() => empType.value !== "");
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
location: "",
|
location: "",
|
||||||
|
|
@ -57,6 +68,7 @@ async function onSubmit() {
|
||||||
try {
|
try {
|
||||||
showLoader();
|
showLoader();
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
formData.append("ProfileId", profileId.value);
|
||||||
formData.append("Location", form.location);
|
formData.append("Location", form.location);
|
||||||
formData.append(
|
formData.append(
|
||||||
"ActiveDate",
|
"ActiveDate",
|
||||||
|
|
@ -70,8 +82,9 @@ async function onSubmit() {
|
||||||
formData.append("remark", form.remark);
|
formData.append("remark", form.remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
// await http.post(config.API.listtransfer(), formData);
|
await http.post(config.API.resignAdmin(empType.value), formData);
|
||||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
router.push({ name: isEmployee.value ? "resignEmployee" : "resign" });
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
messageError($q, error);
|
messageError($q, error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -82,6 +95,11 @@ async function onSubmit() {
|
||||||
/** function ปิด popup*/
|
/** function ปิด popup*/
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
|
form.location = "";
|
||||||
|
form.activeDate = null;
|
||||||
|
form.reason = "";
|
||||||
|
form.files = null;
|
||||||
|
form.remark = "";
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ const { showLoader, hideLoader, messageError, success } = useCounterMixin();
|
||||||
//props
|
//props
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
|
|
||||||
|
const profileId = ref<string>(route.params.id?.toString() ?? ""); //ProfileId
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
tranferOrg: "",
|
tranferOrg: "",
|
||||||
noteReason: "",
|
noteReason: "",
|
||||||
|
|
@ -30,14 +32,16 @@ async function onSubmit() {
|
||||||
try {
|
try {
|
||||||
showLoader();
|
showLoader();
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
formData.append("ProfileId", profileId.value);
|
||||||
formData.append("Organization", form.tranferOrg);
|
formData.append("Organization", form.tranferOrg);
|
||||||
formData.append("Reason", form.noteReason);
|
formData.append("Reason", form.noteReason);
|
||||||
if (form.files) {
|
if (form.files) {
|
||||||
formData.append("file", form.files);
|
formData.append("file", form.files);
|
||||||
}
|
}
|
||||||
|
|
||||||
// await http.post(config.API.listtransfer(), formData);
|
await http.post(config.API.transferAdmin, formData);
|
||||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
router.push({ name: "transfer" });
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
messageError($q, error);
|
messageError($q, error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ const itemsMenuEmployee = ref<DataOptionSys[]>([
|
||||||
name: "ให้ออกจากราชการ",
|
name: "ให้ออกจากราชการ",
|
||||||
system: "SYS_DISMISS_EMP",
|
system: "SYS_DISMISS_EMP",
|
||||||
},
|
},
|
||||||
|
{ id: "4", name: "ขอลาออก", system: "SYS_RESIGN_EMP" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const uploadUrl = ref<string>(""); //URL อัปโหลดรูป
|
const uploadUrl = ref<string>(""); //URL อัปโหลดรูป
|
||||||
|
|
@ -776,7 +777,7 @@ const titleName = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function openDialogSendTransferResign(
|
function openDialogSendTransferResign(
|
||||||
system: "SYS_TRANSFER_REQ" | "SYS_RESIGN"
|
system: "SYS_TRANSFER_REQ" | "SYS_RESIGN" | "SYS_RESIGN_EMP"
|
||||||
) {
|
) {
|
||||||
system === "SYS_TRANSFER_REQ"
|
system === "SYS_TRANSFER_REQ"
|
||||||
? (modalDialogTransfer.value = true)
|
? (modalDialogTransfer.value = true)
|
||||||
|
|
@ -890,6 +891,8 @@ onMounted(async () => {
|
||||||
? clickPassaway()
|
? clickPassaway()
|
||||||
: item.name == 'ให้ออกจากราชการ'
|
: item.name == 'ให้ออกจากราชการ'
|
||||||
? outPost()
|
? outPost()
|
||||||
|
: item.system === 'SYS_RESIGN_EMP'
|
||||||
|
? openDialogSendTransferResign(item.system)
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue