Ext.namespace('Shipping'); Shipping.MsChfeeAudit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsChfeeAudit.superclass.constructor.call(this); }; Ext.extend(Shipping.MsChfeeAudit, Ext.Panel, { ParentWin: null, //弹出式 ParentPanel: null, //Tab页编辑模式 OpStatus: 'add', EditRecord: null, RefBillNo: '*', DataLoading: true, stroplb: '', strOPTYPE: '普通货', strBSNO: '', strMBSNO: '', FeeStatus: '', feeType: 0, PageSize: 50, sqlcontext: '', isAmend: '0', initUIComponents: function () { Ext.Ajax.timeout = 1200000; this.formname = 'FormBLAuditBL'; this.strMBSNO = ''; this.isAmend = '0'; this.AMENDSELFWORKFLOW = 0; this.AUDITNOBACK = 0; this.ISBLFEE = 1; this.strOPTYPE = '普通货'; this.BLAUDITISHESUANDAN = 1; //明细表-数据集 this.storeBLChFee = Ext.create('Ext.data.Store', { model: 'MsBLChFee', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetBLFeeList', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.initgirdBLcolums = [{ sortable: true, dataIndex: 'BsNo', header: '业务编号', hidden: true, width: 200 }, { sortable: true, dataIndex: 'AccName', header: '费用名称', width: 100 }, { sortable: true, dataIndex: 'ObjDr', header: '应收结算对象', width: 110 }, { sortable: true, dataIndex: 'RMBDR', header: '应收RMB', align: 'right', width: 80, 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; } }, { sortable: true, dataIndex: 'USDDR', header: '应收USD', align: 'right', width: 80, 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; } } //, { // sortable: true, // dataIndex: 'OTDR', // header: '应收其他', // align: 'right', // width: 80, // 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; // } //}, { // sortable: true, // dataIndex: 'TTLDR', // header: '应收合计', // align: 'right', // width: 80, // 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; // } //} , { sortable: true, dataIndex: 'RemarkDr', header: '应收备注', width: 110 }, { sortable: true, dataIndex: 'ObjCr', header: '应付结算对象', width: 110 }, { sortable: true, dataIndex: 'RMBCR', header: '应付RMB', align: 'right', width: 80, 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; } }, { sortable: true, dataIndex: 'USDCR', header: '应付USD', align: 'right', width: 80, 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; } } //, { // sortable: true, // dataIndex: 'OTCR', // header: '应付其他', // align: 'right', // width: 80, // 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; // } //}, { // sortable: true, // dataIndex: 'TTLCR', // header: '应付合计', // align: 'right', // width: 80, // 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; // } //} , { sortable: true, dataIndex: 'RemarkCr', header: '应付备注', width: 110 }, { sortable: true, dataIndex: 'RMBPROFIT', header: 'RMB利润', align: 'right', width: 80, 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; } }, { sortable: true, dataIndex: 'USDPROFIT', header: 'USD利润', align: 'right', width: 80, 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; } }, { sortable: true, dataIndex: 'TTLPROFIT', header: '费用利润', align: 'right', width: 80, 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; } } ]; this.girdBLcolums = this.initgirdBLcolums; this.feeBLGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); _thisblaudit = this; this.gridBLChFee = new Ext.grid.GridPanel({ store: this.storeBLChFee, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.feeBLGridCheckBoxModel, selType: 'cellmodel', viewConfig: { autoFill: true, enableTextSelection: true }, tbar: [{ xtype: 'label', labelAlign: 'right', width: 60, html: "费用信息" }, '-', { text:'保存列表样式',//保存列表样式 menu: [ { text:'保存', //保存 handler: function (button, event) { _thisblaudit.girdBLcolums = DsTruck.SaveGridPanel(userid, _thisblaudit.formname + 'fee', _thisblaudit.gridBLChFee.columns, _thisblaudit.girdBLcolums, 0, true); } }, { text:'初始化', //初始化 handler: function (menu, event) { _thisblaudit.gridBLChFee.reconfigure(_thisblaudit.storeBLChFee, _thisblaudit.initgirdDrcolums); _thisblaudit.girdBLcolums = DsTruck.SaveGridPanel(userid, _thisblaudit.formname + 'fee', _thisblaudit.gridBLChFee.columns, _thisblaudit.initgirdBLcolums, 0, true); } }], scope: this } ], columns: this.girdBLcolums }); this.girdBLcolums = DsTruck.GetGridPanel(userid, this.formname+'fee', this.girdBLcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列 this.gridBLChFee.reconfigure(this.storeBLChFee, this.girdBLcolums); this.storeDrChFee = Ext.create('Ext.data.Store', { model: 'MsChFee', remoteSort: false, proxy: { type: 'ajax', url: '/Account/Chfee_Audit/GetDataList', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.storeCrChFee = Ext.create('Ext.data.Store', { model: 'MsChFee', remoteSort: false, proxy: { type: 'ajax', url: '/Account/Chfee_Audit/GetDataList', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.storeChFeeGain = Ext.create('Ext.data.Store', { model: 'MsChFeeGain', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetOPGainList', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.storeChFeeMasterGain = Ext.create('Ext.data.Store', { model: 'MsChFeeGain', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetMasterGainData', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.storeChFeeModify = Ext.create('Ext.data.Store', { model: 'MsChFee', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetModifyData', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.CheckAll = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.OnlyAuditBusiness, //仅需审核业务 checked: true, width: 120 }); this.initgirdDrcolums = [{ sortable: true, dataIndex: 'GId', header: '惟一编号', hidden: true, width: 160 }, { sortable: true, dataIndex: 'BsNo', header: '业务编号', hidden: true, width: 200 }, { sortable: true, dataIndex: 'FeeStatus', header: Zi.LAN.CostStatus,//费用状态 renderer: function (value, p, record) { return record.data.FeeStatus_Ref; }, width: 66 }, { sortable: true, dataIndex: 'FeeName', header: Zi.LAN.NameFeePayable,//应收费用名称 width: 100 }, { sortable: true, dataIndex: 'FeeDescription', header: Zi.LAN.CostEnglishName,//费用英文名称 width: 120 }, { sortable: true, dataIndex: 'CustomerType', header: Zi.LAN.CustomerCategory,//客户类别 width: 80 }, { sortable: true, dataIndex: 'CustomerName', header: Zi.LAN.SettlementObject,//结算对象 width: 120 }, { sortable: true, dataIndex: 'Unit', header: Zi.LAN.UnitStandard,//单位标准 width: 60 }, { sortable: true, dataIndex: 'UnitPrice', header: Zi.LAN.price,//单价 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: 'TaxUnitPrice', header: Zi.LAN.TaxPrice,//含税单价 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: 'Quantity', header: Zi.LAN.Num,//数量 width: 60 }, { sortable: true, dataIndex: 'TaxRate', header: Zi.LAN.taxRate,//税率 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: 60 }, { sortable: true, dataIndex: 'NoTaxAmount', header: Zi.LAN.NotaxRate,//不含税金额 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: 'Amount', header: Zi.LAN.Money,//金额 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: 'Currency', header: Zi.LAN.Currency,//币别 width: 40 }, { sortable: true, dataIndex: 'ExChangerate', header: Zi.LAN.exchangeRate,//汇率 align: 'right', width: 60 }, { sortable: true, dataIndex: 'AccTaxRate', header: Zi.LAN.InputTaxRate,//进项税率 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: 'Remark', header: Zi.LAN.Remarks,//备注 width: 150 }, { sortable: true, dataIndex: 'IsAdvancedpay', header: Zi.LAN.WhetherToAdvance,//是否垫付 width: 60 }, { sortable: true, dataIndex: 'IsInvoice', header: Zi.LAN.Nnvoice,//不开发票 width: 60 }, { sortable: true, dataIndex: 'FeeFrt', header: 'FRT', width: 40 }, { sortable: true, dataIndex: 'Commissionrate', header: Zi.LAN.CommissionRate,//佣金比率 width: 60 }, { sortable: true, dataIndex: 'OpName', header: Zi.LAN.notIncludederson,//录入人 width: 60 }, { sortable: true, dataIndex: 'EnterDate', header: Zi.LAN.EnterDate,//录入日期 renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Auditoperator', header: Zi.LAN.Auditor,//审核人 width: 60 }, { sortable: true, dataIndex: 'AuditDate', header: Zi.LAN.ReviewDate,//审核日期 renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Settlement', header: Zi.LAN.SettlementAmount,//结算金额 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: 'Invoice', header: Zi.LAN.BillingAmount,//已开票金额 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: 'InvoiceNum', header: Zi.LAN.InvoiceNumber,//发票号码 width: 80 }, { sortable: true, dataIndex: 'IsOpen', header: Zi.LAN.IsOpen, //'是否机密', renderer: function (value, cellmeta) { if (value == 'True' ||value == 'true' || value == '1') { return "√"; } else return ""; }, width: 60 } ]; this.girdDrcolums = this.initgirdDrcolums; this.feeDrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); _this = this; this.gridDrChFee = new Ext.grid.GridPanel({ store: this.storeDrChFee, enableHdMenu: false, region: 'center', loadMask: { msg: Zi.LAN.LoadData },//数据加载中 trackMouseOver: true, disableSelection: false, selModel: this.feeDrGridCheckBoxModel, selType: 'cellmodel', viewConfig: { autoFill: true, getRowClass: function (record, rowIndex, rowParams, store) { var feeStatus = record.get('FeeStatus'); var ISSEL = record.get('ISSEL'); if (ISSEL == '1') return Shipping.FeeGetRowClassFont(feeStatus); else return Shipping.FeeGetRowClass(feeStatus); } }, tbar: [{ xtype: 'label', labelAlign: 'right', width: 60, html: "" + Zi.LAN.ChargesPayable + "" }, '-', { text: Zi.LAN.ViewInformation,//查看信息 tooltip: '查看信息', handler: function (button, event) { _this.onViewDetailClick(button, event, 1); }, scope: this }, '-', { text: Zi.LAN.SavelistStyle,//保存列表样式 menu: [ { text: Zi.LAN.Save, //保存 handler: function (button, event) { _this.girdDrcolums = DsTruck.SaveGridPanel(userid, 'FEEDRGRIDAD', _this.gridDrChFee.columns, _this.girdDrcolums, 0, true); } }, { text: Zi.LAN.Initialization, //初始化 handler: function (menu, event) { _this.gridDrChFee.reconfigure(this.storeDrChFee, _this.initgirdDrcolums); _this.girdDrcolums = DsTruck.SaveGridPanel(userid, 'FEEDRGRIDAD', _this.gridDrChFee.columns, _this.initgirdDrcolums, 0, true); } }], scope: this }, '-', { text: Zi.LAN.ShowWorkflow,//显示工作流 tooltip: '显示工作流', handler: function (button, event) { this.onViewWorkFlowDetailClick(button, event, 1); }, scope: this }], columns: this.girdDrcolums }); this.girdDrcolums = DsTruck.GetGridPanel(userid, 'FEEDRGRIDAD', this.girdDrcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列 this.initgirdCrcolums = [{ sortable: true, dataIndex: 'GId', header: '惟一编号', hidden: true, width: 160 }, { sortable: true, dataIndex: 'BsNo', header: '业务编号', hidden: true, width: 200 }, { sortable: true, dataIndex: 'FeeStatus', header: Zi.LAN.CostStatus,//费用状态 renderer: function (value, p, record) { return record.data.FeeStatus_Ref; }, width: 66 }, { sortable: true, dataIndex: 'FeeName', header: Zi.LAN.NamePayable,//应付费用名称 width: 100 }, { sortable: true, dataIndex: 'FeeDescription', header: Zi.LAN.CostEnglishName,//费用英文名称 width: 120 }, { sortable: true, dataIndex: 'CustomerType', header: Zi.LAN.CustomerCategory,//客户类别 width: 80 }, { sortable: true, dataIndex: 'CustomerName',//结算对象 header: Zi.LAN.SettlementObject, width: 120 }, { sortable: true, dataIndex: 'Unit', header: Zi.LAN.UnitStandard,//单位标准 width: 60 }, { sortable: true, dataIndex: 'UnitPrice', header: Zi.LAN.price,//单价 renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 3, '', 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: 'TaxUnitPrice', header: Zi.LAN.TaxPrice,//含税单价 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: 'Quantity', header: Zi.LAN.Num,//数量 width: 60 }, { sortable: true, dataIndex: 'TaxRate', header: Zi.LAN.taxRate,//税率 align: 'right', width: 60 }, { sortable: true, dataIndex: 'NoTaxAmount', header: Zi.LAN.NotaxRate,//不含税金额 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: 'Amount', header: Zi.LAN.Money,//金额 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: 'Currency', header: Zi.LAN.Currency,//币别 width: 40 }, { sortable: true, dataIndex: 'ExChangerate', header: Zi.LAN.exchangeRate,//汇率 align: 'right', width: 60 }, { sortable: true, dataIndex: 'AccTaxRate', header: Zi.LAN.XiaoxiangSL,//销项税率 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: 'Remark', header: Zi.LAN.Remarks,//备注 width: 150 }, { sortable: true, dataIndex: 'IsAdvancedpay', header: Zi.LAN.WhetherToAdvance,//是否垫付 width: 60 }, { sortable: true, dataIndex: 'IsInvoice', header: Zi.LAN.Nnvoice,//不开发票 width: 60 }, { sortable: true, dataIndex: 'FeeFrt', header: 'FRT', width: 40 }, { sortable: true, dataIndex: 'Commissionrate', header: Zi.LAN.CommissionRate,//佣金比率 width: 60 }, { sortable: true, dataIndex: 'OpName', header: Zi.LAN.notIncludederson,//录入人 width: 60 }, { sortable: true, dataIndex: 'EnterDate', header: Zi.LAN.EnterDate,//录入日期 renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Auditoperator', header: Zi.LAN.Auditor,//审核人 width: 60 }, { sortable: true, dataIndex: 'AuditDate', header: Zi.LAN.ReviewDate,//审核日期 renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Settlement', header: Zi.LAN.SettlementAmount,//结算金额 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: 'OrderAmount', header: Zi.LAN.ShenQingJinE,//申请金额 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: 'IsOpen', header: Zi.LAN.IsOpen, //'是否机密', renderer: function (value, cellmeta) { if (value == 'True' || value == 'true' || value == '1') { return "√"; } else return ""; }, width: 60 } ]; this.girdCrcolums = this.initgirdCrcolums; this.feeCrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); _this = this; this.gridCrChFee = new Ext.grid.GridPanel({ store: this.storeCrChFee, enableHdMenu: false, region: 'center', loadMask: { msg: Zi.LAN.LoadData }, trackMouseOver: true, disableSelection: false, selModel: this.feeCrGridCheckBoxModel, selType: 'cellmodel', viewConfig: { autoFill: true, getRowClass: function (record, rowIndex, rowParams, store) { var feeStatus = record.get('FeeStatus'); var ISSEL = record.get('ISSEL'); if (ISSEL == '1') return Shipping.FeeGetRowClassFont(feeStatus); else return Shipping.FeeGetRowClass(feeStatus); } }, tbar: [{ xtype: 'label', labelAlign: 'right', width: 60, html: "" + Zi.LAN.Payable + "" }, '-', { text: Zi.LAN.ViewInformation,//查看信息 tooltip: '查看信息', handler: function (button, event) { _this.onViewDetailClick(button, event, 2); }, scope: this }, '-', { text: Zi.LAN.ShowWorkflow,//显示工作流 tooltip: '显示工作流', handler: function (button, event) { this.onViewWorkFlowDetailClick(button, event, 2); }, scope: this }, '-', { text: Zi.LAN.SavelistStyle,//保存列表样式 menu: [ { text: Zi.LAN.Save, //保存 handler: function (button, event) { _this.girdCrcolums = DsTruck.SaveGridPanel(userid, 'FEECRGRIDAD', _this.gridCrChFee.columns, _this.girdCrcolums, 0, true); } }, { text: Zi.LAN.Initialization, //初始化 handler: function (menu, event) { _this.gridCrChFee.reconfigure(this.storeCrChFee, _this.initgirdCrcolums); _this.girdCrcolums = DsTruck.SaveGridPanel(userid, 'FEECRGRIDAD', _this.gridCrChFee.columns, _this.initgirdCrcolums, 0, true); } }], scope: this }], columns: this.girdCrcolums }); this.girdCrcolums = DsTruck.GetGridPanel(userid, 'FEECRGRIDAD', this.girdCrcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列 //明细表表格 this.InitDrGrid(this.girdDrcolums); this.InitCrGrid(this.girdCrcolums); this.storeBodySum = Ext.create('Ext.data.Store', { model: 'MsOPGain', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetOPGainList', reader: { root: 'data', totalProperty: 'totalCount' } } }); this.gridSum = new Ext.grid.GridPanel({ store: this.storeBodySum, enableHdMenu: false, region: 'center', loadMask: { msg: Zi.LAN.LoadData },//数据加载 trackMouseOver: true, disableSelection: false, columns: [{ header: "" + Zi.LAN.Sum + "",//总计 sortable: false, align: 'center', dataIndex: 'CURR', width: 160 }, { header: Zi.LAN.TaxesNotIncluded,//应收不含税 dataIndex: 'NORATEDR', 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: 160 }, { header: Zi.LAN.TaxIncluded,//应收含税 dataIndex: 'DR', align: 'right', 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; }, width: 160 }, { header: Zi.LAN.PayableTax,//应付不含税 dataIndex: 'NORATECR', align: 'right', 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; }, width: 160 }, { header: Zi.LAN.YingFuHanShui,//应付含税 dataIndex: 'CR', align: 'right', 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; }, width: 160 }, { header: Zi.LAN.notIncluded,//利润不含税 dataIndex: 'NORATEPR', 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: 160 }, { header: Zi.LAN.notIncludedID,//利润含税 dataIndex: 'PR', align: 'right', 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; }, width: 160 } ] }); this.storeChFeeGain = Ext.create('Ext.data.Store', { model: 'MsChFeeGain', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetGainData', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.gridListCust = new Ext.grid.GridPanel({ store: this.storeChFeeGain, enableHdMenu: false, region: 'center', loadMask: { msg: Zi.LAN.LoadData },//数据加载 trackMouseOver: true, disableSelection: false, columns: [{ sortable: true, dataIndex: 'CUSTOMERNAME', header: Zi.LAN.SettlementObject,//结算对象 width: 110 }, { sortable: true, dataIndex: 'RMBDR', header: LOCALCURR + Zi.LAN.Receivable,//应收 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: 'RMBCR', header: LOCALCURR + Zi.LAN.Handle,//应付 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: 'RMBPROFIT', header: LOCALCURR + Zi.LAN.profit,//利润 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: 'USDDR', header: 'USD' + Zi.LAN.Receivable,//应收 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: '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', width: 80 }, { sortable: true, dataIndex: 'USDPROFIT', header: 'USD' + Zi.LAN.profit,//利润 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: 'OTDR', header: Zi.LAN.ReceivableOther,//其他币别应收 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: 'OTCR', header: Zi.LAN.HandleOther,//其他币别应付 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: 'OTPROFIT', header: Zi.LAN.Otherprofit,//其他币别利润 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: 'TTLDR', header: Zi.LAN.ReceivableSum,//合计应收 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: 'TTLCR', header: Zi.LAN.profitSum,//合计应付 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: 'TTLPROFIT', header: Zi.LAN.Hejiprofit,//合计利润 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 } ] }); this.panelCustSum = new Ext.Panel({ title:'客户合计',//客户合计 layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.gridListCust] }); //#region 主票费用合计 //this.MasterSumColumn = this.initCustSumColumn; ////定义Grid //this.gridListMaster = new Ext.grid.GridPanel({ // store: this.storeChFeeMasterGain, // enableHdMenu: false, // columnLines: true, // region: 'center', // loadMask: { msg:'数据加载中。。。' }, // trackMouseOver: true, // viewConfig: { // autoFill: true, // enableTextSelection: true // }, // disableSelection: false, // // features: [{ // // ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 // // }], // columns: this.MasterSumColumn, // // paging bar on the bottom // bbar: Ext.create('Ext.PagingToolbar', { // store: this.storeChFeeMasterGain, // displayInfo: true, // displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', // emptyMsg: "没有数据" // }) //}); //this.panelCustMaster = new Ext.Panel({ // title: '客户合计', //'客户合计', // layout: "border", // region: 'center', // animate: true, // autoScroll: true, // //containerScroll: true, // frame: false, // items: [this.gridListMaster] //}); //#endregion this.panelCurrSum = new Ext.Panel({ title: Zi.LAN.BiBieSum,//币别合计 layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.gridSum] }); this.storeChFeeAmendGain = Ext.create('Ext.data.Store', { model: 'MsChFeeGain', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetAmendGainData', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.gridListAmendttl = new Ext.grid.GridPanel({ store: this.storeChFeeAmendGain, enableHdMenu: false, region: 'center', loadMask: { msg: Zi.LAN.LoadData }, trackMouseOver: true, disableSelection: false, columns: [{ sortable: true, dataIndex: 'CUSTOMERNAME', header: Zi.LAN.AmendttlObject, //结算对象 width: 160 }, { sortable: true, dataIndex: 'RMBDR', header: LOCALCURR + Zi.LAN.Receivable, 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: 'RMBCR', header: LOCALCURR + Zi.LAN.Handle, 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: 'RMBPROFIT', header: LOCALCURR + Zi.LAN.profit, 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: 'USDDR', header: 'USD' + Zi.LAN.Receivable, 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: 'USDCR', header: Zi.LAN.profitUSD, 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: 'USDPROFIT', header: Zi.LAN.USDprofit, //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', width: 80 }, { sortable: true, dataIndex: 'OTDR', header: Zi.LAN.ReceivableOther, 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: 'OTCR', header: Zi.LAN.ReceivableOther, 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: 'OTPROFIT', header: Zi.LAN.Otherprofit, 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: 'TTLDR', header: Zi.LAN.ReceivableSum, 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: 'TTLCR', header: Zi.LAN.profitSum, 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: 'TTLPROFIT', header: Zi.LAN.Hejiprofit, 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 } ] }); this.panelAmendttlSum = new Ext.Panel({ title: Zi.LAN.TotalProfitAmendSTR, //客户合计 layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.gridListAmendttl] }); this.tabTotal = new Ext.TabPanel({ activeTab: 0, autoWidth: true, border: true, height: 180, frame: false, region: 'south', enableHdMenu: false, // region: 'center', title: Zi.LAN.ChangeProfitBefore,//利润统计 collapsed: true, collapsible: true, split: true, enableTabScroll: true, items: [ this.panelCustSum, this.panelCurrSum, this.panelAmendttlSum ] }); this.storeBillList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'MsChFeedoBill', remoteSort: true, proxy: { type: 'ajax', timeout: 120000, url: '/Account/Chfee_Audit/GetBLListData3', reader: { id: 'BSNO', root: 'data', totalProperty: 'totalCount' } } }); this.Pagenum = Ext.create('Ext.form.field.Number', { name: 'bottles', fieldLabel: Zi.LAN.PageNum,//每页记录数 labelAlign: 'right', value: this.PageSize, maxValue: 100000, width: 180, minValue: 0, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.AddGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); this.initgirdcolums = [{ sortable: true, id: '', dataIndex: '', header: '', width: 0 }, { sortable: true, dataIndex: 'BSNO', header: 'BSNO', width: 0 }, { sortable: true, dataIndex: 'BLTYPE', header:'业务类型',//业务类别 width: 80 }, { sortable: true, dataIndex: 'OPLBNAME', header: Zi.LAN.ServiceCategory,//业务类别 width: 80 }, { sortable: true, dataIndex: 'OPTYPE', header: Zi.LAN.ChangeSingle,//更改单 width: 80 }, { sortable: true, dataIndex: 'CUSTNO', header: Zi.LAN.DelegateNumber,//委托编号 width: 120 }, { sortable: true, dataIndex: 'MBLNO', header: Zi.LAN.ladingNumber,//主提单号 width: 120 }, { sortable: true, dataIndex: 'HBLNO', header: Zi.LAN.FenladingNumber, //分提单号 width: 120 }, { sortable: true, dataIndex: 'CUSTOMNO', header: Zi.LAN.DeclarationNumber, //报关单号 width: 120 }, { sortable: true, id: '', align: 'center', dataIndex: 'BSSTATUSREF', header: Zi.LAN.BusinessLock,//业务锁定 width: 60, renderer: function (value, cellmeta) { if (value == '锁定') { return ""; } } }, { sortable: true, id: '', align: 'center', dataIndex: 'FEESTATUSREF', header: Zi.LAN.Costlock,//费用锁定 width: 60, renderer: function (value, cellmeta) { if (value == '锁定') { return ""; } } }, { sortable: true, id: '', dataIndex: 'DRFEESTATUS', header: Zi.LAN.ChargesPayable,//应收费用 align: 'center', width: 60, renderer: function (value, meta) { if (value == '审核通过') { meta.tdCls = 'feestatus_pass'; } else if (value == '录入状态') { } else if (value == '提交审核') { meta.tdCls = 'feestatus_refer'; } else if (value == '部分结算') { meta.tdCls = 'feestatus_refer'; } else if (value == '结算完毕') { meta.tdCls = 'feestatus_settle'; } else if (value == '未录入') { } else if (value == '部分结算') { meta.tdCls = 'feestatus_settle'; } else if (value == '部分审核') { meta.tdCls = 'feestatus_pass'; } else if (value == '部分提交') { meta.tdCls = 'feestatus_refer'; } return value; } }, { sortable: true, id: '', dataIndex: 'CRFEESTATUS', header: Zi.LAN.Payable,//应付费用 align: 'center', width: 60, renderer: function (value, meta) { if (value == '审核通过') { meta.tdCls = 'feestatus_pass'; } else if (value == '录入状态') { } else if (value == '提交审核') { meta.tdCls = 'feestatus_refer'; } else if (value == '部分结算') { meta.tdCls = 'feestatus_refer'; } else if (value == '结算完毕') { meta.tdCls = 'feestatus_settle'; } else if (value == '未录入') { } else if (value == '部分结算') { meta.tdCls = 'feestatus_settle'; } else if (value == '部分审核') { meta.tdCls = 'feestatus_pass'; } else if (value == '部分提交') { meta.tdCls = 'feestatus_refer'; } return value; } }, { sortable: true, dataIndex: 'OPSTATUS', header: Zi.LAN.CostStatus,//费用状态 width: 180 }, { sortable: true, dataIndex: 'CUSTOMERNAME', header: Zi.LAN.Requester,//委托单位 width: 100 }, { sortable: true, dataIndex: 'ETD', header: Zi.LAN.SailingDate,//开船日期 renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 100 }, { sortable: true, dataIndex: 'SALE', header: Zi.LAN.LanhuoPeople,//揽货人 width: 80 }, { sortable: true, dataIndex: 'CNTRTOTAL', header: Zi.LAN.Changing,//集装箱 width: 120 }, { sortable: true, dataIndex: 'ACCDATE', header: Zi.LAN.kuaiJiQJ, //会计期间 width: 80 }, { sortable: true, dataIndex: 'BSSOURCE', header: Zi.LAN.BusinessSource, //业务来源 width: 80 }, { sortable: true, dataIndex: 'BSSOURCEDETAIL', header: Zi.LAN.BSSOURCEDETAIL, //业务来源 width: 80 }, { sortable: true, dataIndex: 'ENTERP', header: Zi.LAN.BusinessUnit, //经营单位 width: 80 }, { sortable: true, dataIndex: 'OP', header: Zi.LAN.Operating, //操作 width: 80 }, { sortable: true, dataIndex: 'INPUTBY', header: Zi.LAN.notIncludederson, //录入人 width: 80 }, { sortable: true, dataIndex: 'PORTLOAD', header: Zi.LAN.loadingDock, //起运港 width: 120 }, { sortable: true, dataIndex: 'PORTDISCHARGE', header: Zi.LAN.PORTDISCHARGE, //目的港 width: 120 }, { sortable: true, dataIndex: 'PLACERECEIPT', header: Zi.LAN.PLACERECEIPT, //收货地 width: 120 }, { sortable: true, dataIndex: 'DESTINATION', header: Zi.LAN.DESTINATION, //目的地 width: 120 }, { sortable: true, dataIndex: 'VESSEL', header: Zi.LAN.ShipName, //船名 width: 150 }, { sortable: true, dataIndex: 'VOYNO', header: Zi.LAN.Voyage, //航次 width: 60 }, { sortable: true, dataIndex: 'CARRIER', header: Zi.LAN.CARRIER, //航次 width: 60 }, { sortable: true, dataIndex: 'BLFRT', header: Zi.LAN.BLFRT, //航次 width: 60 }, { sortable: true, dataIndex: 'CUSTOMSNUM', header: Zi.LAN.NumberDeclarations, //报关项数 width: 60 }, { sortable: true, dataIndex: 'PKGS', header: Zi.LAN.NumberOfpieces, //件数 width: 60 }, { sortable: true, dataIndex: 'KGS', header: Zi.LAN.Weight, //重量 width: 60 }, { sortable: true, dataIndex: 'CBM', header: Zi.LAN.Size, //尺码 width: 60 }, { sortable: true, dataIndex: 'REMARK', header: Zi.LAN.Remarks, //备注 width: 80 }, { sortable: true, dataIndex: 'REMARK2', header: Zi.LAN.Remarks2, //备注 width: 80 }, { sortable: true, dataIndex: 'REASON', header:'更改原因', //备注 width: 80 }, { sortable: true, dataIndex: 'INVNO', header: Zi.LAN.INVNO, //报关单号 width: 120 }, { sortable: true, id: '', dataIndex: 'BillFeeStatus', header: Zi.LAN.BillFeeStatus, //'整票状态', width: 60, renderer: function (value, meta) { if (value == '0') { return "未提交"; } else if (value == '1') { meta.tdCls = 'feestatus_refer'; return "整票提交"; } else if (value == '2') { meta.tdCls = 'feestatus_pass'; return "审核通过"; } else if (value == '4') { meta.tdCls = 'feestatus_nopass'; return "整票驳回"; } else { return ""; } } }, { sortable: true, dataIndex: 'BILLFEESTATUSTIME', header: Zi.LAN.BILLFEESTATUSTIME, //报关单号 width: 120 }, { sortable: true, dataIndex: 'BILLFEEOP', header: Zi.LAN.BILLFEEOP, //报关单号 width: 120 } ]; this.girdcolums = this.initgirdcolums; this.gridBillList = new Ext.grid.GridPanel({ store: this.storeBillList, enableHdMenu: false, region: 'center', loadMask: { msg: Zi.LAN.LoadData }, trackMouseOver: true, viewConfig: { autoFill: true, enableTextSelection: true }, plugins: [{ ptype: 'rowexpander', rowBodyTpl: [ '
', '
' ] }], disableSelection: false, selModel: this.AddGridCheckBoxModel, columns: this.girdcolums, // paging bar on the bottom bbar: [Ext.create('Ext.PagingToolbar', { store: this.storeBillList, displayInfo: true, displayMsg: Zi.LAN.FenYe,//数据加载 emptyMsg: Zi.LAN.NoAudtid //没有要审核的数据 }), this.Pagenum] }); this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列 this.gridBillList.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/MsOpSeae/EditView?handle=check&bsno=" + record.data.PARENTID; } else if (record.data.OPLBNAME == "海运进口" || record.data.OPLBNAME == "海运进口散货") { openUrl = "../../MvcShipping/MsOpSeai/EditView?handle=check&bsno=" + record.data.PARENTID; } else if (record.data.OPLBNAME == "空运出口") { openUrl = "../../MvcShipping/MsOpAire/EditView?handle=check&bsno=" + record.data.PARENTID; } else if (record.data.OPLBNAME == "空运进口") { openUrl = "../../MvcShipping/MsOpAiri/EditView?handle=check&bsno=" + record.data.PARENTID; } else if (record.data.OPLBNAME == "报关业务") { openUrl = "../../MvcShipping/MsOpApply/EditView?handle=check&bsno=" + record.data.PARENTID; } else if (record.data.OPLBNAME == "综合业务") { openUrl = "../../MvcShipping/MsOpOther/EditView?handle=check&bsno=" + record.data.PARENTID; } else { openUrl = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO; } window.open(openUrl, openType, openSet); // DsOpenEditWin("/TruckMng/MsWlPc/Edit"); }, this); this.gridBillList.view.on('expandBody', function (rowNode, record, expandRow, eOpts) { _this.displayInnerGrid(record.get('BSNO'), record.get('BLTYPE')); }); this.gridBillList.view.on('collapsebody', function (rowNode, record, expandRow, eOpts) { _this.destroyInnerGrid(record); }); //#region formSearch //#region formSearch枚举参照相关 this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {}); this.StoreOpLb.load({ params: { enumTypeId: 96005} }); this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.BusinessType,//业务类型 store: this.StoreOpLb, 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: Zi.LAN.TypeTransport,//运输类型 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: Zi.LAN.LanhuoPeople,//揽货人 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: Zi.LAN.Operating,//操作 width: 90, store: this.storeSalesCode, forceSelection: true, name: 'PS_OP', valueField: 'UserName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.Requester,//委托单位 store: this.storeCustCode, forceSelection: true, name: 'PS_CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', { model: 'MsFeeCurr', proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' } }); this.StoreCurr.load({ params: { condition: ""} }); this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.Currency,//币别 store: this.StoreCurr, forceSelection: true, name: 'Currency', valueField: 'CURR', displayField: 'CURR', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.FeeTypeRefModel', proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' } }); this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.CostName,//费用名称 store: this.storeFeeNameRef, forceSelection: true, name: 'FeeName', valueField: 'Name', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeCust = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCust.load({ params: { condition: ""} }); this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SettlementCustomers,//结算客户 store: this.storeCust, forceSelection: true, name: 'CUSTNAME', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.VesselModel', proxy: { url: '/CommMng/BasicDataRef/GetVesselList' } }); this.storeVoyVeg.load({ params: { condition: ""} }); this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.ShipName,//船名 store: this.storeVoyVeg, valueField: 'VESSEL', name: 'PS_VESSEL', displayField: 'VESSEL', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); Ext.define('OpSeaeShipper', { extend: 'Ext.data.Model', idProperty: 'SHIPPERID', fields: [ { name: 'SHIPPERID', type: 'string' }, { name: 'CODENAME', type: 'string' }, { name: 'SHORTNAME', type: 'string' }, { name: 'CodeAndName', type: 'string' }, { name: 'SHIPPERDETAIL', type: 'string' }, { name: 'SHIPPERTYPE', type: 'int' }, { name: 'LOADADDRESS', type: 'string' }, { name: 'DELIVERADDRESS', type: 'string' }, { name: 'ISPUBLIC', type: 'bool' } ] }); this.storeagent = Ext.create('DsExt.ux.RefTableStore', { model: 'OpSeaeShipper', proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' } }); this.storeagent.load({ params: { condition: "shippertype=4 "} }); this.comboxAgent = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.ForeignAgent,//国外代理 store: this.storeagent, forceSelection: true, name: 'PS_AGENT', valueField: 'SHORTNAME', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { specialkey: 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: Zi.LAN.BusinessSource,//业务来源 store: this.storeSource, forceSelection: true, name: 'BSSOURCE', valueField: 'SourceName', displayField: 'SourceName' }); this.storeFEEUP = Ext.create('Ext.data.Store', { fields: ['FSTATUS', 'NAME'] }); this.storeFEEUP.add({ "FSTATUS": "", "NAME": "" }); this.storeFEEUP.add({ "FSTATUS": "0", "NAME": "否" }); this.storeFEEUP.add({ "FSTATUS": "1", "NAME": "是" }); this.comboxFEEUP = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.WhetherCostIsSubmitted,//是否费用提交 store: this.storeFEEUP, valueField: 'FSTATUS', displayField: 'NAME', // flex: 0.7, labelWidth: 90, forceSelection: true, name: 'ISFEEUP', value: '', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeBillFeeStatus = Ext.create('Ext.data.Store', { fields: ['FSTATUS', 'NAME'] }); this.storeBillFeeStatus.add({ "FSTATUS": "", "NAME": "全部" }); this.storeBillFeeStatus.add({ "FSTATUS": "1", "NAME": "整票提交" }); this.storeBillFeeStatus.add({ "FSTATUS": "2", "NAME": "审核通过" }); this.storeBillFeeStatus.add({ "FSTATUS": "4", "NAME": "整票驳回" }); this.comboxBillFeeStatus = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '整票状态', //是否开垫付 store: this.storeBillFeeStatus, valueField: 'FSTATUS', displayField: 'NAME', forceSelection: true, name: 'BillFeeStatus', value: '', // flex: 0.7, enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#endregion this.CheckSaveQuery = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.RememberQuery,//记忆查询条件 checked: true, width: 120 }); this.formSearch = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 0, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 70, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxOpLb, { fieldLabel: Zi.LAN.SingleNumber,//单号 name: 'PS_MBLNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxVoyVeg, { fieldLabel: Zi.LAN.Voyage,//航次 name: 'PS_VOYNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxAgent, this.comboxCust, { xtype: 'button', width: 90,//执行查询 text: Zi.LAN.Executequery, iconCls: "btnrefresh", handler: function (button, event) { // _this.LoadData(this.opStatus, "", this.RefBillNo); this.onRefreshClick(button, event); var isvisible = true; var issavevalue = false; isvisible = true; if (this.CheckSaveQuery.checked) issavevalue = true saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue); }, scope: this } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxBsType, this.comboxSalesCode, this.comboxCustCode, { fieldLabel: Zi.LAN.FromBusinessDate,//从业务日期 format: 'Y-m-d', xtype: 'datefield', name: 'PS_EXPDATEBGN', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: Zi.LAN.ToBusinessDate,//至业务日期 format: 'Y-m-d', xtype: 'datefield', name: 'PS_EXPDATEEND', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxFeeNameRef, { xtype: 'button', width: 90, text: Zi.LAN.ResetCondition,//重置 iconCls: "btnreset", handler: function (button, event) { this.onClearSql(button, event); }, scope: this } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxBSSOURCE, { fieldLabel: Zi.LAN.FromAccountingPeriod,//从会计期间 xtype: 'monthfield', name: 'PS_ACCDATEBGN', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: Zi.LAN.ToAccountingPeriod,//至会计期间 xtype: 'monthfield', name: 'PS_ACCDATEEND', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxOp, this.comboxBillFeeStatus, { xtype: 'hiddenfield' }, { xtype: 'button', width: 90, text: Zi.LAN.AdvancedSearch,//高级查询 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 } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); //查询工具条 _this = this; this.SearchBtn = new Ext.Button({ text: Zi.LAN.ShowQuery, handler: function () { if (_this.SearchBtn.text == Zi.LAN.HideQuery) { _this.panelSearch.hide(); _this.SearchBtn.setText(Zi.LAN.ShowQuery); } else { _this.panelSearch.show(); _this.SearchBtn.setText(Zi.LAN.HideQuery); } } }); this.storeAddDCType = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storeAddDCType.add({ "DC": "0", "NAME": "全部" }); this.storeAddDCType.add({ "DC": "1", "NAME": "待审核" }); this.storeAddDCType.add({ "DC": "2", "NAME": "已审核" }); this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.FYchakan,//费用查看范围 store: this.storeAddDCType, valueField: 'DC', displayField: 'NAME', forceSelection: true, name: 'DC', value: '0' }); this.panelBtn = new Ext.Panel({ region: "north", tbar: [this.SearchBtn, '-', { xtype: 'button', text: Zi.LAN.ReLoad,//刷新 iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); var isvisible = true; var issavevalue = false; isvisible = true; if (this.CheckSaveQuery.checked) issavevalue = true saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue); }, scope: this } , '-', this.CheckAll, '-', this.CheckSaveQuery, '-', { text: Zi.LAN.SavelistStyle, //保存列表样式 id: "btntest", menu: [ { text: Zi.LAN.Save, //保存 handler: function (button, event) { this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridBillList.columns, _this.girdcolums, 1, true); } }, { text: Zi.LAN.Initialization, //初始化 handler: function (menu, event) { _this.gridBillList.reconfigure(this.storeBillList, _this.initgirdcolums); _this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridBillList.columns, _this.initgirdcolums, 1, true); } }], scope: this }, { text: Zi.LAN.LooKYUanPiao, //查看原票费用 id: 'ViewFee', 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/MsOpBill/MsOpFeeView?handle=check&bsno=" + this.strMBSNO; window.open(openUrl, openType, openSet); }, scope: this }, '-', { text: '整票审核', tooltip: '整票审核', handler: function (button, event) { _this.onSelAuditClick(button, event); }, scope: this }, '-', { text: '整票驳回', tooltip: '整票审核', handler: function (button, event) { _this.onSelAuditBackClick(button, event); }, scope: this }, '-', { text: '查看工作流', tooltip: '查看工作流', handler: function (button, event) { _this.onSelViewClick(button, event); }, scope: this }, '-', { text: Zi.LAN.btnprintview, //"打印", iconCls: 'btnprint', handler: function (button, event) { _this.PrintSelect(1); }, scope: this }, '-', { text: Zi.LAN.btnprint, //"打印", iconCls: 'btnprint', handler: function (button, event) { _this.PrintSelect(); }, 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: 90, items: [this.formSearch] }); this.panelBill = new Ext.Panel({ // title: '业务信息', layout: "border", region: 'north', height: 200, frame: true, split: true, items: [this.gridBillList] }); //this.panelDrChFee = new Ext.Panel({ // // title: '应收费用', // layout: "border", // // anchor: '100% 50%', // frame: true, // region: 'west', // width: 620, // split: true, // items: [this.gridDrChFee] //}); //this.panelCrChFee = new Ext.Panel({ // // title: '应付费用', // layout: "border", // // anchor: '100% 50%', // region: 'center', // // region: 'center', // frame: true, // items: [this.gridCrChFee] //}); //this.panelFee = new Ext.Panel({ // // title: '费用信息', // // layout: "border", // layout: "border", // // region: 'north', // // height: 560, // region: 'center', // items: [ // this.panelDrChFee, this.panelCrChFee // ] //}); this.storeBLList = Ext.create('Ext.data.Store', { pageSize: 50, fields: [ { name: 'OPTYPE', type: 'string' }, { name: 'CUSTNO', type: 'string' }, { name: 'MBLNO', type: 'string' }, { name: 'ACCDATE', type: 'string' }, { name: 'TTLPROFIT', type: 'number' } ], remoteSort: true, proxy: { type: 'ajax', timeout: 120000, url: '/MvcShipping/MsRptOpProfit/BsParentListData', reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); this.gridBLlistcolumn = [{ sortable: true, dataIndex: 'OPTYPE', text: '更改单', width: 50 }, { sortable: true, id: '', dataIndex: 'CUSTNO', text: '委托编号', width: 80 }, { sortable: true, id: '', dataIndex: 'MBLNO', text: '主提单号', width: 80 }, { sortable: true, id: '', dataIndex: 'ACCDATE', text: '会计期间', width: 60 },{ 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', width: 80 } ]; //定义Grid this.gridBLList = new Ext.grid.GridPanel({ store: this.storeBLList, title:'相关委托信息', enableHdMenu: false, region: 'east', width:300, loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.gridBLlistcolumn }); this.panelFee = new Ext.Panel({ // title: '费用信息', // layout: "border", layout: "border", // region: 'north', // height: 560, region: 'center', items: [ this.gridBLChFee, this.gridBLList ] }); //#region 布局 //this.panelList = new Ext.Panel({ // title:'审核列表', //'委托信息', // layout: "border", // region: 'center', // animate: true, // autoScroll: true, // frame: false, // //closable:true, // items: [this.panelSearch, this.panelBill] //}); //this.panelBody = new Ext.Panel({ // title: '详细信息', //'委托信息', // layout: "border", // region: 'center', // animate: true, // autoScroll: true, // frame: false, // //closable:true, // items: [this.formHead,this.panelFee, this.tabTotal] //}); //this.tabpanel = new Ext.TabPanel({ // activeTab: 0, // layout: 'border', // border: true, // frame: false, // region: 'center', // enableTabScroll: true, // items: // [ // this.panelList, // this.panelBody // ] //}); Ext.apply(this, { items: [this.panelTop, this.panelSearch, this.panelBill, this.panelFee, this.tabTotal] }); //#endregion // this.opStatus = 'add'; _this = this; this.storeBillList.on('beforeload', function (store) { var sql = this.sqlcontext; Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext }); }, this); this.CheckAll.addListener('change', function (field, newValue, oldValue, eOpts) { this.CheckChange(field, newValue, oldValue, eOpts); }, this); _this = this; this.gridDrChFee.getSelectionModel().on('select', function (model, record, index) { var FeeStatus = record.data.FeeStatus; var GId = record.data.GId; var oldAmount = record.data.Amount; var oldExChangerate = record.data.ExChangerate; var FeeName = record.data.FeeName; for (i = 0; i < this.storeCrChFee.getCount(); i += 1) { var memberyf = this.storeCrChFee.getAt(i); if (memberyf.data.FeeName == FeeName) { memberyf.set("ISSEL", '1'); } else { memberyf.set("ISSEL", '0'); } }; }, this); this.gridCrChFee.getSelectionModel().on('select', function (model, record, index) { var FeeStatus = record.data.FeeStatus; var GId = record.data.GId; var oldAmount = record.data.Amount; var oldExChangerate = record.data.ExChangerate; var FeeName = record.data.FeeName; for (i = 0; i < this.storeDrChFee.getCount(); i += 1) { var memberyf = this.storeDrChFee.getAt(i); if (memberyf.data.FeeName == FeeName) { memberyf.set("ISSEL", '1'); } else { memberyf.set("ISSEL", '0'); } }; }, this); this.gridDrChFee.on({ selectionchange: function (sm, selections) { if (selections.length == 0) { for (i = 0; i < _this.storeCrChFee.getCount(); i += 1) { var memberyf = _this.storeCrChFee.getAt(i); memberyf.set("ISSEL", '0'); }; } } }); this.gridCrChFee.on({ selectionchange: function (sm, selections) { if (selections.length == 0) { for (i = 0; i < _this.storeDrChFee.getCount(); i += 1) { var memberyf = _this.storeDrChFee.getAt(i); memberyf.set("ISSEL", '0'); }; } } }); _this = this; this.gridBillList.getSelectionModel().on('select', function (model, record, index) { var bsno = record.data.BSNO; var optype = record.data.OPLBNAME; var OPTYPE = record.data.OPTYPE; var bltype = record.data.BLTYPE; this.strOPTYPE = OPTYPE; this.stroplb = record.data.OPLB; this.strBSNO = record.data.BSNO; this.strMBSNO = record.data.PARENTID; this.FeeStatus = record.data.FEESTATUS; var isAll = '0'; var condition = this.getFeeCondition(); // isAll = this.comboxaddDCType.getValue(); if (this.BLAUDITISHESUANDAN == 1) { this.storeBLChFee.load({ params: { bsno: bsno, bltype: bltype, optype: this.strOPTYPE } }); } else { this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: this.stroplb, isAll: isAll, condition: condition } }); this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: this.stroplb, isAll: isAll, condition: condition } }); } if (OPTYPE == '更改单') { this.storeBLList.load({ params: { condition: "MASTERNO in (SELECT MASTERNO FROM V_OP_BILL WHERE PARENTID='" + this.strMBSNO + "')" } }); } else this.storeBLList.load({ params: { condition: "MASTERNO in (SELECT MASTERNO FROM V_OP_BILL WHERE PARENTID='" + this.strBSNO + "')" } }); this.storeBodySum.load({ params: { bsno: bsno, bltype: bltype, optype: OPTYPE, oplb: this.stroplb }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); this.storeChFeeGain.load({ params: { bsno: bsno, bltype: bltype, optype: this.stroplb} }); this.storeChFeeAmendGain.load({ params: { bsno: this.strMBSNO, bltype: bltype } }); }, this); this.InitData(); LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery); this.gridBillList.reconfigure(this.storeBillList, this.girdcolums); this.gridBillList.columns[1] = new Ext.grid.RowNumberer(); //#region 费用锁定 this.CheckAccMonth = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.XiuGaiKuaiji, //修改会计期间 checked: false, width: 120 }); this.formAccMonthShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 85, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.CheckAccMonth, { fieldLabel: Zi.LAN.kuaiJiQJ, //会计期间 xtype: 'monthfield', name: 'AccDate' } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winFeeCloseShow = Ext.create('Ext.window.Window', { title: Zi.LAN.FYfengzhang, //费用封账 width: 420, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formAccMonthShow], buttons: [{ text: Zi.LAN.SureFengZhang, //确认封账 minWidth: 70, handler: function () { var form = me.formAccMonthShow.getForm(); if (me.CheckAccMonth.checked) { me.AccDate = form.findField('AccDate').getRawValue(); if (me.AccDate == '' || me.AccDate == null || me.AccDate == undefined) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Bixukuaiji, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; }; me.IsAccDate = '1'; } else me.IsAccDate = '0'; _this.onSelFeeLockClick() } }, { text: Zi.LAN.close, minWidth: 70, handler: function () { me.winFeeCloseShow.close(); } }] }); //#endregion Ext.Ajax.request({ waitMsg: '', url: '/MvcShipping/MsSysParamSet/GetData', params: { condition: "PARAMNAME='AMENDSELFWORKFLOW'" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success != true) { } else { var data = result.data; if (data.PARAMVALUE == '1') { this.AMENDSELFWORKFLOW = 1; } else { } } } else { } }, scope: this }); Ext.Ajax.request({ waitMsg: '', url: '/MvcShipping/MsSysParamSet/GetData', params: { condition: "PARAMNAME='AUDITNOBACK'" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success != true) { } else { var data = result.data; if (data.PARAMVALUE == '1') { this.AUDITNOBACK = 1; } else { } } } else { } }, scope: this }); Ext.Ajax.request({ waitMsg: '', url: '/MvcShipping/MsSysParamSet/GetData', params: { condition: "PARAMNAME='BLAUDITISHESUANDAN'" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success != true) { } else { var data = result.data; if (data.PARAMVALUE == '1') { this.BLAUDITISHESUANDAN = 1; } else { } } } else { } }, scope: this }); this.panelSearch.hide(); //人员信息加载 this.storeOpCodeTZ = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' } }); this.storeOpCodeTZ.load(); //客服 this.comboxTZ = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '通知人员', store: this.storeOpCodeTZ, forceSelection: true, name: 'TZ', valueField: 'UserName', displayField: 'CodeAndName' }); this.formAuditBack = Ext.widget('form', { frame: true, region: 'center', title: "驳回原因", bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [{ xtype: 'textareafield', grow: true, fieldLabel: '', labelSeparator: '', labelWidth: 0, height: 100, name: 'ORREASON', anchor: '100%' }, this.comboxTZ ]//end root items }); me = this; this.winAuditBackShow = Ext.create('Ext.window.Window', { title: "驳回整票审核", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formAuditBack], buttons: [{ text: "确认驳回", minWidth: 70, handler: function () { var form = me.formAuditBack.getForm(); var ORREASON = form.findField('ORREASON').getRawValue(); if (ORREASON == '' || ORREASON == null || ORREASON == undefined) { Ext.Msg.show({ title: '提示', msg: '驳回原因为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; }; me.reason = ORREASON; me.onAuditBack(); } }, { text: "关闭", minWidth: 70, handler: function () { me.winAuditBackShow.close(); } }] }); }, //end initUIComponents //#region 加载数据 InitData: function () { var condition = ''; /* if (this.ParentPanel) { var ret = this.ParentPanel.OprationSwap(); this.opStatus = ret[0]; this.StoreList = ret[1]; this.editRecord = ret[2]; this.RefBillNo = ret[3]; } */ // this.panelSearch.hide(); this.LoadData(this.opStatus, condition, this.RefBillNo); }, //end InitData LoadData: function (opstatus, condition, refbillno) { this.feeCrSerialNo = 0; this.feeCrBodyDel = []; this.feeCrSerialNo = 0; this.feeCrBodyDel = []; this.opStatus = opstatus; this.PageSize = this.Pagenum.getValue(); this.storeBillList.pageSize = this.PageSize; // this.BillSql = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0) "; this.BillSql = " (OPTYPE='更改单' or (OPTYPE='普通货' and (BLTYPE='整箱' OR (BSNO=MASTERNO)))) AND EXISTS (select 1 from workflow_using wu left join workflow_step st on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) " this.BillSql = this.BillSql + " where wu.bsno=v_op_bill.BSNO " this.BillSql = this.BillSql + " and wu.TYPENO=602 " this.BillSql = this.BillSql + " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + userid + "' ) "; _this = this; this.sqlcontext = this.BillSql; this.storeBillList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql }, waitMsg: Zi.LAN.NowSelect,//正在查询 callback: function (r, options, success) { if (success) { this.DataLoading = false; if (r.length > 0) { this.gridBillList.getSelectionModel().select(0); } else { var bsno = '1'; var optype = '1'; var isAll = '0'; // isAll = this.comboxaddDCType.getValue(); if (this.BLAUDITISHESUANDAN == 1) { _this.storeBLChFee.load({ params: { bsno: bsno, bltype: '', optype:'' } }); } else { _this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll } }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll } }); } _this.storeBodySum.load({ params: { bsno: bsno }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno} }); _this.storeChFeeAmendGain.load({ params: { bsno: bsno } }); _this.storeBLList.removeAll(); // _this.storeChFeeGain.load({ params: { bsno: bsno }, // callback: function (r, options, success) { // if (success) { // _this.formtotal.getForm().loadRecord(_this.storeChFeeGain.getAt(0)); // } // }, // scope: this // }); } } }, scope: this }); // var el = Ext.get("gridDrChFee"); /* this.storeDrChFee.load({ params: { billno: this.gid, type: 1} }); this.storeCrChFee.load({ params: { billno: this.gid, type: 2} }); this.storeChFeeGain.load({ params: { bsno: this.gid }, callback: function (r, options, success) { if (success) { this.formtotal.getForm().loadRecord(this.storeChFeeGain.getAt(0)); } }, scope: this }); */ }, // end LoadDate InitDrGrid: function (grid) { var agirdcolums = grid; this.gridDrChFee.reconfigure(this.storeDrChFee, agirdcolums); }, InitCrGrid: function (grid) { var agirdcolums = grid; this.gridCrChFee.reconfigure(this.storeCrChFee, agirdcolums); }, //#region 拼箱分票Grid displayInnerGrid: function (renderId, fenpiao) { if (fenpiao != '拼箱主票' && fenpiao != '合票主票') return; var storeBillListfen = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'MsChFeedoBill', remoteSort: true, proxy: { type: 'ajax', timeout: 120000, url: '/Account/Chfee_Audit/GetBLListData', reader: { id: 'BSNO', root: 'data', totalProperty: 'totalCount' } } }); var innerGrid = Ext.create('Ext.grid.Panel', { store: storeBillListfen, viewConfig: { enableTextSelection: true, //允许复制数据 autoFill: true }, columns: this.initgirdcolums, frame: false, renderTo: renderId }); innerGrid.columns[0] = new Ext.grid.RowNumberer(); innerGrid.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/MsOpSeae/EditView?handle=check&bsno=" + record.data.BSNO; } else if (record.data.OPLBNAME == "海运进口" || record.data.OPLBNAME == "海运进口散货") { openUrl = "../../MvcShipping/MsOpSeai/EditView?handle=check&bsno=" + record.data.BSNO; } else if (record.data.OPLBNAME == "空运出口") { openUrl = "../../MvcShipping/MsOpAire/EditView?handle=check&bsno=" + record.data.BSNO; } else if (record.data.OPLBNAME == "空运进口") { openUrl = "../../MvcShipping/MsOpAiri/EditView?handle=check&bsno=" + record.data.BSNO; } else if (record.data.OPLBNAME == "报关业务") { openUrl = "../../MvcShipping/MsOpApply/EditView?handle=check&bsno=" + record.data.BSNO; } else if (record.data.OPLBNAME == "综合业务") { openUrl = "../../MvcShipping/MsOpOther/EditView?handle=check&bsno=" + record.data.BSNO; } else { openUrl = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO; } window.open(openUrl, openType, openSet); }, this); storeBillListfen.on('beforeload', function (store) { var sql = " MASTERNO='" + renderId + "' AND BSNO<>'" + renderId + "'" Ext.apply(store.proxy.extraParams, { condition: sql }); }, this); storeBillListfen.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " MASTERNO='" + renderId + "' AND BSNO<>'" + renderId + "'" } }); _this = this; innerGrid.getSelectionModel().on('select', function (model, record, index) { var bsno = record.data.BSNO; var optype = record.data.OPLBNAME; var OPTYPE = record.data.OPTYPE; this.strOPTYPE = OPTYPE; this.stroplb = record.data.OPLB; this.strBSNO = record.data.BSNO; this.strMBSNO = record.data.PARENTID; this.FeeStatus = record.data.FEESTATUS; var isAll = '0'; var condition = this.getFeeCondition(); // isAll = this.comboxaddDCType.getValue(); if (this.BLAUDITISHESUANDAN == 1) { this.storeBLChFee.load({ params: { bsno: bsno, bltype: record.data.BLTYPE, optype: record.data.OPTYPE } }); } else { this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: this.stroplb, isAll: isAll, condition: condition } }); this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: this.stroplb, isAll: isAll, condition: condition } }); } this.storeBLList.load({ params: { condition: "PARENTID='" + this.strMBSNO + "'" } }); this.storeBodySum.load({ params: { bsno: bsno, oplb: this.stroplb }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); this.storeChFeeGain.load({ params: { bsno: bsno, optype: this.stroplb} }); this.storeChFeeAmendGain.load({ params: { bsno: this.strMBSNO } }); }, this); }, destroyInnerGrid: function (record, fenpiao) { if (record.get('BLTYPE') != '拼箱主票' && record.get('BLTYPE')!= '合票主票') return; var parent = document.getElementById(record.get('BSNO')); var child = parent.firstChild; while (child) { child.parentNode.removeChild(child); child = child.nextSibling; } }, //#endregion setTotalHead: function () { //var rmbdr = 0; //var rmbcr = 0; //var usddr = 0; //var usdcr = 0; //var otdr = 0; //var otcr = 0; //var ttldr = 0; //var ttlcr = 0; //var rmbprofit = 0; //var usdprofit = 0; //var otprofit = 0; //var ttlprofit = 0; //var profitrate = 0; //for (i = 0; i < this.storeBodySum.getCount(); i += 1) { // var memberyf = this.storeBodySum.getAt(i); // if (memberyf.data.CURR == LOCALCURR) { // rmbdr = memberyf.data.DR; // rmbcr = memberyf.data.CR; // rmbprofit = memberyf.data.PR; // } else if (memberyf.data.CURR == 'USD') { // usddr = memberyf.data.DR; // usdcr = memberyf.data.CR; // usdprofit = memberyf.data.PR; // } if (memberyf.data.CURR == '其他币别') { // otdr = memberyf.data.DR; // otcr = memberyf.data.CR; // otprofit = memberyf.data.PR; // } if (memberyf.data.CURR == '合计') { // ttldr = memberyf.data.DR; // ttlcr = memberyf.data.CR; // ttlprofit = memberyf.data.PR; // profitrate = memberyf.data.PROFITRATE; // } //} var ref = this.getProfitNum(); rmbdr = ref.rmbdr; rmbcr = ref.rmbcr; rmbprofit = ref.rmbprofit; usddr = ref.usddr; usdcr = ref.usdcr; rmbdr = ref.rmbdr; usdprofit = ref.usdprofit; otdr = ref.otdr; otcr = ref.otcr; otprofit = ref.otprofit; ttldr = ref.ttldr; ttlcr = ref.ttlcr; ttlprofit = ref.ttlprofit; profitrate = ref.profitrate; noacctaxttldr = ref.noacctaxttldr; noacctaxttlcr = ref.noacctaxttlcr; acctaxttldr = ref.acctaxttldr; acctaxttlcr = ref.acctaxttlcr; var rmblb = ""; var usdlb = ""; var otlb = ""; var ttllb = ""; if (this.onlyfeedr == 1) { rmbcr = '***'; rmbprofit = '***'; usdcr = '***'; usdprofit = '***'; otcr = '***'; otprofit = '***'; ttlcr = '***'; ttlprofit = '***'; } if (this.onlyfeecr == 1) { rmbdr = '***'; rmbprofit = '***'; usddr = '***'; usdprofit = '***'; otdr = '***'; otprofit = '***'; ttldr = '***'; ttlprofit = '***'; } if (rmbdr != 0 || rmbcr != 0 || rmbprofit != 0) { var feecolor = 'green'; if (rmbprofit < 0) feecolor = 'red'; rmblb = "   " + LOCALCURR + Zi.LAN.profit + ":" + returnfloat(rmbprofit) + "   |"; } if (usddr != 0 || usdcr != 0 || usdprofit != 0) { var feecolor = 'green'; if (usdprofit < 0) feecolor = 'red'; usdlb = "   "+Zi.LAN.USDprofit + "" + returnfloat(usdprofit) + "   |"; } if (otdr != 0 || otcr != 0 || otprofit != 0) { var feecolor = 'green'; if (otprofit < 0) feecolor = 'red'; otlb = "   " +Zi.LAN.Otherprofit + "" + returnfloat(otprofit) + "   |"; } //if (ttldr != 0 || ttlcr != 0 || ttlprofit != 0) { var feecolor = 'green'; if (ttlprofit < 0) feecolor = 'red'; ttllb = "   " + Zi.LAN.ReceivableSum + ": " + returnfloat(ttldr) + "   " + Zi.LAN.profitSum + ":" + returnfloat(ttlcr) + "   " + Zi.LAN.Hejiprofit + "" + returnfloat(ttlprofit) + "  " + Zi.LAN.ProfitMargins + "" + returnfloat(profitrate) + ""; //} this.tabTotal.setTitle(Zi.LAN.TotalProfit + rmblb + usdlb + otlb + ttllb); }, getProfitNum: function () { var rmbdr = 0; var rmbcr = 0; var usddr = 0; var usdcr = 0; var otdr = 0; var otcr = 0; var ttldr = 0; var ttlcr = 0; var rmbprofit = 0; var usdprofit = 0; var otprofit = 0; var ttlprofit = 0; var profitrate = 0; var noacctaxttldr = 0; var noacctaxttlcr = 0; var acctaxttldr = 0; var acctaxttlcr = 0; for (i = 0; i < this.storeBodySum.getCount(); i += 1) { var memberyf = this.storeBodySum.getAt(i); if (memberyf.data.CURR == LOCALCURR) { rmbdr = memberyf.data.DR; rmbcr = memberyf.data.CR; rmbprofit = memberyf.data.PR; } else if (memberyf.data.CURR == 'USD') { usddr = memberyf.data.DR; usdcr = memberyf.data.CR; usdprofit = memberyf.data.PR; } if (memberyf.data.CURR == '其他币别') { otdr = memberyf.data.DR; otcr = memberyf.data.CR; otprofit = memberyf.data.PR; } if (memberyf.data.CURR == '合计') { ttldr = memberyf.data.DR; ttlcr = memberyf.data.CR; ttlprofit = memberyf.data.PR; profitrate = memberyf.data.PROFITRATE; noacctaxttldr = memberyf.data.NOACCTAXRATEDR; noacctaxttlcr = memberyf.data.NOACCTAXRATECR; acctaxttldr = memberyf.data.ACCTAXDR; acctaxttlcr = memberyf.data.ACCTAXCR; } } return { rmbdr: rmbdr, rmbcr: rmbcr, rmbprofit: rmbprofit, usddr: usddr, usdcr: usdcr, usdprofit: usdprofit, otdr: otdr, otcr: otcr, otprofit: otprofit, ttldr: ttldr, ttlcr: ttlcr, ttlprofit: ttlprofit, profitrate: profitrate, noacctaxttldr: noacctaxttldr, noacctaxttlcr: noacctaxttlcr, acctaxttldr: acctaxttldr, acctaxttlcr: acctaxttlcr }; }, //#endregion //#region 明细操作 onRefreshClick: function (button, event) { // var girdcolums = this.gridList.getColumnMode(); this.BillSql = this.getCondition(); _this = this; this.PageSize = this.Pagenum.getValue(); this.storeBillList.pageSize = this.PageSize; this.sqlcontext = this.BillSql; this.storeBillList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql }, waitMsg: Zi.LAN.NowSelect,//正在查询数据 callback: function (r, options, success) { if (success) { if (r.length > 0) { this.gridBillList.getSelectionModel().select(0); } else { var bsno = '1'; var optype = '1'; var isAll = '0'; // isAll = this.comboxaddDCType.getValue(); if (this.BLAUDITISHESUANDAN == 1) { this.storeBLChFee.load({ params: { bsno: bsno, bltype: '', optype:'' } }); } else { _this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll } }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll } }); } _this.storeBodySum.load({ params: { bsno: bsno }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno, optype: optype} }); _this.storeChFeeAmendGain.load({ params: { bsno: bsno } }); _this.storeBLList.removeAll(); } } }, scope: this }); }, onDsQuery: function () { //var girdcolums = this.gridList.getColumnMode(); this.PageSize = this.Pagenum.getValue(); this.storeBillList.pageSize = this.PageSize; this.BillSql = this.sqlcontext; this.storeBillList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql }, waitMsg: Zi.LAN.NowSelect,//正在查询数据 callback: function (r, options, success) { if (success) { if (r.length > 0) { this.gridBillList.getSelectionModel().select(0); } else { var bsno = '1'; var optype = '1'; var isAll = '0'; // isAll = this.comboxaddDCType.getValue(); if (this.BLAUDITISHESUANDAN == 1) { this.storeBLChFee.load({ params: { bsno: bsno, bltype: '', optype:''} }); } else { _this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll } }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll } }); } _this.storeBodySum.load({ params: { bsno: bsno }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno, optype: optype} }); _this.storeChFeeAmendGain.load({ params: { bsno: bsno } }); _this.storeBLList.removeAll(); } } }, scope: this }); }, CheckChange: function (field, newValue, oldValue, eOpts) { this.onRefreshClick(); }, onSelAuditClick: function (menu, event) { var GidStr = ''; var records = this.AddGridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; rec.REMARK = ''; bodyAddDatas.push(rec); } if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LoaclYeWuNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { //提示', '确定删除该记录吗? var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Msg.wait(Zi.LAN.ZZShenHe); Ext.Ajax.request({ waitMsg: Zi.LAN.zzaiLoacal, url: '/Account/Chfee_Audit/SelAuditBL', params: { data: jsonbodyAddDatas, worktype: _this.worktype }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.hide(); // Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); // _this.onRefreshClick(); _this.storeBillList.reload(); //var bsno = '1'; //var optype = '1'; //var isAll = '0'; //if (this.BLAUDITISHESUANDAN == 1) { // _this.storeBLChFee.load({ params: { bsno: bsno, bltype: '', optype:''} }); //} else { // _this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll } }); // _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll } }); //} //_this.storeBodySum.load({ // params: { bsno: bsno }, // callback: function (r, options, success) { // if (success) { // _this.setTotalHead(); // } // } //}); //_this.storeChFeeGain.load({ params: { bsno: bsno } }); //_this.storeChFeeAmendGain.load({ params: { bsno: bsno } }); Ext.MessageBox.hide(); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onSelAuditBackClick: function (menu, event) { var GidStr = ''; var records = this.AddGridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; rec.REMARK = ''; bodyAddDatas.push(rec); } if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LoaclYeWuNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { //提示', '确定删除该记录吗? this.winAuditBackShow.show(); } }, onAuditBack:function() { var records = this.AddGridCheckBoxModel.selected.items; var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; rec.REMARK = ''; bodyAddDatas.push(rec); } var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Msg.wait(Zi.LAN.ZZShenHe); var reason = this.formAuditBack.getForm().findField('ORREASON').getValue(); var TZ = this.formAuditBack.getForm().findField('TZ').getValue(); Ext.Ajax.request({ waitMsg: Zi.LAN.zzaiLoacal, url: '/Account/Chfee_Audit/SelAuditBackBL', params: { data: jsonbodyAddDatas, worktype: _this.worktype, reason: reason, tz: TZ }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.hide(); this.winAuditBackShow.close(); // Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); // _this.onRefreshClick(); _this.storeBillList.reload(); if (this.BLAUDITISHESUANDAN == 1) { _this.storeBLChFee.reload(); } else { _this.storeDrChFee.reload(); _this.storeCrChFee.reload(); } Ext.MessageBox.hide(); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); }, onCancelAuditClick: function (menu, event) { var GidStr = ''; var records = this.AddGridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; rec.REMARK = ''; bodyAddDatas.push(rec); } if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LoaclYeWuNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { //提示', '确定删除该记录吗? this.winAuditBackShow.show(); } }, onSelViewClick: function (menu, event) { var GidStr = ''; var records = this.AddGridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bsno = records[0].data.BSNO; var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var openUrl = "../../Account/Chfee_payapplication/Map?bsno=" + bsno + "&name="; window.open(openUrl, openType, openSet); }, UpListStatus: function (bsno) { Ext.Ajax.request({ waitMsg: Zi.LAN.OnSelect, url: '/Account/Chfee_Audit/GetBLData', params: { handle: 'edit', condition: " BSNO='" + bsno + "'", isapp: false }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } var data = result.data; for (i = 0; i < this.storeBillList.getCount(); i += 1) { var memberyf = this.storeBillList.getAt(i); if (memberyf.data.BSNO == bsno) { memberyf.data.DRFEESTATUS = data.DRFEESTATUS; memberyf.data.CRFEESTATUS = data.CRFEESTATUS; memberyf.data.FEESTATUS = data.FEESTATUS; memberyf.data.FEESTATUSREF = data.FEESTATUSREF; memberyf.commit(); } }; } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); }, onViewWorkFlowDetailClick: function (button, event, type) { if (type == '1') { var records = this.feeDrGridCheckBoxModel.selected.items; } else if (type == '2') { var records = this.feeCrGridCheckBoxModel.selected.items; }; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectFY, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var record = records[0]; var feeStatus = record.data.FeeStatus; var Gid = record.data.GId; var WorkFlowName = "FeeOpOpOtherRecvPayAudit"; if ((this.strOPTYPE == '更改单') && (this.AMENDSELFWORKFLOW == 1)) { WorkFlowName = "AmendFeefyAudit"; } else { if (feeStatus == 3 || feeStatus == 4) { WorkFlowName = "FeeOpOtherModifyAudit"; if (this.stroplb == "op_seae") { WorkFlowName = "FeeModifyAudit"; } if (this.stroplb == "op_seai") { WorkFlowName = "FeeSeaiModifyAudit"; } if (this.stroplb == "op_aire") { WorkFlowName = "AireFeeModify"; } if (this.stroplb == "op_airi") { WorkFlowName = "AiriFeeModify"; } if (this.stroplb == "op_apply") { WorkFlowName = "ApplyFeeModify"; } if (this.stroplb == "op_bulk") { WorkFlowName = "BulkFeeModify"; } if (this.stroplb == "op_other" || this.stroplb == "tMsWlPcHead" || this.stroplb == "OpCtnBsCard") { WorkFlowName = "FeeOpOtherModifyAudit"; } if (this.stroplb == "op_railway") { WorkFlowName = "RailwayFeeModify"; } } else { if (this.stroplb == "op_seae") { WorkFlowName = "FeeRecvPayAudit"; } if (this.stroplb == "op_seai") { WorkFlowName = "FeeSeaiRecvPayAudit"; } if (this.stroplb == "op_aire") { WorkFlowName = "AireFeeAudit"; } if (this.stroplb == "op_airi") { WorkFlowName = "AiriFeeAudit"; } if (this.stroplb == "op_apply") { WorkFlowName = "ApplyFeeAudit"; } if (this.stroplb == "op_bulk") { WorkFlowName = "BulkFeeAudit"; } if (this.stroplb == "op_other" || this.stroplb == "tMsWlPcHead" || this.stroplb == "OpCtnBsCard") { WorkFlowName = "FeeOpOpOtherRecvPayAudit"; } if (this.stroplb == "op_railway") { WorkFlowName = "RailwayFeeAudit"; } } } var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var openUrl = "../../Account/Chfee_payapplication/Map?bsno=" + Gid + "&name=" + WorkFlowName; window.open(openUrl, openType, openSet); }, onViewDetailClick: function (button, event, type) { var openSet = "height=540, width=890, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 540) / 2 + ",Left= " + (screen.width - 890) / 2 var openType = "_blank"; //打开费用“历史信息查询”页面 // var openUrl = "../../Shipping/FeeHistory.aspx?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type; var openUrl = "../../MvcShipping/MsOpBill/MsFeeHistoryView?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type; window.open(openUrl, openType, openSet); }, getAllowOperationDetail: function () { var feeStatus = 0; if (feeStatus == '0' || feeStatus == false || feeStatus == 'false') return true; else {//"此票委托已费用已锁定,不允许操作费用!" Ext.Msg.show({ title: Zi.LAN.E, msg: Zi.LAN.FeiYongYisD, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return false; } }, //#endregion getFeeStatus: function () { var feeStatus = this.EditRecord.get('FEESTATUS'); return feeStatus; }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); }, //onClearClick getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; var feestr = this.getFeeCondition(); if (feestr != '') feestr = " and " + feestr; /* var sqldata = form.getValues(); sql = Ext.JSON.encode(sqldata); */ // var StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0) "; var StrAudit = " (OPTYPE='更改单' or (OPTYPE='普通货' and BSNO=MASTERNO)) AND EXISTS (select 1 from workflow_using wu left join workflow_step st on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) " StrAudit = StrAudit + " where wu.bsno=v_op_bill.BSNO " StrAudit = StrAudit + " and wu.TYPENO=602 " StrAudit = StrAudit + " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + userid + "' " StrAudit = StrAudit + " ) "; if (this.DataLoading) { return StrAudit } var mblNo = form.findField('PS_MBLNO').getValue(); // sql = sql + getAndConSql(sql, mblNo, "(MblNo like '%" + mblNo + "%' or hblNo like '%" + mblNo + "%' OR CUSTNO like '%" + mblNo + "%' OR CUSTOMNO like '%" + mblNo + "%' OR ORDERNO like '%" + mblNo + "%')"); sql = sql + getAndConSql(sql, mblNo, " (CUSTNO+' '+MBLNO+' '+HBLNO+' '+CUSTOMNO+' '+ORDERNO like '%" + mblNo + "%')"); var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue(); sql = sql + getAndConSql(sql, expDate_Min, " OPDATE>='" + expDate_Min + "'"); var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue(); sql = sql + getAndConSql(sql, expDate_Max, " OPDATE<='" + expDate_Max + " 23:59:59'"); var accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue(); sql = sql + getAndConSql(sql, accDate_Min, " ACCDATE>='" + accDate_Min + "'"); var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue(); sql = sql + getAndConSql(sql, accDate_Max, " ACCDATE<='" + accDate_Max + "'"); var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue(); sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'"); var AGENT = form.findField('PS_AGENT').getValue(); sql = sql + getAndConSql(sql, AGENT, "AGENTID='" + AGENT + "'"); var SALE = form.findField('PS_SALE').getValue(); sql = sql + getAndConSql(sql, SALE, "SALE='" + SALE + "'"); var OP = form.findField('PS_OP').getValue(); sql = sql + getAndConSql(sql, OP, "OP='" + OP + "'"); var BSTYPE = form.findField('PS_BSTYPE').getValue(); sql = sql + getAndConSql(sql, BSTYPE, "BSTYPE='" + BSTYPE + "'"); var OPLB = form.findField('PS_OPLB').getValue(); sql = sql + getAndConSql(sql, OPLB, "OPLBNAME='" + OPLB + "'"); var VESSEL = form.findField('PS_VESSEL').getValue(); sql = sql + getAndConSql(sql, VESSEL, "VESSEL like '%" + VESSEL + "%'"); var VOYNO = form.findField('PS_VOYNO').getValue(); sql = sql + getAndConSql(sql, VOYNO, "VOYNO like '%" + VOYNO + "%'"); var BSSOURCE = form.findField('BSSOURCE').getValue(); sql = sql + getAndConSql(sql, BSSOURCE, "BSSOURCE='" + BSSOURCE + "'"); var BillFeeStatus = form.findField('BillFeeStatus').getValue(); sql = sql + getAndConSql(sql, BillFeeStatus, "BillFeeStatus='" + BillFeeStatus + "'"); //var ISFEEUP = form.findField('ISFEEUP').getValue(); //if (ISFEEUP == '0') { // sql = sql + getAndConSql(sql, ISFEEUP, " NOT EXISTS (select 1 from OP_STATUS WHERE v_op_bill.BSNO=OP_STATUS.BSNO AND OP_STATUS.STTYPE='2') "); //} else if (ISFEEUP == '1') { // sql = sql + getAndConSql(sql, ISFEEUP, " EXISTS (select 1 from OP_STATUS WHERE v_op_bill.BSNO=OP_STATUS.BSNO AND OP_STATUS.STTYPE='2') "); //} if (this.CheckAll.checked) { sql = sql + getAndConSql(sql, StrAudit, StrAudit); } else { var feestr = this.getFeeCondition(); if (feestr != '') sql = sql + getAndConSql(sql, feestr, " EXISTS (select 1 from ch_fee WHERE v_op_bill.BSNO=ch_fee.BSNO AND " + feestr + ") "); }; return sql; }, getFeeCondition: function () { var form = this.formSearch.getForm(); var feesql = ''; var CUSTNAME = form.findField('CUSTNAME').getValue(); feesql = feesql + getAndConSql(feesql, CUSTNAME, "ch_fee.CUSTOMERNAME='" + CUSTNAME + "'"); var FeeName = form.findField('FeeName').getValue(); feesql = feesql + getAndConSql(feesql, FeeName, "ch_fee.FEENAME='" + FeeName + "'"); return feesql; }, PrintSelect: function (rptmode) { var selections = this.gridBillList.getSelectionModel().getSelection(); if (selections.length == 0) { //Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var record = selections[0]; var BSNO = record.data.BSNO; var printType = 'MSCHFEAUDITSEL'; var sql1 = "SELECT * FROM V_OP_BILL WHERE BSNO='" + BSNO + "'"; var sql2 = "SELECT F.*,dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno) as IsAudit FROM CH_FEE F left join workflow_using wu on wu.bsno=F.GID "; sql2 = sql2 + " where F.bsno='" + BSNO + "' and F.FeeType=1 and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0 "; var sql3 = "SELECT F.*,dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno) as IsAudit FROM CH_FEE F left join workflow_using wu on wu.bsno=F.GID "; sql3 = sql3 + " where F.bsno='" + BSNO + "' and F.FeeType=2 and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0 "; var sql4 = ""; var sql5 = ""; var sql6 = ""; if (rptmode == 1) { PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, '', 'MSCHFEAUDITSEL', 1); } else PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } });