파일 업로드(폐기상품이미지) 추가

dev
이범준 5 months ago
parent 65cc22ff1d
commit 9919bfa05e

@ -294,15 +294,22 @@
rndDtlRptCnt: datasetListPrd.length,
userId: "${currentUser.account}"
}
var fileArr = [];
$("input[type='file'][name='dsusePrdImgFiles']").each(function (i) {
fileArr.push(this.files[0]);
});
let saveData = {
dsuseMgtJsonStr: JSON.stringify(saveBsshData),
dsuseMgtDtlsJsonStr: JSON.stringify(datasetListPrd),
// 폐기상품이미지목록
dsusePrdImgFiles: []
dsusePrdImgFiles: fileArr
}
let create = (jsonBssh.dscdmngId == "");
ajax.post({
upload({
url: '<c:url value="${apiHost}/api/biz/nims/v1/saveDsuseMgtReceipt" />'
, data: saveData || {}
, success: resp => {

@ -332,7 +332,7 @@
var template = document.getElementById("imgCheckboxTemplate--${pageName}").innerHTML;
template = template.replace(/{name}/gi, "dsusePrdImgFilesSlector");
template = template.replace(/{name}/gi, "dsuseDsuseImgFilesSelector");
template = template.replace(/{value}/gi, item.id);
template = template.replace(/{src}/gi, item.url);
@ -377,7 +377,7 @@
//이미지 삭제 버튼
$("#btnImageDel--${pageName}").on("click", function() {
var checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsusePrdImgFilesSlector']:checked");
var checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsuseDsuseImgFilesSelector']:checked");
if(checkeds.length > 0){
var keys = [];
checkeds.each(function(){

Loading…
Cancel
Save