บรรจุ แต่งตั้ง ย้าย โอน => ปรับ code และ load
This commit is contained in:
parent
9f4aeec575
commit
34dc306288
30 changed files with 1154 additions and 1429 deletions
|
|
@ -56,21 +56,19 @@ const onEdit = ref<boolean>(false);
|
|||
const myform = ref<QForm | null>(null);
|
||||
const familyData = ref<Family>(props.data);
|
||||
|
||||
|
||||
|
||||
function checkEdit() {
|
||||
onEdit.value = true;
|
||||
}
|
||||
|
||||
function filterSelector(val: any, update: Function, refData: string){
|
||||
function filterSelector(val: any, update: Function, refData: string) {
|
||||
update(() => {
|
||||
props.Ops[`${refData}`] = props.OpsFilter[`${refData}`].filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
async function refreshData(){
|
||||
async function refreshData() {
|
||||
if (myform.value != null) {
|
||||
myform.value.reset();
|
||||
}
|
||||
|
|
@ -89,31 +87,11 @@ async function refreshData(){
|
|||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function editData(){
|
||||
async function editData() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
// const body: ResponseObject = {
|
||||
// couple: familyData.value.couple == "1",
|
||||
// couplePrefixId: familyData.value.marryPrefixId,
|
||||
// coupleFirstName: familyData.value.marryFirstName,
|
||||
// coupleLastName: familyData.value.marryLastName,
|
||||
// coupleLastNameOld: familyData.value.lastnameCOld,
|
||||
// coupleCareer: familyData.value.marryOccupation,
|
||||
// fatherPrefixId: familyData.value.fatherPrefixId,
|
||||
// fatherFirstName: familyData.value.fatherFirstName,
|
||||
// fatherLastName: familyData.value.fatherLastName,
|
||||
// fatherCareer: familyData.value.fatherOccupation,
|
||||
// motherPrefixId: familyData.value.motherPrefixId,
|
||||
// motherFirstName: familyData.value.motherFirstName,
|
||||
// motherLastName: familyData.value.motherLastName,
|
||||
// motherCareer: familyData.value.motherOccupation,
|
||||
// // childrens: familyData.value.childrens,
|
||||
// createdFullName: "-",
|
||||
// createdAt: new Date(),
|
||||
// };
|
||||
|
||||
const body = {
|
||||
couple: familyData.value.couple == "1",
|
||||
couplePrefix: familyData.value.marryPrefixId,
|
||||
|
|
@ -135,31 +113,30 @@ async function editData(){
|
|||
config.API.placementFamilyId(route.params.personalId.toString()),
|
||||
body
|
||||
)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch("Family");
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch("Family");
|
||||
});
|
||||
})
|
||||
.finally(async () => {});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
async function saveData(){
|
||||
async function saveData() {
|
||||
await myform.value?.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
await editData();
|
||||
} else {
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function selectRadio(e: boolean, i: any){
|
||||
function selectRadio(e: boolean, i: any) {
|
||||
onEdit.value = true;
|
||||
if (e) {
|
||||
familyData.value.marryPrefixId = "";
|
||||
|
|
@ -168,9 +145,9 @@ function selectRadio(e: boolean, i: any){
|
|||
// familyData.value.lastnameCOld = "";
|
||||
familyData.value.marryOccupation = "";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function changeBtn(){
|
||||
async function changeBtn() {
|
||||
if (edit.value == true) {
|
||||
if (props.statusEdit === true) {
|
||||
props.notiNoEdit();
|
||||
|
|
@ -180,14 +157,14 @@ async function changeBtn(){
|
|||
} else {
|
||||
emit("update:statusEdit", false);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getClass(val: boolean){
|
||||
function getClass(val: boolean) {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
emit("update:statusEdit", false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue