add member link document

This commit is contained in:
2024-02-12 12:14:53 +07:00
parent 98f5d04b4d
commit ef1b3d1301
3 changed files with 23 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ class MemberAlarmCenterResources extends JsonResource
'id' => $this->id, 'id' => $this->id,
'personId' => $this->person_id, 'personId' => $this->person_id,
'memberId' => $this->member_id, 'memberId' => $this->member_id,
'link_document' => $this->link_document,
'fullName' => $this->full_name, 'fullName' => $this->full_name,
'service' => $this->service_code, 'service' => $this->service_code,
'start_date' => $this->members_effective_date, 'start_date' => $this->members_effective_date,

View File

@@ -255,6 +255,7 @@ class CorporateMemberService
'members.members_effective_date', // Use the actual property name 'members.members_effective_date', // Use the actual property name
'members.members_expire_date', // Use the actual property name 'members.members_expire_date', // Use the actual property name
'members.active', 'members.active',
'members.link_document',
'request_logs.service_code', 'request_logs.service_code',
]) ])
// ->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`") // ->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")

View File

@@ -18,6 +18,7 @@ import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
import { enqueueSnackbar } from 'notistack'; import { enqueueSnackbar } from 'notistack';
import Label from '../../components/Label'; import Label from '../../components/Label';
import { Stack } from '@mui/material'; import { Stack } from '@mui/material';
import { Download } from '@mui/icons-material';
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
@@ -28,6 +29,11 @@ export default function List() {
const [data, setData] = useState([]); const [data, setData] = useState([]);
// Fungsi handleDocumentClick untuk menangani klik pada tautan dokumen
const handleDocumentClick = (link : string) => {
window.open(link, '_blank');
};
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* setting up for the table */ /* setting up for the table */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
@@ -190,6 +196,10 @@ export default function List() {
handleEndDateChange: handleEndDateChanges, handleEndDateChange: handleEndDateChanges,
}; };
const handleDownload = {
}
/* -------------------------------- handle export --------------------------- */ /* -------------------------------- handle export --------------------------- */
const handleExportReport = async () => { const handleExportReport = async () => {
@@ -292,15 +302,20 @@ export default function List() {
end_date: <Label> {fDateSuffix(obj.end_date)}</Label>, end_date: <Label> {fDateSuffix(obj.end_date)}</Label>,
action: ( action: (
<TableMoreMenu <TableMoreMenu
actions={ actions={
<> <>
<MenuItem onClick={() => navigate('member/' + obj.id)}> <MenuItem onClick={() => navigate('member/' + obj.id)}>
<VisibilityOutlinedIcon /> <VisibilityOutlinedIcon />
View View
</MenuItem> </MenuItem>
<MenuItem onClick={() => handleDocumentClick(obj.link_document)}>
<Download />
Document Member
</MenuItem>
</> </>
} }
/> />
), ),
})) }))
); );