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

View file

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

View file

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

View file

@ -1,15 +1,24 @@
<script setup lang="ts">
import { ref, onMounted, computed } from "vue";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResRecord } from "@/modules/15_development/interface/response/Main";
const $q = useQuasar();
const { date2Thai, onSearchDataTable } = useCounterMixin();
const {
date2Thai,
onSearchDataTable,
showLoader,
hideLoader,
success,
messageError,
dialogRemove,
} = useCounterMixin();
//prosp
const isProfile = defineModel<boolean>("isProfile", { required: true });
@ -231,10 +240,6 @@ const visibleColumns = ref<string[]>([
"commandNumber",
"commandDate",
]);
const pagination = ref({
page: 1,
rowsPerPage: 10,
});
/**
* convert status to text
@ -253,10 +258,11 @@ function formBmaofficer(val: string) {
/** function เรียกข้อมูลโครงการ*/
function fetchDataProject() {
rows.value = listPerson.value.filter(
const data = listPerson.value.filter(
(e: ResRecord) => e.isProfile === isProfile.value
);
rowsMain.value = rows.value;
rowsMain.value = data;
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(() => {
fetchDataProject();
@ -314,12 +337,12 @@ onMounted(() => {
:columns="columns"
:rows="rows"
:paging="true"
v-model:pagination="pagination"
:rows-per-page-options="[20, 50, 100]"
:visible-columns="visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
@ -327,6 +350,18 @@ onMounted(() => {
</template>
<template v-slot:body="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">
<div v-if="col.name === 'isDone'" class="text-center">
<q-icon

View file

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