| @@ -54,11 +54,15 @@ const PublicNoticeApplyForm = ({loadedData, selections}) => { | |||||
| return; | return; | ||||
| } | } | ||||
| if(!attachment){ | if(!attachment){ | ||||
| setWarningText("請選擇上傳文件"); | |||||
| setWarningText("請選擇上傳檔案"); | |||||
| setIsWarningPopUp(true); | |||||
| return; | |||||
| }else if(!attachment.size || attachment.size <=0){ | |||||
| setWarningText("請上傳有效檔案"); | |||||
| setIsWarningPopUp(true); | setIsWarningPopUp(true); | ||||
| return; | return; | ||||
| }else if(attachment.size >= (10*1024*1034)){ | }else if(attachment.size >= (10*1024*1034)){ | ||||
| setWarningText("上傳文件大小應<10MB"); | |||||
| setWarningText("上傳檔案大小應<10MB"); | |||||
| setIsWarningPopUp(true); | setIsWarningPopUp(true); | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -77,7 +81,7 @@ const PublicNoticeApplyForm = ({loadedData, selections}) => { | |||||
| faxNumber: values.faxNumber | faxNumber: values.faxNumber | ||||
| }, | }, | ||||
| issueId:values.issueId, | issueId:values.issueId, | ||||
| remarks:values.remarks, | |||||
| remarks:values.remarks?values.remarks:"", | |||||
| }, | }, | ||||
| files: [attachment], | files: [attachment], | ||||
| onSuccess: function(){ | onSuccess: function(){ | ||||
| @@ -163,7 +167,7 @@ const PublicNoticeApplyForm = ({loadedData, selections}) => { | |||||
| <Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
| <Grid item lg={4} | <Grid item lg={4} | ||||
| sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | ||||
| 上傳文件 ({"檔案大小應<10MB"}): | |||||
| 犒件檔案 ({"檔案大小應<10MB"}): | |||||
| </Grid> | </Grid> | ||||
| <Grid item lg={4}> | <Grid item lg={4}> | ||||
| {attachment.name} | {attachment.name} | ||||
| @@ -184,7 +188,7 @@ const PublicNoticeApplyForm = ({loadedData, selections}) => { | |||||
| component="span" | component="span" | ||||
| variant="outlined" | variant="outlined" | ||||
| size="large" | size="large" | ||||
| >{attachment?"上傳文件":"重新上傳"}</Button> | |||||
| >{attachment?"上傳檔案":"重新上傳"}</Button> | |||||
| </label> | </label> | ||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| @@ -49,7 +49,7 @@ export default function BaseGrid({rows}) { | |||||
| contact = "電話: " + phone?.countryCode + " " + phone?.phoneNumber | contact = "電話: " + phone?.countryCode + " " + phone?.phoneNumber | ||||
| } | } | ||||
| if (faxNo) { | |||||
| if (faxNo && faxNo?.faxNumber) { | |||||
| if (contact != "") | if (contact != "") | ||||
| contact = contact + ", " | contact = contact + ", " | ||||
| contact = contact + "傳真:" + faxNo?.countryCode + " " + faxNo?.faxNumber | contact = contact + "傳真:" + faxNo?.countryCode + " " + faxNo?.faxNumber | ||||
| @@ -53,7 +53,7 @@ export default function SubmittedTab({ rows }) { | |||||
| contact = "電話: " + phone?.countryCode + " " + phone?.phoneNumber | contact = "電話: " + phone?.countryCode + " " + phone?.phoneNumber | ||||
| } | } | ||||
| if (faxNo) { | |||||
| if (faxNo && faxNo?.faxNumber) { | |||||
| if (contact != "") | if (contact != "") | ||||
| contact = contact + ", " | contact = contact + ", " | ||||
| contact = contact + "傳真:" + faxNo?.countryCode + " " + faxNo?.faxNumber | contact = contact + "傳真:" + faxNo?.countryCode + " " + faxNo?.faxNumber | ||||
| @@ -55,7 +55,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| contact = "電話: " + phone?.countryCode + " " + phone?.phoneNumber | contact = "電話: " + phone?.countryCode + " " + phone?.phoneNumber | ||||
| } | } | ||||
| if (faxNo) { | |||||
| if (faxNo && faxNo?.faxNumber) { | |||||
| if (contact != "") | if (contact != "") | ||||
| contact = contact + ", " | contact = contact + ", " | ||||
| contact = contact + "傳真:" + faxNo?.countryCode + " " + faxNo?.faxNumber | contact = contact + "傳真:" + faxNo?.countryCode + " " + faxNo?.faxNumber | ||||
| @@ -45,7 +45,7 @@ export const postWithFiles = ({url, params, files, onSuccess, onFail, onError}) | |||||
| if(typeof(params[key]) ==='object'){ | if(typeof(params[key]) ==='object'){ | ||||
| formData.append(key, JSON.stringify(params[key])); | formData.append(key, JSON.stringify(params[key])); | ||||
| }else{ | }else{ | ||||
| formData.append(key, params[key]?params[key]:null); | |||||
| formData.append(key, params[key]); | |||||
| } | } | ||||
| } | } | ||||