ChargeDetailMaterial.aspx
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:15k
- <%@ page language="C#" autoeventwireup="true" inherits="Workflow_ChargeDetailMaterial, App_Web_-rs7x2pk" theme="Normal" %>
- <!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">
- <base target="_self" />
- <link href="style/gridStyle.css" rel="stylesheet" />
- <title>材料费用</title>
-
- <script type="text/javascript">
- //小计
- function sum1()
- {
- var price= parseFloat(document.getElementById("TB_MarketPrice").value); //默认为0
- var number= parseFloat(document.getElementById("TB_Number").value); //默认为1
-
- var BPrice = parseFloat(document.getElementById("TB_BudGetPrice").value);
- var a= price * number;
- var tcount = (price - BPrice) * number;
-
- // document.getElementById("TB_DifferencePriceSum").innerText= cheng(a,2);
- // document.getElementById("TB_count").innerText=cheng(tcount,2);
- form1.TB_DifferencePriceSum.value =cheng(a,2);
- form1.txtsum.value =cheng(a,2);
- form1.TB_count.value = cheng(tcount,2);
- form1.txtcount.value =cheng(tcount,2);
- if( document.getElementById("TB_DifferencePriceSum").value=="NaN")
- document.getElementById("TB_DifferencePriceSum").innerText="空";
- }
-
- //保留两位小数
- function cheng(num,n) // num:被四舍五入的数字,n:要保留小数的位数
- {
- var dd=1;
- var tempnum;
- for(i=0;i<n;i++)
- {
- dd*=10;
- }
- tempnum=num*dd;
- tempnum=Math.round(tempnum);
- return tempnum/dd;
- // alert(tempnum/dd);
- }
-
- //判断输入是否是数字
- function checkNumber()
- {
- if(!(((window.event.keyCode>=48)&&(window.event.keyCode<=57))||(window.event.keyCode==13)||(window.event.keyCode==46)||(window.event.keyCode==45)))
- {
- window.event.keyCode=0;
- alert("对不起,只能输入数字!");
- }
- }
- function returnvalue()
- {
- // alert("dfdf");
- var txcount= document.getElementById("HjCount").value;
- window.returnValue=txcount;
- }
-
- function DBLChange()
- {
- var nowEvenObj = event.srcElement;
- if (nowEvenObj.type != undefined)
- {
- // alert(nowEvenObj.nodeName);
- if(nowEvenObj.nodeName == "INPUT")
- {
- form1.TxtSeacher.value=nowEvenObj.value;
- // alert(nowEvenObj.value);
- }
- }
- // alert(form1.RBL_Type.value);
- // return false;
- }
-
- function DListSearch()
- {
- var s=form1.TB_SearchContent.value;
- s=s.replace(/^s+|s+$/g,"");
- // alert(s);
- if (s=="")
- {
- alert("系统提示:请输入查询内容!");
- return false;
- }
- if (form1.TxtSeacher.value=="2")
- {
- var NVale = window.showModalDialog("SelectMateril.aspx?StrE="+s,"","help=0;dialogWidth=450px;dialogHeight=370px;status=no;status=no;");
- if (NVale!=undefined)
- {
- form1.TxtWZ.value = NVale;
- return true;
- }
- return false;
- }
- }
-
- function EnterTextBox()
- {
- if(event.keyCode == 13 && document.all["TB_SearchContent"].value != "")
- {
- event.keyCode = 9;
- event.returnValue = false;
- document.all["IB_Search"].click();
- }
- }
- function CheckNull()
- {
- // var BudGetPrice=parseFloat(form1.TB_BudGetPrice.value);
- var MarketPrice=parseFloat(form1.TB_MarketPrice.value);
- var Number=parseFloat(form1.TB_Number.value);
-
- if (MarketPrice<=0 || Number<=0)
- {
- alert("系统提示:单价或数量必需大于零!");
- return false;
- }
- }
- </script>
-
- </head>
- <body onunload="returnvalue()">
- <form id="form1" runat="server" style="font-size:12px;">
- <table style="width:100%; font-size:12px;" border="0" cellpadding="0" cellspacing="0" >
- <tr>
- <td align="left" style="width: 70px; font-weight: bold;">
- 查找类型:
- </td>
- <td align="left" style="width: 160px" >
- <asp:RadioButtonList ID="RBL_Type" runat="server" RepeatColumns="3">
- <asp:ListItem Text="物资代码" Value="1" Selected="True"></asp:ListItem>
- <asp:ListItem Text="规格型号" Value="2"></asp:ListItem>
- </asp:RadioButtonList>
- </td>
- <td align="left" style="width: 250px">
-
- <asp:TextBox ID="TB_SearchContent" runat="server" style="width:250px"></asp:TextBox>
-
- </td>
- <td align="left">
- <asp:ImageButton ID="IB_Search" ImageUrl="~/Workflow/image/Search.gif" ToolTip=" 查找" runat="server" OnClientClick="javascript:return DListSearch();" OnClick="IB_Search_Click" />
- <%-- <asp:Button ID="Button1" runat="server" Text="新增" OnClick="BT_Add_Click" />--%>
- <asp:ImageButton ID="IB_Add" ImageUrl="~/Workflow/image/Add.jpg" ToolTip=" 新增" runat="server" OnClick="IB_Add_Click" />
- </td>
- </tr>
- </table>
-
- <table width="100%" border="0" cellpadding="0" cellspacing="0" >
- <tr>
- <td colspan="7">
- <div style="text-indent:2em;height:300px;overflow-x:hidden;overflow-y:auto; width:100%;text-align:left;">
- <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="MaterialID" BackColor="#CDCDCF" BorderWidth="0px"
- CssClass="Grid" SelectedRowStyle-CssClass="SelectedRow" RowStyle-CssClass="HeadingCellText"
- FooterStyle-CssClass="GridFooter" ShowFooter="true" CellSpacing="1" CellPadding="0"
- OnRowDataBound="GridView1_RowDataBound" style="width:100%"
- OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing"
- AllowPaging="false" AllowSorting="false">
-
- <AlternatingRowStyle BackColor="#F0F0F0" />
- <RowStyle BackColor="#F9FAFC" CssClass="HeadingCellText" />
- <HeaderStyle BackColor="#DFDFDF" CssClass="GridHeader" />
-
- <Columns>
- <asp:BoundField DataField="MeterialName" HeaderText="材料名称">
- <ItemStyle Width="10%" />
- </asp:BoundField>
- <asp:BoundField DataField="MeterialSize" HeaderText="材料型号">
- <ItemStyle Width="15%" />
- </asp:BoundField>
- <asp:BoundField DataField="wz_id" HeaderText="物资代码">
- <ItemStyle Width="8%" />
- </asp:BoundField>
- <asp:BoundField DataField="UnitName" HeaderText="生产单位">
- <ItemStyle Width="10%" />
- </asp:BoundField>
- <asp:BoundField DataField="BudGetPrice" HeaderText="预算原价">
- <ItemStyle Width="8%" />
- </asp:BoundField>
- <asp:BoundField DataField="MarketPrice" HeaderText="市场价">
- <ItemStyle Width="8%" />
- </asp:BoundField>
- <asp:BoundField DataField="Number" HeaderText="数量">
- <ItemStyle Width="4%" />
- </asp:BoundField>
- <asp:BoundField DataField="DifferencePrice" HeaderText="差价小计">
- <ItemStyle Width="8%" />
- </asp:BoundField>
- <asp:BoundField DataField="DifferencePriceSum" HeaderText="实际总价">
- <ItemStyle Width="8%" />
- </asp:BoundField>
-
- <asp:TemplateField HeaderText="操作">
- <ItemTemplate>
- <asp:ImageButton ID="IB_Edit" ToolTip="编辑" runat="server" CommandName="edit" ImageUrl="~/Images/s_edit.gif"/>
- <asp:ImageButton ToolTip="删除" ID="IB_Del" runat="server" CommandName="Delete" ImageUrl="~/Images/s-del.gif"
- OnClientClick='<%#"return confirm("确认删除此材料的费用记录吗?");" %>'/>
-
- </ItemTemplate>
- <%-- <HeaderStyle HorizontalAlign="Center" BorderWidth="0px"/>--%>
- <ItemStyle HorizontalAlign="Center" Width="10%" BorderWidth="0px"/>
- </asp:TemplateField>
-
- </Columns>
- <FooterStyle CssClass="GridFooter" />
- <PagerStyle CssClass="GridPage" />
- <EmptyDataTemplate>
- <table width="100%" class="GridHeader">
- <tr style="border-width:1px;height:16px" align="center" bgcolor="#DFDFDF">
- <td style="border:1px solid #CCCCCC;width:10%">材料名称</td>
- <td style="border:1px solid #CCCCCC;width:15%">材料型号</td>
- <td style="border:1px solid #CCCCCC;width:8%">物资代码</td>
- <td style="border:1px solid #CCCCCC;width:10%">生产单位</td>
- <td style="border:1px solid #CCCCCC;width:8%">预算原价</td>
- <td style="border:1px solid #CCCCCC;width:8%">市场价</td>
- <td style="border:1px solid #CCCCCC;width:4%">数 量</td>
- <td style="border:1px solid #CCCCCC;width:8%">差价小计</td>
- <td style="border:1px solid #CCCCCC;width:8%">实际总价</td>
- <td style="border:1px solid #CCCCCC; text-align:center;"> 操 作</td>
- </tr>
- </table>
- </EmptyDataTemplate>
- </asp:GridView>
- </div>
- </td>
-
- </tr>
- </table>
-
- <asp:Panel ID="PanelAdd" runat="server" Width="100%">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" >
-
- <tr style="border-width:1px;height:16px" align="center" bgcolor="#DFDFDF">
- <td style="border:1px solid #CCCCCC;width:10%">材料名称</td>
- <td style="border:1px solid #CCCCCC;width:15%">材料型号</td>
- <td style="border:1px solid #CCCCCC;width:8%">物资代码</td>
- <td style="border:1px solid #CCCCCC;width:10%">生产单位</td>
- <td style="border:1px solid #CCCCCC;width:8%">预算原价</td>
- <td style="border:1px solid #CCCCCC;width:8%">市场价</td>
- <td style="border:1px solid #CCCCCC;width:4%">数 量</td>
- <td style="border:1px solid #CCCCCC;width:8%">差价小计</td>
- <td style="border:1px solid #CCCCCC;width:8%">实际总价</td>
- <td style="border:1px solid #CCCCCC; text-align:center;" colspan="2"> 操 作</td>
- </tr>
-
- <tr>
- <td align="left" style="width:10%">
- <asp:DropDownList id="dListParent" runat="server" Width="100%" AutoPostBack="True" OnSelectedIndexChanged="dListParent_SelectedIndexChanged"> </asp:DropDownList><%-- onchange="Go(this)"--%>
- </td>
- <td align="left" style="width:15%">
- <asp:DropDownList id="dListChild" runat="server" Width="100%" AutoPostBack="True" OnSelectedIndexChanged="dListChild_SelectedIndexChanged"></asp:DropDownList>
- </td>
- <td align="left" style="width:8%">
- <asp:TextBox ID="TBWZ" runat="server" Width="100%" Enabled="false"></asp:TextBox>
- </td>
- <td align="left" style="width:10%">
- <asp:TextBox ID="TB_UnitName" runat="server" Width="100%"></asp:TextBox>
- </td>
- <td align="left" style="width:8%">
- <asp:TextBox ID="TB_BudGetPrice" Text="0" MaxLength="12" Enabled="false" runat="server" Width="100%" ></asp:TextBox>
- </td>
- <td align="left" style="width:8%">
- <asp:TextBox ID="TB_MarketPrice" Text="0" MaxLength="12" onkeypress="checkNumber()" onblur="sum1()" runat="server" Width="100%"></asp:TextBox>
- </td>
- <td align="left" style="width:4%">
- <asp:TextBox ID="TB_Number" Text="1" onkeypress="checkNumber()" onblur="sum1()" runat="server" Width="100%" ></asp:TextBox>
- </td>
- <td align="left" style="width:8%">
- <asp:TextBox ID="TB_count" Text="0" runat="server" Width="100%" Enabled="false"></asp:TextBox>
- </td>
- <td align="left" style="width:9%">
- <asp:TextBox ID="TB_DifferencePriceSum" Text="0" runat="server" Width="92%" Enabled="false"></asp:TextBox>
- </td>
- <td align="left">
- <asp:ImageButton ID="BT_Confirm" runat="server" ImageUrl="image/queding.gif" OnClick="BT_Confirm_Click" ValidationGroup="SaveButton" OnClientClick="return CheckNull();" style="width:80%"/>
- </td>
- <td>
- <asp:ImageButton ID="BT_Cancel" runat="server" ImageUrl="image/quxiao.gif" OnClick="BT_Cancel_Click" style="width:80%" />
- </td>
- </tr>
- </table>
-
- </asp:Panel>
-
- <input type="hidden" id="equipmentid" name="equipmentid" runat="server"/>
- <input type="hidden" id="status" name="status" runat="server"/>
- <input type="hidden" id="HjCount" name="HjCount" value="0" runat="server"/> <%--差价合计--%>
- <input type="hidden" id="txtcount" name="txtcount" value="0" runat="server"/>
- <input type="hidden" id="txtsum" name="txtsum" value="0" runat="server"/>
- <input type="hidden" id="TxtSeacher" name="TxtSeacher" value="0" runat="server"/>
- <input type="hidden" id="TxtWZ" name="TxtWZ" value="0" runat="server"/>
-
- </form>
- </body>
- </html>