From 5acca0efa64ac0af03c735d8d80308a4ca4c8c9d Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 22 Nov 2023 14:21:05 +0700 Subject: [PATCH] no message --- src/components/Dialogs/AddPersonal.vue | 13 ++ .../components/1_Complaint/EditPage.vue | 2 + .../components/1_Complaint/Form.vue | 113 +++++++++++------- .../interface/request/complaint.ts | 2 + .../interface/response/complaint.ts | 2 + .../11_discipline/store/ComplaintsStore.ts | 1 + 6 files changed, 90 insertions(+), 43 deletions(-) diff --git a/src/components/Dialogs/AddPersonal.vue b/src/components/Dialogs/AddPersonal.vue index 9bba86a15..58c3638ef 100644 --- a/src/components/Dialogs/AddPersonal.vue +++ b/src/components/Dialogs/AddPersonal.vue @@ -43,6 +43,7 @@ const visibleColumns = ref([ "no", "idcard", "fullName", + "positionNo", "position", "positionLevel", "salary", @@ -78,6 +79,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "positionNo", + align: "left", + label: "ตำแหน่งเลขที่", + sortable: true, + field: "positionNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "position", align: "left", @@ -205,6 +215,7 @@ onMounted(() => { prefix: "นาง", firstName: "ศิรินภา", lastName: "คงน้อย", + positionNo: "สกก.1", position: "ตำเเหน่ง1", positionLevel: "level1", salary: "100", @@ -217,6 +228,7 @@ onMounted(() => { prefix: "นาย", firstName: "แก้ว", lastName: "คำ", + positionNo: "สกก.1", position: "ตำแหน่ง2", positionLevel: "level2", salary: "100", @@ -229,6 +241,7 @@ onMounted(() => { prefix: "นาย", firstName: "ภัทรานุย", lastName: "คงนอย", + positionNo: "สกก.1", position: "ตำแหน่ง2", positionLevel: "level3", salary: "100", diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index 638455736..ca49efa96 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -21,6 +21,7 @@ const id = ref(route.params.id as string); const personOj = reactive({ idcard: "", name: "", + positionNo: "", position: "", positionLevel: "", salary: "", @@ -76,6 +77,7 @@ const fetchData = async () => { { idcard: "1529900022223", name: "นางศิรินภา คงน้อย", + positionNo: "สกก.1", position: "ธุรการ", positionLevel: "ต้น", salary: "10000", diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index cc4afff8c..2578209e3 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -10,7 +10,7 @@ import type { MyObjectComplaintsRef, DataAddRequest, ArrayPerson, - ArrayFileList + ArrayFileList, } from "@/modules/11_discipline/interface/request/complaint"; /** importStroe*/ @@ -26,7 +26,7 @@ const fileDocDataUpload = ref([]); /** เรียกใช้ store */ const mixin = useCounterMixin(); const complainstStore = useComplainstDataStore(); -const { date2Thai, dialogConfirm,dialogRemove,success } = mixin; +const { date2Thai, dialogConfirm, dialogRemove, success } = mixin; const { selectComplainantTpye, filterSelector } = complainstStore; // function จาก store complainstStore /** validateForm */ @@ -60,6 +60,7 @@ const props = defineProps({ const personOj = reactive({ idcard: "", name: "", + positionNo: "", position: "", positionLevel: "", salary: "", @@ -67,10 +68,10 @@ const personOj = reactive({ }); const fileListOj = reactive({ - id:"", - file:"", - fileName:"", - fileType:"" + id: "", + file: "", + fileName: "", + fileType: "", }); const formData = reactive({ @@ -92,7 +93,7 @@ const formData = reactive({ personId: [], organizationId: null, respondentId: [], - fileList:[fileListOj] + fileList: [fileListOj], }); /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ @@ -161,6 +162,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "positionNo", + align: "left", + label: "ตำแหน่งเลขที่", + sortable: true, + field: "positionNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "position", align: "left", @@ -204,6 +214,7 @@ const visibleColumns = ref([ "no", "idcard", "name", + 'positionNo', "position", "positionLevel", "salary", @@ -320,6 +331,7 @@ async function addPerson() { id: "001", idcard: "0000000000001", name: "นางศิรินภา คงน้อย", + positionNo: "สกก.1", position: "ตำเเหน่ง1", positionLevel: "level1", salary: "10000", @@ -329,6 +341,7 @@ async function addPerson() { id: "002", idcard: "0000000000002", name: "นายแก้ว คำ", + positionNo: "สกก.1", position: "ตำแหน่ง2", positionLevel: "level2", salary: "1000", @@ -338,6 +351,7 @@ async function addPerson() { id: "003", idcard: "0000000000003", name: "นายภัทรานุย คงนอย", + positionNo: "สกก.1", position: "ตำแหน่ง2", positionLevel: "level3", salary: "100", @@ -350,19 +364,28 @@ async function addPerson() { /** * เปิดลิงค์ไฟล์ - * @param link รับมาเป็น https ลิงค์ + * @param link รับมาเป็น https ลิงค์ */ -function downloadFile(link:string){ - window.open(link, '_blank'); +function downloadFile(link: string) { + window.open(link, "_blank"); } -function deleteFile(id:string){ - dialogRemove($q,() => confirmDelete(id)) +/** + * ลบไฟล์ + * @param id id file + */ +function deleteFile(id: string) { + dialogRemove($q, () => confirmDelete(id)); } -function confirmDelete(id:string){ +/** + * ยืนยัน ลบ ไฟล์ + * @param id id file + */ +function confirmDelete(id: string) { success($q, `ลบไฟล์สำเร็จ #id:${id}`); } + /** * เช็คข้อมูลจาก props * เมื่อมีข้อมูล @@ -943,36 +966,40 @@ onMounted(() => {
- - - {{ data.fileName }} - - ดาวน์โหลดไฟล์ - ลบไฟล์ - - - -
+ + + {{ data.fileName }} + + ดาวน์โหลดไฟล์ + ลบไฟล์ + + + diff --git a/src/modules/11_discipline/interface/request/complaint.ts b/src/modules/11_discipline/interface/request/complaint.ts index 7ba76ca35..f115287ca 100644 --- a/src/modules/11_discipline/interface/request/complaint.ts +++ b/src/modules/11_discipline/interface/request/complaint.ts @@ -23,6 +23,7 @@ interface FormData { interface ArrayPerson { idcard: string, name: string, + positionNo: string, position: string, positionLevel: string, salary: string, @@ -54,6 +55,7 @@ interface DataAddRequest { id: string idcard: string name: string + positionNo: string position: string positionLevel: string salary: string diff --git a/src/modules/11_discipline/interface/response/complaint.ts b/src/modules/11_discipline/interface/response/complaint.ts index 5a81bbda8..b59306649 100644 --- a/src/modules/11_discipline/interface/response/complaint.ts +++ b/src/modules/11_discipline/interface/response/complaint.ts @@ -13,6 +13,7 @@ interface DataAdd { id:string idcard:string name:string + positionNo:string position:string positionLevel:string salary:string @@ -22,6 +23,7 @@ interface DataAddResponse { id:string idcard:string name:string + positionNo:string position:string positionLevel:string salary:string diff --git a/src/modules/11_discipline/store/ComplaintsStore.ts b/src/modules/11_discipline/store/ComplaintsStore.ts index 9fc3f98bc..f648a395c 100644 --- a/src/modules/11_discipline/store/ComplaintsStore.ts +++ b/src/modules/11_discipline/store/ComplaintsStore.ts @@ -29,6 +29,7 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () => id: e.id, idcard: e.idcard, name: e.name, + positionNo: e.positionNo, position: e.position, positionLevel: e.positionLevel, salary: addCommas(e.salary),