รายการอื่นๆ ==> ตำแหน่งที่บรรจุกลับ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-28 17:53:32 +07:00
parent 5865438d9d
commit 6fa064bb7c
2 changed files with 136 additions and 1 deletions

View file

@ -15,6 +15,7 @@ import type { listMain } from "@/modules/05_placement/interface/response/OhterMa
/** importcomopnents*/
import Dialogbody from "@/modules/05_placement/components/Other/DialogOrders.vue";
import DialogOrgSelect from "@/components/Dialogs/DialogOrgSelect.vue";
/** use*/
const $q = useQuasar();
@ -44,6 +45,7 @@ const filterKeyword2 = ref<string>(""); //คำค้นหารายกา
const visibleColumns = ref<string[]>([
"no",
"fullname",
"organizationPositionReturn",
"positionLevel",
"organizationPositionOld",
"createdAt",
@ -73,6 +75,19 @@ const columns = ref<QTableProps["columns"]>([
}`;
},
},
{
name: "organizationPositionReturn",
align: "left",
label: "ตำแหน่ง/หน่วยงานที่บรรจุกลับ",
sortable: true,
field: "organizationPositionReturn",
format(val, row) {
return row.organizationPositionOld.replace(/\n/g, " ");
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
@ -198,6 +213,65 @@ function clickDelete(id: string) {
});
}
const modalSelectOrg = ref<boolean>(false);
const type = ref<string | null>(null);
const personalId = ref<string>("");
const posType = ref<string>(""); //
const posLevel = ref<string>(""); //
const position = ref<string>(""); //
const dataRows = ref<any>(); //
/**
* งกนเป popup เลอกหนวยงานทบโอน
* @param id id รายการรบโอนทเลอกหนวยงานทบโอน
* @param data อมลรายการรบโอน
*/
function onSelectOrg(data: any) {
personalId.value = data.id;
// personal.value = dataRecevice.value.filter((e: ResponseData) => e.id === id);
dataRows.value = data;
posType.value = data.posTypeId;
posLevel.value = data.posLevelId;
position.value = data.positionId;
type.value = null;
modalSelectOrg.value = true;
}
async function onSaveSelectOrg(data: any) {
const body = {
node: data.node,
nodeId: data.nodeId,
orgRevisionId: data.orgRevisionId,
positionId: data.positionId,
posMasterNo: data.posMasterNo,
positionName: data.positionName,
posTypeId: data.posTypeId,
posTypeName: data.posTypeName,
posLevelId: data.posLevelId,
posLevelName: data.posLevelName,
posExecutiveName: data.posExecutiveName,
reportingDate: data.reportingDate,
posmasterId: data.posmasterId,
typeCommand: data.typeCommand,
};
showLoader();
await http
.put(config.API.otherPosition(personalId.value), body)
.then(async () => {
await fecthlistOthet();
await success($q, "บันทึกข้อมูลสำเร็จ");
modalSelectOrg.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/**
* redialect รายละเอยดรายการอนๆ
* @param id รายการอนๆ
@ -220,6 +294,7 @@ onMounted(() => {
fecthlistOthet();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">รายการอนๆ</div>
<q-card flat bordered class="col-12 q-mt-sm">
@ -321,6 +396,29 @@ onMounted(() => {
<template v-slot:body="props">
<q-tr :props="props">
<q-td auto-width>
<q-btn
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
:disable="
props.row.status === 'REPORT' ||
props.row.status === 'DONE'
"
:color="
props.row.status === 'REPORT' ||
props.row.status === 'DONE'
? 'grey'
: 'primary'
"
flat
round
dense
icon="mdi-bookmark-outline"
@click="onSelectOrg(props.row)"
>
<q-tooltip>เลอกหนวยงานทบรรจกล</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
flat
@ -357,6 +455,29 @@ onMounted(() => {
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name === 'organizationPositionReturn'">
<div class="col-4">
<div class="text-weight-medium">
{{ props.row.root !== null ? props.row.root : "-" }}
{{
props.row.rootShortName !== null
? `(${props.row.rootShortName})`
: ""
}}
</div>
<div class="text-weight-light">
{{
props.row.nodeName !== null ? props.row.nodeName : ""
}}
{{
props.row.nodeShortName !== null
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
: ""
}}
</div>
</div>
</div>
<div
v-else-if="col.name === 'organizationPositionOld'"
class="text-html"
@ -384,6 +505,17 @@ onMounted(() => {
v-model:rowsData="rows2Data"
:fecthlistOthet="fecthlistOthet"
/>
<DialogOrgSelect
:title="`เลือกหน่วยงานที่บรรจุกลับ`"
v-model:modal="modalSelectOrg"
v-model:type="type"
:pos-type="posType"
:pos-level="posLevel"
:position="position"
:data-rows="dataRows"
:onSubmit="onSaveSelectOrg"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -68,6 +68,9 @@ const columns = computed(() => [
align: "left",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val: number, row: RetirementList) {
return val === 0 ? "ว่าง" : val;
},
},
{
name: "name",
@ -77,7 +80,7 @@ const columns = computed(() => [
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val: any, row: any) {
format(val: string, row: RetirementList) {
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`;
},
},