From fa13be0a3e98e689e9207a87f75831351594699c Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 18 Jul 2025 11:57:30 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B9=81?= =?UTF-8?q?=E0=B8=95=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1=E0=B9=89=E0=B8=87?= =?UTF-8?q?=20=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=20?= =?UTF-8?q?=E0=B8=A2=E0=B9=89=E0=B8=B2=E0=B8=A2=E0=B8=88=E0=B8=B2=E0=B8=81?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B4=E0=B8=88=E0=B8=88?= =?UTF-8?q?=E0=B8=B2=E0=B8=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GovernmentInformation/07_Position.vue | 7 +- .../detail/Salary/01_PositionSalary.vue | 7 +- .../components/AppointMent/DialogOrders.vue | 8 +- .../components/DialogCreateCommand.vue | 130 ++++++++------ .../18_command/components/Main/TableMain.vue | 2 - .../18_command/components/Step/1_Detail.vue | 163 +++++++++++------- .../18_command/interface/request/Main.ts | 1 + .../18_command/interface/response/Main.ts | 2 + src/modules/18_command/store/ListStore.ts | 6 +- src/modules/18_command/views/detail.vue | 8 +- 10 files changed, 217 insertions(+), 117 deletions(-) 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 a8f4c2b42..cb43343df 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -192,7 +192,9 @@ const baseColumns = ref([ field: "commandNo", format(val, row) { return row.commandNo && row.commandYear - ? `${row.commandNo}/${Number(row.commandYear) + 543}` + ? row.commandType !== "C-PM-47" + ? `${row.commandNo}/${Number(row.commandYear) + 543}` + : `${row.commandNo}` : ""; }, headerStyle: "font-size: 14px", @@ -968,7 +970,8 @@ onMounted(async () => { v-if="isLeave == false && checkPermission($route)?.attrIsUpdate" flat :disable=" - props.row.commandId !== null && props.row.commandId !== '' + (props.row.commandId !== null && props.row.commandId !== '') || + props.row.commandType === 'C-PM-47' " :color="props.row.commandId ? 'grey' : 'edit'" dense 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 9966a4e25..29a389787 100644 --- a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue +++ b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue @@ -197,7 +197,9 @@ const baseColumns = ref([ field: "commandNo", format(val, row) { return row.commandNo && row.commandYear - ? `${row.commandNo}/${Number(row.commandYear) + 543}` + ? row.commandType !== "C-PM-47" + ? `${row.commandNo}/${Number(row.commandYear) + 543}` + : `${row.commandNo}` : ""; }, headerStyle: "font-size: 14px", @@ -928,7 +930,8 @@ onMounted(async () => { v-if="isLeave == false && checkPermission($route)?.attrIsUpdate" flat :disable=" - props.row.commandId !== null && props.row.commandId !== '' + (props.row.commandId !== null && props.row.commandId !== '') || + props.row.commandType === 'C-PM-47' " :color="props.row.commandId ? 'grey' : 'edit'" dense diff --git a/src/modules/05_placement/components/AppointMent/DialogOrders.vue b/src/modules/05_placement/components/AppointMent/DialogOrders.vue index 3949269d5..1dd5b9783 100644 --- a/src/modules/05_placement/components/AppointMent/DialogOrders.vue +++ b/src/modules/05_placement/components/AppointMent/DialogOrders.vue @@ -277,6 +277,7 @@ function sendToCommand() { /** ฟังก์ชันเลือกประเภทคำสั่ง */ function filterSelectOrder() { const data = rowsData.value; + selected.value = []; rows.value = data.filter((v: PersonData) => { switch (commandType.value) { @@ -289,6 +290,8 @@ function filterSelectOrder() { case "C-PM-07": return v.typeCommand === "MOVE"; + case "C-PM-47": + return v.posTypeName === "บริหาร" || v.posTypeName === "อำนวยการ"; default: return []; } @@ -329,7 +332,10 @@ watch( const data = await storeCommand.getCommandTypes(); commandMainOp.value = data.filter( (e: ListCommand) => - e.code === "C-PM-05" || e.code === "C-PM-39" || e.code === "C-PM-07" + e.code === "C-PM-05" || + e.code === "C-PM-39" || + e.code === "C-PM-07" || + e.code === "C-PM-47" ); } } diff --git a/src/modules/18_command/components/DialogCreateCommand.vue b/src/modules/18_command/components/DialogCreateCommand.vue index d494839b6..822b82858 100644 --- a/src/modules/18_command/components/DialogCreateCommand.vue +++ b/src/modules/18_command/components/DialogCreateCommand.vue @@ -40,7 +40,10 @@ const props = defineProps({ const commandOp = ref([]); // ประเภทคำสั่ง const commandType = ref(""); //ประเภทคำสั่ง const commandNo = ref(""); //คำสั่งเลขที่ +const commandCode = ref(""); //รหัสคำสั่ง const commandYear = ref(new Date().getFullYear()); //ปี +const commandVolume = ref(""); //เล่มที่ +const commandChapter = ref(""); //ตอนที่ const rows = ref([]); // รายการคำสั่ง const selected = ref([]); // id คำสั่งที่เลือก @@ -189,7 +192,10 @@ function createCommand(isRedirect: boolean) { const body = { commandYear: commandYear.value, - commandNo: commandNo.value, + commandNo: + commandCode.value !== "C-PM-47" + ? commandNo.value + : `${commandVolume.value}/${commandChapter.value}`, commandTypeId: commandType.value, persons: !props.notPerson ? data : [], }; @@ -284,6 +290,8 @@ function clearValue() { selectCreate.value = "NEW"; selected.value = []; filter.value = ""; + commandVolume.value = ""; + commandChapter.value = ""; } /** ฟังก์ชันดึงข้อมูลคำสั่ง */ @@ -294,6 +302,7 @@ async function fetchCommandType() { (v: ListCommand) => v.code == props.commandTypeCode ); commandType.value = commandOp.value[0].id; + commandCode.value = commandOp.value[0].code; } /** @@ -374,7 +383,7 @@ watch(
-
+
-
- -
- -
- - - - - +
+
+ +
+ + +
+ +
+
+ +
+
+ + + + + +
diff --git a/src/modules/18_command/components/Main/TableMain.vue b/src/modules/18_command/components/Main/TableMain.vue index 9667a7a63..53124e0eb 100644 --- a/src/modules/18_command/components/Main/TableMain.vue +++ b/src/modules/18_command/components/Main/TableMain.vue @@ -10,7 +10,6 @@ import { updateCurrentPage } from "@/utils/function"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; import type { Pagination } from "@/modules/18_command/interface/index/Main"; import DialogFormCommand from "@/modules/18_command/components/Main/DialogFormCommand.vue"; @@ -24,7 +23,6 @@ const { hideLoader, success, messageError, - date2Thai, dialogRemove, dialogConfirm, } = useCounterMixin(); diff --git a/src/modules/18_command/components/Step/1_Detail.vue b/src/modules/18_command/components/Step/1_Detail.vue index e1e51e74b..2317b0526 100644 --- a/src/modules/18_command/components/Step/1_Detail.vue +++ b/src/modules/18_command/components/Step/1_Detail.vue @@ -36,6 +36,7 @@ const props = defineProps({ }); const commandId = ref(route.params.id.toString()); //ID คำสั่ง +const commandCode = ref(""); //รหัสคำสั่ง // ฟอร์มข้อมูล let formData = reactive({ issue: null, //คำสั่งเรื่อง @@ -48,6 +49,8 @@ let formData = reactive({ commandExcecuteDate: null, //วันที่คำสั่งมีผล isBangkok: null, //คำสั่งสำนักปลัดกรุงเทพมหานคร }); +const commandVolume = ref(""); //เล่มที่ +const commandChapter = ref(""); //ตอนที่ const modalPreview = ref(false); //แสดงตัวอย่าง const isIdofficer = ref(false); //เช็ค สกจ. @@ -73,6 +76,10 @@ async function onSubmit() { await http .put(config.API.commandAction(commandId.value, "tab1"), { ...formData, + commandNo: + commandCode.value === "C-PM-47" + ? `${commandVolume.value}/${commandChapter.value}` + : formData.commandNo, commandAffectDate: convertDateToAPI(formData.commandAffectDate), commandExcecuteDate: convertDateToAPI(formData.commandExcecuteDate), }) @@ -106,6 +113,10 @@ onMounted(async () => { formData.isBangkok = !isIdofficer.value ? null : props.formCommandList.isBangkok; + commandCode.value = props.formCommandList.commandCode; + const [volume, chapter] = props.formCommandList.commandNo.split("/"); + commandVolume.value = volume || ""; + commandChapter.value = chapter || ""; }); @@ -126,62 +137,93 @@ onMounted(async () => { />
-
-
- -
- -
- +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ + + + + +
@@ -278,7 +320,7 @@ onMounted(async () => {
-
+
{
-
+
{
-
+
{ />
-
+
{ sortable: false, field: "commandNo", format(val, row) { - return val ? `${val}/${row.commandYear + 543}` : "-"; + return val + ? row.commandType !== "C-PM-47" + ? `${val}/${row.commandYear + 543}` + : `${val}` + : "-"; }, headerStyle: "font-size: 14px", style: "font-size: 14px", diff --git a/src/modules/18_command/views/detail.vue b/src/modules/18_command/views/detail.vue index 5f7a02a37..66991373c 100644 --- a/src/modules/18_command/views/detail.vue +++ b/src/modules/18_command/views/detail.vue @@ -48,6 +48,7 @@ let formCommandList = reactive({ status: "", commandTypeName: "", commandNo: "", + commandCode: "", commandYear: null, detailHeader: "", detailBody: "", @@ -77,7 +78,6 @@ async function fetchDataCommandList() { .get(config.API.commandAction(commandId.value, "tab1")) .then(async (res) => { const data = await res.data.result; - formCommandList = data; statusCheck.value = data.commandCode == "C-PM-10" ? true : false; store.dataCommand = data; @@ -124,6 +124,7 @@ onMounted(async () => { + { :key="index" :name="tab.name" :label="tab.label" - :disable="statusCheck && tab.name == 'ListPersons'" + :disable=" + (statusCheck && tab.name == 'ListPersons') || + (commandCode === 'C-PM-47' && tab.name === 'Attached') + " />