//集运管理-路单查询 Ext.namespace('Shipping'); Shipping.MsRptSaleBalProfitShareIndex = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsRptSaleBalProfitShareIndex.superclass.constructor.call(this); }; Ext.extend(Shipping.MsRptSaleBalProfitShareIndex, Ext.Panel, { PageSize: 20000, OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, sqlcontext: '1=2', bslistsortfield: '', bslistsortdire: '', salelistsortfield: '', salelistsortdire: '', custlistsortfield: '', custlistsortdire: '', oplistsortfield: '', oplistsortdire: '', bssourcelistsortfield: '', bssourcelistsortdire: '', bssourcedetaillistsortfield: '', bssourcedetaillistsortdire: '', initUIComponents: function () { this.formname = 'MsRptSaleLHProfitShareIndex'; Ext.Ajax.timeout = 120000; //定义数据集 this.storeList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, fields: [ { name: 'BSNO', type: 'string' }, { name: 'OPLB', type: 'string' }, { name: 'OPLBNAME', type: 'string' }, { name: 'OPTYPE', type: 'string' }, { name: 'BSTYPE', type: 'string' }, { name: 'ISSALEFEE', type: 'string' }, { name: 'SETTLETIME', type: 'string' }, { name: 'BLFRT', type: 'string' }, { name: 'CUSTOMERNAME', type: 'string' }, { name: 'CUSTNO', type: 'string' }, { name: 'MBLNO', type: 'string' }, { name: 'HBLNO', type: 'string' }, { name: 'ETD', type: 'string' }, { name: 'STLDATE', type: 'string' }, { name: 'STLNAME', type: 'string' }, { name: 'VESSEL', type: 'string' }, { name: 'VOYNO', type: 'string' }, { name: 'INPUTBY', type: 'string' }, { name: 'CREATETIME', type: 'string' }, { name: 'BSSTATUS', type: 'string' }, { name: 'SALE', type: 'string' }, { name: 'OP', type: 'string' }, { name: 'DOC', type: 'string' }, { name: 'CUSTSERVICE', type: 'string' }, { name: 'PORTLOAD', type: 'string' }, { name: 'PORTDISCHARGE', type: 'string' }, { name: 'CUSTOMNO', type: 'string' }, { name: 'ACCDATE', type: 'string' }, { name: 'CARRIER', type: 'string' }, { name: 'BSSOURCE', type: 'string' }, { name: 'LANE', type: 'string' }, { name: 'FORWARDER', type: 'string' }, { name: 'CNTRTOTAL', type: 'string' }, { name: 'TRADETYPE', type: 'string' }, { name: 'GOODSNAME', type: 'string' }, { name: 'OPDATE', type: 'string' }, { name: 'CUSTOMDATE', type: 'string' }, { name: 'ENTERP', type: 'string' }, { name: 'NETWEIGHT', type: 'number' }, { name: 'KGS', type: 'number' }, { name: 'TEU', type: 'number' }, { name: 'CNTR1', type: 'number' }, { name: 'CNTR2', type: 'number' }, { name: 'CNTR3', type: 'number' }, { name: 'CNTR4', type: 'number' }, { name: 'CNTR5', type: 'number' }, { name: 'CNTR6', type: 'number' }, { name: 'CNTR7', type: 'number' }, { name: 'CNTR8', type: 'number' }, { name: 'CNTR9', type: 'number' }, { name: 'CNTR10', type: 'number' }, { name: 'OTCNTR', type: 'number' }, { name: 'RMBDR', type: 'number' }, { name: 'RMBCR', type: 'number' }, { name: 'USDDR', type: 'number' }, { name: 'USDCR', type: 'number' }, { name: 'OTDR', type: 'number' }, { name: 'OTCR', type: 'number' }, { name: 'TTLDR', type: 'number' }, { name: 'TTLCR', type: 'number' }, { name: 'INTEREST', type: 'number' }, { name: 'RMBPROFIT', type: 'number' }, { name: 'USDPROFIT', type: 'number' }, { name: 'OTPROFIT', type: 'number' }, { name: 'TTLPROFIT', type: 'number' }, { name: 'RMBNODR', type: 'number' }, { name: 'USDNODR', type: 'number' }, { name: 'OTNODR', type: 'number' }, { name: 'TTLNODR', type: 'number' }, { name: 'RMBNOCR', type: 'number' }, { name: 'USDNOCR', type: 'number' }, { name: 'OTNOCR', type: 'number' }, { name: 'TTLNOCR', type: 'number' }, { name: 'STLRMBDR', type: 'number' }, { name: 'STLUSDDR', type: 'number' }, { name: 'STLOTDR', type: 'number' }, { name: 'STLTTLDR', type: 'number' }, { name: 'MONTHSTLTTLDR', type: 'number' }, { name: 'STLRMBCR', type: 'number' }, { name: 'STLUSDCR', type: 'number' }, { name: 'STLOTCR', type: 'number' }, { name: 'STLTTLCR', type: 'number' }, { name: 'ACTUALDAY', type: 'number' }, { name: 'NODAY', type: 'number' }, { name: 'ACTNODAY', type: 'number' }, { name: 'NOMONTH', type: 'number' }, { name: 'TiChengQuJian', type: 'number' }, { name: 'COMPR', type: 'number' }, { name: 'MONTHTTLPR', type: 'number' }, { name: 'TiChengBiLi', type: 'number' }, { name: 'TiChengBiLiStr', type: 'string' }, { name: 'TiCheng', type: 'number' }, { name: 'PROFITRATE', type: 'string' }, { name: 'PRREMARK', type: 'string' } ], remoteSort: true, proxy: { type: 'ajax', timeout: 120000, url: '/MvcShipping/MsRptSaleBalProfitShare/GetLHDataList', reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); //定义Grid this.initgirdcolums = [{ sortable: true, dataIndex: 'BSNO', header: '编号', hidden: true, width: 130 }, { sortable: true, dataIndex: 'OPLBNAME', header: '业务类型', width: 70 }, { sortable: true, dataIndex: 'OPTYPE', header: '更改单', width: 70 }, { sortable: true, dataIndex: 'FEESTATUSREF', header: '费用锁定', width: 70 }, { sortable: true, dataIndex: 'ISSALEFEE', header: '提成发放', width: 70 }, { sortable: true, dataIndex: 'OPDATE', header: '业务日期', width: 86 }, { sortable: true, dataIndex: 'SETTLETIME', header: '结算日期', width: 86 }, { sortable: true, dataIndex: 'CUSTOMERNAME', header: '委托单位', width: 120 }, { sortable: true, dataIndex: 'CUSTNO', header: '委托编号', width: 136 }, { sortable: true, dataIndex: 'BLFRT', header: '付费方式', width: 200 }, { sortable: true, dataIndex: 'MBLNO', header: '主提单号', width: 120 }, { sortable: true, dataIndex: 'HBLNO', header: '分提单号', width: 120 }, { sortable: true, dataIndex: 'ETD', header: '开船日期', width: 86 }, { sortable: true, dataIndex: 'VESSEL', header: '船名', width: 200 }, { sortable: true, dataIndex: 'VOYNO', header: '航次', width: 50 }, { sortable: true, dataIndex: 'SALE', header: '业务员', width: 80 }, { sortable: true, dataIndex: 'OP', header: '操作', width: 80 }, { sortable: true, dataIndex: 'DOC', header: '单证', width: 80 }, { sortable: true, dataIndex: 'CUSTSERVICE', header: '客服员', width: 80 }, { sortable: true, dataIndex: 'PORTLOAD', header: '起运港', width: 80 }, { sortable: true, dataIndex: 'PORTDISCHARGE', header: '目的港', width: 150 }, { sortable: true, dataIndex: 'ACCDATE', header: '会计期间', width: 80 }, { sortable: true, dataIndex: 'CARRIER', header: '船公司', width: 80 }, { sortable: true, dataIndex: 'BSSOURCE', header: '业务来源', width: 120 }, { sortable: true, dataIndex: 'TEU', header: 'TEU', width: 80 }, { sortable: true, dataIndex: 'KGS', header: 'KGS', width: 80 }, { sortable: true, dataIndex: 'GOODSNAME', header: '品名', width: 80 }, { sortable: true, dataIndex: 'ACTUALDAY', 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; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'NODAY', 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; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'ACTNODAY', 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; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'NOMONTH', 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; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'TiChengQuJian', 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; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'COMPR', 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; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'TiChengBiLi', 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; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'TiCheng', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'PRREMARK', header: '提成备注', width: 80 }, { sortable: true, dataIndex: 'TiChengBiLiStr', header: '提成比例公式', width: 80 }, { sortable: true, dataIndex: 'RMBDR', 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: 80 }, { sortable: true, dataIndex: 'RMBCR', 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: 80 }, { sortable: true, dataIndex: 'RMBPROFIT', 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: 80 }, { sortable: true, dataIndex: 'USDDR', 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 }, { sortable: true, dataIndex: 'USDCR', 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 }, { sortable: true, dataIndex: 'USDPROFIT', 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 }, { sortable: true, dataIndex: 'OTDR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'OTCR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'OTPROFIT', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'TTLDR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'TTLCR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'TTLPROFIT', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'MONTHTTLPR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'PROFITRATE', header: '利润率', width: 80 }, { sortable: true, dataIndex: 'STLRMBDR', 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: 80 }, { sortable: true, dataIndex: 'RMBNODR', 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: 80 }, { sortable: true, dataIndex: 'STLUSDDR', 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 }, { sortable: true, dataIndex: 'USDNODR', 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 }, { sortable: true, dataIndex: 'STLOTDR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'OTNODR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'STLTTLDR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'MONTHSTLTTLDR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'TTLNODR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'STLRMBCR', 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: 80 }, { sortable: true, dataIndex: 'RMBNOCR', 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: 80 }, { sortable: true, dataIndex: 'STLUSDCR', 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 }, { sortable: true, dataIndex: 'USDNOCR', 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 }, { sortable: true, dataIndex: 'STLOTCR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'OTNOCR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'STLTTLCR', 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; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, width: 80 }, { sortable: true, dataIndex: 'TTLNOCR', 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; }, 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.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); this.gridList = new Ext.grid.GridPanel({ store: this.storeList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, selModel: this.GridCheckBoxModel, disableSelection: false, features: [{ ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 }], columns: this.girdcolums, viewConfig: { autoFill: true, getRowClass: function (record, rowIndex, rowParams, store) { var BILLSTATUSREF = record.get('ISSALEFEE'); if (BILLSTATUSREF == "已发放") return 'feestatus_pass'; } }, bbar: Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.girdcolums, 1); this.gridList.reconfigure(this.storeList, this.girdcolums); this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.SelectedRecord = record; 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 = ""; if (record.data.OPLBNAME == "报关业务") { openUrl = "../MvcShipping/MsOpApply/ApplyFeeView?handle=check&bsno=" + record.data.BSNO; } else { openUrl = "../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO; } window.open(openUrl, openType, openSet); }, this); this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) { this.bslistsortfield = column.dataIndex; this.bslistsortdire = direction; }, this); //#region formSearch //#region formSearch枚举参照相关 _this = this; 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.CheckAllDR = new Ext.form.Checkbox({ fieldLabel: '包含应收为0业务', checked: false, labelAlign: "right", labelWidth: 120 }); //#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: [{ fieldLabel: '提成月份', xtype: 'monthfield', name: 'PS_ACCDATE', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxSalesCode, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }, { 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: "高级查询", 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 }, { 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.CheckSaveQuery, '-', { text: "保存列表样式", id: "btntest", menu: [ { text: "保存列表", handler: function (button, event) { _this.onSaveGridClick(button, event); } }, { text: "列表初始化", handler: function (button, event) { _this.oninitGridClick(button, event); } }], scope: this }, '-', { text: '发放提成', tooltip: '发放提成', id: 'btnSubmitAudit', handler: function (button, event) { this.onSetFeeClick(); }, scope: this }, '-', { text: '取消发放', tooltip: '取消发放', id: 'btnSubmitAuditBack', handler: function (button, event) { this.onCancelSetFeeClick(); }, scope: this }, '-', { text: '差旅费', tooltip: '差旅费', handler: function (button, event) { 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 = ""; openUrl = "../../MvcShipping/MsRptSaleBalProfitShare/TravelFee"; window.open(openUrl, openType, openSet); }, 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: 56, items: [this.formSearch] }); this.panelBodyChFee = new Ext.Panel({ title: '业务明细', layout: "border", region: 'center', margin: '0 0', frame: true, items: [this.gridList] }); // 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.panelBodyChFee ] }); Ext.apply(this, { items: [this.panelTop, this.panelSearch, this.tabpanel] }); this.storeList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var month = this.formSearch.getForm().findField('PS_ACCDATE').getRawValue(); Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext, month: month }); }, this); // this.storeSumList.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; var sql = this.getCondition(); this.sqlcontext = sql; var month = this.formSearch.getForm().findField('PS_ACCDATE').getRawValue(); this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql, month: month}, waitMsg: "正在查询数据...", scope: this }); }, onDsQuery: function (button, event) { var sql = this.sqlcontext; var month = this.formSearch.getForm().findField('PS_ACCDATE').getRawValue(); this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql, month: month }, waitMsg: "正在查询数据...", scope: this }); }, getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; var SALE = form.findField('PS_SALE').getValue(); sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'"); 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(); }, onSetFeeClick: function (button, event) { var GidStr = ''; var records = this.GridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择要发放的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; if (rec.data.ISSALEFEE != '已发放') { bodyAddDatas.push(rec); } } _this = this; if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: '提示', msg: '没有要发放提成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.wait('正在提取数据...'); var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: '正在锁定...', url: '/MvcShipping/MsRptSaleBalProfitShare/SetFee', params: { data: jsonbodyAddDatas }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.onRefreshClick(); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onCancelSetFeeClick: function (button, event) { var GidStr = ''; var records = this.GridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择要发放的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; if (rec.data.ISSALEFEE != '未发放') { bodyAddDatas.push(rec); } } _this = this; if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: '提示', msg: '没有要发放提成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.wait('正在提取数据...'); var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: '正在锁定...', url: '/MvcShipping/MsRptSaleBalProfitShare/CancelSetFee', params: { data: jsonbodyAddDatas }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.onRefreshClick(); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, 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) { this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.girdcolums, 1, true); }, oninitGridClick: function (button, event) { var agirdcolums = this.initgirdcolums; this.gridList.reconfigure(this.storeList, agirdcolums); this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.initgirdcolums, 1, true); }, onExportClick: function (button, event) { GridExportExcelPage(this.gridList); }, Print: function () { _this = this; if (this.storeList.getCount() == 0) { return; } var sql = this.sqlcontext var stlsql = this.getstlCondition(); var iszerodr = this.CheckAllDR.checked; var Dsql = this.getDCondition(); var isallstl = this.CheckOnlyStl.checked; var sortstr = ''; if (this.bslistsortfield != '' && this.bslistsortdire != '') { sortstr = this.bslistsortfield + ' ' + this.bslistsortdire; } Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptSaleBalProfitShare/GetDataListStr', scope: this, params: { start: 0, limit: this.PageSize, condition: sql, stlcondition: stlsql, isdrzero: iszerodr, dcondition: Dsql,isallstl:isallstl, sort: 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 = 'MSRPTSALEBALPROFITSHARELIST'; 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 }); } } }); } });