先上图吧:
代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ZeQuoteDetail.aspx.cs" Inherits="ERP_EXT_ZeQuoteDetail" %> <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> <!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 type="text/javascript"> var template = '<span style="color:{0};">{1}</span>'; var change = function (value) { return String.format(template, (value > 0) ? 'green' : 'red', value); } var pctChange = function (value) { return String.format(template, (value > 0) ? 'green' : 'red', value*100 + '%'); } var exportData = function (format) { var store = GridPanel1.store; store.directEventConfig.isUpload = true; var records = store.reader.readRecords(store.proxy.data).records, values = []; for (i = 0; i < records.length; i++) { var obj = {}, dataR; if (store.reader.meta.id) { obj[store.reader.meta.id] = records[i].id; } dataR = Ext.apply(obj, records[i].data); if (!Ext.isEmptyObj(dataR)) { values.push(dataR); } } store.submitData(values); store.directEventConfig.isUpload = false; }; </script> </head> <body> <form id="form1" runat="server"> <ext:ResourceManager ID="ResourceManager1" runat="server"> </ext:ResourceManager> <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData" OnSubmitData="Store1_Submit"> <Reader> <ext:JsonReader> <Fields> <ext:RecordField Name="报价日期" Type="Date" /> <ext:RecordField Name="报价单号" Type="String" /> <ext:RecordField Name="客户编码" Type="String" /> <ext:RecordField Name="客户简称" Type="String"/> <ext:RecordField Name="品名" Type="String"/> <ext:RecordField Name="型号" Type="String"/> <ext:RecordField Name="区域" Type="String"/> <ext:RecordField Name="销货类型" Type="String"/> <ext:RecordField Name="兑换率" Type="Float"/> <ext:RecordField Name="劳工成本" Type="Float"/> <ext:RecordField Name="利润率" Type="Float"/> <ext:RecordField Name="税率" Type="Float" /> <ext:RecordField Name="损耗率" Type="Float" /> <ext:RecordField Name="产品属性" Type="String"/> <ext:RecordField Name="业务员" Type="String"/> <ext:RecordField Name="5K" Type="Float" /> <ext:RecordField Name="3K" Type="Float" /> <ext:RecordField Name="1K" Type="Float"/> <ext:RecordField Name="销售备注" Type="String" /> <ext:RecordField Name="采购备注" Type="String" /> <ext:RecordField Name="开发备注" Type="String" /> <ext:RecordField Name="财务备注" Type="String" /> <ext:RecordField Name="币别" Type="String" /> </Fields> </ext:JsonReader> </Reader> </ext:Store> <ext:Store ID="Store2" runat="server" > <Reader> <ext:JsonReader> <Fields> <ext:RecordField Name="MA001" /> <ext:RecordField Name="MA002" /> <ext:RecordField Name="MA003" /> </Fields> </ext:JsonReader> </Reader> </ext:Store> <ext:Store ID="Store3" runat="server" > <Reader> <ext:JsonReader> <Fields> <ext:RecordField Name="UserName" /> <ext:RecordField Name="UserId" /> </Fields> </ext:JsonReader> </Reader> </ext:Store> <ext:Panel ID="Panel3" runat="server" Height="600" Title="报价样品明细信息" Border="false" Icon="Application"> <TopBar> <ext:Toolbar ID="Toolbar1" runat="server"> <Items> <ext:Button ID="btnxls" runat="server" Text="导出" Icon="PageExcel"> <Listeners> <Click Handler="exportData('xls');" /> </Listeners> </ext:Button> <ext:Button ID="btnrefresh" runat="server" Text="刷新" Icon="ArrowRefresh"> <Listeners> <Click Handler="location.reload();" /> </Listeners> </ext:Button> <ext:ToolbarFill ID="ToolbarFill1" runat="server" /> </Items> </ext:Toolbar> </TopBar> <Items> <ext:FieldSet ID="FieldSet1" runat="server" Title="过滤条件" Collapsible="true" Layout="ColumnLayout" > <Items> <ext:Panel ID="Panel1" runat="server" LabelWidth="100" Border ="false" Header ="false" Layout="FormLayout" ColumnWidth=".40" LabelAlign="Right" Height="105"> <Items> <ext:ComboBox ID="cbxtype" runat="server" FieldLabel="报价类型" EmptyText="--请选择--" BlankText="--请选择--" AllowBlank="false" Width="150" > <Items > <ext:ListItem Text="正式报价" Value ="QT" /> <ext:ListItem Text="估价" Value ="GT"/> </Items> </ext:ComboBox> <ext:TextField ID="txtQuotationCode" runat ="server" FieldLabel="报价/估计单编号" Width="150"></ext:TextField> <ext:ComboBox ID="cbxDescription" runat="server" FieldLabel="品名" EmptyText="--请选择品名--" Width="150"> <Items > <ext:ListItem Text="LCD" /> <ext:ListItem Text="LCD+BL" /> <ext:ListItem Text="LCM" /> <ext:ListItem Text="TFT" /> <ext:ListItem Text="BL" /> <ext:ListItem Text="其他" /> </Items> <Triggers> <ext:FieldTrigger Icon="Clear" Qtip="移除选项" /> </Triggers> <Listeners> <TriggerClick Handler="this.removeByValue(this.getValue());this.clearValue();" /> </Listeners> </ext:ComboBox> <ext:ComboBox ID="cbxqy" runat ="server" FieldLabel="区域" EmptyText="--请选择区域--" Editable="false" Width="150" > <Items > <ext:ListItem Text="国内" /> <ext:ListItem Text="AZ" /> <ext:ListItem Text="NAZ" /> <ext:ListItem Text="AZ-0004" /> </Items> <Triggers> <ext:FieldTrigger Icon="Clear" Qtip="移除选项" /> </Triggers> <Listeners> <TriggerClick Handler="this.removeByValue(this.getValue());this.clearValue();" /> </Listeners> </ext:ComboBox> </Items> </ext:Panel> <ext:Panel ID="Panel2" runat="server" LabelWidth="80" Border ="false" Header ="false" Layout="FormLayout" ColumnWidth=".60" LabelAlign="Right" Height="105"> <Items> <ext:CompositeField ID="MultiField1" runat="server" FieldLabel=" 客户编码"> <Items> <ext:TextField ID="txtClient" runat ="server" FieldLabel="客户编码" Width="100" EmptyText="--客户编码--" BlankText="请输入客户编码" ></ext:TextField> <ext:TextField ID="txtclientdes" runat ="server" FieldLabel="客户简称" Width="150" Disabled="true"></ext:TextField> <ext:Button ID="btnQuery" runat="server" Text="" Icon="Find" Width="30" > <Listeners> <Click Handler="WinQuery.show();" /> </Listeners> </ext:Button> </Items> </ext:CompositeField> <ext:ComboBox ID="cbxsalesman" runat="server" FieldLabel="业务员" Width="150" DisplayField="UserName" ValueField="UserId" StoreID="Store3"> <Triggers> <ext:FieldTrigger Icon="Clear" Qtip="移除选项" /> </Triggers> <Listeners> <TriggerClick Handler="this.removeByValue(this.getValue());this.clearValue();" /> </Listeners> </ext:ComboBox> <ext:DateField ID="dfstartdate" runat="server" FieldLabel="报价日期" Width="150" AllowBlank="false"></ext:DateField> <ext:CompositeField ID="CompositeField1" runat="server" FieldLabel=" 至日期"> <Items> <ext:DateField ID="dfenddate" runat="server" FieldLabel="至日期" Width="150" AllowBlank="false"></ext:DateField> <ext:Button ID="btnsubmit" runat="server" Icon="Zoom" Text="查询"> <DirectEvents> <Click OnEvent="Query"> <EventMask ShowMask="true" Msg="正在提交数据,请稍候..." MinDelay="1000"/> </Click> </DirectEvents> </ext:Button> </Items> </ext:CompositeField> </Items> </ext:Panel> </Items> </ext:FieldSet> <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" Height="400" StripeRows="true" AutoExpandColumn="销售备注"> <ColumnModel ID="ColumnModel1" runat="server"> <Columns> <ext:RowNumbererColumn Locked="true" /> <ext:Column Header="报价日期" DataIndex="报价日期" Width="80" > <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d ')" /> </ext:Column> <ext:Column Header="报价单号" DataIndex="报价单号" Width="120" Locked="true" > </ext:Column> <ext:Column Header="客户编码" DataIndex="客户编码" Width="80" Locked="true" > </ext:Column> <ext:Column Header="客户简称" DataIndex="客户简称" Width="100" > </ext:Column> <ext:Column Header="品名" DataIndex="品名" Width="60" > </ext:Column> <ext:Column Header="型号" DataIndex="型号" Width="100" > </ext:Column> <ext:Column Header="区域" DataIndex="区域" Width="40" > </ext:Column> <ext:Column Header="销货类型" DataIndex="销货类型" Width="100" > </ext:Column> <ext:Column Header="劳工" DataIndex="劳工成本" Width="40" Hidden="true"> <Renderer Fn="change"/> </ext:Column> <ext:Column Header="利润" DataIndex="利润率" Width="40" Hidden="true"> <Renderer Fn="pctChange"/> </ext:Column> <ext:Column Header="税率" DataIndex="税率" Width="40" Hidden="true"> <Renderer Fn="pctChange"/> </ext:Column> <ext:Column Header="损耗" DataIndex="损耗率" Width="40" Hidden="true"> <Renderer Fn="pctChange"/> </ext:Column> <ext:Column Header="产品属性" DataIndex="产品属性" Width="60" Hidden="true"> </ext:Column> <ext:Column Header="1K" DataIndex="1K" Width="60" > <Renderer Fn="change"/> </ext:Column> <ext:Column Header="3K" DataIndex="3K" Width="60" > <Renderer Fn="change"/> </ext:Column> <ext:Column Header="5K" DataIndex="5K" Width="60" > <Renderer Fn="change"/> </ext:Column> <ext:Column Header="销售备注" DataIndex="销售备注" Width="100" > </ext:Column> <ext:Column Header="采购备注" DataIndex="采购备注" Width="100" > </ext:Column> <ext:Column Header="开发备注" DataIndex="开发备注" Width="100" > </ext:Column> <ext:Column Header="业务员" DataIndex="业务员" Width="60" > </ext:Column> </Columns> </ColumnModel> <SelectionModel> <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" /> </SelectionModel> <LoadMask ShowMask="true" /> <Plugins> <ext:GridFilters runat="server" ID="GridFilters1" Local="true"> <Filters> <ext:StringFilter DataIndex="报价单号" /> <ext:StringFilter DataIndex="客户编码" /> </Filters> </ext:GridFilters> </Plugins> <%-- <BottomBar> <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="200" StoreID="Store1" > <Items> <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" /> <ext:Button ID="Button1" runat="server" Text=""> <DirectEvents> <Click OnEvent="SetFilter" /> </DirectEvents> </ext:Button> </Items> </ext:PagingToolbar> </BottomBar>--%> <View> <ext:LockingGridView ID="LockingGridView1" runat="server" /> </View> </ext:GridPanel> </Items> </ext:Panel> <ext:Window ID="WinQuery" runat="server" Collapsible="true" Height="330" Icon="Application" Title="客户基本信息" Width="420" Hidden="true" > <Items> <ext:GridPanel id="GridPanelClient" runat="server" StoreID="Store2" Width="400" Height="300" StripeRows="true" AutoExpandColumn="MA003"> <TopBar> <ext:Toolbar ID="Toolbar2" runat="server"> <Items> <ext:ComboBox ID="cbxcondition" runat ="server" FieldLabel="过滤" LabelWidth="40" Width ="100"> <Items > <ext:ListItem Text="客户编码" /> <ext:ListItem Text="客户简称" /> <ext:ListItem Text="客户全称" /> </Items> </ext:ComboBox> <ext:TextField ID="txtcondition" runat ="server" Width ="180"></ext:TextField> <ext:Button ID="btnSelect" runat="server" Icon="Accept" Text="查询"> <DirectEvents> <Click OnEvent="Select"> <EventMask ShowMask="true" Msg="正在提交数据,请稍候..." MinDelay="500"/> </Click> </DirectEvents> </ext:Button> </Items> </ext:Toolbar> </TopBar> <ColumnModel ID="ColumnModel2" runat="server"> <Columns> <ext:RowNumbererColumn /> <ext:Column Header="客户编码" DataIndex="MA001" Width="100"/> <ext:Column Header="客户简称" DataIndex="MA002" Width="80"/> <ext:Column Header="客户全称" DataIndex="MA003" Width="80"/> </Columns> </ColumnModel> <SelectionModel> <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" /> </SelectionModel> <DirectEvents> <Click OnEvent="SubmitSelection"> <ExtraParams> <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanelClient}.getRowsValues({selectedOnly:true}))" Mode="Raw" /> </ExtraParams> <EventMask ShowMask="true" Msg="数据正在生成,请稍候..." MinDelay="100"/> </Click> </DirectEvents> <LoadMask ShowMask="true" /> <BottomBar> <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" StoreID="Store1" /> </BottomBar> </ext:GridPanel> </Items> </ext:Window> </form> </body> </html>