Merge branch 'develop' into devTee
This commit is contained in:
commit
61db243f92
7 changed files with 180 additions and 107 deletions
|
|
@ -35,6 +35,14 @@ const columnsLeave = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
field: "citizenId",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
|
|
@ -44,6 +52,42 @@ const columnsLeave = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "agency",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: true,
|
||||
field: "agency",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "org",
|
||||
align: "left",
|
||||
label: "ส่วนราชการ",
|
||||
sortable: true,
|
||||
field: "org",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "level",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "level",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "dateSendLeave",
|
||||
align: "left",
|
||||
|
|
@ -53,6 +97,15 @@ const columnsLeave = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "dateLeave",
|
||||
align: "left",
|
||||
label: "วันที่ลา",
|
||||
sortable: true,
|
||||
field: "dateLeave",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
|
|
@ -66,8 +119,14 @@ const columnsLeave = ref<QTableProps["columns"]>([
|
|||
const visibleColumnsLeave = ref<string[]>([
|
||||
"no",
|
||||
"leaveTypeName",
|
||||
"citizenId",
|
||||
"fullName",
|
||||
"dateSendLeave",
|
||||
"dateLeave",
|
||||
"agency",
|
||||
"org",
|
||||
"position",
|
||||
"level",
|
||||
"status",
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@ interface ListLeave {
|
|||
fullName: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
||||
dateSendLeave: Date | null; //วันที่ยื่นใบลา
|
||||
status: string | null; //ส
|
||||
citizenId?: string;
|
||||
leaveStartDate?: Date | null;
|
||||
leaveEndDate?: Date | null;
|
||||
agency?: string;
|
||||
org?: string;
|
||||
position?: string;
|
||||
level?: string;
|
||||
}
|
||||
interface FormData {
|
||||
id: string;
|
||||
|
|
|
|||
|
|
@ -45,8 +45,16 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
|||
id: e.id,
|
||||
leaveTypeName: e.leaveTypeName,
|
||||
leaveTypeId: e.leaveTypeId,
|
||||
citizenId: e.citizenId ?? "3120101734950",
|
||||
fullName: e.fullName,
|
||||
agency: e.agency ?? "สำนักงานการเจ้าหน้าที่",
|
||||
org: e.org ?? "กองบริหารทั่วไป/ฝ่ายการเจ้าหน้าที่",
|
||||
position: e.position ?? "นักทรัพยากรบุคคล",
|
||||
level: e.level ?? "ชำนาญการ",
|
||||
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
|
||||
dateLeave:
|
||||
e.dateSendLeave &&
|
||||
date2Thai(e.dateSendLeave) + "-" + date2Thai(e.dateSendLeave),
|
||||
status: e.status && convertSatatus(e.status),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,10 @@ const nextStep = async () => {
|
|||
await http
|
||||
.put(config.API.nextStep(orderId.value))
|
||||
.then(() => {
|
||||
if (route.name == "disciplineOrderDatail") {
|
||||
if (
|
||||
route.name == "disciplineOrderDatail" ||
|
||||
route.name == "disciplineOrderAdd"
|
||||
) {
|
||||
router.push(
|
||||
`/discipline-order/detail/${orderId.value}?step=${step.value + 1}`
|
||||
);
|
||||
|
|
@ -56,7 +59,10 @@ const previousStep = async () => {
|
|||
await http
|
||||
.put(config.API.prevStep(orderId.value))
|
||||
.then(() => {
|
||||
if (route.name == "disciplineOrderDatail") {
|
||||
if (
|
||||
route.name == "disciplineOrderDatail" ||
|
||||
route.name == "disciplineOrderAdd"
|
||||
) {
|
||||
router.push(
|
||||
`/discipline-order/detail/${orderId.value}?step=${step.value - 1}`
|
||||
);
|
||||
|
|
@ -101,7 +107,8 @@ onMounted(() => {
|
|||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="
|
||||
route.name == 'disciplineOrderDatail' || route.name == 'disciplineOrderAdd'
|
||||
route.name == 'disciplineOrderDatail' ||
|
||||
route.name == 'disciplineOrderAdd'
|
||||
? router.push(`/discipline-order`)
|
||||
: router.push(`/order`)
|
||||
"
|
||||
|
|
|
|||
|
|
@ -136,13 +136,6 @@ onMounted(async () => {
|
|||
} else {
|
||||
await fecthTypeOption("noData");
|
||||
}
|
||||
|
||||
if (
|
||||
route.name == "disciplineOrderDatail" ||
|
||||
route.name == "disciplineOrderAdd"
|
||||
) {
|
||||
await getComplaint();
|
||||
}
|
||||
});
|
||||
// เลือกคำสั่งโดย
|
||||
watch(byOrder, async () => {
|
||||
|
|
@ -222,8 +215,12 @@ const fetchdetailOrder = async () => {
|
|||
let orderIdString = orderId.toString();
|
||||
await http
|
||||
.get(config.API.detailOrder(orderIdString))
|
||||
.then((res) => {
|
||||
.then(async (res: any) => {
|
||||
const data = res.data.result;
|
||||
|
||||
const orderTypeCode = await data.orderTypeCode.toUpperCase();
|
||||
await optionsData(orderTypeCode);
|
||||
|
||||
typeOrder.value = typeOrderOption.value.find(
|
||||
(e) => e.id === data.orderTypeValue
|
||||
);
|
||||
|
|
@ -294,8 +291,6 @@ const fetchdetailOrder = async () => {
|
|||
result.value = data.result;
|
||||
refRaw.value = data.refRaw;
|
||||
complaintId.value = data.complaintId;
|
||||
|
||||
fecthExamRoundOption(data.orderTypeCode);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -317,62 +312,71 @@ const fecthCommand = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const optionsData = async (commandCode: string) => {
|
||||
const orderTypeCode = await commandCode.toUpperCase();
|
||||
if (orderTypeCode === "C-PM-10") {
|
||||
nodeTree();
|
||||
}
|
||||
nameOrder.value = DataStore.nameOrderFilter(orderTypeCode);
|
||||
|
||||
// บรรจุ แต่งตั้ง ย้าย 01 - 04
|
||||
if (
|
||||
orderTypeCode == "C-PM-01" ||
|
||||
orderTypeCode == "C-PM-02" ||
|
||||
orderTypeCode == "C-PM-03" ||
|
||||
orderTypeCode == "C-PM-04"
|
||||
) {
|
||||
fecthExamRoundOption(orderTypeCode);
|
||||
}
|
||||
|
||||
// คำสั่งวินัย
|
||||
if (
|
||||
route.name == "disciplineOrderDatail" ||
|
||||
route.name == "disciplineOrderAdd"
|
||||
) {
|
||||
await getComplaint();
|
||||
}
|
||||
|
||||
// console.log(DataStore.complaintLists)
|
||||
DataStore.complaintOption = [];
|
||||
if (orderTypeCode == "C-PM-25" || orderTypeCode == "C-PM-26") {
|
||||
await DataStore.complaintLists
|
||||
.filter((x: complaintLists) => x.isDisciplinary === true)
|
||||
.map((val: complaintLists) => {
|
||||
DataStore.complaintOption.push({ id: val.id, name: val.title });
|
||||
});
|
||||
} else if (orderTypeCode == "C-PM-32") {
|
||||
await DataStore.complaintLists
|
||||
.filter(
|
||||
(x: complaintLists) =>
|
||||
x.isInvestigate === true ||
|
||||
x.isDisciplinary === true ||
|
||||
x.isResult === true
|
||||
)
|
||||
.map((val: complaintLists) => {
|
||||
DataStore.complaintOption.push({ id: val.id, name: val.title });
|
||||
});
|
||||
} else if (
|
||||
orderTypeCode == "C-PM-19" ||
|
||||
orderTypeCode == "C-PM-20" ||
|
||||
orderTypeCode == "C-PM-27" ||
|
||||
orderTypeCode == "C-PM-28" ||
|
||||
orderTypeCode == "C-PM-29" ||
|
||||
orderTypeCode == "C-PM-30" ||
|
||||
orderTypeCode == "C-PM-31"
|
||||
) {
|
||||
await DataStore.complaintLists
|
||||
.filter((x: complaintLists) => x.isResult === true)
|
||||
.map((val: complaintLists) => {
|
||||
DataStore.complaintOption.push({ id: val.id, name: val.title });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const selectCMP = async (selectOrder: OrederResult) => {
|
||||
if (selectOrder != null) {
|
||||
fecthExamRoundOption(selectOrder.commandCode);
|
||||
if (selectOrder.commandCode === "C-PM-10") {
|
||||
nodeTree();
|
||||
}
|
||||
nameOrder.value = DataStore.nameOrderFilter(selectOrder.commandCode);
|
||||
|
||||
// บรรจุ แต่งตั้ง ย้าย 01 - 04
|
||||
if (
|
||||
selectOrder.commandCode == "C-PM-01" ||
|
||||
selectOrder.commandCode == "C-PM-02" ||
|
||||
selectOrder.commandCode == "C-PM-03" ||
|
||||
selectOrder.commandCode == "C-PM-04"
|
||||
) {
|
||||
fecthExamRoundOption(selectOrder.commandCode);
|
||||
}
|
||||
|
||||
// คำสั่งวินัย
|
||||
// console.log(DataStore.complaintLists)
|
||||
DataStore.complaintOption = [];
|
||||
if (
|
||||
selectOrder.commandCode == "C-PM-25" ||
|
||||
selectOrder.commandCode == "C-PM-26"
|
||||
) {
|
||||
await DataStore.complaintLists
|
||||
.filter((x: complaintLists) => x.isDisciplinary === true)
|
||||
.map((val: complaintLists) => {
|
||||
DataStore.complaintOption.push({ id: val.id, name: val.title });
|
||||
});
|
||||
} else if (selectOrder.commandCode == "C-PM-32") {
|
||||
await DataStore.complaintLists
|
||||
.filter(
|
||||
(x: complaintLists) =>
|
||||
x.isInvestigate === true ||
|
||||
x.isDisciplinary === true ||
|
||||
x.isResult === true
|
||||
)
|
||||
.map((val: complaintLists) => {
|
||||
DataStore.complaintOption.push({ id: val.id, name: val.title });
|
||||
});
|
||||
} else if (
|
||||
selectOrder.commandCode == "C-PM-19" ||
|
||||
selectOrder.commandCode == "C-PM-20" ||
|
||||
selectOrder.commandCode == "C-PM-27" ||
|
||||
selectOrder.commandCode == "C-PM-28" ||
|
||||
selectOrder.commandCode == "C-PM-29" ||
|
||||
selectOrder.commandCode == "C-PM-30" ||
|
||||
selectOrder.commandCode == "C-PM-31"
|
||||
) {
|
||||
await DataStore.complaintLists
|
||||
.filter((x: complaintLists) => x.isResult === true)
|
||||
.map((val: complaintLists) => {
|
||||
DataStore.complaintOption.push({ id: val.id, name: val.title });
|
||||
});
|
||||
}
|
||||
const orderTypeCode = await selectOrder.commandCode.toUpperCase();
|
||||
optionsData(orderTypeCode);
|
||||
}
|
||||
//01-04
|
||||
examRound.value = "";
|
||||
|
|
@ -635,7 +639,15 @@ const createListOrder = async (formData: Object, type: string) => {
|
|||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
localStorage.setItem("orderId", data.id);
|
||||
router.push(`/order/detail/${data.id}?step=${2}`); // สร้างเสร็จแล้วให้ไป Step 2
|
||||
|
||||
if (
|
||||
route.name == "disciplineOrderDatail" ||
|
||||
route.name == "disciplineOrderAdd"
|
||||
) {
|
||||
router.push(`/discipline-order/detail/${data.id}?step=${2}`); // สร้างเสร็จแล้วให้ไป Step 2
|
||||
} else {
|
||||
router.push(`/order/detail/${data.id}?step=${2}`); // สร้างเสร็จแล้วให้ไป Step 2
|
||||
}
|
||||
next();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
|
|
|
|||
|
|
@ -240,16 +240,16 @@ interface DataOptionInsigniaType {
|
|||
name: string;
|
||||
}
|
||||
interface OrederResult {
|
||||
category: string
|
||||
category?: string
|
||||
commandCode: string
|
||||
createdAt: Date
|
||||
createdFullName: string
|
||||
createdUserId: string
|
||||
id: string
|
||||
lastUpdateFullName: string
|
||||
lastUpdateUserId: string
|
||||
lastUpdatedAt: string
|
||||
name: string
|
||||
createdAt?: Date
|
||||
createdFullName?: string
|
||||
createdUserId?: string
|
||||
id?: string
|
||||
lastUpdateFullName?: string
|
||||
lastUpdateUserId?: string
|
||||
lastUpdatedAt?: string
|
||||
name?: string
|
||||
}
|
||||
export type {
|
||||
DataOption,
|
||||
|
|
|
|||
|
|
@ -146,26 +146,6 @@ async function fetchOrderlist() {
|
|||
});
|
||||
}
|
||||
|
||||
// redirect ไปยัง step ปัจจุบัน
|
||||
const redirectToPage = (id?: string, status?: string) => {
|
||||
let step = 1;
|
||||
switch (status) {
|
||||
case "จัดทำร่างคำสั่ง":
|
||||
step = 1;
|
||||
break;
|
||||
case "บัญชีแนบท้าย":
|
||||
step = 2;
|
||||
break;
|
||||
case "เลือกผู้ได้รับสำเนาคำสั่ง":
|
||||
step = 3;
|
||||
break;
|
||||
default:
|
||||
step = 4;
|
||||
break;
|
||||
}
|
||||
router.push(`/order/detail/${id}?step=${step}`);
|
||||
};
|
||||
|
||||
// สร้างคำสั่งใหม่
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "disciplineOrderAdd" });
|
||||
|
|
@ -212,12 +192,12 @@ const addedOrderStatusValues: string[] = [];
|
|||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
||||
function resetFilter(){
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
}
|
||||
|
||||
async function OrderTypeFilter(){
|
||||
async function OrderTypeFilter() {
|
||||
await http
|
||||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
|
|
@ -235,14 +215,14 @@ async function OrderTypeFilter(){
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/** ฟังชั่นฟิลเตอร์ตามค่า ประเภท สถานะ ปี */
|
||||
async function searchFilterTable(){
|
||||
async function searchFilterTable() {
|
||||
stroe.filterListOrder(OrderType.value, OrderStatus.value, fiscalyear.value);
|
||||
};
|
||||
}
|
||||
|
||||
async function OrderStatusFilter(){
|
||||
async function OrderStatusFilter() {
|
||||
for (let data of stroe.mainData) {
|
||||
const OrderStatusValue = data.orderStatusName;
|
||||
|
||||
|
|
@ -261,7 +241,7 @@ async function OrderStatusFilter(){
|
|||
addedOrderStatusValues.push(OrderStatusValue);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟิลเตอร์ข้อมูลจาก input
|
||||
|
|
@ -269,7 +249,7 @@ async function OrderStatusFilter(){
|
|||
* @param update function จาก quasar
|
||||
* @param refData type ที่กำหนด ของ input นั้นๆ
|
||||
*/
|
||||
function filterSelector(val: any, update: Function, refData: string){
|
||||
function filterSelector(val: any, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "fiscalyearOP":
|
||||
update(() => {
|
||||
|
|
@ -295,7 +275,7 @@ function filterSelector(val: any, update: Function, refData: string){
|
|||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue