filter ออกคำสั่งเฉพาะที่ไม่อยู่ในวินัยและเงินเดือน
This commit is contained in:
parent
d184a1bf5a
commit
249311668c
2 changed files with 66 additions and 22 deletions
|
|
@ -18,6 +18,35 @@ const mixin = useCounterMixin();
|
|||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
const DataStore = useOrderPlacementDataStore();
|
||||
|
||||
const commandCodes = ref<string[]>([
|
||||
"C-PM-01",
|
||||
"C-PM-02",
|
||||
"C-PM-03",
|
||||
"C-PM-04",
|
||||
"C-PM-05",
|
||||
"C-PM-06",
|
||||
"C-PM-07",
|
||||
"C-PM-08",
|
||||
"C-PM-09",
|
||||
"C-PM-10",
|
||||
"C-PM-11",
|
||||
"C-PM-12",
|
||||
"C-PM-13",
|
||||
"C-PM-14",
|
||||
"C-PM-15",
|
||||
"C-PM-16",
|
||||
"C-PM-17",
|
||||
"C-PM-18",
|
||||
"C-PM-21",
|
||||
"C-PM-22",
|
||||
"C-PM-23",
|
||||
"C-PM-24",
|
||||
"C-PM-38",
|
||||
"C-PM-39",
|
||||
"C-PM-40",
|
||||
"C-PM-41",
|
||||
]);
|
||||
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: 1,
|
||||
|
|
@ -112,14 +141,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
await OriginalDataFetch();
|
||||
fiscalYearFilter();
|
||||
searchFilterTable();
|
||||
OrderStatusFilter();
|
||||
OrderTypeFilter();
|
||||
});
|
||||
|
||||
// ข้อมูลตาราง
|
||||
const rows = ref<FormOrderPlacementMainData[]>([]);
|
||||
let OriginalData = ref<FormOrderPlacementMainData[]>([]);
|
||||
|
|
@ -129,8 +150,8 @@ const OriginalDataFetch = async () => {
|
|||
showLoader();
|
||||
await http
|
||||
.get(config.API.listOrder())
|
||||
.then((res: any) => {
|
||||
rows.value = res.data.result.map((e: any) => ({
|
||||
.then(async (res: any) => {
|
||||
let data = await res.data.result.map((e: any) => ({
|
||||
orderId: e.orderId,
|
||||
Order: e.orderName,
|
||||
OrderNum:
|
||||
|
|
@ -144,6 +165,10 @@ const OriginalDataFetch = async () => {
|
|||
OrderType: e.orderTypeName,
|
||||
orderTypeValue: e.orderTypeValue,
|
||||
}));
|
||||
|
||||
const typeid = OrderTypeOption.value.map((e) => e.id);
|
||||
|
||||
rows.value = data.filter((e: any) => typeid.includes(e.orderTypeValue)); // rows.value = data;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -213,11 +238,15 @@ const OrderTypeFilter = async () => {
|
|||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
const response = res.data.result;
|
||||
const filterRes = response.filter((e: any) =>
|
||||
commandCodes.value.includes(e.commandCode)
|
||||
);
|
||||
|
||||
OrderTypeOption.value = [{ id: "", name: "ทั้งหมด" }];
|
||||
OrderTypeOption.value.push(...response);
|
||||
OrderTypeOption.value.push(...filterRes);
|
||||
|
||||
OrderTypeFilter1.value = [{ id: "", name: "ทั้งหมด" }];
|
||||
OrderTypeFilter1.value.push(...response);
|
||||
OrderTypeFilter1.value.push(...filterRes);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -310,6 +339,14 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await OrderTypeFilter();
|
||||
await OriginalDataFetch();
|
||||
fiscalYearFilter();
|
||||
searchFilterTable();
|
||||
OrderStatusFilter();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -117,13 +117,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
await fiscalYearFilter();
|
||||
await OrderTypeFilter();
|
||||
await fetchOrderlist();
|
||||
await OrderStatusFilter();
|
||||
});
|
||||
|
||||
async function fetchOrderlist() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -276,6 +269,13 @@ function filterSelector(val: any, update: Function, refData: string) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fiscalYearFilter();
|
||||
await OrderTypeFilter();
|
||||
await fetchOrderlist();
|
||||
await OrderStatusFilter();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -316,7 +316,10 @@ function filterSelector(val: any, update: Function, refData: string) {
|
|||
<template v-if="fiscalyear !== 0" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="(fiscalyearOP = fiscalyearFilter1)(fiscalyear = 0), searchFilterTable()"
|
||||
@click.stop.prevent="
|
||||
(fiscalyearOP = fiscalyearFilter1)((fiscalyear = 0)),
|
||||
searchFilterTable()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
|
|
@ -410,7 +413,9 @@ function filterSelector(val: any, update: Function, refData: string) {
|
|||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
(OrderTypeOption = OrderTypeFilter1),(OrderType = ''), searchFilterTable()
|
||||
(OrderTypeOption = OrderTypeFilter1),
|
||||
(OrderType = ''),
|
||||
searchFilterTable()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
|
|
@ -450,7 +455,9 @@ function filterSelector(val: any, update: Function, refData: string) {
|
|||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
(OrderStatusOption = OrderStatusFilter1),(OrderStatus = 'ทั้งหมด'), searchFilterTable()
|
||||
(OrderStatusOption = OrderStatusFilter1),
|
||||
(OrderStatus = 'ทั้งหมด'),
|
||||
searchFilterTable()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue