diff --git a/src/modules/18_command/components/Step/1_Detail.vue b/src/modules/18_command/components/Step/1_Detail.vue index 1a480e21c..31739f855 100644 --- a/src/modules/18_command/components/Step/1_Detail.vue +++ b/src/modules/18_command/components/Step/1_Detail.vue @@ -39,6 +39,8 @@ let formData = reactive({ commandAffectDate: null, //วันที่ลงนาม commandExcecuteDate: null, //วันที่คำสั่งมีผล isBangkok: false, + isAttachment:true + }); const modalPreview = ref(false); //แสดงตัวอย่าง diff --git a/src/modules/18_command/components/Step/2_ListPersons.vue b/src/modules/18_command/components/Step/2_ListPersons.vue index cbd495755..848a8d85e 100644 --- a/src/modules/18_command/components/Step/2_ListPersons.vue +++ b/src/modules/18_command/components/Step/2_ListPersons.vue @@ -138,9 +138,10 @@ function onDelete(id: string) { dialogRemove($q, async () => { showLoader(); await http - .get(config.API.commandAction(id, "tab2")) + .delete(config.API.commandAction(id, "tab2")) .then((res) => { success($q, "ลบข้อมูลสำเร็จ"); + getPersonList(); }) .catch((e) => { messageError($q, e); diff --git a/src/modules/18_command/components/Step/Dialog2_Salary.vue b/src/modules/18_command/components/Step/Dialog2_Salary.vue index 5088aeb7e..30d130c91 100644 --- a/src/modules/18_command/components/Step/Dialog2_Salary.vue +++ b/src/modules/18_command/components/Step/Dialog2_Salary.vue @@ -37,8 +37,8 @@ function onSubmit() { mouthSalaryAmount: formData.salaryAmount, //เงินเดือน positionSalaryAmount: formData.positionSalaryAmount, //เงินประจำตำแหน่ง amount: formData.monthSalaryAmount, //เงินค่าตอบแทนรายเดือน - remarkHorizontal: formData.remarkVertical, //หมายเหตุแนวตั้ง - remarkVertical: formData.remarkHorizontal, //หมายเหตุแนวนอน + remarkVertical: formData.remarkVertical, //หมายเหตุแนวตั้ง + remarkHorizontal: formData.remarkHorizontal, //หมายเหตุแนวนอน }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); diff --git a/src/modules/18_command/interface/request/Main.ts b/src/modules/18_command/interface/request/Main.ts index a7e9f8cb7..713e3c78c 100644 --- a/src/modules/18_command/interface/request/Main.ts +++ b/src/modules/18_command/interface/request/Main.ts @@ -25,6 +25,7 @@ interface FormDataDetail { commandSysId?: string; commandTypeName?: string; isBangkok?: boolean; + isAttachment:boolean } interface ListCommandSalaryType { diff --git a/src/modules/18_command/views/detail.vue b/src/modules/18_command/views/detail.vue index abba301f8..76c867432 100644 --- a/src/modules/18_command/views/detail.vue +++ b/src/modules/18_command/views/detail.vue @@ -23,7 +23,6 @@ const router = useRouter(); const route = useRoute(); const commandId = ref(route.params.id.toString()); //ID คำสั่ง const store = useCommandDetail(); -const isAttachment = ref(true); const childDetailRef = ref | null>(null); //ref components รายละเอียดคำสั่ง const childListPersonsRef = ref | null>(null); //ref components รายชื่อผู้ออกคำสั่ง @@ -63,6 +62,7 @@ let formCommandList = reactive({ commandAffectDate: null, //วันที่ลงนาม commandExcecuteDate: null, //วันที่คำสั่งมีผล commandSysId: "", // ประเภท คำสั่ง + isAttachment:true }); /** @@ -85,11 +85,8 @@ async function fetchDataCommandList() { .get(config.API.commandAction(commandId.value, "tab1")) .then(async (res) => { const data = await res.data.result; - console.log("🚀 ~ .then ~ data:", data); formCommandList = data; store.dataCommand = data; - //รอ API ส่งมา isAttachment.value = data.isAttachment ; - isAttachment.value = true; // จำลอง isChangeData.value = false; //จำลอง }) .catch((err) => { @@ -217,7 +214,7 @@ onMounted(async () => { ref="childAttachedRef" v-model:is-change-data="isChangeData" :on-check-change-data="onCheckChangeData" - v-model:is-attachment="isAttachment" + v-model:is-attachment="formCommandList.isAttachment " />