//欠费月度统计 Ext.namespace('Shipping'); Shipping.MsRptNoTotalMonthIndex = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsRptNoTotalMonthIndex.superclass.constructor.call(this); }; Ext.extend(Shipping.MsRptNoTotalMonthIndex, Ext.Panel, { PageSize: 2000, OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, sqlcontext: '1=2', salesumsortfield: '', salesumsortdire: '', custsumsortfield: '', custsumsortdire: '', salecustsumsortfield: '', salecustsumsortdire: '', opcustsumsortfield: '', opcustsumsortdire: '', sqlselect: '1=2', initUIComponents: function () { //定义数据集 this.formname = 'MsRptNoTotalMonthIndex'; this.storeSaleList = null; // //定义Grid this.girdcolumssale = [{ sortable: true, dataIndex: 'SALE', text: '业务员', width: 100 }]; this.gridListSale = new Ext.grid.GridPanel({ store: this.storeSaleList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolumssale, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeSaleList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.gridListSale.addListener('sortchange', function (ct, column, direction, eOpts) { this.salesumsortfield = column.dataIndex; this.salesumsortdire = direction; }, this); this.gridListSale.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.sqlselect = " B.SALE= '" + record.data.SALE + "'"; var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var form = this.formSearch.getForm(); var DC = form.findField('DC').getValue(); if (DC == '2') openUrl = "../MvcShipping/MsRptNoTotal/CrIndex"; else openUrl = "../MvcShipping/MsRptNoTotal/DrIndex"; window.open(openUrl, openType, openSet); // DsOpenEditWin("/TruckMng/MsWlPc/Edit"); }, this); this.storeCustList = null; //定义Grid this.girdcolumscust = [{ sortable: true, dataIndex: 'CUSTNAME', text: '客户', width: 100 }, { sortable: true, dataIndex: 'CUSTFULLNAME', text: '客户全称', width: 120 } ]; this.gridListCust = new Ext.grid.GridPanel({ store: this.storeCustList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolumscust, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeCustList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.gridListCust.addListener('sortchange', function (ct, column, direction, eOpts) { this.custsumsortfield = column.dataIndex; this.custsumsortdire = direction; }, this); this.gridListCust.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.sqlselect = " F.CUSTOMERNAME= '" + record.data.CUSTNAME + "'"; var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var form = this.formSearch.getForm(); var DC = form.findField('DC').getValue(); if (DC == '2') openUrl = "../MvcShipping/MsRptNoTotal/CrIndex"; else openUrl = "../MvcShipping/MsRptNoTotal/DrIndex"; window.open(openUrl, openType, openSet); // DsOpenEditWin("/TruckMng/MsWlPc/Edit"); }, this); this.storeSaleCustList = null; //定义Grid this.girdcolumssalecust = [{ sortable: true, dataIndex: 'SALE', text: '揽货人', width: 100 }, { sortable: true, dataIndex: 'CUSTNAME', text: '客户', width: 100 }, { sortable: true, dataIndex: 'CUSTFULLNAME', text: '客户全称', width: 120 } ]; this.gridListSaleCust = new Ext.grid.GridPanel({ store: this.storeSaleCustList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolumssalecust, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeSaleCustList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.gridListSaleCust.addListener('sortchange', function (ct, column, direction, eOpts) { this.salecustsumsortfield = column.dataIndex; this.salecustsumsortdire = direction; }, this); this.gridListSaleCust.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.sqlselect = " B.SALE='" + record.data.SALE + "' AND F.CUSTOMERNAME= '" + record.data.CUSTNAME + "'"; var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var form = this.formSearch.getForm(); var DC = form.findField('DC').getValue(); if (DC == '2') openUrl = "../MvcShipping/MsRptNoTotal/CrIndex"; else openUrl = "../MvcShipping/MsRptNoTotal/DrIndex"; window.open(openUrl, openType, openSet); // DsOpenEditWin("/TruckMng/MsWlPc/Edit"); }, this); this.storeOpCustList = null; //定义Grid this.girdcolumsopcust = [{ sortable: true, dataIndex: 'OP', text: '操作', width: 100 }, { sortable: true, dataIndex: 'CUSTNAME', text: '客户', width: 100 }, { sortable: true, dataIndex: 'CUSTFULLNAME', text: '客户全称', width: 120 } ]; this.gridListOpCust = new Ext.grid.GridPanel({ store: this.storeOpCustList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolumsopcust, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeOpCustList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.gridListOpCust.addListener('sortchange', function (ct, column, direction, eOpts) { this.opcustsumsortfield = column.dataIndex; this.opcustsumsortdire = direction; }, this); this.gridListOpCust.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.sqlselect = " B.OP='" + record.data.OP + "' AND F.CUSTOMERNAME= '" + record.data.CUSTNAME + "'"; var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var form = this.formSearch.getForm(); var DC = form.findField('DC').getValue(); if (DC == '2') openUrl = "../MvcShipping/MsRptNoTotal/CrIndex"; else openUrl = "../MvcShipping/MsRptNoTotal/DrIndex"; window.open(openUrl, openType, openSet); // DsOpenEditWin("/TruckMng/MsWlPc/Edit"); }, this); this.storeSumList = null; //定义Grid this.gridListSum = new Ext.grid.GridPanel({ store: this.storeSumList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolumssalecust }); // //定义Grid this.girdcolumssaledept = [{ sortable: true, dataIndex: 'SALEDEPT', text: '部门', width: 100 }]; this.gridListSaleDept = new Ext.grid.GridPanel({ store: this.storeSaleDeptList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolumssaledept, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeSaleList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.gridListSaleDept.addListener('sortchange', function (ct, column, direction, eOpts) { this.saledeptsumsortfield = column.dataIndex; this.saledeptsumsortdire = direction; }, this); this.gridListSaleDept.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.sqlselect = " B.SALEDEPT= '" + record.data.SALEDEPT + "'"; var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var form = this.formSearch.getForm(); var DC = form.findField('DC').getValue(); if (DC == '2') openUrl = "../MvcShipping/MsRptNoTotal/CrIndex"; else openUrl = "../MvcShipping/MsRptNoTotal/DrIndex"; window.open(openUrl, openType, openSet); // DsOpenEditWin("/TruckMng/MsWlPc/Edit"); }, this); //#region formSearch //#region formSearch枚举参照相关 _this = this; this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {}); this.StoreOpLb.load({ params: { enumTypeId: 96005} }); this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '业务类型', store: this.StoreOpLb, forceSelection: true, name: 'PS_OPLB', valueField: 'EnumValueName', displayField: 'EnumValueName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {}); this.storeBsType.load({ params: { enumTypeId: 96004} }); this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '运输类型', store: this.storeBsType, name: 'PS_BSTYPE', valueField: 'EnumValueName', displayField: 'EnumValueName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeSalesCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' } }); this.storeSalesCode.load(); this.comboxSalesCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '揽货人', store: this.storeSalesCode, forceSelection: true, name: 'PS_SALE', valueField: 'UserName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '操 作', store: this.storeSalesCode, forceSelection: true, name: 'PS_OP', valueField: 'UserName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '委托单位', store: this.storeCustCode, forceSelection: true, name: 'PS_CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeCust = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCust.load({ params: { condition: ""} }); this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '结算客户', store: this.storeCust, forceSelection: true, name: 'CUSTNAME', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeFSTATUS = Ext.create('Ext.data.Store', { fields: ['FSTATUS', 'NAME'] }); this.storeFSTATUS.add({ "DC": "0", "NAME": "全部" }); this.storeFSTATUS.add({ "DC": "1", "NAME": "仅已审核" }); this.comboxFSTATUS = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '费用状态', store: this.storeFSTATUS, valueField: 'FSTATUS', displayField: 'NAME', forceSelection: true, name: 'FSTATUS', value: '0', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //状态_业务状态 Ext.define('BSSTATUSModel', { extend: 'Ext.data.Model', fields: [ { name: 'Name', type: 'string' }, { name: 'Value', type: 'string' } ] }); var dataBSSTATUS = [{ "Name": "未锁定", "Value": 0 }, { "Name": "锁定", "Value": 1}]; var storeBSSTATUS = Ext.create('Ext.data.Store', { model: 'BSSTATUSModel', data: dataBSSTATUS }); //费用状态 this.comboxFEESTATUS = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '费用锁定', forceSelection: true, store: storeBSSTATUS, name: 'FEESTATUS', valueField: 'Name', displayField: 'Name', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); Ext.define('SubComp', { extend: 'Ext.data.Model', fields: [ { name: 'GID', type: 'string' }, { name: 'NAME', type: 'string' }, { name: 'ENNAME', type: 'string' } ] }); this.StoreSubComp = Ext.create('DsExt.ux.RefTableStore', { model: 'SubComp', proxy: { url: '/MvcShipping/MsBaseInfo/GetCompanyEN' } }); this.StoreSubComp.load({ params: { condition: ""} }); this.comboxSubComp = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '所属公司', store: this.StoreSubComp, name: 'SUBCOMP', valueField: 'GID', displayField: 'NAME', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeAddDCType = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storeAddDCType.add({ "DC": "1", "NAME": "应收" }); this.storeAddDCType.add({ "DC": "2", "NAME": "应付" }); this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '收/付', store: this.storeAddDCType, valueField: 'DC', displayField: 'NAME', forceSelection: true, name: 'DC', value: '1', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeDATETYPE = Ext.create('Ext.data.Store', { fields: ['FSTATUS', 'NAME'] }); this.storeDATETYPE.add({ "FSTATUS": "OPDATE", "NAME": "业务日期" }); // this.storeBLNOTYPE.add({ "FSTATUS": "INVOICENO", "NAME": "发票号" }); this.storeDATETYPE.add({ "FSTATUS": "ACCDATE", "NAME": "会计期间" }); this.comboxDATETYPE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '统计日期', store: this.storeDATETYPE, valueField: 'FSTATUS', displayField: 'NAME', forceSelection: true, name: 'DATETYPE', value: 'OPDATE', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#endregion this.formSearch = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxDATETYPE,{ fieldLabel: '从业务日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_EXPDATEBGN', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '结束业务日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_EXPDATEEND', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '从会计期间', xtype: 'monthfield', name: 'PS_ACCDATEBGN', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '至会计期间', xtype: 'monthfield', name: 'PS_ACCDATEEND', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxCustCode, this.comboxSubComp ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxCust, this.comboxOp, this.comboxSalesCode, this.comboxOpLb, this.comboxBsType, this.comboxaddDCType, { xtype: 'hiddenfield' } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); //#endregion formSearch //查询工具条 this.CheckSaveQuery = new Ext.form.Checkbox({ fieldLabel: '记忆查询条件', checked: true, width: 120 }); _this = this; this.SearchBtn = new Ext.Button({ text: '隐藏查询', handler: function () { if (_this.SearchBtn.text == '隐藏查询') { _this.panelSearch.hide(); _this.SearchBtn.setText("显示查询"); } else { _this.panelSearch.show(); _this.SearchBtn.setText("隐藏查询"); } } }); this.panelBtn = new Ext.Panel({ region: "north", tbar: [ { text: "执行查询", iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); var isvisible = true; var issavevalue = false; if (_this.SearchBtn.text == '隐藏查询') isvisible = true else isvisible = false; if (this.CheckSaveQuery.checked) issavevalue = true saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue); }, scope: this }, { text: "导出Excel", id: "btnExportExcel", iconCls: 'btnexportexcel', handler: function (button, event) { this.onExportClick(button, event); }, scope: this }, '-', { text: "打印", iconCls: 'btnprint', handler: function (button, event) { this.Print(); }, scope: this }, '-', this.SearchBtn, { xtype: 'button', width: 90, text: "清空条件", iconCls: "btnreset", handler: function (button, event) { this.onClearSql(button, event); }, scope: this } ] }); this.panelTop = new Ext.Panel({ layout: "border", region: "north", height: 29, items: [this.panelBtn] }); this.panelSearch = new Ext.Panel({ layout: "border", region: "north", height: 80, items: [this.formSearch] }); this.panelSaleSum = new Ext.Panel({ title: '揽货人', layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.gridListSale] }); this.panelCustSum = new Ext.Panel({ title: '客户', layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.gridListCust] }); this.panelSaleCustSum = new Ext.Panel({ title: '揽货人客户', layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.gridListSaleCust] }); this.panelSaleDeptSum = new Ext.Panel({ title: '部门', layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.gridListSaleDept] }); this.panelOpCustSum = new Ext.Panel({ title: '操作客户', layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.gridListOpCust] }); this.panelSum = new Ext.Panel({ title: '合 计', layout: "border", height: 120, region: 'south', margin: '0 0', frame: true, items: [this.gridListSum] }); this.tabpanel = new Ext.TabPanel ({ activeTab: 0, autoWidth: true, border: false, frame: false, region: 'center', id: "TabPanelID", enableTabScroll: true, items: [ this.panelCustSum, this.panelSaleSum, this.panelSaleCustSum, this.panelSaleDeptSum, this.panelOpCustSum ] }); Ext.apply(this, { items: [this.panelTop, this.panelSearch, this.tabpanel, this.panelSum] }); LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery); }, //end initUIComponents InitGrid: function (datetype,startdate, enddate) { _this = this; var zlcolumn = []; var myfield = []; var salefield = [ { name: 'SALE', type: 'string' } ]; var custfield = [ { name: 'CUSTNAME', type: 'string' }, { name: 'CUSTFULLNAME', type: 'string' }, { name: 'CUSTZQ', type: 'string' } ]; var salecustfield = [ { name: 'SALE', type: 'string' }, { name: 'CUSTNAME', type: 'string' }, { name: 'CUSTFULLNAME', type: 'string' }, { name: 'CUSTZQ', type: 'string' } ]; var saledeptfield = [ { name: 'SALEDEPT', type: 'string' } ]; var opcustfield = [ { name: 'OP', type: 'string' }, { name: 'CUSTNAME', type: 'string' }, { name: 'CUSTFULLNAME', type: 'string' }, { name: 'CUSTZQ', type: 'string' } ]; this.girdcolumssale = [{ sortable: true, dataIndex: 'SALE', text: '业务员', width: 100 }]; this.girdcolumssaledept = [{ sortable: true, dataIndex: 'SALEDEPT', text: '部门', width: 100 }]; this.girdcolumssalecust = [{ sortable: true, dataIndex: 'SALE', text: '揽货人', width: 100 }, { sortable: true, dataIndex: 'CUSTNAME', text: '客户', width: 100 }, { sortable: true, dataIndex: 'CUSTFULLNAME', text: '客户全称', width: 120 }, { sortable: true, dataIndex: 'CUSTZQ', text: '客户账期', width: 120 } ]; this.girdcolumscust = [{ sortable: true, dataIndex: 'CUSTNAME', text: '应收客户', width: 100 }, { sortable: true, dataIndex: 'CUSTFULLNAME', text: '应收客户全称', width: 120 }, { sortable: true, dataIndex: 'CUSTZQ', text: '客户账期', width: 120 } ]; this.girdcolumsopcust = [{ sortable: true, dataIndex: 'OP', text: '操作', width: 100 }, { sortable: true, dataIndex: 'CUSTNAME', text: '客户', width: 100 }, { sortable: true, dataIndex: 'CUSTFULLNAME', text: '客户全称', width: 120 }, { sortable: true, dataIndex: 'CUSTZQ', text: '客户账期', width: 120 } ]; var storeMonthData = Ext.create('DsExt.ux.RefTableStore', { fields: [ { name: 'MONTHNAME', type: 'string' }, { name: 'MONTHNO', type: 'number' }, { name: 'MONTHFIELDNAME', type: 'string' } ], proxy: { url: '/MvcShipping/MsRptNoTotalMonth/GetMonthsData' } }); _this = this; storeMonthData.load({ params: { datetype:datetype,startmonth: startdate, endmonth: enddate }, callback: function (r, options, success) { if (success) { if (r.length != 0) { for (i = 0; i < storeMonthData.getCount(); i += 1) { var itemindex = i + 1; var memberyf = storeMonthData.getAt(i); myfield.push({ name: 'ZL' + memberyf.data.MONTHNO + 'USD', type: 'number' }); myfield.push({ name: 'ZL' + memberyf.data.MONTHNO + 'RMB', type: 'number' }); myfield.push({ name: 'ZL' + memberyf.data.MONTHNO + 'OT', type: 'number' }); myfield.push({ name: 'ZL' + memberyf.data.MONTHNO + 'TTL', type: 'number' }); zlcolumn.push({ text: memberyf.data.MONTHNAME, dataIndex: 'ZL' + memberyf.data.MONTHNAME, columns: [{ dataIndex: 'ZL' + memberyf.data.MONTHNO + 'RMB', sortable: true, text: 'RMB', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { dataIndex: 'ZL' + memberyf.data.MONTHNO + 'USD', text: 'USD', sortable: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { dataIndex: 'ZL' + memberyf.data.MONTHNO + 'OT', text: '其他币别', sortable: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { dataIndex: 'ZL' + memberyf.data.MONTHNO + 'TTL', sortable: true, text: '合计', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 } ] }); }; } myfield.push({ name: 'ZLTTLUSD', type: 'number' }); myfield.push({ name: 'ZLTTLRMB', type: 'number' }); myfield.push({ name: 'ZLTTLOT', type: 'number' }); myfield.push({ name: 'ZLTTLTTL', type: 'number' }); zlcolumn.push({ text: '总计', dataIndex: 'ZLTTL' , columns: [{ dataIndex: 'ZLTTLRMB', text: 'RMB', sortable: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { dataIndex: 'ZLTTLUSD', text: 'USD', sortable: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { dataIndex: 'ZLTTLOT', text: '其他币别', sortable: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { dataIndex: 'ZLTTLTTL', text: '合计', sortable: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 } ] }); for (var k in myfield) { salefield.push(myfield[k]); custfield.push(myfield[k]); salecustfield.push(myfield[k]); saledeptfield.push(myfield[k]); opcustfield.push(myfield[k]); } Ext.define('salemodel', { extend: 'Ext.data.Model', fields: salefield }); this.storeSaleList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'salemodel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptNoTotalMonth/SaleListData', reader: { root: 'data', totalProperty: 'totalCount' } } }); Ext.define('custmodel', { extend: 'Ext.data.Model', fields: custfield }); this.storeCustList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'custmodel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptNoTotalMonth/CustListData', reader: { root: 'data', totalProperty: 'totalCount' } } }); Ext.define('salecustmodel', { extend: 'Ext.data.Model', fields: salecustfield }); this.storeSaleCustList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'salecustmodel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptNoTotalMonth/SaleCustListData', reader: { root: 'data', totalProperty: 'totalCount' } } }); Ext.define('saledeptmodel', { extend: 'Ext.data.Model', fields: saledeptfield }); this.storeSaleDeptList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'saledeptmodel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptNoTotalMonth/DeptListData', reader: { root: 'data', totalProperty: 'totalCount' } } }); Ext.define('opcustmodel', { extend: 'Ext.data.Model', fields: opcustfield }); this.storeOpCustList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'opcustmodel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptNoTotalMonth/OpCustListData', reader: { root: 'data', totalProperty: 'totalCount' } } }); Ext.define('summodel', { extend: 'Ext.data.Model', fields: myfield }); this.storeSumList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'summodel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptNoTotalMonth/SumListData', reader: { root: 'data', totalProperty: 'totalCount' } } }); for (var k in zlcolumn) { this.girdcolumssale.push(zlcolumn[k]); this.girdcolumssalecust.push(zlcolumn[k]); this.girdcolumscust.push(zlcolumn[k]); this.girdcolumssaledept.push(zlcolumn[k]); this.girdcolumsopcust.push(zlcolumn[k]); } this.gridListSale.columns = this.girdcolumssale; this.gridListSale.reconfigure(this.storeSaleList, this.girdcolumssale); this.gridListCust.reconfigure(this.storeCustList, this.girdcolumscust); this.gridListSaleCust.reconfigure(this.storeSaleCustList, this.girdcolumssalecust); this.gridListSaleDept.reconfigure(this.storeSaleDeptList, this.girdcolumssaledept); this.gridListOpCust.reconfigure(this.storeOpCustList, this.girdcolumsopcust); this.gridListSum.reconfigure(this.storeSumList, zlcolumn); var sql = this.getCondition(); this.sqlcontext = sql; this.storeCustList.load({ params: { start: 0, limit: this.PageSize, condition: sql, datetype: datetype, startmonth: startdate, endmonth: enddate }, waitMsg: "正在查询数据...", scope: this }); this.storeSaleList.load({ params: { start: 0, limit: this.PageSize, condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }, waitMsg: "正在查询数据...", scope: this }); this.storeSaleCustList.load({ params: { start: 0, limit: this.PageSize, condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }, waitMsg: "正在查询数据...", scope: this }); this.storeSaleDeptList.load({ params: { start: 0, limit: this.PageSize, condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }, waitMsg: "正在查询数据...", scope: this }); this.storeOpCustList.load({ params: { start: 0, limit: this.PageSize, condition: sql, datetype: datetype, startmonth: startdate, endmonth: enddate }, waitMsg: "正在查询数据...", scope: this }); this.storeSumList.load({ params: { start: 0, limit: this.PageSize, condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }, waitMsg: "正在查询数据...", scope: this }); this.storeSaleList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }); }, this); this.storeSaleDeptList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }); }, this); this.storeCustList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }); }, this); this.storeSaleCustList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }); }, this); this.storeOpCustList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype, startmonth: startdate, endmonth: enddate }); }, this); this.storeSumList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype,startmonth: startdate, endmonth: enddate }); }, this); } }, scope: this }); }, onRefreshClick: function (button, event) { if (!this.checkSearchCondition()) return; var form = this.formSearch.getForm(); var datetype = form.findField('DATETYPE').getValue(); if (datetype == 'OPDATE') { var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue(); var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue(); if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) { Ext.Msg.alert('提示', '开始业务日期不能为空!'); return; } if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) { Ext.Msg.alert('提示', '结束业务日期不能为空!'); return; } var expDate_Mindate = form.findField('PS_EXPDATEBGN').getValue(); var expDate_Maxdate = form.findField('PS_EXPDATEEND').getValue(); if (expDate_Mindate > expDate_Maxdate) { Ext.Msg.alert('提示', '业务开始日期不能大于结束日期!'); return; } this.InitGrid(datetype,expDate_Min, expDate_Max); } else { var expDate_Min = form.findField('PS_ACCDATEBGN').getRawValue(); var expDate_Max = form.findField('PS_ACCDATEEND').getRawValue(); if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) { Ext.Msg.alert('提示', '开始会计期间不能为空!'); return; } if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) { Ext.Msg.alert('提示', '结束会计期间不能为空!'); return; } var expDate_Mindate = form.findField('PS_ACCDATEBGN').getValue(); var expDate_Maxdate = form.findField('PS_ACCDATEEND').getValue(); if (expDate_Mindate > expDate_Maxdate) { Ext.Msg.alert('提示', '会计期间开始日期不能大于结束日期!'); return; } this.InitGrid(datetype, expDate_Min, expDate_Max); } }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); }, getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; /* var sqldata = form.getValues(); sql = Ext.JSON.encode(sqldata); */ // var mblNo = form.findField('PS_MBLNO').getValue(); // sql = sql + getAndConSql(sql, mblNo, " (B.CUSTNO like '%" + mblNo + "%' or B.MBLNO like '%" + mblNo + "%' or B.HBLNO like '%" + mblNo + "%' or B.CUSTOMNO like '%" + mblNo + "%' or B.ORDERNO like '%" + mblNo + "%') "); var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue(); sql = sql + getAndConSql(sql, expDate_Min, " B.OPDATE>='" + expDate_Min + "'"); var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue(); sql = sql + getAndConSql(sql, expDate_Max, " B.OPDATE<='" + expDate_Max + " 23:59:59'"); // var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue(); // sql = sql + getAndConSql(sql, etdDate_Min, " B.ETD>='" + etdDate_Min + "'"); // var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue(); // sql = sql + getAndConSql(sql, etdDate_Max, " B.ETD<='" + etdDate_Max + " 23:59:59'"); var accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue(); sql = sql + getAndConSql(sql, accDate_Min, " B.ACCDATE>='" + accDate_Min + "'"); var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue(); sql = sql + getAndConSql(sql, accDate_Max, " B.ACCDATE<='" + accDate_Max + "'"); var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue(); sql = sql + getAndConSql(sql, CUSTOMERNAME, "B.CUSTOMERNAME='" + CUSTOMERNAME + "'"); var SALE = form.findField('PS_SALE').getValue(); sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'"); // var FEESTATUS = form.findField('FEESTATUS').getValue(); // sql = sql + getAndConSql(sql, FEESTATUS, "B.FEESTATUS=" + FEESTATUS); var SUBCOMP = form.findField('SUBCOMP').getValue(); sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'"); var OP = form.findField('PS_OP').getValue(); sql = sql + getAndConSql(sql, OP, "B.OP='" + OP + "'"); var BSTYPE = form.findField('PS_BSTYPE').getValue(); sql = sql + getAndConSql(sql, BSTYPE, "B.BSTYPE='" + BSTYPE + "'"); var OPLB = form.findField('PS_OPLB').getValue(); sql = sql + getAndConSql(sql, OPLB, "B.OPLBNAME='" + OPLB + "'"); var CUSTNAME = form.findField('CUSTNAME').getValue(); sql = sql + getAndConSql(sql, CUSTNAME, "F.CUSTOMERNAME='" + CUSTNAME + "'"); var DC = form.findField('DC').getValue(); sql = sql + getAndConSql(sql, DC, "F.FEETYPE=" + DC); var FEERANGE = 'B'; if (FEERANGE == '' || FEERANGE == null || FEERANGE == undefined) { } else { if (sql == '') { if (FEERANGE == 'B') { sql = ' F.AMOUNT<>F.SETTLEMENT ' } } else { if (FEERANGE == 'B') { sql = sql + ' and F.AMOUNT<>F.SETTLEMENT ' } } } //var FSTATUS = 1; //if (FSTATUS == '' || FSTATUS == null || FSTATUS == undefined || FSTATUS == 0) { //} //else { // if (sql == '') { // if (FSTATUS == 1) { // sql = ' (F.FEESTATUS=0 or F.FEESTATUS=8 or F.FEESTATUS=9) ' // } // } // else { // if (FSTATUS == 1) { // sql = sql + 'and (F.FEESTATUS=0 or F.FEESTATUS=8 or F.FEESTATUS=9) ' // } // } //} return sql; }, checkSearchCondition: function () { var form = this.formSearch.getForm(); if (!form.isValid()) { Ext.Msg.alert('提示', '查询条件赋值错误,请检查。'); return false; } return true; }, OprationSwap: function () { var ret = new Array(); ret[0] = this.OprationStatus; ret[1] = this.storeList; ret[2] = this.SelectedRecord; ret[3] = this.SelectedRecord.data.BSNO; ret[4] = "MsRptOpProfitIndex"; return ret; }, onSaveGridClick: function (button, event) { if (this.tabpanel.getActiveTab() == this.panelSaleSum) { this.girdcolumssale = DsTruck.SaveGridPanel(USERID, this.formname + 'sale', this.gridListSale.columns, this.girdcolumssale, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelCustSum) { this.girdcolumscust = DsTruck.SaveGridPanel(USERID, this.formname + 'cust', this.gridListCust.columns, this.girdcolumscust, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelSaleCustSum) { this.girdcolumssalecust = DsTruck.SaveGridPanel(USERID, this.formname + 'salecust', this.gridListSaleCust.columns, this.girdcolumssalecust, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelOpCustSum) { this.girdcolumsopcust = DsTruck.SaveGridPanel(USERID, this.formname + 'opcust', this.gridListOpCust.columns, this.girdcolumsopcust, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelSaleDeptSum) { this.girdcolumssaledept = DsTruck.SaveGridPanel(USERID, this.formname + 'saledept', this.gridListSaleDept.columns, this.girdcolumssaledept, 1, true); } }, oninitGridClick: function (button, event) { if (this.tabpanel.getActiveTab() == this.panelSaleSum) { this.gridListSale.reconfigure(this.storeSaleList, this.initgirdcolumssale); this.girdcolumssale = DsTruck.SaveGridPanel(USERID, this.formname + 'sale', this.gridListSale.columns, this.initgirdcolumssale, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelCustSum) { this.gridListCust.reconfigure(this.storeCustList, this.initgirdcolumscust); this.girdcolumscust = DsTruck.SaveGridPanel(USERID, this.formname + 'cust', this.gridListCust.columns, this.initgirdcolumscust, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelSaleCustSum) { this.gridListSaleCust.reconfigure(this.storeSaleCustList, this.initgirdcolumssalecust); this.girdcolumssalecust = DsTruck.SaveGridPanel(USERID, this.formname + 'salecust', this.gridListSaleCust.columns, this.initgirdcolumssalecust, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelOpCustSum) { this.gridListOpCust.reconfigure(this.storeOpCustList, this.initgirdcolumsopcust); this.girdcolumsopcust = DsTruck.SaveGridPanel(USERID, this.formname + 'opcust', this.gridListOpCust.columns, this.initgirdcolumsopcust, 1, true); } else if (this.tabpanel.getActiveTab() == this.panelSaleDeptSum) { this.gridListSaleDept.reconfigure(this.storeSaleDeptList, this.initgirdcolumssaledept); this.girdcolumssaledept = DsTruck.SaveGridPanel(USERID, this.formname + 'saledept', this.gridListSaleDept.columns, this.initgirdcolumssaledept, 1, true); } }, onExportClick: function (button, event) { _this = this; if (this.tabpanel.getActiveTab() == this.panelSaleSum) { grid2Excel(this.gridListSale, "业务员欠费月度"); // GridExportExcelPage(this.gridListSale); } else if (this.tabpanel.getActiveTab() == this.panelCustSum) { grid2Excel(this.gridListCust, "客户欠费月度"); // GridExportExcelPage(this.gridListCust); } else if (this.tabpanel.getActiveTab() == this.panelSaleCustSum) { grid2Excel(this.gridListSaleCust, "业务员客户欠费月度"); // GridExportExcelPage(this.gridListSaleCust); } else if (this.tabpanel.getActiveTab() == this.panelOpCustSum) { grid2Excel(this.gridListOpCust, "操作客户欠费月度"); // GridExportExcelPage(this.gridListSaleCust); } else if (this.tabpanel.getActiveTab() == this.panelSaleDeptSum) { grid2Excel(this.gridListSaleDept, "部门欠费月度"); // GridExportExcelPage(this.gridListCust); } }, Print: function () { var form = this.formSearch.getForm(); var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue(); var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue(); if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) { Ext.Msg.alert('提示', '开始业务日期不能为空!'); return; } if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) { Ext.Msg.alert('提示', '结束业务日期不能为空!'); return; } var expDate_Mindate = form.findField('PS_EXPDATEBGN').getValue(); var expDate_Maxdate = form.findField('PS_EXPDATEEND').getValue(); var startdate = expDate_Min; var enddate = expDate_Min; var sql = this.getCondition(); var Crsql = sql + getAndConSql(sql, '1=1', " F.FEETYPE=2"); var Drsql = sql + getAndConSql(sql, '1=1', " F.FEETYPE=1"); _this = this; if (this.tabpanel.activeTab == this.panelSaleSum) { if (this.storeSaleList.getCount() == 0) { return; } var sortstr = ' B.SALE'; if (this.salesumsortfield != '' && this.salesumsortdire != '') { sortstr = this.salesumsortfield + ' ' + this.salesumsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptNoTotalMonth/SaleListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, startmonth: startdate, endmonth: enddate, printstr: 'true', sortstr: sortstr }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnstr = jsonresult.Data; var printType = 'MSRPTNOTOTALMONTHSALE'; var sql1 = returnstr; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); } else if (this.tabpanel.activeTab == this.panelCustSum) { if (this.storeCustList.getCount() == 0) { return; } var sortstr = ' F.CUSTOMERNAME'; if (this.custsumsortfield != '' && this.custsumsortdire != '') { sortstr = this.custsumsortfield + ' ' + this.custsumsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptNoTotalMonth/CustListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, startmonth: startdate, endmonth: enddate, printstr: 'true', sortstr: sortstr }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnstr = jsonresult.Data; var printType = 'MSRPTNOTOTALMONTHCUST'; var sql1 = returnstr; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); } else if (this.tabpanel.activeTab == this.panelSaleCustSum) { if (this.storeSaleCustList.getCount() == 0) { return; } var sortstr = ' B.SALE,F.CUSTOMERNAME'; if (this.salecustsumsortfield != '' && this.salecustsumsortdire != '') { sortstr = this.salecustsumsortfield + ' ' + this.salecustsumsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptNoTotalMonth/SaleCustListData', scope: this, params: { start: 0, limit: this.PageSize, condition: sql, startmonth: startdate, endmonth: enddate, printstr: 'true', sortstr: sortstr }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnstr = jsonresult.Data; var printType = 'MSRPTNOTOTALMONTHSALECUST'; var sql1 = returnstr; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); } else if (this.tabpanel.activeTab == this.panelOpCustSum) { if (this.storeOpCustList.getCount() == 0) { return; } var sortstr = ' B.OP,F.CUSTOMERNAME'; if (this.opcustsumsortfield != '' && this.opcustsumsortdire != '') { sortstr = this.opcustsumsortfield + ' ' + this.opcustsumsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptNoTotalMonth/OpCustListData', scope: this, params: { start: 0, limit: this.PageSize, condition: sql, startmonth: startdate, endmonth: enddate, printstr: 'true', sortstr: sortstr }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnstr = jsonresult.Data; var printType = 'MSRPTNOTOTALMONTHOPCUST'; var sql1 = returnstr; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); } else if (this.tabpanel.activeTab == this.panelSaleDeptSum) { if (this.storeSaleDeptList.getCount() == 0) { return; } var sortstr = ' B.SALEDEPT'; //if (this.salesumsortfield != '' && this.salesumsortdire != '') { // sortstr = this.saledesumsortfield + ' ' + this.salesumsortdire; //} Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptNoTotalMonth/DeptListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, startmonth: startdate, endmonth: enddate, printstr: 'true', sortstr: sortstr }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnstr = jsonresult.Data; var printType = 'MSRPTNOTOTALMONTHSALE'; var sql1 = returnstr; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); } } });