Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
# Conflicts: # src/stores/mixin.ts
This commit is contained in:
commit
25d9ad97aa
12 changed files with 233 additions and 75 deletions
|
|
@ -12,6 +12,8 @@ import type { ResponseItems } from "@/modules/06_retirement/interface/response/e
|
|||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** use */
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const router = useRouter();
|
||||
|
|
@ -293,6 +295,10 @@ const openModalCalendar = (rows: any) => {
|
|||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
color="blue-9"
|
||||
icon="mdi-square-edit-outline"
|
||||
outline
|
||||
|
|
@ -354,12 +360,41 @@ const openModalCalendar = (rows: any) => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="!props.row.appointDate"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-interview/questionnair-detail/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet && checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!props.row.appointDate && checkPermission($route)?.attrIsGet && checkPermission($route)?.attrIsUpdate"
|
||||
icon="mdi-calendar"
|
||||
size="12px"
|
||||
color="blue-7"
|
||||
flat
|
||||
round
|
||||
|
|
@ -369,25 +404,12 @@ const openModalCalendar = (rows: any) => {
|
|||
<q-tooltip>วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
key="no"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import CardProfile from "@/components/CardProfile.vue";
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "exit-Interview-detailsOnly");
|
||||
const mixin = useCounterMixin();
|
||||
const dataId = route.params.id.toString();
|
||||
const {
|
||||
|
|
@ -326,6 +327,7 @@ const putData = () => {
|
|||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:readonly="checkRoutePermisson"
|
||||
v-model="score[0].score"
|
||||
label="คะแนนข้อ 1"
|
||||
type="number"
|
||||
|
|
@ -345,6 +347,7 @@ const putData = () => {
|
|||
v-if="reasonWork.includes(question1Answer.length - 1)"
|
||||
v-model="reasonWorkOther"
|
||||
disable
|
||||
:readonly="checkRoutePermisson"
|
||||
label="กรอกข้อความ"
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -368,6 +371,7 @@ const putData = () => {
|
|||
<div class="col-2">
|
||||
<q-input
|
||||
dense
|
||||
:readonly="checkRoutePermisson"
|
||||
outlined
|
||||
v-model="score[1].score"
|
||||
label="คะแนนข้อ 2"
|
||||
|
|
@ -394,6 +398,7 @@ const putData = () => {
|
|||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:readonly="checkRoutePermisson"
|
||||
v-model="score[2].score"
|
||||
label="คะแนนข้อ 3"
|
||||
type="number"
|
||||
|
|
@ -416,6 +421,7 @@ const putData = () => {
|
|||
dense
|
||||
disable
|
||||
lazy-rules
|
||||
:readonly="checkRoutePermisson"
|
||||
type="text"
|
||||
autogrow
|
||||
hide-bottom-space
|
||||
|
|
@ -436,6 +442,7 @@ const putData = () => {
|
|||
<div class="col-2">
|
||||
<q-input
|
||||
dense
|
||||
:readonly="checkRoutePermisson"
|
||||
outlined
|
||||
v-model="score[3].score"
|
||||
label="คะแนนข้อ 4"
|
||||
|
|
@ -459,6 +466,7 @@ const putData = () => {
|
|||
dense
|
||||
disable
|
||||
lazy-rules
|
||||
:readonly="checkRoutePermisson"
|
||||
type="text"
|
||||
autogrow
|
||||
hide-bottom-space
|
||||
|
|
@ -480,6 +488,7 @@ const putData = () => {
|
|||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:readonly="checkRoutePermisson"
|
||||
v-model="score[4].score"
|
||||
label="คะแนนข้อ 5"
|
||||
type="number"
|
||||
|
|
@ -508,6 +517,7 @@ const putData = () => {
|
|||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:readonly="checkRoutePermisson"
|
||||
v-model="score[5].score"
|
||||
label="คะแนนข้อ 6"
|
||||
type="number"
|
||||
|
|
@ -536,6 +546,7 @@ const putData = () => {
|
|||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:readonly="checkRoutePermisson"
|
||||
v-model="score[6].score"
|
||||
label="คะแนนข้อ 7"
|
||||
type="number"
|
||||
|
|
@ -558,6 +569,7 @@ const putData = () => {
|
|||
label="กรอกอื่นๆ"
|
||||
dense
|
||||
disable
|
||||
:readonly="checkRoutePermisson"
|
||||
lazy-rules
|
||||
type="text"
|
||||
autogrow
|
||||
|
|
@ -580,6 +592,7 @@ const putData = () => {
|
|||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:readonly="checkRoutePermisson"
|
||||
v-model="score[7].score"
|
||||
label="คะแนนข้อ 8"
|
||||
type="number"
|
||||
|
|
@ -603,6 +616,7 @@ const putData = () => {
|
|||
dense
|
||||
lazy-rules
|
||||
disable
|
||||
:readonly="checkRoutePermisson"
|
||||
type="text"
|
||||
autogrow
|
||||
hide-bottom-space
|
||||
|
|
@ -625,6 +639,7 @@ const putData = () => {
|
|||
dense
|
||||
outlined
|
||||
v-model="score[8].score"
|
||||
:readonly="checkRoutePermisson"
|
||||
label="คะแนนข้อ 9"
|
||||
type="number"
|
||||
lazy-rules
|
||||
|
|
@ -645,6 +660,7 @@ const putData = () => {
|
|||
label="กรอกข้อความ"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="checkRoutePermisson"
|
||||
type="text"
|
||||
autogrow
|
||||
hide-bottom-space
|
||||
|
|
@ -668,6 +684,7 @@ const putData = () => {
|
|||
dense
|
||||
outlined
|
||||
v-model="score[9].score"
|
||||
:readonly="checkRoutePermisson"
|
||||
label="คะแนนข้อ 10"
|
||||
type="number"
|
||||
lazy-rules
|
||||
|
|
@ -1050,6 +1067,8 @@ const putData = () => {
|
|||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
:readonly="checkRoutePermisson"
|
||||
hide-bottom-space
|
||||
v-model="comment"
|
||||
label="กรอกความคิดเห็น"
|
||||
type="textarea"
|
||||
|
|
@ -1068,9 +1087,9 @@ const putData = () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-12" v-if="!checkRoutePermisson"><q-separator /></div>
|
||||
|
||||
<q-card-actions class="col-12 text-primary q-pa-md">
|
||||
<q-card-actions class="col-12 text-primary q-pa-md" v-if="!checkRoutePermisson">
|
||||
<q-space />
|
||||
<q-btn
|
||||
unelevated
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
/** use */
|
||||
const RetirementData = useRetirementDataStore();
|
||||
const { statusText } = RetirementData;
|
||||
|
|
@ -240,8 +240,11 @@ const pagination = ref({
|
|||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
@click="openModalOrder"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
|
|
@ -301,18 +304,44 @@ const pagination = ref({
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width></q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.id"
|
||||
@click="router.push(`/retirement/resign/${props.row.id}`)"
|
||||
>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click="
|
||||
router.push(`/retirement/resign-detail/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
@click="router.push(`/retirement/resign/${props.row.id}`)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ const personId = ref<string>("");
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailbyid");
|
||||
const mixin = useCounterMixin();
|
||||
const RetirementData = useRetirementDataStore();
|
||||
const {
|
||||
|
|
@ -748,7 +749,11 @@ function removeFile(fileName: string) {
|
|||
<q-space />
|
||||
|
||||
<div
|
||||
v-if="dataDetail.status == 'WAITTING' && roleUser === 'officer'"
|
||||
v-if="
|
||||
dataDetail.status == 'WAITTING' &&
|
||||
roleUser === 'officer' &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
>
|
||||
<div v-if="!conditions">
|
||||
<q-btn
|
||||
|
|
@ -828,7 +833,11 @@ function removeFile(fileName: string) {
|
|||
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
|
||||
<div class="col-12 row">
|
||||
<q-file
|
||||
v-if="dataDetail.status == 'WAITTING' && roleUser === 'officer'"
|
||||
v-if="
|
||||
dataDetail.status == 'WAITTING' &&
|
||||
roleUser === 'officer' &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
class="col-12"
|
||||
for="#evidenceFiles"
|
||||
outlined
|
||||
|
|
@ -884,7 +893,8 @@ function removeFile(fileName: string) {
|
|||
<q-btn
|
||||
v-if="
|
||||
dataDetail.status == 'WAITTING' &&
|
||||
roleUser === 'officer'
|
||||
roleUser === 'officer' &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
dense
|
||||
flat
|
||||
|
|
@ -1054,7 +1064,7 @@ function removeFile(fileName: string) {
|
|||
</div>
|
||||
<q-space />
|
||||
|
||||
<div v-if="roleUser === 'officer'">
|
||||
<div v-if="roleUser === 'officer' && !checkRoutePermisson">
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const resign = () =>
|
|||
import("@/modules/06_retirement/components/resign/Resign.vue");
|
||||
const resignByid = () =>
|
||||
import("@/modules/06_retirement/components/resign/ResignByid.vue");
|
||||
const resignDetailbyid = () =>
|
||||
import("@/modules/06_retirement/components/resign/ResignByid.vue");
|
||||
const deceased = () =>
|
||||
import("@/modules/06_retirement/components/resign/Deceased.vue");
|
||||
const detaildeceased = () =>
|
||||
|
|
@ -36,6 +38,8 @@ const exitInterviewMain = () =>
|
|||
import("@/modules/06_retirement/components/ExitInterview/exitMain.vue");
|
||||
const exitInterviewDetails = () =>
|
||||
import("@/modules/06_retirement/components/ExitInterview/exitRegistry.vue");
|
||||
const exitInterviewDetailsOnly = () =>
|
||||
import("@/modules/06_retirement/components/ExitInterview/exitRegistry.vue");
|
||||
const exitInterviewEditQuestion = () =>
|
||||
import("@/modules/06_retirement/components/ExitInterview/EditQuestion.vue");
|
||||
const detaildeceasedByid = () =>
|
||||
|
|
@ -102,6 +106,16 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/exit-interview/questionnair-detail/:id",
|
||||
name: "exit-Interview-detailsOnly",
|
||||
component: exitInterviewDetailsOnly,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RESIGN_INTERVIEW",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/exit-interview/edit-question",
|
||||
name: "ExitInterviewEditQuestion",
|
||||
|
|
@ -132,6 +146,16 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/resign-detail/:id",
|
||||
name: "resignDetailbyid",
|
||||
component: resignDetailbyid,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RESIGN",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
// {
|
||||
// path: "/retirement/resign-order",
|
||||
// name: "resign-order",
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ const {
|
|||
messageError,
|
||||
hideLoader,
|
||||
showLoader,
|
||||
downloadRenameFileByLink
|
||||
} = mixin;
|
||||
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
|
|
@ -140,13 +141,6 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิดลิงค์ไฟล์
|
||||
* @param link รับมาเป็น https ลิงค์
|
||||
*/
|
||||
function downloadFile(link: string) {
|
||||
window.open(link, "_blank");
|
||||
}
|
||||
|
||||
/**
|
||||
* ลบไฟล์
|
||||
|
|
@ -434,7 +428,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
ref="respondentTypeRef"
|
||||
dense
|
||||
outlined
|
||||
:readonly="isReadonly ||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
label="ผู้ถูกร้องเรียน"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
|
@ -674,7 +668,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
ref="descriptionRef"
|
||||
dense
|
||||
outlined
|
||||
:readonly="isReadonly|| checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
hide-bottom-space
|
||||
v-model="formData.description"
|
||||
label="รายละเอียดเรื่องร้องเรียน"
|
||||
|
|
@ -691,7 +685,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:readonly="isReadonly|| checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
|
|
@ -709,7 +703,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
outlined
|
||||
dense
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly|| checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
hide-bottom-space
|
||||
:model-value="
|
||||
formData.dateReceived != null
|
||||
|
|
@ -741,7 +735,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
ref="levelConsiderationRef"
|
||||
dense
|
||||
outlined
|
||||
:readonly="isReadonly|| checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
v-model="formData.levelConsideration"
|
||||
:options="complainstStore.levelConsiderationtOptions"
|
||||
label="ระดับการพิจารณา"
|
||||
|
|
@ -764,7 +758,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
v-model="formData.dateConsideration"
|
||||
@update:model-value="changeFormData()"
|
||||
:locale="'th'"
|
||||
:readonly="isReadonly|| checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
|
|
@ -788,7 +782,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
? date2Thai(formData.dateConsideration)
|
||||
: null
|
||||
"
|
||||
:readonly="isReadonly|| checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
label="วันที่กำหนดพิจารณา"
|
||||
hide-bottom-space
|
||||
>
|
||||
|
|
@ -801,7 +795,11 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
</q-icon>
|
||||
</template>
|
||||
<template
|
||||
v-if="formData.dateConsideration && !isReadonly && !checkRoutePermisson"
|
||||
v-if="
|
||||
formData.dateConsideration &&
|
||||
!isReadonly &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
<q-icon
|
||||
|
|
@ -824,7 +822,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
ref="offenseDetailsRef"
|
||||
dense
|
||||
outlined
|
||||
:readonly="isReadonly|| checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
v-model="formData.offenseDetails"
|
||||
:options="mainStore.offenseDetailstOptions"
|
||||
label="ลักษณะความผิด"
|
||||
|
|
@ -844,7 +842,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
v-model="formData.dateNotification"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
|
|
@ -863,7 +861,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
outlined
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
hide-bottom-space
|
||||
:model-value="
|
||||
formData.dateNotification != null
|
||||
|
|
@ -881,7 +879,11 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
</q-icon>
|
||||
</template>
|
||||
<template
|
||||
v-if="formData.dateNotification && !isReadonly && !checkRoutePermisson"
|
||||
v-if="
|
||||
formData.dateNotification &&
|
||||
!isReadonly &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
<q-icon
|
||||
|
|
@ -924,7 +926,7 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
dense
|
||||
outlined
|
||||
v-model="formData.appellant"
|
||||
:readonly="isReadonly ||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
label="ผู้ร้องเรียน"
|
||||
hide-bottom-space
|
||||
type="textarea"
|
||||
|
|
@ -975,7 +977,11 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
|
||||
<div
|
||||
v-if="!checkRoutePermisson && !isReadonly && formData.id !== ''"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
!isReadonly &&
|
||||
formData.id !== ''
|
||||
"
|
||||
class="col-12 row"
|
||||
>
|
||||
<q-file
|
||||
|
|
@ -1034,7 +1040,9 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
dense
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(data.pathName)"
|
||||
@click="
|
||||
downloadRenameFileByLink(data.pathName, data.fileName)
|
||||
"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
|
|
@ -1067,7 +1075,10 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
</div>
|
||||
|
||||
<div class="col-12" v-if="!checkRoutePermisson"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-sm" v-if="!isReadonly && !checkRoutePermisson">
|
||||
<div
|
||||
class="row col-12 q-pa-sm"
|
||||
v-if="!isReadonly && !checkRoutePermisson"
|
||||
>
|
||||
<q-space />
|
||||
<q-btn
|
||||
for="ButtonOnSubmit"
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ const {
|
|||
success,
|
||||
messageError,
|
||||
dialogRemove,
|
||||
downloadRenameFileByLink
|
||||
} = mixin;
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
const countNum = ref<number>(1);
|
||||
|
|
@ -1553,7 +1554,7 @@ onMounted(async () => {
|
|||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadFileRelevant(file.pathName)"
|
||||
@click="downloadRenameFileByLink(file.pathName, file.fileName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -1657,7 +1658,7 @@ onMounted(async () => {
|
|||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadFile(file.pathName)"
|
||||
@click="downloadRenameFileByLink(file.pathName, file.fileName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ const {
|
|||
messageError,
|
||||
showLoader,
|
||||
dialogRemove,
|
||||
downloadRenameFileByLink
|
||||
} = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
|
@ -600,7 +601,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
dense
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(data.pathName)"
|
||||
@click="downloadRenameFileByLink(data.pathName,data.fileName)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
const $q = useQuasar();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, success, messageError, dialogRemove } = mixin;
|
||||
const { showLoader, hideLoader, success, messageError, dialogRemove ,downloadRenameFileByLink} = mixin;
|
||||
|
||||
const fileRef = ref<Object | null>(null);
|
||||
const file = ref<any>();
|
||||
|
|
@ -186,7 +186,7 @@ function downloadFile(link: string) {
|
|||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadFile(f.pathName)"
|
||||
@click="downloadRenameFileByLink(f.pathName,f.fileName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสาร</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -96,10 +96,18 @@ function onSubmit() {
|
|||
function inputEdit(val: boolean) {
|
||||
return {
|
||||
"full-width cursor-pointer inputgreen ": val,
|
||||
"full-width cursor-pointer inputgreen": !val,
|
||||
"full-width cursor-pointer ": !val,
|
||||
};
|
||||
}
|
||||
|
||||
function onUpdatePeriod(val: string) {
|
||||
if (val === "SPECIAL") {
|
||||
isActive.value = true;
|
||||
} else {
|
||||
isActive.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** callbackFunction ทำการ fetch ข้อมูลไฟล์เมื่อเปิด Dialog*/
|
||||
watch(
|
||||
() => modal.value,
|
||||
|
|
@ -137,6 +145,7 @@ watch(
|
|||
<div class="q-gutter-y-sm">
|
||||
<datepicker
|
||||
:readonly="isRead"
|
||||
:class="inputEdit(!isRead)"
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
class="col-2"
|
||||
|
|
@ -152,9 +161,9 @@ watch(
|
|||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="isRead"
|
||||
:class="inputEdit(!isRead)"
|
||||
ref="yearRef"
|
||||
dense
|
||||
:class="inputEdit(isReadonly)"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
:model-value="year === 0 ? null : Number(year) + 543"
|
||||
|
|
@ -176,7 +185,7 @@ watch(
|
|||
<q-select
|
||||
:readonly="isRead"
|
||||
ref="periodRef"
|
||||
:class="inputEdit(isReadonly)"
|
||||
:class="inputEdit(!isRead)"
|
||||
v-model="period"
|
||||
label="รอบการขึ้นเงินเดือน"
|
||||
dense
|
||||
|
|
@ -189,6 +198,7 @@ watch(
|
|||
lazy-rules
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกรอบการขึ้นเงินเดือน'}`]"
|
||||
hide-bottom-space
|
||||
@update:model-value="onUpdatePeriod"
|
||||
/>
|
||||
<datepicker
|
||||
:readonly="isRead"
|
||||
|
|
@ -212,7 +222,7 @@ watch(
|
|||
ref="effectiveDateRef"
|
||||
outlined
|
||||
dense
|
||||
:class="inputEdit(isReadonly)"
|
||||
:class="inputEdit(!isRead)"
|
||||
:readonly="isRead"
|
||||
hide-bottom-space
|
||||
:model-value="
|
||||
|
|
@ -246,6 +256,7 @@ watch(
|
|||
type="checkbox"
|
||||
v-model="isActive"
|
||||
:readonly="isRead"
|
||||
:disabled="period === 'SPECIAL'"
|
||||
/>
|
||||
<span class="control"></span>
|
||||
</label>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted } from "vue";
|
||||
import { useSalaryDataStore } from "@/modules/13_salary/store/SalaryStore";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -294,11 +295,10 @@ onMounted(async () => {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="checkPermission($route)?.attrIsCreate">
|
||||
<q-btn
|
||||
id="addComplaints"
|
||||
for="addComplaints"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
|
|
@ -370,19 +370,28 @@ onMounted(async () => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet ||
|
||||
(checkPermission($route)?.attrIsUpdate &&
|
||||
props.row.isClose !== true) ||
|
||||
(checkPermission($route)?.attrIsDelete &&
|
||||
props.row.revisionId == null) ||
|
||||
(checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate)
|
||||
"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
size="12px"
|
||||
color="secondary"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
round
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="
|
||||
|
|
@ -397,14 +406,14 @@ onMounted(async () => {
|
|||
color="edit"
|
||||
size="17px"
|
||||
:name="
|
||||
props.row.revisionId !== null
|
||||
props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate
|
||||
? 'mdi-eye-outline'
|
||||
: 'edit'
|
||||
"
|
||||
/>
|
||||
<div class="q-pl-md">
|
||||
{{
|
||||
props.row.revisionId !== null
|
||||
props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate
|
||||
? "ดูข้อมูล"
|
||||
: "แก้ไขข้อมูล"
|
||||
}}
|
||||
|
|
@ -417,7 +426,8 @@ onMounted(async () => {
|
|||
v-if="
|
||||
props.row.isClose === false &&
|
||||
props.row.isActive === true &&
|
||||
props.row.revisionId !== null
|
||||
props.row.revisionId !== null &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -435,7 +445,10 @@ onMounted(async () => {
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="props.row.revisionId == null"
|
||||
v-if="
|
||||
props.row.revisionId == null &&
|
||||
checkPermission($route)?.attrIsDelete
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="deleteData(props.row.id)"
|
||||
|
|
|
|||
|
|
@ -1068,6 +1068,22 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
: "";
|
||||
}
|
||||
|
||||
function downloadRenameFileByLink(link: string, fileName: string) {
|
||||
fetch(link)
|
||||
.then((response) => response.blob())
|
||||
.then((blob) => {
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = fileName; // ชื่อไฟล์
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
})
|
||||
.catch((error) => console.error("ดาวน์โหลดไฟล์ไม่สำเร็จ:", error));
|
||||
}
|
||||
|
||||
return {
|
||||
calAge,
|
||||
date2Thai,
|
||||
|
|
@ -1110,5 +1126,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
findPosMasterNo,
|
||||
findPosMasterNoOld,
|
||||
pathRegistryEmp,
|
||||
downloadRenameFileByLink,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue