견적서 복사 담당자 자리수 체크

This commit is contained in:
basssy 2025-02-28 16:44:09 +09:00
parent 200cdff8cf
commit 77ec18c05b

View File

@ -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,