ลบ log

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-26 14:25:48 +07:00
parent e4188b7ed3
commit 7adf787d49
14 changed files with 52 additions and 110 deletions

View file

@ -161,11 +161,6 @@ const props = defineProps({
type: Boolean, type: Boolean,
defualt: false, defualt: false,
}, },
// optionsHistory: Array,
// updateHistory: {
// type: Function,
// default: () => console.log("not function"),
// },
}); });
const emit = defineEmits([ const emit = defineEmits([

View file

@ -216,7 +216,6 @@ const uploadData = async () => {
const formData = new FormData(); const formData = new FormData();
formData.append("avatar", newFile); formData.append("avatar", newFile);
formData.append("moss", "newFile"); formData.append("moss", "newFile");
console.log(formData);
showLoader(); showLoader();
await http await http
.post(config.API.profilePaperId(profileId.value), formData) .post(config.API.profilePaperId(profileId.value), formData)

View file

@ -332,7 +332,6 @@ const fetchData = async () => {
.get(config.API.profileAvatarId(route.params.id.toString())) .get(config.API.profileAvatarId(route.params.id.toString()))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
fullname.value = data.fullname; fullname.value = data.fullname;
imageUrl.value = data.avatar; imageUrl.value = data.avatar;
position.value = data.position; position.value = data.position;
@ -363,7 +362,6 @@ const fetchAvatarHistory = async () => {
.get(config.API.profileAvatarHistoryId(route.params.id.toString())) .get(config.API.profileAvatarHistoryId(route.params.id.toString()))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
console.log(data);
images.value = []; images.value = [];
data.map((e: any) => { data.map((e: any) => {
images.value.push({ images.value.push({

View file

@ -723,7 +723,6 @@ const fetchData = async () => {
.get(config.API.profileLeaveId(profileId.value)) .get(config.API.profileLeaveId(profileId.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
data.map((e: ResponseObject) => { data.map((e: ResponseObject) => {
rows.value.push({ rows.value.push({
id: e.id, id: e.id,
@ -909,7 +908,6 @@ const clickAddLeave = async () => {
numUsedLeave.value = 0; numUsedLeave.value = 0;
await clickTotal(); await clickTotal();
if (rowsTotal.value.length > 0) { if (rowsTotal.value.length > 0) {
// console.log(rowsTotal.value);
let data: DataOptionLeave[] = []; let data: DataOptionLeave[] = [];
rowsTotal.value.map((e: ResponseTotalObject) => { rowsTotal.value.map((e: ResponseTotalObject) => {
data.push({ data.push({
@ -1131,7 +1129,6 @@ const selectData = async (props: DataProps) => {
numUsedLeave.value = props.row.sumLeave; numUsedLeave.value = props.row.sumLeave;
await clickTotal(); await clickTotal();
if (rowsTotal.value.length > 0) { if (rowsTotal.value.length > 0) {
// console.log(rowsTotal.value);
let data: DataOptionLeave[] = []; let data: DataOptionLeave[] = [];
rowsTotal.value.map((e: ResponseTotalObject) => { rowsTotal.value.map((e: ResponseTotalObject) => {
data.push({ data.push({

View file

@ -1479,7 +1479,6 @@ const fetchData = async () => {
.get(config.API.profileSalaryEmployeeId(profileId.value)) .get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
rows.value = []; rows.value = [];
data.map((e: ResponseObjectEmployee) => { data.map((e: ResponseObjectEmployee) => {
rows.value.push({ rows.value.push({
@ -1600,7 +1599,6 @@ const checkRowPage = () => {
editRow.value = false; editRow.value = false;
next.value = true; next.value = true;
previous.value = true; previous.value = true;
// console.log(rowIndex.value);
if (rowIndex.value + 1 >= rows.value.length) { if (rowIndex.value + 1 >= rows.value.length) {
next.value = false; next.value = false;
} }
@ -1834,7 +1832,6 @@ const clickClose = async () => {
* @param props props ใน row เลอก * @param props props ใน row เลอก
*/ */
const selectData = async (props: DataPropsEmployee) => { const selectData = async (props: DataPropsEmployee) => {
// console.log(props.row);
modalEdit.value = true; modalEdit.value = true;
modal.value = true; modal.value = true;
edit.value = false; edit.value = false;
@ -1945,7 +1942,6 @@ const clickHistory = async (row: RequestItemsEmployee) => {
.get(config.API.profileSalaryHisId(row.id)) .get(config.API.profileSalaryHisId(row.id))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log("clickHistory", data);
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: ResponseObjectEmployee) => { data.map((e: ResponseObjectEmployee) => {
rowsHistory.value.push({ rowsHistory.value.push({

View file

@ -1509,7 +1509,6 @@ const fetchData = async () => {
.get(config.API.profileSalaryEmployeeId(profileId.value)) .get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
rows.value = []; rows.value = [];
data.map((e: ResponseObjectEmployee) => { data.map((e: ResponseObjectEmployee) => {
rows.value.push({ rows.value.push({
@ -1630,7 +1629,6 @@ const checkRowPage = () => {
editRow.value = false; editRow.value = false;
next.value = true; next.value = true;
previous.value = true; previous.value = true;
// console.log(rowIndex.value);
if (rowIndex.value + 1 >= rows.value.length) { if (rowIndex.value + 1 >= rows.value.length) {
next.value = false; next.value = false;
} }
@ -1864,7 +1862,6 @@ const clickClose = async () => {
* @param props props ใน row เลอก * @param props props ใน row เลอก
*/ */
const selectData = async (props: DataPropsEmployee) => { const selectData = async (props: DataPropsEmployee) => {
// console.log(props.row);
modalEdit.value = true; modalEdit.value = true;
modal.value = true; modal.value = true;
edit.value = false; edit.value = false;
@ -1975,7 +1972,6 @@ const clickHistory = async (row: RequestItemsEmployee) => {
.get(config.API.profileSalaryHisId(row.id)) .get(config.API.profileSalaryHisId(row.id))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log("clickHistory", data);
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: ResponseObjectEmployee) => { data.map((e: ResponseObjectEmployee) => {
rowsHistory.value.push({ rowsHistory.value.push({

View file

@ -954,8 +954,6 @@ const fetchPosition = async () => {
.get(config.API.position) .get(config.API.position)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
console.log(data.positionPaths);
let optionpositionpaths: DataOption[] = []; let optionpositionpaths: DataOption[] = [];
data.positionPaths.map((r: any) => { data.positionPaths.map((r: any) => {
optionpositionpaths.push({ optionpositionpaths.push({
@ -1394,7 +1392,6 @@ const clickHistory = async (row: RequestItemsObject) => {
let data = res.data.result; let data = res.data.result;
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: RequestItemsObject, index: number) => { data.map((e: RequestItemsObject, index: number) => {
console.log(index);
if (index != 0) { if (index != 0) {
rowsHistory.value.push({ rowsHistory.value.push({
id: e.id, id: e.id,

View file

@ -385,7 +385,7 @@ const ddNoResultMsg = defineAsyncComponent(
); // Dropdown Filter ); // Dropdown Filter
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const $q = useQuasar(); // show dialog const $q = useQuasar(); // show dialog
const emit = defineEmits(["update:positions", "update:formprops"]); const emit = defineEmits(["update:positions", "update:formprops"]);
const props = defineProps({ const props = defineProps({
@ -405,8 +405,6 @@ watch(myForm, (form: QForm | null, prevForm: QForm | null) => {
if (!props.isAddNew) { if (!props.isAddNew) {
positions.value.push(JSON.parse(JSON.stringify(positionSet.value))); positions.value.push(JSON.parse(JSON.stringify(positionSet.value)));
if (!props.editObj != null && !props.editObj != undefined) { if (!props.editObj != null && !props.editObj != undefined) {
// console.log("position.value", position.value);
// console.log("props.editObj", props.editObj);
positions.value[0].positionMasterId = props.editObj?.positionMasterId; positions.value[0].positionMasterId = props.editObj?.positionMasterId;
positions.value[0].positionUserNote = props.editObj?.positionUserNote; positions.value[0].positionUserNote = props.editObj?.positionUserNote;
positions.value[0].isActive = props.editObj?.isActive; positions.value[0].isActive = props.editObj?.isActive;
@ -442,7 +440,6 @@ const fetchPositionMaster = async () => {
// .get(config.API.getPostionMasterDraft(false)) // .get(config.API.getPostionMasterDraft(false))
.get(config.API.getPostionMaster(false)) .get(config.API.getPostionMaster(false))
.then((res) => { .then((res) => {
// console.log("psMaster:", res.data.result);
res.data.result.map((e: any) => { res.data.result.map((e: any) => {
positionFilter.value.push({ positionFilter.value.push({
id: e.id, id: e.id,
@ -475,7 +472,7 @@ const fetchPositionMaster = async () => {
}); });
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -503,7 +500,6 @@ const filterFn = (val: string, update: any) => {
(v: any) => v.positionPath != null && v.positionPath.indexOf(val) > -1 (v: any) => v.positionPath != null && v.positionPath.indexOf(val) > -1
); );
}); });
// console.log(positions.value);
}; };
/**Add new positionSet item into positions /**Add new positionSet item into positions
@ -511,7 +507,6 @@ const filterFn = (val: string, update: any) => {
*อมลไมครบแสดง Alert เตอนใหเฉยๆ แลวไมใหเพ *อมลไมครบแสดง Alert เตอนใหเฉยๆ แลวไมใหเพ
*/ */
const addPositionItem = () => { const addPositionItem = () => {
// console.log(positions.value);
myForm.value!.validate().then((result) => { myForm.value!.validate().then((result) => {
if (result) { if (result) {
positions.value.push(JSON.parse(JSON.stringify(positionSet.value))); positions.value.push(JSON.parse(JSON.stringify(positionSet.value)));
@ -539,15 +534,15 @@ const deletePositionItem = (val: object) => {
persistent: true, persistent: true,
}) })
.onOk(() => { .onOk(() => {
// console.log(">>>> OK");
positions.value = positions.value.filter((x: object) => x !== val); // positions.value = positions.value.filter((x: object) => x !== val); //
// console.log(positions.value);
}) })
.onCancel(() => { .onCancel(() => {
// console.log(">>>> Cancel");
}) })
.onDismiss(() => { .onDismiss(() => {
// console.log("I am triggered on both OK and Cancel");
}); });
} else { } else {
positions.value = positions.value.filter((x: object) => x !== val); positions.value = positions.value.filter((x: object) => x !== val);
@ -560,11 +555,9 @@ const deletePositionItem = (val: object) => {
* @param items Array of position * @param items Array of position
*/ */
const isEmptyPosition = (items: any[]) => { const isEmptyPosition = (items: any[]) => {
console.log("items", items);
const isEmpty = items.map((f: any) => !f.positionMasterId); const isEmpty = items.map((f: any) => !f.positionMasterId);
// true // true
// data false // data false
console.log("isEmpty", isEmpty[0]);
return isEmpty[0]; return isEmpty[0];
}; };

View file

@ -345,7 +345,7 @@ const props = defineProps({
const emit = defineEmits(["update:organizprops", "update:formprops"]); const emit = defineEmits(["update:organizprops", "update:formprops"]);
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const $q = useQuasar(); // show dialog const $q = useQuasar(); // show dialog
const myForm = ref<QForm | null>(null); const myForm = ref<QForm | null>(null);
@ -415,7 +415,7 @@ const fetchOrganizationOri = async () => {
organizationOriFilter.value = option; organizationOriFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -430,7 +430,6 @@ const fetchOrganizationAgencyCode = async () => {
.get(config.API.organizationCode) .get(config.API.organizationCode)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
let option: GovermentOption[] = []; let option: GovermentOption[] = [];
data.map((r: any) => { data.map((r: any) => {
option.push({ option.push({
@ -444,7 +443,7 @@ const fetchOrganizationAgencyCode = async () => {
organizationAgencyCodeFilter.value = option; organizationAgencyCodeFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -459,7 +458,6 @@ const fetchOrganizationGovernmentCode = async () => {
.get(config.API.organizationShortName) .get(config.API.organizationShortName)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
let option: GovermentOption[] = []; let option: GovermentOption[] = [];
data.map((r: any) => { data.map((r: any) => {
option.push({ option.push({
@ -473,7 +471,7 @@ const fetchOrganizationGovernmentCode = async () => {
organizationGovernmentCodeFilter.value = option; organizationGovernmentCodeFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -488,7 +486,6 @@ const fetchOrganizationGovernmentCode = async () => {
// .get(config.API.organizationShortName) // .get(config.API.organizationShortName)
// .then((res) => { // .then((res) => {
// const data = res.data.result; // const data = res.data.result;
// // console.log(data);
// let option: GovermentOption[] = []; // let option: GovermentOption[] = [];
// data.map((r: any) => { // data.map((r: any) => {
// option.push({ // option.push({
@ -502,7 +499,6 @@ const fetchOrganizationGovernmentCode = async () => {
// organizationShortNameFilter.value = option; // organizationShortNameFilter.value = option;
// }) // })
// .catch((e) => { // .catch((e) => {
// console.log(e);
// }) // })
// .finally(() => { // .finally(() => {
// hideLoader(); // hideLoader();
@ -528,7 +524,7 @@ const fetchOrganizationAgency = async () => {
organizationAgencyFilter.value = option; organizationAgencyFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -554,7 +550,7 @@ const fetchOrganizationGovernmentAgency = async () => {
organizationGovernmentAgencyFilter.value = option; organizationGovernmentAgencyFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -577,7 +573,7 @@ const fetchOrganizationType = async () => {
organizationTypeFilter.value = option; organizationTypeFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -600,7 +596,7 @@ const fetchOrganizationLevel = async () => {
organizationLevelFilter.value = option; organizationLevelFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -623,7 +619,7 @@ const fetchOrganizationTelInternal = async () => {
organizationTelInternalFilter.value = option; organizationTelInternalFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -646,7 +642,7 @@ const fetchOrganizationTelExternal = async () => {
organizationTelExternalFilter.value = option; organizationTelExternalFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -669,7 +665,7 @@ const fetchOrganizationFax = async () => {
organizationFaxFilter.value = option; organizationFaxFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -692,18 +688,12 @@ const deleteOrgItem = (val: OrganizaOption) => {
persistent: true, persistent: true,
}) })
.onOk(() => { .onOk(() => {
// console.log(">>>> OK");
organizations.value = organizations.value.filter( organizations.value = organizations.value.filter(
(x: object) => x !== val (x: object) => x !== val
); // ); //
// console.log(positions.value);
}) })
.onCancel(() => { .onCancel(() => {})
// console.log(">>>> Cancel"); .onDismiss(() => {});
})
.onDismiss(() => {
// console.log("I am triggered on both OK and Cancel");
});
} else { } else {
organizations.value = organizations.value.filter((x: object) => x !== val); organizations.value = organizations.value.filter((x: object) => x !== val);
} }
@ -738,7 +728,6 @@ const isEmptyOrganization = (items: OrganizaOption[]) => {
*/ */
const addOrganizationItem = async () => { const addOrganizationItem = async () => {
await myForm.value!.validate().then(async (result: boolean) => { await myForm.value!.validate().then(async (result: boolean) => {
// console.log(result);
if (result) { if (result) {
// organizations.value.push(JSON.parse(JSON.stringify(organizationSet))); // organizations.value.push(JSON.parse(JSON.stringify(organizationSet)));
organizations.value.push({ organizations.value.push({
@ -767,7 +756,6 @@ const addOrganizationItem = async () => {
isActive: true, isActive: true,
}); });
emit("update:organizprops", organizations.value); emit("update:organizprops", organizations.value);
// console.log(organizations);
} }
}); });
}; };
@ -791,7 +779,7 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
// organizationAgencyCodeFilter.value = option; // organizationAgencyCodeFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -818,7 +806,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
item.organizationGovernmentCodeOptionFilter = option; item.organizationGovernmentCodeOptionFilter = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();

View file

@ -316,7 +316,7 @@ import type { EnumStringMember } from "@babel/types";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const props = defineProps({ const props = defineProps({
organizprops: Object as PropType<OrganizaOption>, organizprops: Object as PropType<OrganizaOption>,
@ -411,9 +411,7 @@ onMounted(async () => {
await fetchOrganizationTelExternal(); await fetchOrganizationTelExternal();
await fetchOrganizationTelInternal(); await fetchOrganizationTelInternal();
await fetchOrganizationStatus(); await fetchOrganizationStatus();
// console.log("Edit:organization.value", organization.value);
console.log("props.orgId", props.org);
console.log("props.orgId.organizationId", props.org.organizationId);
await fillOrgEdit(); // input shortName & shortCode await fillOrgEdit(); // input shortName & shortCode
}); });
@ -434,7 +432,7 @@ const fillOrgEdit = async () => {
.get(config.API.getOrgDraft(props.org.organizationId)) .get(config.API.getOrgDraft(props.org.organizationId))
.then((res) => { .then((res) => {
// objOrg OrganizationDialogAddEdit.vue // objOrg OrganizationDialogAddEdit.vue
console.log("ข้อมูลเดิม", res.data.result);
organization.value.organizationOrganizationId = organization.value.organizationOrganizationId =
res.data.result.organizationOrganizationId; res.data.result.organizationOrganizationId;
organization.value.organizationShortNameId = organization.value.organizationShortNameId =
@ -498,12 +496,11 @@ const fillOrgEdit = async () => {
emit("update:organizprops", organization.value); emit("update:organizprops", organization.value);
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
hideLoader(); hideLoader();
}); });
console.log("success");
}; };
/** /**
@ -523,7 +520,7 @@ const fetchOrganizationOri = async () => {
organizationOriFilter.value = option; organizationOriFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -538,7 +535,7 @@ const fetchOrganizationAgencyCode = async () => {
.get(config.API.organizationCode) .get(config.API.organizationCode)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
let option: GovermentOption[] = []; let option: GovermentOption[] = [];
data.map((r: any) => { data.map((r: any) => {
option.push({ option.push({
@ -552,7 +549,7 @@ const fetchOrganizationAgencyCode = async () => {
organizationAgencyCodeFilter.value = option; organizationAgencyCodeFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -567,7 +564,6 @@ const fetchOrganizationGovernmentCode = async () => {
.get(config.API.organizationShortName) .get(config.API.organizationShortName)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log(data);
let option: GovermentOption[] = []; let option: GovermentOption[] = [];
data.map((r: any) => { data.map((r: any) => {
option.push({ option.push({
@ -584,7 +580,7 @@ const fetchOrganizationGovernmentCode = async () => {
emit("update:organizprops", organization.value); emit("update:organizprops", organization.value);
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -599,7 +595,6 @@ const fetchOrganizationGovernmentCode = async () => {
// .get(config.API.organizationShortName) // .get(config.API.organizationShortName)
// .then((res) => { // .then((res) => {
// const data = res.data.result; // const data = res.data.result;
// // console.log(data);
// let option: GovermentOption[] = []; // let option: GovermentOption[] = [];
// data.map((r: any) => { // data.map((r: any) => {
// option.push({ // option.push({
@ -613,7 +608,7 @@ const fetchOrganizationGovernmentCode = async () => {
// organizationShortNameFilter.value = option; // organizationShortNameFilter.value = option;
// }) // })
// .catch((e) => { // .catch((e) => {
// console.log(e); // messageError($q,e)
// }) // })
// .finally(() => { // .finally(() => {
// hideLoader(); // hideLoader();
@ -640,7 +635,7 @@ const fetchOrganizationAgency = async () => {
organizationAgencyFilter.value = option; organizationAgencyFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -657,7 +652,7 @@ const fetchOrganizationGovernmentAgency = async () => {
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
let option: DataOption[] = []; let option: DataOption[] = [];
// console.log(data);
data.map((r: any) => { data.map((r: any) => {
option.push({ option.push({
id: r.organizationId.toString(), id: r.organizationId.toString(),
@ -668,7 +663,7 @@ const fetchOrganizationGovernmentAgency = async () => {
organizationGovernmentAgencyFilter.value = option; organizationGovernmentAgencyFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -691,7 +686,7 @@ const fetchOrganizationType = async () => {
organizationTypeFilter.value = option; organizationTypeFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -715,7 +710,7 @@ const fetchOrganizationStatus = async () => {
organizationStatusFilter.value = option; organizationStatusFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -739,7 +734,7 @@ const fetchOrganizationLevel = async () => {
organizationLevelFilter.value = option; organizationLevelFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -762,7 +757,7 @@ const fetchOrganizationTelInternal = async () => {
organizationTelInternalFilter.value = option; organizationTelInternalFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -785,7 +780,7 @@ const fetchOrganizationTelExternal = async () => {
organizationTelExternalFilter.value = option; organizationTelExternalFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -808,7 +803,7 @@ const fetchOrganizationFax = async () => {
organizationFaxFilter.value = option; organizationFaxFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -834,7 +829,7 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
// organizationAgencyCodeFilter.value = option; // organizationAgencyCodeFilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -861,7 +856,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
item.organizationGovernmentCodeOptionFilter = option; item.organizationGovernmentCodeOptionFilter = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();

View file

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -11,7 +12,8 @@ import { useCounterMixin } from "@/stores/mixin";
import chartData from "@/assets/orgChartData"; import chartData from "@/assets/orgChartData";
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const $q = useQuasar(); // show dialog
const dataSource = ref(chartData); const dataSource = ref(chartData);
// const dataSource = ref() // Chart // const dataSource = ref() // Chart
@ -45,7 +47,7 @@ const fetchTreeRoot = async () => {
} }
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -65,7 +67,7 @@ const fetchOrgChart = async () => {
} }
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();

View file

@ -238,7 +238,7 @@ const fetchOrganizationAgency = async () => {
govermentOPfilter.value = option; govermentOPfilter.value = option;
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -248,6 +248,5 @@ const fetchOrganizationAgency = async () => {
onMounted(async () => { onMounted(async () => {
hideLoader(); hideLoader();
await fetchOrganizationAgency(); await fetchOrganizationAgency();
console.log(govermentOP.value);
}); });
</script> </script>

View file

@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent } from "@vue/runtime-core"; import { defineAsyncComponent } from "@vue/runtime-core";
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -10,7 +11,8 @@ import "structure-chart/structure-chart.css";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const $q = useQuasar(); // show dialog
// import chartData from '@/assets/structChartData' // import chartData from '@/assets/structChartData'
// const dataSource = ref(chartData) // const dataSource = ref(chartData)
@ -46,7 +48,7 @@ const fetchTreeRoot = async () => {
} }
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -70,7 +72,7 @@ const fetchStructChart = async () => {
} }
}) })
.catch((e) => { .catch((e) => {
console.log(e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();

View file

@ -969,7 +969,6 @@ watch(selectedFile, async (value, oldValue) => {
}); });
onMounted(async () => { onMounted(async () => {
console.log("onMounted");
await fetchTreeRoot(true); //fetch Root Edit Tree level 1 await fetchTreeRoot(true); //fetch Root Edit Tree level 1
expandedNodeView.value = [`1`]; expandedNodeView.value = [`1`];
@ -988,7 +987,6 @@ const loadTreeData = async () => {
"https://s3cluster.frappet.com/bma-public-test/organization/strueture/61a11705-8346-4336-8289-49f72ed9463f-%E0%B8%AA%E0%B8%B3%E0%B8%99%E0%B8%B1%E0%B8%81%E0%B8%87%E0%B8%B2%E0%B8%99%E0%B8%84%E0%B8%93%E0%B8%B0%E0%B8%81%E0%B8%A3%E0%B8%A3%E0%B8%A1%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%B2%E0%B8%8A%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%81%E0%B8%A3%E0%B8%B8%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%A1%E0%B8%AB%E0%B8%B2%E0%B8%99%E0%B8%84%E0%B8%A3.json" "https://s3cluster.frappet.com/bma-public-test/organization/strueture/61a11705-8346-4336-8289-49f72ed9463f-%E0%B8%AA%E0%B8%B3%E0%B8%99%E0%B8%B1%E0%B8%81%E0%B8%87%E0%B8%B2%E0%B8%99%E0%B8%84%E0%B8%93%E0%B8%B0%E0%B8%81%E0%B8%A3%E0%B8%A3%E0%B8%A1%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%B2%E0%B8%8A%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%81%E0%B8%A3%E0%B8%B8%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%A1%E0%B8%AB%E0%B8%B2%E0%B8%99%E0%B8%84%E0%B8%A3.json"
) )
.then((res) => { .then((res) => {
console.log(res.data.result);
dataTree.value = res.data.result; dataTree.value = res.data.result;
}) })
.catch((e) => { .catch((e) => {
@ -1007,7 +1005,6 @@ const loadViewTree = async () => {
}; };
const loadPublishScreen = async () => { const loadPublishScreen = async () => {
console.log("onMounted");
await fetchPublishFile(); await fetchPublishFile();
expandedNodeView.value = [`1`]; expandedNodeView.value = [`1`];
setTimeout(async () => { setTimeout(async () => {
@ -1041,12 +1038,9 @@ const loadFileServer = async (node: any) => {
`${config.s3ClusterUrl}${node.organizationId}-${node.organizationName}.json` `${config.s3ClusterUrl}${node.organizationId}-${node.organizationName}.json`
) )
.then((res) => { .then((res) => {
console.log(res.data);
node.children = res.data; node.children = res.data;
}) })
.catch((e) => { .catch((e) => {
// console.log(e);
// console.log(e.response);
manageApiErrorMsg(e); manageApiErrorMsg(e);
}) })
.finally(() => { .finally(() => {
@ -1061,13 +1055,9 @@ const isTreeHasDraft = async () => {
await http await http
.get(config.API.isOrgPohasDraft) .get(config.API.isOrgPohasDraft)
.then((res) => { .then((res) => {
// console.log("isOrgPohasDraft:", res.data.result);
orgPoHasDraft = res.data.result; orgPoHasDraft = res.data.result;
}) })
.catch((e) => { .catch((e) => {
console.log("====isOrgPohasDraft====");
console.log(e);
console.log(e.response);
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
@ -1077,13 +1067,9 @@ const isTreeHasDraft = async () => {
await http await http
.get(config.API.isOrghasDraft) .get(config.API.isOrghasDraft)
.then((res) => { .then((res) => {
// console.log("isOrghasDraft:", res.data.result);
orgHasDraft = res.data.result; orgHasDraft = res.data.result;
}) })
.catch((e) => { .catch((e) => {
console.log("====isOrghasDraft====");
console.log(e);
console.log(e.response);
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
@ -1101,7 +1087,6 @@ const isTreeHasDraft = async () => {
* @param isDraft แสดงขอมลดราฟหร Production * @param isDraft แสดงขอมลดราฟหร Production
*/ */
const fetchTreeRoot = async (isDraft: boolean) => { const fetchTreeRoot = async (isDraft: boolean) => {
// console.log(isDraft);
showLoader(); showLoader();
console.log("Call API14 GetTreeRoot"); console.log("Call API14 GetTreeRoot");
isShowEditTree.value = isDraft; // to show same tree that we fetch isShowEditTree.value = isDraft; // to show same tree that we fetch