update api path insignia
This commit is contained in:
parent
f5b677e26c
commit
7ac582d451
5 changed files with 72 additions and 42 deletions
|
|
@ -32,11 +32,11 @@ export default {
|
||||||
insigniaDelete: (profileId: string) =>
|
insigniaDelete: (profileId: string) =>
|
||||||
`${insignia}/request/status/delete/${profileId}`,
|
`${insignia}/request/status/delete/${profileId}`,
|
||||||
insigniaEdit: (profileId: string) => `${insignia}/request/${profileId}`,
|
insigniaEdit: (profileId: string) => `${insignia}/request/${profileId}`,
|
||||||
insigniaNosend: (insigniaPeriodId: any) =>
|
insigniaNosend: (insigniaPeriodId: any, type: string = "officer") =>
|
||||||
`${insignia}/request/org/no-send/${insigniaPeriodId}`,
|
`${insignia}/request/org/no-send/${type}/${insigniaPeriodId}`,
|
||||||
insigniaAgency: () => `${insignia}/request/agency`,
|
insigniaAgency: () => `${insignia}/request/agency`,
|
||||||
insigniaDashboard: (insigniaPeriodId: string) =>
|
insigniaDashboard: (insigniaPeriodId: string, type: string = "officer") =>
|
||||||
`${insignia}/request/dashboard/${insigniaPeriodId}`,
|
`${insignia}/request/dashboard/${type}/${insigniaPeriodId}`,
|
||||||
// record
|
// record
|
||||||
noteround: () => `${insignia}/request/note`,
|
noteround: () => `${insignia}/request/note`,
|
||||||
requestDocNote: (id: string) => `${insignia}/request/note/doc/${id}`,
|
requestDocNote: (id: string) => `${insignia}/request/note/doc/${id}`,
|
||||||
|
|
@ -46,12 +46,21 @@ export default {
|
||||||
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
|
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
|
||||||
noteByid: (id: string) => `${insignia}/request/note/${id}`,
|
noteByid: (id: string) => `${insignia}/request/note/${id}`,
|
||||||
|
|
||||||
insigniaSendToDirector: (roundId: string, ocId: string) =>
|
insigniaSendToDirector: (
|
||||||
`${insignia}/request/officer/approve/${roundId}/${ocId}`,
|
roundId: string,
|
||||||
insigniaDirectorBackToEdit: (roundId: string, ocId: string) =>
|
ocId: string,
|
||||||
`${insignia}/request/director/reject/${roundId}/${ocId}`,
|
type: string = "officer"
|
||||||
insigniaDirectorApproved: (roundId: string, ocId: string) =>
|
) => `${insignia}/request/officer/approve/${type}/${roundId}/${ocId}`,
|
||||||
`${insignia}/request/director/approve/${roundId}/${ocId}`,
|
insigniaDirectorBackToEdit: (
|
||||||
|
roundId: string,
|
||||||
|
ocId: string,
|
||||||
|
type: string = "officer"
|
||||||
|
) => `${insignia}/request/director/reject/${type}/${roundId}/${ocId}`,
|
||||||
|
insigniaDirectorApproved: (
|
||||||
|
roundId: string,
|
||||||
|
ocId: string,
|
||||||
|
type: string = "officer"
|
||||||
|
) => `${insignia}/request/director/approve/${type}/${roundId}/${ocId}`,
|
||||||
insigniaRequestSendNote: (insigniaPeriodId: string) =>
|
insigniaRequestSendNote: (insigniaPeriodId: string) =>
|
||||||
`${insignia}/request/send/note/${insigniaPeriodId}`,
|
`${insignia}/request/send/note/${insigniaPeriodId}`,
|
||||||
|
|
||||||
|
|
@ -107,8 +116,8 @@ export default {
|
||||||
uploadfileOnlyInsignia: (requestId: string) =>
|
uploadfileOnlyInsignia: (requestId: string) =>
|
||||||
`${insignia}/request/upload/${requestId}`,
|
`${insignia}/request/upload/${requestId}`,
|
||||||
// สกจ. ตีกลับให้หัวหน้าเขต
|
// สกจ. ตีกลับให้หัวหน้าเขต
|
||||||
rejectRequest: (id: string, ocId: string) =>
|
rejectRequest: (id: string, ocId: string, type: string = "officer") =>
|
||||||
`${insignia}/request/head/reject/${id}/${ocId}`,
|
`${insignia}/request/head/reject/${type}/${id}/${ocId}`,
|
||||||
|
|
||||||
reportInsigniaNew: `${insignia}/report`,
|
reportInsigniaNew: `${insignia}/report`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ const pagination = ref({
|
||||||
async function fecthOrg() {
|
async function fecthOrg() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.insigniaNosend(props.roundId))
|
.get(config.API.insigniaNosend(props.roundId, DataStore.employeeClass))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
rows.value = data.map((e: ResponseNoSend) => ({
|
rows.value = data.map((e: ResponseNoSend) => ({
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
const typeinsigniaOptions = ref<OptionData[]>([
|
const typeinsigniaOptions = ref<OptionData[]>([
|
||||||
{ id: "all", name: "ทั้งหมด" },
|
{ id: "all", name: "ทั้งหมด" },
|
||||||
]);
|
]);
|
||||||
const employeeClass = ref<string>("all");
|
const employeeClass = ref<string>("officer");
|
||||||
const employeeClassOps = ref<OptionData[]>([
|
const employeeClassOps = ref<OptionData[]>([
|
||||||
{ name: "ทั้งหมด", id: "all" },
|
// { name: "ทั้งหมด", id: "all" },
|
||||||
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
||||||
{ name: "ลูกจ้างประจำ", id: "perm" },
|
{ name: "ลูกจ้างประจำ", id: "perm" },
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ async function fecthInsigniaByOc(
|
||||||
ocId: string,
|
ocId: string,
|
||||||
role: string,
|
role: string,
|
||||||
status: string,
|
status: string,
|
||||||
isDeputy: boolean = false
|
isDeputy: boolean = DataStore.isDeputy
|
||||||
) {
|
) {
|
||||||
DataStore.rows = [];
|
DataStore.rows = [];
|
||||||
if (roundId && ocId && role && status) {
|
if (roundId && ocId && role && status) {
|
||||||
|
|
@ -424,7 +424,7 @@ function requestSendNote() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function อัพเดตข้อมูลคุณสมบัติ
|
* function อัปเดตข้อมูลคุณสมบัติ
|
||||||
*/
|
*/
|
||||||
async function updateDataProperty() {
|
async function updateDataProperty() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
|
|
@ -443,7 +443,7 @@ async function updateDataProperty() {
|
||||||
"officer",
|
"officer",
|
||||||
tab.value
|
tab.value
|
||||||
);
|
);
|
||||||
success($q, "อัพเดตข้อมูลคุณสมบัติสำเร็จ");
|
success($q, "อัปเดตข้อมูลคุณสมบัติสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -538,21 +538,22 @@ onUnmounted(() => {
|
||||||
>
|
>
|
||||||
<q-tooltip>ล็อกข้อมูล</q-tooltip>
|
<q-tooltip>ล็อกข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<!-- อัพเดตข้อมูลคุณสมบัติ -->
|
<!-- อัปเดตข้อมูลคุณสมบัติ -->
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
DataStore.isStaff &&
|
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||||
DataStore.isLock !== true &&
|
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||||
|
DataStore.isLock !== true && (requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||||
checkPermission($route)?.attrIsUpdate
|
checkPermission($route)?.attrIsUpdate
|
||||||
"
|
"
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
label="อัพเดตข้อมูลคุณสมบัติ"
|
label="อัปเดตข้อมูลคุณสมบัติ"
|
||||||
color="public"
|
color="info"
|
||||||
class="q-px-md q-ml-md"
|
class="q-px-md q-ml-sm"
|
||||||
@click="updateDataProperty"
|
@click="updateDataProperty"
|
||||||
>
|
>
|
||||||
<q-tooltip>อัพเดตข้อมูลคุณสมบัติ</q-tooltip>
|
<q-tooltip>อัปเดตข้อมูลคุณสมบัติ</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ async function fecthlistRound() {
|
||||||
async function fecthStat(id: string) {
|
async function fecthStat(id: string) {
|
||||||
if (DataStore.isOfficer) {
|
if (DataStore.isOfficer) {
|
||||||
await http
|
await http
|
||||||
.get(config.API.insigniaDashboard(id))
|
.get(config.API.insigniaDashboard(id, "employee"))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
stat.value = res.data.result;
|
stat.value = res.data.result;
|
||||||
})
|
})
|
||||||
|
|
@ -234,7 +234,7 @@ async function fecthInsigniaByOc(
|
||||||
ocId: string,
|
ocId: string,
|
||||||
role: string,
|
role: string,
|
||||||
status: string,
|
status: string,
|
||||||
isDeputy: boolean = false
|
isDeputy: boolean = DataStore.isDeputy
|
||||||
) {
|
) {
|
||||||
DataStore.rows = [];
|
DataStore.rows = [];
|
||||||
if (roundId && ocId && role && status) {
|
if (roundId && ocId && role && status) {
|
||||||
|
|
@ -280,7 +280,13 @@ function sendToDirector() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.insigniaSendToDirector(round.value, DataStore.agency))
|
.get(
|
||||||
|
config.API.insigniaSendToDirector(
|
||||||
|
round.value,
|
||||||
|
DataStore.agency,
|
||||||
|
"employee"
|
||||||
|
)
|
||||||
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fecthStat(round.value);
|
await fecthStat(round.value);
|
||||||
await fecthInsigniaByOc(
|
await fecthInsigniaByOc(
|
||||||
|
|
@ -323,7 +329,11 @@ function backToEdit(reason: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.put(
|
.put(
|
||||||
config.API.insigniaDirectorBackToEdit(round.value, DataStore.agency),
|
config.API.insigniaDirectorBackToEdit(
|
||||||
|
round.value,
|
||||||
|
DataStore.agency,
|
||||||
|
"employee"
|
||||||
|
),
|
||||||
{
|
{
|
||||||
reason: reason,
|
reason: reason,
|
||||||
}
|
}
|
||||||
|
|
@ -357,7 +367,13 @@ function directorApproved() {
|
||||||
() => {
|
() => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.insigniaDirectorApproved(round.value, DataStore.agency))
|
.get(
|
||||||
|
config.API.insigniaDirectorApproved(
|
||||||
|
round.value,
|
||||||
|
DataStore.agency,
|
||||||
|
"employee"
|
||||||
|
)
|
||||||
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fecthInsigniaByOc(
|
await fecthInsigniaByOc(
|
||||||
round.value,
|
round.value,
|
||||||
|
|
@ -385,9 +401,12 @@ function directorApproved() {
|
||||||
function backToEditinsignia2Role(reason: string) {
|
function backToEditinsignia2Role(reason: string) {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
http
|
http
|
||||||
.put(config.API.rejectRequest(round.value, DataStore.typeOc), {
|
.put(
|
||||||
reason: reason,
|
config.API.rejectRequest(round.value, DataStore.typeOc, "employee"),
|
||||||
})
|
{
|
||||||
|
reason: reason,
|
||||||
|
}
|
||||||
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fecthInsigniaByOc(
|
await fecthInsigniaByOc(
|
||||||
round.value,
|
round.value,
|
||||||
|
|
@ -405,7 +424,7 @@ function backToEditinsignia2Role(reason: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function อัพเดตข้อมูลคุณสมบัติ
|
* function อัปเดตข้อมูลคุณสมบัติ
|
||||||
*/
|
*/
|
||||||
async function updateDataProperty() {
|
async function updateDataProperty() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
|
|
@ -424,7 +443,7 @@ async function updateDataProperty() {
|
||||||
"officer",
|
"officer",
|
||||||
tab.value
|
tab.value
|
||||||
);
|
);
|
||||||
success($q, "อัพเดตข้อมูลคุณสมบัติสำเร็จ");
|
success($q, "อัปเดตข้อมูลคุณสมบัติสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -504,21 +523,22 @@ onUnmounted(() => {
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
||||||
<!-- อัพเดตข้อมูลคุณสมบัติ -->
|
<!-- อัปเดตข้อมูลคุณสมบัติ -->
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
DataStore.isStaff &&
|
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||||
DataStore.isLock !== true &&
|
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||||
|
DataStore.isLock !== true && (requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||||
checkPermission($route)?.attrIsUpdate
|
checkPermission($route)?.attrIsUpdate
|
||||||
"
|
"
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
label="อัพเดตข้อมูลคุณสมบัติ"
|
label="อัปเดตข้อมูลคุณสมบัติ"
|
||||||
color="public"
|
color="info"
|
||||||
class="q-px-md q-ml-md"
|
class="q-px-md q-ml-sm"
|
||||||
@click="updateDataProperty"
|
@click="updateDataProperty"
|
||||||
>
|
>
|
||||||
<q-tooltip>อัพเดตข้อมูลคุณสมบัติ</q-tooltip>
|
<q-tooltip>อัปเดตข้อมูลคุณสมบัติ</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue