เพิ่มคำสั่งแต่งตั้ง เลื่อน ย้ายจากราชกิจจาฯ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-18 11:57:30 +07:00
parent db8046efdb
commit fa13be0a3e
10 changed files with 217 additions and 117 deletions

View file

@ -40,7 +40,10 @@ const props = defineProps({
const commandOp = ref<ListCommand[]>([]); //
const commandType = ref<string>(""); //
const commandNo = ref<string>(""); //
const commandCode = ref<string>(""); //
const commandYear = ref<number>(new Date().getFullYear()); //
const commandVolume = ref<string>(""); //
const commandChapter = ref<string>(""); //
const rows = ref<DataListCommand[]>([]); //
const selected = ref<DataOrder[]>([]); // 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(
<q-separator />
<div v-if="selectCreate == 'NEW'" class="row q-mt-sm q-col-gutter-sm">
<div class="col-12">
<div class="col-12 q-col-gutter-sm">
<q-select
class="inputgreen"
v-model="commandType"
@ -400,53 +409,78 @@ watch(
</template>
</q-select>
</div>
<div class="col-6">
<q-input
class="inputgreen"
outlined
dense
v-model="commandNo"
:label="`${'คำสั่งเลขที่'}`"
/>
</div>
<label class="col-1 flex justify-center items-center text-bold"
>/</label
>
<div class="col-5">
<datepicker
menu-class-name="modalfix"
v-model="commandYear"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
class="inputgreen"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
hide-bottom-space
:model-value="commandYear == null ? null : commandYear + 543"
:label="`${'พ.ศ.'}`"
:rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<div class="row col-12 q-col-gutter-sm">
<div class="col-6" v-if="commandCode !== 'C-PM-47'">
<q-input
class="inputgreen"
outlined
dense
v-model="commandNo"
:label="`${'คำสั่งเลขที่'}`"
/>
</div>
<label
class="col-1 flex justify-center items-center text-bold"
v-if="commandCode !== 'C-PM-47'"
>/
</label>
<div class="col-4" v-if="commandCode === 'C-PM-47'">
<q-input
class="inputgreen"
outlined
dense
v-model="commandVolume"
:label="`${'เล่มที่'}`"
/>
</div>
<div class="col-4" v-if="commandCode === 'C-PM-47'">
<q-input
class="inputgreen"
outlined
dense
v-model="commandChapter"
:label="`${'ตอนที่'}`"
/>
</div>
<div :class="commandCode === 'C-PM-47' ? 'col-4' : 'col-5'">
<datepicker
menu-class-name="modalfix"
v-model="commandYear"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
class="inputgreen"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
hide-bottom-space
:model-value="
commandYear == null ? null : commandYear + 543
"
:label="`${'พ.ศ.'}`"
:rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
</div>