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) =>
|
||||
`${insignia}/request/status/delete/${profileId}`,
|
||||
insigniaEdit: (profileId: string) => `${insignia}/request/${profileId}`,
|
||||
insigniaNosend: (insigniaPeriodId: any) =>
|
||||
`${insignia}/request/org/no-send/${insigniaPeriodId}`,
|
||||
insigniaNosend: (insigniaPeriodId: any, type: string = "officer") =>
|
||||
`${insignia}/request/org/no-send/${type}/${insigniaPeriodId}`,
|
||||
insigniaAgency: () => `${insignia}/request/agency`,
|
||||
insigniaDashboard: (insigniaPeriodId: string) =>
|
||||
`${insignia}/request/dashboard/${insigniaPeriodId}`,
|
||||
insigniaDashboard: (insigniaPeriodId: string, type: string = "officer") =>
|
||||
`${insignia}/request/dashboard/${type}/${insigniaPeriodId}`,
|
||||
// record
|
||||
noteround: () => `${insignia}/request/note`,
|
||||
requestDocNote: (id: string) => `${insignia}/request/note/doc/${id}`,
|
||||
|
|
@ -46,12 +46,21 @@ export default {
|
|||
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
|
||||
noteByid: (id: string) => `${insignia}/request/note/${id}`,
|
||||
|
||||
insigniaSendToDirector: (roundId: string, ocId: string) =>
|
||||
`${insignia}/request/officer/approve/${roundId}/${ocId}`,
|
||||
insigniaDirectorBackToEdit: (roundId: string, ocId: string) =>
|
||||
`${insignia}/request/director/reject/${roundId}/${ocId}`,
|
||||
insigniaDirectorApproved: (roundId: string, ocId: string) =>
|
||||
`${insignia}/request/director/approve/${roundId}/${ocId}`,
|
||||
insigniaSendToDirector: (
|
||||
roundId: string,
|
||||
ocId: string,
|
||||
type: string = "officer"
|
||||
) => `${insignia}/request/officer/approve/${type}/${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) =>
|
||||
`${insignia}/request/send/note/${insigniaPeriodId}`,
|
||||
|
||||
|
|
@ -107,8 +116,8 @@ export default {
|
|||
uploadfileOnlyInsignia: (requestId: string) =>
|
||||
`${insignia}/request/upload/${requestId}`,
|
||||
// สกจ. ตีกลับให้หัวหน้าเขต
|
||||
rejectRequest: (id: string, ocId: string) =>
|
||||
`${insignia}/request/head/reject/${id}/${ocId}`,
|
||||
rejectRequest: (id: string, ocId: string, type: string = "officer") =>
|
||||
`${insignia}/request/head/reject/${type}/${id}/${ocId}`,
|
||||
|
||||
reportInsigniaNew: `${insignia}/report`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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) => ({
|
||||
|
|
|
|||
|
|
@ -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" },
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue