From 44ab2aa17e36cd2e988e468f28f068d42b761677 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 9 Aug 2023 12:09:46 +0700 Subject: [PATCH] no message --- src/api/05_placement/api.probation.ts | 8 +- .../components/probation/FormAssign.vue | 453 +++++++++++++----- .../components/probation/MainProbation.vue | 144 ++---- .../components/probation/ProbationDetail.vue | 73 ++- .../05_placement/interface/request/Main.ts | 32 +- src/modules/05_placement/router.ts | 2 +- 6 files changed, 463 insertions(+), 249 deletions(-) diff --git a/src/api/05_placement/api.probation.ts b/src/api/05_placement/api.probation.ts index 351a6685a..b774f3e36 100644 --- a/src/api/05_placement/api.probation.ts +++ b/src/api/05_placement/api.probation.ts @@ -1,6 +1,8 @@ import env from "../index"; const dataOptions = `${env.API_PROBATION_URI}/data-options`; const personal = `${env.API_PROBATION_URI}/personal`; +const calculate = `${env.API_PROBATION_URI}/calculate`; +const finish = `${env.API_PROBATION_URI}/assign`; export default { competencyOptions: () => `${dataOptions}/competency`, @@ -8,7 +10,11 @@ export default { knowledgeOptions: () => `${dataOptions}/knowledge`, skillOptions: () => `${dataOptions}/skill`, lawOptions: () => `${dataOptions}/law`, - + personalList: () => `${personal}/list`, + personal: (personalId:string) => `${personal}?personal_id=${personalId}`, + newAssign: (personalId:string) => `${dataOptions}/new-assign?personal_id=${personalId}`, + calculateDate: () => `${calculate}/assign-finish`, + saveFinish: (personalId:string) => `${finish}/probation-assign?personal_id=${personalId}`, personalAdd: () => `${personal}/add`, // clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}` }; diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index e719eea9b..bc24c0b4c 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -67,6 +67,7 @@ dense borderless option-label="label" + option-value="value" :outlined="routeName === 'probationWorkAdd'" v-model="monthSelect" :label="`ระยะเวลากี่เดือน`" @@ -154,6 +155,7 @@
+ > +
+ > +
+ > +
+ > +
@@ -641,7 +675,9 @@ option-value="id" hide-bottom-space :rules="[(val) => !!val || 'กรุณาเลือกสมรรถนะ']" - :options="filterMain(OPmain,[main2,main3,main4,main5])" + :options=" + filterMain(OPmain, [main2, main3, main4, main5]) + " class="bg-white" :readonly="routeName != 'probationWorkAdd'" dense @@ -649,7 +685,14 @@ :outlined="routeName == 'probationWorkAdd'" v-model="main" label="ตัวที่ 1" - /> + > +
+ > +
+ > +
+ > +
+ > +
@@ -731,7 +810,6 @@
+ > +
+ > +
+ > +
@@ -1179,6 +1278,8 @@
- +
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 @@