Merge branch 'develop' into nice

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-15 16:12:06 +07:00
commit 545fce692f
15 changed files with 200 additions and 188 deletions

View file

@ -59,13 +59,6 @@ function fetchProfile(id: string) {
)
.then(async (res) => {
profile.avatar = res.data.downloadUrl;
})
.catch((e) => {
if (e.response.data.message === "ไม่พบไฟล์ในระบบ") {
profile.avatar = "";
} else {
messageError($q, e);
}
});
}
}

View file

@ -1,4 +1,3 @@
divdivdiv
<script setup lang="ts">
import { ref, watch, computed } from "vue";
import { useQuasar } from "quasar";

View file

@ -129,7 +129,7 @@ async function fetchInformation(id: string) {
async function fetchProfileGov(id: string) {
showLoader();
await http
.get(config.API.profileNewGovernmentById(id))
.get(config.API.profileNewGovernmentById(id, ""))
.then((res) => {
const data = res.data.result;
goverment.oc = data.org !== "" ? data.org : "-";

View file

@ -1,16 +1,10 @@
divdivdiv
<script setup lang="ts">
import { onMounted, ref, reactive } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/components/CurruncyInput.vue";
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
import type {
appointmentData,
ResponseData,
DataProfile,
} from "@/modules/05_placement/interface/response/AppointMent";
import type { DataProfile } from "@/modules/05_placement/interface/response/AppointMent";
import type { QForm } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -103,7 +97,7 @@ function putAppointment() {
positionTypeOld: positionTypeOld.value,
positionLevelOld: positionLevelOld.value,
positionNumberOld: posNo.value,
amountOld: Number(salary.value),
amountOld: salary.value.toString().replace(/,/g, ""),
reason: reason.value,
positionDate: date.value,
};

View file

@ -3,7 +3,7 @@ import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { UserData } from "@/modules/05_placement/interface/response/AppointMent";
import type { UserDataNew } from "@/modules/05_placement/interface/response/AppointMent";
import DialogHeader from "@/modules/05_placement/components/AppointMent/DialogHeader.vue";
import { useTransferDataStore } from "@/modules/05_placement/store";
@ -27,7 +27,7 @@ const {
const $q = useQuasar();
const selected = ref<[]>([]);
const checkSelected = computed(() => {
if (selected.value.length === 0 || props.type === "") {
if (selected.value.length === 0) {
return true;
}
});
@ -48,6 +48,7 @@ const visibleColumns2 = ref<string[]>([
"fullname",
"organizationName",
"birthday",
"typeCommand",
]);
const columns2 = ref<QTableProps["columns"]>([
{
@ -88,6 +89,24 @@ const columns2 = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "typeCommand",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "typeCommand",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val: string) => {
return val === "APPOINT"
? "แต่งตั้ง"
: val === "SLIP"
? "เลื่อน"
: val === "MOVE"
? "ย้าย"
: "-";
},
},
{
name: "birthday",
align: "left",
@ -110,43 +129,41 @@ const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
const updateInputType = (value: string) => {
emit("update:type", value);
};
// const updateInputType = (value: string) => {
// emit("update:type", value);
// };
//
const Reset = () => {
emit("update:filterKeyword2", "");
};
// modal
const clickAddlist = () => {
dialogConfirm($q, () => createdAppoint());
};
//
const createdAppoint = async () => {
let pId: string[] = [];
let Type = props.type as string;
selected.value.forEach((e: UserData) => {
pId.push(e.personalId);
});
let data = {
id: pId,
};
showLoader();
await http
.put(config.API.apppointmentReport(Type), data)
.then((res) => {
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
props.fecthlistappointment?.();
selected.value = [];
props.clickClose?.();
//
const sendToCommand = () => {
dialogConfirm($q, async () => {
let pId: string[] = [];
let Type = props.type as string;
selected.value.forEach((e: UserDataNew) => {
pId.push(e.id);
});
let data = {
id: pId,
};
showLoader();
await http
.put(config.API.apppointmentReport(Type), data)
.then((res) => {
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
props.fecthlistappointment?.();
selected.value = [];
props.clickClose?.();
});
});
};
watchEffect(() => {
@ -163,7 +180,7 @@ watchEffect(() => {
<q-card-section class="q-pt-none">
<div class="row justify-between">
<div class="col-5">
<q-toolbar style="padding: 0">
<!-- <q-toolbar style="padding: 0">
<q-select
outlined
dense
@ -177,7 +194,7 @@ watchEffect(() => {
option-label="name"
option-value="id"
/>
</q-toolbar>
</q-toolbar> -->
</div>
<div class="col-5">
<q-toolbar style="padding: 0">
@ -316,7 +333,7 @@ watchEffect(() => {
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="clickAddlist"
@click="sendToCommand"
color="public"
:disable="checkSelected"
/>

View file

@ -57,6 +57,7 @@ const visibleColumns = ref<string[]>([
"citizenId",
"fullname",
"organizationName",
"typeCommand",
"dateOfBirth",
"createdAt",
"status",
@ -113,6 +114,24 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "typeCommand",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "typeCommand",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val: string) => {
return val === "APPOINT"
? "แต่งตั้ง"
: val === "SLIP"
? "เลื่อน"
: val === "MOVE"
? "ย้าย"
: "-";
},
},
{
name: "createdAt",
align: "left",
@ -146,10 +165,10 @@ const clickClose = () => {
};
// modal
const popup = () => {
const sendToCommand = () => {
modal.value = true;
filterKeyword2.value = "";
fecthTypeOption();
// fecthTypeOption();
};
// API
@ -213,22 +232,22 @@ const fecthlistappointment = async () => {
};
//
const fecthTypeOption = async () => {
type.value = "";
await http
.get(config.API.typeOrder())
.then((res) => {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-05" ||
e.commandCode === "C-PM-06" ||
e.commandCode === "C-PM-07"
);
})
.catch((e) => {
messageError($q, e);
});
};
// const fecthTypeOption = async () => {
// type.value = "";
// await http
// .get(config.API.typeOrder())
// .then((res) => {
// optionsType.value = res.data.result.filter(
// (e: OpType) =>
// e.commandCode === "C-PM-05" ||
// e.commandCode === "C-PM-06" ||
// e.commandCode === "C-PM-07"
// );
// })
// .catch((e) => {
// messageError($q, e);
// });
// };
//
const openModalTree = (data: any, type: string) => {
@ -262,12 +281,6 @@ const deleteAppoint = async (id: string) => {
});
};
// modal
const closeModalTree = async () => {
await fecthlistappointment();
modalTree.value = false;
};
//
const nextPage = (id: string) => {
router.push({
@ -314,6 +327,7 @@ onMounted(() => {
fecthlistappointment();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการแตงต-เลอน-าย
@ -324,7 +338,7 @@ onMounted(() => {
<div class="col-12">
<div class="row col-12">
<q-btn
@click="popup()"
@click="sendToCommand()"
size="14px"
flat
round

View file

@ -6,20 +6,13 @@ import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
import type { ResponseDataDetail } from "@/modules/05_placement/interface/response/Transfer";
import type {
OtherdataInterface,
resApiData,
} from "@/modules/05_placement/interface/response/OhterMain";
import type { resApiData } from "@/modules/05_placement/interface/response/OhterMain";
import type { QForm } from "quasar";
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
/** importComponents*/
import CardProfile from "@/components/CardProfile.vue";
import CurruncyInput from "@/components/CurruncyInput.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
@ -102,7 +95,7 @@ const onSubmit = async () => {
positionTypeOld: positionTypeOld.value,
positionLevelOld: positionLevelOld.value,
positionNumberOld: posNo.value,
amountOld: Number(salary.value),
amountOld: salary.value.toString().replace(/,/g, ""),
positionDate: date.value,
militaryDate: militaryDate.value,
reason: reason.value,
@ -145,6 +138,7 @@ onMounted(async () => {
await fetchData();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
<q-btn

View file

@ -186,22 +186,6 @@ const fecthTypeOption = async () => {
});
};
//----()------//
const deleteOther = async (id: string) => {
showLoader();
await http
.delete(config.API.otherByid(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthlistOthet();
});
};
//----( input)------//
const resetFilter = () => {
filterKeyword.value = "";
@ -224,10 +208,23 @@ const clickClose = () => {
//----( Dialog )------//
const clickDelete = (id: string) => {
dialogRemove($q, () => deleteOther(id));
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.otherByid(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthlistOthet();
});
});
};
//----()------//
//----()------//
const nextPage = (id: string) => {
router.push({
path: `/other/detail/${id}`,
@ -351,7 +348,7 @@ onMounted(() => {
class="text-red-14"
icon="mdi-delete"
dense
@click.stop="clickDelete(props.row.personalId)"
@click.stop="clickDelete(props.row.id)"
><q-tooltip>ลบขอม</q-tooltip></q-btn
>
</q-td>

View file

@ -37,7 +37,7 @@ const {
} = mixin;
const profileStore = useProfileDataStore();
const { changeRetireText, changeBirth } = profileStore;
const { changeRetireText } = profileStore;
const prefixOps = ref<DataOption[]>([]);
const age = ref<string | null>("");
@ -331,7 +331,7 @@ const onSubmit = async () => {
.post(config.API.receiveData(), formData)
.then(async (res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
await changeBirth(informaData.value.birthDate ?? new Date());
// await changeBirth(informaData.value.birthDate ?? new Date());
await clickBack();
})
.catch((e) => {

View file

@ -14,7 +14,14 @@ const { statusText } = transferStore;
const $q = useQuasar();
const selected = ref<ResponseRow[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader,date2Thai } = mixin;
const {
showLoader,
success,
messageError,
dialogConfirm,
hideLoader,
date2Thai,
} = mixin;
//
const visibleColumns2 = ref<string[]>([
@ -134,7 +141,7 @@ const saveOrder = () => {
};
//
const Ordersave = async () => {
const id = selected.value.map((r: ResponseRow) => r.personalId);
const id = selected.value.map((r: ResponseRow) => r.id);
const body = {
id,
};
@ -302,7 +309,6 @@ watchEffect(() => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>

View file

@ -1,10 +1,9 @@
divdivdiv<script setup lang="ts">
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/08_registryEmployee/store";
import CurrencyInput from "@/components/CurruncyInput.vue";
import type { QTableProps, QForm } from "quasar";
import type {
ResponseTitle,
@ -407,21 +406,6 @@ const calRetire = async (birth: Date) => {
// }
};
const conditionSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
dialogConfirm(
$q,
async () => await saveData(),
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
}
});
}
};
function saveData() {
dialogConfirm(
$q,

View file

@ -258,7 +258,7 @@ const getData = async () => {
positionLevelOld: item.positionLevelOld,
positionNumberOld: item.positionNumberOld,
organizationPositionOld: item.organizationPositionOld,
createdAt:date2Thai(item.createdAt),
createdAt: date2Thai(item.createdAt),
}));
})
.catch((e) => {
@ -516,7 +516,10 @@ const pagination = ref({
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.status !== 'DONE' && props.row.status !== 'REPORT'"
v-if="
props.row.status !== 'DONE' &&
props.row.status !== 'REPORT'
"
icon="mdi-dots-vertical"
size="12px"
color="grey-7"

View file

@ -1,61 +1,61 @@
interface listAppointType {
personalId: string
citizenId: number
fullname: string
organizationName: string
orgName: string
organizationShortName: string
positionNumber: string
positionPath: string
status: string
createdAt: string
birthday: string
educationOld: string
organizationPositionOld: string
positionTypeOld: string
positionLevelOld: string
positionNumberOld: string
salary: number
positionDate: Date
personalId: string;
citizenId: number;
fullname: string;
organizationName: string;
orgName: string;
organizationShortName: string;
positionNumber: string;
positionPath: string;
status: string;
createdAt: string;
birthday: string;
educationOld: string;
organizationPositionOld: string;
positionTypeOld: string;
positionLevelOld: string;
positionNumberOld: string;
salary: number;
positionDate: Date;
}
interface resData {
id: string
citizenId: number
prefix: string
firstname: string
lastname: string
organizationName: string
organizationShortName: string
positionNumber: string
positionPath: string
status: string
createdAt: Date
dateOfBirth: Date
educationOld: string
organizationPositionOld: string
positionTypeOld: string
positionLevelOld: string
positionNumberOld: string
salary: number
positionDate: Date
id: string;
citizenId: number;
prefix: string;
firstname: string;
lastname: string;
organizationName: string;
organizationShortName: string;
positionNumber: string;
positionPath: string;
status: string;
createdAt: Date;
dateOfBirth: Date;
educationOld: string;
organizationPositionOld: string;
positionTypeOld: string;
positionLevelOld: string;
positionNumberOld: string;
salary: number;
positionDate: Date;
}
interface orgFilter {
orgName: string
status: string
educationOld: string
organizationPositionOld: string
positionTypeOld: string
positionLevelOld: string
positionNumberOld: string
salary: number
positionDate: Date
orgName: string;
status: string;
educationOld: string;
organizationPositionOld: string;
positionTypeOld: string;
positionLevelOld: string;
positionNumberOld: string;
salary: number;
positionDate: Date;
}
interface appointmentData {
citizenId: string
prefixId?: string
firstname?: string
lastname?: string
citizenId: string;
prefixId?: string;
firstname?: string;
lastname?: string;
}
interface UserData {
@ -72,10 +72,24 @@ interface UserData {
birthday: string;
}
interface UserDataNew {
id: string;
citizenId: string;
fullname: string;
organizationName: string;
orgName: string;
organizationShortName: string;
positionNumber: string;
positionPath: string;
status: string;
createdAt: string;
birthday: string;
}
interface ResponseData {
data: {
result: {
citizenId: string
citizenId: string;
profileId: string;
prefix: string;
firstname: string;
@ -90,7 +104,6 @@ interface ResponseData {
reason: string;
positionDate: Date;
avatar: string;
};
};
}
@ -129,7 +142,7 @@ export type {
orgFilter,
appointmentData,
UserData,
UserDataNew,
ResponseData,
DataProfile
}
DataProfile,
};

View file

@ -6,7 +6,7 @@ interface ResponseTitle {
}
interface ResponseRow {
personalId: string;
id: string;
citizenId: string;
fullname: string;
organizationName: string;

View file

@ -32,8 +32,6 @@ const documentFile = ref<any>(null);
const fileList = ref<ArrayFileList[]>([]);
async function getData() {
console.log(config.API.kpiFile);
showLoader();
await http
.get(config.API.kpiFile + `/KPI/ไฟล์เอกสาร/${id.value}`)