API คนครอง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-08 18:06:14 +07:00
parent 21e1249d4c
commit b853b4e7d6
3 changed files with 167 additions and 136 deletions

View file

@ -322,23 +322,27 @@ function openSelectPerson(data: DataPosition[]) {
}
/** ลบคนครอง */
function removePerson(data: DataPosition[]) {
function removePerson(id: string) {
dialogRemove(
$q,
async () => {
showLoader();
// await http
// .delete(config.API.orgPosMasterById(id))
// .then(() => {
// success($q, "");
// props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
hideLoader();
// });
await http
.post(config.API.orgDeleteProfile(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.(
reqMaster.value.id,
reqMaster.value.type,
false
);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการลบคนครอง",
"ต้องการยืนยันการลบคนครองนี้ใช่หรือไม่?"
@ -520,7 +524,7 @@ function removePerson(data: DataPosition[]) {
"
clickable
v-close-popup
@click="removePerson(props.row)"
@click="removePerson(props.row.id)"
>
<q-item-section>
<div class="row items-center">
@ -678,6 +682,7 @@ function removePerson(data: DataPosition[]) {
<DialogSelectPerson
v-model:modal="modalSelectPerson"
:dataDetailPos="dataDetailPos"
:fetchDataTable="props.fetchDataTable"
/>
</template>