Merge branch 'develop' into working
This commit is contained in:
commit
f4dfa11ce1
7 changed files with 713 additions and 235 deletions
|
|
@ -113,6 +113,7 @@ const guidCheck = (id: string) => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
storePersonal.loading = false;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.placementPersonalId(examId.value))
|
||||
|
|
@ -256,8 +257,8 @@ const fetchData = async () => {
|
|||
รายละเอียดของ {{ personalData.fullName }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-pb-lg" v-if="storePersonal.loading">
|
||||
<q-card class="row q-pb-lg">
|
||||
<div class="q-pb-lg">
|
||||
<q-card class="row q-pb-lg" v-if="storePersonal.loading">
|
||||
<div id="information" name="1" class="col-12 q-pa-sm">
|
||||
<Informationvue
|
||||
v-model:statusEdit="statusEdit"
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.file)"
|
||||
@click="downloadData(file.pathName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสารหลักฐาน</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-show="edit"
|
||||
@click="deleteData(file.id)"
|
||||
@click="deleteData(file.docId)"
|
||||
>
|
||||
<q-tooltip>ลบเอกสารหลักฐาน</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -168,7 +168,7 @@ const emit = defineEmits(["update:statusEdit"]);
|
|||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const route = useRoute();
|
||||
const { success, messageError, showLoader, hideLoader } = mixin;
|
||||
const { success, messageError, showLoader, dialogConfirm } = mixin;
|
||||
const profileId = ref<string>(
|
||||
route.params.personalId ? route.params.personalId.toString() : ""
|
||||
);
|
||||
|
|
@ -206,18 +206,25 @@ const getData = async () => {
|
|||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.documentDelid(profileId.value, id))
|
||||
.then(() => {
|
||||
success($q, "ลบไฟล์เอกสารสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await props.fetch();
|
||||
});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.documentDelid(profileId.value, id))
|
||||
.then(() => {
|
||||
success($q, "ลบไฟล์เอกสารสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await props.fetch();
|
||||
});
|
||||
},
|
||||
"ยืนยันการลบเอกสารหลักฐาน",
|
||||
"ต้องการยืนยันการลบเอกสารหลักฐานนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
|
||||
const uploadData = async () => {
|
||||
|
|
@ -228,7 +235,7 @@ const uploadData = async () => {
|
|||
type: file.value[0].type,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("docs", newFile);
|
||||
formData.append("file", newFile);
|
||||
// formData.append("moss", "newFile");
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -240,11 +247,11 @@ const uploadData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await props.fetch();
|
||||
uploader.value.reset();
|
||||
name.value = "";
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch();
|
||||
});
|
||||
// } else {
|
||||
// // modalError(
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@ import type { Information } from "@/modules/05_placement/components/PersonalDeta
|
|||
export const usePersonalDataStore = defineStore("personal-detail", () => {
|
||||
const dataMain = ref<any>([])
|
||||
const loading = ref<boolean>(false)
|
||||
|
||||
|
||||
function fecthDataInformation(data: Information) {
|
||||
dataMain.value = data
|
||||
dataMain.value.length !== 0 ? loading.value = true : loading.value = false
|
||||
if (dataMain.value) {
|
||||
loading.value = true
|
||||
} else {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue