update เกษียณ + ปิด route หน้ารายละเอียดถึงแก่กรรม
This commit is contained in:
parent
d08b3625f3
commit
97b5e63813
4 changed files with 36 additions and 39 deletions
|
|
@ -16,7 +16,10 @@ const id = route.params.id;
|
|||
const props = defineProps({
|
||||
retireld: String,
|
||||
listId: String,
|
||||
UpdateListId: Function,
|
||||
UpdateListId: {
|
||||
type: Function,
|
||||
default: () => console.log("UpdateListId"),
|
||||
},
|
||||
});
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -125,11 +128,8 @@ watch(modal, () => {
|
|||
fecthlistRetire();
|
||||
}
|
||||
});
|
||||
const updateListId = (val: any) => {
|
||||
listId.value = val;
|
||||
if (props.UpdateListId) {
|
||||
props.UpdateListId(listId.value);
|
||||
}
|
||||
const updateListData = (retireld: string, pId: string) => {
|
||||
props.UpdateListId(retireld, pId);
|
||||
};
|
||||
const fecthlistRetire = async () => {
|
||||
showLoader();
|
||||
|
|
@ -199,12 +199,12 @@ const clickAdd = (props: any) => {
|
|||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
console.log("เพิ่มข้อมูล");
|
||||
// console.log("เพิ่มข้อมูล");
|
||||
await http
|
||||
.put(config.API.profileRetire(retireld.value), { profileId: data })
|
||||
.then((res) => {
|
||||
success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||
updateListId(data);
|
||||
updateListData(retireld.value, data);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue