From f4aa92634e39880de95e868b20418b6bcea7a0f3 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 7 Aug 2023 18:07:32 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B8=84=E0=B9=89=E0=B8=B2=E0=B8=87=20?= =?UTF-8?q?=E0=B8=9F=E0=B8=B4=E0=B8=A5=E0=B9=80=E0=B8=95=E0=B8=AD=E0=B8=A3?= =?UTF-8?q?=E0=B9=8C=203.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/FormAssign.vue | 888 +++++++----------- 1 file changed, 328 insertions(+), 560 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 895acb766..e719eea9b 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -283,17 +283,22 @@
-
+
-
+
{{ item.description }}
@@ -365,11 +372,11 @@ class="row bg-grey-2 q-py-xs borderCheck" >
-
+
{{ item.description }}
-
+
+
diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index 8467377f8..18e4fa248 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -84,7 +84,7 @@
@@ -257,12 +257,12 @@ const pagination = ref({ const visibleColumns = ref([ "no", "name", - "position", - "level", - "institution", - "time", - "status", - "orderNum", + "position_line", + "position_level", + "organization", + "probation_no", + "order_number", + "probation_status", ]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง // หัวตาราง @@ -286,114 +286,63 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "position", + name: "position_line", align: "left", label: "ตำแหน่งในสายงาน", sortable: true, - field: "position", + field: "position_line", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "level", + name: "position_level", align: "left", label: "ระดับ", sortable: true, - field: "level", + field: "position_level", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "institution", + name: "organization", align: "left", label: "สังกัด", sortable: true, - field: "institution", + field: "organization", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "time", + name: "probation_no", align: "center", label: "ครั้งที่ทดลองงาน", sortable: true, - field: "time", + field: "probation_no", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "orderNum", + name: "order_number", align: "center", label: "เลขที่คําสั่งบรรจุแต่งตั้ง", sortable: true, - field: "orderNum", + field: "order_number", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "status", + name: "probation_status", align: "left", label: "สถานะทดลองงาน", sortable: true, - field: "status", + field: "probation_status", headerStyle: "font-size: 14px", style: "font-size: 14px", }, ]); // ข้อมูลตาราง (จำลอง) -const rows = ref([ - { - no: "1", - name: "นายสมคิด ยอดใจ ", - position: "นักวิชาการพัสดุ", - level: "ปฏิบัติการ", - institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - time: "1", - status: "อยู่ระหว่างการทดลองงาน", - orderNum: "11/2566", - }, - { - no: "2", - name: "นายเกียรติศักดิ์ บัณฑิต", - position: "นักวิชาการพัสดุ", - level: "ปฏิบัติการ", - institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - time: "1", - status: "อยู่ระหว่างการทดลองงาน", - orderNum: "11/2566", - }, - { - no: "3", - name: "นางสาวกัณฐิมา กาฬสินธุ์", - position: "นักจัดการงานทั่วไป", - level: "ปฏิบัติการ", - institution: "กลุ่มงานช่วยนักบริหาร", - time: "1", - status: "อยู่ระหว่างการทดลองงาน", - orderNum: "11/2566", - }, - { - no: "4", - name: "นางสาวเมขลา กระจ่างมนตรี", - position: "นักจัดการงานทั่วไป", - level: "ปฏิบัติการ", - institution: "กลุ่มงานช่วยนักบริหาร", - time: "1", - status: "ไม่ผ่านการทดลอง", - orderNum: "11/2566", - }, - { - no: "5", - name: "นางสาวฐิติรัตน์ พงษ์ศิริ", - position: "นักจัดการงานทั่วไป", - level: "ปฏิบัติการ", - institution: "กลุ่มงานช่วยนักบริหาร", - time: "1", - status: "ผ่านการทดลองงาน", - orderNum: "11/2566", - }, -]); +const rows = ref([]); // หัวตาราง2 const columns2 = ref([ @@ -483,28 +432,37 @@ const rows2 = ref([ // }, ]); -onMounted(async () => {}); - -watch(modal, () => { - if (modal.value === true) { - fecthOrganiz(); - } +onMounted(async () => { + getpersonalList(); }); -const fecthOrganiz = async () => { +// watch(modal, () => { +// if (modal.value === true) { +// getpersonalList(); +// } +// }); + +const getpersonalList = async () => { showLoader(); await http - .get(config.API.profileOrganizRoot) + .get(config.API.personalList()) .then((res) => { - console.log(res); - let id = res.data.result[0].id; - if (id !== "") { - findlist(id); - } - }) - .catch((e) => { - messageError($q, e); + const data = res.data.data; + rows.value = data.map((item: FormMainProbation) => ({ + personal_id: item.personal_id, + name: item.name, + position_line: item.position_line, + position_line_id: item.position_line_id, + position_level: item.position_level, + position_level_id: item.position_level_id, + organization: item.organization, + probation_no: item.probation_no, + order_number: item.order_number, + probation_status: item.probation_status, + })); + console.log("(data)", data); }) + .catch(() => {}) .finally(() => { hideLoader(); }); @@ -559,15 +517,11 @@ const clickAdd = (id: string) => { .onOk(async () => { const postData = { personal_id: id, - } + }; console.log("postData:", postData); - await http - .post(config.API.personalAdd(), postData) - .then((res) => { - console.log("res:", res); - - }); - + await http.post(config.API.personalAdd(), postData).then((res) => { + console.log("res:", res); + }); }) .onCancel(() => {}) .onDismiss(() => {}); diff --git a/src/modules/05_placement/components/probation/ProbationDetail.vue b/src/modules/05_placement/components/probation/ProbationDetail.vue index cb43dad2d..628b2f7c0 100644 --- a/src/modules/05_placement/components/probation/ProbationDetail.vue +++ b/src/modules/05_placement/components/probation/ProbationDetail.vue @@ -34,19 +34,19 @@
ตำแหน่งในสายงาน
-
{{ position }}
+
{{ position_line }}
ระดับ
-
{{ level }}
+
{{ position_level }}
สังกัด
-
{{ institution }}
+
{{ organization }}
@@ -55,18 +55,18 @@
- {{ status }} + {{ probation_status == 'PENDING' ? 'อยู่ในระหว่างการทดลองงาน' : '' }}
@@ -78,7 +78,7 @@