update api path insignia

This commit is contained in:
Warunee Tamkoo 2025-05-29 17:54:41 +07:00
parent f5b677e26c
commit 7ac582d451
5 changed files with 72 additions and 42 deletions

View file

@ -63,7 +63,7 @@ const pagination = ref({
async function fecthOrg() {
showLoader();
await http
.get(config.API.insigniaNosend(props.roundId))
.get(config.API.insigniaNosend(props.roundId, DataStore.employeeClass))
.then((res) => {
let data = res.data.result;
rows.value = data.map((e: ResponseNoSend) => ({

View file

@ -37,9 +37,9 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
const typeinsigniaOptions = ref<OptionData[]>([
{ id: "all", name: "ทั้งหมด" },
]);
const employeeClass = ref<string>("all");
const employeeClass = ref<string>("officer");
const employeeClassOps = ref<OptionData[]>([
{ name: "ทั้งหมด", id: "all" },
// { name: "ทั้งหมด", id: "all" },
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
{ name: "ลูกจ้างประจำ", id: "perm" },
]);

View file

@ -234,7 +234,7 @@ async function fecthInsigniaByOc(
ocId: string,
role: string,
status: string,
isDeputy: boolean = false
isDeputy: boolean = DataStore.isDeputy
) {
DataStore.rows = [];
if (roundId && ocId && role && status) {
@ -424,7 +424,7 @@ function requestSendNote() {
}
/**
* function เดตขอมลคณสมบ
* function เดตขอมลคณสมบ
*/
async function updateDataProperty() {
dialogConfirm($q, async () => {
@ -443,7 +443,7 @@ async function updateDataProperty() {
"officer",
tab.value
);
success($q, "อัเดตข้อมูลคุณสมบัติสำเร็จ");
success($q, "อัเดตข้อมูลคุณสมบัติสำเร็จ");
})
.catch((err) => {
messageError($q, err);
@ -538,21 +538,22 @@ onUnmounted(() => {
>
<q-tooltip>อกขอม</q-tooltip>
</q-btn>
<!-- เดตขอมลคณสมบ -->
<!-- เดตขอมลคณสมบ -->
<q-btn
v-if="
DataStore.isStaff &&
DataStore.isLock !== true &&
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
DataStore.isLock !== true && (requestStatus == 'st1' || requestStatus == 'st4') &&
checkPermission($route)?.attrIsUpdate
"
dense
unelevated
label="อัเดตข้อมูลคุณสมบัติ"
color="public"
class="q-px-md q-ml-md"
label="อัเดตข้อมูลคุณสมบัติ"
color="info"
class="q-px-md q-ml-sm"
@click="updateDataProperty"
>
<q-tooltip>เดตขอมลคณสมบ</q-tooltip>
<q-tooltip>เดตขอมลคณสมบ</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>

View file

@ -110,7 +110,7 @@ async function fecthlistRound() {
async function fecthStat(id: string) {
if (DataStore.isOfficer) {
await http
.get(config.API.insigniaDashboard(id))
.get(config.API.insigniaDashboard(id, "employee"))
.then((res) => {
stat.value = res.data.result;
})
@ -234,7 +234,7 @@ async function fecthInsigniaByOc(
ocId: string,
role: string,
status: string,
isDeputy: boolean = false
isDeputy: boolean = DataStore.isDeputy
) {
DataStore.rows = [];
if (roundId && ocId && role && status) {
@ -280,7 +280,13 @@ function sendToDirector() {
dialogConfirm($q, () => {
showLoader();
http
.get(config.API.insigniaSendToDirector(round.value, DataStore.agency))
.get(
config.API.insigniaSendToDirector(
round.value,
DataStore.agency,
"employee"
)
)
.then(async () => {
await fecthStat(round.value);
await fecthInsigniaByOc(
@ -323,7 +329,11 @@ function backToEdit(reason: string) {
showLoader();
http
.put(
config.API.insigniaDirectorBackToEdit(round.value, DataStore.agency),
config.API.insigniaDirectorBackToEdit(
round.value,
DataStore.agency,
"employee"
),
{
reason: reason,
}
@ -357,7 +367,13 @@ function directorApproved() {
() => {
showLoader();
http
.get(config.API.insigniaDirectorApproved(round.value, DataStore.agency))
.get(
config.API.insigniaDirectorApproved(
round.value,
DataStore.agency,
"employee"
)
)
.then(async () => {
await fecthInsigniaByOc(
round.value,
@ -385,9 +401,12 @@ function directorApproved() {
function backToEditinsignia2Role(reason: string) {
dialogConfirm($q, () => {
http
.put(config.API.rejectRequest(round.value, DataStore.typeOc), {
reason: reason,
})
.put(
config.API.rejectRequest(round.value, DataStore.typeOc, "employee"),
{
reason: reason,
}
)
.then(async () => {
await fecthInsigniaByOc(
round.value,
@ -405,7 +424,7 @@ function backToEditinsignia2Role(reason: string) {
}
/**
* function เดตขอมลคณสมบ
* function เดตขอมลคณสมบ
*/
async function updateDataProperty() {
dialogConfirm($q, async () => {
@ -424,7 +443,7 @@ async function updateDataProperty() {
"officer",
tab.value
);
success($q, "อัเดตข้อมูลคุณสมบัติสำเร็จ");
success($q, "อัเดตข้อมูลคุณสมบัติสำเร็จ");
})
.catch((err) => {
messageError($q, err);
@ -504,21 +523,22 @@ onUnmounted(() => {
<q-space />
<!-- เดตขอมลคณสมบ -->
<!-- เดตขอมลคณสมบ -->
<q-btn
v-if="
DataStore.isStaff &&
DataStore.isLock !== true &&
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
DataStore.isLock !== true && (requestStatus == 'st1' || requestStatus == 'st4') &&
checkPermission($route)?.attrIsUpdate
"
dense
unelevated
label="อัเดตข้อมูลคุณสมบัติ"
color="public"
class="q-px-md q-ml-md"
label="อัเดตข้อมูลคุณสมบัติ"
color="info"
class="q-px-md q-ml-sm"
@click="updateDataProperty"
>
<q-tooltip>เดตขอมลคณสมบ</q-tooltip>
<q-tooltip>เดตขอมลคณสมบ</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>