Merge branch 'develop' into dev

* develop:
  แก้คำผิด
  fix(development - record): add button delete
  fix(registry-edit) : input autocomplete
  fix : registry edit
This commit is contained in:
Warunee Tamkoo 2026-03-12 20:35:55 +07:00
commit ae47c7cf34
5 changed files with 108 additions and 51 deletions

View file

@ -295,7 +295,7 @@ async function onDefineData(index: number) {
if (newData) { if (newData) {
const salaryNew = newData.salaryNew; const salaryNew = newData.salaryNew;
const salaryOld = newData.salaryOld; const salaryOld = newData?.salaryOld;
formData.commandCode = salaryNew.commandCode; formData.commandCode = salaryNew.commandCode;
formData.commandNo = salaryNew.commandNo; formData.commandNo = salaryNew.commandNo;
@ -325,32 +325,34 @@ async function onDefineData(index: number) {
formData.posNumCodeSit = salaryNew.posNumCodeSit; formData.posNumCodeSit = salaryNew.posNumCodeSit;
formData.posNumCodeSitAbb = salaryNew.posNumCodeSitAbb; formData.posNumCodeSitAbb = salaryNew.posNumCodeSitAbb;
formReadonly.commandCode = salaryOld.commandCode; if (salaryOld) {
formReadonly.commandNo = salaryOld.commandNo; formReadonly.commandCode = salaryOld.commandCode;
formReadonly.commandYear = salaryOld.commandYear; formReadonly.commandNo = salaryOld.commandNo;
formReadonly.commandDateAffect = salaryOld.commandDateAffect; formReadonly.commandYear = salaryOld.commandYear;
formReadonly.commandDateSign = salaryOld.commandDateSign; formReadonly.commandDateAffect = salaryOld.commandDateAffect;
formReadonly.posNoAbb = salaryOld.posNoAbb; formReadonly.commandDateSign = salaryOld.commandDateSign;
formReadonly.posNo = salaryOld.posNo; formReadonly.posNoAbb = salaryOld.posNoAbb;
formReadonly.positionName = salaryOld.positionName; formReadonly.posNo = salaryOld.posNo;
formReadonly.positionType = salaryOld.positionType; formReadonly.positionName = salaryOld.positionName;
formReadonly.positionLevel = salaryOld.positionLevel; formReadonly.positionType = salaryOld.positionType;
formReadonly.positionCee = salaryOld.positionCee; formReadonly.positionLevel = salaryOld.positionLevel;
formReadonly.positionLine = salaryOld.positionLine; formReadonly.positionCee = salaryOld.positionCee;
formReadonly.positionPathSide = salaryOld.positionPathSide; formReadonly.positionLine = salaryOld.positionLine;
formReadonly.positionExecutive = salaryOld.positionExecutive; formReadonly.positionPathSide = salaryOld.positionPathSide;
formReadonly.positionExecutiveField = salaryOld.positionExecutiveField; formReadonly.positionExecutive = salaryOld.positionExecutive;
formReadonly.amount = salaryOld.amount; formReadonly.positionExecutiveField = salaryOld.positionExecutiveField;
formReadonly.positionSalaryAmount = salaryOld.positionSalaryAmount; formReadonly.amount = salaryOld.amount;
formReadonly.mouthSalaryAmount = salaryOld.mouthSalaryAmount; formReadonly.positionSalaryAmount = salaryOld.positionSalaryAmount;
formReadonly.orgRoot = salaryOld.orgRoot; formReadonly.mouthSalaryAmount = salaryOld.mouthSalaryAmount;
formReadonly.orgChild1 = salaryOld.orgChild1; formReadonly.orgRoot = salaryOld.orgRoot;
formReadonly.orgChild2 = salaryOld.orgChild2; formReadonly.orgChild1 = salaryOld.orgChild1;
formReadonly.orgChild3 = salaryOld.orgChild3; formReadonly.orgChild2 = salaryOld.orgChild2;
formReadonly.orgChild4 = salaryOld.orgChild4; formReadonly.orgChild3 = salaryOld.orgChild3;
formReadonly.remark = salaryOld.remark; formReadonly.orgChild4 = salaryOld.orgChild4;
formReadonly.posNumCodeSit = salaryOld.posNumCodeSit; formReadonly.remark = salaryOld.remark;
formReadonly.posNumCodeSitAbb = salaryOld.posNumCodeSitAbb; formReadonly.posNumCodeSit = salaryOld.posNumCodeSit;
formReadonly.posNumCodeSitAbb = salaryOld.posNumCodeSitAbb;
}
} }
} }

View file

@ -33,9 +33,9 @@ const posExecutiveOptions = defineModel<DataOption[]>("posExecutiveOptions", {
required: true, required: true,
}); });
const props = defineProps({ const props = defineProps<{
updateSelectType: { type: Function, defult: () => {} }, updateSelectType?: (value: any) => void;
}); }>();
/** /**
* ลเตอรอมลจาก input * ลเตอรอมลจาก input
@ -364,6 +364,8 @@ function classInput(val: boolean) {
:label="empType === 'officer' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'" :label="empType === 'officer' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'"
:rules="isAddPosition ? [(val: string) => !!val || `${empType === 'officer' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'}` ] :[]" :rules="isAddPosition ? [(val: string) => !!val || `${empType === 'officer' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'}` ] :[]"
hide-bottom-space hide-bottom-space
autocomplete="on"
name="positionName"
/> />
</div> </div>
@ -388,6 +390,7 @@ function classInput(val: boolean) {
hide-selected hide-selected
fill-input fill-input
clearable clearable
@clear="formData.positionLevel = ''"
input-debounce="0" input-debounce="0"
@update:model-value="props.updateSelectType" @update:model-value="props.updateSelectType"
@filter="(inputValue: string, @filter="(inputValue: string,
@ -461,6 +464,8 @@ function classInput(val: boolean) {
v-model="formData.positionLine" v-model="formData.positionLine"
hide-bottom-space hide-bottom-space
:label="`${'สายงาน'}`" :label="`${'สายงาน'}`"
autocomplete="on"
name="positionLine"
/> />
<!-- <q-select <!-- <q-select
outlined outlined
@ -505,6 +510,8 @@ function classInput(val: boolean) {
v-model="formData.positionPathSide" v-model="formData.positionPathSide"
hide-bottom-space hide-bottom-space
:label="`${'ด้าน/สาขา'}`" :label="`${'ด้าน/สาขา'}`"
autocomplete="on"
name="positionPathSide"
/> />
<!-- <q-select <!-- <q-select
:class="classInput(isReadonly)" :class="classInput(isReadonly)"
@ -549,6 +556,8 @@ function classInput(val: boolean) {
v-model="formData.positionExecutive" v-model="formData.positionExecutive"
hide-bottom-space hide-bottom-space
:label="`${'ตำแหน่งทางการบริหาร'}`" :label="`${'ตำแหน่งทางการบริหาร'}`"
autocomplete="on"
name="positionExecutive"
/> />
<!-- <q-select <!-- <q-select
:class="classInput(isReadonly)" :class="classInput(isReadonly)"
@ -593,6 +602,8 @@ function classInput(val: boolean) {
v-model="formData.positionExecutiveField" v-model="formData.positionExecutiveField"
hide-bottom-space hide-bottom-space
:label="`${'ด้านทางการบริหาร'}`" :label="`${'ด้านทางการบริหาร'}`"
autocomplete="on"
name="positionExecutiveField"
/> />
</div> </div>
@ -693,7 +704,8 @@ function classInput(val: boolean) {
borderless borderless
v-model="formData.orgRoot" v-model="formData.orgRoot"
hide-bottom-space hide-bottom-space
:label="`${'หน่วยงาน'}`" autocomplete="on"
name="organization"
/> />
</div> </div>
@ -708,6 +720,8 @@ function classInput(val: boolean) {
v-model="formData.orgChild1" v-model="formData.orgChild1"
hide-bottom-space hide-bottom-space
:label="`${'ส่วนราชการระดับ 1'}`" :label="`${'ส่วนราชการระดับ 1'}`"
autocomplete="on"
name="organization"
/> />
</div> </div>
@ -722,6 +736,8 @@ function classInput(val: boolean) {
v-model="formData.orgChild2" v-model="formData.orgChild2"
hide-bottom-space hide-bottom-space
:label="`${'ส่วนราชการระดับ 2'}`" :label="`${'ส่วนราชการระดับ 2'}`"
autocomplete="on"
name="organization"
/> />
</div> </div>
@ -736,6 +752,8 @@ function classInput(val: boolean) {
v-model="formData.orgChild3" v-model="formData.orgChild3"
hide-bottom-space hide-bottom-space
:label="`${'ส่วนราชการระดับ 3'}`" :label="`${'ส่วนราชการระดับ 3'}`"
autocomplete="on"
name="organization"
/> />
</div> </div>
@ -750,6 +768,8 @@ function classInput(val: boolean) {
v-model="formData.orgChild4" v-model="formData.orgChild4"
hide-bottom-space hide-bottom-space
:label="`${'ส่วนราชการระดับ 4'}`" :label="`${'ส่วนราชการระดับ 4'}`"
autocomplete="on"
name="organization"
/> />
</div> </div>
</div> </div>

View file

@ -307,8 +307,6 @@ const isAddPosition = ref<boolean>(true); // สถานะการเพิ
/** function fetch ข้อมูลรายการตำแหน่งเงินเดือน*/ /** function fetch ข้อมูลรายการตำแหน่งเงินเดือน*/
async function fetchData() { async function fetchData() {
isLoad.value = true; isLoad.value = true;
rowsMain.value = [];
rows.value = [];
const paht = const paht =
tabs.value === "PENDING" tabs.value === "PENDING"
? `/${empType.value}/${profileId.value}` ? `/${empType.value}/${profileId.value}`

View file

@ -1,15 +1,24 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, computed } from "vue"; import { ref, onMounted, computed } from "vue";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { ResRecord } from "@/modules/15_development/interface/response/Main"; import type { ResRecord } from "@/modules/15_development/interface/response/Main";
const $q = useQuasar(); const $q = useQuasar();
const { date2Thai, onSearchDataTable } = useCounterMixin(); const {
date2Thai,
onSearchDataTable,
showLoader,
hideLoader,
success,
messageError,
dialogRemove,
} = useCounterMixin();
//prosp //prosp
const isProfile = defineModel<boolean>("isProfile", { required: true }); const isProfile = defineModel<boolean>("isProfile", { required: true });
@ -231,10 +240,6 @@ const visibleColumns = ref<string[]>([
"commandNumber", "commandNumber",
"commandDate", "commandDate",
]); ]);
const pagination = ref({
page: 1,
rowsPerPage: 10,
});
/** /**
* convert status to text * convert status to text
@ -253,10 +258,11 @@ function formBmaofficer(val: string) {
/** function เรียกข้อมูลโครงการ*/ /** function เรียกข้อมูลโครงการ*/
function fetchDataProject() { function fetchDataProject() {
rows.value = listPerson.value.filter( const data = listPerson.value.filter(
(e: ResRecord) => e.isProfile === isProfile.value (e: ResRecord) => e.isProfile === isProfile.value
); );
rowsMain.value = rows.value; rowsMain.value = data;
serchDataTable();
} }
function serchDataTable() { function serchDataTable() {
@ -267,6 +273,23 @@ function serchDataTable() {
); );
} }
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.developmentMain + `/delete/${id}`);
success($q, "ลบข้อมูลสำเร็จ");
rowsMain.value = rowsMain.value.filter((e: ResRecord) => e.id !== id);
listPerson.value = listPerson.value.filter((e: ResRecord) => e.id !== id);
serchDataTable();
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */ /** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => { onMounted(() => {
fetchDataProject(); fetchDataProject();
@ -314,12 +337,12 @@ onMounted(() => {
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:paging="true" :paging="true"
v-model:pagination="pagination"
:rows-per-page-options="[20, 50, 100]" :rows-per-page-options="[20, 50, 100]"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
@ -327,6 +350,18 @@ onMounted(() => {
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props"> <q-tr :props="props">
<q-td auto-width>
<q-btn
flat
round
color="red"
@click="handleDelete(props.row.id)"
icon="mdi-delete"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'isDone'" class="text-center"> <div v-if="col.name === 'isDone'" class="text-center">
<q-icon <q-icon

View file

@ -9,7 +9,7 @@ import { usePagination } from "@/composables/usePagination";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/18_command/interface/index/Main"; import type { DataOption } from "@/modules/18_command/interface/index/Main";
import type { DataProfile} from "@/modules/18_command/interface/response/Main"; import type { DataProfile } from "@/modules/18_command/interface/response/Main";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
@ -68,7 +68,7 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "posNo", name: "posNo",
align: "left", align: "left",
label: "เลขที่ตำแหน่ง", label: "เลขที่ตำแหน่ง",
@ -77,7 +77,7 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "position", name: "position",
align: "left", align: "left",
label: "ตำแหน่งในสายงาน", label: "ตำแหน่งในสายงาน",
@ -86,7 +86,7 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "positionType", name: "positionType",
align: "left", align: "left",
label: "ประเภทตำแหน่ง", label: "ประเภทตำแหน่ง",
@ -96,7 +96,9 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.posTypeName return row.posTypeName
? `${row.posTypeName} ${row.positionLevelName ? `(${row.positionLevelName})` : ""}` ? `${row.posTypeName} ${
row.positionLevelName ? `(${row.positionLevelName})` : ""
}`
: "-"; : "-";
}, },
}, },
@ -119,7 +121,7 @@ async function fetchDataPerson() {
{ {
fieldName: type.value, fieldName: type.value,
keyword: keyword.value.trim(), keyword: keyword.value.trim(),
system: (route.meta?.Key as string) || 'COMMAND', system: (route.meta?.Key as string) || "COMMAND",
}, },
{ {
params: params.value, params: params.value,
@ -137,7 +139,7 @@ async function fetchDataPerson() {
function onSubmit() { function onSubmit() {
if (selected.value.length == 0) { if (selected.value.length == 0) {
dialogMessageNotify($q, "กรุณาเลือกบุคคลที่ต้องการมอบหมายคำสั่ง"); dialogMessageNotify($q, "กรุณาเลือกบุคคลที่ต้องการมอบหมายคำสั่ง");
return; return;
} }
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
@ -148,7 +150,7 @@ function onSubmit() {
}); });
await props.fetchListCommand(); await props.fetchListCommand();
handleClose(); handleClose();
success($q, "มอบหมายคำสั่งสำเร็จ"); success($q, "มอบหมายคำสั่งสำเร็จ");
} catch (error) { } catch (error) {
messageError($q, error); messageError($q, error);
} finally { } finally {
@ -180,7 +182,7 @@ watch(modal, (newVal) => {
<template> <template>
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="width: 50vw; max-width: 50vw"> <q-card style="width: 50vw; max-width: 50vw">
<DialogHeader tittle="มอบหมายคำสั่ง" :close="handleClose" /> <DialogHeader tittle="มอบหมายคำสั่ง" :close="handleClose" />
<q-separator /> <q-separator />
<q-card-section style="max-height: 60vh"> <q-card-section style="max-height: 60vh">
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">