โครงสร้างอัตรากำลัง => 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() {
|
function validateFormPositionEdit() {
|
||||||
isDisValidate.value = false;
|
isDisValidate.value = false;
|
||||||
const hasError = [];
|
// const hasError = [];
|
||||||
for (const key in objectPositionSelectRef) {
|
// for (const key in objectPositionSelectRef) {
|
||||||
if (Object.prototype.hasOwnProperty.call(objectPositionSelectRef, key)) {
|
// if (Object.prototype.hasOwnProperty.call(objectPositionSelectRef, key)) {
|
||||||
const property = objectPositionSelectRef[key];
|
// const property = objectPositionSelectRef[key];
|
||||||
if (property.value && typeof property.value.validate === "function") {
|
// if (property.value && typeof property.value.validate === "function") {
|
||||||
const isValid = property.value.validate();
|
// const isValid = property.value.validate();
|
||||||
hasError.push(isValid);
|
// hasError.push(isValid);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (hasError.every((result) => result === true)) {
|
// if (hasError.every((result) => result === true)) {
|
||||||
if (isEditCheck.value == true) {
|
if (isEditCheck.value == true) {
|
||||||
saveSelectEdit();
|
saveSelectEdit();
|
||||||
} else {
|
} else {
|
||||||
onSubmitSelectEdit();
|
onSubmitSelectEdit();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveSelectEdit() {
|
function saveSelectEdit() {
|
||||||
|
|
@ -313,6 +313,8 @@ watch(
|
||||||
if (modal.value === true) {
|
if (modal.value === true) {
|
||||||
await fetchType();
|
await fetchType();
|
||||||
await fetchExecutive();
|
await fetchExecutive();
|
||||||
|
console.log(props.data);
|
||||||
|
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
const dataList = props.data;
|
const dataList = props.data;
|
||||||
console.log(dataList);
|
console.log(dataList);
|
||||||
|
|
@ -342,7 +344,12 @@ watch(
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-card-section class="q-pa-none">
|
<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="row q-col-gutter-sm col-12 q-pa-sm">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -517,7 +524,7 @@ watch(
|
||||||
color="public"
|
color="public"
|
||||||
/>
|
/>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</form>
|
</q-form>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,6 @@ function onSubmit() {
|
||||||
level.value !== 0 ? formData.orgLevelSub : undefined,
|
level.value !== 0 ? formData.orgLevelSub : undefined,
|
||||||
[nameId]: rootId,
|
[nameId]: rootId,
|
||||||
};
|
};
|
||||||
console.log(body);
|
|
||||||
|
|
||||||
if (actionType.value === "ADD") {
|
if (actionType.value === "ADD") {
|
||||||
await http
|
await http
|
||||||
|
|
@ -375,7 +374,6 @@ function selectOrgLevele(val: string, status: boolean = true) {
|
||||||
for="#ocNo"
|
for="#ocNo"
|
||||||
:label="level == 0 ? 'รหัสหน่วยงาน' : 'รหัสส่วนราชการ'"
|
:label="level == 0 ? 'รหัสหน่วยงาน' : 'รหัสส่วนราชการ'"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
class="inputNumber"
|
|
||||||
:rules="[
|
:rules="[
|
||||||
(val) =>
|
(val) =>
|
||||||
!!val ||
|
!!val ||
|
||||||
|
|
@ -482,14 +480,4 @@ function selectOrgLevele(val: string, status: boolean = true) {
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
.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>
|
|
||||||
|
|
|
||||||
|
|
@ -544,8 +544,6 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
async function addPosition(data: RowDetailPositions) {
|
async function addPosition(data: RowDetailPositions) {
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
const isIdExist = await rows.value.some(
|
const isIdExist = await rows.value.some(
|
||||||
(item: any) =>
|
(item: any) =>
|
||||||
item.posExecutiveId == data.posExecutiveId &&
|
item.posExecutiveId == data.posExecutiveId &&
|
||||||
|
|
@ -817,7 +815,7 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="teal"
|
color="teal"
|
||||||
@click="() => (modalAdd = true)"
|
@click="() => ((modalAdd = true), (dataCopy = null))"
|
||||||
><q-tooltip>สร้างตำแหน่ง</q-tooltip></q-btn
|
><q-tooltip>สร้างตำแหน่ง</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue