เพิ่มฟิล เลขที่คำสั่ง

This commit is contained in:
setthawutttty 2024-10-10 10:37:19 +07:00
parent a354e8cc73
commit adcb1f034f
2 changed files with 107 additions and 67 deletions

View file

@ -336,14 +336,14 @@ onMounted(() => {
<q-tr :props="props">
<q-td auto-width>
<q-btn
icon="edit"
:icon="props.row.topic == 'ขออัปเดตข้อมูลจากกรมการปกครอง' ? 'mdi-sync-circle':'edit'"
round
dense
flat
color="edit"
:color="props.row.topic == 'ขออัปเดตข้อมูลจากกรมการปกครอง' ? 'info':'edit'"
@click.pervent="onclickEdit(props.row.id)"
>
<q-tooltip>แกไขสถานะคำรอง</q-tooltip>
<q-tooltip>{{props.row.topic == 'ขออัปเดตข้อมูลจากกรมการปกครอง' ? 'ขออัปเดตข้อมูลจากกรมการปกครอง':'แก้ไขสถานะคำร้อง'}}</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">

View file

@ -33,7 +33,7 @@ const filterRef2 = ref<any>(null);
const attrs = ref<any>(useAttrs());
const paging2 = ref<boolean>(true);
const fillterStatus = ref<any>([]);
const fillter = ref<any>('');
const fillter = ref<any>("");
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const rows = ref<FormMainProbation[]>([]);
@ -218,6 +218,15 @@ const columns2 = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "refCommandNo",
align: "center",
label: "เลขที่คําสั่งบรรจุแต่งตั้ง",
sortable: true,
field: "refCommandNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
/** get ข้อมูล */
@ -282,31 +291,55 @@ async function filterKeyword2Fn(page: number) {
* @param data personal data
*/
function clickAdd(data: any) {
const body = {
id: data.id,
prefix: data.prefix,
rank: data.rank,
firstName: data.firstName,
lastName: data.lastName,
position: data.position,
idcard: data.idcard,
order_number: data.refCommandNo ? data.refCommandNo:'',
posLevelName: data.posLevelName,
posTypeName: data.posTypeName,
posNo: data.posNo,
positionField: data.positionField,
positionArea: data.positionArea,
posExecutiveName: data.posExecutiveName,
positionExecutiveField: data.positionExecutiveField,
isProbation: data.isProbation,
orgRootName: data.orgRootName,
orgChild1Name: data.orgChild1Name,
orgChild2Name: data.orgChild2Name,
orgChild3Name: data.orgChild3Name,
orgChild4Name: data.orgChild4Name,
};
dialogConfirm(
$q,
async () => {
showLoader();
await http
.post(config.API.personalAdd(), data)
.post(config.API.personalAdd(), body)
.then(async () => {
await http
.get(config.API.orgProfileStatus(data.id))
.then((res) => {
getpersonalList();
.then(async(res) => {
await getpersonalList();
success($q, "เพิ่มข้อมูลสำเร็จ");
clickClose();
hideLoader();
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
clickClose();
hideLoader();
});
})
.finally(() => {});
},
"ยันยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้หรือไม่ ?"
@ -389,64 +422,62 @@ onMounted(async () => {
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
<div class="row q-col-gutter-sm">
<div class="row col-12 q-col-gutter-sm">
<div class="row">
<q-select
v-model="fillter"
label="สถานะ"
dense
map-options
option-label="value"
:options="Opfillter2"
option-value="id"
lazy-rules
emit-value
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
@update:model-value="getpersonalList()"
@filter="filterFn"
use-input
behavior="menu"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
<div class="row">
<q-select
v-model="fillter"
label="สถานะ"
dense
map-options
option-label="value"
:options="Opfillter2"
option-value="id"
lazy-rules
emit-value
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
@update:model-value="getpersonalList()"
@filter="filterFn"
use-input
behavior="menu"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
</q-select>
<div>
<q-btn
v-if="checkPermission($route)?.attrIsCreate"
@click="onclickAddProbation"
flat
round
color="add"
icon="mdi-plus"
>
<q-tooltip>เพมผทดลองปฏหนาทราชการ</q-tooltip>
</q-btn>
</div>
<div>
<q-btn
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
@click="onCommand"
flat
round
color="add"
icon="mdi-account-arrow-right"
>
<q-tooltip>งไปออกคำส</q-tooltip>
</q-btn>
</div>
<div>
<q-btn
v-if="checkPermission($route)?.attrIsCreate"
@click="onclickAddProbation"
flat
round
color="add"
icon="mdi-plus"
>
<q-tooltip>เพมผทดลองปฏหนาทราชการ</q-tooltip>
</q-btn>
</div>
<div>
<q-btn
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
@click="onCommand"
flat
round
color="add"
icon="mdi-account-arrow-right"
>
<q-tooltip>งไปออกคำส</q-tooltip>
</q-btn>
</div>
</div>
<q-space />
@ -717,6 +748,15 @@ onMounted(async () => {
}${props.row.orgRootName ? props.row.orgRootName : ""}`
}}
</div>
<div v-else-if="col.name == 'refCommandNo'">
{{
props.row.refCommandNo
? props.row.refCommandNo != "xx/2566"
? props.row.refCommandNo
: "-"
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>