내정보 끝.
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
|
||||
? `
|
||||
|
||||
@@ -85,14 +85,12 @@
|
||||
<!-- 수당 인풋 -->
|
||||
<!-- transferCategory+Text-->
|
||||
<th:block th:each="item : ${transferCategoryList}">
|
||||
|
||||
<div class="component-input " th:data-option="${item.codeText}">
|
||||
<div class="input-field">
|
||||
<input type="text" th:id="${item.id}+'_value'" th:name="${item.id}+'_value'" value="" placeholder="수입 대상을 입력해 주세요." maxlength="30">
|
||||
</div>
|
||||
<ul class="input-info">
|
||||
<li style="display:none">수입 대상을 입력해 주세요.</li>
|
||||
<li class="txt-blue" th:if="${item.msgCode}" th:text="${item.msgCode}"></li>
|
||||
<ul class="guide-info" th:if="${item.msgCode}">
|
||||
<li class="txt-blue" th:text="${item.msgCode}"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</th:block>
|
||||
@@ -160,6 +158,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="component-input " id="unitDiv" style="display: none">
|
||||
<div class="input-field">
|
||||
<input type="text" name="unit" id="unit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -277,10 +277,18 @@
|
||||
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,11 +359,23 @@
|
||||
}
|
||||
|
||||
if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', 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){
|
||||
|
||||
if (form.count.value && !form.unitCode.value) errors.push({
|
||||
field: 'unitCode',
|
||||
message: '단위를 선택해주세요.'
|
||||
});
|
||||
errors.push({
|
||||
field: 'unit',
|
||||
message: '단위를 입력해주세요.'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
|
||||
console.log(errors) //////////////////////////
|
||||
kri.form.error(errors);
|
||||
@@ -407,15 +427,19 @@
|
||||
const field = form.elements.namedItem(key);
|
||||
if (field) {
|
||||
field.value = val;
|
||||
if(key == 'transferCategoryCode' && val == "code.bank.input.99"){
|
||||
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.transferCategoryCodeSelect.setValue(product.transferCategoryCode);
|
||||
ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode);
|
||||
document.getElementById("unit").value = product.unit;
|
||||
|
||||
},100)
|
||||
|
||||
},
|
||||
@@ -476,13 +500,16 @@
|
||||
const categoryCode = product.transferCategoryCode;
|
||||
const categoryCodeInputValue = product.transferCategory;
|
||||
const categoryValue = product[`${categoryCode}_value`] ? product[`${categoryCode}_value`] : categoryCodeInputValue;
|
||||
const tagTitle = categoryCode === 'code.bank.output.99'
|
||||
const tagTitle = categoryCode === 'code.bank.output.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
|
||||
? `
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
</div>
|
||||
<th:block th:each="item : ${transferCategoryList}">
|
||||
|
||||
<div class="component-input " th:if="${item.id == 'code.bank.output.99'}" th:data-option="${item.codeText}">
|
||||
<div class="component-input " th:data-option="${item.codeText}">
|
||||
<div class="input-field">
|
||||
<input type="text" th:id="${item.id}+'_value'" th:name="${item.id}+'_value'" value="" placeholder="수입 대상을 입력해 주세요." maxlength="30">
|
||||
</div>
|
||||
<ul class="input-info">
|
||||
<li style="display:none">수입 대상을 입력해 주세요.</li>
|
||||
<li class="txt-blue" th:if="${item.msgCode}" th:text="${item.msgCode}"></li>
|
||||
<ul class="guide-info" th:if="${item.msgCode}">
|
||||
<li class="txt-blue" th:text="${item.msgCode}"></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
@@ -121,6 +121,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="component-input " id="unitDiv" style="display: none">
|
||||
<div class="input-field">
|
||||
<input type="text" name="unit" id="unit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
Reference in New Issue
Block a user