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