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() { }); } + -
+