no message
This commit is contained in:
parent
f592008bbe
commit
fbb59b99ff
5 changed files with 17 additions and 264 deletions
|
|
@ -100,10 +100,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
]);
|
]);
|
||||||
// ข้อมูลตาราง (จำลอง)
|
// ข้อมูลตาราง (จำลอง)
|
||||||
const rows = ref<QTableProps["rows"]>([]);
|
const rows = ref<QTableProps["rows"]>([]);
|
||||||
// const yearValue = ref<number>(0); // เพิ่มตัวแปรในโมดูล
|
|
||||||
|
|
||||||
// let OriginalData = ref<FormPlacementMainData[]>([]);
|
|
||||||
// let UpdataData = ref<FormPlacementMainData[]>([]);
|
|
||||||
const searchYear = ref();
|
const searchYear = ref();
|
||||||
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||||
|
|
||||||
|
|
@ -126,14 +122,11 @@ onMounted(async () => {
|
||||||
const fetchPlacementData = async (val: number) => {
|
const fetchPlacementData = async (val: number) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
http
|
await http
|
||||||
.get(config.API.MainDetail(val))
|
.get(config.API.MainDetail(val))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
dataPlacement.value = res.data.result;
|
dataPlacement.value = res.data.result;
|
||||||
DataStore.DataMainOrig = dataPlacement.value;
|
DataStore.DataMainOrig = dataPlacement.value;
|
||||||
console.log(DataStore.DataMainOrig);
|
|
||||||
|
|
||||||
// rows.value = DataStore.DataMainOrig;
|
|
||||||
const dataArr: any = [];
|
const dataArr: any = [];
|
||||||
await DataStore.DataMainOrig.map((e: any) => {
|
await DataStore.DataMainOrig.map((e: any) => {
|
||||||
dataArr.push({
|
dataArr.push({
|
||||||
|
|
@ -149,27 +142,25 @@ const fetchPlacementData = async (val: number) => {
|
||||||
numberOfCandidates: e.numberOfCandidates,
|
numberOfCandidates: e.numberOfCandidates,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
rows.value = dataArr;
|
rows.value = dataArr;
|
||||||
|
|
||||||
examTypeFilter();
|
examTypeFilter();
|
||||||
examTimeFilter();
|
examTimeFilter();
|
||||||
expiredAccountFilter();
|
expiredAccountFilter();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
filterKeyword.value = "";
|
filterKeyword.value = "";
|
||||||
examTime.value = "all"
|
examTime.value = "all";
|
||||||
examType.value = "all"
|
examType.value = "all";
|
||||||
expiredAccount.value = false
|
expiredAccount.value = false;
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchYearOptions = async () => {
|
const fetchYearOptions = async () => {
|
||||||
http
|
await http
|
||||||
.get(config.API.yearOptions())
|
.get(config.API.yearOptions())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const response = res.data.result;
|
const response = res.data.result;
|
||||||
|
|
@ -179,7 +170,6 @@ const fetchYearOptions = async () => {
|
||||||
}, "");
|
}, "");
|
||||||
searchYear.value = maxNumber;
|
searchYear.value = maxNumber;
|
||||||
DataStore.DataMainYearSet(searchYear.value);
|
DataStore.DataMainYearSet(searchYear.value);
|
||||||
// DataStore.DataMainYear = yearOptions.value;
|
|
||||||
fetchPlacementData(searchYear.value);
|
fetchPlacementData(searchYear.value);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -187,7 +177,6 @@ const fetchYearOptions = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const filterYear = () => {
|
const filterYear = () => {
|
||||||
// console.log("searchYear", searchYear.value);
|
|
||||||
fetchPlacementData(searchYear.value);
|
fetchPlacementData(searchYear.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -210,7 +199,6 @@ const examTimeOP = reactive<DataOption1[]>([{ id: "all", name: "ทั้งห
|
||||||
const addedExamTimeValues: Set<number> = new Set();
|
const addedExamTimeValues: Set<number> = new Set();
|
||||||
|
|
||||||
const examTimeFilter = async () => {
|
const examTimeFilter = async () => {
|
||||||
// examTimeOP.push({ id: "all", name: "ทั้งหมด" });
|
|
||||||
for (const data of dataPlacement.value) {
|
for (const data of dataPlacement.value) {
|
||||||
const examOrder = data.examOrder;
|
const examOrder = data.examOrder;
|
||||||
if (examOrder !== null && !addedExamTimeValues.has(examOrder)) {
|
if (examOrder !== null && !addedExamTimeValues.has(examOrder)) {
|
||||||
|
|
@ -274,12 +262,8 @@ const searchFilterTable = async () => {
|
||||||
//----------------|บัญชีหมดอายุ|-----------------------------//
|
//----------------|บัญชีหมดอายุ|-----------------------------//
|
||||||
const expiredAccount = ref<boolean>(false);
|
const expiredAccount = ref<boolean>(false);
|
||||||
const expiredAccountFilter = async () => {
|
const expiredAccountFilter = async () => {
|
||||||
// const currentDate = new Date();
|
|
||||||
const updatedRows = dataPlacement.value.map((data: any) => {
|
const updatedRows = dataPlacement.value.map((data: any) => {
|
||||||
// let expirationDate = new Date(data.accountExpirationDate);
|
|
||||||
// let isExpired = currentDate > expirationDate;
|
|
||||||
let isExpired = data.isExpired == expiredAccount;
|
let isExpired = data.isExpired == expiredAccount;
|
||||||
|
|
||||||
return { ...data, isExpired };
|
return { ...data, isExpired };
|
||||||
});
|
});
|
||||||
await DataStore.DataMain(updatedRows);
|
await DataStore.DataMain(updatedRows);
|
||||||
|
|
@ -427,7 +411,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="pagination.page"
|
v-model="pagination.page"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
color="dark"
|
color="dark"
|
||||||
:max="scope.pagesNumber"
|
:max="scope.pagesNumber"
|
||||||
:max-pages="5"
|
:max-pages="5"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ const fetchPlacementData = async () => {
|
||||||
DataStore.DataMainOrig = res.data.result;
|
DataStore.DataMainOrig = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -141,11 +141,7 @@ const fetchPlacementData = async () => {
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm">
|
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm">
|
||||||
<div>
|
<div>
|
||||||
<AddTablePosition
|
<AddTablePosition :statCard="getStat" class="q-pa-none" />
|
||||||
:statCard="getStat"
|
|
||||||
class="q-pa-none"
|
|
||||||
@get-stat="getStat"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,6 @@ let dataForm = reactive({
|
||||||
positionLineId: "",
|
positionLineId: "",
|
||||||
positionPathSideId: "",
|
positionPathSideId: "",
|
||||||
positionTypeId: "",
|
positionTypeId: "",
|
||||||
// salaryAmount: null,
|
|
||||||
// mouthSalaryAmount: null,
|
|
||||||
// positionSalaryAmount: null,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
@ -85,7 +82,6 @@ const loadTreeData = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
function filterByPersonIdNull(obj: any) {
|
function filterByPersonIdNull(obj: any) {
|
||||||
// console.log(obj);
|
|
||||||
if (obj.name === null && obj.isCondition != true) {
|
if (obj.name === null && obj.isCondition != true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -102,8 +98,6 @@ const fetchplacementPosition = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.placementPosition())
|
.get(config.API.placementPosition())
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
console.log("1221111111");
|
|
||||||
|
|
||||||
placementPosition.value = res.data.result;
|
placementPosition.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
|
|
@ -164,8 +158,6 @@ const validateData = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveAppoint = async () => {
|
const saveAppoint = async () => {
|
||||||
console.log("save", dataForm);
|
|
||||||
|
|
||||||
myFormPosition.value.validate().then(async (result: boolean) => {
|
myFormPosition.value.validate().then(async (result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
const dataAppoint = await {
|
const dataAppoint = await {
|
||||||
|
|
@ -177,16 +169,12 @@ const saveAppoint = async () => {
|
||||||
positionLineId: dataForm.positionLineId,
|
positionLineId: dataForm.positionLineId,
|
||||||
positionPathSideId: dataForm.positionPathSideId,
|
positionPathSideId: dataForm.positionPathSideId,
|
||||||
positionTypeId: dataForm.positionTypeId,
|
positionTypeId: dataForm.positionTypeId,
|
||||||
// salaryAmount: dataForm.salaryAmount,
|
|
||||||
// mouthSalaryAmount: dataForm.mouthSalaryAmount,
|
|
||||||
// positionSalaryAmount: dataForm.positionSalaryAmount,
|
|
||||||
};
|
};
|
||||||
console.log("save appoint===>", dataAppoint);
|
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.post(config.API.placementPass(), dataAppoint)
|
.post(config.API.placementPass(), dataAppoint)
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
console.log("respone=>", res);
|
|
||||||
success($q, "บันทึกสำเร็จ");
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -194,7 +182,6 @@ const saveAppoint = async () => {
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await closeAndClear();
|
await closeAndClear();
|
||||||
// await resetFilter();
|
|
||||||
await fetchPublishFile();
|
await fetchPublishFile();
|
||||||
await loadTreeData();
|
await loadTreeData();
|
||||||
await fetchplacementPosition();
|
await fetchplacementPosition();
|
||||||
|
|
@ -217,15 +204,6 @@ const closeModal = () => {
|
||||||
"ข้อมูลมีการแก้ไข",
|
"ข้อมูลมีการแก้ไข",
|
||||||
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
|
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
|
||||||
);
|
);
|
||||||
// $q.dialog({
|
|
||||||
// title: `ข้อมูลมีการแก้ไข`,
|
|
||||||
// message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
|
||||||
// cancel: "ยกเลิก",
|
|
||||||
// ok: "ยืนยัน",
|
|
||||||
// persistent: true,
|
|
||||||
// }).onOk(() => {
|
|
||||||
// closeAndClear();
|
|
||||||
// });
|
|
||||||
} else {
|
} else {
|
||||||
closeAndClear();
|
closeAndClear();
|
||||||
}
|
}
|
||||||
|
|
@ -243,9 +221,6 @@ const closeAndClear = async () => {
|
||||||
dataForm.positionLineId = "";
|
dataForm.positionLineId = "";
|
||||||
dataForm.positionPathSideId = "";
|
dataForm.positionPathSideId = "";
|
||||||
dataForm.positionTypeId = "";
|
dataForm.positionTypeId = "";
|
||||||
// dataForm.salaryAmount = null;
|
|
||||||
// dataForm.mouthSalaryAmount = null;
|
|
||||||
// dataForm.positionSalaryAmount = null;
|
|
||||||
editDataStatus.value = false;
|
editDataStatus.value = false;
|
||||||
};
|
};
|
||||||
// ตำแหน่งเลขที่
|
// ตำแหน่งเลขที่
|
||||||
|
|
@ -292,10 +267,7 @@ const positionLevelOptions = ref<Object[]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const selectedPosition = async (data: any) => {
|
const selectedPosition = async (data: any) => {
|
||||||
// console.log("selecteds", data);
|
|
||||||
if (data.name == null && selected.value != data.keyId) {
|
if (data.name == null && selected.value != data.keyId) {
|
||||||
// console.log("selecteds", data);
|
|
||||||
|
|
||||||
editDataStatus.value = true;
|
editDataStatus.value = true;
|
||||||
selected.value = data.keyId;
|
selected.value = data.keyId;
|
||||||
|
|
||||||
|
|
@ -376,7 +348,6 @@ const selectedPosition = async (data: any) => {
|
||||||
dataForm.positionPathSideId = "";
|
dataForm.positionPathSideId = "";
|
||||||
dataForm.positionTypeId = "";
|
dataForm.positionTypeId = "";
|
||||||
}
|
}
|
||||||
// console.log("dataForm", dataForm);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkPosition = (val: string) => {
|
const checkPosition = (val: string) => {
|
||||||
|
|
@ -394,36 +365,28 @@ watch(props, () => {
|
||||||
dataPersonal.map((data: any) => {
|
dataPersonal.map((data: any) => {
|
||||||
personal.value = data;
|
personal.value = data;
|
||||||
});
|
});
|
||||||
console.log("personal", personal.value);
|
|
||||||
}
|
}
|
||||||
// console.log("draft===>", personal.value.draft);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
personal.value &&
|
personal.value &&
|
||||||
personal.value.draft === false &&
|
personal.value.draft === false &&
|
||||||
personal.value.positionNumber !== null
|
personal.value.positionNumber !== null
|
||||||
) {
|
) {
|
||||||
// const findData = dataRespone.value.find(findByPerson);
|
|
||||||
let findData: any = null;
|
let findData: any = null;
|
||||||
dataRespone.value.map((x: any) => {
|
dataRespone.value.map((x: any) => {
|
||||||
findData = findByPerson(x);
|
findData = findByPerson(x);
|
||||||
// console.log(findData);
|
|
||||||
|
|
||||||
if (findData != null) {
|
if (findData != null) {
|
||||||
// console.log("findData===>", findData);
|
|
||||||
selectedPosition(findData);
|
selectedPosition(findData);
|
||||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||||
expanded.value.push(findData.keyId.slice(0, i));
|
expanded.value.push(findData.keyId.slice(0, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// loadTreeData();
|
|
||||||
// selectedPosition(findData.children.children.children)
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function findByPerson(element: any): any {
|
function findByPerson(element: any): any {
|
||||||
// console.log("searchTree element===>", element)
|
|
||||||
if (
|
if (
|
||||||
element.positionNumId &&
|
element.positionNumId &&
|
||||||
element.positionLineId === personal.value.positionLineId &&
|
element.positionLineId === personal.value.positionLineId &&
|
||||||
|
|
@ -444,37 +407,12 @@ function findByPerson(element: any): any {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const clearPosition = () => {
|
const clearPosition = () => {
|
||||||
// console.log(personal.value);
|
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => postClearPosition(),
|
async () => postClearPosition(),
|
||||||
"ยืนยันการคืนตำแหน่ง",
|
"ยืนยันการคืนตำแหน่ง",
|
||||||
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
|
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
|
||||||
);
|
);
|
||||||
// $q.dialog({
|
|
||||||
// title: "ยืนยันการคืนตำแหน่ง",
|
|
||||||
// message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?",
|
|
||||||
// cancel: {
|
|
||||||
// flat: true,
|
|
||||||
// const: "negative",
|
|
||||||
// },
|
|
||||||
// persistent: true,
|
|
||||||
// })
|
|
||||||
// .onOk(async () => {
|
|
||||||
// showLoader();
|
|
||||||
// await http
|
|
||||||
// .post(config.API.clearPosition(personal.value.personalId), {})
|
|
||||||
// .then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ"))
|
|
||||||
// .catch((e: Object) => {
|
|
||||||
// console.log(e);
|
|
||||||
// })
|
|
||||||
// .finally(async () => {
|
|
||||||
// hideLoader();
|
|
||||||
// await closeAndClear();
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// .onCancel(() => {})
|
|
||||||
// .onDismiss(() => {});
|
|
||||||
};
|
};
|
||||||
const postClearPosition = async () => {
|
const postClearPosition = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -485,7 +423,7 @@ const postClearPosition = async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
.catch((e: Object) => {
|
.catch((e: Object) => {
|
||||||
console.log(e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -540,8 +478,6 @@ const postClearPosition = async () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--แสดง Total Count PositionNum-->
|
<!--แสดง Total Count PositionNum-->
|
||||||
<!-- <q-badge rounded color="grey-2" text-color="dark"
|
|
||||||
:label="prop.node.totalPositionCount" /> -->
|
|
||||||
<q-badge
|
<q-badge
|
||||||
v-if="prop.node.totalPositionVacant > 0"
|
v-if="prop.node.totalPositionVacant > 0"
|
||||||
rounded
|
rounded
|
||||||
|
|
@ -790,55 +726,6 @@ const postClearPosition = async () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-sx-12 col-sm-12 col-md-12">
|
|
||||||
<q-separator inset size="2px" class="q-my-md" />
|
|
||||||
</div> -->
|
|
||||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="dataForm.salaryAmount"
|
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
|
||||||
:label="`${'เงินเดือน'}`"
|
|
||||||
@update:modelValue="clickEditRow"
|
|
||||||
type="number"
|
|
||||||
hide-bottom-space
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="dataForm.positionSalaryAmount"
|
|
||||||
:rules="[
|
|
||||||
(val) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`,
|
|
||||||
]"
|
|
||||||
:label="`${'เงินประจำตำแหน่ง'}`"
|
|
||||||
@update:modelValue="clickEditRow"
|
|
||||||
type="number"
|
|
||||||
hide-bottom-space
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="dataForm.mouthSalaryAmount"
|
|
||||||
:rules="[
|
|
||||||
(val) =>
|
|
||||||
!!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`,
|
|
||||||
]"
|
|
||||||
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
|
|
||||||
@update:modelValue="clickEditRow"
|
|
||||||
type="number"
|
|
||||||
hide-bottom-space
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</q-scroll-area>
|
</q-scroll-area>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,6 @@ const convertBmaOfficer = (val: string) => {
|
||||||
return "บุคคลภายนอก";
|
return "บุคคลภายนอก";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const convertContainStatus = (val: string) => {
|
const convertContainStatus = (val: string) => {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "UN-CONTAIN":
|
case "UN-CONTAIN":
|
||||||
|
|
@ -216,7 +215,6 @@ const getTable = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.personalList(examIdString))
|
.get(config.API.personalList(examIdString))
|
||||||
.then(async (res: any) => {
|
.then(async (res: any) => {
|
||||||
console.log(res);
|
|
||||||
dataRes.value = res.data.result;
|
dataRes.value = res.data.result;
|
||||||
rowsAll.value = [];
|
rowsAll.value = [];
|
||||||
(rowsFilter.value = []),
|
(rowsFilter.value = []),
|
||||||
|
|
@ -252,7 +250,6 @@ const getTable = async () => {
|
||||||
draft: convertDraft(data.draft),
|
draft: convertDraft(data.draft),
|
||||||
positionCandidate: data.positionCandidate,
|
positionCandidate: data.positionCandidate,
|
||||||
};
|
};
|
||||||
|
|
||||||
rowsAll.value.push(rowData);
|
rowsAll.value.push(rowData);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -266,7 +263,6 @@ const getTable = async () => {
|
||||||
e.positionNumber !== null &&
|
e.positionNumber !== null &&
|
||||||
e.statusName == "เตรียมบรรจุ"
|
e.statusName == "เตรียมบรรจุ"
|
||||||
);
|
);
|
||||||
console.log(rowsFilter.value);
|
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -277,7 +273,6 @@ const getTable = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const appointModal = ref<boolean>(false);
|
const appointModal = ref<boolean>(false);
|
||||||
|
|
||||||
const saveDeferment = async () => {
|
const saveDeferment = async () => {
|
||||||
myForm.value.validate().then(async (result: boolean) => {
|
myForm.value.validate().then(async (result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
@ -287,18 +282,6 @@ const saveDeferment = async () => {
|
||||||
"ยืนยันการขอผ่อนผัน",
|
"ยืนยันการขอผ่อนผัน",
|
||||||
"ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?"
|
"ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?"
|
||||||
);
|
);
|
||||||
// $q.dialog({
|
|
||||||
// title: "ยืนยันการขอผ่อนผัน",
|
|
||||||
// message: "ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?",
|
|
||||||
// cancel: {
|
|
||||||
// flat: true,
|
|
||||||
// const: "negative",
|
|
||||||
// },
|
|
||||||
// persistent: true,
|
|
||||||
// })
|
|
||||||
// .onOk(async () => {})
|
|
||||||
// .onCancel(() => {})
|
|
||||||
// .onDismiss(() => {});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -314,7 +297,7 @@ const postDeferment = async () => {
|
||||||
success($q, "บันทึกสำเร็จ");
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await getTable();
|
await getTable();
|
||||||
|
|
@ -343,7 +326,6 @@ const postDisclaimf = async () => {
|
||||||
personId: personalId.value,
|
personId: personalId.value,
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
console.log("ยืนยันการสละสิทธิ์");
|
|
||||||
await http
|
await http
|
||||||
.post(config.API.disclaimF(), {
|
.post(config.API.disclaimF(), {
|
||||||
note: dataPost.note,
|
note: dataPost.note,
|
||||||
|
|
@ -487,7 +469,6 @@ const displayAdd = ref<boolean>(true);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (keycloak.tokenParsed != null) {
|
if (keycloak.tokenParsed != null) {
|
||||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||||
console.log("roleAdmin===>", roleAdmin.value);
|
|
||||||
if (roleAdmin.value === false) {
|
if (roleAdmin.value === false) {
|
||||||
displayAdd.value = false;
|
displayAdd.value = false;
|
||||||
visibleColumns.value = [
|
visibleColumns.value = [
|
||||||
|
|
@ -506,18 +487,9 @@ onMounted(async () => {
|
||||||
}
|
}
|
||||||
await getTable();
|
await getTable();
|
||||||
});
|
});
|
||||||
// watch(rowsAll, () => {
|
|
||||||
// props.statCard();
|
|
||||||
// });
|
|
||||||
// watchEffect(() => {
|
|
||||||
// if (getTable()) {
|
|
||||||
// props.statCard();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
const containStatus = ref<boolean>(false);
|
const containStatus = ref<boolean>(false);
|
||||||
watch(containStatus, () => {
|
watch(containStatus, () => {
|
||||||
// console.log("containStatus===>", containStatus.value);
|
|
||||||
if (containStatus.value) {
|
if (containStatus.value) {
|
||||||
rows.value = rowsAll.value.filter((x: any) => x.statusId == "CONTAIN");
|
rows.value = rowsAll.value.filter((x: any) => x.statusId == "CONTAIN");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -534,7 +506,6 @@ const savelist = () => {
|
||||||
personal_selected.value.push(e.personalId);
|
personal_selected.value.push(e.personalId);
|
||||||
});
|
});
|
||||||
if (personal_selected.value) {
|
if (personal_selected.value) {
|
||||||
// console.log(personal_selected.value);
|
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
|
|
@ -545,11 +516,10 @@ const savelist = () => {
|
||||||
success($q, "บันทึกสำเร็จ");
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
console.log(e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await getTable();
|
await getTable();
|
||||||
|
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -851,6 +821,7 @@ const pagination = ref({
|
||||||
:validate="validateData"
|
:validate="validateData"
|
||||||
/>
|
/>
|
||||||
</q-form>
|
</q-form>
|
||||||
|
|
||||||
<q-dialog v-model="modalDefermentDisclaim" persistent>
|
<q-dialog v-model="modalDefermentDisclaim" persistent>
|
||||||
<q-card style="width: 800px">
|
<q-card style="width: 800px">
|
||||||
<q-form ref="myForm">
|
<q-form ref="myForm">
|
||||||
|
|
@ -1005,14 +976,6 @@ const pagination = ref({
|
||||||
v-model="scope.selected"
|
v-model="scope.selected"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<!-- <template v-slot:body-selection="scope">
|
|
||||||
<q-checkbox
|
|
||||||
keep-color
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
v-model="scope.selected"
|
|
||||||
/>
|
|
||||||
</template> -->
|
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-td>
|
<q-td>
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||||
const { success, showLoader, hideLoader, date2Thai, modalConfirm } = mixin;
|
const { showLoader, hideLoader, date2Thai } = mixin;
|
||||||
const save = ref<boolean>(true);
|
const $q = useQuasar();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
Modal: Boolean,
|
Modal: Boolean,
|
||||||
|
|
@ -80,49 +80,12 @@ const myForm = ref<any>([]);
|
||||||
const personalForm = ref<any>([]);
|
const personalForm = ref<any>([]);
|
||||||
const selection = ref<any>([]);
|
const selection = ref<any>([]);
|
||||||
|
|
||||||
const $q = useQuasar();
|
|
||||||
|
|
||||||
function isRequired(val: any): boolean | string {
|
|
||||||
return !!val || "กรุณาเลือกไฟล์เอกสารหลักฐาน";
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
if (props.Modal === true) {
|
if (props.Modal === true) {
|
||||||
// console.log(props.getdetail);
|
|
||||||
fetchData();
|
fetchData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const validateData = () => {
|
|
||||||
const selectedIds = personalForm.value.isProperty;
|
|
||||||
|
|
||||||
const selectedItems = personalForm.value.isProperty.filter(
|
|
||||||
(item: any) => item.value === true
|
|
||||||
// selectedIds.includes(item.value)
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
selectedItems.length > 0 || selectedItems.length === selectedIds.length
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
// const ClickSave = () => {
|
|
||||||
// const isValid = validateData();
|
|
||||||
|
|
||||||
// if (isValid) {
|
|
||||||
// // props.close();
|
|
||||||
// // props.validate();
|
|
||||||
// // putpersonalForm();
|
|
||||||
// modalConfirm(
|
|
||||||
// $q,
|
|
||||||
// "การยืนยัน",
|
|
||||||
// "ยืนยันการบันทึกการคัดกรองคุณสมบัติ",
|
|
||||||
// putpersonalForm
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// success($q, "กรอกให้ครบ");
|
|
||||||
// console.log();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -164,24 +127,6 @@ const close = async () => {
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
};
|
};
|
||||||
const putpersonalForm = async () => {
|
|
||||||
props.close();
|
|
||||||
// await http
|
|
||||||
// .put(
|
|
||||||
// config.API.putProperty("0a846508-4932-40de-9a9e-5b519492217c"),
|
|
||||||
// personalForm.value.isProperty
|
|
||||||
// )
|
|
||||||
// .then((res) => {
|
|
||||||
// success($q, res.data.message);
|
|
||||||
// })
|
|
||||||
// .catch((e) => {
|
|
||||||
// console.log(e);
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// props.close();
|
|
||||||
// props.validate();
|
|
||||||
// });
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="props.Modal">
|
<q-dialog v-model="props.Modal">
|
||||||
|
|
@ -336,29 +281,7 @@ const putpersonalForm = async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="contanier-box-mini"> -->
|
|
||||||
<!-- <q-card bordered class="card-panding">
|
|
||||||
<div class="col-12 row items-center q-pa-sm header-text">
|
|
||||||
เอกสารเพิ่มเติม
|
|
||||||
</div> -->
|
|
||||||
<!-- <div v-for="(item, index) of personalForm.isProperty" :key="index" class="q-pa-sm">
|
|
||||||
<q-checkbox size="xs" v-model="item.value" :val="item.value" :label="item.name" keep-color color="teal"
|
|
||||||
:rules="[isRequired]" class="checkbox-group" />
|
|
||||||
<q-separator />
|
|
||||||
</div> -->
|
|
||||||
<!-- </q-card>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <q-separator />
|
|
||||||
<div>
|
|
||||||
<DialogFooter
|
|
||||||
@click="ClickSave"
|
|
||||||
:model="props.Modal"
|
|
||||||
:editvisible="save"
|
|
||||||
:validate="validateData"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue