From ecd6c890aeb63c55eb5bdf484303be3a6650c51d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 13 Feb 2024 09:59:49 +0700 Subject: [PATCH 01/10] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20tr?= =?UTF-8?q?ee=20=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA=E0=B8=A3?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/02_organizationalNew/components/listView.vue | 4 +++- src/modules/02_organizationalNew/components/mainTree.vue | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/02_organizationalNew/components/listView.vue b/src/modules/02_organizationalNew/components/listView.vue index 2ff6a8217..a41272d1e 100644 --- a/src/modules/02_organizationalNew/components/listView.vue +++ b/src/modules/02_organizationalNew/components/listView.vue @@ -34,6 +34,8 @@ const nodeTree = ref(); // ข้อมูล Tree const nodeId = ref(""); // id ของ Tree const orgLevel = ref(0); // levelTree const isLoad = ref(false); // loadTable +const isLoadTree = ref(false); // loadTable + const selected = ref(""); const reqMaster = reactive({ @@ -53,6 +55,7 @@ const posMaster = ref([]); * @param id id โครงสร้าง */ async function fetchDataTree(id: string) { + isLoadTree.value = false; showLoader(); await http .get(config.API.orgByid(id.toString())) @@ -185,7 +188,6 @@ watch( diff --git a/src/modules/02_organizationalNew/components/mainTree.vue b/src/modules/02_organizationalNew/components/mainTree.vue index 88d482208..627866f2b 100644 --- a/src/modules/02_organizationalNew/components/mainTree.vue +++ b/src/modules/02_organizationalNew/components/mainTree.vue @@ -28,7 +28,6 @@ const { dialogRemove, showLoader, hideLoader, messageError, success } = /** props*/ const nodeTEST = defineModel("nodeTree", { default: [] }); const nodeId = defineModel("nodeId", { required: true }); -const selected = defineModel("selected", { required: true }); const props = defineProps({ fetchDataTree: { type: Function, @@ -366,8 +365,6 @@ watch( nodes.value = nodeTEST.value; } ); - -const modaeMenu = ref(false); diff --git a/src/modules/01_metadataNew/views/position.vue b/src/modules/01_metadataNew/views/position.vue index bd15a4547..0c2ce6698 100644 --- a/src/modules/01_metadataNew/views/position.vue +++ b/src/modules/01_metadataNew/views/position.vue @@ -41,12 +41,21 @@ onMounted(() => { class="q-py-xs" /> - -
- - - -
+ + + + + + + + + + + + + + + From 833ab217e611686c80e6e26248876abc15c41517 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Tue, 13 Feb 2024 10:45:46 +0700 Subject: [PATCH 04/10] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA=E0=B8=A3=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=E0=B8=AD=E0=B8=B1=E0=B8=95=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=81=E0=B8=B3=E0=B8=A5=E0=B8=B1=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PositionDetail.vue | 213 +++++++++--------- .../components/listView.vue | 27 +++ .../components/mainTree.vue | 64 +++--- .../components/tableTree.vue | 27 ++- 4 files changed, 184 insertions(+), 147 deletions(-) diff --git a/src/modules/02_organizationalNew/components/PositionDetail.vue b/src/modules/02_organizationalNew/components/PositionDetail.vue index 87c76d73d..f47fb9624 100644 --- a/src/modules/02_organizationalNew/components/PositionDetail.vue +++ b/src/modules/02_organizationalNew/components/PositionDetail.vue @@ -43,81 +43,81 @@ const formData = reactive({ status: "", //*สถานะตำแหน่ง }); -const columns = ref([ - { - name: "no", - align: "left", - label: "ลำดับ", - sortable: false, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionName", - align: "left", - label: "ตำแหน่งในสายงาน", - sortable: true, - field: "positionName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionField", - align: "left", - label: "สายงาน", - sortable: true, - field: "positionField", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posTypeName", - align: "left", - label: "ประเภทตำเเหน่ง", - sortable: true, - field: "posTypeName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posLevelName", - align: "left", - label: "ระดับตำแหน่ง", - sortable: true, - field: "posLevelName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posExecutiveName", - align: "left", - label: "ตำแหน่งทางการบริหาร", - sortable: true, - field: "posExecutiveName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionExecutiveField", - align: "left", - label: "ด้านทางการบริหาร", - sortable: true, - field: "positionExecutiveField", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionArea", - align: "left", - label: "ด้าน/สาขา", - sortable: true, - field: "positionArea", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, -]); -const row = ref([]); +// const columns = ref([ +// { +// name: "no", +// align: "left", +// label: "ลำดับ", +// sortable: false, +// field: "no", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// { +// name: "positionName", +// align: "left", +// label: "ตำแหน่งในสายงาน", +// sortable: true, +// field: "positionName", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// { +// name: "positionField", +// align: "left", +// label: "สายงาน", +// sortable: true, +// field: "positionField", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// { +// name: "posTypeName", +// align: "left", +// label: "ประเภทตำเเหน่ง", +// sortable: true, +// field: "posTypeName", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// { +// name: "posLevelName", +// align: "left", +// label: "ระดับตำแหน่ง", +// sortable: true, +// field: "posLevelName", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// { +// name: "posExecutiveName", +// align: "left", +// label: "ตำแหน่งทางการบริหาร", +// sortable: true, +// field: "posExecutiveName", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// { +// name: "positionExecutiveField", +// align: "left", +// label: "ด้านทางการบริหาร", +// sortable: true, +// field: "positionExecutiveField", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// { +// name: "positionArea", +// align: "left", +// label: "ด้าน/สาขา", +// sortable: true, +// field: "positionArea", +// headerStyle: "font-size: 14px", +// style: "font-size: 14px", +// }, +// ]); +// const row = ref([]); /** function ปิด popup*/ function close() { @@ -137,18 +137,26 @@ watch( : store.typeOrganizational === "draft" ? "แบบร่าง" : "ยุบเลิก"; - row.value = prosp.dataDetailPos.positions.map((e: Position) => ({ - ...e, - positionName: e.positionName ? e.positionName : "-", - positionField: e.positionField ? e.positionField : "-", - posTypeName: e.posTypeName ? e.posTypeName : "-", - posLevelName: e.posLevelName ? e.posLevelName : "-", - posExecutiveName: e.posExecutiveName ? e.posExecutiveName : "-", - positionExecutiveField: e.positionExecutiveField - ? e.positionExecutiveField - : "-", - positionArea: e.positionArea ? e.positionArea : "-", - })); + formData.positionType = prosp.dataDetailPos.posTypeName + formData.positionPathSide = prosp.dataDetailPos.positionName + formData.positionLine = prosp.dataDetailPos.positionField + formData.positionSide = prosp.dataDetailPos.positionArea ? prosp.dataDetailPos.positionArea : "-" + formData.positionLevel = prosp.dataDetailPos.posLevelName + formData.positionExecutive = prosp.dataDetailPos.posExecutiveName ? prosp.dataDetailPos.posExecutiveName : "-" + formData.positionExecutiveSide = prosp.dataDetailPos.positionExecutiveField ? prosp.dataDetailPos.positionExecutiveField : "-" + + // row.value = prosp.dataDetailPos.positions.map((e: Position) => ({ + // ...e, + // positionName: e.positionName ? e.positionName : "-", + // positionField: e.positionField ? e.positionField : "-", + // posTypeName: e.posTypeName ? e.posTypeName : "-", + // posLevelName: e.posLevelName ? e.posLevelName : "-", + // posExecutiveName: e.posExecutiveName ? e.posExecutiveName : "-", + // positionExecutiveField: e.positionExecutiveField + // ? e.positionExecutiveField + // : "-", + // positionArea: e.positionArea ? e.positionArea : "-", + // })); } } } @@ -172,7 +180,6 @@ watch(

{{ formData.positionNo }}

- + - + - + - + - + - + - +
@@ -261,7 +268,7 @@ watch(
-
+
diff --git a/src/modules/02_organizationalNew/components/listView.vue b/src/modules/02_organizationalNew/components/listView.vue index a41272d1e..1e6ba514e 100644 --- a/src/modules/02_organizationalNew/components/listView.vue +++ b/src/modules/02_organizationalNew/components/listView.vue @@ -124,6 +124,32 @@ async function fetchDataTable(id: string, level: number, action: boolean) { }); } +/** ดึงข้อมูลสถิติจำนวนด้านบน*/ +function getSummary() { + http + .post(config.API.orgSummary, { + id: reqMaster.id, //*Id node + type: reqMaster.type, //*ประเภทnode + isNode: reqMaster.isAll, //*นับทั้ง node ไหม + }) + .then(async (res: any) => { + const data = await res.data.result; + + store.getSumPosition({ + totalPosition: data.totalPosition, + totalPositionCurrentUse: data.totalPositionCurrentUse, + totalPositionCurrentVacant: data.totalPositionCurrentVacant, + totalPositionNextUse: data.totalPositionNextUse, + totalPositionNextVacant: data.totalPositionNextVacant, + totalRootPosition: data.totalPosition, + totalRootPositionCurrentUse: data.totalPositionCurrentUse, + totalRootPositionCurrentVacant: data.totalPositionCurrentVacant, + totalRootPositionNextUse: data.totalPositionNextUse, + totalRootPositionNextVacant: data.totalPositionNextVacant, + }); + }); +} + /** funcion ค้นหาข้อมูลใน Table*/ async function filterKeyword() { reqMaster.page = 1; @@ -171,6 +197,7 @@ watch([() => reqMaster.page, () => reqMaster.pageSize], () => { watch( () => reqMaster.isAll, () => { + getSummary(); if (reqMaster.page !== 1) { reqMaster.page = 1; } else { diff --git a/src/modules/02_organizationalNew/components/mainTree.vue b/src/modules/02_organizationalNew/components/mainTree.vue index 627866f2b..6cca066cb 100644 --- a/src/modules/02_organizationalNew/components/mainTree.vue +++ b/src/modules/02_organizationalNew/components/mainTree.vue @@ -96,39 +96,39 @@ const orgId = ref(""); * @param data ข่อมูล Tree */ function updateSelected(data: DataTree) { - store.treeId = data.orgTreeId; - store.level = data.orgLevel; - // if (data.orgTreeId === nodeId.value) { - // nodeId.value = ""; - // } else { - nodeId.value = data.orgTreeId ? data.orgTreeId : "111"; + if (!store.treeId || store.treeId != data.orgTreeId) { + store.treeId = data.orgTreeId; + store.level = data.orgLevel; - data.orgTreeId && props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true); - /** ดึงข้อมูลสถิติจำนวนด้านบน*/ - http - .post(config.API.orgSummary, { - id: data.orgTreeId, //*Id node - type: data.orgLevel, //*ประเภทnode - isNode: false, //*นับทั้ง node ไหม - }) - .then(async (res: any) => { - const data = await res.data.result; - if (data) { - store.getSumPosition({ - totalPosition: data.totalPosition, - totalPositionCurrentUse: data.totalPositionCurrentUse, - totalPositionCurrentVacant: data.totalPositionCurrentVacant, - totalPositionNextUse: data.totalPositionNextUse, - totalPositionNextVacant: data.totalPositionNextVacant, - totalRootPosition: data.totalPosition, - totalRootPositionCurrentUse: data.totalPositionCurrentUse, - totalRootPositionCurrentVacant: data.totalPositionCurrentVacant, - totalRootPositionNextUse: data.totalPositionNextUse, - totalRootPositionNextVacant: data.totalPositionNextVacant, - }); - } - }); - // } + nodeId.value = data.orgTreeId ? data.orgTreeId : "111"; + + data.orgTreeId && + props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true); + /** ดึงข้อมูลสถิติจำนวนด้านบน*/ + http + .post(config.API.orgSummary, { + id: data.orgTreeId, //*Id node + type: data.orgLevel, //*ประเภทnode + isNode: false, //*นับทั้ง node ไหม + }) + .then(async (res: any) => { + const data = await res.data.result; + if (data) { + store.getSumPosition({ + totalPosition: data.totalPosition, + totalPositionCurrentUse: data.totalPositionCurrentUse, + totalPositionCurrentVacant: data.totalPositionCurrentVacant, + totalPositionNextUse: data.totalPositionNextUse, + totalPositionNextVacant: data.totalPositionNextVacant, + totalRootPosition: data.totalPosition, + totalRootPositionCurrentUse: data.totalPositionCurrentUse, + totalRootPositionCurrentVacant: data.totalPositionCurrentVacant, + totalRootPositionNextUse: data.totalPositionNextUse, + totalRootPositionNextVacant: data.totalPositionNextVacant, + }); + } + }); + } } const breakLoop = ref(false); diff --git a/src/modules/02_organizationalNew/components/tableTree.vue b/src/modules/02_organizationalNew/components/tableTree.vue index 2c3d80e2f..df21ce9ed 100644 --- a/src/modules/02_organizationalNew/components/tableTree.vue +++ b/src/modules/02_organizationalNew/components/tableTree.vue @@ -89,12 +89,6 @@ const listMenu = ref([ type: "HISTORY", color: "deep-purple", }, - { - label: "ดูรายละเอียด", - icon: "mdi-eye", - type: "VIEWDETIAL", - color: "blue", - }, ]); const document = ref([ { @@ -612,16 +606,12 @@ async function onClickDownloadReport(val: string) { e.type === 'HISTORY')" :key="index" clickable v-close-popup @click=" - item.type === 'VIEWDETIAL' - ? onClickViewDetail(props.row) - : item.type === 'EDIT' + item.type === 'EDIT' ? onClickPosition('EDIT', props.row.id) : item.type === 'DEL' ? onClickDelete(props.row.id) @@ -645,6 +635,19 @@ async function onClickDownloadReport(val: string) { + + +
+ +
ดูรายละเอียด
+
+
+
From fd14b1b3643cb39a84e1dacb3c6a882c559ffbfe Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 13 Feb 2024 11:01:11 +0700 Subject: [PATCH 05/10] =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1?= =?UTF-8?q?=E0=B8=B9=E0=B8=A5=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=20=3D>=20=E0=B9=80=E0=B8=8A=E0=B9=87?= =?UTF-8?q?=E0=B8=84=E0=B9=80=E0=B8=A5=E0=B8=82=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=8A=E0=B8=B2=E0=B8=8A=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/registry/registry.vue | 289 +++++++++++------- 1 file changed, 173 insertions(+), 116 deletions(-) diff --git a/src/modules/04_registryNew/components/registry/registry.vue b/src/modules/04_registryNew/components/registry/registry.vue index e6f99dd76..43e689406 100644 --- a/src/modules/04_registryNew/components/registry/registry.vue +++ b/src/modules/04_registryNew/components/registry/registry.vue @@ -18,6 +18,7 @@ const { messageError, showLoader, hideLoader, + dialogMessageNotify, } = mixin; const columns = ref([ { @@ -170,34 +171,66 @@ async function fetchPrefix() { } async function addData() { - await http.post(config.API.registryNew, { - prefix: prefix.value, - firstName: firstName.value, - lastName: lastName.value, - citizenId: citizenId.value, - position: position.value, - posTypeId: posTypeId.value, - posLevelId: posLevelId.value, - }); - fetchData(); + showLoader(); + await http + .post(config.API.registryNew, { + prefix: prefix.value, + firstName: firstName.value, + lastName: lastName.value, + citizenId: citizenId.value, + position: position.value, + posTypeId: posTypeId.value, + posLevelId: posLevelId.value, + }) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + fetchData(); + hideLoader(); + }); } async function editData(id: string) { - await http.put(config.API.registryNewId(id), { - prefix: prefix.value, - firstName: firstName.value, - lastName: lastName.value, - citizenId: citizenId.value, - position: position.value, - posTypeId: posTypeId.value, - posLevelId: posLevelId.value, - }); - fetchData(); + showLoader(); + await http + .put(config.API.registryNewId(id), { + prefix: prefix.value, + firstName: firstName.value, + lastName: lastName.value, + citizenId: citizenId.value, + position: position.value, + posTypeId: posTypeId.value, + posLevelId: posLevelId.value, + }) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + fetchData(); + hideLoader(); + }); } async function deleteData(id: string) { - await http.delete(config.API.registryNewId(id)); - fetchData(); + await http + .delete(config.API.registryNewId(id)) + .then(() => { + success($q, "ลบข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + fetchData(); + hideLoader(); + }); } function updateSelectType(val: string) { @@ -250,6 +283,28 @@ watch(posTypeId, () => { updateSelectType(posTypeId.value); }, 200); }); + +/** + * function ตรวจสอบเลขประจำตัวประชาชน + * @param citizenId เลขประจำตัวประชาชน + */ +async function changeCardID(citizenId: string | number | null) { + if (citizenId != null && typeof citizenId == "string") { + if (citizenId.length == 13 && citizenId) { + await http + .get(config.API.profileCitizenId(citizenId)) + .then((res) => { + console.log(res); + const statusId = res.data.result.citizen; + !statusId && + dialogMessageNotify($q, "เลขประจำตัวประชาชนนี้มีการใช้งานแล้ว"); + }) + .catch((err) => { + messageError($q, err); + }); + } + } +} - - @@ -311,6 +344,7 @@