แก้ แต่งตั้งคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ **ต้องมี 3 role ถึงจะบันทึกได้
This commit is contained in:
parent
e598af0d1c
commit
4c5f329a6a
1 changed files with 30 additions and 2 deletions
|
|
@ -64,6 +64,27 @@ const countRowLength = computed(() => {
|
|||
: false;
|
||||
});
|
||||
|
||||
const findPerson = computed(() => {
|
||||
const roles = ["chairman", "committee", "caregiver"];
|
||||
return roles.every((role) => rows.value.some((row) => row.role === role));
|
||||
});
|
||||
|
||||
const textAlert = computed(() => {
|
||||
const roles = [
|
||||
{ key: "chairman", label: "ประธาน" },
|
||||
{ key: "committee", label: "ผู้บังคับบัญชา" },
|
||||
{ key: "caregiver", label: "ผู้ดูแล" },
|
||||
];
|
||||
|
||||
const missingRoles = roles
|
||||
.filter((role) => !rows.value.some((row) => row.role === role.key))
|
||||
.map((role) => role.label);
|
||||
|
||||
return missingRoles.length > 0
|
||||
? `กรุณาเพิ่มรายชื่อ : ${missingRoles.join(", ")}`
|
||||
: "";
|
||||
});
|
||||
|
||||
const optionsTypeMain = ref<OpfillterTypeSt[]>([]);
|
||||
const optionsType = ref<OpfillterTypeSt[]>([
|
||||
{ id: "chairman", value: "ประธาน" },
|
||||
|
|
@ -599,7 +620,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
<q-separator v-if="!checkRoutePermisson" />
|
||||
<q-card-actions align="right" v-if="!checkRoutePermisson">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
<span class="q-mr-sm text-red" v-if="!findPerson"
|
||||
><q-icon name="mdi-alert-circle-outline"></q-icon>
|
||||
{{ textAlert }}</span
|
||||
>
|
||||
<q-btn
|
||||
label="บันทึก"
|
||||
color="secondary"
|
||||
type="submit"
|
||||
:disable="!findPerson"
|
||||
><q-tooltip>บันทึก</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
|
|
@ -657,7 +686,6 @@ onMounted(async () => {
|
|||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter.prevent="(pagination.page = 1), getPerson()"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue