내정보 끝.
This commit is contained in:
@@ -285,10 +285,19 @@
|
||||
ENV.elementRefs.select.unitCodeSelect.core.init($select3,{
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
document.querySelector('#unitCode').value=dataValue;
|
||||
if(dataValue === "code.record.unit.self") {
|
||||
document.querySelector('#unit').value="";
|
||||
document.querySelector('#unitDiv').style.display ='block';
|
||||
} else {
|
||||
document.querySelector('#unit').value="";
|
||||
document.querySelector('#unitDiv').style.display ='none';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ENV.module.modalPopup.open();
|
||||
|
||||
document.querySelector('.modal-content').scrollTop = 0;
|
||||
},
|
||||
function(code, rstData) {
|
||||
kri.logger.error('Do nothing. code: '+ code, rstData);
|
||||
@@ -351,24 +360,37 @@
|
||||
|
||||
const errors = [];
|
||||
if (!form.transferCategoryCode.value) errors.push({field: 'transferCategoryCode', message: '수입종류를 선택해주세요.'});
|
||||
if (form.transferCategoryCode.value && document.getElementById(form.transferCategoryCode.value+"_value")
|
||||
if(document.getElementById(form.transferCategoryCode.value+"_value")){
|
||||
if (form.transferCategoryCode.value && document.getElementById(form.transferCategoryCode.value+"_value")
|
||||
&& !document.getElementById(form.transferCategoryCode.value+"_value").value){
|
||||
errors.push({field: form.transferCategoryCode.value+"_value", message: '수입대상을 입력해주세요.'});
|
||||
}
|
||||
}
|
||||
if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', message: '수입원을 입력해주세요.'});
|
||||
|
||||
if (form.count.value && !form.unitCode.value) errors.push({
|
||||
field: 'unitCode',
|
||||
message: '단위를 선택해주세요.'
|
||||
});
|
||||
if(form.count.value){
|
||||
if(!form.unitCode.value){
|
||||
errors.push({
|
||||
field: 'unitCode',
|
||||
message: '단위를 선택해주세요.'
|
||||
});
|
||||
} else if (form.unitCode.value && form.unitCode.value =="code.record.unit.self" && !form.unit.value){
|
||||
|
||||
errors.push({
|
||||
field: 'unit',
|
||||
message: '단위를 입력해주세요.'
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
|
||||
console.log(errors) //////////////////////////
|
||||
kri.form.error(errors);
|
||||
if (errors.length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.transferCategory.value = document.getElementById(form.transferCategoryCode.value+"_value").value;//입력값
|
||||
if(document.getElementById(form.transferCategoryCode.value+"_value")){
|
||||
form.transferCategory.value = document.getElementById(form.transferCategoryCode.value+"_value").value;//입력값
|
||||
}
|
||||
const formData = new FormData(form);
|
||||
const product = {};
|
||||
formData.forEach((value, key) => product[key] = value);
|
||||
@@ -411,15 +433,20 @@
|
||||
const field = form.elements.namedItem(key);
|
||||
if (field) {
|
||||
field.value = val;
|
||||
if(key == 'transferCategoryCode'){
|
||||
if(key == 'transferCategoryCode' && val == "code.bank.input.self"){
|
||||
document.getElementById(val+"_value").value = product["transferCategory"];
|
||||
}
|
||||
if(key == 'unitCode' && val == "code.record.unit.self"){
|
||||
document.getElementById("unitDiv").style.display = "";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ENV.elementRefs.select.cropCodeSelect.setValue(product.cropCode);
|
||||
ENV.elementRefs.select.transferCategoryCodeSelect.setValue(product.transferCategoryCode);
|
||||
ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode);
|
||||
document.getElementById("unit").value = product.unit;
|
||||
|
||||
},100)
|
||||
|
||||
},
|
||||
@@ -481,13 +508,16 @@
|
||||
const categoryCode = product.transferCategoryCode;
|
||||
const categoryCodeInputValue = product.transferCategory;
|
||||
const categoryValue = product[`${categoryCode}_value`] ? product[`${categoryCode}_value`] : categoryCodeInputValue;
|
||||
const tagTitle = categoryCode === 'code.bank.input.99'
|
||||
? categoryValue
|
||||
: `${getCategory(categoryCode)}<span>(${categoryValue})</span>`;
|
||||
const tagTitle = categoryCode === 'code.bank.input.self'
|
||||
? categoryCodeInputValue
|
||||
: `${getCategory(categoryCode)}`;
|
||||
|
||||
const tagCount = product.count
|
||||
? `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`
|
||||
: '';
|
||||
let tagCount = '';
|
||||
if(product.count && product.unitCode != "code.record.unit.self"){
|
||||
tagCount = `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`;
|
||||
} else {
|
||||
tagCount = `<li><p>수량</p><span>${format(product.count)}${product.unit}</span></li>`
|
||||
}
|
||||
|
||||
const buttonGroupHtml = isEdit
|
||||
? `
|
||||
|
||||
Reference in New Issue
Block a user