From 12b3f3569d276bd1b145defff7dc18378036cc54 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 13 Sep 2024 15:44:29 +0700 Subject: [PATCH] fixing bug isOfficer --- .../components/DialogFormAgency.vue | 43 +++++++++++++------ .../components/DialogFormPosition.vue | 1 - 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/modules/02_organization/components/DialogFormAgency.vue b/src/modules/02_organization/components/DialogFormAgency.vue index 8c58f2c49..664a30d55 100644 --- a/src/modules/02_organization/components/DialogFormAgency.vue +++ b/src/modules/02_organization/components/DialogFormAgency.vue @@ -341,20 +341,36 @@ watch( ); /** ถ้ามีการเลือก สกจ. และเคยมีเลือกไปแล้วระบบจะถามและให้ยืนยันการเลือกสกจ. */ -watch( - () => formData.isOfficer, - (newData, oldData) => { - if (newData === true && checkIsOfficer.value === true) { - dialogConfirm( - $q, - () => (formData.isOfficer = true), - "ยืนยันการแก้ไข", - "คุณต้องการแก้ไข สกจ. เป็นส่วนราชการนี้ใช่หรือไม่?", - () => (formData.isOfficer = false) - ); - } +function onChangeIsOfficer() { + if (formData.isOfficer === true && checkIsOfficer.value === true) { + dialogConfirm( + $q, + () => (formData.isOfficer = true), + "ยืนยันการแก้ไข", + "คุณต้องการแก้ไข สกจ. เป็นส่วนราชการนี้ใช่หรือไม่?", + () => (formData.isOfficer = false) + ); } -); +} +// watch( +// () => formData.isOfficer, +// (newData, oldData) => { +// if ( +// newData === true && +// oldData === false && +// checkIsOfficer.value === true && +// props.modal === true +// ) { +// dialogConfirm( +// $q, +// () => (formData.isOfficer = true), +// "ยืนยันการแก้ไข", +// "คุณต้องการแก้ไข สกจ. เป็นส่วนราชการนี้ใช่หรือไม่?", +// () => (formData.isOfficer = false) +// ); +// } +// } +// );