ปรับ form เพิ่มกรรมการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-15 13:06:25 +07:00
parent 53cd8e593c
commit 7a39d4fccd
2 changed files with 8 additions and 14 deletions

View file

@ -1,15 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, reactive } from "vue"; import { onMounted, ref, reactive } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router"; import { useRoute } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
/** importType*/ /** importType*/
import type { import type { FormCommand } from "@/modules/12_evaluatePersonal/interface/index/evalute";
FormCommand,
FormCommandRef,
} from "@/modules/12_evaluatePersonal/interface/index/evalute";
/** importComponents*/ /** importComponents*/
import Stepper from "@/modules/12_evaluatePersonal/components/Detail/Stepper.vue"; import Stepper from "@/modules/12_evaluatePersonal/components/Detail/Stepper.vue";

View file

@ -67,23 +67,22 @@ watch(props.data, async () => {
formData.position = props.data.position; formData.position = props.data.position;
formData.phone = props.data.phone; formData.phone = props.data.phone;
formData.email = props.data.email; formData.email = props.data.email;
}); });
/** /**
* เพมบคลากร * เพมบคลากร
*/ */
function addEmployee() { function addEmployee() {
if (idCard.value.length === 13) { showLoader();
if (idCard.value.length === 17) {
console.log("idCard===>", idCard.value); console.log("idCard===>", idCard.value);
showLoader();
http http
.post(config.API.profileSearchPersonal(), { .post(config.API.profileSearchPersonal(), {
fieldName: "idcard", fieldName: "idcard",
keyword: idCard.value, keyword: idCard.value,
}) })
.then((res) => { .then((res) => {
console.log(res) console.log(res);
const dataApi = res.data.result; const dataApi = res.data.result;
if (dataApi.length > 0) { if (dataApi.length > 0) {
const dataList = dataApi[0]; const dataList = dataApi[0];
@ -104,12 +103,9 @@ function addEmployee() {
.finally(async () => { .finally(async () => {
hideLoader(); hideLoader();
}); });
}
if (idCard.value.length !== 13) {
hideLoader();
dialogMessageNotify($q, "กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก");
} else { } else {
console.log("nodata"); dialogMessageNotify($q, "กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก");
hideLoader();
} }
} }
@ -183,6 +179,7 @@ function inputEdit(val: boolean) {
ref="idCardRef" ref="idCardRef"
for="idCardRef" for="idCardRef"
hide-bottom-space hide-bottom-space
mask="#-####-#####-##-#"
:rules="[(val: string) => !!val || `${'กรุณากรอกรหัสบัตรประชาชน'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอกรหัสบัตรประชาชน'}`]"
/> />
</div> </div>