직접 입력후 저장후 데이터값 초기화 수정

dev_bert
kyebyungha 3 years ago
parent b132bf91fe
commit 5f0d12da01

@ -24,12 +24,14 @@
}
$(document).ready(function(){
/*
$('#prd_nm').autocomplete({
minLength: 1,
source: function call_ajax(){
list_more('Y');
}
});
*/
});
function ajax_data(keyword){

@ -21,7 +21,7 @@
<div class="nutrition_camera">
<div class="nutrition_camera_box">
<div id="img_preview" class="img_preview">
<p><label for="img"><img src="<#if model['rm']['append_300_img_file']?exists>${URL_ROOT}/file/get_img.do?mt_file_seq=${model['rm']['append_300_img_file']}<#else>${URL_STATIC_ROOT}/m/img/main/main_cont_img_camera.png</#if>" alt="사진영역" /></label></p>
<p><label for="img"><img id="imgSrc" src="<#if model['rm']['append_300_img_file']?exists>${URL_ROOT}/file/get_img.do?mt_file_seq=${model['rm']['append_300_img_file']}<#else>${URL_STATIC_ROOT}/m/img/main/main_cont_img_camera.png</#if>" alt="사진영역" /></label></p>
</div>
<input type="file" id="img" name="append_src_img_file">
</div>
@ -245,43 +245,43 @@
<div class="content">
<div class="nutrition_memo">
<div class="checkbox">
<input type="checkbox" id="agree_grain" name="agree_grain">
<input type="checkbox" id="agree_grain" name="agree_grain" class="agree_opt_chk">
<label for="agree_grain">곡류군</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_vegetable" name="agree_vegetable">
<input type="checkbox" id="agree_vegetable" name="agree_vegetable" class="agree_opt_chk">
<label for="agree_vegetable">채소군</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_fruit" name="agree_fruit">
<input type="checkbox" id="agree_fruit" name="agree_fruit" class="agree_opt_chk">
<label for="agree_fruit">과일군</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_meat" name="agree_meet">
<input type="checkbox" id="agree_meat" name="agree_meet" class="agree_opt_chk">
<label for="agree_meat">육류</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_poultry" name="agree_poultry">
<input type="checkbox" id="agree_poultry" name="agree_poultry" class="agree_opt_chk">
<label for="agree_poultry">가금류</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_seafood" name="agree_seafood">
<input type="checkbox" id="agree_seafood" name="agree_seafood" class="agree_opt_chk">
<label for="agree_seafood">어패류</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_turbulence" name="agree_turbulence">
<input type="checkbox" id="agree_turbulence" name="agree_turbulence" class="agree_opt_chk">
<label for="agree_turbulence">난류</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_dairy" name="agree_dairy">
<input type="checkbox" id="agree_dairy" name="agree_dairy" class="agree_opt_chk">
<label for="agree_dairy">유제품류</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_bean" name="agree_bean">
<input type="checkbox" id="agree_bean" name="agree_bean" class="agree_opt_chk">
<label for="agree_bean">콩류</label>
</div>
<div class="checkbox">
<input type="checkbox" id="agree_none" name="agree_none">
<input type="checkbox" id="agree_none" name="agree_none" class="agree_opt_chk">
<label for="agree_none">해당없음</label>
</div>
</div>
@ -479,13 +479,47 @@
console.log(result)
var RESULT = result.RESULT
if(RESULT == 0){ //0:RESULT_SUCCESS
save_set('', result.dbc_no, $("#menu_nm").val(), 'sf')
save_set('', result.dbc_no, $("#menu_nm").val(), 'sf');
this.init_self();
Swal.fire({text:"입력되었습니다"});
}else{
Swal.fire({text:"등록되지 않았습니다"})
}
},
})
},
init_self: function(){
$('#imgSrc').attr("src", "${URL_STATIC_ROOT}/m/img/main/main_cont_img_camera.png");
$('#img').val('');
$('#menu_nm').val('');
$('#company').val('');
$('#calorie').val('');
$('#srv_self').val('');
$('#srv_unit').val('');
$('#carbohydrate').val('');
$('#protein').val('');
$('#province').val('');
$('#sugar').val('');
$('#dietary_fiber').val('');
$('#dsaturated_fat').val('');
$('#trans_fat').val('');
$('#cholesterol').val('');
$('#salt').val('');
$('#vitamina').val('');
$('#vitaminb1').val('');
$('#vitaminb2').val('');
$('#niacin').val('');
$('#vitaminb6').val('');
$('#vitaminc').val('');
$('#vitamind').val('');
$('#vitamine').val('');
$('#folic_acid').val('');
$('#steel').val('');
$('#calcium').val('');
$('#zinc').val('');
$('#potassium').val('');
//$("input:checkbox[class='agree_opt_chk']").attr("checked", false);
$("input:checkbox[class='agree_opt_chk']").prop("checked",false);
}
};

@ -226,7 +226,6 @@
var RESULT = result.RESULT
if(RESULT == 0){ //0:RESULT_SUCCESS
var tag = "";
debugger;
for(var idx=0;idx< result.lm_memo_mst.length; idx++){
tag += "<li><a href =\"#\" onclick=\"javascript:save.appendMemo('"+result.lm_memo_mst[idx].memo+"')\">"+result.lm_memo_mst[idx].memo+"</a></li>";
}

@ -188,7 +188,7 @@
<div class="nutrition_camera">
<div class="nutrition_camera_box">
<div id="img_preview" class="img_preview">
<p><label for="img"><img src="<#if model['rm']['append_300_img_file']?exists>${URL_ROOT}/file/get_img.do?mt_file_seq=${model['rm']['append_300_img_file']}<#else>${URL_STATIC_ROOT}/m/img/main/main_cont_img_camera.png</#if>" alt="사진영역" /></label></p>
<p><label for="img"><img id="imgSrc" src="<#if model['rm']['append_300_img_file']?exists>${URL_ROOT}/file/get_img.do?mt_file_seq=${model['rm']['append_300_img_file']}<#else>${URL_STATIC_ROOT}/m/img/main/main_cont_img_camera.png</#if>" alt="사진영역" /></label></p>
</div>
<input type="file" id="img" name="append_src_img_file">
</div>
@ -369,12 +369,29 @@
$('#popup_self2').removeClass('open');
$("#db_dhb_no").val(result.dhb_no);
$("#prd_nm").text($("#prd_nm_sch2").val());
this.init_self();
Swal.fire({text:"입력되었습니다"});
}else{
Swal.fire({text:"등록되지 않았습니다"});
}
},
})
},
init_self: function(){
$('#imgSrc').attr("src", "${URL_STATIC_ROOT}/m/img/main/main_cont_img_camera.png");
$('#img').val('');
$('#prd_nm_sch2').val('');
$("input[name=dbi_no]").each ( function(idx, ele) {
ele.value="";
});
$("input[name=rate_100]").each ( function(idx, ele) {
ele.value="";
});
$("input[name=di_name]").each ( function(idx, ele) {
ele.value="";
});
}
}

Loading…
Cancel
Save