Merge branch 'develop' into working

# Conflicts:
#	src/interface/request/main/main.ts
#	src/modules/08_registryEmployee/router.ts
#	src/modules/08_registryEmployee/views/Main.vue
This commit is contained in:
Tanyalak 2023-08-16 17:06:58 +07:00
commit 06c3d36c7a
333 changed files with 64333 additions and 12866 deletions

View file

@ -16,6 +16,7 @@ const retireld_params = route.params.id;
const props = defineProps({
retireld: String,
profileId: String,
dataProfile: Object,
UpdateListId: {
type: Function,
default: () => console.log("UpdateListId"),
@ -112,8 +113,8 @@ const rows = ref<any>([
watch(modal, () => {
if (modal.value === true) {
retireld.value = props.retireld;
if (type_params === "officer") {
type.value = type_params;
if (props.dataProfile.type === "OFFICER") {
type.value = "officer";
} else type.value = "all";
fecthlistRetire();
@ -125,8 +126,7 @@ const fecthlistRetire = async () => {
await http
.get(config.API.profileOrganizRoot)
.then((res) => {
// console.log(res);
console.log(res);
const id = res.data.result[0].id;
if (id !== "") {
findlist(id);

View file

@ -4,18 +4,18 @@ import AddList from "../ListRetirement/AddList.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRouter } from "vue-router";
const router = useRouter();
const route = useRoute();
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success } = mixin;
const type_params = route.params.type;
const year_params = route.params.year;
const retireld_params = route.params.id;
// const type_params = route.params.type;
// const year_params = route.params.year;
const retireld_params = route.params.retirementId;
const modalNote = ref<boolean>(false);
const note = ref<string>("");
@ -34,15 +34,15 @@ const columns = ref<any["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
/* {
name: "fixname",
align: "left",
label: "คำนำหน้านาม",
title: "คำนำหน้านาม",
field: "fixname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
}, */
/* {
name: "fixname",
align: "left",
label: "คำนำหน้านาม",
title: "คำนำหน้านาม",
field: "fixname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
}, */
{
name: "name",
align: "left",
@ -159,22 +159,28 @@ const visibleColumns = ref<string[]>([
"bureau",
]);
const action = ref<string>("");
onMounted(() => {
// console.log(route.params);
if (retireld_params === undefined) {
fecthlistprofile(type_params, year_params);
} else {
fecthlist(retireld_params);
}
retireld.value = retireld_params.toString();
console.log(retireld_params);
fecthlistprofile(retireld.value);
});
const round = ref<number>();
const typeReport = ref<string>("");
const statusReport = ref<boolean>();
const dataProfile = ref<Object>([]);
// fecthlist
const fecthlistprofile = async (type: any, year: any) => {
const fecthlistprofile = async (id: string) => {
showLoader();
await http
.get(config.API.profile(type, year))
.then((res: any) => {
// console.log(res);
retireld.value = res.data.result.id;
.get(config.API.listRetire(id))
.then((res) => {
console.log(res);
dataProfile.value = res.data.result;
round.value = res.data.result.round;
statusReport.value = res.data.result.json;
typeReport.value = res.data.result.typeReport;
rows.value = res.data.result.profile.map((e: any) => ({
id: e.id,
profileId: e.profileId,
@ -187,37 +193,12 @@ const fecthlistprofile = async (type: any, year: any) => {
positionNumber: e.posNoEmployee,
positionLavel: e.positionEmployeeLevel,
bureau: e.oc,
reason: e.reason,
remove: e.remove,
}));
console.log(statusReport.value);
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const fecthlist = async (retireld: any) => {
showLoader();
await http
.get(config.API.listRetire(retireld))
.then((res: any) => {
// retireld.value = res.data.result.id;
rows.value = res.data.result.map((e: any) => ({
id: e.id,
profileId: e.profileId,
order: e.order,
fixname: e.prefix,
name: e.fullName,
organizationOrganization: e.organizationOrganization,
positionType: e.positionType,
position: e.position,
positionNumber: e.posNoEmployee,
positionLavel: e.positionEmployeeLevel,
bureau: e.oc,
}));
// console.log(rows.value);
})
.catch((e: any) => {
.catch((e) => {
messageError($q, e);
})
.finally(() => {
@ -225,10 +206,7 @@ const fecthlist = async (retireld: any) => {
});
};
// DelProfile
const clickDelete = (prop: any) => {
console.log(prop);
let retireProfileId = prop.profileId;
const clickDelete = () => {
$q.dialog({
title: "ยืนยันการลบข้อมูล",
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
@ -240,7 +218,10 @@ const clickDelete = (prop: any) => {
})
.onOk(async () => {
await http
.delete(config.API.profileRetire(retireProfileId))
.post(config.API.removeProfile(), {
retireProfileId: retireProfileId.value,
reason: note.value,
})
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
@ -248,28 +229,30 @@ const clickDelete = (prop: any) => {
messageError($q, e);
})
.finally(async () => {
if (retireld_params === undefined) {
await fecthlistprofile(type_params, year_params);
} else await fecthlist(retireld_params);
retireld.value = retireld_params.toString();
await fecthlistprofile(retireld.value);
modalNote.value = false;
});
})
.onCancel(() => {})
.onDismiss(() => {});
};
// note
const fetchReason = async (prop: string) => {
await http
.get(config.API.reasonId(prop))
.then((res: any) => {
console.log(res.data.result);
note.value = res.data.result.reason;
retireProfileId.value = res.data.result.id;
})
.catch((e: any) => {
messageError($q, e);
});
};
// const fetchReason = async (prop: string) => {
// await http
// .get(config.API.reasonId(prop))
// .then((res: any) => {
// console.log(res.data.result);
// note.value = res.data.result.reason;
// retireProfileId.value = res.data.result.id;
// })
// .catch((e: any) => {
// messageError($q, e);
// });
// };
const saveNote = () => {
console.log(retireProfileId.value, note.value);
$q.dialog({
title: "ยืนยันการบันทึกข้อมูลข้อมูล",
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?",
@ -280,7 +263,6 @@ const saveNote = () => {
persistent: true,
})
.onOk(async () => {
// console.log("");
await http
.post(config.API.createnote(), {
retireProfileId: retireProfileId.value,
@ -293,7 +275,8 @@ const saveNote = () => {
messageError($q, e);
})
.finally(async () => {
await fecthlist(retireld_params);
retireld.value = retireld_params.toString();
fecthlistprofile(retireld.value);
modalNote.value = false;
});
})
@ -303,7 +286,7 @@ const saveNote = () => {
const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId;
fecthlist(retireld);
fecthlistprofile(retireld);
console.log("profileId", profileId.value);
};
const backHistory = () => {
@ -341,11 +324,11 @@ const visibleNote = computed(() => {
// .onCancel(() => {})
// .onDismiss(() => {});
// };
// const classrow = (prop: any) => {
// if (profileId.value!=='' && prop.profileId === profileId.value) {
// return "color: #26a69a;";
// } else return "";
// };
const classrow = (prop: any) => {
if (profileId.value !== "" && prop.profileId === profileId.value) {
return "color: #26a69a;";
} else return "";
};
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",
@ -377,10 +360,16 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-card class="col-12 q-pa-md">
<div class="row col-12 q-pb-sm">
<AddList
:dataProfile="dataProfile"
:retireld="retireld"
:profile-id="profileId"
:UpdateListId="UpdateListId"
v-if="
statusReport === false &&
(typeReport == 'ADD' || typeReport == '' || typeReport == null)
"
/>
<!-- <q-btn flat round style="color: #016987;" icon="save" @click="saveList">
<q-tooltip>นทกขอม</q-tooltip>
</q-btn> -->
@ -472,7 +461,24 @@ const paginationLabel = (start: number, end: number, total: number) => {
</div>
</q-th>
<q-th auto-width />
<q-th auto-width />
<q-th
auto-width
v-if="
(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
"
/>
<q-th
auto-width
v-if="
(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
"
/>
</q-tr>
</template>
<template v-slot:body="props">
@ -480,13 +486,19 @@ const paginationLabel = (start: number, end: number, total: number) => {
:props="props"
class="cursor-pointer"
:style="props.row.profileId === profileId && 'color: #26a69a;'"
@click.stop="router.push(`/registry/${props.row.profileId}`)"
>
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
<!-- <q-td key="fixname" :props="props">{{ props.row.fixname }}</q-td> -->
<q-td key="name" :props="props">{{ props.row.fixname + props.row.name }}</q-td>
<q-td class="table_ellipsis" key="organizationOrganization" :props="props">{{
props.row.organizationOrganization
<q-td key="name" :props="props">{{
props.row.fixname + props.row.name
}}</q-td>
<q-td
class="table_ellipsis"
key="organizationOrganization"
:props="props"
>{{ props.row.organizationOrganization }}</q-td
>
<q-td key="positionType" :props="props">{{
props.row.positionType
}}</q-td>
@ -505,7 +517,9 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-td key="govOffice" :props="props">{{
props.row.govOffice
}}</q-td>
<q-td class="table_ellipsis" key="bureau" :props="props">{{ props.row.bureau }}</q-td>
<q-td class="table_ellipsis" key="bureau" :props="props">{{
props.row.bureau
}}</q-td>
<q-td>
<!-- <q-btn
:props="props"
@ -521,25 +535,64 @@ const paginationLabel = (start: number, end: number, total: number) => {
>
<q-tooltip>โน</q-tooltip></q-btn
> -->
<q-btn
<!-- <q-btn
flat
round
color="blue"
dense
icon="mdi-file-account"
@click="router.push(`/registry/${props.row.profileId}`)"
@click.stop="router.push(`/registry/${props.row.profileId}`)"
>
<q-tooltip>อมลทะเบยนประว</q-tooltip>
</q-btn> -->
</q-td>
<q-td
auto-width
v-if="
(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
"
>
<q-btn
flat
round
color="primary"
icon="mdi-pencil"
dense
@click.stop="
(modalNote = true),
(note = props.row.reason),
(action = 'edit'),
(retireProfileId = props.row.id)
"
>
<q-tooltip>กรอกเหตผล</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-td
auto-width
v-if="
(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false
"
>
<q-btn
flat
round
class="text-red-14"
icon="mdi-delete"
dense
@click="clickDelete(props.row)"
@click.stop="
(modalNote = true),
(action = 'delete'),
(note = props.row.reason),
(retireProfileId = props.row.id)
"
><q-tooltip>ลบขอม</q-tooltip></q-btn
>
</q-td>
@ -593,6 +646,14 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-card-actions align="right">
<q-btn
v-if="action === 'delete'"
label="บันทึก"
color="secondary"
:disable="visibleNote"
@click="clickDelete"
/>
<q-btn
v-else
label="บักทึก"
color="secondary"
@click="saveNote"
@ -623,13 +684,16 @@ const paginationLabel = (start: number, end: number, total: number) => {
position: sticky;
z-index: 1;
}
.q-table thead tr:last-child th {
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
.q-btn-dropdown__arrow {
display: none;
}