edit select person in probation system
This commit is contained in:
parent
884fe69e2c
commit
1ae929acbf
5 changed files with 46 additions and 14 deletions
|
|
@ -316,7 +316,6 @@ watch(
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
|
|
@ -328,7 +327,7 @@ watch(
|
|||
:filter="filter"
|
||||
row-key="personal_id"
|
||||
:visible-columns="visibleColumns"
|
||||
selection="multiple"
|
||||
selection="single"
|
||||
v-model:selected="selected"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
@update:pagination="updatePagination"
|
||||
|
|
|
|||
|
|
@ -177,7 +177,6 @@ watchEffect(() => {
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
|
|
@ -247,7 +246,7 @@ watchEffect(() => {
|
|||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="'C-PM-10'"
|
||||
:persons="selected ? dataMapToSend:[]"
|
||||
:persons="selected ? dataMapToSend : []"
|
||||
:not-person="false"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -143,6 +143,11 @@ const probation_statusOP = ref<any>([
|
|||
label: "ดึงรายชื่อไปออกคำสั่งแล้ว",
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
label: "ออกคำสั่งเสร็จแล้ว",
|
||||
disable: true,
|
||||
},
|
||||
]);
|
||||
|
||||
/** get ข้อมูล งานที่ได้รับมอบหมาย */
|
||||
|
|
@ -371,7 +376,10 @@ onMounted(async () => {
|
|||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
(probation_status == 1 || probation_status == 7)
|
||||
"
|
||||
@click="router.push(`/probation/add/${personalId}`)"
|
||||
flat
|
||||
round
|
||||
|
|
@ -414,7 +422,6 @@ onMounted(async () => {
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
|
|
@ -462,7 +469,10 @@ onMounted(async () => {
|
|||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
(probation_status == 1 || probation_status == 7)
|
||||
"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import type {
|
|||
ListCommand,
|
||||
DataOrder,
|
||||
Pagination,
|
||||
TabOptions,
|
||||
} from "@/modules/18_command/interface/index/Main";
|
||||
import type { DataListCommand } from "@/modules/18_command/interface/response/Main";
|
||||
|
||||
|
|
@ -283,6 +284,26 @@ function updatePagination(newPagination: Pagination) {
|
|||
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(
|
||||
() => pagination.value.rowsPerPage,
|
||||
|
|
@ -294,6 +315,7 @@ watch(
|
|||
/** ดูการเปลี่ยนแปลงของ modal*/
|
||||
watch(modal, () => {
|
||||
if (modal.value && props.persons?.length !== 0) {
|
||||
displayTab();
|
||||
fetchCommandType();
|
||||
}
|
||||
});
|
||||
|
|
@ -313,7 +335,6 @@ watch(
|
|||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="min-width: 50vw">
|
||||
<DialogHeader :tittle="'สร้าง/เลือกคำสั่ง'" :close="closeModal" />
|
||||
|
||||
<q-separator />
|
||||
<q-card-section style="max-height: 50vh" class="scroll">
|
||||
<div class="row q-mb-md">
|
||||
|
|
@ -324,10 +345,7 @@ watch(
|
|||
color="white"
|
||||
text-color="black"
|
||||
no-caps
|
||||
:options="[
|
||||
{ label: 'สร้างคำสั่งใหม่', value: 'NEW' },
|
||||
{ label: 'เลือกคำสั่งที่เป็นแบบร่าง', value: 'DRAF' },
|
||||
]"
|
||||
:options="tabOptions"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -478,7 +496,6 @@ watch(
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
|
|
@ -539,6 +556,7 @@ watch(
|
|||
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
v-if="isHold"
|
||||
label="บันทึกและเลือกรายชื่อต่อ"
|
||||
@click="() => onSubmit(false)"
|
||||
:disable="
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ interface ItemTabs {
|
|||
name: string;
|
||||
}
|
||||
|
||||
interface TabOptions {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface DataPerson {
|
||||
fullName?: string;
|
||||
citizenId: string;
|
||||
|
|
@ -112,5 +117,6 @@ export type {
|
|||
ListCommand,
|
||||
DataOrder,
|
||||
DataFileOrder,
|
||||
FormDataDetail
|
||||
FormDataDetail,
|
||||
TabOptions,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue