ระบบพัฒนา

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-26 18:11:08 +07:00
parent 59d8de0234
commit 29007e97c9
3 changed files with 88 additions and 19 deletions

View file

@ -28,6 +28,24 @@ const listPerson = defineModel<ResRecord[]>("listPerson", { required: true });
const keyword = ref<string>(""); const keyword = ref<string>("");
const rows = ref<ResRecord[]>([]); const rows = ref<ResRecord[]>([]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{
name: "isDone",
align: "left",
label: "บันทึกที่ทะเบียนประวัติแล้ว",
sortable: true,
field: "isDone",
headerStyle: "font-size: 14px; width: 50px;",
style: "font-size: 14px",
},
{
name: "isDoneIDP",
align: "left",
label: "บันทึก IDP ที่ทะเบียนประวัติแล้ว",
sortable: true,
field: "isDoneIDP",
headerStyle: "font-size: 14px; width: 50px;",
style: "font-size: 14px",
},
{ {
name: "type", name: "type",
align: "left", align: "left",
@ -177,6 +195,8 @@ const columns = ref<QTableProps["columns"]>([
}, },
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"isDone",
"isDoneIDP",
"type", "type",
"idcard", "idcard",
"fullName", "fullName",
@ -268,26 +288,37 @@ onMounted(() => {
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props">
<q-td>
<q-icon
v-if="props.row.isDone"
name="mdi-check"
color="green"
size="xs"
>
<q-tooltip>งไปบนทกททะเบยนประวแล</q-tooltip>
</q-icon>
</q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name == 'fullName'"> <div v-if="col.name === 'isDone'" class="text-center">
<q-icon
v-if="props.row.isDone"
name="mdi-check"
color="green"
size="xs"
>
<q-tooltip>งไปบนทกททะเบยนประวแล</q-tooltip>
</q-icon>
</div>
<div v-else-if="col.name === 'isDoneIDP'" class="text-center">
<q-icon
v-if="props.row.isDoneIDP"
name="mdi-check"
color="blue"
size="xs"
>
<q-tooltip>งไปบนท IDP ทะเบยนประวแล</q-tooltip>
</q-icon>
</div>
<div v-else-if="col.name == 'fullName'">
{{ props.row.prefix ? props.row.prefix : "" {{ props.row.prefix ? props.row.prefix : ""
}}{{ props.row.firstName ? props.row.firstName : "" }} }}{{ props.row.firstName ? props.row.firstName : "" }}
{{ props.row.lastName ? props.row.lastName : "" }} {{ props.row.lastName ? props.row.lastName : "" }}

View file

@ -127,6 +127,7 @@ interface ResRecord {
trainingDays: number | null; trainingDays: number | null;
type: string; type: string;
isProfile: boolean; isProfile: boolean;
idDoneIDP: boolean;
} }
interface DataStrategic { interface DataStrategic {

View file

@ -38,12 +38,13 @@ const modalAddPerson = ref<boolean>(false); // ตัวแปร dialog เพ
* function fetch อมลเบองต * function fetch อมลเบองต
* @param id ProjectId * @param id ProjectId
*/ */
function fetchData(id: string) { async function fetchData(id: string) {
showLoader(); showLoader();
http await http
.get(config.API.developmentMainTab("tab1", id)) .get(config.API.developmentMainTab("tab1", id))
.then(async (res) => { .then(async (res) => {
title.value = res.data.result.projectName; title.value = await res.data.result.projectName;
await fetchDataProject();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -56,10 +57,10 @@ function fetchData(id: string) {
/** /**
* function เรยกขอมลรายชอทงหมด * function เรยกขอมลรายชอทงหมด
*/ */
function fetchDataProject() { async function fetchDataProject() {
isLoadPage.value = false; isLoadPage.value = false;
showLoader(); showLoader();
http await http
.get(config.API.developmentMainTab("tab6", projectId.value)) .get(config.API.developmentMainTab("tab6", projectId.value))
.then(async (res) => { .then(async (res) => {
listPerson.value = await res.data.result; listPerson.value = await res.data.result;
@ -126,6 +127,30 @@ function sendRecordRegistry() {
); );
} }
/**
* function งขอมลการพฒนารายบคคลไปบนทกททะเบยนประว
*/
function sendDevalopRegistry() {
dialogConfirm(
$q,
() => {
// showLoader();
// http
// .get(config.API.developmentMainTab("tab6/done", projectId.value))
// .then(async () => {
// await fetchDataProject();
// await success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// hideLoader();
// });
},
"ยืนยันการส่งข้อมูลการพัฒนารายบุคคลไปบันทึกที่ทะเบียนประวัติ",
"ต้องการยืนยันการส่งข้อมูลการพัฒนารายบุคคลไปบันทึกที่ทะเบียนประวัติหรือไม่"
);
}
/** /**
* function ดาวนโหลดไฟลนแบบ * function ดาวนโหลดไฟลนแบบ
*/ */
@ -139,7 +164,6 @@ function downloadFile() {
} }
onMounted(() => { onMounted(() => {
fetchDataProject();
fetchData(projectId.value); fetchData(projectId.value);
store.projectStatus = "FINISH"; store.projectStatus = "FINISH";
}); });
@ -206,6 +230,19 @@ onMounted(() => {
> >
<q-tooltip>งไปบนทกททะเบยนประว</q-tooltip> <q-tooltip>งไปบนทกททะเบยนประว</q-tooltip>
</q-btn> </q-btn>
<q-btn
size="md"
icon="mdi-clipboard-account-outline"
round
flat
color="primary"
@click="sendDevalopRegistry()"
>
<q-tooltip
>งขอมลการพฒนารายบคคลไปบนทกททะเบยนประว</q-tooltip
>
</q-btn>
<q-space /> <q-space />
<q-btn <q-btn
flat flat