ปรับ code บรรจุ
This commit is contained in:
parent
063db4e245
commit
35a5817db3
16 changed files with 559 additions and 700 deletions
|
|
@ -14,6 +14,7 @@ import type { resData } from "@/modules/05_placement/interface/response/AppointM
|
|||
import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { PersonData } from "@/modules/05_placement/interface/index/Main";
|
||||
import type { FormDataAppoint } from "@/modules/05_placement/interface/request/Main";
|
||||
|
||||
/** importComponents*/
|
||||
import Dialogbody from "@/modules/05_placement/components/AppointMent/DialogOrders.vue"; //ส่งไปออกคำสั่ง
|
||||
|
|
@ -30,7 +31,7 @@ const {
|
|||
messageError,
|
||||
date2Thai,
|
||||
dialogRemove,
|
||||
onSearchDataTable
|
||||
onSearchDataTable,
|
||||
} = useCounterMixin();
|
||||
|
||||
const modal = ref<boolean>(false); //แสดง popup ส่งไปออกคำสั่ง
|
||||
|
|
@ -39,7 +40,7 @@ const posType = ref<string>(""); //ประเภทตำแหน่ง
|
|||
const posLevel = ref<string>(""); //ระดับตำแหน่ง
|
||||
const position = ref<string>(""); //ตำแหน่ง
|
||||
const typeModal = ref<string | null>(null); //ประเภท popup แต่งตั้ง , เลื่อน , ย้าย
|
||||
const dataRows = ref<any[]>([]);
|
||||
const dataRows = ref<PersonData>();
|
||||
const personalId = ref<string>("");
|
||||
|
||||
const filterRef = ref<any>(null);
|
||||
|
|
@ -154,13 +155,6 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/** รีเซ็ตคำค้นหารายการ*/
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
filterKeyword2.value = "";
|
||||
filterRef.value.focus();
|
||||
}
|
||||
|
||||
/** fetch รายการแต่งตั้ง-เลื่อน-ย้าย*/
|
||||
async function fecthlistappointment() {
|
||||
showLoader();
|
||||
|
|
@ -172,8 +166,7 @@ async function fecthlistappointment() {
|
|||
rows.value = response;
|
||||
rowsData.value = response;
|
||||
// รายชื่อ ส่งไปออกคำสั่ง
|
||||
const listData =
|
||||
rows.value.filter(
|
||||
const listData = rows.value.filter(
|
||||
(e: any) =>
|
||||
e.root !== null &&
|
||||
e.status !== "REPORT" &&
|
||||
|
|
@ -185,8 +178,8 @@ async function fecthlistappointment() {
|
|||
e.positionNumberOld &&
|
||||
e.positionDate
|
||||
);
|
||||
rows2.value = listData
|
||||
rows2Data.value = listData
|
||||
rows2.value = listData;
|
||||
rows2Data.value = listData;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -229,7 +222,7 @@ function nextPage(id: string) {
|
|||
}
|
||||
|
||||
/** เปิด popup เลือกหน่วยงาน*/
|
||||
function openModalTree(data: any, type: string) {
|
||||
function openModalTree(data: PersonData, type: string) {
|
||||
personalId.value = data.id;
|
||||
typeModal.value = type;
|
||||
dataRows.value = data;
|
||||
|
|
@ -240,7 +233,7 @@ function openModalTree(data: any, type: string) {
|
|||
}
|
||||
|
||||
/** ยืนยันการเลือกหน่วยงานที่แต่งตั้ง*/
|
||||
function onSave(data: any) {
|
||||
async function onSave(data: FormDataAppoint) {
|
||||
const dataAppoint = {
|
||||
node: data.node,
|
||||
nodeId: data.nodeId,
|
||||
|
|
@ -258,7 +251,7 @@ function onSave(data: any) {
|
|||
};
|
||||
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.put(config.API.appointmentPosition(personalId.value), dataAppoint)
|
||||
.then(async () => {
|
||||
await fecthlistappointment();
|
||||
|
|
@ -268,7 +261,7 @@ function onSave(data: any) {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
@ -293,8 +286,8 @@ function onSearch() {
|
|||
}
|
||||
|
||||
/** ทำงานเมื่อมีการเรียกใช้ Components*/
|
||||
onMounted(() => {
|
||||
fecthlistappointment();
|
||||
onMounted(async () => {
|
||||
await fecthlistappointment();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue