บรรจุ แต่งตั้ง ย้าย โอน => ปรับ code และ load
This commit is contained in:
parent
9f4aeec575
commit
34dc306288
30 changed files with 1154 additions and 1429 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue