โครงสร้างอัตรากำลัง => 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>
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@ function onSubmit() {
|
|||
level.value !== 0 ? formData.orgLevelSub : undefined,
|
||||
[nameId]: rootId,
|
||||
};
|
||||
console.log(body);
|
||||
|
||||
if (actionType.value === "ADD") {
|
||||
await http
|
||||
|
|
@ -375,7 +374,6 @@ function selectOrgLevele(val: string, status: boolean = true) {
|
|||
for="#ocNo"
|
||||
:label="level == 0 ? 'รหัสหน่วยงาน' : 'รหัสส่วนราชการ'"
|
||||
hide-bottom-space
|
||||
class="inputNumber"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
|
|
@ -482,14 +480,4 @@ function selectOrgLevele(val: string, status: boolean = true) {
|
|||
</template>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.inputNumber >>> input[type="number"] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.inputNumber >>> input::-webkit-outer-spin-button,
|
||||
.inputNumber >>> input::-webkit-inner-spin-button {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -544,8 +544,6 @@ watch(
|
|||
);
|
||||
|
||||
async function addPosition(data: RowDetailPositions) {
|
||||
console.log(data);
|
||||
|
||||
const isIdExist = await rows.value.some(
|
||||
(item: any) =>
|
||||
item.posExecutiveId == data.posExecutiveId &&
|
||||
|
|
@ -817,7 +815,7 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
|||
flat
|
||||
round
|
||||
color="teal"
|
||||
@click="() => (modalAdd = true)"
|
||||
@click="() => ((modalAdd = true), (dataCopy = null))"
|
||||
><q-tooltip>สร้างตำแหน่ง</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue