เพิ่มประเภททุน ปรับ ui

This commit is contained in:
Warunee Tamkoo 2024-04-18 11:42:01 +07:00
parent 12c255e82f
commit 43f4cecf7f
2 changed files with 85 additions and 66 deletions

View file

@ -103,15 +103,19 @@ const scholarshipTypeOp = ref<DataOptions[]>([
{ id: "DOMESTICE", name: "การศึกษาในประเทศ" }, { id: "DOMESTICE", name: "การศึกษาในประเทศ" },
{ {
id: "NOABROAD", id: "NOABROAD",
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)", name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
}, },
{ {
id: "ABROAD", id: "ABROAD",
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)", name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
}, },
{ {
id: "EXECUTIVE", id: "EXECUTIVE",
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)", name: " ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรประเภทนักบริหาร)",
},
{
id: "RESEARCH",
name: "ศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ",
}, },
]); ]);
@ -288,8 +292,8 @@ async function clickUpload(file: any) {
await http await http
.post( .post(
config.API.developmentSalaryFile( config.API.developmentSalaryFile(
"ระบบพัฒนาบุคคล", "พัฒนาบุคคล",
"ฟอร์มรายงานตัวกลับเข้ารับราชการ", "ฟอร์มรายงานตัวกลับ",
id.value id.value
), ),
{ {
@ -346,17 +350,16 @@ function getFile() {
http http
.get( .get(
config.API.developmentSalaryFile( config.API.developmentSalaryFile(
"ระบบพัฒนาบุคคล", "พัฒนาบุคคล",
"ฟอร์มรายงานตัวกลับเข้ารับราชการ", "ฟอร์มรายงานตัวกลับ",
id.value id.value
) )
) )
.then((res) => { .then((res) => {
if (res) {
const dataFile = res.data; const dataFile = res.data;
fileList.value = dataFile[0]; fileList.value = dataFile[0];
}) }
.catch((e) => {
messageError($q, e);
}) })
.finally(() => {}); .finally(() => {});
} }
@ -409,26 +412,41 @@ onMounted(async () => {
<div class="row q-col-gutter-x-sm full-width"> <div class="row q-col-gutter-x-sm full-width">
<div class="col-2 q-pa-none"> <div class="col-2 q-pa-none">
<q-btn <q-btn
class="full-width" flat
icon="mdi-dots-vertical"
color="grey-8"
for="#cancel"
dense
round
unelevated unelevated
color="edit"
label="แก้ไขข้อมูลรายงานตัวกลับเข้ารับราชการ"
@click="onOpenReturn"
> >
<q-tooltip>แกไขขอมลรายงานตวกลบเขารบราชการ</q-tooltip> <q-menu>
</q-btn> <q-list>
</div> <q-item clickable v-close-popup @click="onOpenReturn">
<div class="col-2"> <q-item-section>
<q-btn <q-item-label>
class="full-width" <q-icon name="edit" color="edit" size="18px" />
unelevated แกไขขอมลรายงานตวกลบเขารบราชการ
</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="onDownload">
<q-item-section>
<q-item-label>
<q-icon
name="download"
color="primary" color="primary"
label="ดาวน์โหลดฟอร์มต้นแบบ" size="18px"
@click="onDownload" />
> ดาวนโหลดฟอรมตนแบบ
<q-tooltip>ดาวนโหลดฟอรมตนแบบ</q-tooltip> </q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn> </q-btn>
</div> </div>
<q-space /> <q-space />
<div v-if="fileList == null" class="col-3"> <div v-if="fileList == null" class="col-3">
<q-file <q-file
@ -460,16 +478,18 @@ onMounted(async () => {
</template> </template>
</q-file> </q-file>
</div> </div>
<div v-else class="col-2"> <div v-else class="col-2 text-right">
<q-btn <q-btn
color="primary" size="12px"
class="full-width" flat
label="ดาวน์โหลดไฟล์เอกสาร" round
unelevated dense
color="blue"
icon="mdi-download"
@click="downloadFile(fileList)" @click="downloadFile(fileList)"
> >
<q-tooltip>ดาวนโหลดไฟลเอกสาร</q-tooltip> <q-tooltip>ดาวนโหลดไฟล</q-tooltip></q-btn
</q-btn> >
</div> </div>
</div> </div>
</q-toolbar> </q-toolbar>

View file

@ -16,7 +16,7 @@ const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const profilId = ref<string>('') const profilId = ref<string>("");
const currentPage = ref<number>(1); const currentPage = ref<number>(1);
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
const page = ref<number>(1); const page = ref<number>(1);
@ -26,21 +26,22 @@ const rows = ref<any>();
const year = ref<number>(0); const year = ref<number>(0);
const type = ref<string>("DOMESTICE"); const type = ref<string>("DOMESTICE");
const scholarshipTypeOp = ref<DataOptions[]>([ const scholarshipTypeOp = ref<DataOptions[]>([
{ { id: "DOMESTICE", name: "การศึกษาในประเทศ" },
id: "DOMESTICE",
name: "การศึกษาในประเทศ",
},
{ {
id: "NOABROAD", id: "NOABROAD",
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)", name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
}, },
{ {
id: "ABROAD", id: "ABROAD",
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)", name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
}, },
{ {
id: "EXECUTIVE", id: "EXECUTIVE",
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)", name: " ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรประเภทนักบริหาร)",
},
{
id: "RESEARCH",
name: "ศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ",
}, },
]); ]);
@ -81,14 +82,12 @@ function getData() {
http http
.get(config.API.developmentScholarship + `/user/${profilId.value}`) .get(config.API.developmentScholarship + `/user/${profilId.value}`)
.then((res) => { .then((res) => {
rows.value = res.data.result rows.value = res.data.result;
}).catch((e)=>{
messageError($q,e)
}).finally(()=>{
}) })
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
} }
function onEdit(id: string) { function onEdit(id: string) {
@ -117,8 +116,8 @@ function getProfileId() {
http http
.get(config.API.profilePosition()) .get(config.API.profilePosition())
.then((res) => { .then((res) => {
profilId.value = res.data.result.profileId profilId.value = res.data.result.profileId;
getData() getData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);