| @@ -2,7 +2,9 @@ | |||
| import { | |||
| Typography, | |||
| } from '@mui/material'; | |||
| import { | |||
| isORGLoggedIn, | |||
| } from "utils/Utils"; | |||
| import * as React from 'react'; | |||
| import * as FormatUtils from "utils/FormatUtils" | |||
| import { FiDataGrid } from "components/FiDataGrid"; | |||
| @@ -26,11 +28,12 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
| { | |||
| id: 'appNo', | |||
| field: 'appNo', | |||
| headerName: '申請編號/我的備註', | |||
| headerName: isORGLoggedIn()?'申請編號/Care Of/我的備註':'申請編號/我的備註', | |||
| flex: 1, | |||
| renderCell: (params) => { | |||
| let appNo = params.row.appNo; | |||
| return <div style={{ margin: 4 }}>{appNo}<br/>{params.row.remarks}</div> | |||
| console.log(params) | |||
| return <div style={{ margin: 4 }}>{appNo}<br/>{isORGLoggedIn()?<>{params.row.careOf}<br /></>:null}{params.row.remarks}</div> | |||
| }, | |||
| }, | |||
| { | |||
| @@ -8,6 +8,9 @@ import * as FormatUtils from "utils/FormatUtils" | |||
| import * as ProofStatus from "utils/statusUtils/ProofStatus"; | |||
| import { useNavigate } from "react-router-dom"; | |||
| import { FiDataGrid } from "components/FiDataGrid"; | |||
| import { | |||
| isORGLoggedIn, | |||
| } from "utils/Utils"; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function SearchPublicNoticeTable({ recordList }) { | |||
| @@ -69,17 +72,18 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
| { | |||
| id: 'appId', | |||
| field: 'appId', | |||
| headerName: '申請編號 / 憲報期數 / 我的備註', | |||
| headerName: isORGLoggedIn()?"憲報期數 / Care Of/ 我的備註":"憲報期數 / 我的備註", | |||
| flex: 1, | |||
| renderCell: (params) => { | |||
| let appNo = params.row.appNo; | |||
| // let appNo = params.row.appNo; | |||
| // let code = params.row.groupNo; | |||
| let isssue = params.row.issueYear | |||
| + " Vol. " + FormatUtils.zeroPad(params.row.issueVolume, 3) | |||
| + ", No. " + FormatUtils.zeroPad(params.row.issueNo, 2) | |||
| + ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); | |||
| return <div style={{ margin: 4 }}>{appNo}<br />{isssue}<br />{params.row.appRemarks}</div> | |||
| // return <div style={{ margin: 4 }}>{appNo}<br />{isssue}<br />{params.row.appRemarks}</div> | |||
| return <div style={{ margin: 4 }}>{isssue}<br />{isORGLoggedIn()?<>{params.row.appCareOf}<br /></>:null}{params.row.appRemarks}</div> | |||
| }, | |||
| }, | |||
| { | |||
| @@ -15,6 +15,9 @@ import * as UrlUtils from "utils/ApiPathConst"; | |||
| import * as FieldUtils from "utils/FieldUtils"; | |||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | |||
| import ForwardIcon from '@mui/icons-material/Forward'; | |||
| import { | |||
| isORGLoggedIn, | |||
| } from "utils/Utils"; | |||
| import { useNavigate } from "react-router-dom"; | |||
| import { notifyActionSuccess } from 'utils/CommonFunction'; | |||
| @@ -38,7 +41,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||
| backgroundColor: '#0C489E', | |||
| backgroundPosition: 'right' | |||
| } | |||
| // React.useEffect(()=>{ | |||
| // loadedData.careOf = loadedData.contactPerson | |||
| // },[]); | |||
| @@ -225,14 +228,16 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||
| {FieldUtils.getTextField({ | |||
| label: "代理人:", | |||
| valueName: "careOf", | |||
| form: formik, | |||
| // disabled: true | |||
| })} | |||
| </Grid> | |||
| {isORGLoggedIn()? | |||
| <Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Care Of:", | |||
| valueName: "careOf", | |||
| form: formik, | |||
| // disabled: true | |||
| })} | |||
| </Grid>:null | |||
| } | |||
| <Grid item xs={12} md={12} lg={12}> | |||
| {FieldUtils.getTextArea({ | |||
| label: "備註:", | |||
| @@ -513,6 +513,19 @@ const ApplicationDetailCard = ( | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| {currentApplicationDetailData.orgId === null ? null: | |||
| <Grid item xs={12} md={6} lg={6} sx={{ mb: 1, paddingTop: 2 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel><Typography variant="h5">Care Of:</Typography></FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <Typography variant="h5">{currentApplicationDetailData.careOf}</Typography> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| } | |||
| <Grid item xs={12} md={6} lg={6} sx={{ mb: 1, paddingTop: 2 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| @@ -2,12 +2,15 @@ | |||
| import * as React from 'react'; | |||
| import {FiDataGrid} from "components/FiDataGrid"; | |||
| import { | |||
| Button | |||
| Button, | |||
| Typography | |||
| } from '@mui/material'; | |||
| import * as DateUtils from "utils/DateUtils" | |||
| import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; | |||
| import {useNavigate} from "react-router-dom"; | |||
| import { | |||
| isORGLoggedIn, | |||
| } from "utils/Utils"; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function BaseGrid({rows}) { | |||
| @@ -17,6 +20,8 @@ export default function BaseGrid({rows}) { | |||
| navigate('/publicNotice/'+ params.id); | |||
| }; | |||
| // const remarkHeadername = rows.orgId===null?"我的備註":"Care Of / 我的備註" | |||
| const columns = [ | |||
| { | |||
| id: 'appNo', | |||
| @@ -62,8 +67,18 @@ export default function BaseGrid({rows}) { | |||
| { | |||
| id: 'remarks', | |||
| field: 'remarks', | |||
| headerName: '我的備註', | |||
| headerName: isORGLoggedIn()?"Care Of / 我的備註":"我的備註", | |||
| flex: 3, | |||
| renderCell: (params) => ( | |||
| params.row.orgId === null? | |||
| <div> | |||
| <Typography>{params.row.remarks}</Typography> | |||
| </div>: | |||
| <div> | |||
| <Typography>Care Of: {params.row.careOf}</Typography> | |||
| <Typography>我的備註: {params.row.remarks}</Typography> | |||
| </div> | |||
| ) | |||
| }, | |||
| { | |||
| id: 'status', | |||
| @@ -11,11 +11,15 @@ import * as DateUtils from "utils/DateUtils" | |||
| import * as FormatUtils from "utils/FormatUtils" | |||
| import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; | |||
| import { useNavigate } from "react-router-dom"; | |||
| import { | |||
| isORGLoggedIn, | |||
| } from "utils/Utils"; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function SubmittedTab({ rows }) { | |||
| const [selectedRowItems, setSelectedRowItems] = React.useState([]); | |||
| const [isPopUp, setIsPopUp] = React.useState(false); | |||
| const [checkCareOf, setCheckCareOf] = React.useState(false); | |||
| //const [amount, setAmount] = React.useState(0); | |||
| const navigate = useNavigate() | |||
| @@ -68,9 +72,18 @@ export default function SubmittedTab({ rows }) { | |||
| { | |||
| id: 'remarks', | |||
| field: 'remarks', | |||
| headerName: '我的備註', | |||
| headerName: isORGLoggedIn()?"Care Of / 我的備註":"我的備註", | |||
| flex: 3, | |||
| renderCell: (params) => ( | |||
| params.row.orgId === null? | |||
| <div> | |||
| <Typography>{params.row.remarks}</Typography> | |||
| </div>: | |||
| <div> | |||
| <Typography>Care Of: {params.row.careOf}</Typography> | |||
| <Typography>我的備註: {params.row.remarks}</Typography> | |||
| </div> | |||
| ) | |||
| }, | |||
| { | |||
| id: 'fee', | |||
| @@ -135,11 +148,23 @@ export default function SubmittedTab({ rows }) { | |||
| const datas = rows?.filter((row) => | |||
| selectedRowItems.includes(row.id) | |||
| ); | |||
| console.log(datas) | |||
| for (var i = 0; i < datas?.length; i++) { | |||
| totalAmount += datas[i].fee; | |||
| appIdList.push(datas[i].id); | |||
| } | |||
| navigate('/paymentPage', { state: { amount: totalAmount, appIdList: appIdList } }); | |||
| console.log(appIdList) | |||
| console.log(totalAmount) | |||
| const firstCareOf = datas[0].careOf; | |||
| const areAllCareOfEqual = datas.every(obj => obj.careOf === firstCareOf); | |||
| if (appIdList.length>0&&areAllCareOfEqual){ | |||
| navigate('/paymentPage', { state: { amount: totalAmount, appIdList: appIdList } }); | |||
| }else{ | |||
| setCheckCareOf(true); | |||
| console.log("The selected applications should be from the same Care of.") | |||
| } | |||
| } | |||
| return ( | |||
| @@ -180,6 +205,23 @@ export default function SubmittedTab({ rows }) { | |||
| </DialogActions> | |||
| </Dialog> | |||
| </div> | |||
| <div> | |||
| <Dialog open={checkCareOf} onClose={() => setCheckCareOf(false)} > | |||
| <DialogTitle></DialogTitle> | |||
| {/* <Typography variant="h2" style={{ padding: '16px' }}>確認付款</Typography> */} | |||
| <DialogContent style={{ display: 'flex', }}> | |||
| <Stack direction="column" justifyContent="space-between"> | |||
| <Typography variant="h5" color="error"> | |||
| The selected applications should be from the same Care of. | |||
| </Typography> | |||
| </Stack> | |||
| </DialogContent> | |||
| <DialogActions> | |||
| <Button onClick={() => setCheckCareOf(false)}><Typography variant="h5">確認</Typography></Button> | |||
| </DialogActions> | |||
| </Dialog> | |||
| </div> | |||
| </> | |||
| ); | |||
| @@ -11,6 +11,9 @@ import { useForm } from "react-hook-form"; | |||
| import * as React from "react"; | |||
| import * as ComboData from "utils/ComboData"; | |||
| import * as DateUtils from "utils/DateUtils"; | |||
| import { | |||
| isORGLoggedIn, | |||
| } from "utils/Utils"; | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| @@ -37,6 +40,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||
| dateFrom: data.dateFrom, | |||
| dateTo: data.dateTo, | |||
| contact: data.contact, | |||
| careOf: data.careOf?data.careOf:"", | |||
| status: (data.status === "" || data.status.includes('all')) ? "" : data.status, | |||
| }; | |||
| applySearch(temp); | |||
| @@ -111,6 +115,20 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||
| }} | |||
| /> | |||
| </Grid> | |||
| {isORGLoggedIn()? | |||
| <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||
| <TextField | |||
| fullWidth | |||
| {...register("careOf")} | |||
| id="careOf" | |||
| label="Care Of" | |||
| defaultValue={searchCriteria.careOf} | |||
| InputLabelProps={{ | |||
| shrink: true | |||
| }} | |||
| /> | |||
| </Grid>:null | |||
| } | |||
| <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||
| <TextField | |||
| @@ -1,12 +1,16 @@ | |||
| // material-ui | |||
| import * as React from 'react'; | |||
| import { | |||
| Button | |||
| Button, | |||
| Typography | |||
| } from '@mui/material'; | |||
| import * as DateUtils from "utils/DateUtils"; | |||
| import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; | |||
| import {useNavigate} from "react-router-dom"; | |||
| import {FiDataGrid} from "components/FiDataGrid"; | |||
| import { | |||
| isORGLoggedIn, | |||
| } from "utils/Utils"; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function SearchPublicNoticeTable({ recordList }) { | |||
| @@ -66,8 +70,18 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
| { | |||
| id: 'remarks', | |||
| field: 'remarks', | |||
| headerName: '我的備註', | |||
| headerName: isORGLoggedIn()?"Care Of / 我的備註":"我的備註", | |||
| flex: 3, | |||
| renderCell: (params) => ( | |||
| params.row.orgId === null? | |||
| <div> | |||
| <Typography>{params.row.remarks}</Typography> | |||
| </div>: | |||
| <div> | |||
| <Typography>Care Of: {params.row.careOf}</Typography> | |||
| <Typography>我的備註: {params.row.remarks}</Typography> | |||
| </div> | |||
| ) | |||
| }, | |||
| { | |||
| id: 'status', | |||