ปรับ dialog บรรจุ
This commit is contained in:
parent
508fb3b02b
commit
1881aa1b2f
23 changed files with 1064 additions and 1072 deletions
|
|
@ -20,7 +20,7 @@ const checkSelected = computed(() => {
|
|||
return true;
|
||||
}
|
||||
});
|
||||
const firstName = ref<string>("")
|
||||
const firstName = ref<string>("");
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
|
@ -32,9 +32,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogMessage,
|
||||
|
||||
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -259,16 +257,18 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
|
||||
//--------------(ปุ่มลบ)----------------//
|
||||
|
||||
const openDetail = (id:string) => {
|
||||
router.push(`/help-government/detail/${id}`)
|
||||
}
|
||||
const openDetail = (id: string) => {
|
||||
router.push(`/help-government/detail/${id}`);
|
||||
};
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => (modal.value = false);
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = rows.value.filter(
|
||||
(item: officerType) =>
|
||||
item.status == "WAITTING" || item.status == "PENDING" || item.status == "APPROVE"
|
||||
item.status == "WAITTING" ||
|
||||
item.status == "PENDING" ||
|
||||
item.status == "APPROVE"
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
|
@ -281,7 +281,7 @@ const getData = async () => {
|
|||
console.log("data==>", data);
|
||||
rows.value = data.map((item: officerType) => ({
|
||||
id: item.id,
|
||||
fullname:`${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
fullname: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
position: item.position,
|
||||
posNo: item.posNo,
|
||||
positionLevel: item.positionLevel,
|
||||
|
|
@ -289,7 +289,7 @@ const getData = async () => {
|
|||
organization: item.organization,
|
||||
reason: item.reason,
|
||||
status: item.status,
|
||||
statusText:statusText(item.status),
|
||||
statusText: statusText(item.status),
|
||||
date: item.date,
|
||||
salary: item.salary,
|
||||
positionTypeOld: item.positionTypeOld,
|
||||
|
|
@ -297,9 +297,8 @@ const getData = async () => {
|
|||
positionNumberOld: item.positionNumberOld,
|
||||
organizationPositionOld: item.organizationPositionOld,
|
||||
isActive: item.isActive,
|
||||
})
|
||||
);
|
||||
console.log(rows.value )
|
||||
}));
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
|
|
@ -331,35 +330,23 @@ const saveOrder = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
const deleteData = async (id:string) => {
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.officerMainDelete(id))
|
||||
.then((res)=>{
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
}
|
||||
.delete(config.API.officerMainDelete(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const clickDelete = async (name:string,id:string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
`ลบข้อมูลของ ${name}`,
|
||||
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
||||
"delete",
|
||||
"ยืนยัน",
|
||||
"red",
|
||||
async () => await deleteData(id)
|
||||
,
|
||||
async () => await getData()
|
||||
|
||||
);
|
||||
const clickDelete = async (name: string, id: string) => {
|
||||
dialogRemove($q, async () => await deleteData(id));
|
||||
};
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
|
|
@ -442,26 +429,50 @@ onMounted(async () => {
|
|||
<q-td key="no" :props="props" @click="openDetail(props.row.id)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="position"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
<q-td key="positionLevel" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="positionLevel"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.positionLevel }}
|
||||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="organizationPositionOld"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="organization"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props" @click="openDetail(props.row.id)">
|
||||
<q-td
|
||||
key="statusText"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.statusText }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
|
|
@ -472,9 +483,9 @@ onMounted(async () => {
|
|||
flat
|
||||
round
|
||||
dense
|
||||
@click="clickDelete(props.row.fullname,props.row.id)"
|
||||
@click="clickDelete(props.row.fullname, props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
@ -581,13 +592,13 @@ onMounted(async () => {
|
|||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props">
|
||||
{{ props.row.statusText }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue