UI => ส่งคนไประบบออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-27 15:59:13 +07:00
parent 3ca0390b87
commit fc75e315f5
19 changed files with 816 additions and 842 deletions

View file

@ -9,19 +9,16 @@ import { useTransferDataStore } from "@/modules/05_placement/store";
import http from "@/plugins/http";
import config from "@/app.config";
/**
* importType
*/
/** importType*/
import type {
listAppointType,
resData,
} from "@/modules/05_placement/interface/response/AppointMent";
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";
/**
* importComponents
*/
/** importComponents*/
import Dialogbody from "@/modules/05_placement/components/AppointMent/DialogOrders.vue"; //
import DialogOrgSelect from "@/components/Dialogs/DialogOrgSelect.vue"; //
@ -52,11 +49,9 @@ const listRecevice = ref<resData[]>([]); //ข้อมูลรายการ
const optionsType = ref<OpType[]>([]);
const type = ref<string>("");
/**
* Table
*/
const rows = ref<listAppointType[]>([]); //--
const rows2 = ref<listAppointType[]>([]); //
//table
const rows = ref<PersonData[]>([]); //--
const rows2 = ref<PersonData[]>([]); //
const filterKeyword = ref<string>(""); //--
const filterKeyword2 = ref<string>(""); //
const columns = ref<QTableProps["columns"]>([
@ -159,18 +154,14 @@ const pagination = ref({
rowsPerPage: 10,
});
/**
* เซตคำคนหารายการ
*/
/** รีเซ็ตคำค้นหารายการ*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
}
/**
* fetch รายการแตงต-เลอน-าย
*/
/** fetch รายการแต่งตั้ง-เลื่อน-ย้าย*/
async function fecthlistappointment() {
showLoader();
await http
@ -234,9 +225,7 @@ function nextPage(id: string) {
});
}
/**
* เป popup เลอกหนวยงาน
*/
/** เปิด popup เลือกหน่วยงาน*/
function openModalTree(data: any, type: string) {
personalId.value = data.id;
typeModal.value = type;
@ -247,9 +236,7 @@ function openModalTree(data: any, type: string) {
modalTree.value = true;
}
/**
* นยนการเลอกหนวยงานทแตงต
*/
/** ยืนยันการเลือกหน่วยงานที่แต่งตั้ง*/
function onSave(data: any) {
const dataAppoint = {
node: data.node,
@ -283,24 +270,18 @@ function onSave(data: any) {
});
}
/**
* เป popup งไปออกคำส
*/
/** เปิด popup ส่งไปออกคำสั่ง*/
function sendToCommand() {
modal.value = true;
filterKeyword2.value = "";
}
/**
* popup งไปออกคำส
*/
/** ปิด popup ส่งไปออกคำสั่ง*/
function clickClose() {
modal.value = false;
}
/**
* ทำงานเมอมการเรยกใช Components
*/
/** ทำงานเมื่อมีการเรียกใช้ Components*/
onMounted(() => {
fecthlistappointment();
});
@ -582,9 +563,9 @@ onMounted(() => {
v-model:type="type"
:click-close="clickClose"
:options-type="optionsType"
:rows2="rows2"
:next-page="nextPage"
:fetch-data="fecthlistappointment"
:rows2="rows2"
/>
<DialogOrgSelect

View file

@ -10,11 +10,8 @@ import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type {
listAppointType,
resData,
} from "@/modules/05_placement/interface/response/AppointMent";
import type { PersonData } from "@/modules/05_placement/interface/index/Main";
import type { resData } from "@/modules/05_placement/interface/response/AppointMent";
import type { OpType } from "@/modules/05_placement/interface/response/Main";
import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue"; //
@ -49,8 +46,8 @@ const optionsType = ref<OpType[]>([]);
const type = ref<string>("");
// Table
const rows = ref<listAppointType[]>([]); //
const rows2 = ref<listAppointType[]>([]); //
const rows = ref<PersonData[]>([]); //
const rows2 = ref<PersonData[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -59,6 +56,7 @@ const visibleColumns = ref<string[]>([
"fullname",
"organizationName",
"dateOfBirth",
"typeCommand",
"createdAt",
"status",
]);
@ -114,6 +112,18 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "typeCommand",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "typeCommand",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val: string) => {
return val === "SLIP" ? "เลื่อน" : val === "MOVE" ? "ย้าย" : "-";
},
},
{
name: "createdAt",
align: "left",
@ -527,9 +537,9 @@ onMounted(() => {
v-model:type="type"
:click-close="clickClose"
:options-type="optionsType"
:rows2="rows2"
:next-page="nextPage"
:fetch-data="fecthlistappointment"
:rows2="rows2"
/>
<DialogOrgSelectEmployee

View file

@ -32,8 +32,6 @@ const {
} = useCounterMixin();
const modal = ref<boolean>(false);
const type = ref<string>("");
const optionsType = ref<OpType[]>([]);
/**
* Table
@ -163,29 +161,6 @@ async function fecthlistOthet() {
});
}
/**
* fetch รายการขอมลประเภทคำส
*/
function fecthTypeOption() {
showLoader();
type.value = "";
http
.get(config.API.typeOrder())
.then((res) => {
// C-PM-08 C-PM-09
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09"
);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/**
* เซตขอมลในชอง input
*/
@ -200,9 +175,6 @@ function resetFilter() {
function popup() {
modal.value = true;
filterKeyword2.value = "";
type.value = "";
// fetch
fecthTypeOption();
}
/**
@ -380,9 +352,7 @@ onMounted(() => {
<Dialogbody
v-model:Modal="modal"
v-model:filter-keyword2="filterKeyword2"
v-model:type="type"
:click-close="clickClose"
:options-type="optionsType"
:rows2="rows2"
:fecthlistOthet="fecthlistOthet"
/>