Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop

This commit is contained in:
Warunee Tamkoo 2024-10-28 12:17:02 +07:00
commit bbb83f0da4
9 changed files with 40 additions and 46 deletions

3
.env
View file

@ -6,4 +6,5 @@ VITE_S3CLUSTER_PUBLIC_URL: "https://s3cluster.frappet.com/bma-ehr-fpt/organizati
VITE_URL_KEYCLOAK: "https://id.frappet.synology.me" VITE_URL_KEYCLOAK: "https://id.frappet.synology.me"
VITE_REALM_KEYCLOAK: "bma-ehr" VITE_REALM_KEYCLOAK: "bma-ehr"
VITE_CLIENTID_KEYCLOAK: "gettoken" VITE_CLIENTID_KEYCLOAK: "gettoken"
VITE_CLIENTSECRET_KEYCLOAK: "qsFwDb5anVoXKKwoeivrByIn9VYWQNRn" VITE_CLIENTSECRET_KEYCLOAK: "qsFwDb5anVoXKKwoeivrByIn9VYWQNRn"
VITE_URL_SSO: "https://bma-sso.frappet.synology.me"

View file

@ -8,4 +8,5 @@ VITE_URL_KEYCLOAK: VITE_URL_KEYCLOAK
VITE_REALM_KEYCLOAK: VITE_REALM_KEYCLOAK VITE_REALM_KEYCLOAK: VITE_REALM_KEYCLOAK
VITE_CLIENTID_KEYCLOAK: VITE_CLIENTID_KEYCLOAK VITE_CLIENTID_KEYCLOAK: VITE_CLIENTID_KEYCLOAK
VITE_CLIENTSECRET_KEYCLOAK: VITE_CLIENTSECRET_KEYCLOAK VITE_CLIENTSECRET_KEYCLOAK: VITE_CLIENTSECRET_KEYCLOAK
VITE_MANUAL_URL: VITE_MANUAL_URL VITE_MANUAL_URL: VITE_MANUAL_URL
VITE_URL_SSO: VITE_URL_SSO

View file

@ -19,6 +19,7 @@ do
sed -i 's|VITE_CLIENTID_KEYCLOAK|'${VITE_CLIENTID_KEYCLOAK}'|g' $file sed -i 's|VITE_CLIENTID_KEYCLOAK|'${VITE_CLIENTID_KEYCLOAK}'|g' $file
sed -i 's|VITE_CLIENTSECRET_KEYCLOAK|'${VITE_CLIENTSECRET_KEYCLOAK}'|g' $file sed -i 's|VITE_CLIENTSECRET_KEYCLOAK|'${VITE_CLIENTSECRET_KEYCLOAK}'|g' $file
sed -i 's|VITE_MANUAL_URL|'${VITE_MANUAL_URL}'|g' $file sed -i 's|VITE_MANUAL_URL|'${VITE_MANUAL_URL}'|g' $file
sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file
done done

View file

@ -8,8 +8,8 @@ import { useCommandDetail } from "@/modules/18_command/store/DetailStore";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import LiveView from "@/modules/18_command/components/Step/View0_Live.vue"; import LiveView from "@/modules/18_command/components/Step/View0_Live.vue"; //
import DigitalView from "@/modules/18_command/components/Step/View0_Digital.vue"; import DigitalView from "@/modules/18_command/components/Step/View0_Digital.vue"; //Digital Signature
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
@ -19,7 +19,7 @@ const { showLoader, hideLoader, messageError, dialogConfirm } =
useCounterMixin(); useCounterMixin();
const commandId = ref<string>(route.params.id.toString()); //ID const commandId = ref<string>(route.params.id.toString()); //ID
const step = ref<number>(1); const step = ref<number>(1); //
const isStatus = ref<string>(""); // const isStatus = ref<string>(""); //
const signaturetype = ref<string>(""); // const signaturetype = ref<string>(""); //
const isSignature = ref<boolean | null>(null); const isSignature = ref<boolean | null>(null);
@ -28,6 +28,7 @@ const isDraft = ref<boolean>(false); //ทำแบบร่าง
const isSign = ref<boolean>(false); // const isSign = ref<boolean>(false); //
const isAttachment = ref<boolean>(false); // const isAttachment = ref<boolean>(false); //
/** ฟังก์ชันเรียกข้อมูลสถานะคำสั่ง*/
async function fetchData() { async function fetchData() {
showLoader(); showLoader();
await http await http
@ -55,6 +56,7 @@ async function fetchData() {
}); });
} }
/** ฟังก์ชันยืนยันวิธีลงนาม*/
function onConfirmSignature() { function onConfirmSignature() {
dialogConfirm( dialogConfirm(
$q, $q,

View file

@ -36,21 +36,21 @@ const props = defineProps({
const commandId = ref<string>(route.params.id.toString()); //ID const commandId = ref<string>(route.params.id.toString()); //ID
// //
let formData = reactive({ let formData = reactive<FormDataDetail>({
commandNo: "", issue: null, //
commandYear: null, commandNo: "", //
detailHeader: "", commandYear: null, //..
detailBody: "", detailHeader: "", //
detailFooter: "", detailBody: "", //
issue: null, detailFooter: "", //
commandAffectDate: null, // commandAffectDate: null, //
commandExcecuteDate: null, // commandExcecuteDate: null, //
isBangkok: null, isBangkok: null, //
// isAttachment: true,
}); });
const modalPreview = ref<boolean>(false); // const modalPreview = ref<boolean>(false); //
const isIdofficer = ref<boolean>(false); // . const isIdofficer = ref<boolean>(false); // .
/** ฟังก์ชันเช็ค สกจ.*/
async function fetchCheckIdofficer() { async function fetchCheckIdofficer() {
await http await http
.get(config.API.checkIdofficer) .get(config.API.checkIdofficer)
@ -90,7 +90,6 @@ async function onSubmit() {
*/ */
onMounted(async () => { onMounted(async () => {
await fetchCheckIdofficer(); await fetchCheckIdofficer();
formData.commandNo = props.formCommandList.commandNo; formData.commandNo = props.formCommandList.commandNo;
formData.commandYear = props.formCommandList.commandYear; formData.commandYear = props.formCommandList.commandYear;
formData.detailHeader = props.formCommandList.detailHeader; formData.detailHeader = props.formCommandList.detailHeader;
@ -109,8 +108,6 @@ onMounted(async () => {
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<q-card-section> <q-card-section>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<!-- คำสงเลขท -->
<!-- คำสงเรอง -->
<div class="col-12"> <div class="col-12">
<q-input <q-input
:class="store.classInput(!store.readonly)" :class="store.classInput(!store.readonly)"

View file

@ -25,7 +25,6 @@ const commandId = ref<string>(route.params.id.toString()); //ID คำสั่
const storePosSalary = usePosSalaryDataStore(); const storePosSalary = usePosSalaryDataStore();
const store = useCommandDetail(); const store = useCommandDetail();
const { const {
dialogMessageNotify,
dialogConfirm, dialogConfirm,
dialogRemove, dialogRemove,
messageError, messageError,
@ -34,7 +33,7 @@ const {
success, success,
} = useCounterMixin(); } = useCounterMixin();
const isChangeData = defineModel<boolean>("isChangeData", { required: true }); // // const isChangeData = defineModel<boolean>("isChangeData", { required: true }); //
const props = defineProps({ const props = defineProps({
onCheckChangeData: { type: Function, required: true }, onCheckChangeData: { type: Function, required: true },
fetchDataCommandList: { type: Function, required: true }, fetchDataCommandList: { type: Function, required: true },
@ -219,7 +218,6 @@ function savePosition() {
} }
async function getCommandSalaryList(type: string) { async function getCommandSalaryList(type: string) {
showLoader();
await http await http
.get(config.API.commandSalaryList(type)) .get(config.API.commandSalaryList(type))
.then(async (res) => { .then(async (res) => {
@ -228,15 +226,11 @@ async function getCommandSalaryList(type: string) {
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
})
.finally(() => {
hideLoader();
}); });
} }
/** ดึงข้อมูล บุคคล */ /** ดึงข้อมูล บุคคล */
async function getPersonList() { async function getPersonList() {
showLoader();
await http await http
.get(config.API.commandAction(commandId.value, "tab2")) .get(config.API.commandAction(commandId.value, "tab2"))
.then(async (res) => { .then(async (res) => {
@ -247,17 +241,19 @@ async function getPersonList() {
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
})
.finally(() => {
hideLoader();
}); });
} }
onMounted(async () => { onMounted(async () => {
await getPersonList(); const promises = [getPersonList()];
if (props.commandSysId) { if (props.commandSysId) {
await getCommandSalaryList(props.commandSysId); promises.push(getCommandSalaryList(props.commandSysId));
} }
showLoader();
await Promise.all(promises).finally(() => {
hideLoader();
});
}); });
</script> </script>

View file

@ -119,7 +119,6 @@ async function fetchData() {
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
rows.value = data; rows.value = data;
isChangeData.value = false; isChangeData.value = false;
}) })
.catch((err) => { .catch((err) => {

View file

@ -12,20 +12,15 @@ interface FormCommand {
} }
interface FormDataDetail { interface FormDataDetail {
id?: string; issue: string | null; //คำสั่งเรื่อง
status?: string; commandNo: string; //คำสั่งเลขที่
commandNo: string; commandYear: number | null; //พ.ศ.
commandYear: number | null; detailHeader: string; //เนื้อหาคำสั่งขึ้นต้น
detailHeader: string; detailBody: string; //เนื้อหาคำสั่งหลัก
detailBody: string; detailFooter: string; //เนื้อหาคำสั่งลงท้าย
detailFooter: string; commandAffectDate: Date | null; //วันที่ลงนาม
issue: string | null; commandExcecuteDate: Date | null; //วันที่คำสั่งมีผล
commandAffectDate: Date | null; isBangkok: string | null; //คำสั่งสำนักปลัดกรุงเทพมหานคร
commandExcecuteDate: Date | null;
commandSysId?: string;
commandTypeName?: string;
isBangkok?: string | null;
isAttachment: boolean;
} }
interface ListCommandSalaryType { interface ListCommandSalaryType {

View file

@ -1,5 +1,7 @@
const ACCESS_TOKEN = "BMAHRIS_KEYCLOAK_IDENTITY"; const ACCESS_TOKEN = "BMAHRIS_KEYCLOAK_IDENTITY";
const key_C_Config = {
url_Logout: import.meta.env.VITE_URL_SSO,
};
interface AuthResponse { interface AuthResponse {
access_token: string; access_token: string;
expires_in: number; expires_in: number;
@ -15,7 +17,7 @@ async function setAuthen(r: AuthResponse) {
async function logout() { async function logout() {
await deleteCookie(ACCESS_TOKEN); await deleteCookie(ACCESS_TOKEN);
window.location.href = "/login"; window.location.href = key_C_Config.url_Logout;
} }
async function getToken() { async function getToken() {