Merge branch 'develop' into nice

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-13 11:49:12 +07:00
commit e422ef250c
38 changed files with 349 additions and 203 deletions

View file

@ -22,7 +22,7 @@ const retireDate = ref<Date>();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const isEmployee = defineModel("isEmployee", { type: String }); const isEmployee = defineModel("isEmployee", { type: String });
const empType = ref<string>(""); const empType = ref<string>("officer");
/** props*/ /** props*/
const props = defineProps({ const props = defineProps({
id: { id: {
@ -95,7 +95,12 @@ function calculateAge(birthDate: Date | null) {
async function fetchInformation(id: string) { async function fetchInformation(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.orgProfileById(id, empType.value)) .get(
config.API.orgProfileById(
id,
`${empType.value == "employee" ? `-${empType.value}` : ""}`
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
imformation.prefix = data.prefix ? data.prefix : "-"; imformation.prefix = data.prefix ? data.prefix : "-";
@ -128,7 +133,12 @@ async function fetchInformation(id: string) {
async function fetchProfileGov(id: string) { async function fetchProfileGov(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewGovernmentById(id, empType.value)) .get(
config.API.profileNewGovernmentById(
id,
`${empType.value == "employee" ? `-${empType.value}` : ""}`
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
goverment.oc = data.org !== "" ? data.org : "-"; goverment.oc = data.org !== "" ? data.org : "-";
@ -155,7 +165,7 @@ async function fetchProfileGov(id: string) {
} }
function redirecToRegistry() { function redirecToRegistry() {
router.push(`/registry-officer${empType.value}/${props.id}`); router.push(`/registry-${empType.value}/${props.id}`);
modal.value = false; modal.value = false;
} }
@ -168,8 +178,8 @@ watch(
empType.value = empType.value =
route.name === "appoint-employee-detail" || route.name === "appoint-employee-detail" ||
isEmployee.value == "EMPLOYEE" isEmployee.value == "EMPLOYEE"
? "-employee" ? "employee"
: ""; : "officer";
fetchInformation(props.id); fetchInformation(props.id);
fetchProfileGov(props.id); fetchProfileGov(props.id);

View file

@ -19,6 +19,7 @@ const {
messageError, messageError,
success, success,
date2Thai, date2Thai,
pathRegistryEmp,
} = mixin; } = mixin;
const historyDialog = ref<boolean>(false); const historyDialog = ref<boolean>(false);
@ -26,9 +27,7 @@ const mode = ref<string>("table");
const dialog = ref<boolean>(false); const dialog = ref<boolean>(false);
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id.toString()); const id = ref<string>(route.params.id.toString());
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const dialogStatus = ref<string>("create"); const dialogStatus = ref<string>("create");
const editId = ref<string>(""); const editId = ref<string>("");
const keyword = ref<string>(""); const keyword = ref<string>("");

View file

@ -21,13 +21,13 @@ const {
messageError, messageError,
success, success,
date2Thai, date2Thai,
pathRegistryEmp,
} = mixin; } = mixin;
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id.toString()); const id = ref<string>(route.params.id.toString());
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const dialog = ref<boolean>(false); const dialog = ref<boolean>(false);
const mode = ref<string>("table"); const mode = ref<string>("table");
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([

View file

@ -30,13 +30,12 @@ const {
hideLoader, hideLoader,
messageError, messageError,
dialogConfirm, dialogConfirm,
pathRegistryEmp,
} = mixin; } = mixin;
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const id = ref<string>(""); const id = ref<string>("");
const insigniaType = ref<string>(""); const insigniaType = ref<string>("");

View file

@ -22,13 +22,12 @@ const {
showLoader, showLoader,
hideLoader, hideLoader,
dialogConfirm, dialogConfirm,
pathRegistryEmp,
} = mixin; } = mixin;
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const id = ref<string>(""); const id = ref<string>("");
const issueDateYear = ref<number>(0); const issueDateYear = ref<number>(0);

View file

@ -26,13 +26,12 @@ const {
showLoader, showLoader,
hideLoader, hideLoader,
dialogConfirm, dialogConfirm,
pathRegistryEmp,
} = mixin; } = mixin;
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const id = ref<string>(""); const id = ref<string>("");
const resPerformForm = reactive<RequestItemsObject>({ const resPerformForm = reactive<RequestItemsObject>({

View file

@ -27,12 +27,11 @@ const {
showLoader, showLoader,
hideLoader, hideLoader,
success, success,
pathRegistryEmp,
} = mixin; } = mixin;
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id.toString());
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
/** ตัวแปรข้อมูลหลัก */ /** ตัวแปรข้อมูลหลัก */
const formMain = reactive<FormMain>({ const formMain = reactive<FormMain>({
ocId: "", // ocId: "", //

View file

@ -17,12 +17,7 @@ import DialogHistory from "@/modules/04_registryPerson/components/detail/Governm
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
const route = useRoute(); const route = useRoute();
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -32,9 +27,15 @@ const {
hideLoader, hideLoader,
messageError, messageError,
success, success,
pathRegistryEmp,
dialogRemove, dialogRemove,
} = mixin; } = mixin;
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const disciplineData = reactive<RequestItemsObject>({ const disciplineData = reactive<RequestItemsObject>({
date: null, date: null,
level: "", level: "",

View file

@ -19,7 +19,10 @@ const id = defineModel<string>("id", { required: true });
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
mixin;
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const currentPage = ref<number>(1); const currentPage = ref<number>(1);
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
@ -147,9 +150,6 @@ const columns = ref<QTableProps["columns"]>([
}, },
]); ]);
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http

View file

@ -23,12 +23,7 @@ import config from "@/app.config";
const rowsTotal = ref<ResponseTotalObject[]>([]); const rowsTotal = ref<ResponseTotalObject[]>([]);
const id = ref<string>(""); const id = ref<string>("");
const route = useRoute(); const route = useRoute();
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -39,8 +34,14 @@ const {
success, success,
date2Thai, date2Thai,
dateToISO, dateToISO,
pathRegistryEmp,
} = mixin; } = mixin;
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const pagination = ref({ const pagination = ref({
page: 1, page: 1,
rowsPerPage: 10, rowsPerPage: 10,
@ -618,7 +619,6 @@ onMounted(() => {
<q-space /> <q-space />
<div> <div>
<q-btn <q-btn
color="deep-purple" color="deep-purple"
icon="mdi-history" icon="mdi-history"
flat flat

View file

@ -19,11 +19,11 @@ const id = defineModel<string>("id", { required: true });
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
mixin;
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const rows = ref<DetailData[]>([]); //select data history const rows = ref<DetailData[]>([]); //select data history
const formFilter = reactive<FormFilter>({ const formFilter = reactive<FormFilter>({

View file

@ -21,9 +21,7 @@ const route = useRoute();
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -33,8 +31,11 @@ const {
showLoader, showLoader,
hideLoader, hideLoader,
success, success,
pathRegistryEmp,
} = mixin; } = mixin;
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const edit = ref<boolean>(false); const edit = ref<boolean>(false);
const modalHistory = ref<boolean>(false); const modalHistory = ref<boolean>(false);

View file

@ -19,11 +19,11 @@ const id = defineModel<string>("id", { required: true });
const route = useRoute(); const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
mixin;
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const currentPage = ref<number>(1); const currentPage = ref<number>(1);
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");

View file

@ -25,6 +25,7 @@ const {
messageError, messageError,
dialogRemove, dialogRemove,
dialogConfirm, dialogConfirm,
pathRegistryEmp,
} = mixin; } = mixin;
const id = ref<string>(""); const id = ref<string>("");
@ -36,9 +37,8 @@ const pagination = ref({
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const mode = ref<string>("table"); const mode = ref<string>("table");
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const rows = ref<RowList[]>([]); const rows = ref<RowList[]>([]);

View file

@ -21,7 +21,8 @@ const id = defineModel<string>("id", { required: true });
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
mixin;
const historyPagination = ref({ const historyPagination = ref({
page: 1, page: 1,
rowsPerPage: 10, rowsPerPage: 10,
@ -42,9 +43,7 @@ const formFilter = reactive<FormFilter>({
isShowRetire: false, isShowRetire: false,
isProbation: false, isProbation: false,
}); });
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([
"date", "date",

View file

@ -52,7 +52,11 @@ const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee" route.name === "registryNewByid"
? ""
: route.name === "registry-employeeId"
? "-temp"
: "-employee"
); );
const modal = ref<boolean>(false); const modal = ref<boolean>(false);

View file

@ -39,6 +39,7 @@ const {
messageError, messageError,
showLoader, showLoader,
hideLoader, hideLoader,
pathRegistryEmp,
} = useCounterMixin(); } = useCounterMixin();
/** /**
@ -50,9 +51,8 @@ const props = defineProps({
const submitDisable = ref<boolean>(true); const submitDisable = ref<boolean>(true);
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id.toString());
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const editId = ref<string>(""); const editId = ref<string>("");
const dialog = ref<boolean>(false); const dialog = ref<boolean>(false);
const dialogStatus = ref<string>("create"); const dialogStatus = ref<string>("create");

View file

@ -33,13 +33,12 @@ const {
showLoader, showLoader,
hideLoader, hideLoader,
dialogConfirm, dialogConfirm,
pathRegistryEmp,
} = mixin; } = mixin;
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const currentPage = ref<number>(1); const currentPage = ref<number>(1);
const maxPage = ref<number>(1); const maxPage = ref<number>(1);

View file

@ -23,16 +23,20 @@ const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const store = useProfileDataStore(); const store = useProfileDataStore();
const { fetchPerson, filterSelector } = store; const { filterSelector } = store;
const { dialogConfirm, showLoader, hideLoader, messageError, success } = const {
useCounterMixin(); dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
pathRegistryEmp,
} = useCounterMixin();
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
/** TableHisoty*/ /** TableHisoty*/
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([

View file

@ -22,6 +22,7 @@ const {
messageError, messageError,
success, success,
date2Thai, date2Thai,
pathRegistryEmp,
} = mixin; } = mixin;
const dialog = ref<boolean>(false); const dialog = ref<boolean>(false);
@ -402,9 +403,8 @@ const historyRows = ref<ResponseObject[]>([]);
const editId = ref<string>(""); const editId = ref<string>("");
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id.toString()); const id = ref<string>(route.params.id.toString());
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const isDate = ref<string>("false"); const isDate = ref<string>("false");
const educationOption = ref([ const educationOption = ref([
{ label: "ใช่", value: true }, { label: "ใช่", value: true },

View file

@ -22,6 +22,7 @@ const {
messageError, messageError,
success, success,
date2Thai, date2Thai,
pathRegistryEmp,
} = mixin; } = mixin;
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
@ -147,9 +148,8 @@ const rows = ref<ResponseObject[]>([]);
const historyRows = ref<ResponseObject[]>([]); const historyRows = ref<ResponseObject[]>([]);
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id.toString()); const id = ref<string>(route.params.id.toString());
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const editId = ref<string>(""); const editId = ref<string>("");
const keyword = ref<string>(""); const keyword = ref<string>("");
const historyKeyword = ref<string>(""); const historyKeyword = ref<string>("");

View file

@ -26,9 +26,7 @@ const route = useRoute();
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const store = useSalaryDataStore(); const store = useSalaryDataStore();
const { const {
date2Thai, date2Thai,
@ -37,8 +35,11 @@ const {
hideLoader, hideLoader,
messageError, messageError,
success, success,
pathRegistryEmp,
} = useCounterMixin(); } = useCounterMixin();
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const baseColumns = ref<QTableProps["columns"]>([ const baseColumns = ref<QTableProps["columns"]>([
{ {
name: "date", name: "date",
@ -609,9 +610,8 @@ const classInput = (val: boolean) => {
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width v-if="checkPermission($route)?.attrIsUpdate" />
<q-th auto-width v-if="checkPermission($route)?.attrIsUpdate" />
<q-th auto-width /> <q-th auto-width />
<q-th v-if="checkPermission($route)?.attrIsUpdate" auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
@ -619,31 +619,7 @@ const classInput = (val: boolean) => {
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props"> <q-tr :props="props">
<q-td auto-width v-if="checkPermission($route)?.attrIsUpdate"> <q-td>
<q-btn
dense
flat
round
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
:disable="props.rowIndex + 1 == 1"
icon="mdi-arrow-up-bold"
@click="onSwapUp(props.row.id)"
>
</q-btn>
</q-td>
<q-td auto-width v-if="checkPermission($route)?.attrIsUpdate">
<q-btn
dense
flat
round
:color="rows.length == props.rowIndex + 1 ? 'grey' : 'red'"
:disable="rows.length == props.rowIndex + 1"
icon="mdi-arrow-down-bold"
@click="onSwapDown(props.row.id)"
>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn <q-btn
flat flat
dense dense
@ -668,6 +644,29 @@ const classInput = (val: boolean) => {
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>
<q-td v-if="checkPermission($route)?.attrIsUpdate">
<q-btn
dense
flat
round
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
:disable="props.rowIndex + 1 == 1"
icon="mdi-arrow-up-bold"
@click="onSwapUp(props.row.id)"
>
</q-btn>
<q-btn
dense
flat
round
:color="rows.length == props.rowIndex + 1 ? 'grey' : 'red'"
:disable="rows.length == props.rowIndex + 1"
icon="mdi-arrow-down-bold"
@click="onSwapDown(props.row.id)"
>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
<div class="table_ellipsis"> <div class="table_ellipsis">
{{ col.value ? col.value : "-" }} {{ col.value ? col.value : "-" }}

View file

@ -20,11 +20,10 @@ const {
hideLoader, hideLoader,
messageError, messageError,
success, success,
pathRegistryEmp,
} = useCounterMixin(); } = useCounterMixin();
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const salaryId = defineModel<string>("salaryId", { required: true }); const salaryId = defineModel<string>("salaryId", { required: true });

View file

@ -24,14 +24,13 @@ const {
messageError, messageError,
success, success,
dialogRemove, dialogRemove,
pathRegistryEmp,
} = useCounterMixin(); } = useCounterMixin();
const id = ref<string>(""); const id = ref<string>("");
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const modelView = ref<string>("table"); const modelView = ref<string>("table");
const modalDialog = ref<boolean>(false); const modalDialog = ref<boolean>(false);

View file

@ -14,11 +14,10 @@ import DialogHeader from "@/components/DialogHeader.vue";
const route = useRoute(); const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
mixin;
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const id = defineModel<string>("id", { required: true }); const id = defineModel<string>("id", { required: true });

View file

@ -40,6 +40,7 @@ const {
date2Thai, date2Thai,
dateToISO, dateToISO,
dialogMessageNotify, dialogMessageNotify,
pathRegistryEmp,
} = useCounterMixin(); } = useCounterMixin();
/** ถึงเเก่กรรม */ /** ถึงเเก่กรรม */
@ -53,9 +54,7 @@ const reasonDeath = ref("");
const dialogImage = ref<boolean>(false); const dialogImage = ref<boolean>(false);
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id.toString());
const empType = ref<string>( const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
route.name === "registryNewByid" ? "" : "-employee"
);
const formDetail = ref<ResponseObject>(); const formDetail = ref<ResponseObject>();
const itemsMenu = ref<DataOption[]>([ const itemsMenu = ref<DataOption[]>([

View file

@ -710,14 +710,7 @@ function onSave(data: any) {
</q-menu> </q-menu>
</q-btn> </q-btn>
</q-td> </q-td>
<q-td <q-td v-for="col in props.cols" :key="col.name" :props="props">
v-for="col in props.cols"
:key="col.name"
:props="props"
@click="
checkPermission($route)?.attrIsGet && nextPage(props.row.id)
"
>
<div v-if="col.name == 'no'"> <div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</div> </div>

View file

@ -277,7 +277,7 @@ const putData = () => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
router.push(`/exit-Interview`); router.push(`/retirement/exit-interview`);
}); });
}; };
</script> </script>

View file

@ -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 DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import { checkPermission } from "@/utils/permissions";
/** use */ /** use */
const $q = useQuasar(); // noti quasar const $q = useQuasar(); // noti quasar
const router = useRouter(); const router = useRouter();
@ -293,10 +295,14 @@ const openModalCalendar = (rows: any) => {
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div> <div>
<q-btn <q-btn
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
color="blue-9" color="blue-9"
icon="mdi-square-edit-outline" icon="mdi-square-edit-outline"
outline outline
@click="$router.push('/retirement/exit-Interview/edit-question')" @click="$router.push('/retirement/exit-interview/edit-question')"
><span class="q-pl-sm">แกไขคำถาม</span></q-btn ><span class="q-pl-sm">แกไขคำถาม</span></q-btn
> >
</div> </div>
@ -354,12 +360,41 @@ const openModalCalendar = (rows: any) => {
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props">
<q-td auto-width> <q-td auto-width>
<q-btn <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" icon="mdi-calendar"
size="12px"
color="blue-7" color="blue-7"
flat flat
round round
@ -369,25 +404,12 @@ const openModalCalendar = (rows: any) => {
<q-tooltip>นนดหมายเพอทาการสมภาษณการลาออก</q-tooltip> <q-tooltip>นนดหมายเพอทาการสมภาษณการลาออก</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>
<q-td <q-td key="no" :props="props">
key="no"
:props="props"
@click="
router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}`
)
"
>
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</q-td> </q-td>
<q-td <q-td
key="fullname" key="fullname"
:props="props" :props="props"
@click="
router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}`
)
"
> >
{{ props.row.fullname }} {{ props.row.fullname }}
</q-td> </q-td>
@ -396,7 +418,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >
@ -407,7 +429,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >
@ -418,7 +440,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >
@ -429,7 +451,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >
@ -440,7 +462,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >
@ -452,7 +474,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >
@ -465,7 +487,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >
@ -478,7 +500,7 @@ const openModalCalendar = (rows: any) => {
:props="props" :props="props"
@click=" @click="
router.push( router.push(
`/retirement/exit-Interview/questionnair/${props.row.id}` `/retirement/exit-interview/questionnair/${props.row.id}`
) )
" "
> >

View file

@ -23,6 +23,7 @@ import CardProfile from "@/components/CardProfile.vue";
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const checkRoutePermisson = ref<boolean>(route.name == "exit-Interview-detailsOnly");
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataId = route.params.id.toString(); const dataId = route.params.id.toString();
const { const {
@ -278,7 +279,7 @@ const putData = () => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
router.push(`/exit-Interview`); router.push(`/retirement/exit-interview`);
}); });
}; };
</script> </script>
@ -326,6 +327,7 @@ const putData = () => {
<q-input <q-input
dense dense
outlined outlined
:readonly="checkRoutePermisson"
v-model="score[0].score" v-model="score[0].score"
label="คะแนนข้อ 1" label="คะแนนข้อ 1"
type="number" type="number"
@ -345,6 +347,7 @@ const putData = () => {
v-if="reasonWork.includes(question1Answer.length - 1)" v-if="reasonWork.includes(question1Answer.length - 1)"
v-model="reasonWorkOther" v-model="reasonWorkOther"
disable disable
:readonly="checkRoutePermisson"
label="กรอกข้อความ" label="กรอกข้อความ"
dense dense
lazy-rules lazy-rules
@ -368,6 +371,7 @@ const putData = () => {
<div class="col-2"> <div class="col-2">
<q-input <q-input
dense dense
:readonly="checkRoutePermisson"
outlined outlined
v-model="score[1].score" v-model="score[1].score"
label="คะแนนข้อ 2" label="คะแนนข้อ 2"
@ -394,6 +398,7 @@ const putData = () => {
<q-input <q-input
dense dense
outlined outlined
:readonly="checkRoutePermisson"
v-model="score[2].score" v-model="score[2].score"
label="คะแนนข้อ 3" label="คะแนนข้อ 3"
type="number" type="number"
@ -416,6 +421,7 @@ const putData = () => {
dense dense
disable disable
lazy-rules lazy-rules
:readonly="checkRoutePermisson"
type="text" type="text"
autogrow autogrow
hide-bottom-space hide-bottom-space
@ -436,6 +442,7 @@ const putData = () => {
<div class="col-2"> <div class="col-2">
<q-input <q-input
dense dense
:readonly="checkRoutePermisson"
outlined outlined
v-model="score[3].score" v-model="score[3].score"
label="คะแนนข้อ 4" label="คะแนนข้อ 4"
@ -459,6 +466,7 @@ const putData = () => {
dense dense
disable disable
lazy-rules lazy-rules
:readonly="checkRoutePermisson"
type="text" type="text"
autogrow autogrow
hide-bottom-space hide-bottom-space
@ -480,6 +488,7 @@ const putData = () => {
<q-input <q-input
dense dense
outlined outlined
:readonly="checkRoutePermisson"
v-model="score[4].score" v-model="score[4].score"
label="คะแนนข้อ 5" label="คะแนนข้อ 5"
type="number" type="number"
@ -508,6 +517,7 @@ const putData = () => {
<q-input <q-input
dense dense
outlined outlined
:readonly="checkRoutePermisson"
v-model="score[5].score" v-model="score[5].score"
label="คะแนนข้อ 6" label="คะแนนข้อ 6"
type="number" type="number"
@ -536,6 +546,7 @@ const putData = () => {
<q-input <q-input
dense dense
outlined outlined
:readonly="checkRoutePermisson"
v-model="score[6].score" v-model="score[6].score"
label="คะแนนข้อ 7" label="คะแนนข้อ 7"
type="number" type="number"
@ -558,6 +569,7 @@ const putData = () => {
label="กรอกอื่นๆ" label="กรอกอื่นๆ"
dense dense
disable disable
:readonly="checkRoutePermisson"
lazy-rules lazy-rules
type="text" type="text"
autogrow autogrow
@ -580,6 +592,7 @@ const putData = () => {
<q-input <q-input
dense dense
outlined outlined
:readonly="checkRoutePermisson"
v-model="score[7].score" v-model="score[7].score"
label="คะแนนข้อ 8" label="คะแนนข้อ 8"
type="number" type="number"
@ -603,6 +616,7 @@ const putData = () => {
dense dense
lazy-rules lazy-rules
disable disable
:readonly="checkRoutePermisson"
type="text" type="text"
autogrow autogrow
hide-bottom-space hide-bottom-space
@ -625,6 +639,7 @@ const putData = () => {
dense dense
outlined outlined
v-model="score[8].score" v-model="score[8].score"
:readonly="checkRoutePermisson"
label="คะแนนข้อ 9" label="คะแนนข้อ 9"
type="number" type="number"
lazy-rules lazy-rules
@ -645,6 +660,7 @@ const putData = () => {
label="กรอกข้อความ" label="กรอกข้อความ"
dense dense
lazy-rules lazy-rules
:readonly="checkRoutePermisson"
type="text" type="text"
autogrow autogrow
hide-bottom-space hide-bottom-space
@ -668,6 +684,7 @@ const putData = () => {
dense dense
outlined outlined
v-model="score[9].score" v-model="score[9].score"
:readonly="checkRoutePermisson"
label="คะแนนข้อ 10" label="คะแนนข้อ 10"
type="number" type="number"
lazy-rules lazy-rules
@ -1050,6 +1067,8 @@ const putData = () => {
dense dense
lazy-rules lazy-rules
outlined outlined
:readonly="checkRoutePermisson"
hide-bottom-space
v-model="comment" v-model="comment"
label="กรอกความคิดเห็น" label="กรอกความคิดเห็น"
type="textarea" type="textarea"
@ -1068,9 +1087,9 @@ const putData = () => {
</div> </div>
</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-space />
<q-btn <q-btn
unelevated unelevated

View file

@ -9,7 +9,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main"; import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import { checkPermission } from "@/utils/permissions";
/** use */ /** use */
const RetirementData = useRetirementDataStore(); const RetirementData = useRetirementDataStore();
const { statusText } = RetirementData; const { statusText } = RetirementData;
@ -240,8 +240,11 @@ const pagination = ref({
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div> <div>
<q-btn <q-btn
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
@click="openModalOrder" @click="openModalOrder"
size="14px"
flat flat
round round
color="add" color="add"
@ -301,18 +304,44 @@ const pagination = ref({
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width></q-th>
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props">
<q-td <q-td auto-width>
v-for="col in props.cols" <q-btn
:key="col.id" v-if="checkPermission($route)?.attrIsGet"
@click="router.push(`/retirement/resign/${props.row.id}`)" 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'"> <div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</div> </div>

View file

@ -30,6 +30,7 @@ const personId = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailbyid");
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const RetirementData = useRetirementDataStore(); const RetirementData = useRetirementDataStore();
const { const {
@ -748,7 +749,11 @@ function removeFile(fileName: string) {
<q-space /> <q-space />
<div <div
v-if="dataDetail.status == 'WAITTING' && roleUser === 'officer'" v-if="
dataDetail.status == 'WAITTING' &&
roleUser === 'officer' &&
!checkRoutePermisson
"
> >
<div v-if="!conditions"> <div v-if="!conditions">
<q-btn <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="row col-12 q-col-gutter-y-sm q-pa-sm">
<div class="col-12 row"> <div class="col-12 row">
<q-file <q-file
v-if="dataDetail.status == 'WAITTING' && roleUser === 'officer'" v-if="
dataDetail.status == 'WAITTING' &&
roleUser === 'officer' &&
!checkRoutePermisson
"
class="col-12" class="col-12"
for="#evidenceFiles" for="#evidenceFiles"
outlined outlined
@ -884,7 +893,8 @@ function removeFile(fileName: string) {
<q-btn <q-btn
v-if=" v-if="
dataDetail.status == 'WAITTING' && dataDetail.status == 'WAITTING' &&
roleUser === 'officer' roleUser === 'officer' &&
!checkRoutePermisson
" "
dense dense
flat flat
@ -1054,7 +1064,7 @@ function removeFile(fileName: string) {
</div> </div>
<q-space /> <q-space />
<div v-if="roleUser === 'officer'"> <div v-if="roleUser === 'officer' && !checkRoutePermisson">
<div class="q-gutter-sm" v-if="!edit"> <div class="q-gutter-sm" v-if="!edit">
<q-btn <q-btn
outline outline

View file

@ -13,6 +13,8 @@ const resign = () =>
import("@/modules/06_retirement/components/resign/Resign.vue"); import("@/modules/06_retirement/components/resign/Resign.vue");
const resignByid = () => const resignByid = () =>
import("@/modules/06_retirement/components/resign/ResignByid.vue"); import("@/modules/06_retirement/components/resign/ResignByid.vue");
const resignDetailbyid = () =>
import("@/modules/06_retirement/components/resign/ResignByid.vue");
const deceased = () => const deceased = () =>
import("@/modules/06_retirement/components/resign/Deceased.vue"); import("@/modules/06_retirement/components/resign/Deceased.vue");
const detaildeceased = () => const detaildeceased = () =>
@ -36,6 +38,8 @@ const exitInterviewMain = () =>
import("@/modules/06_retirement/components/ExitInterview/exitMain.vue"); import("@/modules/06_retirement/components/ExitInterview/exitMain.vue");
const exitInterviewDetails = () => const exitInterviewDetails = () =>
import("@/modules/06_retirement/components/ExitInterview/exitRegistry.vue"); import("@/modules/06_retirement/components/ExitInterview/exitRegistry.vue");
const exitInterviewDetailsOnly = () =>
import("@/modules/06_retirement/components/ExitInterview/exitRegistry.vue");
const exitInterviewEditQuestion = () => const exitInterviewEditQuestion = () =>
import("@/modules/06_retirement/components/ExitInterview/EditQuestion.vue"); import("@/modules/06_retirement/components/ExitInterview/EditQuestion.vue");
const detaildeceasedByid = () => const detaildeceasedByid = () =>
@ -83,7 +87,7 @@ export default [
}, },
}, },
{ {
path: "/retirement/exit-Interview", path: "/retirement/exit-interview",
name: "exit-Interview", name: "exit-Interview",
component: exitInterviewMain, component: exitInterviewMain,
meta: { meta: {
@ -93,7 +97,7 @@ export default [
}, },
}, },
{ {
path: "/retirement/exit-Interview/questionnair/:id", path: "/retirement/exit-interview/questionnair/:id",
name: "exit-Interview-details", name: "exit-Interview-details",
component: exitInterviewDetails, component: exitInterviewDetails,
meta: { meta: {
@ -103,7 +107,17 @@ export default [
}, },
}, },
{ {
path: "/retirement/exit-Interview/edit-question", 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", name: "ExitInterviewEditQuestion",
component: exitInterviewEditQuestion, component: exitInterviewEditQuestion,
meta: { meta: {
@ -132,6 +146,16 @@ export default [
Role: "STAFF", Role: "STAFF",
}, },
}, },
{
path: "/retirement/resign-detail/:id",
name: "resignDetailbyid",
component: resignDetailbyid,
meta: {
Auth: true,
Key: "SYS_RESIGN",
Role: "STAFF",
},
},
// { // {
// path: "/retirement/resign-order", // path: "/retirement/resign-order",
// name: "resign-order", // name: "resign-order",

View file

@ -46,6 +46,7 @@ const {
messageError, messageError,
hideLoader, hideLoader,
showLoader, showLoader,
downloadRenameFileByLink
} = mixin; } = mixin;
const { filterSelector } = complainstStore; // function store complainstStore 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" ref="respondentTypeRef"
dense dense
outlined outlined
:readonly="isReadonly ||checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
label="ผู้ถูกร้องเรียน" label="ผู้ถูกร้องเรียน"
option-value="id" option-value="id"
option-label="name" option-label="name"
@ -674,7 +668,7 @@ function filterOptionFnAgency(val: string, update: Function) {
ref="descriptionRef" ref="descriptionRef"
dense dense
outlined outlined
:readonly="isReadonly|| checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
hide-bottom-space hide-bottom-space
v-model="formData.description" v-model="formData.description"
label="รายละเอียดเรื่องร้องเรียน" label="รายละเอียดเรื่องร้องเรียน"
@ -691,7 +685,7 @@ function filterOptionFnAgency(val: string, update: Function) {
:locale="'th'" :locale="'th'"
autoApply autoApply
borderless borderless
:readonly="isReadonly|| checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
@update:model-value="changeFormData()" @update:model-value="changeFormData()"
@ -709,7 +703,7 @@ function filterOptionFnAgency(val: string, update: Function) {
outlined outlined
dense dense
:class="inputEdit(isReadonly)" :class="inputEdit(isReadonly)"
:readonly="isReadonly|| checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
hide-bottom-space hide-bottom-space
:model-value=" :model-value="
formData.dateReceived != null formData.dateReceived != null
@ -741,7 +735,7 @@ function filterOptionFnAgency(val: string, update: Function) {
ref="levelConsiderationRef" ref="levelConsiderationRef"
dense dense
outlined outlined
:readonly="isReadonly|| checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
v-model="formData.levelConsideration" v-model="formData.levelConsideration"
:options="complainstStore.levelConsiderationtOptions" :options="complainstStore.levelConsiderationtOptions"
label="ระดับการพิจารณา" label="ระดับการพิจารณา"
@ -764,7 +758,7 @@ function filterOptionFnAgency(val: string, update: Function) {
v-model="formData.dateConsideration" v-model="formData.dateConsideration"
@update:model-value="changeFormData()" @update:model-value="changeFormData()"
:locale="'th'" :locale="'th'"
:readonly="isReadonly|| checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
autoApply autoApply
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
@ -788,7 +782,7 @@ function filterOptionFnAgency(val: string, update: Function) {
? date2Thai(formData.dateConsideration) ? date2Thai(formData.dateConsideration)
: null : null
" "
:readonly="isReadonly|| checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
label="วันที่กำหนดพิจารณา" label="วันที่กำหนดพิจารณา"
hide-bottom-space hide-bottom-space
> >
@ -801,7 +795,11 @@ function filterOptionFnAgency(val: string, update: Function) {
</q-icon> </q-icon>
</template> </template>
<template <template
v-if="formData.dateConsideration && !isReadonly && !checkRoutePermisson" v-if="
formData.dateConsideration &&
!isReadonly &&
!checkRoutePermisson
"
v-slot:append v-slot:append
> >
<q-icon <q-icon
@ -824,7 +822,7 @@ function filterOptionFnAgency(val: string, update: Function) {
ref="offenseDetailsRef" ref="offenseDetailsRef"
dense dense
outlined outlined
:readonly="isReadonly|| checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
v-model="formData.offenseDetails" v-model="formData.offenseDetails"
:options="mainStore.offenseDetailstOptions" :options="mainStore.offenseDetailstOptions"
label="ลักษณะความผิด" label="ลักษณะความผิด"
@ -844,7 +842,7 @@ function filterOptionFnAgency(val: string, update: Function) {
v-model="formData.dateNotification" v-model="formData.dateNotification"
:locale="'th'" :locale="'th'"
autoApply autoApply
:readonly="isReadonly||checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
@ -863,7 +861,7 @@ function filterOptionFnAgency(val: string, update: Function) {
outlined outlined
:class="inputEdit(isReadonly)" :class="inputEdit(isReadonly)"
dense dense
:readonly="isReadonly||checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
hide-bottom-space hide-bottom-space
:model-value=" :model-value="
formData.dateNotification != null formData.dateNotification != null
@ -881,7 +879,11 @@ function filterOptionFnAgency(val: string, update: Function) {
</q-icon> </q-icon>
</template> </template>
<template <template
v-if="formData.dateNotification && !isReadonly && !checkRoutePermisson" v-if="
formData.dateNotification &&
!isReadonly &&
!checkRoutePermisson
"
v-slot:append v-slot:append
> >
<q-icon <q-icon
@ -924,7 +926,7 @@ function filterOptionFnAgency(val: string, update: Function) {
dense dense
outlined outlined
v-model="formData.appellant" v-model="formData.appellant"
:readonly="isReadonly ||checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
label="ผู้ร้องเรียน" label="ผู้ร้องเรียน"
hide-bottom-space hide-bottom-space
type="textarea" type="textarea"
@ -975,7 +977,11 @@ function filterOptionFnAgency(val: string, update: Function) {
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="row col-12 q-col-gutter-y-sm q-pa-sm"> <div class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div <div
v-if="!checkRoutePermisson && !isReadonly && formData.id !== ''" v-if="
!checkRoutePermisson &&
!isReadonly &&
formData.id !== ''
"
class="col-12 row" class="col-12 row"
> >
<q-file <q-file
@ -1034,7 +1040,9 @@ function filterOptionFnAgency(val: string, update: Function) {
dense dense
color="blue" color="blue"
icon="mdi-download" icon="mdi-download"
@click="downloadFile(data.pathName)" @click="
downloadRenameFileByLink(data.pathName, data.fileName)
"
><q-tooltip>ดาวนโหลดไฟล</q-tooltip></q-btn ><q-tooltip>ดาวนโหลดไฟล</q-tooltip></q-btn
> >
<q-btn <q-btn
@ -1067,7 +1075,10 @@ function filterOptionFnAgency(val: string, update: Function) {
</div> </div>
<div class="col-12" v-if="!checkRoutePermisson"><q-separator /></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-space />
<q-btn <q-btn
for="ButtonOnSubmit" for="ButtonOnSubmit"

View file

@ -49,6 +49,7 @@ const {
success, success,
messageError, messageError,
dialogRemove, dialogRemove,
downloadRenameFileByLink
} = mixin; } = mixin;
const investigateDis = useInvestigateDisStore(); const investigateDis = useInvestigateDisStore();
const countNum = ref<number>(1); const countNum = ref<number>(1);
@ -1553,7 +1554,7 @@ onMounted(async () => {
round round
color="blue" color="blue"
icon="mdi-download-outline" icon="mdi-download-outline"
@click="downloadFileRelevant(file.pathName)" @click="downloadRenameFileByLink(file.pathName, file.fileName)"
> >
<q-tooltip>ดาวนโหลดไฟล</q-tooltip> <q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn> </q-btn>
@ -1657,7 +1658,7 @@ onMounted(async () => {
round round
color="blue" color="blue"
icon="mdi-download-outline" icon="mdi-download-outline"
@click="downloadFile(file.pathName)" @click="downloadRenameFileByLink(file.pathName, file.fileName)"
> >
<q-tooltip>ดาวนโหลดไฟล</q-tooltip> <q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn> </q-btn>

View file

@ -34,6 +34,7 @@ const {
messageError, messageError,
showLoader, showLoader,
dialogRemove, dialogRemove,
downloadRenameFileByLink
} = mixin; } = mixin;
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@ -600,7 +601,7 @@ function updatemodalPersonal(modal: boolean) {
dense dense
color="blue" color="blue"
icon="mdi-download" icon="mdi-download"
@click="downloadFile(data.pathName)" @click="downloadRenameFileByLink(data.pathName,data.fileName)"
><q-tooltip>ดาวนโหลดไฟล</q-tooltip></q-btn ><q-tooltip>ดาวนโหลดไฟล</q-tooltip></q-btn
> >
<q-btn <q-btn

View file

@ -11,7 +11,7 @@ import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); 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 fileRef = ref<Object | null>(null);
const file = ref<any>(); const file = ref<any>();
@ -186,7 +186,7 @@ function downloadFile(link: string) {
round round
color="blue" color="blue"
icon="mdi-download-outline" icon="mdi-download-outline"
@click="downloadFile(f.pathName)" @click="downloadRenameFileByLink(f.pathName,f.fileName)"
> >
<q-tooltip>ดาวนโหลดเอกสาร</q-tooltip> <q-tooltip>ดาวนโหลดเอกสาร</q-tooltip>
</q-btn> </q-btn>

View file

@ -1058,6 +1058,32 @@ export const useCounterMixin = defineStore("mixin", () => {
} }
} }
function pathRegistryEmp(routeName: string) {
return routeName
? routeName === "registryNewByid"
? ""
: routeName === "registry-employeeId"
? "-temp"
: "-employee"
: "";
}
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 { return {
calAge, calAge,
date2Thai, date2Thai,
@ -1099,5 +1125,7 @@ export const useCounterMixin = defineStore("mixin", () => {
findOrgNameOld, findOrgNameOld,
findPosMasterNo, findPosMasterNo,
findPosMasterNoOld, findPosMasterNoOld,
pathRegistryEmp,
downloadRenameFileByLink,
}; };
}); });