Merge branch 'nice_dev' into develop
This commit is contained in:
commit
e9c389ee36
6 changed files with 179 additions and 357 deletions
|
|
@ -6,7 +6,7 @@ const insignia = `${env.API_URI}/insignia`;
|
|||
const Organization = `${env.API_URI}/Organization`
|
||||
export default {
|
||||
getRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||
listRoundInsignia: (type: string) => `${insignia}/period/${type}`,
|
||||
listRoundInsignia: () => `${insignia}/period/`,
|
||||
editRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||
RoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||
requestInsignia: (insigniaPeriodId: string) => `${insignia}/request/${insigniaPeriodId}`,
|
||||
|
|
@ -18,8 +18,8 @@ export default {
|
|||
insigniaManage: (type: string) => `${insignia}/manage/${type}`,
|
||||
insigniaCreate: () => `${insignia}/request`,
|
||||
insigniaList: (insigniaPeriodId: any, ocId: string, role: string, status: any) => `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}`,
|
||||
insigniaReject: (profileId: string) => `${insignia}/status/reject/${profileId}`,
|
||||
insigniaDelete: (profileId: string) => `${insignia}/status/delete/${profileId}`,
|
||||
insigniaReject: (profileId: string) => `${insignia}/request/status/reject/${profileId}`,
|
||||
insigniaDelete: (profileId: string) => `${insignia}/request/status/delete/${profileId}`,
|
||||
insigniaEdit: (profileId: string) => `${insignia}/request/${profileId}`,
|
||||
insigniaAgency: () => `${insignia}/request/agency`,
|
||||
insigniaDashboard: (insigniaPeriodId: string) => `${insignia}/request/dashboard/${insigniaPeriodId}`,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ const visibleColumns = ref<string[]>([
|
|||
"position",
|
||||
"level",
|
||||
"salary",
|
||||
"organization",
|
||||
"insigniaType",
|
||||
"insigniaSend",
|
||||
"insigniaLevel",
|
||||
|
|
@ -93,15 +92,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "insigniaType",
|
||||
align: "left",
|
||||
|
|
@ -139,61 +130,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<any[]>([
|
||||
{
|
||||
no: "1",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นายใจดี ยอดใจ ",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "1",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นายจักกริน บัณฑิต",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นางสาวกัณฐิมา กาฬสินธุ์",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นางสาวเมขลา กระจ่างมนตรี",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
]);
|
||||
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -232,7 +168,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
},
|
||||
]);
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
|
||||
const rows2 = ref<any[]>([]);
|
||||
|
||||
const Note = ref<string>("");
|
||||
|
|
@ -254,12 +190,11 @@ const props = defineProps({
|
|||
type: Function,
|
||||
},
|
||||
});
|
||||
const typeinsignia = ref<number | string>("all");
|
||||
const typeinsigniaOptions = reactive<any>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const typeinsigniaValues: Set<number> = new Set();
|
||||
|
||||
onMounted(async () => {
|
||||
organizationOptions.value = DataStore.optionsTypeOc;
|
||||
organization.value = organizationOptions.value[0].id;
|
||||
organization.value = organizationOptions.value[2].id;
|
||||
DataStore.typeOc = organization.value;
|
||||
// if (props.fecthInsigniaAll) {
|
||||
// await props.fecthInsigniaAll(props.roundId, props.tab);
|
||||
// }
|
||||
|
|
@ -271,7 +206,6 @@ onMounted(async () => {
|
|||
"officer",
|
||||
props.tab
|
||||
);
|
||||
filtertypeInsignia();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -345,7 +279,7 @@ const clickAdd = async (id: string) => {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
addlistperson(id);
|
||||
await addlistperson(id);
|
||||
},
|
||||
"ยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ",
|
||||
"ต้องการยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ นี้หรือไม่ ?"
|
||||
|
|
@ -389,7 +323,11 @@ const addlistperson = async (id: string) => {
|
|||
// actionModal.value = action;
|
||||
// modalNote.value = true;
|
||||
// };
|
||||
const clickmodalEdit = () => {
|
||||
const clickmodalEdit = (props: any) => {
|
||||
insignia.value = "";
|
||||
insigniaType.value = "";
|
||||
person.value = props;
|
||||
console.log(person.value);
|
||||
modalEdit.value = true;
|
||||
fecthInsignia();
|
||||
fecthInsigniaType();
|
||||
|
|
@ -398,62 +336,95 @@ const clickSave = () => {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await listEdit();
|
||||
await listEdit(person.value.id);
|
||||
},
|
||||
"ยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอ",
|
||||
"ต้องการยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
const listEdit = async () => {
|
||||
let data = { insigniaId: organization.value };
|
||||
console.log(data);
|
||||
const listEdit = async (profileId: string) => {
|
||||
let data: any = {
|
||||
insigniaId: insignia.value,
|
||||
insigniaTypeId: insigniaType.value,
|
||||
};
|
||||
await http
|
||||
.get(config.API.insigniaEdit(), data)
|
||||
.put(config.API.insigniaEdit(profileId), data)
|
||||
.then(() => {
|
||||
success($q, "แก้ไขเครื่องราชฯ ที่ยื่นขอสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(async () => {
|
||||
modalEdit.value = false;
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
const clickReject = () => {
|
||||
const clickReject = (profileId: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await listreject();
|
||||
await listreject(profileId);
|
||||
},
|
||||
"ยืนยันการย้ายข้อมูล",
|
||||
"ต้องการยืนยันการย้ายข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
const listreject = async () => {
|
||||
const listreject = async (profileId: string) => {
|
||||
await http
|
||||
.get(config.API.insigniaReject())
|
||||
.get(config.API.insigniaReject(profileId))
|
||||
.then(() => {
|
||||
success($q, "ย้ายข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(async () => {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
const clickDelete = () => {
|
||||
const clickDelete = (profileId: string) => {
|
||||
dialogRemove(
|
||||
$q,
|
||||
async () => {
|
||||
await listdelete();
|
||||
await listdelete(profileId);
|
||||
},
|
||||
"ยืนยันการลบออกข้ออมูล",
|
||||
"ต้องการยืนยันการลบข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
const listdelete = async () => {
|
||||
const listdelete = async (profileId: string) => {
|
||||
await http
|
||||
.get(config.API.insigniaDelete())
|
||||
.get(config.API.insigniaDelete(profileId))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(async () => {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
const insignia = ref<string>("");
|
||||
|
|
@ -477,32 +448,6 @@ const fecthInsigniaType = async () => {
|
|||
.catch((err) => {});
|
||||
};
|
||||
|
||||
const listinsignia = ref<any>([]);
|
||||
const filtertypeInsignia = async () => {
|
||||
listinsignia.value = rows.value;
|
||||
for (const data of listinsignia.value) {
|
||||
const Type = data.insigniaType;
|
||||
if (Type !== null && !typeinsigniaValues.has(Type)) {
|
||||
typeinsigniaOptions.push({
|
||||
id: Type.toString(),
|
||||
name: Type.toString(),
|
||||
});
|
||||
typeinsigniaValues.add(Type);
|
||||
}
|
||||
}
|
||||
};
|
||||
const searchFilterTable = async () => {
|
||||
if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
|
||||
if (typeinsignia.value === "all") {
|
||||
rows.value = listinsignia.value;
|
||||
} else {
|
||||
rows.value = listinsignia.value.filter(
|
||||
(e) => e.insigniaType === typeinsignia.value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
|
@ -538,6 +483,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<!-- {{ DataStore.typeinsigniaOptions }} -->
|
||||
<q-select
|
||||
v-model="organization"
|
||||
label="หน่วยงาน"
|
||||
|
|
@ -557,12 +503,12 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
@update:model-value="changtypeOc"
|
||||
/>
|
||||
<q-select
|
||||
v-model="typeinsignia"
|
||||
v-model="DataStore.typeinsignia"
|
||||
label="ปรเภทเครื่องราชฯ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="typeinsigniaOptions"
|
||||
:options="DataStore.typeinsigniaOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
|
|
@ -572,7 +518,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="searchFilterTable"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
/>
|
||||
<div>
|
||||
<q-btn size="md" icon="mdi-download" flat round color="primary">
|
||||
|
|
@ -632,7 +578,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
<q-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:rows="DataStore.rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="name"
|
||||
flat
|
||||
|
|
@ -672,9 +618,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
<q-td key="salary" :props="props">
|
||||
{{ props.row.salary }}
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props">
|
||||
{{ props.row.organization }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="insigniaType" :props="props">
|
||||
{{ props.row.insigniaType }}
|
||||
</q-td>
|
||||
|
|
@ -718,7 +662,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickReject(props.row)"
|
||||
@click="clickReject(props.row.profileId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
|
|
@ -737,7 +681,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickDelete(props.row)"
|
||||
@click="clickDelete(props.row.profileId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
|
|
@ -884,33 +828,12 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
/>
|
||||
</q-toolbar>
|
||||
<q-separator />
|
||||
|
||||
<div class="q-pa-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-select
|
||||
v-model="insigniaType"
|
||||
label="ประเภทเครื่องราชฯ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="insigniaTypeOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="changtypeOc"
|
||||
/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<q-select
|
||||
v-model="insignia"
|
||||
label="ชั้นเครื่องราชฯ"
|
||||
label="ชื่อเครื่องราชฯ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
|
|
@ -924,7 +847,25 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="changtypeOc"
|
||||
/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<q-select
|
||||
v-model="insigniaType"
|
||||
label="ชั้นเครื่องราชฯ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="insigniaTypeOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ const visibleColumns = ref<string[]>([
|
|||
"position",
|
||||
"level",
|
||||
"salary",
|
||||
"organization",
|
||||
|
||||
"insigniaType",
|
||||
"insigniaSend",
|
||||
"insigniaLevel",
|
||||
|
|
@ -92,15 +92,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "insigniaType",
|
||||
align: "left",
|
||||
|
|
@ -139,63 +130,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<any[]>([
|
||||
{
|
||||
no: "1",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นายใจดี ยอดใจ ",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "1",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นายจักกริน บัณฑิต",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นางสาวกัณฐิมา กาฬสินธุ์",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นางสาวเมขลา กระจ่างมนตรี",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
organizationOptions.value = DataStore.optionsTypeOc;
|
||||
organization.value = organizationOptions.value[0].id;
|
||||
DataStore.typeOc = organization.value;
|
||||
// if (props.fecthInsigniaAll) {
|
||||
// await props.fecthInsigniaAll(props.roundId, props.tab);
|
||||
// }
|
||||
|
|
@ -207,7 +146,6 @@ onMounted(async () => {
|
|||
"officer",
|
||||
props.tab
|
||||
);
|
||||
filtertypeInsignia();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -222,35 +160,6 @@ const changtypeOc = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const typeinsignia = ref<number | string>("all");
|
||||
const typeinsigniaOptions = reactive<any>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const typeinsigniaValues: Set<number> = new Set();
|
||||
const listinsignia = ref<any>([]);
|
||||
const filtertypeInsignia = async () => {
|
||||
listinsignia.value = rows.value;
|
||||
for (const data of listinsignia.value) {
|
||||
const Type = data.insigniaType;
|
||||
if (Type !== null && !typeinsigniaValues.has(Type)) {
|
||||
typeinsigniaOptions.push({
|
||||
id: Type.toString(),
|
||||
name: Type.toString(),
|
||||
});
|
||||
typeinsigniaValues.add(Type);
|
||||
}
|
||||
}
|
||||
};
|
||||
const searchFilterTable = async () => {
|
||||
if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
|
||||
if (typeinsignia.value === "all") {
|
||||
rows.value = listinsignia.value;
|
||||
} else {
|
||||
rows.value = listinsignia.value.filter(
|
||||
(e) => e.insigniaType === typeinsignia.value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const resetFilter = () => {
|
||||
|
|
@ -272,6 +181,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<template>
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12">
|
||||
<!-- {{ DataStore.typeinsigniaOptions }} -->
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
v-model="organization"
|
||||
|
|
@ -292,12 +202,12 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
@update:model-value="changtypeOc"
|
||||
/>
|
||||
<q-select
|
||||
v-model="typeinsignia"
|
||||
v-model="DataStore.typeinsignia"
|
||||
label="ปรเภทเครื่องราชฯ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="typeinsigniaOptions"
|
||||
:options="DataStore.typeinsigniaOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
|
|
@ -307,7 +217,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="searchFilterTable"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
/>
|
||||
<q-space />
|
||||
|
||||
|
|
@ -352,7 +262,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:rows="DataStore.rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="name"
|
||||
flat
|
||||
|
|
@ -395,9 +305,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-td key="salary" :props="props">
|
||||
{{ props.row.salary }}
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props">
|
||||
{{ props.row.organization }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="insigniaType" :props="props">
|
||||
{{ props.row.insigniaType }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ const visibleColumns = ref<string[]>([
|
|||
"position",
|
||||
"level",
|
||||
"salary",
|
||||
"organization",
|
||||
"insigniaType",
|
||||
"insigniaSend",
|
||||
"insigniaLevel",
|
||||
|
|
@ -91,15 +90,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "insigniaType",
|
||||
align: "left",
|
||||
|
|
@ -137,64 +127,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<any[]>([
|
||||
{
|
||||
no: "1",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นายใจดี ยอดใจ ",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "1",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นายจักกริน บัณฑิต",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นางสาวกัณฐิมา กาฬสินธุ์",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
citizenId: "1xxxxxxxxxx",
|
||||
name: "นางสาวเมขลา กระจ่างมนตรี",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
salary: "15000",
|
||||
organization: "บริหาร",
|
||||
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
|
||||
insigniaSend: "ตริตาภรณ์ช้างเผือก",
|
||||
insigniaLevel: "ต่ำกว่าสายสะพาย",
|
||||
dateSend: "31 ม.ค. 2566",
|
||||
},
|
||||
]);
|
||||
onMounted(async () => {
|
||||
organizationOptions.value = DataStore.optionsTypeOc;
|
||||
organization.value = organizationOptions.value[0].id;
|
||||
DataStore.typeOc = organization.value;
|
||||
// if (props.fecthInsigniaAll) {
|
||||
// await props.fecthInsigniaAll(props.roundId, props.tab);
|
||||
// }
|
||||
|
|
@ -206,7 +142,6 @@ onMounted(async () => {
|
|||
"officer",
|
||||
props.tab
|
||||
);
|
||||
filtertypeInsignia();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -221,35 +156,6 @@ const changtypeOc = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const typeinsignia = ref<number | string>("all");
|
||||
const typeinsigniaOptions = reactive<any>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const typeinsigniaValues: Set<number> = new Set();
|
||||
const listinsignia = ref<any>([]);
|
||||
const filtertypeInsignia = async () => {
|
||||
listinsignia.value = rows.value;
|
||||
for (const data of listinsignia.value) {
|
||||
const Type = data.insigniaType;
|
||||
if (Type !== null && !typeinsigniaValues.has(Type)) {
|
||||
typeinsigniaOptions.push({
|
||||
id: Type.toString(),
|
||||
name: Type.toString(),
|
||||
});
|
||||
typeinsigniaValues.add(Type);
|
||||
}
|
||||
}
|
||||
};
|
||||
const searchFilterTable = async () => {
|
||||
if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
|
||||
if (typeinsignia.value === "all") {
|
||||
rows.value = listinsignia.value;
|
||||
} else {
|
||||
rows.value = listinsignia.value.filter(
|
||||
(e) => e.insigniaType === typeinsignia.value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const resetFilter = () => {
|
||||
|
|
@ -291,12 +197,12 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
@update:model-value="changtypeOc"
|
||||
/>
|
||||
<q-select
|
||||
v-model="typeinsignia"
|
||||
v-model="DataStore.typeinsignia"
|
||||
label="ปรเภทเครื่องราชฯ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="typeinsigniaOptions"
|
||||
:options="DataStore.typeinsigniaOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
|
|
@ -306,7 +212,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="searchFilterTable"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
/>
|
||||
<q-space />
|
||||
|
||||
|
|
@ -351,7 +257,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:rows="DataStore.rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="name"
|
||||
flat
|
||||
|
|
@ -394,9 +300,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-td key="salary" :props="props">
|
||||
{{ props.row.salary }}
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props">
|
||||
{{ props.row.organization }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="insigniaType" :props="props">
|
||||
{{ props.row.insigniaType }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -36,13 +36,12 @@ const stat = ref<any>({
|
|||
disclaim: 0,
|
||||
});
|
||||
onMounted(async () => {
|
||||
console.log(DataStore.optionsTypeOc);
|
||||
await fecthlistRound();
|
||||
await fecthType();
|
||||
});
|
||||
const fecthlistRound = async () => {
|
||||
await http
|
||||
.get(config.API.listRoundInsignia("insignia"))
|
||||
.get(config.API.listRoundInsignia())
|
||||
.then((res: any) => {
|
||||
optionRound.value = res.data.result.map((e: any) => ({
|
||||
id: e.period_id,
|
||||
|
|
@ -84,8 +83,6 @@ const fecthStat = async (id: string) => {
|
|||
.get(config.API.insigniaDashboard(id))
|
||||
.then((res) => {
|
||||
stat.value = res.data.result;
|
||||
// console.log(res);
|
||||
console.log(stat.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -96,6 +93,7 @@ const fecthStat = async (id: string) => {
|
|||
};
|
||||
const changround = () => {
|
||||
fecthStat(round.value);
|
||||
fecthInsigniaByOc(round.value, DataStore.typeOc, "officer", tab.value);
|
||||
};
|
||||
const fecthInsigniaAll = async (periodId: string, tab: string) => {
|
||||
// let data: any = [];
|
||||
|
|
@ -118,14 +116,20 @@ const fecthInsigniaByOc = async (
|
|||
role: string,
|
||||
status: string
|
||||
) => {
|
||||
console.log(status);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaList(roundId, ocId, role, status))
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
console.log(res);
|
||||
|
||||
await DataStore.fetchData(res.data.result.items);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
// messageError($q);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
@ -143,6 +147,7 @@ const fecthInsigniaByOc = async (
|
|||
v-model="round"
|
||||
:options="optionRound"
|
||||
map-options
|
||||
emit-value
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="changround"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,73 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref, } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai
|
||||
} = mixin;
|
||||
|
||||
|
||||
export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||
let optionsTypeOc = ref<any>([]);
|
||||
let typeOc = ref<string>("")
|
||||
let rows = ref<any>([])
|
||||
const listinsignia = ref<any>([])
|
||||
const typeinsigniaValues: Set<number> = new Set();
|
||||
const typeinsignia = ref<number | string>("all");
|
||||
let typeinsigniaOptions = ref<any>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
|
||||
|
||||
const fetchData = async (data: any) => {
|
||||
if (data !== null) {
|
||||
rows.value = await data.map((e: any) =>
|
||||
({
|
||||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
name: e.fullName,
|
||||
position: e.position,
|
||||
level: e.rank,
|
||||
salary2: e.salary,
|
||||
salary: Number(e.salary).toLocaleString(),
|
||||
insigniaType: e.lastInsignia,
|
||||
insigniaSend: e.requestInsignia,
|
||||
insigniaLevel: e.level,
|
||||
dateSend: date2Thai(e.requestDate),
|
||||
}))
|
||||
listinsignia.value = await rows.value
|
||||
filtertypeInsignia()
|
||||
} else rows.value = []
|
||||
|
||||
|
||||
}
|
||||
const filtertypeInsignia = async () => {
|
||||
typeinsignia.value = "all"
|
||||
for (const data of listinsignia.value) {
|
||||
const Type = data.insigniaType;
|
||||
if (Type !== null && !typeinsigniaValues.has(Type)) {
|
||||
typeinsigniaOptions.value.push({ id: Type, name: Type })
|
||||
typeinsigniaValues.add(Type);
|
||||
}
|
||||
}
|
||||
};
|
||||
const searchFilterTable = async () => {
|
||||
if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
|
||||
if (typeinsignia.value === "all") {
|
||||
rows.value = listinsignia.value;
|
||||
} else {
|
||||
rows.value = listinsignia.value.filter(
|
||||
(e: any) => e.insigniaType === typeinsignia.value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
return {
|
||||
optionsTypeOc
|
||||
optionsTypeOc,
|
||||
typeOc,
|
||||
rows,
|
||||
typeinsigniaOptions,
|
||||
typeinsignia,
|
||||
fetchData,
|
||||
searchFilterTable,
|
||||
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue