From ae4e874f426af8f6a55dd595a2574b1654b17a69 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 3 Feb 2026 16:23:08 +0700 Subject: [PATCH] fix:profileId To citizenId --- .../GovernmentInformation/05_ActingPos.vue | 6 ++++- .../06_HelpGovernment.vue | 4 ++++ .../GovernmentInformation/07_Position.vue | 4 ++++ .../detail/GovernmentInformation/Main.vue | 15 ++++++++++--- .../detail/Salary/01_PositionSalary.vue | 4 ++++ .../components/detail/Salary/Main.vue | 5 ++++- .../components/PersonalList/Table.vue | 5 ++++- .../13_salary/components/DialogInfoMain.vue | 3 +++ .../13_salary/components/InfoSalary.vue | 2 ++ .../components/DialogPreviewCommand.vue | 22 +++++++++++++++---- .../18_command/components/Step/View0_Live.vue | 16 +++++++------- 11 files changed, 68 insertions(+), 18 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue index f1bf0ea9e..c78b7e914 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue @@ -40,6 +40,9 @@ const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const isLeave = defineModel("isLeave", { required: true, }); +const citizenId = defineModel("citizenId", { + required: true, +}); const baseColumns = ref([ { @@ -614,7 +617,7 @@ onMounted(() => { disable v-model="formData.status" label="ใช้งาน" - keep-color="primary" + keep-color /> @@ -642,6 +645,7 @@ onMounted(() => { v-model:modal="modalCommand" v-model:command="command" v-model:command-id="commandId" + :citizen-id="citizenId" /> diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue index 9d4b16405..47eba38f8 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue @@ -46,6 +46,9 @@ const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const isLeave = defineModel("isLeave", { required: true, }); +const citizenId = defineModel("citizenId", { + required: true, +}); const baseColumns = ref([ { @@ -977,6 +980,7 @@ onMounted(() => { v-model:modal="modalCommand" v-model:command="command" v-model:command-id="commandId" + :citizen-id="citizenId" /> diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue index 25f62fdd2..33d3c77ee 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -39,6 +39,9 @@ const profileId = ref( const isLeave = defineModel("isLeave", { required: true, }); +const citizenId = defineModel("citizenId", { + required: true, +}); const store = useGovernmentPosDataStore(); const { @@ -1621,6 +1624,7 @@ onMounted(async () => { v-model:modal="modalCommand" v-model:command="command" v-model:commandId="commandId" + :citizen-id="citizenId" /> diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue index 02b9aaac8..da7af1456 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue @@ -65,13 +65,22 @@ const storeRegistry = useRegistryNewDataStore(); - + - + - + diff --git a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue index fb02b6d92..3a7105c70 100644 --- a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue +++ b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue @@ -39,6 +39,9 @@ const profileId = ref( const isLeave = defineModel("isLeave", { required: true, }); +const citizenId = defineModel("citizenId", { + required: true, +}); const store = useSalaryDataStore(); const { @@ -1624,6 +1627,7 @@ onMounted(async () => { v-model:modal="modalCommand" v-model:command="command" v-model:commandId="commandId" + :citizen-id="citizenId" /> diff --git a/src/modules/04_registryPerson/components/detail/Salary/Main.vue b/src/modules/04_registryPerson/components/detail/Salary/Main.vue index a78286a65..f0646d650 100644 --- a/src/modules/04_registryPerson/components/detail/Salary/Main.vue +++ b/src/modules/04_registryPerson/components/detail/Salary/Main.vue @@ -45,7 +45,10 @@ const tab = ref("1"); - + diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 1f6c782f3..3e2038712 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -53,6 +53,7 @@ const props = defineProps({ const modalCommand = ref(false); const command = ref(""); const commandId = ref(""); +const commandCitizenId = ref(""); let roleAdmin = ref(false); const edit = ref(true); @@ -912,9 +913,10 @@ function onSearchAdd() { } function onRefCommand(data: any) { - modalCommand.value = true; command.value = data.refCommandNo; commandId.value = data.commandId; + commandCitizenId.value = data.citizenId; + modalCommand.value = true; // commandId.value = 'bdf9da91-ba45-497a-a2b7-cc49e2446d97'; //จำลอง } @@ -1787,6 +1789,7 @@ onMounted(async () => { v-model:modal="modalCommand" v-model:command="command" v-model:commandId="commandId" + v-model:citizen-id="commandCitizenId" /> diff --git a/src/modules/13_salary/components/DialogInfoMain.vue b/src/modules/13_salary/components/DialogInfoMain.vue index 79868ccbc..71fe5997f 100644 --- a/src/modules/13_salary/components/DialogInfoMain.vue +++ b/src/modules/13_salary/components/DialogInfoMain.vue @@ -36,6 +36,7 @@ const props = defineProps({ const avatar = ref(""); const fullName = ref(""); const position = ref(""); +const citizenId = ref(""); const isLoading = ref(true); /** function เรียกข้อมูลส่วนตัว*/ @@ -48,6 +49,7 @@ function fetchInformation() { fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`; position.value = data.position; + citizenId.value = data.citizenId; if (data.avatarName) { await fetchProfile(data.id as string, data.avatarName); @@ -220,6 +222,7 @@ watch( v-if="type === 'posSalary'" v-model:profileId="profileId" :employeeClass="employeeClass" + :citizenId="citizenId" /> ("profileId", { required: true }); const employeeClass = defineModel("employeeClass", { required: true }); +const citizenId = defineModel("citizenId", { required: true }); const modalCommand = ref(false); const command = ref(""); @@ -470,6 +471,7 @@ onMounted(() => { v-model:modal="modalCommand" v-model:command="command" v-model:commandId="commandId" + :citizen-id="citizenId" /> diff --git a/src/modules/18_command/components/DialogPreviewCommand.vue b/src/modules/18_command/components/DialogPreviewCommand.vue index 3f3fa9f4b..836abb6bd 100644 --- a/src/modules/18_command/components/DialogPreviewCommand.vue +++ b/src/modules/18_command/components/DialogPreviewCommand.vue @@ -19,6 +19,7 @@ const { showLoader, hideLoader, messageError } = useCounterMixin(); const modal = defineModel("modal", { required: true }); const command = defineModel("command", { required: true }); const commandId = defineModel("commandId", { required: true }); +const citizenId = defineModel("citizenId", { required: true }); const promises = ref([]); const tab = ref("main"); //tab @@ -37,6 +38,7 @@ function closeDialog() { modal.value = false; command.value = ""; commandId.value = ""; + citizenId.value = ""; } /** @@ -88,13 +90,25 @@ async function downloadCover(type: string) { */ async function fetchDataCommand(type: string) { let newType = type === "cover" ? "คำสั่ง" : "แนบท้าย"; + const pathAPI = + type === "cover" + ? config.API.fileByFile( + "ระบบออกคำสั่ง", + newType, + commandId.value, + newType + ) + : config.API.subFileByFileName( + "ระบบออกคำสั่ง", + newType, + commandId.value, + citizenId.value, + newType + ); await http - .get( - config.API.fileByFile("ระบบออกคำสั่ง", newType, commandId.value, newType) - ) + .get(pathAPI) .then(async (res) => { const data = res.data; - console.log(res); if (type === "cover") { dataCover.value = data; diff --git a/src/modules/18_command/components/Step/View0_Live.vue b/src/modules/18_command/components/Step/View0_Live.vue index 4d03fa36f..57a7d3ef6 100644 --- a/src/modules/18_command/components/Step/View0_Live.vue +++ b/src/modules/18_command/components/Step/View0_Live.vue @@ -155,7 +155,7 @@ async function uploadFileDoc( uploadUrl: string, file: any, group: string, - profileId?: string + id?: string ) { const formData = new FormData(); formData.append("file", file); @@ -177,7 +177,7 @@ async function uploadFileDoc( fileUploadOrder.value = null; } else { attachmentList.value.forEach((e) => { - if (e.id === profileId) { + if (e.id === id) { e.file = null; } }); @@ -217,13 +217,13 @@ async function fetchDocOrder(type: string) { }); } -async function fetchDocTailer(type: string, profileId: string) { +async function fetchDocTailer(type: string, id: string) { await http - .get(config.API.subFile("ระบบออกคำสั่ง", type, commandId.value, profileId)) + .get(config.API.subFile("ระบบออกคำสั่ง", type, commandId.value, id)) .then((res) => { const data = res.data[0]; attachmentList.value.forEach((e) => { - if (e.id === profileId) { + if (e.id === id) { attachmentFiles.value[e.id] = data; } }); @@ -245,7 +245,7 @@ function downloadFile( file: any, group: string, isView: boolean = false, - profileId: string + id: string ) { let type = group === "order" ? "คำสั่ง" : "แนบท้าย"; @@ -261,7 +261,7 @@ function downloadFile( "ระบบออกคำสั่ง", type, commandId.value, - profileId, + id, file.fileName ); @@ -330,7 +330,7 @@ async function fetchLists() { .then(async (res) => { const data = await res.data.result; attachmentList.value = data.commandRecives.map((item: any) => ({ - id: item.id, + id: item.citizenId, name: item.prefix + item.firstName + " " + item.lastName, file: null, }));