ปรับ เรื่องลาออก

This commit is contained in:
setthawutttty 2024-12-12 15:56:23 +07:00
parent c7a8374784
commit f0f3a94b32
2 changed files with 63 additions and 10 deletions

View file

@ -54,10 +54,15 @@ interface MainListResponse {
isActive: boolean;
}
interface DataOptions{
id:string
name:string
}
export type {
QuestionDescription,
OptionQuestions,
OptionQuestions2,
MainList,
MainListResponse,
DataOptions
};

View file

@ -9,6 +9,8 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import type { DataOptions } from "@/modules/03_retire/interface/Main";
import Dialog from "@/modules/03_retire/views/DialogRetire.vue";
import Header from "@/components/DialogHeader.vue";
import Workflow from "@/components/Workflow/Main.vue";
@ -39,9 +41,33 @@ const myform = ref<QForm | null>(null); //form
const tranferOrg = ref(""); //
const dateCommand = ref<Date>(new Date()); //
const dateLeave = ref<Date | null>(null); //
const noteReason = ref(""); //
const noteReason = ref<string>(""); //
const modal = ref<boolean>(false); // dialog
const remark = ref<string>(""); //
const noteReasonOp = ref<DataOptions[]>([
{
id: "CAREER",
name: "ประกอบอาชีพอื่น",
},
{
id: "MOVE",
name: "รับราชการสังกัดอื่น",
},
{
id: "FAMILY",
name: "ดูแลบิดามารดา",
},
{
id: "EDUCATION",
name: "ศึกษาต่อ",
},
{
id: "OTHER",
name: "อื่น ๆ",
},
]);
/** ข้อมูล v-model ของฟอร์ม */
const dataDetail = ref<any>({});
@ -78,7 +104,9 @@ async function onSubmit() {
);
formData.append("Reason", noteReason.value);
formData.append("file", files.value);
if (noteReason.value == "OTHER") {
formData.append("remark", remark.value);
}
http
.post(config.API.listResignByType(link.value), formData)
.then((res) => {
@ -130,6 +158,7 @@ async function fectDataresign(id: string) {
checkCancleLeave.value = currentDate < dueDateMinusOne;
noteReason.value = data.reason;
remark.value = data.remark;
files.value = data.docs;
dataDetail.value = data;
})
@ -328,23 +357,42 @@ onMounted(async () => {
</q-input>
</template>
</datepicker>
<q-input
<q-select
v-model="noteReason"
:class="
routeName !== 'AddRetire' ? 'col-12' : 'col-12 inputgreen'
"
dense
outlined
v-model="noteReason"
label="เหตุผลที่ลาออกจากราชการ"
type="textarea"
emit-value
map-options
hide-bottom-space
option-label="name"
option-value="id"
:options="noteReasonOp"
label="เหตุผลที่ลาออกจากราชการ"
:readonly="routeName != 'AddRetire'"
:rules="[
(val: string) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`,
(val: string) => !!val || `${'กรุณาเลือกเหตุผลที่ลาออกจากราชการ'}`,
]"
/>
>
</q-select>
<q-input
:class="
routeName !== 'AddRetire' ? 'col-12' : 'col-12 inputgreen'
"
v-if="noteReason == 'OTHER'"
v-model="remark"
outlined
hide-bottom-space
dense
type="textarea"
label="ระบุเหตุผล"
:readonly="routeName != 'AddRetire'"
:rules="[
(val: string) => !!val || `${'กรุณาระบุเหตุผล'}`,
]"
></q-input>
<div class="col-12 row" v-if="routeName == 'AddRetire'">
<q-file
v-model="files"