no message
This commit is contained in:
parent
dc05b4740c
commit
cf343f7b8f
19 changed files with 2595 additions and 2416 deletions
|
|
@ -5,11 +5,12 @@
|
|||
header="ข้อมูลครอบครัว"
|
||||
icon="mdi-account-group"
|
||||
:save="saveData"
|
||||
:history="true"
|
||||
:history="!statusAdd()"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="refreshData"
|
||||
:historyClick="historyData"
|
||||
:addEmployee="statusAdd()"
|
||||
/>
|
||||
<q-form ref="myform" class="col-12">
|
||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
|
|
@ -1114,6 +1115,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -1171,8 +1176,43 @@ onMounted(async () => {
|
|||
await fetchPrefix();
|
||||
await fetchData();
|
||||
emit("update:statusEdit", false);
|
||||
defaultAdd();
|
||||
});
|
||||
|
||||
const statusAdd = () => props.statusAdd;
|
||||
|
||||
const defaultAdd = () => {
|
||||
if (props.statusAdd) {
|
||||
edit.value = props.statusAdd;
|
||||
familyData.value = {
|
||||
prefixC: null,
|
||||
prefixIdC: null,
|
||||
firstnameC: null,
|
||||
lastnameC: null,
|
||||
lastnameCOld: null,
|
||||
occupationC: null,
|
||||
citizenIdC: null,
|
||||
liveC: null,
|
||||
prefixM: null,
|
||||
prefixIdM: null,
|
||||
firstnameM: null,
|
||||
lastnameM: null,
|
||||
occupationM: null,
|
||||
citizenIdM: null,
|
||||
liveM: null,
|
||||
prefixF: null,
|
||||
prefixIdF: null,
|
||||
firstnameF: null,
|
||||
lastnameF: null,
|
||||
occupationF: null,
|
||||
citizenIdF: null,
|
||||
liveF: null,
|
||||
same: "0",
|
||||
childrens: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const historyData = async () => {
|
||||
await fetchHistory();
|
||||
};
|
||||
|
|
@ -1400,10 +1440,32 @@ const editData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .put(config.API.profileInforId(route.params.id.toString()), body)
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// edit.value = false;
|
||||
// emit("update:statusEdit", false);
|
||||
// await fetchData();
|
||||
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
// });
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
await myform.value?.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
await editData();
|
||||
if (props.statusAdd) {
|
||||
await addData();
|
||||
} else {
|
||||
await editData();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue