diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 4a3bf0c2..9c00d5bb 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -437,7 +437,12 @@ export const useEstimateController = (planNo, flag) => { type: 'alert', icon: 'warning', }) + } else { + if (checkLength(copyReceiveUser.trim()) > 10) { + return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' }) + } } + const params = { saleStoreId: session.storeId, sapSalesStoreCd: session.custCd, @@ -469,6 +474,22 @@ export const useEstimateController = (planNo, flag) => { }) } + const checkLength = (value) => { + let str = new String(value) + let _byte = 0 + if (str.length !== 0) { + for (let i = 0; i < str.length; i++) { + let str2 = str.charAt(i) + if (encodeURIComponent(str2).length > 4) { + _byte += 2 + } else { + _byte++ + } + } + } + return _byte + } + return { estimateContextState, setEstimateContextState,