list Order
This commit is contained in:
parent
c46f453f34
commit
92edcfb533
6 changed files with 658 additions and 512 deletions
|
|
@ -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`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 @@
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
key="Order"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.Order)"
|
||||
>
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="redirectToPage(props.row.Order)"
|
||||
>
|
||||
<q-td key="Order" :props="props">
|
||||
{{ props.row.Order }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="OrderNum"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.Order)"
|
||||
>
|
||||
<q-td key="OrderNum" :props="props">
|
||||
{{ props.row.OrderNum }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="OrderType"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.OrderType)"
|
||||
>
|
||||
<q-td key="OrderType" :props="props">
|
||||
{{ props.row.OrderType }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="OrderDate"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.Order)"
|
||||
>
|
||||
<q-td key="OrderDate" :props="props">
|
||||
{{ props.row.OrderDate }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="OrderBy"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.Order)"
|
||||
>
|
||||
<q-td key="OrderBy" :props="props">
|
||||
{{ props.row.OrderBy }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="Signer"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.Order)"
|
||||
>
|
||||
<q-td key="Signer" :props="props">
|
||||
{{ props.row.Signer }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="OrderStatus"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.Order)"
|
||||
>
|
||||
<q-td key="OrderStatus" :props="props">
|
||||
{{ props.row.OrderStatus }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
|
|
@ -210,7 +186,7 @@
|
|||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
@click.stop="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
|
|
@ -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<number | null>(0);
|
|||
const fiscalyearOP = reactive<DataOption[]>([{ 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<string>("");
|
||||
const OrderTypeOption = reactive<DataOption[]>([{ 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<string>("");
|
||||
const OrderStatusText = ref<FormOrderPlacementMainData[]>(
|
||||
|
|
@ -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<any>(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);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
@click="router.go(-1), destroyLocalStorage()"
|
||||
/>
|
||||
ออกคำสั่ง
|
||||
</div>
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router";
|
||||
import { ref, defineAsyncComponent } from "vue";
|
||||
import { ref, defineAsyncComponent, onMounted } from "vue";
|
||||
import type { QStepper } from "quasar";
|
||||
|
||||
const step01 = defineAsyncComponent(
|
||||
|
|
@ -87,11 +87,22 @@ const stepper = ref<QStepper>();
|
|||
|
||||
const nextStep = () => {
|
||||
stepper.value!.next();
|
||||
localStorage.setItem("currentStep", step.value.toString());
|
||||
};
|
||||
|
||||
const previousStep = () => {
|
||||
stepper.value!.previous();
|
||||
localStorage.setItem("currentStep", step.value.toString());
|
||||
};
|
||||
const destroyLocalStorage = () => {
|
||||
localStorage.clear();
|
||||
};
|
||||
onMounted(() => {
|
||||
const currentStep = localStorage.getItem("currentStep");
|
||||
if (currentStep) {
|
||||
step.value = Number(currentStep);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.q-stepper--horizontal .q-stepper__step-inner {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -92,7 +92,17 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/placement/order/detail",
|
||||
path: "/placement/order/add",
|
||||
name: "Orderplacementadd",
|
||||
component: detailOrderReplace,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [6.9],
|
||||
Role: "placement",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/placement/order/detail/:orderid",
|
||||
name: "OrderplacementDetail",
|
||||
component: detailOrderReplace,
|
||||
meta: {
|
||||
|
|
|
|||
|
|
@ -229,6 +229,8 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
|||
) => {
|
||||
DataMainUpdateOrder.value = [];
|
||||
|
||||
|
||||
|
||||
if (filter_1 === "" && filter_2 === "" && filterYear === 0) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value;
|
||||
} else if (filter_1 !== "" && filter_2 === "" && filterYear === 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue