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() {
const data = props.rows ? props.rows : [];
selected.value = [];
rows.value = data.filter((v: any) => {
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 [];
}
});
rows.value = data;
}
/** ปิด Modal และล้างค่าที่เลือก */

View file

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

View file

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