updated registry

This commit is contained in:
Warunee Tamkoo 2024-08-13 11:22:48 +07:00
parent fd1f6a93d2
commit 64a9971665
26 changed files with 125 additions and 116 deletions

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

@ -1058,6 +1058,16 @@ export const useCounterMixin = defineStore("mixin", () => {
} }
} }
function pathRegistryEmp(routeName: string) {
return routeName
? routeName === "registryNewByid"
? ""
: routeName === "registry-employeeId"
? "-temp"
: "-employee"
: "";
}
return { return {
calAge, calAge,
date2Thai, date2Thai,
@ -1099,5 +1109,6 @@ export const useCounterMixin = defineStore("mixin", () => {
findOrgNameOld, findOrgNameOld,
findPosMasterNo, findPosMasterNo,
findPosMasterNoOld, findPosMasterNoOld,
pathRegistryEmp,
}; };
}); });