From 23be6c5fb85ffe6753066212e77b03186cdf341e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 25 Apr 2024 12:06:07 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B9=80=E0=B8=A5=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99/=E0=B8=84?= =?UTF-8?q?=E0=B9=88=E0=B8=B2=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../13_salary/components/Command/step01.vue | 190 ++- .../13_salary/components/Command/step02.vue | 12 +- .../13_salary/components/Command/step03.vue | 8 +- .../13_salary/components/Command/step04.vue | 1026 ++++++++--------- src/modules/13_salary/views/commandSalary.vue | 20 +- 5 files changed, 699 insertions(+), 557 deletions(-) diff --git a/src/modules/13_salary/components/Command/step01.vue b/src/modules/13_salary/components/Command/step01.vue index 400df8b0a..4b5c6b7e7 100644 --- a/src/modules/13_salary/components/Command/step01.vue +++ b/src/modules/13_salary/components/Command/step01.vue @@ -32,7 +32,7 @@ const $q = useQuasar(); //ใช้ noti quasar const route = useRoute(); const router = useRouter(); -const orderId = route.params.orderid; +const orderId = route.params.id; const orderId_paramsName = route.name; const props = defineProps({ @@ -50,8 +50,11 @@ const next = () => props.next(); const myForm = ref(); //option const typeOrderOption = ref([]); +const byOrderOptionMain = ref([]); const byOrderOption = ref([]); const CommandOption = ref([]); +const salaryRoundOptionMain = ref([]); +const salaryRoundOption = ref([]); //Main const typeOrder = ref([]); @@ -62,6 +65,8 @@ const dateCommand = ref(new Date()); const byOrder = ref(""); const nameCommand = ref([]); const positionCommand = ref(""); +const year = ref(0); +const SalaryRound = ref(""); // 33-34-35 const input33 = ref(""); @@ -78,6 +83,9 @@ onMounted(async () => { } else { await fecthTypeOption("noData"); } + if (year.value !== 0) { + fetchSalaryRound(); + } }); // เลือกคำสั่งโดย watch(byOrder, async () => { @@ -97,9 +105,17 @@ watch(nameCommand, async () => { } }); -const commandCodes = ref(["C-PM-33", "C-PM-34", "C-PM-35","C-PM-36","C-PM-37"]); +const commandCodes = ref([ + "C-PM-33", + "C-PM-34", + "C-PM-35", + "C-PM-36", + "C-PM-37", +]); // เรียกคำสั่ง const fecthTypeOption = async (actions: string) => { + console.log(actions); + showLoader(); await http .get(config.API.typeOrder()) @@ -149,6 +165,8 @@ const fetchdetailOrder = async () => { .then(async (res: any) => { const data = res.data.result; + console.log(data); + const orderTypeCode = await data.orderTypeCode.toUpperCase(); typeOrder.value = typeOrderOption.value.find( @@ -175,6 +193,7 @@ const fecthCommand = async () => { await http .get(config.API.organizationsOrder()) .then((res) => { + byOrderOptionMain.value = res.data.result; byOrderOption.value = res.data.result; }) .catch((e) => { @@ -182,30 +201,32 @@ const fecthCommand = async () => { }); }; -function casePm(val: string){ - switch (val) { - case "C-PM-33": - return "เลื่อนเงินเดือนและให้ข้าราชการกรุงเทพมหานครสามัญ ได้รับเงินเดือนสูงกว่าขั้นสูงของตำแหน่งที่ได้รับแต่งตั้ง"; - case "C-PM-34": - return "ให้ข้าราชการกรุงเทพมหานครสามัญได้รับค่าตอบแทนพิเศษ"; - case "C-PM-35": - return `เลื่อนเงินเดือนและให้ข้าราชการกรุงเทพมหานครสามัญที่เกษียณอายุราชการ ในสิ้นปีงบประมาณ พ.ศ. ${new Date().getFullYear()+543} ได้รับเงินเดือนสูงกว่าชั้นสูงของตำแหน่งที่ได้รับแต่งตั้ง`; - case "C-PM-36": - return "เลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้าง สูงกว่าอัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ"; - case "C-PM-37": - return "ให้ลูกจ้างประจำกรุงเทพมหานครได้รับค่าตอบแทนพิเศษ"; - default: - return null; - }} +function casePm(val: string) { + switch (val) { + case "C-PM-33": + return "เลื่อนเงินเดือนและให้ข้าราชการกรุงเทพมหานครสามัญ ได้รับเงินเดือนสูงกว่าขั้นสูงของตำแหน่งที่ได้รับแต่งตั้ง"; + case "C-PM-34": + return "ให้ข้าราชการกรุงเทพมหานครสามัญได้รับค่าตอบแทนพิเศษ"; + case "C-PM-35": + return `เลื่อนเงินเดือนและให้ข้าราชการกรุงเทพมหานครสามัญที่เกษียณอายุราชการ ในสิ้นปีงบประมาณ พ.ศ. ${ + new Date().getFullYear() + 543 + } ได้รับเงินเดือนสูงกว่าชั้นสูงของตำแหน่งที่ได้รับแต่งตั้ง`; + case "C-PM-36": + return "เลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้าง สูงกว่าอัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ"; + case "C-PM-37": + return "ให้ลูกจ้างประจำกรุงเทพมหานครได้รับค่าตอบแทนพิเศษ"; + default: + return null; + } +} async function selectCMP(selectOrder: OrederResult) { if (selectOrder != null) { const orderTypeCode = await selectOrder.commandCode.toUpperCase(); - nameOrder.value = casePm(orderTypeCode) + nameOrder.value = casePm(orderTypeCode); } } - // บันทึกข้อมูล const submit = async () => { let signBy = null; @@ -237,6 +258,8 @@ const submit = async () => { registerPosition: "", signatoryBy: signBy === "" ? nameCommand.value : signBy, signatoryPosition: positionCommand.value, + year: year.value, + period: SalaryRound.value, }; if ( typeOrder.value.commandCode == "C-PM-33" || @@ -307,11 +330,33 @@ const updateOrder = async (formData: Object, orderId: string, type: string) => { }; function filterSelector(val: any, update: Function, fullname: any) { - update(() => { - typeOrderOption.value = typeOrderFilter.value.filter( - (v: any) => v.fullname.toLowerCase().indexOf(val.toLowerCase()) > -1 - ); - }); + switch (fullname) { + case "typeOrderOption": + update(() => { + typeOrderOption.value = typeOrderFilter.value.filter( + (v: any) => v.fullname.toLowerCase().indexOf(val.toLowerCase()) > -1 + ); + }); + break; + case "byOrderOption": + update(() => { + byOrderOption.value = byOrderOptionMain.value.filter( + (v: any) => v.name.toLowerCase().indexOf(val.toLowerCase()) > -1 + ); + }); + break; + + case "SalaryRound": + update(() => { + salaryRoundOption.value = salaryRoundOptionMain.value.filter( + (v: any) => v.name.toLowerCase().indexOf(val.toLowerCase()) > -1 + ); + }); + break; + + default: + break; + } } /** @@ -324,6 +369,40 @@ function getClass(val: boolean) { "full-width cursor-pointer": !val, }; } + +function updateYear() {} + +/** ดึงข้อมูลเริ่มต้น */ +function fetchSalaryRound() { + showLoader(); + http + .get( + config.API.salaryPeriod() + + `?page=${1}&pageSise=${10}&keyword=${""}&year=${year.value}` + ) + .then((res) => { + const data = res.data.result.data; + const list = data.map((e: any) => ({ + id: e.id, + name: + e.period === "SPECIAL" + ? "รอบพิเศษ" + : e.period === "APR" + ? "รอบเมษายน" + : e.period === "OCT" + ? "รอบตุลาคม" + : "-", + })); + salaryRoundOptionMain.value = list; + // salaryRoundOption.value = list; + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +}