⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 partspicker.aspx

📁 CRM系统源码
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PartsPicker.aspx.cs" Inherits="CRM.WEB.Bussiness.UserControls.PartsPicker" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>商品选择</title>
    <link href="../../Css/TabPage.css" rel="stylesheet" type="text/css" />
     <link href="../../Css/Common.css" type="text/css" rel="stylesheet" />
<link href="../../Css/grid.css" type="text/css" rel="stylesheet" />
</head>
<body id="MasterPageBody">
    <form id="form1" runat="server">
        <div>
            <table style="width: 100%; height: 90%;" border="0" cellpadding="2" cellspacing="0"
                class="border">
                <tr>
                    <td colspan="2" style="height:30px; text-align: right;" class="title" >
                        选择的商品:
                        <input id="TxtProductName" readonly="readonly" size="40" style="text-align: left; width: 80%;" type="text" />
                        <br />
                        <input id="BtnDelLast" type="button" value="删除最后" onclick="DeleteLast()" class="button" />
                        <input id="BtnDelAll" type="button" value="删除全部" onclick="DeleteAll()" class="button" />
                        <input id="Button1" type="button" value=" 返 回 " onclick="ReturnValueToOpener()" class="button" />
                    </td>
                </tr>
                <tr>
                    <td class="tdbg" align="center" valign="top" style="width: 20%;">
                       <table style="width: 100%; height: 100%;" oncontextmenu="window.event.returnValue=false">
        <tr>
            <td valign="top">
                <div style="text-align: left">
                    <table>
                        <tr>
                            <td align="left">
                             <asp:TreeView ID="tv" runat="server" ExpandImageUrl="~/images/bm_close.gif" CollapseImageUrl="~/images/bm_open.gif">
            <SelectedNodeStyle BackColor="Khaki" />
            </asp:TreeView>
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
    </table>
                    </td>
                    <td class="tdbg" align="left" valign="top" style="width: 80%;">
                        <iframe id="main_right" name="main_right" scrolling="auto" style="width: 100%; height: 450px"
                            src="PartsShow.aspx" frameborder="0" marginheight="0" marginwidth="1"></iframe>
                    </td>
                </tr>
            </table>
        </div>
    </form>
        <script type="text/javascript">
        
        Array.prototype.del=function(n) {  
            if(n<0)  
                return this;
            else
                return this.slice(0,n).concat(this.slice(n+1,this.length));
        }
        
        var productList = new Array();
        var txtProductName =document.getElementById('TxtProductName');
        
        //返回Opener
        function ReturnValueToOpener()
        {
            if(txtProductName.value =='')
            {
                alert('请选择商品!');
                return;
            }
            //ProductID,ProductName,Property,isPresent$ProductID,ProductName,Property,isPresent ...
            window.opener.DoPartsPickerPostBack(productList.join('$'));
            window.close();
        }
        
        function AddProduct(productId,productName)
        {
            var names = txtProductName.value.split(',');
            var productName2 = productName;           
            for(i=0;i<names.length;i++)
            {
                if(names[i] == productName2)
                {
                    alert("此商品已被选择!");
                    return;
                }
            }
            if(txtProductName.value=='')
            {
                txtProductName.value = productName2;
            }
            else
            {
                txtProductName.value += ","+ productName2;
            }
            //添加到数组
            productList[productList.length] = new Array(productId,productName);
        }        
        function DeleteLast()
        {
            txtProductName.value = txtProductName.value.substring(0,txtProductName.value.lastIndexOf(","));
            productList=productList.del(productList.length -1);
        }
        
        function DeleteAll()
        {
            txtProductName.value='';
            productList = new Array();
        }
        </script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -