edit select person in probation system

This commit is contained in:
Warunee Tamkoo 2024-11-07 15:42:52 +07:00
parent 884fe69e2c
commit 1ae929acbf
5 changed files with 46 additions and 14 deletions

View file

@ -316,7 +316,6 @@ watch(
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="gt-xs q-ml-sm" class="gt-xs q-ml-sm"
/> />
@ -328,7 +327,7 @@ watch(
:filter="filter" :filter="filter"
row-key="personal_id" row-key="personal_id"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
selection="multiple" selection="single"
v-model:selected="selected" v-model:selected="selected"
:rows-per-page-options="[10, 25, 50, 100]" :rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination" @update:pagination="updatePagination"

View file

@ -177,7 +177,6 @@ watchEffect(() => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="gt-xs q-ml-sm" class="gt-xs q-ml-sm"
/> />
@ -247,7 +246,7 @@ watchEffect(() => {
<DialogCreateCommand <DialogCreateCommand
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-10'" :command-type-code="'C-PM-10'"
:persons="selected ? dataMapToSend:[]" :persons="selected ? dataMapToSend : []"
:not-person="false" :not-person="false"
/> />
</template> </template>

View file

@ -143,6 +143,11 @@ const probation_statusOP = ref<any>([
label: "ดึงรายชื่อไปออกคำสั่งแล้ว", label: "ดึงรายชื่อไปออกคำสั่งแล้ว",
disable: true, disable: true,
}, },
{
id: 9,
label: "ออกคำสั่งเสร็จแล้ว",
disable: true,
},
]); ]);
/** get ข้อมูล งานที่ได้รับมอบหมาย */ /** get ข้อมูล งานที่ได้รับมอบหมาย */
@ -371,7 +376,10 @@ onMounted(async () => {
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div> <div>
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsUpdate" v-if="
checkPermission($route)?.attrIsUpdate &&
(probation_status == 1 || probation_status == 7)
"
@click="router.push(`/probation/add/${personalId}`)" @click="router.push(`/probation/add/${personalId}`)"
flat flat
round round
@ -414,7 +422,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />
@ -462,7 +469,10 @@ onMounted(async () => {
<q-tooltip>รายละเอยด</q-tooltip> <q-tooltip>รายละเอยด</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsUpdate" v-if="
checkPermission($route)?.attrIsUpdate &&
(probation_status == 1 || probation_status == 7)
"
flat flat
dense dense
round round

View file

@ -13,6 +13,7 @@ import type {
ListCommand, ListCommand,
DataOrder, DataOrder,
Pagination, Pagination,
TabOptions,
} from "@/modules/18_command/interface/index/Main"; } from "@/modules/18_command/interface/index/Main";
import type { DataListCommand } from "@/modules/18_command/interface/response/Main"; import type { DataListCommand } from "@/modules/18_command/interface/response/Main";
@ -283,6 +284,26 @@ function updatePagination(newPagination: Pagination) {
pagination.value.rowsPerPage = newPagination.rowsPerPage; pagination.value.rowsPerPage = newPagination.rowsPerPage;
} }
const isHold = ref<boolean>(true); // true / false
// tab
const tabOptions = ref<TabOptions[]>([
{ label: "สร้างคำสั่งใหม่", value: "NEW" },
{ label: "เลือกคำสั่งที่เป็นแบบร่าง", value: "DRAF" },
]);
/** ฟังก์ชั่นเช็คการแสดงผล ตรวจสอบว่าเป็นประเภทคำสั่งที่เป็นแบบเลือกได้รายการเดียวไหม ถ้าเป็นแบบรายการเดียวจะซ่อนเลือกคำสั่งที่เป็นแบบร่าง*/
async function displayTab() {
isHold.value =
(await (props.commandTypeCode !== "C-PM-10" &&
props.commandTypeCode !== "C-PM-11" &&
props.commandTypeCode !== "C-PM-12")) ?? false;
tabOptions.value = isHold.value
? [
{ label: "สร้างคำสั่งใหม่", value: "NEW" },
{ label: "เลือกคำสั่งที่เป็นแบบร่าง", value: "DRAF" },
]
: [{ label: "สร้างคำสั่งใหม่", value: "NEW" }];
}
/** ดูการเปลี่ยนแปลงของจำนวนแถวต่อหน้า*/ /** ดูการเปลี่ยนแปลงของจำนวนแถวต่อหน้า*/
watch( watch(
() => pagination.value.rowsPerPage, () => pagination.value.rowsPerPage,
@ -294,6 +315,7 @@ watch(
/** ดูการเปลี่ยนแปลงของ modal*/ /** ดูการเปลี่ยนแปลงของ modal*/
watch(modal, () => { watch(modal, () => {
if (modal.value && props.persons?.length !== 0) { if (modal.value && props.persons?.length !== 0) {
displayTab();
fetchCommandType(); fetchCommandType();
} }
}); });
@ -313,7 +335,6 @@ watch(
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="min-width: 50vw"> <q-card style="min-width: 50vw">
<DialogHeader :tittle="'สร้าง/เลือกคำสั่ง'" :close="closeModal" /> <DialogHeader :tittle="'สร้าง/เลือกคำสั่ง'" :close="closeModal" />
<q-separator /> <q-separator />
<q-card-section style="max-height: 50vh" class="scroll"> <q-card-section style="max-height: 50vh" class="scroll">
<div class="row q-mb-md"> <div class="row q-mb-md">
@ -324,10 +345,7 @@ watch(
color="white" color="white"
text-color="black" text-color="black"
no-caps no-caps
:options="[ :options="tabOptions"
{ label: 'สร้างคำสั่งใหม่', value: 'NEW' },
{ label: 'เลือกคำสั่งที่เป็นแบบร่าง', value: 'DRAF' },
]"
/> />
</div> </div>
</div> </div>
@ -478,7 +496,6 @@ watch(
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="gt-xs q-ml-sm" class="gt-xs q-ml-sm"
/> />
@ -539,6 +556,7 @@ watch(
<q-card-actions align="right"> <q-card-actions align="right">
<q-btn <q-btn
v-if="isHold"
label="บันทึกและเลือกรายชื่อต่อ" label="บันทึกและเลือกรายชื่อต่อ"
@click="() => onSubmit(false)" @click="() => onSubmit(false)"
:disable=" :disable="

View file

@ -12,6 +12,11 @@ interface ItemTabs {
name: string; name: string;
} }
interface TabOptions {
label: string;
value: string;
}
interface DataPerson { interface DataPerson {
fullName?: string; fullName?: string;
citizenId: string; citizenId: string;
@ -112,5 +117,6 @@ export type {
ListCommand, ListCommand,
DataOrder, DataOrder,
DataFileOrder, DataFileOrder,
FormDataDetail FormDataDetail,
TabOptions,
}; };