Merge branch 'anandadev' into develop
This commit is contained in:
commit
fb1ab7669a
8 changed files with 179 additions and 56 deletions
|
|
@ -546,7 +546,7 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -585,7 +585,7 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -80,14 +80,14 @@
|
|||
<div class="row q-pa-sm">
|
||||
<div class="col-xs-12 col-sm-3 col-md- q-pl-sm">
|
||||
<q-select
|
||||
v-model="examType"
|
||||
v-model="OrderType"
|
||||
label="ประเภท"
|
||||
dense
|
||||
clearable
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="examTypeOP"
|
||||
:options="OrderTypeOption"
|
||||
option-value="id"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
|
|
@ -100,14 +100,14 @@
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md- q-pl-sm">
|
||||
<q-select
|
||||
v-model="examType"
|
||||
v-model="OrderStatus"
|
||||
label="สถานะ"
|
||||
dense
|
||||
clearable
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="examTypeOP"
|
||||
:options="OrderStatusOption"
|
||||
option-value="id"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
|
|
@ -168,17 +168,23 @@
|
|||
</q-td>
|
||||
<q-td key="OrderStatus" :props="props">
|
||||
<q-icon
|
||||
v-if="props.row.OrderStatus == false"
|
||||
name="mdi-close"
|
||||
color="red"
|
||||
v-if="props.row.OrderStatus == 'ยังไม่ได้บรรจุ'"
|
||||
name="hourglass_top"
|
||||
color="orange"
|
||||
class="text-h5"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
v-if="props.row.OrderStatus == 'บรรจุแล้ว'"
|
||||
name="mdi-check"
|
||||
color="positive"
|
||||
class="text-h5"
|
||||
/>
|
||||
<q-icon
|
||||
v-if="props.row.OrderStatus == 'สละสิทธิ์'"
|
||||
name="close"
|
||||
color="red"
|
||||
class="text-h5"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
|
|
@ -230,6 +236,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "Order",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "OrderNum",
|
||||
|
|
@ -290,57 +298,85 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "OrderStatus",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "OrderType",
|
||||
align: "left",
|
||||
label: "ประเภท",
|
||||
sortable: false,
|
||||
field: "OrderType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<FormOrderPlacementMainData[]>([
|
||||
{
|
||||
Order: 1,
|
||||
Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้",
|
||||
OrderNum: "1/2565",
|
||||
fiscalYear: 2565,
|
||||
OrderDate: "30 พ.ค. 2565",
|
||||
OrderBy: "สำนักงาน กทม.",
|
||||
Signer: "นาม สมคิด ยอดใจ ",
|
||||
OrderStatus: true,
|
||||
OrderStatus: "ยังไม่ได้บรรจุ",
|
||||
OrderType: "คำสั่งย้าย",
|
||||
},
|
||||
|
||||
{
|
||||
Order: 2,
|
||||
Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้",
|
||||
OrderNum: "1/2565",
|
||||
fiscalYear: 2565,
|
||||
OrderDate: "30 พ.ค. 2565",
|
||||
OrderBy: "สำนักงาน กทม.",
|
||||
Signer: "นาม สมคิด ยอดใจ ",
|
||||
OrderStatus: true,
|
||||
OrderStatus: "ยังไม่ได้บรรจุ",
|
||||
OrderType: "คำสั่งบรรจุและแต่งตั้ง",
|
||||
},
|
||||
|
||||
{
|
||||
Order: 3,
|
||||
Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้",
|
||||
OrderNum: "1/2565",
|
||||
fiscalYear: 2565,
|
||||
OrderDate: "30 พ.ค. 2565",
|
||||
OrderBy: "สำนักงาน กทม.",
|
||||
Signer: "นาม สมคิด ยอดใจ ",
|
||||
OrderStatus: false,
|
||||
OrderStatus: "บรรจุแล้ว",
|
||||
OrderType: "คำสั่งย้าย",
|
||||
},
|
||||
|
||||
{
|
||||
Order: 4,
|
||||
Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้",
|
||||
OrderNum: "1/2564",
|
||||
fiscalYear: 2564,
|
||||
OrderDate: "30 พ.ค. 2564",
|
||||
OrderBy: "สำนักงาน กทม.",
|
||||
Signer: "นาม สมคิด ยอดใจ ",
|
||||
OrderStatus: true,
|
||||
OrderStatus: "บรรจุแล้ว",
|
||||
OrderType: "คำสั่งแต่งตั้ง",
|
||||
},
|
||||
|
||||
{
|
||||
Order: 5,
|
||||
Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้",
|
||||
OrderNum: "1/2566",
|
||||
fiscalYear: 2566,
|
||||
OrderDate: "30 พ.ค. 2566",
|
||||
OrderBy: "สำนักงาน กทม.",
|
||||
Signer: "นาม สมคิด ยอดใจ ",
|
||||
OrderStatus: true,
|
||||
OrderStatus: "สละสิทธิ์",
|
||||
OrderType: "คำสั่งแต่งตั้ง",
|
||||
},
|
||||
]);
|
||||
// const OrderStatusOption = [
|
||||
// "ทั้งหมด",
|
||||
// "ยังไม่ได้บรรจุ",
|
||||
// "บรรจุแล้ว",
|
||||
// "สละสิทธิ์",
|
||||
// ];
|
||||
|
||||
let OriginalData = ref<FormOrderPlacementMainData[]>([]);
|
||||
let UpdataData = ref<FormOrderPlacementMainData[]>([]);
|
||||
|
|
@ -364,14 +400,15 @@ const OriginalDataFetch = async () => {
|
|||
onMounted(async () => {
|
||||
await OriginalDataFetch();
|
||||
fiscalYearFilter();
|
||||
examTypeFilter();
|
||||
searchFilterTable();
|
||||
OrderStatusFilter();
|
||||
OrderTypeFilter();
|
||||
});
|
||||
|
||||
// ดูรายการสอบแข่งขัน หน้าต่อไป
|
||||
const redirectToPage = (id?: number) => {
|
||||
// router.push({ name: 'placementDetail'});
|
||||
router.push(`/placement/detail`);
|
||||
router.push(`/orderPlacement/detail`);
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
|
|
@ -391,6 +428,22 @@ const clickDelete = (id: string) => {
|
|||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
// const deleteData = async (id: string) => {
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .delete(config.API.orderReplace(id))
|
||||
// .then((res) => {
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// loaderPage(false);
|
||||
// await fetchData();
|
||||
// });
|
||||
// };
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "addOrderReplace" });
|
||||
};
|
||||
|
|
@ -426,6 +479,66 @@ const fiscalYearFilter = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
const OrderType = ref<number | null>(0);
|
||||
const OrderTypeOption = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedOrderTypeValues: number[] = [];
|
||||
const OrderTypeFilter = async () => {
|
||||
// API
|
||||
// await http
|
||||
// .get(config.API.// ตัวอย่าง)
|
||||
// .then((res: any) => {
|
||||
// DataStore.DataMainYearSet(rows.value);
|
||||
// fiscalyearOP.value = DataStore.DataMainYearGet;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// });
|
||||
for (let data of OriginalData.value) {
|
||||
const OrderType = data.OrderType;
|
||||
|
||||
if (OrderType.value === null || OrderType > OrderType.value) {
|
||||
OrderType.value = OrderType;
|
||||
}
|
||||
|
||||
if (!addedOrderTypeValues.includes(OrderType)) {
|
||||
OrderTypeOption.push({ id: OrderType, name: OrderType.toString() });
|
||||
addedOrderTypeValues.push(OrderType);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const OrderStatus = ref<number | null>(0);
|
||||
const OrderStatusOption = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedOrderStatusValues: number[] = [];
|
||||
const OrderStatusFilter = async () => {
|
||||
// API
|
||||
// await http
|
||||
// .get(config.API.// ตัวอย่าง)
|
||||
// .then((res: any) => {
|
||||
// DataStore.DataMainYearSet(rows.value);
|
||||
// fiscalyearOP.value = DataStore.DataMainYearGet;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// });
|
||||
for (let data of OriginalData.value) {
|
||||
const OrderStatus = data.OrderStatus;
|
||||
|
||||
if (OrderStatus.value === null || OrderStatus > OrderStatus.value) {
|
||||
OrderStatus.value = OrderStatus;
|
||||
}
|
||||
|
||||
if (!addedOrderStatusValues.includes(OrderStatus)) {
|
||||
OrderStatusOption.push({ id: OrderStatus, name: OrderStatus.toString() });
|
||||
addedOrderStatusValues.push(OrderStatus);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// เลือกปีงบประมาณตาม API
|
||||
const searchfiscalyear = () => {
|
||||
console.log("Input value changed:", fiscalyear.value);
|
||||
|
|
@ -459,32 +572,11 @@ const visibleColumns = ref<string[]>([
|
|||
"OrderStatus",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// ประเภทการสอบ
|
||||
const examType = ref<number | null>(0);
|
||||
const examTypeOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const addedexamTypeValues: number[] = [];
|
||||
const examTypeFilter = async () => {
|
||||
for (let data of OriginalData.value) {
|
||||
const examTypeValue = data.examType;
|
||||
if (examTypeValue == 1 && !addedexamTypeValues.includes(1)) {
|
||||
examTypeOP.push({ id: 1, name: "คัดเลือก" });
|
||||
addedexamTypeValues.push(1);
|
||||
} else if (examTypeValue == 2 && !addedexamTypeValues.includes(2)) {
|
||||
examTypeOP.push({ id: 2, name: "สอบแข่งขัน" });
|
||||
addedexamTypeValues.push(2);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const searchFilterTable = async () => {
|
||||
// console.log('Input value changed:', examTime.value, examType.value, expiredAccount.value);
|
||||
await DataStore.DataUpdateMain(
|
||||
examTime.value,
|
||||
examType.value,
|
||||
expiredAccount.value
|
||||
);
|
||||
UpdataData.value = DataStore.DataMainUpdate;
|
||||
await DataStore.DataUpdateMain(OrderStatus.value, OrderType.value);
|
||||
};
|
||||
// UpdataData.value = DataStore.DataMainUpdate;
|
||||
// console.log("Input value changed:", OrderStatus.value, OrderType.value);
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
|
|
|
|||
|
|
@ -11,13 +11,14 @@ interface FormPlacementMainData {
|
|||
}
|
||||
|
||||
interface FormOrderPlacementMainData {
|
||||
Order: number;
|
||||
Order: string;
|
||||
OrderNum: string;
|
||||
fiscalYear: number;
|
||||
OrderDate: string;
|
||||
OrderBy: string;
|
||||
Signer: string;
|
||||
OrderStatus: boolean;
|
||||
OrderStatus: string;
|
||||
OrderType: string;
|
||||
}
|
||||
|
||||
export type { FormPlacementMainData };
|
||||
|
|
|
|||
|
|
@ -12,9 +12,11 @@ const Placement2Detail = () =>
|
|||
import("@/modules/05_placement/components/exams_other/Detail.vue");
|
||||
const addOrderReplace = () =>
|
||||
import("@/modules/05_placement/components/OrderReplace/addOrderReplace.vue");
|
||||
const MainOrderPlacement = () =>
|
||||
import("@/modules/05_placement/components/OrderReplace/MainOrderReplace.vue");
|
||||
export default [
|
||||
{
|
||||
path: "/placement",
|
||||
path: "/placement/Sorkorcho",
|
||||
name: "placement",
|
||||
component: MainSorkorcho,
|
||||
meta: {
|
||||
|
|
@ -23,6 +25,16 @@ export default [
|
|||
Role: "placement",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/placement/OrderPlacement",
|
||||
name: "Orderplacement",
|
||||
component: MainOrderPlacement,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7],
|
||||
Role: "placement",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/placement/detail",
|
||||
name: "placementDetail",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue