From adfbe1b047bc083889b104a6122afbb64a781f10 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 26 Apr 2024 13:56:32 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=AD=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=20step=201=20&=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../13_salary/components/Command/step01.vue | 19 +++++++----- .../13_salary/components/Command/step04.vue | 31 +++++++++++++++++-- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/modules/13_salary/components/Command/step01.vue b/src/modules/13_salary/components/Command/step01.vue index c2b4feb43..3072478c3 100644 --- a/src/modules/13_salary/components/Command/step01.vue +++ b/src/modules/13_salary/components/Command/step01.vue @@ -66,7 +66,7 @@ const byOrder = ref(""); const nameCommand = ref(); const positionCommand = ref(""); const year = ref(0); -const SalaryRound = ref(""); +const SalaryRound = ref(null); // 33-34-35 const input33 = ref(""); @@ -83,9 +83,6 @@ onMounted(async () => { } else { await fecthTypeOption("noData"); } - if (year.value !== 0) { - fetchSalaryRound(); - } }); // เลือกคำสั่งโดย watch(byOrder, async () => { @@ -176,6 +173,9 @@ const fetchdetailOrder = async () => { nameCommand.value = data.signatoryBy; positionCommand.value = data.signatoryPosition; SalaryRound.value = data.salaryPeriodId; + year.value = Number(data.year); + + fetchSalaryRound(); }) .catch((e) => { messageError($q, e); @@ -256,7 +256,8 @@ const submit = async () => { signatoryBy: signBy === "" ? nameCommand.value : signBy, signatoryPosition: positionCommand.value, year: year.value, - salaryPeriodId: SalaryRound.value, + salaryPeriodId: SalaryRound.value.id, + salaryPeriod: SalaryRound.value.code, }; // if ( // typeOrder.value.commandCode == "C-PM-33" || @@ -387,8 +388,13 @@ function fetchSalaryRound() { : e.period === "OCT" ? "รอบตุลาคม" : "-", + code: e.period, })); salaryRoundOptionMain.value = list; + + if (SalaryRound.value) { + SalaryRound.value = list.find((x: any) => x.id == SalaryRound.value); + } }) .catch((err) => { messageError($q, err); @@ -398,6 +404,7 @@ function fetchSalaryRound() { }); } + -
+