check statusjson ประกาศเกษียณอายุราชการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-23 13:55:11 +07:00
parent 393f94297e
commit e183754ccf
5 changed files with 169 additions and 137 deletions

View file

@ -20,9 +20,10 @@ const retireld_params = route.params.retirementId;
const modalNote = ref<boolean>(false);
const note = ref<string>("");
const retireProfileId = ref<string>("");
const retireld = ref<string>();
const retireld = ref<string>(retireld_params.toString());
const profileId = ref<string>("");
const filter = ref<string>("");
const statusUpload = ref<boolean>();
const columns = ref<any["columns"]>([
{
@ -131,20 +132,7 @@ const columns = ref<any["columns"]>([
style: "font-size: 14px",
},
]);
const rows = ref<any>([
// {
// fixname: "",
// name: " ",
// brand: "",
// positionType: "",
// positionManager: "",
// positionLavel: "",
// positionNumber: ".2",
// govGroup: "",
// govOffice: "",
// bureau: "",
// },
]);
const rows = ref<any>([]);
const visibleColumns = ref<string[]>([
"order",
"fixname",
@ -160,11 +148,14 @@ const visibleColumns = ref<string[]>([
]);
const action = ref<string>("");
const fileUpload = ref<any>(null);
const fileInputRef = ref<any>(null);
onMounted(() => {
retireld.value = retireld_params.toString();
console.log(retireld_params);
fecthlistprofile(retireld.value);
fecthCheck(retireld.value);
});
const round = ref<number>();
const typeReport = ref<string>("");
@ -205,6 +196,17 @@ const fecthlistprofile = async (id: string) => {
hideLoader();
});
};
const fecthCheck = async (id: string) => {
await http
.get(config.API.checkfileupload(id))
.then((res) => {
console.log(res);
statusUpload.value = res.data.result;
})
.catch((err) => {
console.log(err);
});
};
// DelProfile
const clickDelete = () => {
$q.dialog({
@ -297,38 +299,33 @@ const visibleNote = computed(() => {
return true;
}
});
// const saveList = () => {
// $q.dialog({
// title: "",
// message: "?",
// cancel: {
// flat: true,
// color: "negative",
// },
// persistent: true,
// })
// .onOk(async () => {
// const retireld = "1233444";
// await http
// .post(config.API.listRetire("123"), { retireld: retireld })
// .then(() => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// fecthlist();
// });
// })
// .onCancel(() => {})
// .onDismiss(() => {});
// };
const classrow = (prop: any) => {
if (profileId.value !== "" && prop.profileId === profileId.value) {
return "color: #26a69a;";
} else return "";
const uploadFile = async (event: any) => {
showLoader();
const selectedFile = event;
console.log(selectedFile);
const formdata = new FormData();
formdata.append("file", selectedFile);
await http
.put(config.API.fileRetirement(retireld.value.toString()), formdata)
.then((res) => {
success($q, "เพิ่มไฟล์สำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
fileUpload.value = null;
fecthlistprofile(retireld.value);
fecthCheck(retireld.value);
hideLoader();
});
};
// const classrow = (prop: any) => {
// if (profileId.value !== "" && prop.profileId === profileId.value) {
// return "color: #26a69a;";
// } else return "";
// };
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",
@ -359,80 +356,103 @@ const paginationLabel = (start: number, end: number, total: number) => {
<div>
<q-card class="col-12 q-pa-md">
<div class="row col-12 q-pb-sm">
<AddList
:dataProfile="dataProfile"
:retireld="retireld"
:profile-id="profileId"
:UpdateListId="UpdateListId"
v-if="
statusReport === false &&
(typeReport == 'ADD' || typeReport == '' || typeReport == null)
"
/>
<div class="row">
<AddList
:dataProfile="dataProfile"
:retireld="retireld"
:profile-id="profileId"
:UpdateListId="UpdateListId"
v-if="
statusReport === false &&
(typeReport == 'ADD' || typeReport == '' || typeReport == null) &&
statusUpload !== true
"
/>
<!-- <q-btn flat round style="color: #016987;" icon="save" @click="saveList">
<!-- <q-btn flat round style="color: #016987;" icon="save" @click="saveList">
<q-tooltip>นทกขอม</q-tooltip>
</q-btn> -->
<q-btn color="primary" flat round icon="download">
<q-menu>
<q-list style="min-width: 100px">
<q-item clickable>
<q-item-section avatar>
<q-icon color="red" name="mdi-file-pdf" />
</q-item-section>
<q-item-section>ไฟล .PDF</q-item-section>
</q-item>
<q-item clickable>
<q-item-section avatar>
<q-icon color="green" name="mdi-file-excel" />
</q-item-section>
<q-item-section>ไฟล .xls</q-item-section>
</q-item>
</q-list>
</q-menu>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn>
<q-btn flat round color="light-blue" icon="upload">
<q-tooltip>พโหลดไฟล</q-tooltip>
</q-btn>
<q-space />
<q-tabs shrink>
<q-input
borderless
<q-btn color="primary" flat round icon="download">
<q-menu>
<q-list style="min-width: 100px">
<q-item clickable>
<q-item-section avatar>
<q-icon color="red" name="mdi-file-pdf" />
</q-item-section>
<q-item-section>ไฟล .PDF</q-item-section>
</q-item>
<q-item clickable>
<q-item-section avatar>
<q-icon color="green" name="mdi-file-excel" />
</q-item-section>
<q-item-section>ไฟล .xls</q-item-section>
</q-item>
</q-list>
</q-menu>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn>
<q-file
bg-color="white"
outlined
dense
debounce="300"
v-model="filter"
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
v-model="fileUpload"
accept=".pdf"
:style="fileUpload === null ? 'width: 100px' : 'width: auto'"
v-if="statusUpload !== true"
>
<template v-slot:append>
<q-icon name="search" />
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
<q-tooltip>พโหลดไฟล</q-tooltip>
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
>
<!-- <template v-slot:option="{ opt }">
<div>{{ opt.label }}</div>
<div class="sublabel">{{ opt.sublabel }}</div>
</template> -->
</q-select>
</q-tabs>
</q-file>
<q-btn
flat
round
color="light-blue"
icon="upload"
@click="uploadFile(fileUpload)"
v-if="fileUpload !== null"
/>
</div>
<q-space />
<div class="row">
<q-tabs shrink>
<q-input
borderless
outlined
dense
debounce="300"
v-model="filter"
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
>
<!-- <template v-slot:option="{ opt }">
<div>{{ opt.label }}</div>
<div class="sublabel">{{ opt.sublabel }}</div>
</template> -->
</q-select>
</q-tabs>
</div>
</div>
<div>
@ -467,7 +487,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
statusReport === false &&
statusUpload !== true
"
/>
<q-th
@ -476,7 +497,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
statusReport === false &&
statusUpload !== true
"
/>
</q-tr>
@ -553,7 +575,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
statusReport === false &&
statusUpload !== true
"
>
<q-btn
@ -578,7 +601,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
statusReport === false &&
statusUpload !== true
"
>
<q-btn