<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CorporateClientsUpLoadContract.aspx.cs" Inherits="CY.WebForm.Pages.business.CorporateClientsUpLoadContract" %>
|
|
<%-- 上传合同页面 廖 20210916增加--%>
|
<!DOCTYPE html>
|
<script src="./../../myPagination/js/share/js/jquery.min.js" type="text/javascript"></script>
|
<%--<script src="./../../js/jquery.hammer.min.js" type="text/javascript"></script>--%>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head id="Head1" runat="server">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title></title>
|
|
|
<uc:CMSHead ID="CMSHead1" runat="server" />
|
|
</head>
|
<body>
|
<form id="form1" runat="server">
|
<div class="box1" paneltitle="功能面板" roller="false">
|
<table class="TableNewStyle">
|
<tr>
|
<td style="width:200px">新增或者替换合同页面:
|
</td>
|
|
<td style="width:100px">第
|
<input type="text" runat="server" id="TextPage" style="width:40px" onkeyup="value=value.replace(/[^\d]/g,'')" />
|
页
|
</td>
|
<td class="ali03"></td>
|
|
<td class="ali03">
|
<input type="file" id="filesel" name="__hetongFile" keepdefaultstyle="true" runat="server" text="请选择文件" /></td>
|
<td>
|
<asp:Button ID="UpdateFileNew" Text="上传" runat="server" OnClick="btn_Submit_Click" OnClientClick="return checkSelFile()" /></td>
|
</tr>
|
</table>
|
|
|
</div>
|
|
<div class="box1" paneltitle="功能面板" roller="false">
|
<table class="TableNewStyle">
|
<tr>
|
<td class="ali06" style="width:200px">
|
|
批量上传:
|
|
</td>
|
<td class="ali03" style="width:100px">
|
</td>
|
|
<td class="ali03"></td>
|
|
<td class="ali03">
|
<input type="file" id="file2" name="__hetongMutilfiles" keepdefaultstyle="true" multiple="multiple" runat="server" text="请选择文件"/></td>
|
<td>
|
<asp:Button ID="Button1" Text="批量上传" runat="server" OnClick="btn_Submit_Click_multi" OnClientClick="return checkSelMulitFile()" /></td>
|
</tr>
|
</table>
|
</div>
|
<div>
|
|
<p style="text-align: center">已有页面</p>
|
|
<asp:Repeater ID="RepClientList" runat="server">
|
<HeaderTemplate>
|
<table class="tableStyle">
|
<tr>
|
<%-- <th width="25"></th>--%>
|
<th width="60" style="text-align: center">页码
|
</th>
|
<th style="text-align: center">预览
|
</th>
|
<th style="text-align: center">操作
|
</th>
|
|
|
</tr>
|
</HeaderTemplate>
|
|
|
<ItemTemplate>
|
<tr>
|
<%-- <td>
|
<input type="checkbox" class="SelectCheck" value_kid="<%#Eval("Keyid")%>" />
|
</td>--%>
|
<td>第 <%#Eval("PageCode")%> 页
|
</td>
|
<td>
|
|
<a title="点击查看原图" href="<%#Eval("FilePath").ToString() %>" target="view_window">
|
<img src="<%#Eval("FilePath").ToString() %>" width="80" height="100" />
|
</a>
|
|
</td>
|
|
|
<td>
|
|
<a onclick="delelid('<%#Eval("Keyid")%>','<%= Request["Keyid"]%>')">删除当前页面</a>
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
</ItemTemplate>
|
|
|
<FooterTemplate>
|
</table>
|
</FooterTemplate>
|
|
|
|
|
|
</asp:Repeater>
|
<div id="page">
|
<uc:UCPager ID="UCPager1" runat="server" />
|
</div>
|
|
|
|
|
</div>
|
<button id="Buttonupload" onclick="onViewuplodshow('<%= Request["Keyid"]%>')">浏览全部</button>
|
|
<asp:Button ID="Button3" Text="删除所有合同" runat="server" OnClick="btn_Submit_Click_DELLALL" />
|
|
|
</form>
|
</body>
|
</html>
|
<script type="text/javascript">
|
|
//查看
|
function checkSelMulitFile() {
|
|
var oFile = document.getElementById('file2');
|
if (oFile.value == "") {
|
alertMsg('没有选择文件');
|
return false;
|
|
}
|
//debugger;
|
//replaceParamVal("deleteKeyIds", "");
|
return true;
|
}
|
//查看
|
function checkSelFile() {
|
|
if (document.getElementById("TextPage").value == "") {
|
alertMsg("没有输入页数");
|
|
return false;
|
}
|
var oFile = document.getElementById('filesel');
|
if (oFile.value == "") {
|
alertMsg('没有选择文件');
|
return false;
|
|
}
|
//debugger;
|
//replaceParamVal("deleteKeyIds", "");
|
return true;
|
}
|
|
//改变参数
|
function changeURLArg(url, arg, arg_val) {
|
var pattern = arg + '=([^&]*)';
|
var replaceText = arg + '=' + arg_val;
|
if (url.match(pattern)) {
|
var tmp = '/(' + arg + '=)([^&]*)/gi';
|
tmp = url.replace(eval(tmp), replaceText);
|
return tmp;
|
} else {
|
if (url.match('[\?]')) {
|
return url + '&' + replaceText;
|
} else {
|
return url + '?' + replaceText;
|
}
|
}
|
}
|
|
|
// 获取url里的参数
|
|
function getURLString(arg) {
|
var reg = new RegExp("(^|&)" + arg + "=([^&]*)(&|$)", "i");
|
var r = window.location.search.substr(1).match(reg);
|
if (r != null)
|
return unescape(r[2]);
|
return null;
|
}
|
|
//替换指定传入参数的值,paramName为参数,replaceWith为新值
|
function replaceParamVal(paramName, replaceWith) {
|
var oUrl = this.location.href.toString();
|
var re = eval('/(' + paramName + '=)([^&]*)/gi');
|
var nUrl = oUrl.replace(re, paramName + '=' + replaceWith);
|
this.location = nUrl;
|
window.location.href = nUrl
|
}
|
//删除制定合同页面
|
function delelid(KeyID, pageID) {
|
|
|
top.Dialog.confirm("是否要删除该合同页面?", function () {
|
window.location = "/Pages/business/CorporateClientsUpLoadContract.aspx?deleteKeyIds=" + KeyID + "&Keyid=" + pageID;
|
}
|
);
|
}
|
|
|
|
//维护
|
function onViewuplodshow(keyid) {
|
|
|
top.Dialog.open({ URL: "/Pages/business/CorporateClientsContractShow.aspx?Keyid=" + keyid, Title: "浏览合同", Width: 1024, Height: 750 });
|
}
|
|
$(document).ready(function () {
|
$("#file2").change(function () {
|
var myfile = document.getElementById('file2');
|
|
|
for (let i = 0; i < myfile.files.length; i++)
|
{
|
var filepath = myfile.files[i].name;
|
|
var extStart = filepath.lastIndexOf(".");
|
var ext = filepath.substring(extStart, filepath.length).toUpperCase();
|
if (ext != ".BMP" && ext != ".PNG" && ext != ".GIF" && ext != ".JPG" && ext != ".JPEG") {
|
alertMsg("图片限于bmp,png,gif,jpeg,jpg格式");
|
|
return false;
|
} else { $("#fileType").text(ext) }
|
|
var ext = filepath.substring(0, extStart);
|
if (isNumber(ext)) {
|
|
}
|
else {
|
alertMsg(filepath + '文件名有误');
|
return false;
|
}
|
|
}
|
|
//var file_size = 0;
|
//if ($.browser.msie) {
|
// var img = new Image();
|
// img.src = filepath;
|
// while (true) {
|
// if (img.fileSize > 0) {
|
// if (img.fileSize > 3 * 1024 * 1024) {
|
// alert("图片不大于100MB。");
|
// } else {
|
// var num03 = img.fileSize / 1024;
|
// num04 = num03.toFixed(2)
|
// $("#fileSize").text(num04 + "KB");
|
// }
|
// break;
|
// }
|
// }
|
//} else {
|
// file_size = this.files[0].size;
|
// var size = file_size / 1024;
|
// if (size > 10240) {
|
// alert("上传的图片大小不能超过10M!");
|
// } else {
|
// var num01 = file_size / 1024;
|
// num02 = num01.toFixed(2);
|
// $("#fileSize").text(num02 + " KB");
|
// }
|
//}
|
return true;
|
});
|
});
|
function isNumber(val) {
|
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
|
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
|
if (regPos.test(val) || regNeg.test(val)) {
|
return true;
|
} else {
|
return false;
|
}
|
}
|
|
</script>
|