updated placement appoint

This commit is contained in:
Warunee Tamkoo 2024-10-25 17:20:52 +07:00
parent 4e1a8aa39e
commit 6da1827526
3 changed files with 35 additions and 48 deletions

View file

@ -174,25 +174,7 @@ function saveOrder() {
function filterSelectOrder() { function filterSelectOrder() {
const data = props.rows ? props.rows : []; const data = props.rows ? props.rows : [];
selected.value = []; selected.value = [];
rows.value = data.filter((v: any) => { rows.value = data;
switch (commandType.value) {
case "C-PM-01":
case "C-PM-02":
return v.typeCommand === "APPOINTED" && v.bmaOfficerCheck === null;
case "C-PM-03":
return v.typeCommand === "APPOINT" && v.bmaOfficerCheck !== null;
case "C-PM-04":
return v.typeCommand === "MOVE" && v.bmaOfficerCheck !== null;
case "C-PM-06":
return v.typeCommand === "SLIP" && v.bmaOfficerCheck !== null;
default:
return [];
}
});
} }
/** ปิด Modal และล้างค่าที่เลือก */ /** ปิด Modal และล้างค่าที่เลือก */

View file

@ -240,14 +240,14 @@ function convertBmaOfficer(val: string) {
* แปลงสถานะบรรจ * แปลงสถานะบรรจ
* @param val type * @param val type
*/ */
function convertContainStatus(val: string, type: string = "") { function convertContainStatus(val: string) {
switch (val) { switch (val) {
case "UN-CONTAIN": case "UN-CONTAIN":
return "ยังไม่บรรจุ"; return "ยังไม่บรรจุ";
case "PREPARE-CONTAIN": case "PREPARE-CONTAIN":
return "เตรียม" + (!type ? type : "บรรจุ"); return "เตรียมบรรจุ";
case "DONE": case "DONE":
return (!type ? type : "บรรจุ") + "แล้ว"; return "บรรจุแล้ว";
case "DISCLAIM": case "DISCLAIM":
return "สละสิทธิ์"; return "สละสิทธิ์";
case "REPORT": case "REPORT":
@ -266,11 +266,11 @@ function convertTypeCommand(val: string) {
case "APPOINTED": case "APPOINTED":
return "บรรจุแต่งตั้ง"; return "บรรจุแต่งตั้ง";
case "APPOINT": case "APPOINT":
return "แต่งตั้ง"; return "แต่งตั้ง/ย้าย";
case "SLIP": // case "SLIP":
return "เลื่อน"; // return "";
case "MOVE": // case "MOVE":
return "ย้าย"; // return "";
default: default:
return ""; return "";
} }
@ -360,11 +360,8 @@ async function getTable() {
data.node == null data.node == null
? "ขอผ่อนผัน" ? "ขอผ่อนผัน"
: data.statusId == "DONE" : data.statusId == "DONE"
? convertTypeCommand(data.typeCommand) + "แล้ว" ? "บรรจุแล้ว"
: convertContainStatus(data.statusId) + : convertContainStatus(data.statusId),
(data.typeCommand != ""
? convertTypeCommand(data.typeCommand)
: ""),
organizationName: organizationName:
data.root + data.root +
" " + " " +
@ -751,20 +748,27 @@ function openModalOrder(val: boolean) {
// object #e.draft == "" && // object #e.draft == "" &&
rowsOrder.value = rows.value.filter( rowsOrder.value = rows.value.filter(
(e: any) => (e: any) =>
e.nodeName !== null && e.reportingDate !== null && e.statusId !== "REPORT" e.nodeName !== null &&
e.reportingDate !== null &&
e.statusId !== "REPORT" &&
e.statusId !== "DONE"
); );
modalOrder.value = val; modalOrder.value = val;
} }
function onUpdateNewRows(val: string) { function onUpdateNewRows(val: string) {
const data = rowsAwait.value; const data = rowsAwait.value;
rows.value = data.filter((item: any) => { if (val !== "") {
if (val === "EXTERNAL") { rows.value = data.filter((item: any) => {
return item.bmaOfficerCheck === null; if (val === "EXTERNAL") {
} else if (val === "OFFICER") { return item.bmaOfficerCheck === null;
return item.bmaOfficerCheck === "OFFICER"; } else if (val === "OFFICER") {
} return item.bmaOfficerCheck === "OFFICER";
}); }
});
} else {
rows.value = data;
}
} }
watch(containStatus, () => { watch(containStatus, () => {
@ -936,7 +940,9 @@ onMounted(async () => {
name="mdi-bookmark-outline" name="mdi-bookmark-outline"
/> />
</q-item-section> </q-item-section>
<q-item-section>เลอกหนวยงานทบแตงต</q-item-section> <q-item-section
>เลอกหนวยงานทบแตงต/าย</q-item-section
>
</q-item> </q-item>
<q-item <q-item
@ -1001,7 +1007,7 @@ onMounted(async () => {
<q-item-section>เลอกหนวยงานทบเลอน</q-item-section> <q-item-section>เลอกหนวยงานทบเลอน</q-item-section>
</q-item> --> </q-item> -->
<q-item <!-- <q-item
v-if=" v-if="
props.row.bmaOfficer !== 'บุคคลภายนอก' && props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin && roleAdmin &&
@ -1027,7 +1033,7 @@ onMounted(async () => {
/> />
</q-item-section> </q-item-section>
<q-item-section>เลอกหนวยงานทบยาย</q-item-section> <q-item-section>เลอกหนวยงานทบยาย</q-item-section>
</q-item> </q-item> -->
<q-separator /> <q-separator />
<q-item <q-item

View file

@ -13,8 +13,9 @@ const paging = ref<boolean>(true);
const table = ref<any>(null); const table = ref<any>(null);
const filterRef = ref<any>(null); const filterRef = ref<any>(null);
const bmaOfficer = ref<string>('') const bmaOfficer = ref<string>("");
const bmaOfficerOption = ref<optionData[]>([ const bmaOfficerOption = ref<optionData[]>([
{ id: "", name: "ทั้งหมด" },
{ id: "OFFICER", name: "ขรก.กทม. สามัญ" }, { id: "OFFICER", name: "ขรก.กทม. สามัญ" },
{ id: "EXTERNAL", name: "บุคคลภายนอก" }, { id: "EXTERNAL", name: "บุคคลภายนอก" },
]); ]);
@ -188,18 +189,17 @@ function onUpdateNewRows() {
map-options map-options
option-value="id" option-value="id"
option-label="name" option-label="name"
label="สถาภาพ" label="สถาภาพ"
style="width: 200px" style="width: 200px"
@update:model-value="onUpdateNewRows" @update:model-value="onUpdateNewRows"
> >
</q-select> </q-select>
<q-btn <q-btn
v-if="roleAdmin === false"
@click="openModalOrder()"
flat flat
round round
color="add" color="add"
icon="mdi-account-arrow-right" icon="mdi-account-arrow-right"
@click="openModalOrder()"
> >
<q-tooltip>งไปออกคำส</q-tooltip> <q-tooltip>งไปออกคำส</q-tooltip>
</q-btn> </q-btn>
@ -220,7 +220,6 @@ function onUpdateNewRows() {
<div class="items-center" style="display: flex"> <div class="items-center" style="display: flex">
<q-toggle <q-toggle
v-if="roleAdmin === false"
class="col-xs-12 col-sm-5 col-md-5 toggle-expired-account" class="col-xs-12 col-sm-5 col-md-5 toggle-expired-account"
:model-value="containStatus" :model-value="containStatus"
color="blue" color="blue"