fix: 신청서접수시 폐기수량 소숫점 입력 가능하도록 반영

main
Jonguk. Lim 3 months ago
parent 0a8220ea5f
commit 1cc52b6741

@ -187,12 +187,16 @@
const fnPrdChange = (e) => { const fnPrdChange = (e) => {
let key = e.target.closest('tr').dataset.key; const key = e.target.closest('tr').dataset.key;
const name = e.target.name;
let value = e.target.value; let value = e.target.value;
let name = e.target.name;
//alert(JSON.stringify($P.productList.getData(key))); if(name === 'dsuseQy') {
let parts = value.replace(/[^0-9.]/g, '').split('.');
value = parts.shift() + '.' + parts.join('');
e.target.value = value;
}
$P.productList.setValue(key, name, value); $P.productList.setValue(key, name, value);
//alert(JSON.stringify($P.productList.getData(key)));
} }
const fnBarcodeSearch = (barcode) => { const fnBarcodeSearch = (barcode) => {
@ -273,6 +277,9 @@
dialog.alert(obj.message); dialog.alert(obj.message);
return false; return false;
} }
// obj.data.forEach(item => {
// item.data.dsuseQy = parseFloat(item.data.dsuseQy.toFixed(2)).toString()
// });
return obj.data; return obj.data;
} }
, infoSize: "xl" , infoSize: "xl"
@ -680,7 +687,10 @@
} }
}); });
// 숫자만 입력받도록 input 요소에 이벤트 리스너 추가
$("input[name='dsuseQy']").on('change', function() {
this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');
});
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
} }

@ -169,6 +169,7 @@
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
$(document).ready(function() { $(document).ready(function() {
const fnBarcodeSearch = (barcode) => { const fnBarcodeSearch = (barcode) => {
ajax.get({ ajax.get({
url : wctx.url("/adds/nims/getNimsPrdMnfSeqInfoOfBarcode.do") url : wctx.url("/adds/nims/getNimsPrdMnfSeqInfoOfBarcode.do")
@ -623,6 +624,11 @@
fnBarcodeSearch(barcode); fnBarcodeSearch(barcode);
} }
}); });
// 숫자만 입력받도록 input 요소에 이벤트 리스너 추가
$("input[name='dsuseQy']").on('input', function() {
this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');
});
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
} }

Loading…
Cancel
Save