From 018e430289413eda05dfb28bc7389b654232e2b7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 28 Oct 2024 09:54:06 +0700 Subject: [PATCH] fix load --- .../18_command/components/Step/0_Main.vue | 8 ++++--- .../18_command/components/Step/1_Detail.vue | 21 ++++++++--------- .../components/Step/2_ListPersons.vue | 20 +++++++--------- .../components/Step/3_ReceivedCopy.vue | 1 - .../18_command/interface/request/Main.ts | 23 ++++++++----------- 5 files changed, 31 insertions(+), 42 deletions(-) diff --git a/src/modules/18_command/components/Step/0_Main.vue b/src/modules/18_command/components/Step/0_Main.vue index 6481fb0ef..6e8df6a8b 100644 --- a/src/modules/18_command/components/Step/0_Main.vue +++ b/src/modules/18_command/components/Step/0_Main.vue @@ -8,8 +8,8 @@ import { useCommandDetail } from "@/modules/18_command/store/DetailStore"; import http from "@/plugins/http"; import config from "@/app.config"; -import LiveView from "@/modules/18_command/components/Step/View0_Live.vue"; -import DigitalView from "@/modules/18_command/components/Step/View0_Digital.vue"; +import LiveView from "@/modules/18_command/components/Step/View0_Live.vue"; //เซ็นสด +import DigitalView from "@/modules/18_command/components/Step/View0_Digital.vue"; //Digital Signature const $q = useQuasar(); const route = useRoute(); @@ -19,7 +19,7 @@ const { showLoader, hideLoader, messageError, dialogConfirm } = useCounterMixin(); const commandId = ref(route.params.id.toString()); //ID คำสั่ง -const step = ref(1); +const step = ref(1); //สถานะของคำสั่ง const isStatus = ref(""); //สถานะของคำสั่ง const signaturetype = ref(""); //วิธีการลงนาม const isSignature = ref(null); @@ -28,6 +28,7 @@ const isDraft = ref(false); //ทำแบบร่าง const isSign = ref(false); //การลงนาม const isAttachment = ref(false); //เอกสารแนบท้าย +/** ฟังก์ชันเรียกข้อมูลสถานะคำสั่ง*/ async function fetchData() { showLoader(); await http @@ -55,6 +56,7 @@ async function fetchData() { }); } +/** ฟังก์ชันยืนยันวิธีลงนาม*/ function onConfirmSignature() { dialogConfirm( $q, diff --git a/src/modules/18_command/components/Step/1_Detail.vue b/src/modules/18_command/components/Step/1_Detail.vue index 4ade2a325..0439c538d 100644 --- a/src/modules/18_command/components/Step/1_Detail.vue +++ b/src/modules/18_command/components/Step/1_Detail.vue @@ -36,21 +36,21 @@ const props = defineProps({ const commandId = ref(route.params.id.toString()); //ID คำสั่ง // ฟอร์มข้อมูล -let formData = reactive({ - commandNo: "", - commandYear: null, - detailHeader: "", - detailBody: "", - detailFooter: "", - issue: null, +let formData = reactive({ + issue: null, //คำสั่งเรื่อง + commandNo: "", //คำสั่งเลขที่ + commandYear: null, //พ.ศ. + detailHeader: "", //เนื้อหาคำสั่งขึ้นต้น + detailBody: "", //เนื้อหาคำสั่งหลัก + detailFooter: "", //เนื้อหาคำสั่งลงท้าย commandAffectDate: null, //วันที่ลงนาม commandExcecuteDate: null, //วันที่คำสั่งมีผล - isBangkok: null, - // isAttachment: true, + isBangkok: null, //คำสั่งสำนักปลัดกรุงเทพมหานคร }); const modalPreview = ref(false); //แสดงตัวอย่าง const isIdofficer = ref(false); //เช็ค สกจ. +/** ฟังก์ชันเช็ค สกจ.*/ async function fetchCheckIdofficer() { await http .get(config.API.checkIdofficer) @@ -90,7 +90,6 @@ async function onSubmit() { */ onMounted(async () => { await fetchCheckIdofficer(); - formData.commandNo = props.formCommandList.commandNo; formData.commandYear = props.formCommandList.commandYear; formData.detailHeader = props.formCommandList.detailHeader; @@ -109,8 +108,6 @@ onMounted(async () => {
- -
(route.params.id.toString()); //ID คำสั่ const storePosSalary = usePosSalaryDataStore(); const store = useCommandDetail(); const { - dialogMessageNotify, dialogConfirm, dialogRemove, messageError, @@ -34,7 +33,7 @@ const { success, } = useCounterMixin(); -const isChangeData = defineModel("isChangeData", { required: true }); //การเปลี่ยนแปลงของข้อมูล +// const isChangeData = defineModel("isChangeData", { required: true }); //การเปลี่ยนแปลงของข้อมูล const props = defineProps({ onCheckChangeData: { type: Function, required: true }, fetchDataCommandList: { type: Function, required: true }, @@ -219,7 +218,6 @@ function savePosition() { } async function getCommandSalaryList(type: string) { - showLoader(); await http .get(config.API.commandSalaryList(type)) .then(async (res) => { @@ -228,15 +226,11 @@ async function getCommandSalaryList(type: string) { }) .catch((e) => { messageError($q, e); - }) - .finally(() => { - hideLoader(); }); } /** ดึงข้อมูล บุคคล */ async function getPersonList() { - showLoader(); await http .get(config.API.commandAction(commandId.value, "tab2")) .then(async (res) => { @@ -247,17 +241,19 @@ async function getPersonList() { }) .catch((e) => { messageError($q, e); - }) - .finally(() => { - hideLoader(); }); } onMounted(async () => { - await getPersonList(); + const promises = [getPersonList()]; + if (props.commandSysId) { - await getCommandSalaryList(props.commandSysId); + promises.push(getCommandSalaryList(props.commandSysId)); } + showLoader(); + await Promise.all(promises).finally(() => { + hideLoader(); + }); }); diff --git a/src/modules/18_command/components/Step/3_ReceivedCopy.vue b/src/modules/18_command/components/Step/3_ReceivedCopy.vue index 108e92ef3..4a07f94bc 100644 --- a/src/modules/18_command/components/Step/3_ReceivedCopy.vue +++ b/src/modules/18_command/components/Step/3_ReceivedCopy.vue @@ -119,7 +119,6 @@ async function fetchData() { .then(async (res) => { const data = await res.data.result; rows.value = data; - isChangeData.value = false; }) .catch((err) => { diff --git a/src/modules/18_command/interface/request/Main.ts b/src/modules/18_command/interface/request/Main.ts index b928e4b16..1caba8670 100644 --- a/src/modules/18_command/interface/request/Main.ts +++ b/src/modules/18_command/interface/request/Main.ts @@ -12,20 +12,15 @@ interface FormCommand { } interface FormDataDetail { - id?: string; - status?: string; - commandNo: string; - commandYear: number | null; - detailHeader: string; - detailBody: string; - detailFooter: string; - issue: string | null; - commandAffectDate: Date | null; - commandExcecuteDate: Date | null; - commandSysId?: string; - commandTypeName?: string; - isBangkok?: string | null; - isAttachment: boolean; + issue: string | null; //คำสั่งเรื่อง + commandNo: string; //คำสั่งเลขที่ + commandYear: number | null; //พ.ศ. + detailHeader: string; //เนื้อหาคำสั่งขึ้นต้น + detailBody: string; //เนื้อหาคำสั่งหลัก + detailFooter: string; //เนื้อหาคำสั่งลงท้าย + commandAffectDate: Date | null; //วันที่ลงนาม + commandExcecuteDate: Date | null; //วันที่คำสั่งมีผล + isBangkok: string | null; //คำสั่งสำนักปลัดกรุงเทพมหานคร } interface ListCommandSalaryType {