เพิ่ม -em
This commit is contained in:
parent
6ac80b03dc
commit
d868f40dfe
4 changed files with 27 additions and 9 deletions
|
|
@ -6,12 +6,16 @@ const holiday = `${env.API_URI}/metadata/holiday/`;
|
|||
|
||||
export default {
|
||||
listUser: () => `${retirementResign}/resign/user`,
|
||||
listUserByType:(type:string) => `${retirementResign}/resign${type}/user`,
|
||||
listResign: () => `${retirementResign}/resign`,
|
||||
listResignByType: (type:string) => `${retirementResign}/resign${type}`,
|
||||
resingByid: (id: string) => `${retirementResign}/resign/${id}`,
|
||||
resingByidType: (type:string,id: string) => `${retirementResign}/resign${type}/${id}`,
|
||||
questionnaireByid: (id: string) =>
|
||||
`${retirementResign}/resign/questionnaire/${id}`,
|
||||
listquestionnaire: () => `${retirementResign}/resign/questionnaire`,
|
||||
cancelResign: (id: string) => `${retirementResign}/resign/cancel/${id}`,
|
||||
cancelResignByType: (type:string,id: string) => `${retirementResign}/resign${type}/cancel/${id}`,
|
||||
|
||||
// คำถาม
|
||||
questionList: () => `${retirementResign}/resign/questionnaire/question`,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const { dialogConfirm, messageError, showLoader, hideLoader, success } = mixin;
|
|||
const id = ref<string>(route.params.id ? route.params.id.toString() : "");
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const link = defineModel<string>("link", { required: true });
|
||||
const props = defineProps({
|
||||
fectData: { type: Function, require: true },
|
||||
});
|
||||
|
|
@ -41,7 +42,7 @@ function onSubmit() {
|
|||
() => {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.cancelResign(id.value), {
|
||||
.put(config.API.cancelResignByType(link.value, id.value), {
|
||||
reason: reason.value,
|
||||
})
|
||||
.then(() => {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { useRouter, useRoute } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
import Dialog from "@/modules/03_retire/views/DialogRetire.vue";
|
||||
import Header from "@/components/DialogHeader.vue";
|
||||
|
|
@ -15,6 +16,8 @@ import Workflow from "@/components/Workflow/Main.vue";
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const link = ref<string>("");
|
||||
const dataStore = useDataStore();
|
||||
const routeName = router.currentRoute.value.name;
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -77,10 +80,14 @@ async function onSubmit() {
|
|||
formData.append("file", files.value);
|
||||
|
||||
http
|
||||
.post(config.API.listResign(), formData)
|
||||
.post(config.API.listResignByType(link.value), formData)
|
||||
.then((res) => {
|
||||
let id = res.data.result.id;
|
||||
router.push(`/retire/result/${id}`);
|
||||
if (dataStore.officerType == "OFFICER") {
|
||||
router.push(`/retire/result/${id}`);
|
||||
} else {
|
||||
router.push(`/retire/result`);
|
||||
}
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -110,7 +117,7 @@ function cancelResing() {
|
|||
async function fectDataresign(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.resingByid(id))
|
||||
.get(config.API.resingByidType(link.value, id))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
tranferOrg.value = data.location;
|
||||
|
|
@ -144,7 +151,8 @@ function downloadFile(data: string) {
|
|||
/**
|
||||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||
*/
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
link.value = await dataStore.getProFileType();
|
||||
if (route.params.id !== undefined) {
|
||||
fectDataresign(id.value);
|
||||
}
|
||||
|
|
@ -197,7 +205,7 @@ onMounted(() => {
|
|||
/>
|
||||
|
||||
<q-btn
|
||||
v-else-if="dataDetail.statusMain === 'CANCEL'"
|
||||
v-else-if="dataDetail.statusMain === 'CANCEL' && dataStore.officerType == 'OFFICER'"
|
||||
unelevated
|
||||
color="red"
|
||||
label="ติดตามสถานะยกเลิกการขอลาออก"
|
||||
|
|
@ -594,7 +602,8 @@ onMounted(() => {
|
|||
dataDetail.status !== 'DELETE' &&
|
||||
dataDetail.status !== 'CANCEL' &&
|
||||
dataDetail.status !== 'DONECANCEL' &&
|
||||
dataDetail.status !== 'DONEREJECT'
|
||||
dataDetail.status !== 'DONEREJECT' &&
|
||||
dataStore.officerType == 'OFFICER'
|
||||
"
|
||||
>
|
||||
<Workflow :id="id" sys-name="SYS_RETIREMENT" />
|
||||
|
|
@ -602,7 +611,7 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Dialog v-model:modal="modal" :fectData="fectDataresign" />
|
||||
<Dialog v-model:modal="modal" :fectData="fectDataresign" v-model:link="link"/>
|
||||
|
||||
<q-dialog v-model="modalWorkflow" persistent>
|
||||
<q-card style="width: 700px; max-width: 80vw">
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useRestDataStore } from "@/modules/03_retire/store";
|
||||
|
||||
import type {
|
||||
|
|
@ -16,6 +17,8 @@ import type {
|
|||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const link = ref<string>("");
|
||||
const dataStore = useDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
|
||||
const RestData = useRestDataStore();
|
||||
|
|
@ -89,7 +92,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
/** ดึงข้อมูล */
|
||||
async function fectListleave() {
|
||||
await http
|
||||
.get(config.API.listUser())
|
||||
.get(config.API.listUserByType(link.value))
|
||||
.then(async (res) => {
|
||||
let data = await res.data.result;
|
||||
rows.value = data.map((e: MainListResponse) => ({
|
||||
|
|
@ -123,6 +126,7 @@ onBeforeMount(() => {
|
|||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||
*/
|
||||
onMounted(async () => {
|
||||
link.value = await dataStore.getProFileType();
|
||||
await fectListleave();
|
||||
hideLoader();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue