소스 검색

update ui and combo

master
Anna Ho 1 년 전
부모
커밋
3f565e5fba
10개의 변경된 파일250개의 추가작업 그리고 306개의 파일을 삭제
  1. +6
    -6
      src/components/FileList.js
  2. +15
    -14
      src/pages/ProofReply_Public/ApplicationDetails.js
  3. +105
    -83
      src/pages/ProofReply_Public/ProofForm.js
  4. +52
    -41
      src/pages/ProofReply_Public/index.js
  5. +30
    -47
      src/pages/ProofSearch_Public/DataGrid.js
  6. +11
    -48
      src/pages/ProofSearch_Public/SearchForm.js
  7. +2
    -16
      src/pages/ProofSearch_Public/index.js
  8. +2
    -1
      src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js
  9. +26
    -49
      src/utils/ComboData.js
  10. +1
    -1
      src/utils/DateUtils.js

+ 6
- 6
src/components/FileList.js 파일 보기

@@ -10,7 +10,7 @@ import * as DateUtils from "../utils/DateUtils"
import { FiDataGrid } from './FiDataGrid';
// ==============================|| EVENT TABLE ||============================== //

export default function FileList({ refType, refId, allowDelete, sx, dateHideable, ...props }) {
export default function FileList({ refType, refId, allowDelete, sx, dateHideable,lang, ...props }) {
const [rows, setRows] = React.useState([]);
const [rowModesModel] = React.useState({});

@@ -91,13 +91,13 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable
{
id: 'filename',
field: 'filename',
headerName: 'filename',
headerName: lang=="ch"?"檔案名稱":'File Name',
flex: 3,
},
{
id: 'filesize',
field: 'filesize',
headerName: 'filesize',
headerName: lang=="ch"?"檔案大小":'File Size',
flex: 1,
valueGetter: (params) => {
return convertToStr(params.value);
@@ -109,7 +109,7 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable
{
id: 'created',
field: 'created',
headerName: 'created',
headerName: lang=="ch"?"日期":'Created',
flex: 1,
valueGetter: (params) => {
return DateUtils.datetimeStr(params.value);
@@ -136,13 +136,13 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable
{
id: 'filename',
field: 'filename',
headerName: 'filename',
headerName: lang=="ch"?"檔案名稱":'File Name',
flex: 3,
},
{
id: 'filesize',
field: 'filesize',
headerName: 'filesize',
headerName: lang=="ch"?"檔案大小":'File Size',
flex: 1,
valueGetter: (params) => {
return convertToStr(params.value);


+ 15
- 14
src/pages/ProofReply_Public/ApplicationDetails.js 파일 보기

@@ -17,7 +17,7 @@ const MainCard = Loadable(React.lazy(() => import('components/MainCard')));
import * as StatusUtils from "../PublicNotice/ListPanel/PublicNoteStatusUtils";
import FileList from "components/FileList"
// ==============================|| DASHBOARD - DEFAULT ||============================== //
const ApplicationDetailCard = ({ formData,}) => {
const ApplicationDetailCard = ({ formData, }) => {

const params = useParams();

@@ -25,7 +25,7 @@ const ApplicationDetailCard = ({ formData,}) => {
//const [proofId, setProofId] = React.useState();

React.useEffect(() => {
if (formData){
if (formData) {
setData(formData);
//setProofId(formData.id);
}
@@ -59,10 +59,10 @@ const ApplicationDetailCard = ({ formData,}) => {
}

function currencyFormat(num) {
let val = num?num:0;
let val = num ? num : 0;
return val.toLocaleString('en-US', {
minimumFractionDigits: 2
});
minimumFractionDigits: 2
});
}


@@ -71,7 +71,7 @@ const ApplicationDetailCard = ({ formData,}) => {
border={false}
content={false}
>
<Typography variant="h5" sx={{ textAlign:"left", mb: 2, borderBottom: "1px solid black" }}>
<Typography variant="h5" sx={{ textAlign: "left", mb: 2, borderBottom: "1px solid black" }}>
公共啟事:校對資料
</Typography>
<form>
@@ -162,7 +162,7 @@ const ApplicationDetailCard = ({ formData,}) => {
</Grid>

<Grid item xs={12} md={9} lg={9}>
<DisplayField name="issueDate" />
<DisplayField name="issueDateStr" />
</Grid>
</Grid>
</Grid>
@@ -195,6 +195,7 @@ const ApplicationDetailCard = ({ formData,}) => {
</Grid>
</Grid>
<FileList
lang="ch"
refId={params.id}
refType={"proof"}
dateHideable={true}
@@ -212,7 +213,7 @@ const ApplicationDetailCard = ({ formData,}) => {
sx={{ display: 'flex', alignItems: 'center' }}>
<FormLabel>繳費及返稿最後限期:</FormLabel>
</Grid>
<Grid item xs={12} md={12} lg={12} sx={{mb: 4, display: 'flex', alignItems: 'center' }}>
<Grid item xs={12} md={12} lg={12} sx={{ mb: 4, display: 'flex', alignItems: 'center' }}>
<FormLabel>{DateUtils.dateStr_Cht(data.returnBeforeDate)} 下午 2:00前</FormLabel>
</Grid>
<Grid item xs={12} md={3} lg={3}
@@ -220,15 +221,15 @@ const ApplicationDetailCard = ({ formData,}) => {
<FormLabel>應繳費用:</FormLabel>
</Grid>
<Grid item xs={12} md={9} lg={9} sx={{ mb: 1, display: 'flex', alignItems: 'center' }}>
<FormLabel style={{color: "blue", fontWeight: "bold",}}>{currencyFormat(data.fee)}</FormLabel>
<FormLabel style={{ color: "blue", fontWeight: "bold", }}>{currencyFormat(data.fee)}</FormLabel>
</Grid>
<Grid item xs={12} md={12} lg={12} sx={{mb: 4, display: 'flex', alignItems: 'center' }}>
<Grid item xs={12} md={12} lg={12} sx={{ mb: 4, display: 'flex', alignItems: 'center' }}>
{
formik.values.groupType == "A"
?
<FormLabel>( {data.length} 頁 x $6,552 )</FormLabel>
:
<FormLabel>( {data.length} cm x {data.colCount==2?"$364 二格位":"$182 一格位"} )</FormLabel>
?
<FormLabel>( {data.length} 頁 x $6,552 )</FormLabel>
:
<FormLabel>( {data.length} cm x {data.colCount == 2 ? "$364 二格位" : "$182 一格位"} )</FormLabel>
}
</Grid>
</Grid>


+ 105
- 83
src/pages/ProofReply_Public/ProofForm.js 파일 보기

@@ -107,6 +107,15 @@ const FormPanel = ({ formData }) => {
}
}

const isOverTime = () => {
let returnBeforeDate = DateUtils.convertToDate(formik.values?.returnBeforeDate);
if (!returnBeforeDate) return true;
returnBeforeDate = returnBeforeDate.setHours(14, 0, 0, 0);

let current = new Date();
return current.getTime() > returnBeforeDate;
}



return (
@@ -127,10 +136,11 @@ const FormPanel = ({ formData }) => {
校對回覆日期: {DateUtils.datetimeStr_Cht(formik.values.replyDate)}
</Grid>
<Grid item xs={12} md={12} textAlign="left">
校對回覆: {formik.values.action? "可以付印(稿件正確)":"未能付印(需要修改)"}
校對回覆: {formik.values.action ? "可以付印(稿件正確)" : "未能付印(需要修改)"}
</Grid>
<Grid item xs={12} md={12} textAlign="left">
<FileList
<FileList
lang="ch"
refId={params.id}
refType={"proofReply"}
dateHideable={true}
@@ -140,99 +150,111 @@ const FormPanel = ({ formData }) => {
disableColumnSelector
hideFooter
/>
</Grid>
</Grid>
</Grid>
:
<Grid container direction="column" sx={{ paddingLeft: 4, paddingRight: 4 }} spacing={1}>
(
isOverTime() ?
<Grid container direction="column" sx={{ paddingLeft: 4, paddingRight: 4 }} spacing={1}>
<Grid item xs={12} md={12} textAlign="left">
回覆逾時,請重新申請。
</Grid>
</Grid>
:
<Grid container direction="column" sx={{ paddingLeft: 4, paddingRight: 4 }} spacing={1}>

<Grid item xs={12} md={12}>
<RadioGroup
aria-labelledby="demo-radio-buttons-group-label"
id="action"
name="action"
defaultValue={true}
>
<FormControlLabel value={true} control={<Radio />} label="可以付印(稿件正確)" />
<FormControlLabel value={false} control={<Radio />} label="未能付印(需要修改)" />
</RadioGroup>
</Grid>
<Grid item xs={12} md={12}>
<RadioGroup
aria-labelledby="demo-radio-buttons-group-label"
id="action"
name="action"
defaultValue={true}
>
<FormControlLabel value={true} control={<Radio />} label="可以付印(稿件正確)" />
<FormControlLabel value={false} control={<Radio />} label="未能付印(需要修改)" />
</RadioGroup>
</Grid>

<Grid item xs={12} md={12} textAlign="left">
請上載稿件修改的檔案:
</Grid>
<Grid item xs={12} md={12} textAlign="left">
請上載稿件修改的檔案:
</Grid>

<Grid item xs={12} md={12} textAlign="left">
<input
id="uploadFileBtn"
name="file"
type="file"
accept=".pdf"
style={{ display: 'none' }}
disabled={attachments.length >= (formik.values.groupType == "A" ? 2 : 1)}
onChange={(event) => {
readFile(event)
}}
/>
<label htmlFor="uploadFileBtn">
<Button
component="span"
variant="contained"
size="large"
disabled={attachments.length >= (formik.values.groupType == "A" ? 2 : 1)}
>上載</Button>
</label>
</Grid>
<Grid item xs={12} md={12} textAlign="left">
<input
id="uploadFileBtn"
name="file"
type="file"
accept=".pdf"
style={{ display: 'none' }}
disabled={attachments.length >= (formik.values.groupType == "A" ? 2 : 1)}
onChange={(event) => {
readFile(event)
}}
/>
<label htmlFor="uploadFileBtn">
<Button
component="span"
variant="contained"
size="large"
disabled={attachments.length >= (formik.values.groupType == "A" ? 2 : 1)}
>上載</Button>
</label>
</Grid>


<Grid item xs={12} md={12} textAlign="left">
<UploadFileTable key="uploadTable" recordList={attachments} setRecordList={setAttachments} />
</Grid>
<Grid item xs={12} md={12} textAlign="left">
<UploadFileTable key="uploadTable" recordList={attachments} setRecordList={setAttachments} />
</Grid>


<Grid item xs={12} md={12} lg={12}>
<Stack direction="row" alignItems="center">
<FormLabel sx={{ paddingRight: 2, textAlign: "center" }}>
簽署:
</FormLabel>
<TextField
fullWidth
type="text"
onChange={formik.handleChange}
name="vaild"
variant="outlined"
error={Boolean(formik.errors["vaild"])}
helperText={formik.errors["vaild"] ? formik.errors["vaild"] : ''}
placeholder="請輸入你的登入密碼"
sx={
{
"& .MuiInputBase-input.Mui-disabled": {
WebkitTextFillColor: "#000000",
background: "#f8f8f8",
},
width: '50%'
}
}
/>

</Stack>
</Grid>
<Grid item xs={12} md={12} lg={12}>
<Stack direction="row" alignItems="center">
<FormLabel sx={{ paddingRight: 2, textAlign: "center" }}>
簽署:
</FormLabel>
<TextField
fullWidth
type="text"
onChange={formik.handleChange}
name="vaild"
variant="outlined"
error={Boolean(formik.errors["vaild"])}
helperText={formik.errors["vaild"] ? formik.errors["vaild"] : ''}
placeholder="請輸入你的登入密碼"
sx={
{
"& .MuiInputBase-input.Mui-disabled": {
WebkitTextFillColor: "#000000",
background: "#f8f8f8",
},
width: '50%'
}
}
/>

</Stack>
</Grid>


<Grid item xs={12} md={12} textAlign="left">
<Button
size="large"
variant="contained"
color="success"
type="submit"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}>
提交回覆
</Button>
</Grid>

</Grid>

)

<Grid item xs={12} md={12} textAlign="left">
<Button
size="large"
variant="contained"
color="success"
type="submit"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}>
提交回覆
</Button>
</Grid>

</Grid>
}




+ 52
- 41
src/pages/ProofReply_Public/index.js 파일 보기

@@ -10,6 +10,7 @@ import * as React from "react";
import * as HttpUtils from "utils/HttpUtils";
import * as DateUtils from "utils/DateUtils";
import { useParams } from "react-router-dom";
import { useNavigate } from "react-router-dom";

import Loadable from 'components/Loadable';
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
@@ -30,6 +31,7 @@ const BackgroundHead = {

const Index = () => {
const params = useParams();
const navigate = useNavigate()

const [record, setRecord] = React.useState();
const [onReady, setOnReady] = React.useState(false);
@@ -49,6 +51,9 @@ const Index = () => {
HttpUtils.get({
url: UrlUtils.GET_PROOF + "/" + params.id,
onSuccess: (responseData) => {
if(!responseData.data?.id){
navigate("/proof/search");
}
responseData.data["phoneNumber"] = JSON.parse(responseData.data.contactTelNo).phoneNumber;
responseData.data["tel_countryCode"] = JSON.parse(responseData.data.contactTelNo).countryCode;

@@ -56,13 +61,13 @@ const Index = () => {
responseData.data["fax_countryCode"] = JSON.parse(responseData.data.contactFaxNo).countryCode;

responseData.data["issueNoStr"] = responseData.data.issueYear
+" Vol. "+zeroPad(responseData.data.issueVolume,3)
+", No. "+zeroPad(responseData.data.issueNo,2);
responseData.data["issueDate"] = DateUtils.dateFormat(responseData.data.issueDate, "D MMM YYYY (ddd)");
+ " Vol. " + zeroPad(responseData.data.issueVolume, 3)
+ ", No. " + zeroPad(responseData.data.issueNo, 2);
responseData.data["issueDateStr"] = DateUtils.dateFormat(responseData.data.issueDate, "D MMM YYYY (ddd)");

responseData.data["groupType"] = responseData.data.groupNo.charAt(0);
responseData.data["action"] = responseData.data.replyDate?responseData.data.action:true;
responseData.data["action"] = responseData.data.replyDate ? responseData.data.action : true;
setRecord(responseData.data);
}
});
@@ -70,7 +75,7 @@ const Index = () => {
}

function zeroPad(num, places) {
num=num?num:0;
num = num ? num : 0;
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
}
@@ -80,42 +85,48 @@ const Index = () => {
!onReady ?
<LoadingComponent />
:
<Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
<Grid item xs={12} width="100%">
<div style={BackgroundHead} width="100%">
<Stack direction="row" height='70px'>
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>校對記錄</Typography>
</Stack>
</div>
</Grid>
{/*row 1*/}
<Grid item xs={12} md={12} >
<Grid container justifyContent="flex-start" alignItems="center" >
<center>
<Grid item xs={12} md={12} sx={{ pt: 2 }}>
<Box xs={12} md={12} sx={{ p: 4, border: '3px groove grey', borderRadius: '10px' }}>
<ApplicationDetails
formData={record}
style={{
display: "flex",
height: "100%",
flex: 1
}}
/>
</Box>
</Grid>
<Grid item xs={12} md={12} sx={{ pt: 1, pb:2 }}>
<Box xs={12} md={12} sx={{ p: 4, border: '3px groove grey', borderRadius: '10px' }}>
<ProofForm
formData={record}
/>
</Box>
(
<Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
<Grid item xs={12} width="100%">
<div style={BackgroundHead} width="100%">
<Stack direction="row" height='70px'>
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>校對記錄</Typography>
</Stack>
</div>
</Grid>
{/*row 1*/}
<Grid item xs={12} md={12} >
<Grid container justifyContent="flex-start" alignItems="center" >
<center>
<Grid item xs={12} md={12} sx={{ pt: 2 }}>
<Box xs={12} md={12} sx={{ p: 4, border: '3px groove grey', borderRadius: '10px' }}>
<ApplicationDetails
formData={record}
style={{
display: "flex",
height: "100%",
flex: 1
}}
/>
</Box>
</Grid>
<Grid item xs={12} md={12} sx={{ pt: 1, pb: 2 }}>
<Box xs={12} md={12} sx={{ p: 4, border: '3px groove grey', borderRadius: '10px' }}>
<ProofForm
formData={record}
/>
</Box>
</Grid>
</center>
</Grid>
</center>
</Grid>
</Grid>
{/*row 2*/}
</Grid >
</Grid>
{/*row 2*/}
</Grid >

)


);
};



+ 30
- 47
src/pages/ProofSearch_Public/DataGrid.js 파일 보기

@@ -4,8 +4,8 @@ import {
Button
} from '@mui/material';
import * as DateUtils from "utils/DateUtils";
import {useNavigate} from "react-router-dom";
import {FiDataGrid} from "components/FiDataGrid";
import { useNavigate } from "react-router-dom";
import { FiDataGrid } from "components/FiDataGrid";
// ==============================|| EVENT TABLE ||============================== //

export default function SearchPublicNoticeTable({ recordList }) {
@@ -17,14 +17,14 @@ export default function SearchPublicNoticeTable({ recordList }) {
}, [recordList]);

const handleEditClick = (params) => () => {
navigate('/proof/reply/'+ params.row.appId);
navigate('/proof/reply/' + params.row.appId);
};


const columns = [
{
field: 'actions',
headerName: 'Proof No.',
headerName: '校對編號',
width: 150,
cellClassName: 'actions',
renderCell: (params) => {
@@ -34,23 +34,34 @@ export default function SearchPublicNoticeTable({ recordList }) {
{
id: 'appId',
field: 'appId',
headerName: 'Application No./ Gazette Code/ Gazette Issue',
headerName: '申請編號/憲報編號/憲報期數',
flex: 1,
renderCell: (params) => {
let appNo = params.row.appNo;
let code = params.row.groupNo;
let isssue = params.row.issueYear
+" Vol. "+zeroPad(params.row.issueVolume,3)
+", No. "+zeroPad(params.row.issueNo,2)
+", "+DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)");
+ " Vol. " + zeroPad(params.row.issueVolume, 3)
+ ", No. " + zeroPad(params.row.issueNo, 2)
+ ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)");

return <div style={{margin: 4}}>App No: {appNo}<br/>Gazette Code: {code}<br/>Issue: {isssue}</div>
return <div style={{ margin: 4 }}>申請編號: {appNo}<br />憲報編號: {code}<br />憲報期數: {isssue}</div>
},
},
{
id: 'returnBeforeDate',
field: 'returnBeforeDate',
headerName: '此日期前回覆',
flex: 1,
valueGetter: (params) => {
let returnBeforeDate = DateUtils.convertToDate(params?.value);
returnBeforeDate = returnBeforeDate.setHours(14, 0, 0, 0);
return DateUtils.datetimeStr_Cht(returnBeforeDate);
}
},
{
id: 'created',
field: 'created',
headerName: 'Proof Date',
headerName: '校對日期',
flex: 1,
valueGetter: (params) => {
return DateUtils.datetimeStr(params?.value);
@@ -59,69 +70,41 @@ export default function SearchPublicNoticeTable({ recordList }) {
{
id: 'replyDate',
field: 'replyDate',
headerName: 'Confirmed/Return Date',
headerName: '回覆日期',
flex: 1,
valueGetter: (params) => {
return params?.value?DateUtils.datetimeStr(params?.value):"";
}
},
{
id: 'contactPerson',
field: 'contactPerson',
headerName: 'Contact Person',
flex: 1,
renderCell: (params) => {
let company = params.row.enCompanyName!= null ?" ("+(params.row.enCompanyName)+")":"";

let phone = JSON.parse(params.row.contactTelNo);
let faxNo = JSON.parse(params.row.contactFaxNo);

let contact = "";
if (phone) {
contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber
}

if (faxNo && faxNo?.faxNumber) {
if (contact != "")
contact = contact + ", "
contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber
}

return (<>
{params?.value + company}<br />
{contact}
</>);
return params?.value ? DateUtils.datetimeStr(params?.value) : "";
}
},
{
id: 'groupTitle',
field: 'groupTitle',
headerName: 'Gazette Group',
headerName: '憲報類型',
flex: 1,
valueGetter: (params) => {
return (params?.value)?(params?.value):"";
return (params?.value) ? (params?.value) : "";
}
},
{
id: 'fee',
field: 'fee',
headerName: 'Fee',
headerName: '費用',
flex: 1,
valueGetter: (params) => {
return (params?.value)?"$ "+currencyFormat(params?.value):"";
return (params?.value) ? "$ " + currencyFormat(params?.value) : "";
}
},
];

function currencyFormat(num) {
return num.toLocaleString('en-US', {
minimumFractionDigits: 2
});
minimumFractionDigits: 2
});
}


function zeroPad(num, places) {
num=num?num:0;
num = num ? num : 0;
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
}


+ 11
- 48
src/pages/ProofSearch_Public/SearchForm.js 파일 보기

@@ -13,13 +13,11 @@ import * as DateUtils from "utils/DateUtils";
// ==============================|| DASHBOARD - DEFAULT ||============================== //


const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issueComboData
const SearchPublicNoticeForm = ({ applySearch, searchCriteria,issueComboData
}) => {

const [type, setType] = React.useState([]);
const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' });
const [orgSelected, setOrgSelected] = React.useState({});
const [orgCombo, setOrgCombo] = React.useState();
const [issueSelected, setIssueSelected] = React.useState({});
const [issueCombo, setIssueCombo] = React.useState([]);
const [groupSelected, setGroupSelected] = React.useState({});
@@ -46,17 +44,10 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
dateTo: data.dateTo,
contact: data.contact,
replyed: (status?.type && status?.type != 'all') ? status?.type : "",
orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "",
};
applySearch(temp);
};

React.useEffect(() => {
if (orgComboData && orgComboData.length > 0) {
setOrgCombo(orgComboData);
}
}, [orgComboData]);

React.useEffect(() => {
if (issueComboData && issueComboData.length > 0) {
@@ -144,7 +135,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
}}
renderInput={(params) => (
<TextField {...params}
label="Gazette Issue"
label="憲報期數"
InputLabelProps={{
shrink: true
}}
@@ -160,8 +151,8 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
id="gazettGroup"
options={ComboData.groupTitle}
value={groupSelected}
inputValue={(groupSelected?.label)?groupSelected?.label:""}
getOptionLabel={(option)=>option.label}
inputValue={(groupSelected?.labelCht)?groupSelected?.labelCht:""}
getOptionLabel={(option)=>option.labelCht}
onChange={(event, newValue) => {
if (newValue !== null) {
setGroupSelected(newValue);
@@ -169,7 +160,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
}}
renderInput={(params) => (
<TextField {...params}
label="Gazette Group"
label="憲報類型"
InputLabelProps={{
shrink: true
}}
@@ -184,7 +175,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
{...register("dateFrom")}
id="dateFrom"
type="date"
label="校對日期(From)"
label="校對日期()"
defaultValue={searchCriteria.dateFrom}
InputProps={{ inputProps: { max: maxDate } }}
onChange={(newValue) => {
@@ -209,7 +200,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
}}
id="dateTo"
type="date"
label="校對日期(To)"
label="校對日期()"
defaultValue={searchCriteria.dateTo}
/>
</Grid>
@@ -236,7 +227,8 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
filterOptions={(options) => options}
options={ComboData.proofStatus}
value={status}
inputValue={status?.label?status?.label:""}
getOptionLabel={(option)=>option.labelCht}
inputValue={status?.labelCht?status?.labelCht:""}
onChange={(event, newValue) => {
if (newValue !== null) {
setStatus(newValue);
@@ -253,35 +245,6 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
/>
</Grid>

{
orgCombo ?
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}>
<Autocomplete
{...register("orgId")}
disablePortal
id="orgId"
options={orgCombo}
value={orgSelected}
inputValue={(orgSelected?.label) ? orgSelected?.label : ""}
onChange={(event, newValue) => {
if (newValue !== null) {
setOrgSelected(newValue);
}
}}
renderInput={(params) => (
<TextField {...params}
label="Organization"
InputLabelProps={{
shrink: true
}}
/>
)}
/>
</Grid>
: <></>
}


</Grid>


@@ -297,7 +260,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
textTransform: 'capitalize',
alignItems: 'end'
}}>
Clear
重置
</Button>
</Grid>

@@ -310,7 +273,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
textTransform: 'capitalize',
alignItems: 'end'
}}>
Submit
提交
</Button>
</Grid>
</Grid>


+ 2
- 16
src/pages/ProofSearch_Public/index.js 파일 보기

@@ -31,7 +31,6 @@ const BackgroundHead = {
const UserSearchPage_Individual = () => {

const [record,setRecord] = React.useState([]);
const [orgCombo,setOrgCombo] = React.useState([]);
const [issueCombo,setIssueCombo] = React.useState([]);
const [searchCriteria, setSearchCriteria] = React.useState({
dateTo: DateUtils.dateStr(new Date()),
@@ -40,8 +39,6 @@ const UserSearchPage_Individual = () => {
const [onReady, setOnReady] = React.useState(false);

React.useEffect(() => {
getUserList();
getOrgCombo();
getIssueCombo();
}, []);

@@ -50,10 +47,10 @@ const UserSearchPage_Individual = () => {
}, [record]);

React.useEffect(() => {
getUserList();
loadGrid();
}, [searchCriteria]);

function getUserList(){
function loadGrid(){
HttpUtils.get({
url: UrlUtils.LIST_PROOF,
params: searchCriteria,
@@ -63,16 +60,6 @@ const UserSearchPage_Individual = () => {
});
}

function getOrgCombo(){
HttpUtils.get({
url: UrlUtils.GET_ORG_COMBO,
onSuccess: function(responseData){
let combo = responseData;
setOrgCombo(combo);
}
});
}

function getIssueCombo(){
HttpUtils.get({
url: UrlUtils.GET_ISSUE_COMBO,
@@ -104,7 +91,6 @@ const UserSearchPage_Individual = () => {
<Grid item xs={12} md={12} lg={12}>
<SearchForm
applySearch={applySearch}
orgComboData={orgCombo}
issueComboData={issueCombo}
searchCriteria={searchCriteria}
/>


+ 2
- 1
src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js 파일 보기

@@ -135,7 +135,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => {
ComboData.publicNoticeStatic
}
values={status}
inputValue={status?.label}
inputValue={status?.labelCht}
getOptionLabel={(option)=>option.labelCht}
onChange={(event, newValue) => {
if (newValue !== null) {
setStatus(newValue);


+ 26
- 49
src/utils/ComboData.js 파일 보기

@@ -12,52 +12,29 @@ export const country = ["香港","內地","澳門"];
export const accountFilter = [{ id: 1, key: 1, label: 'Active', type: 'active' }, { id: 2, key: 2, label: 'Locked', type: 'locked' }, { id: 3, key: 3, label: 'Not verified', type: 'notVerified' }];

export const publicNoticeStatic = [
{ key: 0, label: '全部', type: 'all' },
{ key: 1, label: '處理中', type: 'processing' }, // submitted and reviewed
{ key: 2, label: '待付款', type: 'confirmed' },
{ key: 3, label: '待發布', type: 'paid' },
{ key: 4, label: '已完成', type: 'completed' },
{ key: 5, label: '不接受', type: 'notAccepted' },
{ key: 6, label: '需重新提交', type: 'resubmit' },
{ key: 7, label: '已取消', type: 'cancelled' },
{ key: 8, label: '已撤銷', type: 'withdrawn' },
{ key: 0, labelCht: '全部', label: 'All', type: 'all' },
{ key: 1, labelCht: '處理中', label: 'Processing', type: 'processing' }, // submitted and reviewed
{ key: 2, labelCht: '待付款', label: 'Pending Payment', type: 'confirmed' },
{ key: 3, labelCht: '待發布', label: 'To be published', type: 'paid' },
{ key: 4, labelCht: '已完成', label: 'Completed', type: 'completed' },
{ key: 5, labelCht: '不接受', label: 'Not accepted', type: 'notAccepted' },
{ key: 6, labelCht: '需重新提交', label: 'Re-submit Required', type: 'resubmit' },
{ key: 7, labelCht: '已取消', label: 'Cancelled', type: 'cancelled' },
{ key: 8, labelCht: '已撤銷', label: 'Withdrawn', type: 'withdrawn' },
];

export const publicNoticeStatic_Creditor = [
{ key: 0, label: '全部', type: 'all' },
{ key: 1, label: '處理中', type: 'processing' }, // submitted and reviewed
{ key: 2, label: '待發布', type: 'confirmed' },
{ key: 3, label: '待付款', type: 'published' },
{ key: 4, label: '已完成', type: 'completed' },
{ key: 5, label: '不接受', type: 'notAccepted' },
{ key: 6, label: '需重新提交', type: 'resubmit' },
{ key: 7, label: '已取消', type: 'cancelled' },
{ key: 8, label: '已撤銷', type: 'withdrawn' },
{ key: 0, labelCht: '全部', label: 'All', type: 'all' },
{ key: 1, labelCht: '處理中', label: 'Processing', type: 'processing' }, // submitted and reviewed
{ key: 2, labelCht: '待發布', label: 'To be published', type: 'confirmed' },
{ key: 3, labelCht: '待付款', label: 'Pending Payment', type: 'published' },
{ key: 4, labelCht: '已完成', label: 'Completed', type: 'completed' },
{ key: 5, labelCht: '不接受', label: 'Not accepted', type: 'notAccepted' },
{ key: 6, labelCht: '需重新提交', label: 'Re-submit Required', type: 'resubmit' },
{ key: 7, labelCht: '已取消', label: 'Cancelled', type: 'cancelled' },
{ key: 8, labelCht: '已撤銷', label: 'Withdrawn', type: 'withdrawn' },
];

export const publicNoticeStaticEng = [
{ key: 0, label: 'All', type: 'all' },
{ key: 1, label: 'Processing', type: 'processing' }, // submitted and reviewed
{ key: 2, label: 'Pending Payment', type: 'confirmed' },
{ key: 3, label: 'To be published', type: 'paid' },
{ key: 4, label: 'Completed', type: 'completed' },
{ key: 5, label: 'Not accepted', type: 'notAccepted' },
{ key: 6, label: 'Re-submit Required', type: 'resubmit' },
{ key: 7, label: 'Cancelled', type: 'cancelled' },
{ key: 8, label: 'Withdrawn', type: 'withdrawn' },
];

export const publicNoticeStaticEng_Creditor = [
{ key: 0, label: 'All', type: 'all' },
{ key: 1, label: 'Processing', type: 'processing' }, // submitted and reviewed
{ key: 2, label: 'To be published', type: 'confirmed' },
{ key: 3, label: 'Pending Payment', type: 'published' },
{ key: 4, label: 'Completed', type: 'completed' },
{ key: 5, label: 'Not accepted', type: 'notAccepted' },
{ key: 6, label: 'Re-submit Required', type: 'resubmit' },
{ key: 7, label: 'Cancelled', type: 'cancelled' },
{ key: 8, label: 'Withdrawn', type: 'withdrawn' },
];

export const publicNoticeStatic_GLD = [
{ key: 0, label: 'All', type: 'all' },
@@ -75,11 +52,11 @@ export const publicNoticeStatic_GLD = [


export const groupTitle = [
{ key: 1, label: 'A - Private Bill', title: 'Private Bill', type: 'A'},
{ key: 2, label: 'B - Companies Ordinance', title: 'Companies Ordinance', type: 'B' },
{ key: 3, label: 'C - High Court', title: 'High Court', type: 'C' },
{ key: 4, label: 'D - Notices', title: 'Notices', type: 'D' },
{ key: 5, label: 'E - Miscellaneous (Companies)', title: 'Miscellaneous  (Companies)', type: 'E' },
{ key: 1, labelCht: 'A - 私人帳單', label: 'A - Private Bill', title: 'Private Bill', type: 'A'},
{ key: 2, labelCht: 'B - 公司條例', label: 'B - Companies Ordinance', title: 'Companies Ordinance', type: 'B' },
{ key: 3, labelCht: 'C - 高等法院', label: 'C - High Court', title: 'High Court', type: 'C' },
{ key: 4, labelCht: 'D - 通知', label: 'D - Notices', title: 'Notices', type: 'D' },
{ key: 5, labelCht: 'E - 其他', label: 'E - Miscellaneous (Companies)', title: 'Miscellaneous  (Companies)', type: 'E' },
];

export const proofPrice = [
@@ -88,7 +65,7 @@ export const proofPrice = [
];

export const proofStatus = [
{ key: 0, label: 'All', type: 'all' },
{ key: 1, label: 'Replyed', type: 'T' }, // submitted and reviewed
{ key: 2, label: 'Not reply yet', type: 'F' },
{ key: 0, labelCht: '全部', label: 'All', type: 'all' },
{ key: 1, labelCht: '已回覆', label:'Replyed', type: 'T' }, // submitted and reviewed
{ key: 2, labelCht: '未回覆', label:'Not reply yet', type: 'F' },
];

+ 1
- 1
src/utils/DateUtils.js 파일 보기

@@ -19,7 +19,7 @@ export const dateStr_Cht = (date) =>{

export const convertToDate = (date)=>{
if(typeof date == 'number'){
return dayjs(date);
return dayjs(date).toDate();
}else if(Array.isArray(date)){
if(date.length==3){
return new Date(date[0],date[1]-1,date[2],0,0,0);


불러오는 중...
취소
저장