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

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-tr :props="props">
<q-td auto-width> <q-td auto-width>
<q-btn <q-btn
icon="edit" :icon="props.row.topic == 'ขออัปเดตข้อมูลจากกรมการปกครอง' ? 'mdi-sync-circle':'edit'"
round round
dense dense
flat flat
color="edit" :color="props.row.topic == 'ขออัปเดตข้อมูลจากกรมการปกครอง' ? 'info':'edit'"
@click.pervent="onclickEdit(props.row.id)" @click.pervent="onclickEdit(props.row.id)"
> >
<q-tooltip>แกไขสถานะคำรอง</q-tooltip> <q-tooltip>{{props.row.topic == 'ขออัปเดตข้อมูลจากกรมการปกครอง' ? 'ขออัปเดตข้อมูลจากกรมการปกครอง':'แก้ไขสถานะคำร้อง'}}</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props"> <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 attrs = ref<any>(useAttrs());
const paging2 = ref<boolean>(true); const paging2 = ref<boolean>(true);
const fillterStatus = ref<any>([]); const fillterStatus = ref<any>([]);
const fillter = ref<any>(''); const fillter = ref<any>("");
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>(""); const filterKeyword2 = ref<string>("");
const rows = ref<FormMainProbation[]>([]); const rows = ref<FormMainProbation[]>([]);
@ -218,6 +218,15 @@ const columns2 = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "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 ข้อมูล */ /** get ข้อมูล */
@ -282,31 +291,55 @@ async function filterKeyword2Fn(page: number) {
* @param data personal data * @param data personal data
*/ */
function clickAdd(data: any) { 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( dialogConfirm(
$q, $q,
async () => { async () => {
showLoader(); showLoader();
await http await http
.post(config.API.personalAdd(), data) .post(config.API.personalAdd(), body)
.then(async () => { .then(async () => {
await http await http
.get(config.API.orgProfileStatus(data.id)) .get(config.API.orgProfileStatus(data.id))
.then((res) => { .then(async(res) => {
getpersonalList(); await getpersonalList();
success($q, "เพิ่มข้อมูลสำเร็จ"); success($q, "เพิ่มข้อมูลสำเร็จ");
clickClose();
hideLoader();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
hideLoader();
}); });
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
})
.finally(() => {
clickClose();
hideLoader(); hideLoader();
}); })
.finally(() => {});
}, },
"ยันยันการเพิ่มข้อมูล", "ยันยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้หรือไม่ ?" "ต้องการเพิ่มข้อมูลนี้หรือไม่ ?"
@ -389,64 +422,62 @@ onMounted(async () => {
<q-card flat bordered class="col-12 q-mt-sm q-pa-md"> <q-card flat bordered class="col-12 q-mt-sm q-pa-md">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div class="row"> <div class="row">
<q-select <q-select
v-model="fillter" v-model="fillter"
label="สถานะ" label="สถานะ"
dense dense
map-options map-options
option-label="value" option-label="value"
:options="Opfillter2" :options="Opfillter2"
option-value="id" option-value="id"
lazy-rules lazy-rules
emit-value emit-value
hide-bottom-space hide-bottom-space
:readonly="false" :readonly="false"
:borderless="false" :borderless="false"
:outlined="true" :outlined="true"
:hide-dropdown-icon="false" :hide-dropdown-icon="false"
@update:model-value="getpersonalList()" @update:model-value="getpersonalList()"
@filter="filterFn" @filter="filterFn"
use-input use-input
behavior="menu" behavior="menu"
> >
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey"> <q-item-section class="text-grey"> ไมอม </q-item-section>
ไมอม </q-item>
</q-item-section> </template>
</q-item> </q-select>
</template>
</q-select>
<div> <div>
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsCreate" v-if="checkPermission($route)?.attrIsCreate"
@click="onclickAddProbation" @click="onclickAddProbation"
flat flat
round round
color="add" color="add"
icon="mdi-plus" icon="mdi-plus"
> >
<q-tooltip>เพมผทดลองปฏหนาทราชการ</q-tooltip> <q-tooltip>เพมผทดลองปฏหนาทราชการ</q-tooltip>
</q-btn> </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> </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 /> <q-space />
@ -717,6 +748,15 @@ onMounted(async () => {
}${props.row.orgRootName ? props.row.orgRootName : ""}` }${props.row.orgRootName ? props.row.orgRootName : ""}`
}} }}
</div> </div>
<div v-else-if="col.name == 'refCommandNo'">
{{
props.row.refCommandNo
? props.row.refCommandNo != "xx/2566"
? props.row.refCommandNo
: "-"
: "-"
}}
</div>
<div v-else> <div v-else>
{{ col.value ? col.value : "-" }} {{ col.value ? col.value : "-" }}
</div> </div>