//集运管理-路单查询 Ext.namespace('Shipping'); Shipping.MsRptSaleJieSuanTiChengIndex = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsRptSaleJieSuanTiChengIndex.superclass.constructor.call(this); }; //需求编号:SR2017072100012 Ext.extend(Shipping.MsRptSaleJieSuanTiChengIndex, Ext.Panel, { PageSize: 1000, OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, sqlcontext: '1=2', bslistsortfield: '', bslistsortdire: '', initUIComponents: function () { this.formname = 'MsRptSaleJieSuanTiChengIndex'; Ext.Ajax.timeout = 12000000; //#region 主列表 //#region 定义数据集 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: 'FEESTATUSREF', type: 'string' }, { name: 'BSTYPE', type: 'string' }, { name: 'ISSALEFEE', type: 'string' }, { name: 'SETTLETIME_T', type: 'string' }, { name: 'SETTLETIME_Y', 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: '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: 'STLRMBCR', type: 'number' }, { name: 'STLUSDCR', type: 'number' }, { name: 'STLOTCR', type: 'number' }, { name: 'STLTTLCR', type: 'number' }, { name: 'PROFITRATE', type: 'string' } ], remoteSort: true, timeout: 60000000, //60秒 proxy: { type: 'ajax', url: '/MvcShipping/MsRptSaleJieSuanTiCheng/GetDataList2', timeout: 60000000, //60秒 reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); this.Pagenum = Ext.create('Ext.form.field.Number', { name: 'bottles', fieldLabel: '每页记录数', labelAlign: 'right', value: this.PageSize, maxValue: 100000, width: 180, minValue: 0, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#endregion //#region 定义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: '费用锁定', align: 'center', width: 70, renderer: function (value, cellmeta) { if (value == '锁定') { return ""; } } }, { sortable: true, dataIndex: 'ISSALEFEE', header: '提成发放', width: 70 }, { sortable: true, dataIndex: 'OPDATE', header: '业务日期', width: 86 }, { sortable: true, dataIndex: 'SETTLETIME_T', header: '提成月份', renderer: Ext.util.Format.dateRenderer('Y-m'), width: 86 }, { sortable: true, dataIndex: 'SETTLETIME_Y', header: '应结算时间', width: 86 }, { sortable: true, dataIndex: 'SETTLETIME', header: '实际结算时间', width: 86 }, { sortable: true, dataIndex: 'CUSTOMERNAME', header: '委托单位', width: 120 }, { sortable: true, dataIndex: 'MBLNO', header: '主提单号', width: 120 }, { sortable: true, dataIndex: 'SALE', header: '业务员', width: 80 } // , { // sortable: true, // dataIndex: 'CUSTNO', // header: '委托编号', // width: 136 // }, { // sortable: true, // dataIndex: 'BLFRT', // header: '付费方式', // width: 200 // }, { // 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: 'OP', // 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: 'INTEREST', 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: '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: '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: '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 = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.initgirdcolums, 1); //#endregion //#region 定义Grid this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); this.gridList = new Ext.grid.GridPanel({ border: false, store: this.storeList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, selModel: this.GridCheckBoxModel, disableSelection: false, 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.Pagenum] }); //#endregion //#region Grid事件 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); //#endregion //#endregion //#region 合计列表 //#region 定义数据集 this.storeListSum = Ext.create('Ext.data.Store', { pageSize: this.PageSize, fields: [ { name: 'BSNO', type: 'string' }, { name: 'OPTYPE', type: 'string' }, { 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: 'STLRMBCR', type: 'number' }, { name: 'STLUSDCR', type: 'number' }, { name: 'STLOTCR', type: 'number' }, { name: 'STLTTLCR', type: 'number' } //,{ name: 'PROFITRATE', type: 'string' } ], remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsRptSaleJieSuanTiCheng/GetDataListSum', timeout: 60000000, //60秒 reader: { id: 'BSNO', root: 'data', totalProperty: 'totalCount' } } }); //#endregion //#region 定义Grid列名 this.girdcolumsSum = [{ sortable: true, dataIndex: 'BSNO', header: '编号', hidden: true, width: 0 }, { sortable: true, dataIndex: 'OPTYPE', header: '单据类型', width: 70 }, { sortable: true, dataIndex: 'INTEREST', 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: '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: '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: '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 }]; //#endregion //#region 定义Grid this.gridListSum = new Ext.grid.GridPanel({ border: false, store: this.storeListSum, enableHdMenu: false, region: 'south', height: 110, loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolumsSum, viewConfig: { autoFill: true }, features: [{ ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性//需求编号:SR2017071700006-2、3、4 }] }); //#endregion //#endregion //#region 加载下拉框 _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.comboxCUSTSERVER= Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客 服', store: this.storeSalesCode, forceSelection: true, name: 'PS_CUSTSERVICE', 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, name: 'PS_CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeEnterpCode = Ext.create('DsExt.ux.RefTableStore', { fields: [ { name: 'CUSTOMER', type: 'string' }, { name: 'ENTERPID', type: 'string' } ], proxy: { url: '/MvcShipping/MsOpApply/GetENTERPLIST' } }); this.storeEnterpCode.load(); this.comboxEnterp = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '经营单位', store: this.storeEnterpCode, name: 'PS_ENTERP', valueField: 'CUSTOMER', displayField: 'CUSTOMER', 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', { 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', { 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.StoreFeeLock = Ext.create('Ext.data.Store', { fields: ['OpLb'] }); this.StoreFeeLock.add({ "OpLb": "全部" }); this.StoreFeeLock.add({ "OpLb": "已锁定" }); this.StoreFeeLock.add({ "OpLb": "未锁定" }); this.comboxFeeLock = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '费用锁定', store: this.StoreFeeLock, forceSelection: true, name: 'PS_FEELOCK', valueField: 'OpLb', displayField: 'OpLb', 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": "", "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: 'ISFEE', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#endregion //#region formSearch this.formSearch = Ext.widget('form', { border: false, 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', defaultType: 'textfield', items: [this.comboxOpLb, { fieldLabel: '编号', name: 'PS_MBLNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '船名', name: 'PS_VESSEL', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '航次', name: 'PS_VOYNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxSalesCode, this.comboxOp ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxBsType, this.comboxCustCode, { 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: '从结算日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_STLDATEBGN', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到结算日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_STLDATEEND', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxBSSOURCE, { 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.comboxSubComp, this.comboxFeeLock, this.comboxCUSTSERVER] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '资金占用费', //扣息 name: 'INTEREST_FEE', value: '0.0003', allowBlank: false }, this.comboxaddDCType, { fieldLabel: '从发放日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_FEEDATEBGN', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到发放日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_FEEDATEEND', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield'}] }] }] }); //#endregion //#region 查询工具条 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({ border: false, 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.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 } ] }); //#endregion //#region 页面布局 this.panelTop = new Ext.Panel({ border: false, layout: "border", region: "north", height: 150, items: [this.panelBtn, this.formSearch] }); Ext.apply(this, { border: false, items: [this.panelTop, this.gridList, this.gridListSum] }); //#endregion //提取查询条件记忆 LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery); }, //end initUIComponents //#region 查询 onRefreshClick: function (button, event) { if (!this.checkSearchCondition()) return; Ext.Ajax.timeout = 60000000; var sql = this.getCondition(); var stlsql = this.getstlCondition(); var Dsql = this.getDCondition(); var INTEREST_FEE = this.formSearch.getForm().findField('INTEREST_FEE').getValue(); this.sqlcontext = sql; this.PageSize = this.Pagenum.getValue(); this.storeList.pageSize = this.PageSize; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql, stlcondition: stlsql, dcondition: Dsql, INTEREST_FEE: INTEREST_FEE }, waitMsg: "正在查询数据...", timeout: 60000000, scope: this }); this.storeList.on('beforeload', function (store) { Ext.apply(store.proxy.extraParams, { condition: sql, stlcondition: stlsql, dcondition: Dsql, INTEREST_FEE: INTEREST_FEE }); }, this); this.storeListSum.load({ params: { start: 0, limit: this.PageSize, condition: sql, stlcondition: stlsql, dcondition: Dsql, INTEREST_FEE: INTEREST_FEE }, waitMsg: "正在查询数据...", timeout: 60000000, scope: this }); }, getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; 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 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 OP = form.findField('PS_OP').getValue(); sql = sql + getAndConSql(sql, OP, "B.OP='" + OP + "'"); var CUSTSERVICE = form.findField('PS_CUSTSERVICE').getValue(); sql = sql + getAndConSql(sql, CUSTSERVICE, "B.CUSTSERVICE='" + CUSTSERVICE + "'"); 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 SUBCOMP = form.findField('SUBCOMP').getValue(); sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'"); var VESSEL = form.findField('PS_VESSEL').getValue(); sql = sql + getAndConSql(sql, VESSEL, "B.VESSEL like '%" + VESSEL + "%'"); var VOYNO = form.findField('PS_VOYNO').getValue(); sql = sql + getAndConSql(sql, VOYNO, "B.VOYNO like '%" + VOYNO + "%'"); var BSSOURCE = form.findField('BSSOURCE').getValue(); sql = sql + getAndConSql(sql, BSSOURCE, "B.BSSOURCE='" + BSSOURCE + "'"); var PS_FEELOCK = form.findField('PS_FEELOCK').getValue(); if (PS_FEELOCK == '已锁定') sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=1"); else if (PS_FEELOCK == '未锁定') sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=0"); var ISFEE = form.findField('ISFEE').getValue(); if (ISFEE == '1') sql = sql + getAndConSql(sql, ISFEE, "f.ISFEE=1"); else if (ISFEE == '2') sql = sql + getAndConSql(sql, ISFEE, "ISNULL(f.ISFEE,0)<>1"); var feeDate_Min = form.findField('PS_FEEDATEBGN').getRawValue(); sql = sql + getAndConSql(sql, feeDate_Min, " f.INPUTDATE>='" + feeDate_Min + "'"); var feeDate_Max = form.findField('PS_FEEDATEEND').getRawValue(); sql = sql + getAndConSql(sql, feeDate_Max, " f.INPUTDATE<='" + feeDate_Max + " 23:59:59'"); return sql; }, getstlCondition: function () { var form = this.formSearch.getForm(); var sql = ''; var asql = ''; var expDate_Min = form.findField('PS_STLDATEBGN').getRawValue(); sql = sql + getAndConSql(sql, expDate_Min, " B.SETTLETIME>='" + expDate_Min + "'"); asql = asql + getAndConSql(asql, expDate_Min, " convert(varchar(10),B.CREATETIME,120)>='" + expDate_Min + "'"); var expDate_Max = form.findField('PS_STLDATEEND').getRawValue(); sql = sql + getAndConSql(sql, expDate_Max, " B.SETTLETIME<='" + expDate_Max + " 23:59:59' "); asql = asql + getAndConSql(asql, expDate_Max, " convert(varchar(10),B.CREATETIME,120)<='" + expDate_Max + " 23:59:59' "); if (sql!='') sql = " ((" + sql + ") or (B.TTLDR=0 and " + asql + " )) "; sql = sql + getAndConSql(sql, "11", " B.TTLDR=B.STLTTLDR and b.FEESTATUSREF='锁定'"); // AND B.TTLDR<>0 return sql; }, getDCondition: function () { var form = this.formSearch.getForm(); var sql = ''; var expDate_Min = form.findField('PS_STLDATEBGN').getRawValue(); if (expDate_Min != '') { var myexpDate_Min = Ext.util.Format.date(expDate_Min, 'Y-m'); sql = sql + getAndConSql(sql, myexpDate_Min, " B.ACCDATE>='" + myexpDate_Min + "'"); } var expDate_Max = form.findField('PS_STLDATEEND').getRawValue(); if (expDate_Max != '') { var myexpDate_Max = Ext.util.Format.date(expDate_Max, 'Y-m'); sql = sql + getAndConSql(sql, myexpDate_Max, " B.ACCDATE<='" + myexpDate_Min + "'"); } 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(); }, //#endregion //#region 发放提成 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/MsRptSaleJieSuanTiCheng/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 }); } }, //#endregion //#region 取消发放 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/MsRptSaleJieSuanTiCheng/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 }); } }, //#endregion //#region 保存列表 onSaveGridClick: function (button, event) { this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.girdcolums, 1, true); }, //#endregion //#region 列表初始化 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); }, //#endregion //#region 导出 onExportClick: function (button, event) { GridExportExcelPage(this.gridList); }, //#endregion //#region 打印 Print: function () { _this = this; if (this.storeList.getCount() == 0) { return; } // var sql = this.sqlcontext var stlsql = this.getstlCondition(); var Dsql = this.getDCondition(); var INTEREST_FEE = this.formSearch.getForm().findField('INTEREST_FEE').getValue(); // var sortstr = ' B.ETD,B.MBLNO DESC'; if (this.bslistsortfield != '' && this.bslistsortdire != '') { sortstr = this.bslistsortfield + ' ' + this.bslistsortdire; } // Ext.Msg.wait('正在组织数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在组织数据...', url: '/MvcShipping/MsRptSaleJieSuanTiCheng/GetDataListStr', scope: this, params: { start: 0, limit: this.PageSize, condition: sql, stlcondition: stlsql, dcondition: Dsql, sortstr: sortstr, INTEREST_FEE: INTEREST_FEE }, 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 = 'MsRptSaleJieSuanTiChengList'; 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 }); } } }); }, //#endregion 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; } });