no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-08 16:59:57 +07:00
parent bf20e7d28c
commit 1fb4478394
2 changed files with 70 additions and 30 deletions

View file

@ -2,6 +2,7 @@ import env from "../index";
const organization = `${env.API_URI}/org`;
const orgPos = `${env.API_URI}/org/pos`;
const orgProfile = `${env.API_URI}/org/profile`;
export default {
/** โครงสร้างอัตรากำลัง*/
@ -32,5 +33,10 @@ export default {
orgPosExecutiveById: (id: string) => `${orgPos}/executive/${id}`,
orgPosHistory: (id: string) => `${orgPos}/history/${id}`,
orgSalaryPosition:`${orgPos}/position?keyword=&type=ALL`,
orgSalaryPosition: `${orgPos}/position?keyword=&type=ALL`,
/**ครองตำแหน่ง */
orgSearchProfile: `${orgProfile}/search`,
orgProfile: `${orgProfile}`,
orgDeleteProfile: (id: string) => `${orgProfile}/delete/${id}`,
};

View file

@ -59,6 +59,7 @@ const props = defineProps({
});
const row = ref<Position[]>([]);
const rowResult = ref<SeaechResult[]>([]);
const formData = reactive<FormDetailPosition>({
positionNo: "", //*
positionType: "", //*
@ -267,8 +268,8 @@ function clearForm() {
formData.positionLevel = "";
formData.personal = "";
formData.position = "";
row.value = []
rowResult.value = []
row.value = [];
rowResult.value = [];
}
watch(
@ -362,27 +363,61 @@ function onSubmit() {
}
/** เมื่อ enter ให้ทำการ ค้นหาข้อมูล */
function searchData() {
const data = [
{
id: "test1",
citizenId: "test1",
name: "test1",
posTypeName: "test1",
positionName: "test1",
posLevelName: "test1",
},
{
id: "test2",
citizenId: "test2",
name: "test2",
posTypeName: "test2",
positionName: "test2",
posLevelName: "test2",
},
];
const page = ref<number>(1);
const pageSize = ref<number>(20);
async function searchData() {
showLoader();
console.log(formData);
const reqBody = {
posTypeId: formData.positionType, // id
posLevelId: formData.positionLevel, // id
position: formData.position, //
page: page.value, //*
pageSize: pageSize.value, //*
keyword: formData.personal, //
};
await http
.post(config.API.orgSearchProfile, reqBody)
.then((res) => {
console.log(res);
const list = res.data.result.data.map((e) => ({
id: e.id,
citizenId: e.citizenId,
name: `${e.prefix + e.firstName + e.lastName}`,
posTypeName: e.posType ?? "-",
positionName: e.position ?? "-",
posLevelName: e.posLevel ?? "-",
}));
rowResult.value = list;
})
rowResult.value = data;
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
// const data = [
// {
// id: "test1",
// citizenId: "test1",
// name: "test1",
// posTypeName: "test1",
// positionName: "test1",
// posLevelName: "test1",
// },
// {
// id: "test2",
// citizenId: "test2",
// name: "test2",
// posTypeName: "test2",
// positionName: "test2",
// posLevelName: "test2",
// },
// ];
// rowResult.value = data;
// props.fetchListDisciplinary?.();
}
@ -509,7 +544,6 @@ function clearPosition() {
</div>
<div class="col-2">
<q-select
ref="positionLevelRef"
:class="inputEdit(isReadonly)"
label="ระดับตำแหน่ง"
@ -539,12 +573,12 @@ function clearPosition() {
></q-select>
</div>
<div class="col-2">
<q-btn
label="ค้นหา"
color="teal-5"
class="full-height"
icon="search"
@click="searchData"
<q-btn
label="ค้นหา"
color="teal-5"
class="full-height"
icon="search"
@click="searchData"
/>
</div>