Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
# Conflicts: # src/api/06_retirement/api.retirement.ts
This commit is contained in:
commit
ecbd8f5518
8 changed files with 1151 additions and 212 deletions
|
|
@ -1,8 +1,4 @@
|
|||
/**
|
||||
* api พ้นจากราชการ
|
||||
*/
|
||||
import env from "../index";
|
||||
|
||||
const retirement = `${env.API_URI}/retirement`
|
||||
|
||||
|
||||
|
|
@ -12,6 +8,7 @@ export default {
|
|||
getprofileRetire: (retireId: string) => `${retirement}/${retireId}`,
|
||||
createnote: () => `${retirement}/reason/`,
|
||||
reasonId: (retireId:string) => `${retirement}/reason/${retireId}`,
|
||||
retirement:(type:string) => `${retirement}/${type}/2023`
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const config = ref<any>({
|
|||
API_URI_ORG_TREE:
|
||||
"https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json",
|
||||
MEET_URI: "meet.frappet.com",
|
||||
API_RETIREMENT_URI: "https://bma-ehr.frappet.synology.me/api/v1",
|
||||
},
|
||||
test: {
|
||||
API_URI: "http://localhost:5010/api/v1",
|
||||
|
|
@ -65,6 +66,9 @@ const API_URI_PROFILE_SERVICE = ref<string>(
|
|||
const API_PLACEMENT_URI = ref<string>(
|
||||
config.value[env.value].API_PLACEMENT_URI
|
||||
);
|
||||
const API_RETIREMENT_URI = ref<string>(
|
||||
config.value[env.value].API_RETIREMENT_URI
|
||||
);
|
||||
const API_URI_ORG_TREE = ref<string>(config.value[env.value].API_URI_ORG_TREE);
|
||||
|
||||
export default {
|
||||
|
|
@ -79,4 +83,5 @@ export default {
|
|||
API_PLACEMENT_URI: API_PLACEMENT_URI.value,
|
||||
API_URI_ORG_TREE: API_URI_ORG_TREE.value,
|
||||
MEET_URI: MEET_URI.value,
|
||||
API_RETIREMENT_URI:API_RETIREMENT_URI.value,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -180,4 +180,5 @@ export default {
|
|||
`${profile}changeName/history/${profileId}`,
|
||||
|
||||
profileCitizenId: (citizenId: string) => `${profile}citizenId/${citizenId}`,
|
||||
profileEmployeeIn: `${profile}information/employee`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1,8 @@
|
|||
export type {};
|
||||
interface resMain{
|
||||
id:string;
|
||||
createdAt:Date;
|
||||
year:string;
|
||||
round:number;
|
||||
total:number;
|
||||
}
|
||||
export type {resMain};
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
indicator-color="primary"
|
||||
align="left"
|
||||
>
|
||||
<q-tab name="samun" label="ขรก.กทม.สามัญ" />
|
||||
<q-tab name="employee" label="ลูกจ้างประจำ" />
|
||||
<q-tab name="samun" label="ขรก.กทม.สามัญ" @click="get('officer')"/>
|
||||
<q-tab name="employee" label="ลูกจ้างประจำ" @click="get('employee')"/>
|
||||
</q-tabs>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import { onMounted, ref, useAttrs } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
FormMainProbation,
|
||||
|
|
@ -183,7 +183,13 @@ import type {
|
|||
} from "@/modules/05_placement/interface/request/Main";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin"
|
||||
import type { resMain } from '@/modules/06_retirement/interface/response/Main'
|
||||
|
||||
const mixin = useCounterMixin()
|
||||
const { messageError ,date2Thai,showLoader,hideLoader} = mixin
|
||||
const router = useRouter();
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -228,31 +234,35 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<any>([
|
||||
{
|
||||
no: "1",
|
||||
Date: "2022-9-31 ",
|
||||
retireNumber: "5",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
Date: "2022-9-15 ",
|
||||
retireNumber: "7",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
Date: "2022-8-31 ",
|
||||
retireNumber: "15",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
Date: "2022-9-25 ",
|
||||
retireNumber: "20",
|
||||
},
|
||||
]);
|
||||
const rows = ref<resMain[]>([]);
|
||||
const tab = ref<any>("samun");
|
||||
const visibleColumns2 = ref<string[]>(["no", "name", "retireNumber"]);
|
||||
const get = async(type:string) =>{
|
||||
|
||||
await http
|
||||
.get(config.API.retirement(type))
|
||||
.then((res)=>{
|
||||
let data = res.data.result
|
||||
console.log(data)
|
||||
rows.value = data.map((items:resMain) =>({
|
||||
id:items.id,
|
||||
Date:date2Thai(items.createdAt),
|
||||
year:items.year,
|
||||
retireNumber:items.round,
|
||||
total:items.total
|
||||
}))
|
||||
|
||||
}).catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
});
|
||||
|
||||
}
|
||||
onMounted(()=>{
|
||||
get
|
||||
})
|
||||
// หัวตาราง2
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,74 +12,6 @@
|
|||
:statusAdd="true"
|
||||
/>
|
||||
</div>
|
||||
<div id="government" name="16" class="row col-12">
|
||||
<!-- <Government v-model:statusEdit="statusEdit" :statusAdd="true" /> -->
|
||||
</div>
|
||||
<div id="address" name="17" class="row col-12">
|
||||
<Address v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="family" name="18" class="row col-12">
|
||||
<Family v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="certicate" name="15" class="row col-12">
|
||||
<Certicate
|
||||
v-model:statusEdit="statusEdit"
|
||||
:statusAdd="true"
|
||||
profileType="employee"
|
||||
/>
|
||||
</div>
|
||||
<div id="education" name="2" class="row col-12 q-mt-md">
|
||||
<EducationVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="training" name="3" class="row col-12 q-mt-md">
|
||||
<TrainVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="insignia" name="4" class="row col-12 q-mt-md">
|
||||
<InsigniaVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="coined" name="5" class="row col-12 q-mt-md">
|
||||
<CoinedVue
|
||||
v-model:statusEdit="statusEdit"
|
||||
:statusAdd="true"
|
||||
profileType="employee"
|
||||
/>
|
||||
</div>
|
||||
<div id="assessment" name="6" class="row col-12 q-mt-md">
|
||||
<AssessmentVue
|
||||
v-model:statusEdit="statusEdit"
|
||||
:statusAdd="true"
|
||||
profileType="employee"
|
||||
/>
|
||||
</div>
|
||||
<div id="position" name="7" class="row col-12 q-mt-md">
|
||||
<!-- <SalaryVue
|
||||
v-model:statusEdit="statusEdit" :statusAdd="true"
|
||||
v-if="profileType === 'officer'"
|
||||
/> -->
|
||||
|
||||
<SalaryEmployeeVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="rule" name="8" class="row col-12 q-mt-md">
|
||||
<DisciplineVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="leave" name="9" class="row col-12 q-mt-md">
|
||||
<LeaveVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="talent" name="10" class="row col-12 q-mt-md">
|
||||
<TalentVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="work" name="11" class="row col-12 q-mt-md">
|
||||
<WorkVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="record" name="12" class="row col-12 q-mt-md">
|
||||
<RecordVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="other" name="13" class="row col-12 q-mt-md">
|
||||
<OtherVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
<div id="document" name="14" class="row col-12 q-my-md">
|
||||
<DocumentVue v-model:statusEdit="statusEdit" :statusAdd="true" />
|
||||
</div>
|
||||
</div>
|
||||
<q-page-sticky
|
||||
position="top"
|
||||
|
|
@ -152,9 +84,7 @@
|
|||
<div class="text-bold q-pb-xs text-name">
|
||||
เพิ่มข้อมูลทะเบียนประวัติ
|
||||
</div>
|
||||
<div class="text-bold q-pb-xs text-sub">
|
||||
ลูกจ้างชั่วคราว
|
||||
</div>
|
||||
<div class="text-bold q-pb-xs text-sub">ลูกจ้างชั่วคราว</div>
|
||||
</div>
|
||||
</div>
|
||||
<q-space />
|
||||
|
|
@ -512,26 +442,7 @@ import { useDataStore } from "@/stores/data";
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import EducationVue from "@/modules/04_registry/components/Education.vue";
|
||||
import TrainVue from "@/modules/04_registry/components/Train.vue";
|
||||
import InsigniaVue from "@/modules/04_registry/components/Insignia.vue";
|
||||
import CoinedVue from "@/modules/04_registry/components/Coin.vue";
|
||||
import AssessmentVue from "@/modules/04_registry/components/Assessment.vue";
|
||||
import SalaryVue from "@/modules/04_registry/components/Salary.vue";
|
||||
import SalaryEmployeeVue from "@/modules/04_registry/components/SalaryEmployee.vue";
|
||||
import DisciplineVue from "@/modules/04_registry/components/Discipline.vue";
|
||||
import LeaveVue from "@/modules/04_registry/components/Leave.vue";
|
||||
import TalentVue from "@/modules/04_registry/components/Talent.vue";
|
||||
import WorkVue from "@/modules/04_registry/components/Work.vue";
|
||||
import RecordVue from "@/modules/04_registry/components/Record.vue";
|
||||
import OtherVue from "@/modules/04_registry/components/Other.vue";
|
||||
import DocumentVue from "@/modules/04_registry/components/Document.vue";
|
||||
import Certicate from "@/modules/04_registry/components/Information/Certicate.vue";
|
||||
import Information from "@/modules/04_registry/components/Information/Information.vue";
|
||||
import Government from "@/modules/04_registry/components/Information/Government.vue";
|
||||
import Address from "@/modules/04_registry/components/Information/Address.vue";
|
||||
import Family from "@/modules/04_registry/components/Information/Family.vue";
|
||||
import OldName from "@/modules/04_registry/components/Information/OldName.vue";
|
||||
import Information from "@/modules/08_registryEmployee/views/information.vue";
|
||||
import type { DataOption } from "@/modules/04_registry/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -547,12 +458,6 @@ const imageUrl = ref<any>(null);
|
|||
const inputImage = ref<any>(null);
|
||||
const fullname = ref<string>("");
|
||||
const position = ref<string>("นักจัดการงานทั่วไป");
|
||||
const pdfSrc = ref<string>("");
|
||||
const pdfCurrentPage = ref<number>();
|
||||
const pdfTotalPage = ref<number>();
|
||||
const pdfSrcShort = ref<string>("");
|
||||
const pdfCurrentPageShort = ref<number>();
|
||||
const pdfTotalPageShort = ref<number>();
|
||||
const dialog = ref<boolean>(false);
|
||||
const dialogShort = ref<boolean>(false);
|
||||
const dialogLeave = ref<boolean>(false);
|
||||
|
|
@ -851,19 +756,6 @@ const clickKp7 = async () => {
|
|||
// });
|
||||
};
|
||||
|
||||
const downloadFilePDF = async (res: string, fileName: string) => {
|
||||
const link = document.createElement("a");
|
||||
// link.href = window.URL.createObjectURL(new Blob([res]));
|
||||
link.href = window.URL.createObjectURL(
|
||||
new Blob([res], {
|
||||
type: "application/vnd.ms-excel",
|
||||
})
|
||||
);
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
};
|
||||
|
||||
const clickKp7Short = async () => {
|
||||
if (profileId.value !== "") {
|
||||
window.open(config.API.profileKp7ShortId(profileId.value));
|
||||
|
|
@ -884,71 +776,6 @@ const clickKp7Short = async () => {
|
|||
// loaderPage(false);
|
||||
// });
|
||||
};
|
||||
|
||||
const clickRetire = async () => {
|
||||
if (reasonStatus.value == true) {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"โปรดยืนยัน",
|
||||
"ต้องการย้ายข้อมูลจากพ้นราชการไปถือครองใช่หรือไม่",
|
||||
"info",
|
||||
undefined,
|
||||
"primary",
|
||||
Retire,
|
||||
undefined,
|
||||
false
|
||||
);
|
||||
} else {
|
||||
leaveDate.value = new Date();
|
||||
leaveDetail.value = "";
|
||||
leaveNumberOrder.value = "";
|
||||
leaveDateOrder.value = new Date();
|
||||
reason.value = "";
|
||||
dialogLeave.value = true;
|
||||
}
|
||||
};
|
||||
|
||||
const Retire = async () => {
|
||||
if (profileId.value !== "") {
|
||||
if (reasonStatus.value == true) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.profileReactive(profileId.value))
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
dialogLeave.value = false;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
router.push("/registry");
|
||||
});
|
||||
} else {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.profileDeactive(profileId.value), {
|
||||
leaveDate: dateToISO(leaveDate.value),
|
||||
leaveDetail: leaveDetail.value,
|
||||
leaveNumberOrder: leaveNumberOrder.value,
|
||||
leaveDateOrder: dateToISO(leaveDateOrder.value),
|
||||
reason: reason.value,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
dialogLeave.value = false;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
router.push("/registry");
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.image-size-default {
|
||||
|
|
|
|||
1096
src/modules/08_registryEmployee/views/information.vue
Normal file
1096
src/modules/08_registryEmployee/views/information.vue
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -68,7 +68,7 @@ const options = ref<optionType[]>([
|
|||
* ให้แสดง แทปด้านขวา เมื่อเข้าหน้า รายละเอียดทะเบียนประวัติ
|
||||
*/
|
||||
const tabScroll = () => {
|
||||
return route.name == "registryDetail" || route.name == "registryEmployeeAdd";
|
||||
return route.name == "registryDetail";
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -157,10 +157,7 @@ const updateScroll = (position: number) => {
|
|||
* ให้แสดง แทปด้านขวา เมื่อเข้าหน้า รายละเอียดทะเบียนประวัติ และ rightActive เท่ากับ true
|
||||
*/
|
||||
const activeBtn = () => {
|
||||
return (
|
||||
(route.name == "registryDetail" || route.name == "registryEmployeeAdd") &&
|
||||
rightActive.value
|
||||
);
|
||||
return route.name == "registryDetail" && rightActive.value;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -225,8 +222,7 @@ const myEventHandler = (e: any, setSCroll: boolean) => {
|
|||
const activeMenu = (path: string) => {
|
||||
if (path == "dashboard" && route.fullPath == "/") return true;
|
||||
|
||||
if (path == "registry" && route.fullPath.includes("registryEmployee"))
|
||||
return false;
|
||||
if (path == "registry" && route.fullPath == "/") return false;
|
||||
const bool = route.fullPath.includes(path);
|
||||
return bool;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue