เพิ่ม -em

This commit is contained in:
setthawutttty 2024-11-08 14:03:01 +07:00
parent 6ac80b03dc
commit d868f40dfe
4 changed files with 27 additions and 9 deletions

View file

@ -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">