เพิ่มประเภททุน ปรับ ui
This commit is contained in:
parent
12c255e82f
commit
43f4cecf7f
2 changed files with 85 additions and 66 deletions
|
|
@ -103,15 +103,19 @@ const scholarshipTypeOp = ref<DataOptions[]>([
|
|||
{ id: "DOMESTICE", name: "การศึกษาในประเทศ" },
|
||||
{
|
||||
id: "NOABROAD",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
|
||||
},
|
||||
{
|
||||
id: "ABROAD",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
|
||||
},
|
||||
{
|
||||
id: "EXECUTIVE",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)",
|
||||
name: " ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรประเภทนักบริหาร)",
|
||||
},
|
||||
{
|
||||
id: "RESEARCH",
|
||||
name: "ศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ",
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -288,8 +292,8 @@ async function clickUpload(file: any) {
|
|||
await http
|
||||
.post(
|
||||
config.API.developmentSalaryFile(
|
||||
"ระบบพัฒนาบุคคล",
|
||||
"ฟอร์มรายงานตัวกลับเข้ารับราชการ",
|
||||
"พัฒนาบุคคล",
|
||||
"ฟอร์มรายงานตัวกลับ",
|
||||
id.value
|
||||
),
|
||||
{
|
||||
|
|
@ -346,17 +350,16 @@ function getFile() {
|
|||
http
|
||||
.get(
|
||||
config.API.developmentSalaryFile(
|
||||
"ระบบพัฒนาบุคคล",
|
||||
"ฟอร์มรายงานตัวกลับเข้ารับราชการ",
|
||||
"พัฒนาบุคคล",
|
||||
"ฟอร์มรายงานตัวกลับ",
|
||||
id.value
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const dataFile = res.data;
|
||||
fileList.value = dataFile[0];
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
if (res) {
|
||||
const dataFile = res.data;
|
||||
fileList.value = dataFile[0];
|
||||
}
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
|
@ -409,26 +412,41 @@ onMounted(async () => {
|
|||
<div class="row q-col-gutter-x-sm full-width">
|
||||
<div class="col-2 q-pa-none">
|
||||
<q-btn
|
||||
class="full-width"
|
||||
flat
|
||||
icon="mdi-dots-vertical"
|
||||
color="grey-8"
|
||||
for="#cancel"
|
||||
dense
|
||||
round
|
||||
unelevated
|
||||
color="edit"
|
||||
label="แก้ไขข้อมูลรายงานตัวกลับเข้ารับราชการ"
|
||||
@click="onOpenReturn"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูลรายงานตัวกลับเข้ารับราชการ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<q-btn
|
||||
class="full-width"
|
||||
unelevated
|
||||
color="primary"
|
||||
label="ดาวน์โหลดฟอร์มต้นแบบ"
|
||||
@click="onDownload"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดฟอร์มต้นแบบ</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list>
|
||||
<q-item clickable v-close-popup @click="onOpenReturn">
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
<q-icon name="edit" color="edit" size="18px" />
|
||||
แก้ไขข้อมูลรายงานตัวกลับเข้ารับราชการ
|
||||
</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"
|
||||
size="18px"
|
||||
/>
|
||||
ดาวน์โหลดฟอร์มต้นแบบ
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<q-space />
|
||||
<div v-if="fileList == null" class="col-3">
|
||||
<q-file
|
||||
|
|
@ -460,16 +478,18 @@ onMounted(async () => {
|
|||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
<div v-else class="col-2">
|
||||
<div v-else class="col-2 text-right">
|
||||
<q-btn
|
||||
color="primary"
|
||||
class="full-width"
|
||||
label="ดาวน์โหลดไฟล์เอกสาร"
|
||||
unelevated
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(fileList)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์เอกสาร</q-tooltip>
|
||||
</q-btn>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</q-toolbar>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const router = useRouter();
|
|||
const $q = useQuasar();
|
||||
const filterKeyword = ref<string>("");
|
||||
|
||||
const profilId = ref<string>('')
|
||||
const profilId = ref<string>("");
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const page = ref<number>(1);
|
||||
|
|
@ -26,21 +26,22 @@ const rows = ref<any>();
|
|||
const year = ref<number>(0);
|
||||
const type = ref<string>("DOMESTICE");
|
||||
const scholarshipTypeOp = ref<DataOptions[]>([
|
||||
{
|
||||
id: "DOMESTICE",
|
||||
name: "การศึกษาในประเทศ",
|
||||
},
|
||||
{ id: "DOMESTICE", name: "การศึกษาในประเทศ" },
|
||||
{
|
||||
id: "NOABROAD",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
|
||||
},
|
||||
{
|
||||
id: "ABROAD",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
|
||||
},
|
||||
{
|
||||
id: "EXECUTIVE",
|
||||
name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)",
|
||||
name: " ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรประเภทนักบริหาร)",
|
||||
},
|
||||
{
|
||||
id: "RESEARCH",
|
||||
name: "ศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ",
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -79,16 +80,14 @@ const visibleColumns = ref<string[]>(["scholarshipYear", "scholarshipType"]);
|
|||
/** ดึงข้อมูล */
|
||||
function getData() {
|
||||
http
|
||||
.get(config.API.developmentScholarship+`/user/${profilId.value}`)
|
||||
.then((res)=>{
|
||||
rows.value = res.data.result
|
||||
}).catch((e)=>{
|
||||
messageError($q,e)
|
||||
}).finally(()=>{
|
||||
|
||||
})
|
||||
|
||||
|
||||
.get(config.API.developmentScholarship + `/user/${profilId.value}`)
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
function onEdit(id: string) {
|
||||
|
|
@ -117,8 +116,8 @@ function getProfileId() {
|
|||
http
|
||||
.get(config.API.profilePosition())
|
||||
.then((res) => {
|
||||
profilId.value = res.data.result.profileId
|
||||
getData()
|
||||
profilId.value = res.data.result.profileId;
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -129,17 +128,17 @@ function getProfileId() {
|
|||
}
|
||||
|
||||
function convertType(val: string) {
|
||||
switch (val) {
|
||||
case "DOMESTICE":
|
||||
return "การศึกษาในประเทศ";
|
||||
case "NOABROAD":
|
||||
return "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)";
|
||||
case "ABROAD":
|
||||
return "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)";
|
||||
case "EXECUTIVE":
|
||||
return "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)";
|
||||
}
|
||||
switch (val) {
|
||||
case "DOMESTICE":
|
||||
return "การศึกษาในประเทศ";
|
||||
case "NOABROAD":
|
||||
return "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)";
|
||||
case "ABROAD":
|
||||
return "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)";
|
||||
case "EXECUTIVE":
|
||||
return "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)";
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
getProfileId();
|
||||
|
|
@ -299,7 +298,7 @@ onMounted(async () => {
|
|||
{{ col.value ? col.value + 543 : "-" }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'scholarshipType'">
|
||||
{{ col.value ? convertType(col.value): "-" }}
|
||||
{{ col.value ? convertType(col.value) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue