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

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

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

@ -332,7 +332,7 @@
var template = document.getElementById("imgCheckboxTemplate--${pageName}").innerHTML; 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(/{value}/gi, item.id);
template = template.replace(/{src}/gi, item.url); template = template.replace(/{src}/gi, item.url);
@ -377,7 +377,7 @@
//이미지 삭제 버튼 //이미지 삭제 버튼
$("#btnImageDel--${pageName}").on("click", function() { $("#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){ if(checkeds.length > 0){
var keys = []; var keys = [];
checkeds.each(function(){ checkeds.each(function(){

Loading…
Cancel
Save