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

This commit is contained in:
AnandaTon 2023-08-30 10:32:34 +07:00
commit 72529c5d6c
4 changed files with 95 additions and 147 deletions

View file

@ -661,6 +661,7 @@ function findByPerson(element: any): any {
dense
hide-bottom-space
lazy-rules
emit-value
:options="positionPathSideOptions"
v-model="dataForm.positionPathSideId"
:label="`${'ด้าน/สาขา'}`"

View file

@ -257,7 +257,6 @@ const columns2 = ref<QTableProps["columns"]>([
const openModalTree = (id: string) => {
personalId.value = id;
console.log(personalId.value);
personal.value = listRecevice.value.filter((e: any) => e.id === id);
modalTree.value = true;
};

View file

@ -4,25 +4,74 @@ import { ref, computed, watch, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const val1 = ref([
{
id: 1,
text: "1.รัฐธรรมนูญ",
checked: false,
},
]);
const status = ref<boolean>(true);
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const {
date2Thai,
dateToISO,
success,
messageError,
showLoader,
hideLoader,
dialogConfirm,
dialogMessageNotify,
} = mixin;
const personalId = route.params.personalId as string;
const assignId = ref<string>(route.params.form as string);
const routeName = router.currentRoute.value.name;
const myForm = ref<any>(null);
const fullname = ref<string>();
const date_start = ref<Date>();
const date_finish = ref<any>();
const other_desc = ref<object>({});
const other4_desc = ref<string>();
const Other5 = ref<string>();
const other5_no1_desc = ref<object>({});
const group = ref<any | null>(null);
const group2 = ref<any | null>(null);
const group3 = ref<any | null>(null);
const main = ref<any>();
const main2 = ref<any>();
const main3 = ref<any>();
const main4 = ref<any>();
const main5 = ref<any>();
const Other = ref<string>("");
const commander = ref<any>("");
const chairman = ref<any>("");
const date1 = ref<any>();
const date2 = ref<any>();
const date3 = ref<any>();
const date4 = ref<any>();
const OPmain = ref<
Array<{
id: number;
title: string;
description: string;
level: number;
}>
>([]);
const OPgroup = ref<
Array<{
id: number;
title: string;
description: string;
level: number;
}>
>([]);
const dataEdit = async (id: string) => {
showLoader();
const data = putDataEdit(id);
await http
.put(config.API.saveEditAssign(id), data)
.then((res) => {})
.catch((e) => {})
.then(() => {})
.catch(() => {})
.finally(async () => {
status.value = false;
getAssign();
@ -38,20 +87,7 @@ const edit = () => {
const cancel = () => {
status.value = false;
};
const router = useRouter();
const mixin = useCounterMixin();
const {
date2Thai,
notifyError,
dateToISO,
success,
messageError,
showLoader,
hideLoader,
dialogConfirm,
dialogMessageNotify,
modalWarning,
} = mixin;
const filterData = (options: any[], excludedGroups: any[]) => {
return options.filter(
(item) => !excludedGroups.some((group) => group && group.id === item.id)
@ -67,64 +103,7 @@ const filterMain = (options: any[], excludedGroups: any[]) => {
(item) => !excludedGroups.some((group) => group && group.id === item.id)
);
};
const route = useRoute();
const checkValidate = ref<boolean>(false);
const myForm = ref<any>(null);
const fullnameFoot = ref<string>("");
const positionFoot = ref<string>("");
const caretakerFoot = ref<string>("");
const caretakerFoot2 = ref<string>("");
const id = ref<number>();
const personalId = route.params.personalId as string;
const fullname = ref<string>();
const knowledge_skill_map_no = ref<string[]>([]);
const round_no = ref<number>();
const date_start = ref<Date>();
const date_finish = ref<any>();
const behavior_desc = ref<string>();
const other_desc = ref<object>({});
const other4_desc = ref<string>();
const Other5 = ref<string>();
const other5_no1_desc = ref<object>({});
const other5_no2_desc = ref<object>({});
const experimenter_dated = ref<Date>();
const createdAt = ref<Date>();
const updatedAt = ref<Date>();
const group = ref<any | null>(null);
const group2 = ref<any | null>(null);
const group3 = ref<any | null>(null);
const main = ref<any>();
const main2 = ref<any>();
const main3 = ref<any>();
const main4 = ref<any>();
const main5 = ref<any>();
const assignId = ref<string>(route.params.form as string);
const Other = ref<string>("");
const commander = ref<any>("");
const chairman = ref<any>("");
const date1 = ref<any>();
const date2 = ref<any>();
const date3 = ref<any>();
const date4 = ref<any>();
const OPmain = ref<
Array<{
id: number;
title: string;
description: string;
level: number;
}>
>([]);
const OPgroup = ref<
Array<{
id: number;
title: string;
description: string;
level: number;
}>
>([]);
const clearDateExam = () => {
date_start.value = undefined;
};
@ -134,8 +113,7 @@ const clearDateExam2 = () => {
const isDatePicker2Readonly = computed(() => {
return date_start.value === undefined;
});
const routeName = router.currentRoute.value.name;
const name = ref<string>("");
const position = ref<string>("");
const monthSelect = ref<any>();
@ -226,9 +204,6 @@ const addKnowledge = () => {
const knowledgeArray = computed(() => {
return Array(knowledgeCount.value).fill("");
});
const getOpknowledge = (index: number) => {
return OPknowledge;
};
const deleteknowledge = (item: number) => {
knowledge.value.splice(item, 1);
@ -236,7 +211,6 @@ const deleteknowledge = (item: number) => {
knowledgeCount.value--;
}
};
const checked = ref<boolean>(false);
const productivityCount = ref<number>(1);
const output_desc = ref<string[]>(Array(productivityCount.value).fill(""));
const indicator_desc = ref<string[]>(Array(productivityCount.value).fill(""));
@ -350,7 +324,6 @@ const getLaw = async (id: string) => {
checkRule.value = res.data.data;
});
};
const postDateTime = async () => {
await http
.post(config.API.calculateDate(), {
@ -621,10 +594,13 @@ const DataSave = async (id: string) => {
const data = putData(id);
http
.post(config.API.saveFinish(id), data)
.then((res) => {
.then(() => {
router.push(`/probation/detail/${id}`);
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.catch((e) => {})
.finally(() => {
hideLoader();
});
@ -634,7 +610,6 @@ const DataSave = async (id: string) => {
});
};
const OtherLaw = ref<string>("");
const skill = ref<any>();
const skill2 = ref<any>();
const skill3 = ref<any>();
@ -671,8 +646,6 @@ const OPresourse = ref<
level_description: string;
}>
>([]);
const skillIds = [1, 2, 3, 4];
const getAssign = async () => {
await http.get(config.API.probationsGetAssign(assignId.value)).then((res) => {
status.value = false;
@ -766,7 +739,9 @@ onMounted(async () => {
await getSkill(personalId);
await getKnowledge(personalId);
await getAssignNew(personalId);
await getAssign();
if (assignId.value !== undefined) {
await getAssign();
}
});
watch(
() => [monthSelect.value, date_start.value],

View file

@ -14,7 +14,7 @@ import { useQuasar } from "quasar";
const $q = useQuasar(); // noti quasar
const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader } = mixin;
const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin;
const modal = ref<boolean>(false);
const pagination = ref({
@ -164,43 +164,7 @@ const columns2 = ref<QTableProps["columns"]>([
]);
// ()
const rows2 = ref<FormMainProbation2[]>([
// {
// no: "1",
// name: " ",
// position: "",
// level: "",
// institution: " ",
// },
// {
// no: "2",
// name: " ",
// position: "",
// level: "",
// institution: " ",
// },
// {
// no: "3",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
// {
// no: "4",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
// {
// no: "5",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
]);
const rows2 = ref<FormMainProbation2[]>([]);
onMounted(async () => {
getpersonalList();
@ -291,24 +255,18 @@ const clickDelete = (id: string) => {
};
const clickAdd = (id: string) => {
$q.dialog({
title: "ยืนยันการเพิ่มข้อมูล",
message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
dialogConfirm(
$q,
async () => {
showLoader();
const postData = {
personal_id: id,
};
await http
.post(config.API.personalAdd(), postData)
.then((res) => {
.then(() => {
getpersonalList();
success($q, "เพิ่มข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
@ -317,9 +275,24 @@ const clickAdd = (id: string) => {
clickClose();
hideLoader();
});
})
.onCancel(() => {})
.onDismiss(() => {});
},
"ยันยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้หรือไม่ ?"
);
// $q.dialog({
// title: "",
// message: "?",
// cancel: {
// flat: true,
// color: "negative",
// },
// persistent: true,
// })
// .onOk(async () => {
// })
// .onCancel(() => {})
// .onDismiss(() => {});
};
const clickClose = async () => {