edit แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ

This commit is contained in:
setthawutttty 2023-08-21 15:45:57 +07:00
parent 6823876fa4
commit 0f5bc65e3d
2 changed files with 174 additions and 119 deletions

View file

@ -24,6 +24,8 @@ export default {
calculateDate: () => `${calculate}/assign-finish`, calculateDate: () => `${calculate}/assign-finish`,
saveFinish: (personalId: string) => saveFinish: (personalId: string) =>
`${finish}/probation-assign?personal_id=${personalId}`, `${finish}/probation-assign?personal_id=${personalId}`,
saveEditAssign: (personalId: string) =>
`${finish}/probation-assign/${personalId}`,
personalAdd: () => `${personal}/add`, personalAdd: () => `${personal}/add`,
probationGetAssignList: (personalId:string) => probationGetAssignList: (personalId:string) =>
`${finish}/probation-assign-list?personal_id=${personalId}`, `${finish}/probation-assign-list?personal_id=${personalId}`,

View file

@ -13,10 +13,38 @@
@click="router.go(-1)" @click="router.go(-1)"
v-if="routeName == 'probationWorkAdd'" v-if="routeName == 'probationWorkAdd'"
/> />
<div v-if="routeName !== 'probationWorkAdd'"> <div v-if="routeName == 'probationWorkAdd'">
เพมแบบมอบหมายงานการทดลองปฏหนาทราชการ เพมแบบมอบหมายงานการทดลองปฏหนาทราชการ
</div> </div>
<div v-else>แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ</div> <div v-else class="col-12 row">
<div>แบบมอบหมายงานการทดลองปฏหนาทราชการ</div>
<q-space />
<div v-if="status == false">
<q-btn
flat
round
color="primary"
@click="edit()"
icon="mdi-pencil-outline"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
</div>
<div v-else>
<q-btn flat round color="red" @click="cancel()" icon="mdi-undo">
<q-tooltip>ยกเล</q-tooltip>
</q-btn>
<q-btn
flat
round
color="public"
@click="saveEdit(personalId)"
icon="mdi-content-save-outline"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
</div>
</div> </div>
<q-card <q-card
:bordered="routeName == 'probationWorkAdd'" :bordered="routeName == 'probationWorkAdd'"
@ -34,10 +62,10 @@
<q-input <q-input
:rules="[(val) => !!val || 'กรุณากรอกชื่อ']" :rules="[(val) => !!val || 'กรุณากรอกชื่อ']"
hide-bottom-space hide-bottom-space
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="fullname" v-model="fullname"
label="ชื่อ-สกุล" label="ชื่อ-สกุล"
/> />
@ -46,10 +74,10 @@
<q-input <q-input
:rules="[(val) => !!val || 'กรุณากรอกตำเเหน่ง']" :rules="[(val) => !!val || 'กรุณากรอกตำเเหน่ง']"
hide-bottom-space hide-bottom-space
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="position" v-model="position"
label="ตำแหน่ง" label="ตำแหน่ง"
/> />
@ -63,12 +91,12 @@
hide-bottom-space hide-bottom-space
:options="monthOp" :options="monthOp"
class="col-xs-12 col-sm-6" class="col-xs-12 col-sm-6"
:readonly="routeName !== 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
option-label="label" option-label="label"
option-value="value" option-value="value"
:outlined="routeName === 'probationWorkAdd'" :outlined="status == true"
v-model="monthSelect" v-model="monthSelect"
:label="`ระยะเวลากี่เดือน`" :label="`ระยะเวลากี่เดือน`"
/> />
@ -82,7 +110,7 @@
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="routeName !== 'probationWorkAdd'" :readonly="status != true"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -94,8 +122,8 @@
<q-input <q-input
dense dense
borderless borderless
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']" :rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
hide-bottom-space hide-bottom-space
class="full-width datepicker q-mb-md" class="full-width datepicker q-mb-md"
@ -117,9 +145,7 @@
:locale="'th'" :locale="'th'"
autoApply autoApply
borderless borderless
:readonly=" :readonly="isDatePicker2Readonly || status != true"
isDatePicker2Readonly || routeName !== 'probationWorkAdd'
"
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
> >
@ -133,7 +159,7 @@
<q-input <q-input
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
readonly readonly
class="full-width datepicker q-mb-md" class="full-width datepicker q-mb-md"
:model-value=" :model-value="
@ -166,26 +192,26 @@
option-value="id" option-value="id"
:options="filtermantor(OPcaretaker, [caretaker2])" :options="filtermantor(OPcaretaker, [caretaker2])"
class="col-xs-12 col-sm-6" class="col-xs-12 col-sm-6"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
hide-bottom-space hide-bottom-space
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker1" v-model="caretaker1"
:label="`ผู้ดูแลคนที่ 1`" :label="`ผู้ดูแลคนที่ 1`"
option-label="fullName" option-label="name"
/> />
<q-select <q-select
:rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']" :rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
:options="filtermantor(OPcaretaker, [caretaker1])" :options="filtermantor(OPcaretaker, [caretaker1])"
option-value="id" option-value="id"
option-label="fullName" option-label="name"
hide-bottom-space hide-bottom-space
class="col-xs-12 col-sm-6" class="col-xs-12 col-sm-6"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker2" v-model="caretaker2"
:label="`ผู้ดูแลคนที่ 2`" :label="`ผู้ดูแลคนที่ 2`"
/> />
@ -196,11 +222,11 @@
option-value="id" option-value="id"
:options="filtermantor(OPcaretaker, [caretaker2])" :options="filtermantor(OPcaretaker, [caretaker2])"
class="col-xs-12 col-sm-6" class="col-xs-12 col-sm-6"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
hide-bottom-space hide-bottom-space
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker1" v-model="caretaker1"
:label="`ผู้ดูแลคนที่ 1`" :label="`ผู้ดูแลคนที่ 1`"
option-label="name" option-label="name"
@ -212,10 +238,10 @@
option-label="name" option-label="name"
hide-bottom-space hide-bottom-space
class="col-xs-12 col-sm-6" class="col-xs-12 col-sm-6"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker2" v-model="caretaker2"
:label="`ผู้ดูแลคนที่ 2`" :label="`ผู้ดูแลคนที่ 2`"
/> />
@ -234,7 +260,7 @@
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
3.1 องาน / ภารกจงานทมอบหมาย (ควรมมากกว 1 ภารกจงาน) 3.1 องาน / ภารกจงานทมอบหมาย (ควรมมากกว 1 ภารกจงาน)
<q-btn <q-btn
v-if="routeName == 'probationWorkAdd'" v-if="status == true"
round round
color="primary" color="primary"
dense dense
@ -259,10 +285,10 @@
index < 2 ? [(val) => !!val || 'กรุณากรอกข้อมูล'] : [] index < 2 ? [(val) => !!val || 'กรุณากรอกข้อมูล'] : []
" "
hide-bottom-space hide-bottom-space
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
class="bg-white" class="bg-white"
type="textarea" type="textarea"
v-model="activity_desc[index]" v-model="activity_desc[index]"
@ -275,10 +301,10 @@
index < 2 ? [(val) => !!val || 'กรุณากรอกข้อมูล'] : [] index < 2 ? [(val) => !!val || 'กรุณากรอกข้อมูล'] : []
" "
hide-bottom-space hide-bottom-space
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
class="bg-white" class="bg-white"
type="textarea" type="textarea"
v-model="goal_desc[index]" v-model="goal_desc[index]"
@ -296,7 +322,7 @@
color="red" color="red"
icon="mdi-trash-can-outline" icon="mdi-trash-can-outline"
@click="deleteactivity(index)" @click="deleteactivity(index)"
v-if="routeName === 'probationWorkAdd'" v-if="status == true"
/> />
</div> </div>
</div> </div>
@ -315,7 +341,7 @@
<div class="col-12 text-top2 row items-center"> <div class="col-12 text-top2 row items-center">
ความรความสามารถในการปฏงาน ความรความสามารถในการปฏงาน
<q-btn <q-btn
v-if="routeName == 'probationWorkAdd'" v-if="status == true"
round round
color="primary" color="primary"
dense dense
@ -345,10 +371,10 @@
hide-bottom-space hide-bottom-space
:options="OPknowledge" :options="OPknowledge"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="knowledge[index]" v-model="knowledge[index]"
:label="`ความรู้ความสามารถในการปฏิบัติงาน ${ :label="`ความรู้ความสามารถในการปฏิบัติงาน ${
index + 1 index + 1
@ -360,7 +386,7 @@
class="col-xs-12 col-sm-1 flex justify-center items-center" class="col-xs-12 col-sm-1 flex justify-center items-center"
> >
<q-btn <q-btn
v-if="routeName == 'probationWorkAdd'" v-if="status == true"
flat flat
round round
color="red" color="red"
@ -375,7 +401,7 @@
<div class="col-12 text-top2 row items-center"> <div class="col-12 text-top2 row items-center">
ความรเรองกฎหมายและกฎระเบยบ (ไมเก 20 วข) ความรเรองกฎหมายและกฎระเบยบ (ไมเก 20 วข)
<!-- <q-btn <!-- <q-btn
v-if="routeName == 'probationWorkAdd'" v-if="status == true"
round round
color="primary" color="primary"
dense dense
@ -404,7 +430,7 @@
v-if="item.status_select === 1" v-if="item.status_select === 1"
v-model="item.checked" v-model="item.checked"
dense dense
:disable="routeName != 'probationWorkAdd'" :disable="status != true"
/> />
</div> </div>
<div v-if="index === 0" class="col-11"> <div v-if="index === 0" class="col-11">
@ -443,7 +469,7 @@
:false-value="0" :false-value="0"
v-model="item.checked" v-model="item.checked"
dense dense
:disable="routeName != 'probationWorkAdd'" :disable="status != true"
/> />
</div> </div>
<div class="col-9 q-pl-xl"> <div class="col-9 q-pl-xl">
@ -471,7 +497,7 @@
:false-value="0" :false-value="0"
v-model="item.checked" v-model="item.checked"
dense dense
:disable="routeName != 'probationWorkAdd'" :disable="status != true"
/> />
</div> </div>
<div class="col-9 q-pl-xl"> <div class="col-9 q-pl-xl">
@ -499,7 +525,7 @@
:false-value="0" :false-value="0"
v-model="item.checked" v-model="item.checked"
dense dense
:disable="routeName != 'probationWorkAdd'" :disable="status != true"
/> />
</div> </div>
<div class="col-9 q-pl-xl"> <div class="col-9 q-pl-xl">
@ -527,7 +553,7 @@
:false-value="0" :false-value="0"
v-model="item.checked" v-model="item.checked"
dense dense
:disable="routeName != 'probationWorkAdd'" :disable="status != true"
/> />
</div> </div>
<div class="col-9 q-pl-xl"> <div class="col-9 q-pl-xl">
@ -566,10 +592,10 @@
<div class="col-12"> <div class="col-12">
<q-input <q-input
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="OtherLaw" v-model="OtherLaw"
type="textarea" type="textarea"
/> />
@ -592,11 +618,11 @@
]" ]"
:options="OPcomputer" :options="OPcomputer"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
map-options map-options
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="skill" v-model="skill"
label="ด้านที่ 1" label="ด้านที่ 1"
> >
@ -623,10 +649,10 @@
]" ]"
:options="OPenglish" :options="OPenglish"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="skill2" v-model="skill2"
label="ด้านที่ 2" label="ด้านที่ 2"
> >
@ -651,11 +677,11 @@
]" ]"
:options="OPinfomation" :options="OPinfomation"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
map-options map-options
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="skill3" v-model="skill3"
label="ด้านที่ 3" label="ด้านที่ 3"
> >
@ -680,11 +706,11 @@
]" ]"
:options="OPresourse" :options="OPresourse"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
map-options map-options
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="skill4" v-model="skill4"
label="ด้านที่ 4" label="ด้านที่ 4"
> >
@ -724,11 +750,11 @@
filterMain(OPmain, [main2, main3, main4, main5]) filterMain(OPmain, [main2, main3, main4, main5])
" "
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
map-options map-options
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="main" v-model="main"
label="ตัวที่ 1" label="ตัวที่ 1"
> >
@ -752,11 +778,11 @@
filterMain(OPmain, [main, main3, main4, main5]) filterMain(OPmain, [main, main3, main4, main5])
" "
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
map-options map-options
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="main2" v-model="main2"
label="ตัวที่ 2" label="ตัวที่ 2"
> >
@ -780,11 +806,11 @@
filterMain(OPmain, [main, main2, main4, main5]) filterMain(OPmain, [main, main2, main4, main5])
" "
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
map-options map-options
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="main3" v-model="main3"
label="ตัวที่ 3" label="ตัวที่ 3"
> >
@ -808,11 +834,11 @@
filterMain(OPmain, [main, main2, main3, main5]) filterMain(OPmain, [main, main2, main3, main5])
" "
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
map-options map-options
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="main4" v-model="main4"
label="ตัวที่ 4" label="ตัวที่ 4"
> >
@ -837,11 +863,11 @@
" "
option-value="id" option-value="id"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
map-options map-options
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="main5" v-model="main5"
label="ตัวที่ 5" label="ตัวที่ 5"
> >
@ -870,11 +896,11 @@
]" ]"
:options="filterData(OPgroup, [group2, group3])" :options="filterData(OPgroup, [group2, group3])"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
map-options map-options
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="group" v-model="group"
label="ตัวที่ 1" label="ตัวที่ 1"
> >
@ -898,11 +924,11 @@
]" ]"
:options="filterData(OPgroup, [group, group3])" :options="filterData(OPgroup, [group, group3])"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
map-options map-options
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="group2" v-model="group2"
label="ตัวที่ 2" label="ตัวที่ 2"
> >
@ -927,10 +953,10 @@
]" ]"
:options="filterData(OPgroup, [group, group2])" :options="filterData(OPgroup, [group, group2])"
class="bg-white" class="bg-white"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="group3" v-model="group3"
label="ตัวที่ 3" label="ตัวที่ 3"
> >
@ -1031,10 +1057,10 @@
<div class="col-12 row q-col-gutter-md"> <div class="col-12 row q-col-gutter-md">
<div class="col-12"> <div class="col-12">
<q-input <q-input
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="Other" v-model="Other"
/> />
</div> </div>
@ -1045,7 +1071,7 @@
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
3.6 ผลผลตของงานทคาดหวงและตวชดความสาเรจของงาน 3.6 ผลผลตของงานทคาดหวงและตวชดความสาเรจของงาน
<q-btn <q-btn
v-if="routeName == 'probationWorkAdd'" v-if="status == true"
round round
color="primary" color="primary"
dense dense
@ -1072,10 +1098,10 @@
" "
class="bg-white" class="bg-white"
type="textarea" type="textarea"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="output_desc[index]" v-model="output_desc[index]"
label="ผลผลิตของงานที่คาดหวัง (ไม่เกิน 10 บรรทัด)" label="ผลผลิตของงานที่คาดหวัง (ไม่เกิน 10 บรรทัด)"
/> />
@ -1088,10 +1114,10 @@
hide-bottom-space hide-bottom-space
class="bg-white" class="bg-white"
type="textarea" type="textarea"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="indicator_desc[index]" v-model="indicator_desc[index]"
label="ตัวชี้วัดความสําเร็จของงาน (ไม่เกิน 10 บรรทัด)" label="ตัวชี้วัดความสําเร็จของงาน (ไม่เกิน 10 บรรทัด)"
/> />
@ -1102,7 +1128,7 @@
> >
<q-btn <q-btn
flat flat
v-if="routeName == 'probationWorkAdd'" v-if="status == true"
round round
color="red" color="red"
icon="mdi-trash-can-outline" icon="mdi-trash-can-outline"
@ -1177,10 +1203,10 @@
<li> <li>
นๆ (าม) นๆ (าม)
<q-input <q-input
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="Other5" v-model="Other5"
label="กรอกอื่นๆ" label="กรอกอื่นๆ"
/> />
@ -1267,20 +1293,20 @@
<div class="col-12 row q-col-gutter-md"> <div class="col-12 row q-col-gutter-md">
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="fullname" v-model="fullname"
label="ชื่อ-สกุล" label="ชื่อ-สกุล"
/> />
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="position" v-model="position"
label="ตำแหน่ง" label="ตำแหน่ง"
/> />
@ -1291,7 +1317,7 @@
v-model="date1" v-model="date1"
:locale="'th'" :locale="'th'"
autoApply autoApply
:readonly="routeName !== 'probationWorkAdd'" :readonly="status != true"
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
@ -1306,10 +1332,10 @@
<q-input <q-input
hide-bottom-space hide-bottom-space
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']" :rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
class="full-width datepicker" class="full-width datepicker"
:model-value="date1 != null ? date2Thai(date1) : null" :model-value="date1 != null ? date2Thai(date1) : null"
label="ลงวันที่" label="ลงวันที่"
@ -1338,12 +1364,12 @@
v-if="status == true" v-if="status == true"
:options="filtermantor(OPcaretaker, [caretaker2])" :options="filtermantor(OPcaretaker, [caretaker2])"
option-value="id" option-value="id"
option-label="fullName" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker1" v-model="caretaker1"
label="ผู้ดูแลคนที่ 1" label="ผู้ดูแลคนที่ 1"
/> />
@ -1353,10 +1379,10 @@
option-value="id" option-value="id"
option-label="name" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker1" v-model="caretaker1"
label="ผู้ดูแลคนที่ 1" label="ผู้ดูแลคนที่ 1"
/> />
@ -1368,7 +1394,7 @@
autoApply autoApply
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
:readonly="routeName !== 'probationWorkAdd'" :readonly="status != true"
week-start="0" week-start="0"
> >
<template #year="{ year }"> <template #year="{ year }">
@ -1381,10 +1407,10 @@
<q-input <q-input
hide-bottom-space hide-bottom-space
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']" :rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
class="full-width datepicker" class="full-width datepicker"
:model-value="date2 != null ? date2Thai(date2) : null" :model-value="date2 != null ? date2Thai(date2) : null"
label="ลงวันที่" label="ลงวันที่"
@ -1405,12 +1431,12 @@
v-if="status == true" v-if="status == true"
:options="filtermantor(OPcaretaker, [caretaker1])" :options="filtermantor(OPcaretaker, [caretaker1])"
option-value="id" option-value="id"
option-label="fullName" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker2" v-model="caretaker2"
label="ผู้ดูแลคนที่ 2" label="ผู้ดูแลคนที่ 2"
/> />
@ -1420,10 +1446,10 @@
option-value="id" option-value="id"
option-label="name" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="caretaker2" v-model="caretaker2"
label="ผู้ดูแลคนที่ 2" label="ผู้ดูแลคนที่ 2"
/> />
@ -1436,7 +1462,7 @@
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="routeName !== 'probationWorkAdd'" :readonly="status != true"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -1448,11 +1474,11 @@
<q-input <q-input
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']" :rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
hide-bottom-space hide-bottom-space
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
s s
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
class="full-width datepicker" class="full-width datepicker"
:model-value="date3 != null ? date2Thai(date3) : null" :model-value="date3 != null ? date2Thai(date3) : null"
label="ลงวันที่" label="ลงวันที่"
@ -1481,12 +1507,12 @@
v-if="status == true" v-if="status == true"
:options="OPcommander" :options="OPcommander"
option-value="id" option-value="id"
option-label="fullName" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="commander" v-model="commander"
label="ผู้บังคับบัญชา" label="ผู้บังคับบัญชา"
/> />
@ -1496,10 +1522,10 @@
option-value="id" option-value="id"
option-label="name" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="commander" v-model="commander"
label="ผู้บังคับบัญชา" label="ผู้บังคับบัญชา"
/> />
@ -1510,7 +1536,7 @@
:locale="'th'" :locale="'th'"
autoApply autoApply
borderless borderless
:readonly="routeName !== 'probationWorkAdd'" :readonly="status != true"
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
> >
@ -1524,10 +1550,10 @@
<q-input <q-input
hide-bottom-space hide-bottom-space
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']" :rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
class="full-width datepicker" class="full-width datepicker"
:model-value="date4 != null ? date2Thai(date4) : null" :model-value="date4 != null ? date2Thai(date4) : null"
label="ลงวันที่" label="ลงวันที่"
@ -1556,12 +1582,12 @@
v-if="status == true" v-if="status == true"
:options="OPchairman" :options="OPchairman"
option-value="id" option-value="id"
option-label="fullName" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="chairman" v-model="chairman"
label="ประธานกรรมการ" label="ประธานกรรมการ"
/> />
@ -1571,10 +1597,10 @@
option-value="id" option-value="id"
option-label="name" option-label="name"
class="col-xs-12 col-sm-8" class="col-xs-12 col-sm-8"
:readonly="routeName != 'probationWorkAdd'" :readonly="status != true"
dense dense
borderless borderless
:outlined="routeName == 'probationWorkAdd'" :outlined="status == true"
v-model="chairman" v-model="chairman"
label="ประธานกรรมการ" label="ประธานกรรมการ"
/> />
@ -1615,6 +1641,33 @@ const val1 = ref([
}, },
]); ]);
const status = ref<boolean>(true); const status = ref<boolean>(true);
const dataEdit = async (id:string) => {
const data = putData(id);
await http
.put(config.API.saveEditAssign(id),data)
.then((res) =>{
console.log("success put==>",res)
console.log("save")
})
.catch((e) => {})
.finally(async () => {
status.value = false
hideLoader();
});
}
const saveEdit = (id:string) => {
dialogConfirm($q,() => dataEdit(id))
}
const edit = () => {
status.value = true;
console.log(status.value);
};
const cancel = () => {
status.value = false;
};
const router = useRouter(); const router = useRouter();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -1723,7 +1776,7 @@ const OPcaretaker = ref<
prefix: string; prefix: string;
firstName: string; firstName: string;
lastName: string; lastName: string;
fullName: string; name: string;
citizenId: number; citizenId: number;
isDirector: boolean; isDirector: boolean;
}>[] }>[]
@ -1735,7 +1788,7 @@ const OPcommander = ref<
prefix: string; prefix: string;
firstName: string; firstName: string;
lastName: string; lastName: string;
fullName: string; name: string;
citizenId: number; citizenId: number;
isDirector: boolean; isDirector: boolean;
}>[] }>[]
@ -1746,7 +1799,7 @@ const OPchairman = ref<
prefix: string; prefix: string;
firstName: string; firstName: string;
lastName: string; lastName: string;
fullName: string; name: string;
citizenId: number; citizenId: number;
isDirector: boolean; isDirector: boolean;
}>[] }>[]
@ -1845,7 +1898,7 @@ const getUser = async () => {
prefix: item.prefix, prefix: item.prefix,
firstName: item.firstName, firstName: item.firstName,
lastName: item.lastName, lastName: item.lastName,
fullName: item.prefix + "" + item.firstName + " " + item.lastName, name: item.prefix + "" + item.firstName + " " + item.lastName,
citizenId: item.citizenId, citizenId: item.citizenId,
isDirector: item.isDirector, isDirector: item.isDirector,
})); }));
@ -1854,7 +1907,7 @@ const getUser = async () => {
prefix: item.prefix, prefix: item.prefix,
firstName: item.firstName, firstName: item.firstName,
lastName: item.lastName, lastName: item.lastName,
fullName: item.prefix + "" + item.firstName + " " + item.lastName, name: item.prefix + "" + item.firstName + " " + item.lastName,
citizenId: item.citizenId, citizenId: item.citizenId,
isDirector: item.isDirector, isDirector: item.isDirector,
})); }));
@ -1863,7 +1916,7 @@ const getUser = async () => {
prefix: item.prefix, prefix: item.prefix,
firstName: item.firstName, firstName: item.firstName,
lastName: item.lastName, lastName: item.lastName,
fullName: item.prefix + "" + item.firstName + " " + item.lastName, name: item.prefix + "" + item.firstName + " " + item.lastName,
citizenId: item.citizenId, citizenId: item.citizenId,
isDirector: item.isDirector, isDirector: item.isDirector,
})); }));