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.

131 lines
4.3 KiB
Plaintext

11 months ago
<head>
<title>驰骋工作流</title>
<script language="JavaScript" src="../Comm/JScript.js" type="text/javascript" ></script>
<script src="../Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../Scripts/QueryString.js" type="text/javascript"></script>
<!-- 引用通用的js文件. -->
<script type="text/javascript" src="../Scripts/config.js"></script>
<script type="text/javascript" src="../Comm/Gener.js"></script>
<script type="text/javascript" language="javascript" >
var result = null;
//页面启动函数.
$(function () {
$("#Msg").html("<img src=../Img/loading.gif />正在加载,请稍后......");
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
handler.AddUrlData();
// var data = handler.DoMethodReturnString("DtlOpt_Init");
// if (data.indexOf('err@') == 0) {
// alert(data); //如果是异常,就提提示.
// return;
// }
$("#Msg").html("<a href='javascript:DownTemplate();'><img src='../Img/FileType/xls.gif' />下载导入模版...</a>");
return;
});
//执行导入.
function Imp() {
//获取URL参数
var queryString = document.location.search.substr(1);
var doMethod = "DtlImpByExcel_Imp";
var httpHandlerName = "BP.WF.HttpHandler.WF_CCForm";
var URL = dynamicHandler + "?DoType=HttpHandler&DoMethod=" + doMethod + "&HttpHandlerName=" + httpHandlerName;
if (queryString.length > 0)
URL = URL + "&" + queryString;
var fileValue = $("#File_Upload").val();
//必须要选择文件
if (fileValue == "") {
$.messager.alert("提示", "没有选择从表模板。");
return;
}
//扩展名
var index = fileValue.lastIndexOf('.');
var fileExt = fileValue.substring(index);
if (fileExt.toLowerCase() != ".xls") {
//$.messager.alert("提示", "首先,确认您上传的Excel文件,其次此版本仅支持97-2003版的Excel,所以你要确认你上传的文件后缀名为xls");
// return;
}
//提交数据
$("#cc").form("submit", {
type: 'POST',
dataType: 'html',
url: URL,
onSubmit: function (param) {
//return false; //这里可以做表单的验证如果验证失败就return false 来终止表单提交
},
success: function (data) {
//刷新 从表的IFRAME
// parent.location.reload();
alert(data);
window.close();
}
});
//怎么增加文件?
//var data = handler.DoMethodReturnString("DtlImpByExcel_Imp");
// alert(data);
//return;
}
//下载指定格式的模版.
function DownTemplate() {
if (plant == "JFlow") {
var url = basePath + "DataUser/DtlTemplete/" + GetQueryString("EnsName") + ".xls";
}
else {
var url = basePath + "/DataUser/DtlTemplete/" + GetQueryString("EnsName") + ".xls";
}
WinOpen(url);
}
</script>
</head>
<body>
<form id="cc" name="cc" action="" enctype="multipart/form-data" method="post" >
<fieldset>
<legend> 导入导出 </legend>
<br />
第1步:点击本机文件:
<input type=file id="File_Upload" name="File_Upload" />
<br />
<br />
第2步选择方式: <select id="DDL_ImpWay" name="DDL_ImpWay">
<option value="0"> 清空方式</option>
<option value="1"> 追加方式</option>
</select>
<br />
<br />
第3步:<input type="button" onclick="Imp();" value="执行导入" />
<br />
<br />
<p>
</p>
</fieldset>
<div id="Msg" ></div>
</form>
</body>
</html>