You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
6.7 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>打包下载</title>
<link href="../../DataUser/Style/ccbpm.css" rel="Stylesheet" />
<script type="text/javascript" src="../Scripts/QueryString.js"></script>
<script type="text/javascript" src="../Scripts/jquery-1.7.2.min.js"></script>
<!-- 导入配置文件. -->
<script type="text/javascript" src="../Scripts/config.js"></script>
<script type="text/javascript" src="../Comm/Gener.js"></script>
<script type="text/javascript">
$(function () {
var fileTypes = GetQueryString("FileType");
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddUrlData();
handler.AddPara("BasePath", basePath);
var data = handler.DoMethodReturnString("Packup_Init");
if (data.indexOf('err@') == 0) {
document.getElementById("Msg").innerHTML = data;
return;
}
if (data.indexOf('warning@') == 0) {
document.getElementById("Msg").innerHTML = data;
return;
}
if (data.indexOf('info@') == 0) {
data = data.replace("info@", "");
data = JSON.parse(data);
if (data.length == 0) {
alert("没有绑定表单,无需打印");
return;
}
var html = "";
html += "<fieldset>";
html += "<legend>ND" + GetQueryString("FK_Node") + "绑定的表单</legend>";
html += "<ul>";
for (var i = 0; i < data.length; i++) {
html += "<li><a href='javaScript:void(0)' target=_blank onclick='PackUpPDF(\"" + data[i].No + "\",\"" + data[i].Name + "\")' >" + data[i].Name + "</a></li>";
}
html += "<li>说明点击上面的表单名称生成PDF进行打印</li>";
html += "</ul>";
html += "</fieldset>";
html += "<br><br><center><div style=''><a href='javascript:CloseWindow();' >关闭窗口</a></div></center>";
document.getElementById("Msg").innerHTML = html;
return;
}
var filetype = GetQueryString("FileType");
var urls = JSON.parse(data);
var html = "";
for (var i = 0; i < urls.length; i++) {
var url = urls[i];
if (fileTypes.indexOf(url.No) < 0)
continue;
if (url.No == "htm" || url.No == "html" || url.No.indexOf("htm_") == 0) {
html += "<fieldset>";
html += "<legend>html在线预览打印</legend>";
html += "<ul>";
html += "<li>系统把整个表单生成了一个静态的html文件.</li>";
html += "<li>点击这里<a href=" + url.Name + " target=_blank ><img src='../Img/FileType/htm.gif' />进行在线预览</a></li>";
html += "</ul>";
html += "</fieldset>";
SetHref(url.Name);
}
if (url.No == "pdf") {
if (url.Name.indexOf('err@') == 0) {
html += "<fieldset>";
html += "<legend>pdf 生成pdf出现错误</legend>";
html += "<font color=red>" + url.Name + "</font>";
html += "</fieldset>";
} else {
html += "<fieldset>";
html += "<legend>pdf 在线打印与预览</legend>";
html += "<ul>";
html += "<li>系统把整个表单生成了一个pdf文件.</li>";
html += "<li>点击这里<a href=" + url.Name + " target=_blank ><img src='../Img/FileType/pdf.gif' />进行下载与在线预览</a></li>";
html += "</ul>";
html += "</fieldset>";
downloadFile(url.Name);
}
}
if (url.No == "zip") {
if (url.Name.indexOf('err@') == 0) {
html += "<fieldset>";
html += "<legend>生成zip出现错误</legend>";
html += "<font color=red>" + url.Name + "</font>";
html += "</fieldset>";
} else {
html += "<fieldset>";
html += "<legend>zip 在线打印与预览</legend>";
html += "<ul>";
html += "<li>系统把整个表单生成了一个zip文件,这个文件里包括了,表单的附件,二维码等信息.</li>";
html += "<li>点击这里<a href=" + url.Name + " target=_blank ><img src='../Img/FileType/Zip.gif' />进行打包下载</a></li>";
html += "</ul>";
html += "</fieldset>";
SetHref(url.Name);
}
}
}
html = '<b><font color=red>提示:如果不能弹出打印窗口,请点击连接手工打印下载.</font></b>' + html;
html += "<br><br><center><div style=''><a href='#' onclick='CloseWindow()' >关闭窗口</a></div></center>";
document.getElementById("Msg").innerHTML = html;
});
function CloseWindow() {
debugger
if (window.parent && typeof window.parent.layer == "object")
window.parent.layer.close(parent.layer.index);
else
window.close();
}
function PackUpPDF(frmId, frmName) {
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddUrlData();
handler.AddPara("FrmID", frmId);
handler.AddPara("FrmName", frmName);
handler.AddPara("BasePath", basePath);
var data = handler.DoMethodReturnString("Packup_FromInit");
if (data.indexOf('err@') == 0 || data.indexOf('warning@') == 0) {
alert(data);
return;
}
var url = JSON.parse(data);
downloadFile(url[0].Name);
}
function downloadFile(url) {
window.open(url);
return;
}
</script>
<style type="text/css">
#tb_msg
{
height: 72px;
width: 272px;
}
</style>
</head>
<body>
<div id="Msg"><img src='../Img/loading.gif' />正在加载请稍候... </div>
</body>
</html>