添加的存储过程:(添加退货申请信息的存储过程)
CREATE PROCEDURE [dbo].[BioBackSendGoods_ADD] @SendBackID INT OUTPUT, @SubJect NVARCHAR(100), @AppUserID INT, @DepartMentID INT, @EndTimeLimit DATETIME, @SendUnit NVARCHAR(100), @BackUnit INT, @SendID INT, @SendAppUser INT, @SendRealUser INT, @SendDate DATETIME, @BackRealUser INT AS INSERT INTO [BioBackSendGoods]( [SubJect],[AppUserID],[DepartMentID],[EndTimeLimit],[SendUnit],[BackUnit],[SendID],[SendAppUser],[SendRealUser],[SendDate],[BackRealUser] )VALUES( @SubJect,@AppUserID,@DepartMentID,@EndTimeLimit,@SendUnit,@BackUnit,@SendID,@SendAppUser,@SendRealUser,@SendDate,@BackRealUser ) SET @SendBackID = @@IDENTITY GO
视图:
CREATE VIEW [dbo].[BioBackSendGoodsViews] AS SELECT SendBackID, SubJect, AppUserID, AppUserName=dbo.getUserNameByUserID(AppUserID), SubmitTime, DepartMentID, DepartMentName=dbo.FN_GetDepartMentByID(DepartMentID), EndTimeLimit, DeleteSate, SendUnit, BackUnit, BackUnitName=dbo.getCustomerByID(BackUnit), SendID, SendAppUser, SendAppUserName=dbo.getUserNameByUserID(SendAppUser), SendRealUser, SendRealUserName=dbo.getUserNameByUserID(SendRealUser), SendDate, BackRealUser, BackRealUserName=dbo.getUserNameByUserID(BackRealUser), DoneTime, isQualityCheck, QualityUserID, QualityUserName=dbo.getUserNameByUserID(QualityUserID), isfinance, FinanceUserID, FinanceUserName=dbo.getUserNameByUserID(FinanceUserID), StockUserid, StockUserName=dbo.getUserNameByUserID(StockUserid), IsStockAllow, StockID, StockName=dbo.FN_getStockNameByStockID(StockID), BackProTotalCount=ISNULL(dbo.FN_getTotalProCount(SendBackID),0), BackProTotalMoney=ISNULL(dbo.FN_getTotalProMoney(SendBackID),0) FROM BioBackSendGoods
添加退货产品信息的存储过程:
CREATE PROCEDURE [dbo].[BioBackGoodsPro_ADD] @BackSendID INT, @ProID INT, @ProName NVARCHAR(100), @SendCount INT, @BackGoodsCount INT, @BackProBaths NVARCHAR(100), @SendPrice MONEY, @BackPrice MONEY, @StockDate DATETIME, @ExPriationDate DATETIME, @MakeDate DATETIME, @ReturnBackBox NVARCHAR(100), @proBaths NVARCHAR(100) AS INSERT INTO [BioBackGoodsPro]( [BackSendID],[ProID],[ProName],[SendCount],[BackGoodsCount],[BackProBaths],[SendPrice],[BackPrice],[StockDate],[ExPriationDate],
[MakeDate],[ReturnBackBox],[proBaths] )VALUES( @BackSendID,@ProID,@ProName,@SendCount,@BackGoodsCount,@BackProBaths,@SendPrice,@BackPrice,@StockDate,@ExPriationDate,
@MakeDate,@ReturnBackBox,@proBaths )
退货申请的前端页面:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BackSendGoodsNew.aspx.cs" Transaction="Required" Inherits="BioErpWeb.BackSendGoods.BackSendGoodsNew" %> <%@ Register Src="../UserControl/BaseTop.ascx" TagName="BaseTop" TagPrefix="uc2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="../Styles/ERPBaseStyle.css" rel="stylesheet" type="text/css" /> <link href="../Styles/Style.css" rel="stylesheet" type="text/css" /> <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script src="../Scripts/jquery.validate.js" type="text/javascript"></script> <script src="../Scripts/validateExtender.js" type="text/javascript"></script> <script src="../Scripts/ValidateMessage_ZW.js" type="text/javascript"></script> <script src="../Scripts/jquery.metadata.js" type="text/javascript"></script> <link href="../Styles/InputStyle1.css" rel="stylesheet" type="text/css" /> <script src="../JS/CheckDepartMent.js" type="text/javascript"></script> <script src="../Scripts/jquery-ui-1.7.custom.min.js" type="text/javascript"></script> <link href="../Scripts/jquery-ui-1.7.custom.css" rel="stylesheet" type="text/css" /> <script src="../JS/CheckUserName.js" type="text/javascript"></script> <script src="../JS/CustomerName.js" type="text/javascript"></script> <script src="../JS/ProNameChoose.js" type="text/javascript"></script> <script src="../JS/SendNumberCheck.js" type="text/javascript"></script> <script src="../Scripts/Comm.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#form1").validate(); }); </script> <style type="text/css"> .trbar { background-color: #eeeeee; } .w80 { 80px; } .w100 { 100px; } .w150 { 150px; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <table class="maintable Inupttable" style=" 900px;"> <tr> <td colspan="8"> <uc2:BaseTop ID="BaseTop1" runat="server" /> </td> </tr> <tr> <td class="w80"> 申请部门 </td> <td class="w150"> <asp:DropDownList ID="ddlDepartMent" runat="server"> </asp:DropDownList> </td> <td class="style14"> 制表人 <asp:Label ID="lbApplayUser" runat="server"></asp:Label> </td> <td> 经手人 </td> <td> <asp:TextBox ID="txtRealUserID" CssClass="{required:true,digits:true, min:1}" runat="server" Width="78px"></asp:TextBox> <input id="btnUser" type="button" value="选择" class="btnchoose" onclick="showDialog3()" /> </td> <td> 制表时间 </td> <td> <asp:Label ID="lbTime" runat="server" Text="Label"></asp:Label> </td> </tr> </table> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table class="maintable Inupttable" style=" 900px;"> <tr> <td> <span>退货客户</span><span> <asp:TextBox ID="txtSendCom" runat="server" Width="59px" CssClass="{required:true,digits:true, min:1}" OnTextChanged="txtSendCom_TextChanged"></asp:TextBox> <asp:Button ID="Button2" runat="server" Text="选择" UseSubmitBehavior="false" class="btnchoose" OnClientClick="showCustomerDialog3()" /> <asp:Label ID="Label2" runat="server" Text="→" ForeColor="Green"></asp:Label> <asp:Label ID="lbCustomer" runat="server" Text=""></asp:Label> </span><span>选择退货单据</span> <span> <asp:TextBox ID="txtSendNumber" runat="server" ontextchanged="txtSendNumber_TextChanged"></asp:TextBox> <asp:Button ID="Button3" runat="server" class="btnchoose" OnClientClick="{showBackSendNumber($('#txtSendCom').val())}" Text="选择" UseSubmitBehavior="false" /> <asp:Label ID="Label1" runat="server" CssClass="red" Text="提示:请按箭头指向顺序操作,如知道发货单单号,可直接在下面输入发货单号查询">
</asp:Label> </span> </td> </tr> <tr> <td> <div> <asp:Label ID="Label7" runat="server" CssClass="gray2" Text="以下信息为对应发货单原始记录,如需退货请在填写必要信息:"></asp:Label> </div> </td> </tr> </table> <table class="maintable Inupttable" style=" 900px;"> <tr> <td> 退货单据 </td> <td> <asp:TextBox ID="txtSendID1" Width="60px" runat="server" AutoPostBack="True" ontextchanged="txtSendID1_TextChanged"></asp:TextBox> </td> <td class="style6"> 发货商 </td> <td class="style8"> <asp:TextBox ID="txtSendUnit" ReadOnly="true" runat="server"></asp:TextBox> </td> <td class="style11"> 退货商 </td> <td> <asp:TextBox ID="txtBackUnit" ReadOnly="true" runat="server"></asp:TextBox> </td> <tr> <td> 发货申请人 </td> <td> <asp:TextBox ID="txtSenApplay" ReadOnly="true" Width="60px" runat="server"></asp:TextBox> </td> <td class="style6"> 发货经手人 </td> <td class="style8"> <asp:TextBox ID="txtSendRealUser" ReadOnly="true" runat="server"></asp:TextBox> </td> <td class="style11"> 发货时间 </td> <td> <asp:TextBox ID="txtSendDate" ReadOnly="true" runat="server"></asp:TextBox> </td> </tr> </table> <table id="tb2" cellpadding="0" border="0" cellspacing="0" class="maintable Inupttable" style=" 900px;"> <tr> <td class="blue4"> 产 品 名 称 及 规 格( 批号货号信息 ) </td> <td class="blue4"> 可退货数量 </td> <td class="blue4"> 退货数量 </td> <td class="blue4"> 发货价 </td> <td class="blue4"> 退货价 </td> <td class="blue4"> 批号 </td> <td class="blue4"> 退货货号 </td> <td class="blue4"> 入库日期 </td> <td class="blue4"> 近效期 </td> <td class="blue4"> 生产日期 </td> </tr> <tr> <td id="td2" class="blue4" style=" 200px;"> <input id="txtProName0" readonly="readonly" name="txtProName0" type="text" class="input" style="color: green; 200px" /> <input name="txtProID" type="hidden" /> </td> <td> <input id="txtProCount0" readonly="readonly" name="txtProCount0" class="input" type="text" style="color: green; 60px;" /> </td> <td> <input id="txtBacknum" name="txtBaxknum" maxlength="7" title="提示:这里填写退货数量,如果此产品不退货,请保持它的默认值0。" class="input" style=" 60px;" type="text" value="0" /> </td> <td> <input id="txtProPrice0" readonly="readonly" name="txtProPrice0" class="input" style="color: green; 60px" type="text" /> </td> <td> <input id="txtbackPrice" name="txtbackPrice" maxlength="8" class="input" title="提示:此处填写退货价格,此处默认为发货价格,可以根据需要修改" style=" 60px;" type="text" value="0" /> </td> <td class="blue4"> <input id="txtProBatch0" name="txtProBatch0" readonly="readonly" class="input" style=" 85px; color: green" type="text" /> </td> <td> <input id="txtProBoxNum0" name="txtProBoxNum0" class="input" style=" 105px;" maxlength="50" title="提示:此处填写货号,此处为默认货号,可根据需要修改" type="text" /> </td> <td> <input id="txtMarkDate0" readonly="readonly" name="txtStockDate0" class="input" style=" 70px; color: green" type="text" /> </td> <td> <input id="txtExPirationDate0" readonly="readonly" name="txtExPirationDate0" class="input" style=" 70px; color: green" type="text" /> </td> <td> <input id="txtMakeDate" name="txtMakeDate" class="input" title="提示:此处生产日期默认'1900-01-01',
如果知道真实生产日期,请修改为退货产品的真实日期;如果不知道,请保持默认值。格式:YYYY-MM-DD" style="75px;" type="text" value="1900-01-01" /> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> <table class="maintable Inupttable" style=" 900px;"> <tr> <td> 备注: </td> <td colspan="5"> <asp:TextBox ID="txtRemark" runat="server" Width="523px"></asp:TextBox> </td> <td> 审批核人 </td> <td> <asp:TextBox ID="txtNetUserId" CssClass="{required:true,digits:true, min:1}" runat="server" Width="70px"></asp:TextBox> <input id="btnUser0" type="button" value="选择" class="btnchoose" onclick="showDialog3()" /> </td> </tr> <tr> <td colspan="8" class="bottomtd"> <asp:Button ID="btnSubmit0" runat="server" Text="暂存" OnClick="btnSubmit0_Click" /> <asp:Button ID="btnSubmit" runat="server" Text="保存" OnClick="btnSubmit_Click" /> </td> </tr> </table> <asp:HiddenField ID="hf_applayUserid" runat="server" /> <asp:HiddenField ID="hfBackUnitID" runat="server" /> <asp:HiddenField ID="hfBackApplayUserid" runat="server" /> <asp:HiddenField ID="hfBackRealUserid" runat="server" /> <br /> <br /> </div> </form> </body> </html>
前端js:
//客户选择对话框 function showBackSendNumber(backUnitID) { if (backUnitID == undefined || backUnitID == '' || backUnitID == '请选择') { alert('请先选择退货单位'); return false; } var backunitid = backUnitID; var re = showModalDialog("../../PersonList/SendNOList.aspx?backUnitID=" + backunitid,"", "dialogWidth=320px;dialogHeight=350px"); var obj = window.event.srcElement; var td = obj.parentNode; var txts = td.getElementsByTagName('input'); if (re == null || re == "") { if (txts[0].value == "" || txts[0].value == null) { txts[0].value = "请选择"; } } else { txts[0].value = re; } }
选择的嵌套页面的前台:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SendNOList.aspx.cs" Inherits="BioErpWeb.PersonList.SendNOList" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script> <link href="../Styles/ERPBaseStyle.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function search() { if (document.getElementById("txtSearchName").value == "") { alert("请输入退货单号(模糊查询)"); return false; } } function choose() { var value = document.getElementById("sltUserList").value; window.returnValue = value; window.close(); } </script> <style type="text/css"> #PersonIframeList { height: 233px; } </style> </head> <body> <form id="form1" runat="server"> <div> <br /> <table> <tr> <td> <span>退货单据 <input id="txtSearchName" name="txtSearchName" runat="server" type="text" size="50" style=" 150px;" maxlength="50" /> </span> <asp:Button ID="Button1" runat="server" OnClientClick="search()" Text="查询" onclick="Button1_Click" /> </td> </tr> <tr> <td> <select multiple="multiple" id="sltUserList" onchange="choose()" style=" 292px; margin:0px; height: 187px;"> <%=this.GetUserList%> </select> </td> </tr> <tr> <td style="vertical-align: bottom;" class="bottomtd"> <span id="chooseProName"> <input type="button" value="选择" onclick="choose()" style=" 100px;" /> </span> </td> </tr> </table> </div> </form> </body> </html>