#1053 물건화면 담당자 자리수

This commit is contained in:
basssy 2025-05-21 09:29:16 +09:00
parent ee2417cf6f
commit 99886ad61e
4 changed files with 22 additions and 31 deletions

View File

@ -1362,10 +1362,11 @@ export default function StuffDetail() {
}
if (params?.receiveUser !== '') {
if (checkLength(params?.receiveUser.trim()) > 10) {
if (checkLength(params?.receiveUser.trim()) > 40) {
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
}
}
// 2 otherSaleStoreId
if (session.storeLvl !== '1') {
if (params.saleStoreLevel === '1') {
@ -1435,20 +1436,15 @@ export default function StuffDetail() {
}
}
/**
* 전각20자 (반각40자)
*/
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
let fullWidthLength = value.replace(/[^\uFF01-\uFF5E]/g, '').length
let halfWidthLength = value.replace(/[\uFF01-\uFF5E]/g, '').length
let totalLength = fullWidthLength * 2 + halfWidthLength
return totalLength
}
//
const onTempSave = async () => {
@ -1498,7 +1494,7 @@ export default function StuffDetail() {
//
if (params?.receiveUser !== '') {
if (checkLength(params?.receiveUser.trim()) > 10) {
if (checkLength(params?.receiveUser.trim()) > 40) {
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
}
}

View File

@ -449,7 +449,7 @@ export const useEstimateController = (planNo, flag) => {
icon: 'warning',
})
} else {
if (checkLength(copyReceiveUser.trim()) > 10) {
if (checkLength(copyReceiveUser.trim()) > 40) {
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
}
}
@ -489,20 +489,15 @@ export const useEstimateController = (planNo, flag) => {
})
}
/**
* 전각20자 (반각40자)
*/
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
let fullWidthLength = value.replace(/[^\uFF01-\uFF5E]/g, '').length
let halfWidthLength = value.replace(/[\uFF01-\uFF5E]/g, '').length
let totalLength = fullWidthLength * 2 + halfWidthLength
return totalLength
}
return {

View File

@ -732,7 +732,7 @@
"stuff.detail.tooltip.surfaceType": "塩害地域の定義は各メーカーの設置マニュアルをご確認ください",
"stuff.detail.tempSave.message0": "一時保存されました。 物件番号を取得するには、保存ボタンを押して下さい。,",
"stuff.detail.tempSave.message1": "一時保存されました。物件番号を取得するには、必須項目をすべて入力してください。",
"stuff.detail.tempSave.message2": "担当者名は10桁以下で入力してください。",
"stuff.detail.tempSave.message2": "担当者名は全角20文字半角40文字以下で入力してください.",
"stuff.detail.tempSave.message3": "二次販売店を選択してください。",
"stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?",
"stuff.detail.delete.message1": "仕様が確定したものは削除できません。",

View File

@ -733,7 +733,7 @@
"stuff.detail.tooltip.surfaceType": "염해지역 정의는 각 메이커의 설치 매뉴얼을 확인해주십시오",
"stuff.detail.tempSave.message0": "임시저장 되었습니다. 물건번호를 획득하려면 저장버튼을 눌러주십시오.",
"stuff.detail.tempSave.message1": "임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.",
"stuff.detail.tempSave.message2": "담당자이름은 10자리 이하로 입력해 주십시오.",
"stuff.detail.tempSave.message2": "담당자이름은 전각20자(반각40자) 이하로 입력해 주십시오.",
"stuff.detail.tempSave.message3": "2차 판매점을 선택해주세요.",
"stuff.detail.confirm.message1": "판매점 정보를 변경하면 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?",
"stuff.detail.delete.message1": "사양이 확정된 물건은 삭제할 수 없습니다.",