|
@@ -18,6 +18,9 @@
|
|
type : 'date'
|
|
type : 'date'
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ function fileForm() {
|
|
|
|
+ alert("!");
|
|
|
|
+ }
|
|
function deleteForm(typeId,id) {
|
|
function deleteForm(typeId,id) {
|
|
var itemId = $("#itemId").val();
|
|
var itemId = $("#itemId").val();
|
|
top.layer.confirm("确认要取消上传后的确认单?", {icon: 3, title:'系统提示'}, function(index){
|
|
top.layer.confirm("确认要取消上传后的确认单?", {icon: 3, title:'系统提示'}, function(index){
|
|
@@ -32,11 +35,11 @@
|
|
data : {"id":typeId,"itemId":itemId},
|
|
data : {"id":typeId,"itemId":itemId},
|
|
success : function(data) {
|
|
success : function(data) {
|
|
$("#"+id).val("未上传");
|
|
$("#"+id).val("未上传");
|
|
- $("#"+id).attr("style","color:red");
|
|
|
|
|
|
+ // $("#"+id).attr("style","color:red");
|
|
parent.layer.msg(data.msg, {icon: 1});
|
|
parent.layer.msg(data.msg, {icon: 1});
|
|
},
|
|
},
|
|
error : function(arg1, arg2, arg3) {
|
|
error : function(arg1, arg2, arg3) {
|
|
- parent.layer.msg(data.msg, {icon: 1});
|
|
|
|
|
|
+ parent.layer.msg(data.msg, {icon: 0});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -54,8 +57,7 @@
|
|
parent.layer.msg(data.msg, {icon: 1});
|
|
parent.layer.msg(data.msg, {icon: 1});
|
|
layer.close(index);
|
|
layer.close(index);
|
|
}else{
|
|
}else{
|
|
- // jp.error(data.msg);
|
|
|
|
- parent.layer.msg(data.msg, {icon: 5});
|
|
|
|
|
|
+ parent.layer.msg(data.msg, {icon:0});
|
|
layer.close(index);
|
|
layer.close(index);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -79,43 +81,24 @@
|
|
window.location.href='${ctx}/workMaterialCollect/total/import/template';
|
|
window.location.href='${ctx}/workMaterialCollect/total/import/template';
|
|
},
|
|
},
|
|
btn2: function(index, layero){
|
|
btn2: function(index, layero){
|
|
- // var oFiles = document.getElementById("uploadFile").files;
|
|
|
|
- // var element = $("#importForm").files[0];
|
|
|
|
- // var element = $("#uploadFile")[0].files[0];
|
|
|
|
- // var element = document.getElementById("uploadFile").files[0];
|
|
|
|
- // var file = document.getElementById("file").files[0];
|
|
|
|
- // var formData = new FormData($("#importForm")[0]);
|
|
|
|
- // console.log(formData);
|
|
|
|
- // console.log(file);
|
|
|
|
- // console.log(element);
|
|
|
|
- // formData.append("file", element);
|
|
|
|
- // var formData = new FormData();
|
|
|
|
- // formData.append("file",oFiles);
|
|
|
|
- // formData.append("itemHideId",$("#itemHideId").val());
|
|
|
|
- // formData.append("projectTypeId",$("#projectTypeId").val());
|
|
|
|
- // formData.append("remarks",$("#remarks").val());
|
|
|
|
- <%--$.ajax({--%>
|
|
|
|
- <%--url : '${ctx}/workMaterialCollect/total/import1',--%>
|
|
|
|
- <%--type : "post",--%>
|
|
|
|
- <%--data : formData,--%>
|
|
|
|
- <%--async:false,--%>
|
|
|
|
- <%--cache: false, // 不缓存数据--%>
|
|
|
|
- <%--processData: false, // 不处理数据--%>
|
|
|
|
- <%--contentType: false, // 不设置内容类型--%>
|
|
|
|
- <%--success : function() {--%>
|
|
|
|
- <%--parent.layer.msg("上传成功", {icon: 1});--%>
|
|
|
|
- <%--},--%>
|
|
|
|
- <%--error : function(arg1, arg2, arg3) {--%>
|
|
|
|
- <%--alert("1");--%>
|
|
|
|
- <%--}--%>
|
|
|
|
- <%--});--%>
|
|
|
|
- var inputForm =top.$("#importForm");
|
|
|
|
- var top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
|
|
|
|
- inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
|
|
|
|
- $("#"+status).val("已上传");
|
|
|
|
- // $("#"+status).attr("style","background-color: white");
|
|
|
|
- top.$("#importForm").submit();
|
|
|
|
- parent.layer.msg("上传成功", {icon: 1})
|
|
|
|
|
|
+ $.ajax({
|
|
|
|
+ url : '${ctx}/workMaterialCollect/total/import',
|
|
|
|
+ type : "post",
|
|
|
|
+ async:false,
|
|
|
|
+ cache: false, // 不缓存数据
|
|
|
|
+ processData: false, // 不处理数据
|
|
|
|
+ contentType: false, // 不设置内容类型
|
|
|
|
+ data : new FormData(top.$("#importForm")[0]),
|
|
|
|
+ success : function(data) {
|
|
|
|
+ if (data.success){
|
|
|
|
+ $("#"+status).val("已上传");
|
|
|
|
+ // $("#"+status).attr("style","background-color: white;");
|
|
|
|
+ parent.layer.msg(data.msg, {icon: 1});
|
|
|
|
+ }else {
|
|
|
|
+ parent.layer.msg(data.msg, {icon: 2});
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
btn3: function(index){
|
|
btn3: function(index){
|
|
@@ -139,16 +122,8 @@
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
<div id="importBox" class="hide">
|
|
<div id="importBox" class="hide">
|
|
- <%--<form id="importForm"style="padding-left:20px;text-align:center;"><br/>--%>
|
|
|
|
- <%--<input id="file" value="" name="file" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/> --%>
|
|
|
|
- <%--<div>--%>
|
|
|
|
- <%--<input type="hidden" name ="itemHideId" id="itemHideId"/>--%>
|
|
|
|
- <%--<input type="hidden" name ="projectTypeId" id="projectTypeId"/>--%>
|
|
|
|
- <%--<input type="hidden" name ="remarks" id="remarksId"/>--%>
|
|
|
|
- <%--</div>--%>
|
|
|
|
- <%--</form>--%>
|
|
|
|
- <form id="importForm" action="${ctx}/workMaterialCollect/total/import" method="post" style="padding-left:20px;text-align:center;" enctype="multipart/form-data"><br/>
|
|
|
|
- <input id="uploadFile" name="file" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/>
|
|
|
|
|
|
+ <form id="importForm" style="padding-left:20px;text-align:center;" method="post" enctype="multipart/form-data"><br/>
|
|
|
|
+ <input value="" id="file" name="file" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/>
|
|
<div>
|
|
<div>
|
|
<input type="hidden" name ="itemHideId" id="itemHideId"/>
|
|
<input type="hidden" name ="itemHideId" id="itemHideId"/>
|
|
<input type="hidden" name ="projectTypeId" id="projectTypeId"/>
|
|
<input type="hidden" name ="projectTypeId" id="projectTypeId"/>
|