var accdatebgn = ""; var accdateend = ""; Ext.namespace('Shipping'); Shipping.MsRptOpProfitZouIndex = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsRptOpProfitZouIndex.superclass.constructor.call(this); }; Ext.extend(Shipping.MsRptOpProfitZouIndex, Ext.Panel, { PageSize: 2000, OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, sqlcontext: '1=2', bslistsortfield: '', bslistsortdire: '', salelistsortfield: '', salelistsortdire: '', custlistsortfield: '', custlistsortdire: '', oplistsortfield: '', oplistsortdire: '', bssourcelistsortfield: '', bssourcelistsortdire: '', bssourcedetaillistsortfield: '', bssourcedetaillistsortdire: '', initUIComponents: function () { this.formname = 'MsRptOpProfitZouIndex'; this.isquery = false; //定义数据集 this.storeList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, fields: [ { name: 'MONTHNAME', type: 'string' }, { name: 'MONTHNUM', type: 'number' }, { name: 'OBJNUMRMB', type: 'number' }, { name: 'OBJNUMUSD', type: 'number' } ], remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptOpProfitZou/SumListData', reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); //定义Grid this.initgirdcolums = [{ sortable: true, dataIndex: 'MONTHNAME', header: '月份', width: 100 }, { sortable: true, dataIndex: 'MONTHNUM', header: '数据', 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; }, summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, align: 'right', width: 90 }, { sortable: true, dataIndex: 'OBJNUMRMB', header: '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', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 90 }, { sortable: true, dataIndex: 'OBJNUMUSD', header: 'USD', 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', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 } ]; // this.girdcolums = this.initgirdcolums; this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.initgirdcolums, 1); this.gridList = new Ext.grid.GridPanel({ store: this.storeList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, features: [{ ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 }], columns: this.girdcolums, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); ////////////////////////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////////////////////// this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) { this.SelectedRecord = record; var month = record.data.MONTHNAME; //alert(month.toString()); //alert(month.substring(0, 4)); //alert(month.substring(5)); openNewDiv("layer", "业务走势图表分析", 500, 300, month); }, this); ////////////////////////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////////////////////// // this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.girdcolums, 1); // this.gridList.reconfigure(this.storeList, this.girdcolums); _this = this; this.piechart = Ext.create('Ext.chart.Chart', { id: 'chartCmp', xtype: 'chart', style: 'background:#fff', animate: true, shadow: true, store: this.storeList, axes: [{ type: 'Numeric', position: 'left', fields: ['MONTHNUM'], label: { renderer: Ext.util.Format.numberRenderer('0,0') }, title: '数据', grid: true, minimum: 0 }, { type: 'Category', position: 'bottom', fields: ['MONTHNAME'], title: '年度月份' }], series: [{ type: 'column', axis: 'left', highlight: true, tips: { trackMouse: true, width: 140, height: 28, renderer: function (storeItem, item) { this.setTitle(storeItem.get('MONTHNAME') + ': ' + storeItem.get('MONTHNUM') + ' $'); } }, label: { display: 'insideEnd', 'text-anchor': 'middle', field: 'MONTHNUM', renderer: Ext.util.Format.numberRenderer('0.00'), orientation: 'vertical', color: '#333' }, xField: 'MONTHNAME', yField: 'MONTHNUM' }] }); //#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', { id: 'comboxOpLbID', 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', { id: 'comboxBsTypeID', 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', { id: 'comboxSalesCodeID', 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', { id: 'comboxOpID', 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', { id: 'comboxCustCodeID', 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.storeSource = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.SourceModel', proxy: { url: '/CommMng/BasicDataRef/GetSource' } }); this.storeSource.load(); this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.SourceDetailModel', proxy: { url: '/CommMng/BasicDataRef/GetSourceDetail2' } }); this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', { id: 'comboxBSSOURCEID', fieldLabel: '业务来源', store: this.storeSource, forceSelection: true, name: 'BSSOURCE', valueField: 'SourceName', displayField: 'SourceName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var recs = DsStoreQueryBy(this.storeSource, 'SourceID', records[0].data.SourceID); if (recs.getCount() > 0) { var data = recs.getAt(0).data; var s = "SOURCEID='" + data.SourceID + "'"; this.storeSourceDetail.load({ params: { condition: s} }); } else { var BSSOURCEDETAIL = this.formSearch.getForm().findField('BSSOURCEDETAIL'); BSSOURCEDETAIL.setValue(''); } } } } }); this.storeSourceDetail.load(); this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', { id: 'comboxBSSOURCEDETAILID', fieldLabel: '来源明细', store: this.storeSourceDetail, forceSelection: true, name: 'BSSOURCEDETAIL', valueField: 'SourceDetail', displayField: 'SourceDetail', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeLANE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.Lane', proxy: { url: '/CommMng/BasicDataRef/GetCodeLaneList' } }); this.storeLANE.load(); this.comboxLANE = Ext.create('DsExt.ux.RefTableCombox', { id: 'comboxLANEID', fieldLabel: '航线', store: this.storeLANE, // forceSelection: true, name: 'LANE', valueField: 'LANE', displayField: 'LANE', 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(); } } } }); //#endregion _this = this; 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: [ { xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', flex: 1, defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: '统计条件', id: 'rdOBJTYPE', columns: 2, flex: 2, vertical: true, items: [ { id: 'rdoBsDate', boxLabel: '业务日期', name: 'OBJTYPE', inputValue: '业务日期', checked: true }, { id: 'rdoAccDate', boxLabel: '会计期间', name: 'OBJTYPE', inputValue: '会计期间' } ], listeners: { change: function (rd, newValue, oldValue, eOpts) { if (_this.isquery) _this.onRefreshClick(); } } }, { xtype: 'radiogroup', fieldLabel: '分析内容', id: 'rdOBJNUM', columns: 5, flex: 3, vertical: true, items: [ { id: 'rdoGain', boxLabel: '利润', name: 'OBJNUM', inputValue: '利润', checked: true }, { id: 'rdoArrearage', boxLabel: '欠费', name: 'OBJNUM', inputValue: '欠费' }, { id: 'rdoTeu', boxLabel: 'TEU', name: 'OBJNUM', inputValue: 'TEU' }, { id: 'rdoKgs', boxLabel: '毛重', name: 'OBJNUM', inputValue: '毛重' }, { id: 'rdoNetW', boxLabel: '计费重', name: 'OBJNUM', inputValue: '计费重' }, { id: 'rdoBill', boxLabel: '票数', name: 'OBJNUM', inputValue: '票数' }, { id: 'rdoOpXs', boxLabel: '操作系数', name: 'OBJNUM', inputValue: '操作系数' } ], listeners: { change: function (rd, newValue, oldValue, eOpts) { if (_this.isquery) _this.onRefreshClick(); } } }, this.comboxSubComp ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ 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', flex: 1, 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.comboxOpLb, this.comboxOp ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxSalesCode, this.comboxBsType, this.comboxCustCode, this.comboxBSSOURCE, this.comboxBSSOURCEDETAIL, this.comboxLANE ] } ]//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 }, '-', this.SearchBtn, { xtype: 'button', width: 90, text: "清空条件", iconCls: "btnreset", handler: function (button, event) { this.onClearSql(button, event); }, scope: this }, { xtype: 'button', text: "高级查询", iconCls: "btnmore", handler: function (button, event) { var sql = this.getCondition(); var winAccess = new Shipping.DsQuery({ }); winAccess.StoreList = this.storeList; winAccess.formname = this.formname; winAccess.condition = sql; winAccess.show(); return; }, scope: this }, this.CheckSaveQuery ] }); this.panelTop = new Ext.Panel({ layout: "border", region: "north", height: 29, items: [this.panelBtn] }); this.panelSearch = new Ext.Panel({ layout: "border", region: "north", height: 120, items: [this.formSearch] }); this.panelBodyChFee = new Ext.Panel({ title: '明细数据', layout: "border", region: 'east', width: 360, margin: '0 0', frame: true, items: [this.gridList] }); this.panelchart = new Ext.Panel({ title: '图表', layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.piechart] }); this.panelBody = new Ext.Panel({ layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.panelchart, this.panelBodyChFee] }); // this.tabpanel = new Ext.TabPanel // ({ // activeTab: 0, // autoWidth: true, // border: false, // frame: false, // region: 'center', // id: "TabPanelID", // enableTabScroll: true, // items: // [ // // ] // }); Ext.apply(this, { items: [this.panelTop, this.panelSearch, this.panelBody] }); this.storeList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql }); }, this); LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery); }, //end initUIComponents onRefreshClick: function (button, event) { if (!this.checkSearchCondition()) return; this.isquery = true; var form = this.formSearch.getForm(); var rdOBJNUM = Ext.getCmp('rdOBJNUM'); var OBJNUM = rdOBJNUM.getValue(); var rdOBJTYPE = Ext.getCmp('rdOBJTYPE'); var OBJTYPE = rdOBJTYPE.getValue(); var form = this.formSearch.getForm(); if (OBJTYPE.OBJTYPE == '业务日期') { 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; } } 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; } } var sql = this.getCondition(); this.sqlcontext = sql; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql, sumfieldtype: OBJNUM, startmonth: expDate_Min, endmonth: expDate_Max, objtype: OBJTYPE.OBJTYPE }, waitMsg: "正在查询数据...", scope: this }); }, onDsQuery: function (button, event) { this.isquery = true; var form = this.formSearch.getForm(); var rdOBJNUM = Ext.getCmp('rdOBJNUM'); var OBJNUM = rdOBJNUM.getValue(); var rdOBJTYPE = Ext.getCmp('rdOBJTYPE'); var OBJTYPE = rdOBJTYPE.getValue(); var form = this.formSearch.getForm(); if (OBJTYPE.OBJTYPE == '业务日期') { 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; } } 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; } } var sql = this.sqlcontext; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql, sumfieldtype: OBJNUM, startmonth: expDate_Min, endmonth: expDate_Max, objtype: OBJTYPE.OBJTYPE }, waitMsg: "正在查询数据...", scope: this }); }, getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; 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 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 + "'"); accdatebgn = accDate_Min; accdateend = accDate_Max; var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue(); sql = sql + getAndConSql(sql, CUSTOMERNAME, "B.CUSTOMERNAME='" + CUSTOMERNAME + "'"); var SUBCOMP = form.findField('SUBCOMP').getValue(); sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'"); var SALE = form.findField('PS_SALE').getValue(); sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'"); 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 BSSOURCE = form.findField('BSSOURCE').getValue(); sql = sql + getAndConSql(sql, BSSOURCE, "B.BSSOURCE='" + BSSOURCE + "'"); var BSSOURCEDETAIL = form.findField('BSSOURCEDETAIL').getValue(); sql = sql + getAndConSql(sql, BSSOURCEDETAIL, "B.BSSOURCEDETAIL='" + BSSOURCEDETAIL + "'"); var LANE = form.findField('LANE').getValue(); sql = sql + getAndConSql(sql, LANE, "B.LANE='" + LANE + "'"); return sql; }, checkSearchCondition: function () { var form = this.formSearch.getForm(); if (!form.isValid()) { Ext.Msg.alert('提示', '查询条件赋值错误,请检查。'); return false; } return true; }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); }, 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] = "MsRptOpProfitPerCentIndex"; return ret; }, Print: function () { _this = this; if (this.tabpanel.getActiveTab() == this.panelBodyChFee) { if (this.storeList.getCount() == 0) { return; } var sortstr = ' B.CUSTOMERNAME,B.OPLB,B.CREATETIME DESC'; if (this.bslistsortfield != '' && this.bslistsortdire != '') { sortstr = this.bslistsortfield + ' ' + this.bslistsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptOpProfit/BsListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, 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 = 'MSRPTPROFITLIST'; 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.panelSaleSum) { if (this.storeSaleList.getCount() == 0) { return; } var sortstr = ' B.SALE, B.BSTYPE'; if (this.salelistsortfield != '' && this.salelistsortdire != '') { sortstr = this.salelistsortfield + ' ' + this.salelistsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptOpProfit/SaleListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, 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 = 'MSRPTPROFITSALE'; 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 = ' B.CUSTOMERNAME'; if (this.custlistsortfield != '' && this.custlistsortdire != '') { sortstr = this.custlistsortfield + ' ' + this.custlistsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptOpProfit/CustListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, 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 = 'MSRPTPROFITCUST'; 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.panelOpSum) { if (this.storeOpList.getCount() == 0) { return; } var sortstr = ' B.OP, B.BSTYPE'; if (this.oplistsortfield != '' && this.oplistsortdire != '') { sortstr = this.oplistsortfield + ' ' + this.oplistsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptOpProfit/OpListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, 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 = 'MSRPTPROFITOP'; 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.panelBsSourceSum) { if (this.storeBsSourceList.getCount() == 0) { return; } var sortstr = ' B.BSSOURCE, B.BSTYPE'; if (this.bssourcelistsortfield != '' && this.bssourcelistsortdire != '') { sortstr = this.bssourcelistsortfield + ' ' + this.bssourcelistsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptOpProfit/BsSourceListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, 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 = 'MSRPTPROFITBSOURCE'; 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.panelBsSourceDetailSum) { if (this.storeBsSourceDetailList.getCount() == 0) { return; } var sortstr = ' B.BSSOURCE,B.BSSOURCEDETAIL, B.BSTYPE'; if (this.bssourcelistdetailsortfield != '' && this.bssourcelistdetailsortdire != '') { sortstr = this.bssourcelistdetailsortfield + ' ' + this.bssourcelistdetailsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptOpProfit/BsSourceDetailListData', scope: this, params: { start: 0, limit: this.PageSize, condition: _this.sqlcontext, 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 = 'MSRPTPROFITBSSOURCEDETAIL'; 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 }); } } }); } } }); function $() { return document.getElementById(arguments[0]) || false; } function openNewDiv(_id, DivHtml, newDivWidth, newDivHeight, strDate) { var m = "mask"; var _leftDatumPoint = document.body.scrollLeft + document.body.clientWidth / 2 - newDivWidth / 2; var _topDatumPoint = document.body.scrollTop + document.body.clientHeight / 2 - newDivHeight / 2; var _innerHTML = ""; // "
"; // var _storeDictionary = new Array(); var _storeDictionaryClass = new Array(); var _storeDictionaryValue = 0; var outputStr = ""; var datetimeStr = ""; var strYear = strDate.substring(0,4); var strMonth = strDate.substring(5, 7); //var oplb = Ext.getCmp('comboxOpLbID').getValue(); var oplbname = Ext.getCmp('comboxOpLbID').getValue(); //alert(oplbname); var oplid = ""; var bstype = Ext.getCmp('comboxBsTypeID').getValue(); var sales = Ext.getCmp('comboxSalesCodeID').getValue(); var op = Ext.getCmp('comboxOpID').getValue(); var customer = Ext.getCmp('comboxCustCodeID').getValue(); var bssource = Ext.getCmp('comboxBSSOURCEID').getValue(); var bssourcedetail = Ext.getCmp('comboxBSSOURCEDETAILID').getValue(); var lane = Ext.getCmp('comboxLANEID').getValue(); /*var accdatebgn = Ext.getCmp('PS_ACCDATEBGN').getValue(); //.getRawValue(); var accdateend = Ext.getCmp('PS_ACCDATEEND').getValue(); //.getRawValue();*/ switch (oplbname) { case "海运进口": oplid = "op_seai"; break; case "海运出口": oplid = "op_seae"; break; case "报关业务": oplid = "op_apply"; break; case "大宗散货": oplid = "op_bulk"; break; case "综合业务": oplid = "op_other"; break; } if ($(_id)) document.body.removeChild($(_id)); if ($("_title" + _id)) document.body.removeChild($("_title" + _id)); if ($("_titleBtn" + _id)) document.body.removeChild($("_titleBtn" + _id)); if ($("_contentFrame" + _id)) document.body.removeChild($("_contentFrame" + _id)); //mask遮罩层 var newMask = document.createElement("div"); newMask.id = m; newMask.style.position = "absolute"; newMask.style.zIndex = "1"; _scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth); _scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); newMask.style.width = _scrollWidth + "px"; newMask.style.height = _scrollHeight + "px"; newMask.style.top = "0px"; newMask.style.left = "0px"; newMask.style.background = "#33393C"; newMask.style.filter = "alpha(opacity=1)"; newMask.style.opacity = "0.01"; document.body.appendChild(newMask); //if ($(m)) document.body.removeChild($(m)); //消息层框架 var newDiv = document.createElement("div"); newDiv.id = _id; newDiv.style.position = "absolute"; newDiv.style.zIndex = "9999"; newDivWidth = newDivWidth || 500; newDivHeight = newDivHeight || 300; newDiv.style.width = newDivWidth + "px"; newDiv.style.height = newDivHeight + "px"; newDiv.style.top = _topDatumPoint + "px"; newDiv.style.left = _leftDatumPoint + "px"; newDiv.style.background = "#dfe9f6"; newDiv.style.border = "1px solid #99bce8"; newDiv.style.padding = "5px"; //newDiv.innerHTML = DivHtml; document.body.appendChild(newDiv); //消息层标题 var newDivTitle = document.createElement("div"); newDivTitle.id = "_title" + _id; newDivTitle.style.position = "absolute"; newDivTitle.style.zIndex = "10002"; newDivWidth = newDivWidth || 500; newDivHeight = newDivHeight || 300; newDivTitle.style.width = 400 + "px"; newDivTitle.style.height = 24 + "px"; newDivTitle.style.top = _topDatumPoint + "px"; newDivTitle.style.left = _leftDatumPoint + "px"; //newDivTitle.style.backgroundImage = "url(../../../images/title_bg.gif)";// background = "#000"; newDivTitle.style.border = "0px solid #99bce8"; newDivTitle.style.padding = "5px"; newDivTitle.style.fontWeight = "bold"; newDivTitle.style.color = "#15498b"; newDivTitle.style.fontSize = "16px"; newDivTitle.style.fontFamily = "微软雅黑"; //newDivTitle.style.cssText = "font-weight:bold;" newDivTitle.innerHTML = " " + DivHtml; document.body.appendChild(newDivTitle); //消息层按钮 var newDivTitleBtn = document.createElement("div"); newDivTitleBtn.id = "_titleBtn" + _id; newDivTitleBtn.style.position = "absolute"; newDivTitleBtn.style.zIndex = "10001"; newDivWidth = newDivWidth || 500; newDivHeight = newDivHeight || 300; newDivTitleBtn.style.width = 10 + "px"; newDivTitleBtn.style.height = 10 + "px"; newDivTitleBtn.style.top = _topDatumPoint + 2 + "px"; newDivTitleBtn.style.left = _leftDatumPoint + 483 + "px"; //newDivTitleBtn.style.background = "#000"; newDivTitleBtn.style.border = "0px solid #99bce8"; newDivTitleBtn.style.padding = "0px"; //newDivTitle2.innerHTML = " " + DivHtml; document.body.appendChild(newDivTitleBtn); //消息层内容 var newDivContent = document.createElement("div"); newDivContent.id = "_contentFrame" + _id; newDivContent.style.position = "absolute"; newDivContent.style.zIndex = "10000"; newDivWidth = newDivWidth || 500; newDivHeight = newDivHeight || 300; newDivContent.style.width = 500 + "px"; newDivContent.style.height = 262 + "px"; newDivContent.style.top = _topDatumPoint + 35 + "px"; newDivContent.style.left = _leftDatumPoint + "px"; //newDivTitle2.style.backgroundImage = "url(../../../images/title_bg.gif)";// background = "#000"; //newDivTitle2.style.border = "1px solid #99bce8"; //newDivTitle2.style.padding = "5px"; newDivContent.innerHTML = _innerHTML; document.body.appendChild(newDivContent); //查询消息 Ext.onReady(function () { var _store; if (Ext.getCmp('rdoGain').getValue() == true) { dispClass = 11; _store = new Ext.data.JsonStore({ autoLoad: true, //设置为自动加载,或者使用_store.load(),具体情况而定 proxy: new Ext.data.HttpProxy({ url: "/MvcShipping/MsRptOpProfitZou/GetCompareGainInfo?strYear=" + strYear + "&strMonth=" + strMonth + "&strOPLB=" + oplid + "&strBSTYPE=" + bstype + "&strSALES=" + sales + "&strOP=" + op + "&strCUSTOMER=" + customer + "&strBSSOURCE=" + bssource + "&strBSSOURCEDETAIL=" + bssourcedetail + "&lane=" + lane + "&strACCDATEBGN=" + accdatebgn + "&strACCDATEEND=" + accdateend }), fields: ["MONTHNAME", "MBLNO", "TTLDR", "TTLCR", "TTLAMOUNT", "INPUTBY"] }); } else if (Ext.getCmp('rdoArrearage').getValue() == true) { dispClass = 12; _store = new Ext.data.JsonStore({ autoLoad: true, //设置为自动加载,或者使用_store.load(),具体情况而定 proxy: new Ext.data.HttpProxy({ url: "/MvcShipping/MsRptOpProfitZou/GetCompareArrearageInfo?strYear=" + strYear + "&strMonth=" + strMonth + "&strOPLB=" + oplid + "&strBSTYPE=" + bstype + "&strSALES=" + sales + "&strOP=" + op + "&strCUSTOMER=" + customer + "&strBSSOURCE=" + bssource + "&strBSSOURCEDETAIL=" + bssourcedetail + "&lane=" + lane + "&strACCDATEBGN=" + accdatebgn + "&strACCDATEEND=" + accdateend }), fields: ["MONTHNAME", "MBLNO", "TTLDR", "STLTTLCR", "TTLAMOUNT", "INPUTBY"] }); } else if (Ext.getCmp('rdoTeu').getValue() == true) { dispClass = 13; _store = new Ext.data.JsonStore({ autoLoad: true, //设置为自动加载,或者使用_store.load(),具体情况而定 proxy: new Ext.data.HttpProxy({ url: "/MvcShipping/MsRptOpProfitZou/GetCompareTEUInfo?strYear=" + strYear + "&strMonth=" + strMonth + "&strOPLB=" + oplid + "&strBSTYPE=" + bstype + "&strSALES=" + sales + "&strOP=" + op + "&strCUSTOMER=" + customer + "&strBSSOURCE=" + bssource + "&strBSSOURCEDETAIL=" + bssourcedetail + "&lane=" + lane + "&strACCDATEBGN=" + accdatebgn + "&strACCDATEEND=" + accdateend }), fields: ["MONTHNAME", "MBLNO", "TEU", "INPUTBY"] }); } _store.on("load", function (_store) { outputStr = "时间 | "; outputStr += "提单号 | "; outputStr += "金额 | "; outputStr += "职员 | "; } else if (dispClass == 13) { outputStr += "时间 | "; outputStr += "提单号 | "; outputStr += "TEU | "; outputStr += "职员 | "; } outputStr += "
" + datetimeStr + " | "; outputStr += "" + _store.getAt(i).get("MBLNO") + " | "; outputStr += "" + _store.getAt(i).get("TTLAMOUNT") + " | "; outputStr += "" + _store.getAt(i).get("INPUTBY") + " | "; } else if (dispClass == 13) { outputStr += "" + datetimeStr + " | "; outputStr += "" + _store.getAt(i).get("MBLNO") + " | "; outputStr += "" + _store.getAt(i).get("TEU") + " | "; outputStr += "" + _store.getAt(i).get("INPUTBY") + " | "; } outputStr += "