diff --git a/src/components/FileList.js b/src/components/FileList.js index 045f3fe..202ecc2 100644 --- a/src/components/FileList.js +++ b/src/components/FileList.js @@ -8,11 +8,15 @@ import * as HttpUtils from "../utils/HttpUtils" import * as UrlUtils from "../utils/ApiPathConst" import * as DateUtils from "../utils/DateUtils" import { FiDataGrid } from './FiDataGrid'; +import {useTheme} from "@emotion/react"; +import {useMediaQuery} from "@mui/material"; // ==============================|| EVENT TABLE ||============================== // export default function FileList({ refType, refId, allowDelete, sx, dateHideable,lang, ...props }) { const [rows, setRows] = React.useState([]); const [rowModesModel] = React.useState({}); + const theme = useTheme(); + const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); React.useEffect(() => { loadData(); @@ -92,13 +96,15 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable id: 'filename', field: 'filename', headerName: lang=="ch"?"檔案名稱":'File Name', - flex: 3, + width: isMdOrLg ? 'auto' : 400, + flex: isMdOrLg ? 3 : undefined, }, { id: 'filesize', field: 'filesize', headerName: lang=="ch"?"檔案大小":'File Size', - flex: 1, + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { return convertToStr(params.value); } @@ -110,7 +116,8 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable id: 'created', field: 'created', headerName: lang=="ch"?"日期":'Created', - flex: 1, + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { return DateUtils.datetimeStr(params.value); } @@ -137,13 +144,15 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable id: 'filename', field: 'filename', headerName: lang=="ch"?"檔案名稱":'File Name', - flex: 3, + width: isMdOrLg ? 'auto' : 400, + flex: isMdOrLg ? 3 : undefined, }, { id: 'filesize', field: 'filesize', headerName: lang=="ch"?"檔案大小":'File Size', - flex: 1, + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { return convertToStr(params.value); } @@ -175,7 +184,6 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable } return ( - //
- //
); } diff --git a/src/pages/Organization/DetailPage/OrganizationCard.js b/src/pages/Organization/DetailPage/OrganizationCard.js index ae2e54b..0509884 100644 --- a/src/pages/Organization/DetailPage/OrganizationCard.js +++ b/src/pages/Organization/DetailPage/OrganizationCard.js @@ -58,7 +58,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { faxNumber: yup.string().min(8, displayErrorMsg('請輸入8位數字')).nullable(), brExpiryDate: yup.string().min(8).required(displayErrorMsg('請輸入商業登記證有效日期')), brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(`請輸入有效商業登記證號碼`)), function (value) { - var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ + var brNo_pattern = /[0-9]{8}/ if (value !== undefined) { if (value.match(brNo_pattern)) { return true diff --git a/src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js b/src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js index ccd54ae..9f21937 100644 --- a/src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js +++ b/src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js @@ -55,10 +55,10 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { phoneNumber: yup.string().min(8, displayErrorMsg('請輸入有效聯絡電話')).required(displayErrorMsg('請輸入聯絡電話')), faxNumber: yup.string().min(8).nullable(), brExpiryDate: yup.string().min(8).required(displayErrorMsg('請輸入商業登記證有效日期')), - brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234-123-12-12-1)`)), function (value) { - var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ + brNo: yup.string().max(8).required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234)`)), function (value) { + var brNo_pattern = /[0-9]{8}/ if (value !== undefined) { - if (value.match(brNo_pattern)) { + if (value.size==8 && value.match(brNo_pattern)) { return true } else { return false diff --git a/src/pages/Organization/SearchPage/OrganizationSearchForm.js b/src/pages/Organization/SearchPage/OrganizationSearchForm.js index a525710..987e284 100644 --- a/src/pages/Organization/SearchPage/OrganizationSearchForm.js +++ b/src/pages/Organization/SearchPage/OrganizationSearchForm.js @@ -4,23 +4,24 @@ import { CardContent, Grid, TextField, Typography, - Checkbox, FormControlLabel, + Autocomplete, } from '@mui/material'; -import MainCard from "../../../components/MainCard"; +import MainCard from "components/MainCard"; import { useForm } from "react-hook-form"; import { useState } from "react"; import * as React from "react"; -import * as UrlUtils from "../../../utils/ApiPathConst"; -import * as HttpUtils from "../../../utils/HttpUtils"; +import * as UrlUtils from "utils/ApiPathConst"; +import * as HttpUtils from "utils/HttpUtils"; +import * as ComboData from "utils/ComboData"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const OrganizationSearchForm = ({ applySearch }) => { const [type, setType] = useState([]); - + const [creditorSelected, setCreditorSelected] = React.useState({ key: 0, labelCht: '全部', label: 'All', type: 'all' }); const { reset, register, handleSubmit } = useForm() const onSubmit = (data) => { @@ -34,8 +35,12 @@ const OrganizationSearchForm = ({ applySearch }) => { brNo: data.brNo, enCompanyName: data.enCompanyName, chCompanyName: data.chCompanyName, - searchCreditor: data.searchCreditor }; + if(creditorSelected.type == 'true'){ + temp["creditor"] = true; + }else if(creditorSelected.type == 'false'){ + temp["creditor"] = false; + } applySearch(temp); }; @@ -102,12 +107,26 @@ const OrganizationSearchForm = ({ applySearch }) => { - } - label="Search Creditor Only" - id="searchCreditor" - /> + { + setCreditorSelected(newValue); + }} + getOptionLabel={(option) => option.label} + renderInput={(params) => ( + + )} + /> diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index 4d6c510..d99e197 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -76,11 +76,14 @@ const FormPanel = ({ formData }) => { }, files: attachments ? attachments : [], onSuccess: function () { + notifyActionSuccess("提交成功!") if (actionValue) { - notifyActionSuccess("提交成功!") - navigate("/proof/pay/" + params.id); + if(data.creditor){ + navigate("/proof/search"); + }else{ + navigate("/proof/pay/" + params.id); + } } else { - notifyActionSuccess("提交成功!") navigate("/proof/search"); } }, diff --git a/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js b/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js index 76da039..4ddf106 100644 --- a/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js +++ b/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js @@ -100,19 +100,23 @@ const ApplicationDetailCard = ( setStatus("withdraw") }; + const doPublish =()=>()=>{ + setStatus("publish") + } + const onProofClick = () => { if (applicationDetailData.data.groupNo) { HttpUtils.get({ - url: UrlUtils.CHECK_CREATE_PROOF+"/"+currentApplicationDetailData.id, - onSuccess:function(responeData){ - if(responeData.success == true){ + url: UrlUtils.CHECK_CREATE_PROOF + "/" + currentApplicationDetailData.id, + onSuccess: function (responeData) { + if (responeData.success == true) { window.open("/proof/create/" + currentApplicationDetailData.id, "_blank", "noreferrer"); window.addEventListener("focus", onFocus) - }else{ + } else { let msg = responeData.msg; - if(msg === "haveActiveProof"){ + if (msg === "haveActiveProof") { msg = "Action Failed: There is already a pending payment and proofreading record for client review." - }else if(msg === "haveProofed"){ + } else if (msg === "haveProofed") { msg = "Action Failed: Already proofed." } setWarningText(msg); @@ -120,8 +124,8 @@ const ApplicationDetailCard = ( } } }); - - }else { + + } else { setWarningText("Please generate Gazette Code before Create Proof."); setIsWarningPopUp(true); } @@ -199,33 +203,49 @@ const ApplicationDetailCard = ( Not accept : - currentApplicationDetailData.status == "paid" ? + (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 1) ? <> - - : null + + : + (currentApplicationDetailData.status == "paid" && currentApplicationDetailData.creditor == 0) ? + <> + + + : null } @@ -267,7 +287,7 @@ const ApplicationDetailCard = ( - + @@ -329,7 +349,7 @@ const ApplicationDetailCard = ( - + @@ -351,7 +371,7 @@ const ApplicationDetailCard = ( WebkitTextFillColor: "#000000", background: "#f8f8f8", }, - mr:1 + mr: 1 }} inputProps={{ maxLength: 3, @@ -414,7 +434,7 @@ const ApplicationDetailCard = ( - + @@ -436,7 +456,7 @@ const ApplicationDetailCard = ( WebkitTextFillColor: "#000000", background: "#f8f8f8", }, - mr:1, + mr: 1, }} inputProps={{ maxLength: 3, diff --git a/src/pages/PublicNotice/Details_GLD/index.js b/src/pages/PublicNotice/Details_GLD/index.js index abdd7c7..f9a297d 100644 --- a/src/pages/PublicNotice/Details_GLD/index.js +++ b/src/pages/PublicNotice/Details_GLD/index.js @@ -32,7 +32,8 @@ import { SET_PUBLIC_NOTICE_STATUS_COMPLATED, SET_PUBLIC_NOTICE_STATUS_WITHDRAW, SET_PUBLIC_NOTICE_STATUS_RESUBMIT, - SET_PUBLIC_NOTICE_STATUS_REVIEWED + SET_PUBLIC_NOTICE_STATUS_REVIEWED, + SET_PUBLIC_NOTICE_STATUS_PUBLISH } from "utils/ApiPathConst"; const StatusChangeDialog = Loadable(lazy(() => import('./StatusChangeDialog'))); import * as DateUtils from "utils/DateUtils"; @@ -182,6 +183,8 @@ const PublicNoticeDetail_GLD = () => { onNotAcceptClick(getReason); } else if (getStatus == "resubmit") { onReSubmitClick(); + } else if (getStatus == "publish") { + onPublishClick(); } } }, [statusWindowAccepted]); @@ -225,6 +228,19 @@ const PublicNoticeDetail_GLD = () => { }); } + const onPublishClick = () => { + if (params.id <= 0) return; + HttpUtils.get({ + url: `${SET_PUBLIC_NOTICE_STATUS_PUBLISH}/${params.id}`, + onSuccess: function () { + setOpen(false); + handleClose(); + loadApplicationDetail() + notifySaveSuccess() + } + }); + } + const onComplatedClick = () => { if (params.id > 0) { axios.get(`${SET_PUBLIC_NOTICE_STATUS_COMPLATED}/${params.id}`) @@ -301,7 +317,7 @@ const PublicNoticeDetail_GLD = () => { }, [getUploadStatus]); return ( - + { - - {title} - + {/* @@ -341,7 +357,7 @@ const PublicNoticeDetail_GLD = () => { - + {isLoading && editMode ? : { - + { - + -
+
- + - + { checkExprityDate(true) }} disabled={currentApplicationDetailData.status == "rejected" || currentApplicationDetailData.status == "cancelled" - || currentApplicationDetailData.status == "paid"} + || currentApplicationDetailData.status == "paid" + || currentApplicationDetailData.creditor} sx={{ textTransform: 'capitalize', alignItems: 'end' diff --git a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js index 8769056..3213ec9 100644 --- a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js +++ b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js @@ -144,12 +144,11 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { :
{/*top button*/} - + - {editMode ? <> - + - - - } - - - - - - - - ID No.: - - - - - {formik.values.idDocType == "HKID" ? + : <> - + {FieldUtils.initField({ - valueName: "identification", - disabled: (!editMode), + valueName: "verifiedStatus", + disabled: true, form: formik, - placeholder: "證件號碼", - inputProps: { - maxLength: 7, - onKeyDown: (e) => { - if (e.key === 'Enter') { - e.preventDefault(); - } - }, - } })} - - + + + + + } + + + + + + + + ID No.: + + + + + {formik.values.idDocType === "HKID" ? + <> + + {FieldUtils.initField({ + valueName: "identification", + disabled: (!editMode), + form: formik, + placeholder: "證件號碼", + inputProps: { + maxLength: 7, + onKeyDown: (e) => { + if (e.key === 'Enter') { + e.preventDefault(); + } + }, + } + })} + + + + {FieldUtils.initField({ + valueName: "checkDigit", + disabled: (!editMode), + form: formik + })} + + : + {FieldUtils.initField({ - valueName: "checkDigit", + valueName: "identification", disabled: (!editMode), form: formik })} - : - - {FieldUtils.initField({ - valueName: "identification", - disabled: (!editMode), - form: formik - })} - - } + } + - - - {FieldUtils.getPhoneField({ - label: "Fax No.:", - valueName: { - code: "fax_countryCode", - num: "faxNumber" - }, - disabled: (!editMode), - form: formik - })} - + + {FieldUtils.getPhoneField({ + label: "Fax No.:", + valueName: { + code: "fax_countryCode", + num: "faxNumber" + }, + disabled: (!editMode), + form: formik + })} + - - {FieldUtils.getTextField({ - label: "Last Login:", - valueName: "lastLoginDate", - disabled: true, - form: formik - })} - + + {FieldUtils.getTextField({ + label: "Last Login:", + valueName: "lastLoginDate", + disabled: true, + form: formik + })} + - - {FieldUtils.getComboField({ - label: "Country:", - valueName: "country", - dataList: ComboData.country, - disabled: (!editMode), - form: formik - })} - + + {FieldUtils.getComboField({ + label: "Country:", + valueName: "country", + dataList: ComboData.country, + disabled: (!editMode), + form: formik + })} + - - {FieldUtils.getTextField({ - label: "Email:", - valueName: "emailAddress", - disabled: (!editMode), - form: formik - })} - + + {FieldUtils.getTextField({ + label: "Email:", + valueName: "emailAddress", + disabled: (!editMode), + form: formik + })} + - - - - Status: - + + + + Status: + - { - editMode ? - - {FieldUtils.initField({ - valueName: "status", - disabled: true, - form: formik, - })} - - : - <> - + { + editMode ? + {FieldUtils.initField({ valueName: "status", disabled: true, form: formik, })} - {locked ? - - - - : - - + : + <> + + {FieldUtils.initField({ + valueName: "status", + disabled: true, + form: formik, + })} - } - - } + {locked ? + + + + : + + + + } + + } + - - - {FieldUtils.getAddressField({ - label: "Address:", - valueName: ["addressLine1", "addressLine2", "addressLine3"], - disabled: (!editMode), - form: formik - })} - + + {FieldUtils.getAddressField({ + label: "Address:", + valueName: ["addressLine1", "addressLine2", "addressLine3"], + disabled: (!editMode), + form: formik + })} + - - {FieldUtils.getComboField({ - label: "District:", - valueName: "district", - dataList: ComboData.district, - disabled: (!editMode), - form: formik - })} + + {FieldUtils.getComboField({ + label: "District:", + valueName: "district", + dataList: ComboData.district, + disabled: (!editMode), + form: formik + })} + - } diff --git a/src/pages/User/DetailsPage_Individual/index.js b/src/pages/User/DetailsPage_Individual/index.js index de2a01f..91bc636 100644 --- a/src/pages/User/DetailsPage_Individual/index.js +++ b/src/pages/User/DetailsPage_Individual/index.js @@ -1,7 +1,7 @@ // material-ui import * as React from "react"; -import { Grid, Typography, Button, Stack, Box } from '@mui/material'; +import { Grid, Typography, Button, Stack } from '@mui/material'; import FileList from "../../../components/FileList" import MainCard from "../../../components/MainCard"; import * as HttpUtils from "../../../utils/HttpUtils"; @@ -35,26 +35,6 @@ const UserMaintainPage_Individual = () => { const [formData, setFormData] = React.useState({}) const [isLoading, setLoding] = React.useState(true); - const _sx = { - ml: 6, - mr: 6, - mb: 3, - mt: 3, - padding: "4 2 4 2", - boxShadow: 1, - border: 1, - borderColor: '#DDD', - '& .MuiDataGrid-cell': { - borderTop: 1, - borderBottom: 1, - borderColor: "#EEE" - }, - '& .MuiDataGrid-footerContainer': { - border: 1, - borderColor: "#EEE" - } - } - React.useEffect(() => { loadData(); }, []); @@ -102,7 +82,7 @@ const UserMaintainPage_Individual = () => { isLoading ? : - +
@@ -116,29 +96,26 @@ const UserMaintainPage_Individual = () => { {/*col 1*/} - + - - - - + + - - - - Files - + + + Files + + - - + +
diff --git a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js index 3b61561..0c4e812 100644 --- a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js +++ b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js @@ -59,8 +59,8 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => phoneNumber: yup.string().min(8, displayErrorMsg('請輸入8位數字')).required(displayErrorMsg('請輸入聯絡電話')), faxNumber: yup.string().min(8, displayErrorMsg('請輸入8位數字')).nullable(), brExpiryDate: yup.string().min(8, displayErrorMsg('請輸入商業登記證有效日期')), - brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234-123-12-12-1)`), function (value) { - var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ + brNo: yup.string().max(8).required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234)`), function (value) { + var brNo_pattern = /[0-9]{8}/ if (value !== undefined) { if (value.match(brNo_pattern)) { return true diff --git a/src/pages/authentication/IAmSmartRegister.js b/src/pages/authentication/IAmSmartRegister.js index b3d77fc..2e4c7be 100644 --- a/src/pages/authentication/IAmSmartRegister.js +++ b/src/pages/authentication/IAmSmartRegister.js @@ -56,6 +56,7 @@ const Register = () => { const [completed, setCompleted] = useState([false]); const [updateValid, setUpdateValid] = useState(false); const [base64Url, setBase64Url] = useState("") + const [checkCode, setCheckCode] = useState("") const [idNo, setIdNo] = useState(""); const totalSteps = () => { diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index d4cd73a..60210ac 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -526,8 +526,9 @@ const BusCustomFormWizard = (props) => { phone: yup.string().min(8, displayErrorMsg('請輸入最少8位數字')).required(displayErrorMsg('請輸入聯絡電話')), fax: yup.string().min(8, displayErrorMsg('請輸入最少8位數字')), brExpiryDate: yup.date().min(new Date().toISOString().split("T")[0], displayErrorMsg('請輸入商業登記證有效日期')).max("2099-12-31", displayErrorMsg('請輸入商業登記證有效日期')).required(displayErrorMsg('請輸入商業登記證有效日期')), - brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234-123-12-12-1)`), function (value) { - var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ + brNo: yup.string().max(8).required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234)`), function (value) { + // var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ + var brNo_pattern = /[0-9]{8}/ if (value !== undefined) { if (value.match(brNo_pattern)) { return true @@ -834,7 +835,7 @@ const BusCustomFormWizard = (props) => { - 商業登記證號碼 (e.g. 12341234-123-12-12-1) + 商業登記證號碼 (e.g. 12341234) * diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index b621d70..e59de2f 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -77,6 +77,7 @@ export const SET_PUBLIC_NOTICE_STATUS_COMPLATED = apiPath+'/application/applicat export const SET_PUBLIC_NOTICE_STATUS_WITHDRAW = apiPath+'/application/application-detail-status-withdrawn'; export const SET_PUBLIC_NOTICE_STATUS_RESUBMIT = apiPath+'/application/application-detail-status-resubmit'; export const SET_PUBLIC_NOTICE_STATUS_REVIEWED = apiPath+'/application/application-detail-status-reviewed'; +export const SET_PUBLIC_NOTICE_STATUS_PUBLISH = apiPath+'/application/application-detail-status-publish'; export const UPDATE_PUBLIC_NOTICE_APPLY_DETAIL = apiPath+'/application/save'; export const GET_ISSUE_COMBO = apiPath+'/gazette-issue/combo'; diff --git a/src/utils/ComboData.js b/src/utils/ComboData.js index fd5c65e..8bf4d40 100644 --- a/src/utils/ComboData.js +++ b/src/utils/ComboData.js @@ -86,4 +86,10 @@ export const denmandNoteStatus = [ { key: 2, labelCht: '待支付', label:'To be Paid', type: 'to be paid' }, { key: 3, labelCht: '已付費', label:'Paid', type: 'paid' }, +]; + +export const CreditorStatus = [ + { key: 0, labelCht: '全部', label: 'All', type: 'all' }, + { key: 1, labelCht: '債權人', label:'Creditor', type: 'true' }, + { key: 2, labelCht: '非債權人', label:'No-Creditor', type: 'false' }, ]; \ No newline at end of file diff --git a/src/utils/FieldUtils.js b/src/utils/FieldUtils.js index 1577fc5..8e6fb02 100644 --- a/src/utils/FieldUtils.js +++ b/src/utils/FieldUtils.js @@ -27,12 +27,12 @@ export const getDateField = ({ label, valueName, form, disabled }) => { } export const getTextField = ({ label, valueName, form, disabled }) => { - return - + {label} - + {initField({ type: "text", valueName: valueName, @@ -71,7 +71,7 @@ export const getTextArea = ({ label, valueName, form, disabled, inputProps, ...p export const getPhoneField = ({ label, valueName, form, disabled }) => { - return + return {label} @@ -123,7 +123,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { - + {initField({ type: "text", valueName: valueName[0], @@ -131,7 +131,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { disabled: disabled })} - + {initField({ type: "text", valueName: valueName[1], @@ -139,7 +139,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { disabled: disabled })} - + {initField({ type: "text", valueName: valueName[2], @@ -152,7 +152,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { } export const getComboField = ({ label, dataList, valueName, form, disabled, getOptionLabel, onInputChange, onChange, filterOptions, ...props }) => { - return + return {label} diff --git a/src/utils/statusUtils/PublicNoteStatusUtils.js b/src/utils/statusUtils/PublicNoteStatusUtils.js index 07e42ce..8fddc1b 100644 --- a/src/utils/statusUtils/PublicNoteStatusUtils.js +++ b/src/utils/statusUtils/PublicNoteStatusUtils.js @@ -3,17 +3,17 @@ import {getStatusTag} from "utils/statusUtils/Base"; export function getStatus(params) { - return getStatusByText(params.row.status); + return getStatusByText(params.row.status, params.row.creditor); } -export function getStatusByText(status) { +export function getStatusByText(status, creditor) { switch (status) { case "submitted": return getStatusTag({ color: "#f5a83d", text: "處理中" }) case "reviewed": return getStatusTag({ color: "#f5a83d", text: "處理中" }) case "confirmed": - if (localStorage.getItem('userData').creditor) + if (creditor) return getStatusTag({ color: "#22a13f", text: "待發布" }) else return getStatusTag({ color: "#22a13f", text: "待付款" }) @@ -37,16 +37,16 @@ export function getStatusByText(status) { } export function getStatusEng(params) { - return getStatusByTextEng(params.row.status); + return getStatusByTextEng(params.row.status, params.row.creditor); } -export function getStatusByTextEng(status) { +export function getStatusByTextEng(status, creditor) { switch (status) { case "submitted": return getStatusTag({ color: "#f5a83d", text: "Submitted" }) case "reviewed": return getStatusTag({ color: "#0C489E", text: "Reviewed" }) case "confirmed": - if (localStorage.getItem('userData').creditor) + if (creditor) return getStatusTag({ color: "#22a13f", text: "Pending Publish" }) else return getStatusTag({ color: "#22a13f", text: "Pending Payment" })