โครงสร้างอัตรากำลัง => fix bug
This commit is contained in:
parent
ed9eff4685
commit
436fcad411
3 changed files with 27 additions and 34 deletions
|
|
@ -92,23 +92,23 @@ const objectPositionSelectRef: FormPositionSelectRef = {
|
|||
/** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */
|
||||
function validateFormPositionEdit() {
|
||||
isDisValidate.value = false;
|
||||
const hasError = [];
|
||||
for (const key in objectPositionSelectRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(objectPositionSelectRef, key)) {
|
||||
const property = objectPositionSelectRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
if (isEditCheck.value == true) {
|
||||
saveSelectEdit();
|
||||
} else {
|
||||
onSubmitSelectEdit();
|
||||
}
|
||||
// const hasError = [];
|
||||
// for (const key in objectPositionSelectRef) {
|
||||
// if (Object.prototype.hasOwnProperty.call(objectPositionSelectRef, key)) {
|
||||
// const property = objectPositionSelectRef[key];
|
||||
// if (property.value && typeof property.value.validate === "function") {
|
||||
// const isValid = property.value.validate();
|
||||
// hasError.push(isValid);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (hasError.every((result) => result === true)) {
|
||||
if (isEditCheck.value == true) {
|
||||
saveSelectEdit();
|
||||
} else {
|
||||
onSubmitSelectEdit();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
function saveSelectEdit() {
|
||||
|
|
@ -313,6 +313,8 @@ watch(
|
|||
if (modal.value === true) {
|
||||
await fetchType();
|
||||
await fetchExecutive();
|
||||
console.log(props.data);
|
||||
|
||||
if (props.data) {
|
||||
const dataList = props.data;
|
||||
console.log(dataList);
|
||||
|
|
@ -342,7 +344,12 @@ watch(
|
|||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-none">
|
||||
<form @submit.prevent="validateFormPositionEdit">
|
||||
<q-form
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="validateFormPositionEdit"
|
||||
>
|
||||
<!-- @submit.prevent="validateFormPositionEdit" -->
|
||||
<div class="row q-col-gutter-sm col-12 q-pa-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
|
|
@ -517,7 +524,7 @@ watch(
|
|||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</form>
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue