บรรจุ แต่งตั้ง ย้าย โอน => ปรับ code และ load

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-19 16:14:43 +07:00
parent 9f4aeec575
commit 34dc306288
30 changed files with 1154 additions and 1429 deletions

View file

@ -3,27 +3,31 @@ import { ref, onMounted } from "vue";
import { checkPermission } from "@/utils/permissions";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
/**
* importType
*/
import type { QTableProps } from "quasar";
import type { officerType } from "@/modules/05_placement/interface/response/officer";
/**
* importComponents
*/
import Dialogbody from "@/modules/05_placement/components/helpgovernment/Dialogbody.vue";
import http from "@/plugins/http";
import config from "@/app.config";
/**
* importStore
*/
import { useTransferDataStore } from "@/modules/05_placement/store";
import { useCounterMixin } from "@/stores/mixin";
const transferStore = useTransferDataStore();
const { statusText } = transferStore;
const $q = useQuasar();
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
const router = useRouter();
const rows = ref<officerType[]>([]);
const rows2 = ref<officerType[]>([]);
const modal = ref<boolean>(false);
const mixin = useCounterMixin();
const {
date2Thai,
@ -36,6 +40,16 @@ const {
findPosMasterNoOld,
} = mixin;
/**
* Table
*/
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
const rows = ref<officerType[]>([]);
const rows2 = ref<officerType[]>([]);
const modal = ref<boolean>(false);
//
const columns = ref<QTableProps["columns"]>([
{
@ -174,38 +188,12 @@ const visibleColumns = ref<string[]>([
"status",
]);
//
const resetFilter = () => {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
};
const openDetail = (id: string) => {
router.push(`/placement/help-government/detail/${id}`);
};
const openModal = () => (modal.value = true);
const closeModal = () => {
modal.value = false;
filterKeyword2.value = "";
};
const openModalOrder = () => {
openModal();
const row = rows.value.filter(
(item: officerType) =>
(item.status == "WAITTING" ||
item.status == "PENDING" ||
item.status == "APPROVE") &&
item.organizationPositionOld &&
item.organization &&
item.dateStart &&
item.dateEnd
);
rows2.value = row;
};
const getData = async () => {
/**
* fetch รายการชวยราชการ
*/
function getData() {
showLoader();
await http
http
.get(config.API.officerMain())
.then((res: any) => {
const data = res.data.result;
@ -217,9 +205,13 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
const clickDelete = async (id: string) => {
/**
* นยนการลบรายการชวยราชการ
* @param id
*/
function clickDelete(id: string) {
dialogRemove($q, () => {
showLoader();
http
@ -235,9 +227,53 @@ const clickDelete = async (id: string) => {
hideLoader();
});
});
};
onMounted(async () => {
await getData();
}
/**
* rediarect หนารายละเอยดขอม
* @param id รายการชวยราชการ
*/
function openDetail(id: string) {
router.push(`/placement/help-government/detail/${id}`);
}
/**
* เป popup งไปออกคำสงชวยราชการ
*/
function openModalOrder() {
const row = rows.value.filter(
(item: officerType) =>
(item.status == "WAITTING" ||
item.status == "PENDING" ||
item.status == "APPROVE") &&
item.organizationPositionOld &&
item.organization &&
item.dateStart &&
item.dateEnd
);
rows2.value = row;
modal.value = true;
}
/**
* popup งไปออกคำสงชวยราชการ
*/
function closeModal() {
modal.value = false;
filterKeyword2.value = "";
}
/**
* เซตขอมลในชองฟลเตอร
*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
}
onMounted(() => {
getData();
});
</script>