diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts
index 6be4c2dde..5ca86af6d 100644
--- a/src/api/05_placement/api.placement.ts
+++ b/src/api/05_placement/api.placement.ts
@@ -1,6 +1,7 @@
import env from "../index";
const placement = `${env.API_PLACEMENT_URI}/placement`;
const orgTree = `${env.API_URI_ORG_TREE}`;
+const order = `${env.API_PLACEMENT_URI}`;
export default {
MainDetail: (year: number) => `${placement}/exam/${year}`,
@@ -47,7 +48,13 @@ export default {
// position
placementPosition: () => `${placement}/position/use`,
// putPositiom
- putPosition: (id:any) => `${placement}/position/${id}`,
+ putPosition: (id: any) => `${placement}/position/${id}`,
// clear Position
- clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}`
+ clearPosition: (personalId: string) => `${placement}/position/clear/${personalId}`,
+
+ // order
+ yearOptionsOrder: () => `${order}/order/fiscal-year`,
+ listOrder: () => `${order}/order`,
+ typeOrder: () => `${order}/order/order-type`,
+ examroundOrder: () => `${order}/order/detail/exam-round`,
};
diff --git a/src/modules/05_placement/components/OrderPlacement/MainOrderPlacement.vue b/src/modules/05_placement/components/OrderPlacement/MainOrderPlacement.vue
index 6894b70cd..efc769971 100644
--- a/src/modules/05_placement/components/OrderPlacement/MainOrderPlacement.vue
+++ b/src/modules/05_placement/components/OrderPlacement/MainOrderPlacement.vue
@@ -97,7 +97,7 @@
map-options
option-label="name"
:options="OrderTypeOption"
- option-value="id"
+ option-value="name"
lazy-rules
hide-bottom-space
:readonly="false"
@@ -115,7 +115,7 @@
map-options
option-label="name"
:options="OrderStatusOption"
- option-value="id"
+ option-value="name"
lazy-rules
hide-bottom-space
:readonly="false"
@@ -153,54 +153,30 @@
-
-
+
+
{{ props.row.Order }}
-
+
{{ props.row.OrderNum }}
-
+
{{ props.row.OrderType }}
-
+
{{ props.row.OrderDate }}
-
+
{{ props.row.OrderBy }}
-
+
{{ props.row.Signer }}
-
+
{{ props.row.OrderStatus }}
@@ -210,7 +186,7 @@
flat
round
color="red"
- @click="clickDelete(props.row.id)"
+ @click.stop="clickDelete(props.row.id)"
icon="mdi-delete"
>
ลบข้อมูล
@@ -246,9 +222,16 @@ import { useCounterMixin } from "@/stores/mixin";
import { useOrderPlacementDataStore } from "@/modules/05_placement/store";
import router from "@/router";
import { useQuasar } from "quasar";
+import http from "@/plugins/http";
+import config from "@/app.config";
const $q = useQuasar(); //ใช้ noti quasar
+const mixin = useCounterMixin();
+const { showLoader, hideLoader, messageError, date2Thai, dateText } = mixin;
const DataStore = useOrderPlacementDataStore();
+
+
+
const pagination = ref({
sortBy: "desc",
descending: false,
@@ -256,9 +239,6 @@ const pagination = ref({
rowsPerPage: 10,
});
-const mixin = useCounterMixin();
-const { dateText } = mixin;
-
// แปลงเวลา ค.ศ ให้เป็น พ.ศ
const textDate = (value: Date) => {
return dateText(value);
@@ -518,13 +498,12 @@ onMounted(async () => {
const OriginalDataFetch = async () => {
// API
- // await http
- // .get(config.API.// ตัวอย่าง)
- // .then((res: any) => {
- // })
- // .catch((e: any) => {
- // messageError($q, e);
- // })
+ // await http.get(config.API.listOrder()).then((res: any) => {
+ // console.log("list", res);
+ // });
+ // .catch((e: any) => {
+ // messageError($q, e);
+ // })
// .finally(async () => {
// });
await DataStore.DataMainOrder(rows.value);
@@ -533,9 +512,9 @@ const OriginalDataFetch = async () => {
};
// ดูรายการหน้าต่อไป
-const redirectToPage = (id?: number) => {
- // router.push({ name: "placementDetail" });
- router.push(`/placement/order/detail`);
+const redirectToPage = (id?: string) => {
+ console.log(id);
+ router.push(`/placement/order/detail/${id}`);
};
const clickDelete = (id: string) => {
@@ -572,7 +551,7 @@ const clickDelete = (id: string) => {
// };
const clickAdd = () => {
- router.push({ name: "OrderplacementDetail" });
+ router.push({ name: "Orderplacementadd" });
};
// const viewDetail = (id: string, status: string) => {
@@ -588,6 +567,16 @@ const fiscalyear = ref(0);
const fiscalyearOP = reactive([{ id: 0, name: "ทั้งหมด" }]);
const addedfiscalYearValues: number[] = [];
const fiscalYearFilter = async () => {
+ await http.get(config.API.yearOptionsOrder()).then((res) => {
+ console.log(res);
+ const response = res.data.result;
+ fiscalyearOP.push(...response);
+ // const maxNumber = fiscalyearOP.reduce((max: any, e: any) => {
+ // return e.id > max ? e.id : max;
+ // }, "");
+ // fiscalyear.value = maxNumber;
+ // console.log(fiscalyear.value);
+ });
// API
// await http
// .get(config.API.// ตัวอย่าง)
@@ -600,25 +589,37 @@ const fiscalYearFilter = async () => {
// })
// .finally(async () => {
// });
- for (let data of OriginalData.value) {
- const year = data.fiscalYear;
- console.log(year);
+ // for (let data of OriginalData.value) {
+ // console.log(OriginalData.value);
- if (fiscalyear.value === null || year > fiscalyear.value) {
- fiscalyear.value = year;
- }
+ // const year = data.fiscalYear;
+ // console.log(year);
- if (!addedfiscalYearValues.includes(year)) {
- fiscalyearOP.push({ id: year, name: year.toString() });
- addedfiscalYearValues.push(year);
- }
- }
+ // if (fiscalyear.value === null || year > fiscalyear.value) {
+ // fiscalyear.value = year;
+ // }
+
+ // if (!addedfiscalYearValues.includes(year)) {
+ // fiscalyearOP.push({ id: year, name: year.toString() });
+ // addedfiscalYearValues.push(year);
+ // }
+ // }
};
const OrderType = ref("");
const OrderTypeOption = reactive([{ id: 0, name: "ทั้งหมด" }]);
const addedOrderTypeValues: string[] = [];
const OrderTypeFilter = async () => {
+ await http
+ .get(config.API.typeOrder())
+ .then((res) => {
+ console.log(res.data);
+ const response = res.data.result;
+ OrderTypeOption.push(...response);
+ })
+ .catch((e) => {
+ messageError($q, e);
+ });
// API
// await http
// .get(config.API.// ตัวอย่าง)
@@ -631,29 +632,29 @@ const OrderTypeFilter = async () => {
// })
// .finally(async () => {
// });
- for (let data of OriginalData.value) {
- const OrderTypeValue = data.OrderType;
- console.log(OrderTypeValue);
+ // for (let data of OriginalData.value) {
+ // const OrderTypeValue = data.OrderType;
+ // console.log(OrderTypeValue);
- // if (OrderTypeValue === null || OrderType > OrderTypeValue) {
- // OrderTypeValue = OrderType;
- // }
- if (!addedOrderTypeValues.includes(OrderTypeValue)) {
- OrderTypeOption.push({
- // id: OrderTypeValue ?? 0,
- id: OrderTypeOption.length,
- name: OrderTypeValue,
- });
- addedOrderTypeValues.push(OrderTypeValue);
- }
- // if (!addedOrderTypeValues.includes(OrderTypeValue)) {
- // OrderTypeOption.push({
- // id: OrderTypeValue,
- // name: OrderTypeValue.toString(),
- // });
- // addedOrderTypeValues.push(OrderTypeValue);
- // }
- }
+ // if (OrderTypeValue === null || OrderType > OrderTypeValue) {
+ // OrderTypeValue = OrderType;
+ // }
+ // if (!addedOrderTypeValues.includes(OrderTypeValue)) {
+ // OrderTypeOption.push({
+ // // id: OrderTypeValue ?? 0,
+ // id: OrderTypeOption.length,
+ // name: OrderTypeValue,
+ // });
+ // addedOrderTypeValues.push(OrderTypeValue);
+ // }
+ // if (!addedOrderTypeValues.includes(OrderTypeValue)) {
+ // OrderTypeOption.push({
+ // id: OrderTypeValue,
+ // name: OrderTypeValue.toString(),
+ // });
+ // addedOrderTypeValues.push(OrderTypeValue);
+ // }
+ // }
};
const OrderStatus = ref("");
const OrderStatusText = ref(
@@ -697,8 +698,12 @@ const OrderStatusFilter = async () => {
};
// เลือกปีงบประมาณตาม API
-const searchfiscalyear = () => {
- console.log("Input value changed:", fiscalyear.value);
+const searchfiscalyear = async () => {
+ const yearNum = fiscalyear.value! + 543;
+
+ await DataStore.DataUpdateOrder(OrderType.value, OrderStatus.value, yearNum);
+ UpdataData.value = DataStore.DataMainUpdateOrder;
+
// API
// await http
// .get(config.API.// ตัวอย่าง)
@@ -722,6 +727,11 @@ const resetFilter = () => {
const attrs = ref(useAttrs());
const searchFilterTable = async () => {
+ if (fiscalyear.value !== null && fiscalyear.value !== 0) {
+ fiscalyear.value += 543;
+ }
+ console.log(fiscalyear.value, OrderType.value, OrderStatus.value);
+
// console.log('Input value changed:', examTime.value, examType.value, expiredAccount.value);
await DataStore.DataUpdateOrder(
OrderType.value,
@@ -729,6 +739,7 @@ const searchFilterTable = async () => {
fiscalyear.value
);
UpdataData.value = DataStore.DataMainUpdateOrder;
+ console.log(UpdataData.value);
};
// UpdataData.value = DataStore.DataMainUpdate;
// console.log("Input value changed:", OrderStatus.value, OrderType.value);
diff --git a/src/modules/05_placement/components/OrderPlacement/detailOrderPlacement.vue b/src/modules/05_placement/components/OrderPlacement/detailOrderPlacement.vue
index 790db1c27..6c17f39fd 100644
--- a/src/modules/05_placement/components/OrderPlacement/detailOrderPlacement.vue
+++ b/src/modules/05_placement/components/OrderPlacement/detailOrderPlacement.vue
@@ -8,7 +8,7 @@
flat
color="primary"
class="q-mr-sm"
- @click="router.go(-1)"
+ @click="router.go(-1), destroyLocalStorage()"
/>
ออกคำสั่ง
@@ -61,7 +61,7 @@