no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-15 15:42:23 +07:00
parent ab24770899
commit 67d62541f6
9 changed files with 988 additions and 1362 deletions

View file

@ -15,11 +15,8 @@ const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success, dialogConfirm } = mixin;
// const type_params = route.params.type;
// const year_params = route.params.year;
const retireld_params = route.params.retirementId;
const orderCoverDocs = ref<string>("");
const orderCoverPdf = ref<string>("");
const modalNote = ref<boolean>(false);
const note = ref<string>("");
const retireProfileId = ref<string>("");
@ -40,15 +37,6 @@ const columns = ref<any["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
/* {
name: "fixname",
align: "left",
label: "คำนำหน้านาม",
title: "คำนำหน้านาม",
field: "fixname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
}, */
{
name: "name",
align: "left",
@ -158,8 +146,6 @@ const fileUpload = ref<any>(null);
onMounted(() => {
retireld.value = retireld_params.toString();
fecthlistprofile(retireld.value);
// fetchReportCover("pdf", retireld.value);
// fetchReportCover("docx", retireld.value);
});
const closeDialog = () => {
@ -247,8 +233,8 @@ const clickDelete = () => {
modalNote.value = false;
});
})
.onCancel(() => { })
.onDismiss(() => { });
.onCancel(() => {})
.onDismiss(() => {});
};
// note
// const fetchReason = async (prop: string) => {
@ -293,8 +279,8 @@ const saveNote = () => {
modalNote.value = false;
});
})
.onCancel(() => { })
.onDismiss(() => { });
.onCancel(() => {})
.onDismiss(() => {});
};
const UpdateListId = (retireld: string, pId: string) => {
@ -362,30 +348,6 @@ const downloadFile = (response: any, filename: string) => {
document.body.removeChild(link);
};
// const fetchReportCover = async (type: string, orderId: string) => {
// showLoader();
// await http
// .get(config.API.reportRetireList(type, orderId))
// .then(async (res) => {
// if (type == "pdf") {
// orderCoverPdf.value = res.data.result;
// } else {
// orderCoverDocs.value = res.data.result;
// }
// })
// .catch((e) => {
// // messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// };
// const classrow = (prop: any) => {
// if (profileId.value !== "" && prop.profileId === profileId.value) {
// return "color: #26a69a;";
// } else return "";
// };
const saveEdiitReport = (reason: string) => {
const formdata = new FormData();
formdata.append("Detail", reason);
@ -431,77 +393,154 @@ const paginationLabel = (start: number, end: number, total: number) => {
<template>
<div class="toptitle text-dark col-12 row items-center">
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="backHistory" />
<q-btn
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="backHistory"
/>
รายชอผเกษยณอายราชการ
</div>
<div>
<q-card class="col-12 q-pa-md">
<div class="row col-12 q-pb-sm">
<div class="row">
<AddList :dataProfile="dataProfile" :retireld="retireld" :profile-id="profileId" :UpdateListId="UpdateListId"
v-if="statusReport === false &&
<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-tooltip>นทกขอม</q-tooltip>
</q-btn> -->
"
/>
<q-btn color="primary" flat round icon="mdi-dots-vertical">
<q-menu>
<q-list style="min-width: 100px">
<q-item clickable v-close-popup type="a" @click="openmodalEditReport()" target="_blank">
<q-item-section avatar><q-icon color="primary" name="mdi-pencil" /></q-item-section>
<q-item
clickable
v-close-popup
type="a"
@click="openmodalEditReport()"
target="_blank"
>
<q-item-section avatar
><q-icon color="primary" name="mdi-pencil"
/></q-item-section>
<q-item-section>แกไข มต ... </q-item-section>
</q-item>
<q-separator />
<q-item clickable v-close-popup type="a" @click="downloadAttachment('pdf', retireld)" target="_blank">
<q-item-section avatar><q-icon color="red" name="mdi-file-pdf" /></q-item-section>
<q-item
clickable
v-close-popup
type="a"
@click="downloadAttachment('pdf', retireld)"
target="_blank"
>
<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 v-close-popup type="a" @click="downloadAttachment('docx', retireld)" target="_blank">
<q-item-section avatar><q-icon color="blue" name="mdi-file-word" /></q-item-section>
<q-item
clickable
v-close-popup
type="a"
@click="downloadAttachment('docx', retireld)"
target="_blank"
>
<q-item-section avatar
><q-icon color="blue" name="mdi-file-word"
/></q-item-section>
<q-item-section>ไฟล .docx</q-item-section>
</q-item>
</q-list>
</q-menu>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn>
<q-file bg-color="white" clearable outlined dense v-model="fileUpload" accept=".pdf"
:style="fileUpload === null ? 'width: 150px' : 'width: auto'" label="อัปโหลดไฟล์"
v-if="statusUpload !== true">
<q-file
bg-color="white"
clearable
outlined
dense
v-model="fileUpload"
accept=".pdf"
:style="fileUpload === null ? 'width: 150px' : 'width: auto'"
label="อัปโหลดไฟล์"
v-if="statusUpload !== true"
>
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
<q-tooltip>ปโหลดไฟล</q-tooltip>
</template>
</q-file>
<q-btn flat round color="light-blue" icon="upload" @click="uploadFile(fileUpload)" v-if="fileUpload !== null" />
<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">
<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
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"
>
</q-select>
</q-tabs>
</div>
</div>
<div>
<q-table flat dense bordered :rows="rows" :columns="columns" row-key="order" class="custom-header-table"
:filter="filter" :visible-columns="visibleColumns" no-data-label="ไม่มีข้อมูล"
:pagination-label="paginationLabel" v-model:pagination="pagination">
<q-table
flat
dense
bordered
:rows="rows"
:columns="columns"
row-key="order"
class="custom-header-table"
:filter="filter"
:visible-columns="visibleColumns"
no-data-label="ไม่มีข้อมูล"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
@ -513,30 +552,45 @@ const paginationLabel = (start: number, end: number, total: number) => {
</div>
</q-th>
<q-th auto-width />
<q-th auto-width v-if="(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
" />
<q-th auto-width v-if="(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
" />
<q-th
auto-width
v-if="
(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
"
/>
<q-th
auto-width
v-if="
(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
"
/>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer" :style="props.row.profileId === profileId && 'color: #26a69a;'"
@click.stop="router.push(`/registry/${props.row.profileId}`)">
<q-tr
:props="props"
class="cursor-pointer"
:style="props.row.profileId === profileId && 'color: #26a69a;'"
@click.stop="router.push(`/registry/${props.row.profileId}`)"
>
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
<!-- <q-td key="fixname" :props="props">{{ props.row.fixname }}</q-td> -->
<q-td key="name" :props="props">{{
props.row.fixname + props.row.name
}}</q-td>
<q-td class="table_ellipsis" key="organizationOrganization" :props="props">{{
props.row.organizationOrganization }}</q-td>
<q-td
class="table_ellipsis"
key="organizationOrganization"
:props="props"
>{{ props.row.organizationOrganization }}</q-td
>
<q-td key="positionType" :props="props">{{
props.row.positionType
}}</q-td>
@ -559,39 +613,69 @@ const paginationLabel = (start: number, end: number, total: number) => {
props.row.bureau
}}</q-td>
<q-td auto-width v-if="(typeReport === 'EDIT' ||
<q-td
auto-width
v-if="
(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
">
<q-btn flat round color="primary" icon="mdi-pencil" dense @click.stop="
(modalNote = true),
(note = props.row.reason),
(action = 'edit'),
(retireProfileId = props.row.id)
">
"
>
<q-btn
flat
round
color="primary"
icon="mdi-pencil"
dense
@click.stop="
(modalNote = true),
(note = props.row.reason),
(action = 'edit'),
(retireProfileId = props.row.id)
"
>
<q-tooltip>กรอกเหตผล</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width v-if="(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
">
<q-btn flat round class="text-red-14" icon="mdi-delete" dense @click.stop="
(modalNote = true),
(action = 'delete'),
(note = props.row.reason),
(retireProfileId = props.row.id)
"><q-tooltip>ลบขอม</q-tooltip></q-btn>
<q-td
auto-width
v-if="
(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
"
>
<q-btn
flat
round
class="text-red-14"
icon="mdi-delete"
dense
@click.stop="
(modalNote = true),
(action = 'delete'),
(note = props.row.reason),
(retireProfileId = props.row.id)
"
><q-tooltip>ลบขอม</q-tooltip></q-btn
>
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
<q-pagination v-model="pagination.page" color="primary" :max="scope.pagesNumber" :max-pages="5" size="sm"
boundary-links direction-links></q-pagination>
<q-pagination
v-model="pagination.page"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
</q-table>
</div>
@ -600,29 +684,52 @@ const paginationLabel = (start: number, end: number, total: number) => {
<!-- note -->
<q-dialog v-model="modalNote">
<q-card style="width: 50vw;">
<q-card style="width: 50vw">
<DialogHeader tittle="กรอกเหตุผล" :close="closeDialog" />
<q-separator />
<q-card-section class="q-pt-none bg-grey-1">
<div class="row q-col-gutter-sm">
<div class="col-12">
<q-input outlined dense lazy-rules v-model="note" :rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
:label="`${'กรอกเหตุผล'}`" type="textarea" />
<q-input
outlined
dense
lazy-rules
v-model="note"
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
:label="`${'กรอกเหตุผล'}`"
type="textarea"
/>
</div>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn v-if="action === 'delete'" label="บันทึก" color="secondary" :disable="visibleNote" @click="clickDelete" />
<q-btn v-else label="บักทึก" color="secondary" @click="saveNote" :disable="visibleNote" />
<q-btn
v-if="action === 'delete'"
label="บันทึก"
color="secondary"
:disable="visibleNote"
@click="clickDelete"
/>
<q-btn
v-else
label="บักทึก"
color="secondary"
@click="saveNote"
:disable="visibleNote"
/>
</q-card-actions>
</q-card>
</q-dialog>
<DialogPopupReason :modal="modalEdit" title="แก้ไขมติ อ.ก.ก." label="มติ อ.ก.ก." :click-close="closemodalEditReport"
:savaForm="saveEdiitReport" :textReport="textReport" />
<DialogPopupReason
:modal="modalEdit"
title="แก้ไขมติ อ.ก.ก."
label="มติ อ.ก.ก."
:click-close="closemodalEditReport"
:savaForm="saveEdiitReport"
:textReport="textReport"
/>
</template>
<style lang="scss" scope>