Commit 57f9617d by 宋祥

1.优化上传附件弹窗和回调操作

parent f96ceae4
...@@ -5,7 +5,7 @@ $(function () { ...@@ -5,7 +5,7 @@ $(function () {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + item.filePath + 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + item.docId
+ '" >附件下载</a>'; + '" >附件下载</a>';
return template; return template;
} }
...@@ -15,33 +15,6 @@ $(function () { ...@@ -15,33 +15,6 @@ $(function () {
} }
}; };
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val();
if (isBlank(uploadFile)) {
return;
}
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", uploadFile);
EiCommunicator.send('HPSC002A', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
}
};
$("#ef_form_head").hide(); $("#ef_form_head").hide();
// 查询 // 查询
...@@ -72,9 +45,39 @@ var query = function (e) { ...@@ -72,9 +45,39 @@ var query = function (e) {
/** /**
* 文件上传 * 文件上传
* *
* @param id
*/ */
function uploadFile() { function uploadFile(id) {
uploadFileWindow.open().center(); JSColorbox.open({
href: "HPSC099?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "70%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", docId);
EiCommunicator.send('HPSC002A', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
// 关闭弹窗
JSColorbox.close();
} }
/** /**
......
...@@ -28,8 +28,4 @@ ...@@ -28,8 +28,4 @@
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
</EF:EFPage> </EF:EFPage>
...@@ -7,6 +7,10 @@ $(function () { ...@@ -7,6 +7,10 @@ $(function () {
$("#fileDocId").val(e.response.docId); $("#fileDocId").val(e.response.docId);
NotificationUtil("附件上传成功"); NotificationUtil("附件上传成功");
console.log($("#fileDocId").val()) console.log($("#fileDocId").val())
try {
parent.JSColorbox.setValueCallback(e.response.docId);
} catch (e){
}
}, },
} }
}; };
......
let rowId;
$(function() { $(function() {
// 查询 // 查询
...@@ -43,20 +42,23 @@ $(function() { ...@@ -43,20 +42,23 @@ $(function() {
}] }]
} }
}; };
});
// 关闭事件 /**
IPLATUI.EFWindow = { * 文件上传
"uploadFile": { *
close: function (e) { * @param id
let $iframe = uploadFileWindow.element.children("iframe"); */
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象 function openUploadFile(id) {
let uploadFile = iframejQuery("#fileDocId").val(); JSColorbox.open({
if (isBlank(uploadFile)) { href: "HPSC099?methodName=initLoad",
return; title: "<div style='text-align: center;'>附件上传</div>",
} width: "60%",
height: "70%",
callbackName: function (docId) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", rowId); inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-affix", uploadFile); inEiInfo.set("result-0-affix", docId);
EiCommunicator.send('HPZL001', 'bindDocIdById', inEiInfo, { EiCommunicator.send('HPZL001', 'bindDocIdById', inEiInfo, {
onSuccess(response) { onSuccess(response) {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
...@@ -67,19 +69,8 @@ $(function() { ...@@ -67,19 +69,8 @@ $(function() {
}, { }, {
async: false async: false
}); });
},
} }
}; });
});
/**
* 文件上传
*
* @param id
*/
function openUploadFile(id) {
uploadFileWindow.open().center();
rowId = id;
} }
/** /**
......
...@@ -60,7 +60,4 @@ ...@@ -60,7 +60,4 @@
hidden="true"/> hidden="true"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
</EF:EFPage> </EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment