CB2-20200827ONU\Administrator
2021-10-08 d789099e9dc45e7fa3ee0eb73ee97f80b1963466
CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsUpLoadContract.aspx
@@ -1,8 +1,9 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CorporateClientsUpLoadContract.aspx.cs" Inherits="CY.WebForm.Pages.business.CorporateClientsUpLoadContract" %>
<%-- 上传合同页面  廖 20210916增加--%>
<!DOCTYPE html>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.hammer.min.js" type="text/javascript"></script>
<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">
@@ -11,25 +12,49 @@
    
 
      <uc:CMSHead ID="CMSHead1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
           <div class="box1" paneltitle="功能面板" roller="false">
            <table class="TableNewStyle">
                <tr>
                      <td class="ali03">新增合同页面:
                        </td>
                    <td class="ali03">
                        页码:
                    <td style="width:200px">新增或者替换合同页面:
                    </td>
                    <td>
                        第 <input type="text" runat="server" id="TextPage" /> 页
                    <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" multiple="multiple" runat="server"  /></td>
                    <td> <asp:Button ID="UpdateFileNew" Text="新增或者替换该页(上传图片)" runat="server" OnClick="btn_Submit_Click"   OnClientClick="return checkSelFile()" /></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>
@@ -37,24 +62,21 @@
  
              <p style="text-align:center"> 已有页面</p>
   
            <asp:repeater id="RepClientList" runat="server" >
                <headertemplate>
            <asp:Repeater ID="RepClientList" runat="server">
                <HeaderTemplate>
                    <table class="tableStyle">
                        <tr>
                           <%-- <th width="25"></th>--%>
                            <th width="60" style="text-align:center">
                                页码
                            <th width="60" style="text-align: center">页码
                            </th>
                            <th style="text-align:center" >
                                预览
                            <th style="text-align: center">预览
                            </th>
                           <th style="text-align:center">
                                操作
                            <th style="text-align: center">操作
                            </th>               
                          
                          
                        </tr>
                </headertemplate>
                </HeaderTemplate>
              
                <ItemTemplate>
@@ -62,13 +84,13 @@
                           <%-- <td>
                                <input type="checkbox" class="SelectCheck" value_kid="<%#Eval("Keyid")%>" />
                            </td>--%>
                            <td>
                               第  <%#Eval("PageCode")%> 页
                        <td>第  <%#Eval("PageCode")%> 页
                            </td>
                            <td>
                                 
                             <a   title="点击查看原图"   href="<%#Eval("FilePath").ToString() %>" target="view_window">
                                   <img src="<%#Eval("FilePath").ToString() %>"  width="80" height="100"/> </a>
                                <img src="<%#Eval("FilePath").ToString() %>" width="80" height="100" />
                            </a>
                       
                            </td>
@@ -96,7 +118,7 @@
                </asp:repeater>
            </asp:Repeater>
                     <div id="page">
                    <uc:UCPager ID="UCPager1" runat="server" />
                </div>
@@ -105,12 +127,29 @@
                 
             
              </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() {
    
@@ -125,12 +164,50 @@
                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;
@@ -138,4 +215,81 @@
        );
    }
            
    //维护
    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>