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: '', feesqlcontext: '', isAmend: '0', initUIComponents: function () { this.worksql = getUrlParam('worksql'); Ext.Ajax.timeout = 120000; this.formname = 'FormMsChfeeAudit'; this.strMBSNO = ''; this.isAmend = '0'; this.AMENDSELFWORKFLOW = 0; this.AUDITNOBACK = 0; this.strOPTYPE = '普通货'; //普通货 this.onlyfeedr = 0; this.onlyfeecr = 0; this.worktype = ''; this.isbslock = '0' //明细表-数据集 this.storeDrChFee = Ext.create('Ext.data.Store', { model: 'MsChFee', remoteSort: false, proxy: { type: 'ajax', timeout: 120000, 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', timeout: 120000, 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', timeout: 120000, 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.storeDrChFee.on('beforeload', function (store) { store.removeAll(); }, this); this.storeCrChFee.on('beforeload', function (store) { store.removeAll(); }, this); 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.CheckFeeAll = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.ChargeDetailsAuditBusiness, //费用明细仅显示待审核 labelWidth: 130, checked: true, width: 150 }); 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, renderer: function (value, meta) { if (value == '委托单位') { return Zi.LAN.WEITUODANWEI; } else if (value == '船公司') { return Zi.LAN.CHUANGONGSI; } else if (value == '订舱代理') { return Zi.LAN.DINGCANGDAILI; } else if (value == '报关行') { return Zi.LAN.BAOGUANHANG; } else if (value == '车队') { return Zi.LAN.CHEDUI; } else if (value == '发货人') { return Zi.LAN.FAHUOREN; } else if (value == '收货人') { return Zi.LAN.SHOUHUOREN; } else if (value == '通知人') { return Zi.LAN.TONGZHIREN; } else if (value == '代理') { return Zi.LAN.DAILI; } else if (value == '场站') { return Zi.LAN.CHANGZHAN; } else if (value == '船代') { return Zi.LAN.CHUANDAI; } else if (value == '保险公司') { return Zi.LAN.BAOXIANGONGS; } else if (value == '其他') { return Zi.LAN.QITA; } else if (value == '仓库') { return Zi.LAN.CANGKU; } else { return value; } } }, { sortable: true, dataIndex: 'CustomerName', header: Zi.LAN.SettlementObject, //结算对象 width: 120 }, { sortable: true, dataIndex: 'CustomerFullName', header: Zi.LAN.CUSTFULLNAME, //'结算对象', width: 160 }, { sortable: true, dataIndex: 'Unit', header: Zi.LAN.UnitStandard, //单位标准 width: 60 }, { sortable: true, dataIndex: 'UnitPrice', header: Zi.LAN.price, //单价 align: 'right', width: 80 }, { sortable: true, dataIndex: 'TaxUnitPrice', header: Zi.LAN.TaxPrice, //含税单价 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: 'Tax', header: Zi.LAN.Tax, //税率 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, //不含税金额 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: '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.OutTaxRate, //进项税率 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: 'AccTax', header: Zi.LAN.OutTax, //进项税率 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: 'AccAmount', header: Zi.LAN.OutAmount, //进项税率 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: 'DebitNo', header: Zi.LAN.DebitNo, //佣金比率 width: 60 }, { 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: 'SUBMITOPREF', header: Zi.LAN.SUBMITOPREF, //审核人 width: 60 }, { sortable: true, dataIndex: 'SubmitDate', header: Zi.LAN.SubmitDate, //审核日期 //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: '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: 'InvoiceNum', header: Zi.LAN.InvoiceNumber, //发票号码 width: 80 }, { sortable: true, dataIndex: 'SALECORP', header: Zi.LAN.SALECORP, //发票号码 width: 80 }, { sortable: true, dataIndex: 'Reason', header: Zi.LAN.Reason, //发票号码 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 }, { sortable: true, dataIndex: 'INPUTMODE', header: Zi.LAN.INPUTMODE, //'录入方式', width: 150 } ]; 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.ExaminationPassed, //审核通过 tooltip: '审核通过', iconCls: "btnsubmit", handler: function (button, event) { this.onAuditNewClick(button, event, 1); }, scope: this }, { text: Zi.LAN.AuditCopy, tooltip: '配对审核,同时审核标红的应付或应收', handler: function (button, event) { _this.onCopyAuditClick('1'); }, scope: this }, { text: Zi.LAN.DismissedSubmission, //驳回提交 tooltip: '驳回提交', iconCls: "btncancel", handler: function (button, event) { this.onAuditBackNewClick(button, event, 1); }, scope: this }, { text: Zi.LAN.DismissedSubmission2, tooltip: '禁开发票', handler: function (button, event) { this.onNoIvoiceClick(button, event, 1); }, scope: this }, { text: Zi.LAN.UnlockInvoice, tooltip: '解禁发票', handler: function (button, event) { this.onCancelNoInvoiceClick(button, event, 1); }, scope: this }, { text: Zi.LAN.ApproveApplication, tooltip: '批准申请', iconCls: "btnsubmit", handler: function (button, event) { this.onAuditShenClick(button, event, 1); }, scope: this }, { text: Zi.LAN.DismissApplication, tooltip: '驳回申请', iconCls: "btncancel", handler: function (button, event) { this.onAuditBackShenClick(button, event, 1); }, scope: this }, { text: Zi.LAN.HistoricalApplication, tooltip: '历史申请', handler: function (button, event) { this.onHistryShenClick(button, event, 1); }, scope: this }, '-', { text: Zi.LAN.ViewInformation, tooltip: '查看信息', handler: function (button, event) { this.onViewDetailClick(button, event, 1); }, scope: this }, '-', { text: Zi.LAN.ShowWorkflow, tooltip: '显示工作流', handler: function (button, event) { this.onViewWorkFlowDetailClick(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.AuditBill, tooltip: '本票审核', handler: function (button, event) { _this.onSelAuditClick(button, event); }, 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, renderer: function (value, meta) { if (value == '委托单位') { return Zi.LAN.WEITUODANWEI; } else if (value == '船公司') { return Zi.LAN.CHUANGONGSI; } else if (value == '订舱代理') { return Zi.LAN.DINGCANGDAILI; } else if (value == '报关行') { return Zi.LAN.BAOGUANHANG; } else if (value == '车队') { return Zi.LAN.CHEDUI; } else if (value == '发货人') { return Zi.LAN.FAHUOREN; } else if (value == '收货人') { return Zi.LAN.SHOUHUOREN; } else if (value == '通知人') { return Zi.LAN.TONGZHIREN; } else if (value == '代理') { return Zi.LAN.DAILI; } else if (value == '场站') { return Zi.LAN.CHANGZHAN; } else if (value == '船代') { return Zi.LAN.CHUANDAI; } else if (value == '保险公司') { return Zi.LAN.BAOXIANGONGS; } else if (value == '其他') { return Zi.LAN.QITA; } else if (value == '仓库') { return Zi.LAN.CANGKU; } else { return value; } } }, { sortable: true, dataIndex: 'CustomerName', header: Zi.LAN.SettlementObject, //结算对象 width: 120 }, { sortable: true, dataIndex: 'CustomerFullName', header: Zi.LAN.CUSTFULLNAME, //'结算对象', width: 160 }, { sortable: true, dataIndex: 'Unit', header: Zi.LAN.UnitStandard, //单位标准 width: 60 }, { sortable: true, dataIndex: 'UnitPrice', header: Zi.LAN.price, //单价 align: 'right', width: 80 }, { sortable: true, dataIndex: 'TaxUnitPrice', header: Zi.LAN.TaxPrice, //含税单价 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: 'Tax', header: Zi.LAN.Tax, //税率 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: 'AccTax', header: Zi.LAN.InputTax, 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: 'AccAmount', header: Zi.LAN.InputAmount, 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: 'DebitNo', header: Zi.LAN.DebitNo, //佣金比率 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: 'SUBMITOPREF', header: Zi.LAN.SUBMITOPREF, //审核人 width: 60 }, { sortable: true, dataIndex: 'SubmitDate', header: Zi.LAN.SubmitDate, //审核日期 //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: 'SALECORP', header: Zi.LAN.SALECORP, //发票号码 width: 80 }, { sortable: true, dataIndex: 'Reason', header: Zi.LAN.Reason, //原因 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 }, { sortable: true, dataIndex: 'INPUTMODE', header: Zi.LAN.INPUTMODE, //'录入方式', width: 150 } ]; 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.ExaminationPassed, //审核通过 tooltip: '审核通过', iconCls: "btnsubmit", handler: function (button, event) { this.onAuditNewClick(button, event, 2); }, scope: this }, { text: Zi.LAN.AuditCopy, tooltip: '配对审核,同时审核标红的应付或应收', handler: function (button, event) { _this.onCopyAuditClick('2'); }, scope: this }, { text: Zi.LAN.DismissedSubmission, //驳回提交 tooltip: '驳回提交', iconCls: "btncancel", handler: function (button, event) { this.onAuditBackNewClick(button, event, 2); }, scope: this }, { text: Zi.LAN.DismissedSubmission2, tooltip: '禁开发票', handler: function (button, event) { this.onNoIvoiceClick(button, event, 2); }, scope: this }, { text: Zi.LAN.UnlockInvoice, tooltip: '解禁发票', handler: function (button, event) { this.onCancelNoInvoiceClick(button, event, 2); }, scope: this }, { text: Zi.LAN.ApproveApplication, tooltip: '批准申请', iconCls: "btnsubmit", handler: function (button, event) { this.onAuditShenClick(button, event, 2); }, scope: this }, { text: Zi.LAN.DismissApplication, tooltip: '驳回申请', iconCls: "btncancel", handler: function (button, event) { this.onAuditBackShenClick(button, event, 2); }, scope: this }, { text: Zi.LAN.HistoricalApplication, tooltip: '历史申请', handler: function (button, event) { this.onHistryShenClick(button, event, 2); }, scope: this }, '-', { 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.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, renderer: function (value, cellmeta) { if (value == '合计') { return Zi.LAN.HEJI; } else if (value == '其他币别') { return Zi.LAN.OTCURR; } else { return value; } } }, { 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.PayTaxIncluded, //应付含税 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, renderer: function (value, cellmeta) { if (value == '合计') { return Zi.LAN.HEJI ; } else { return value; } } }, { 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.panelCustSum = new Ext.Panel({ title: Zi.LAN.TotalProfitSTR, //客户合计 layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.gridListCust] }); this.panelCurrSum = new Ext.Panel({ title: Zi.LAN.BiBieSum, layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.gridSum] }); //#region 主票费用合计 this.initMasterSumColumn = [{ sortable: true, dataIndex: 'CUSTOMERNAME', header: Zi.LAN.FENDANHAO, //'结算对象', // summaryRenderer: function () { // return '合计' // }, width: 110 }, { sortable: true, dataIndex: 'RMBDR', header: 'RMB' + 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', // summaryType: 'sum', // summaryRenderer: Ext.util.Format.numberRenderer('00.00'), width: 80 }, { sortable: true, dataIndex: 'RMBCR', header: 'RMB' + 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; }, // summaryType: 'sum', // summaryRenderer: Ext.util.Format.numberRenderer('00.00'), align: 'right', width: 80 }, { sortable: true, dataIndex: 'RMBPROFIT', header: 'RMB' + Zi.LAN.profit, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { if (value == "***") return value; try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, // summaryType: 'sum', // summaryRenderer: Ext.util.Format.numberRenderer('00.00'), align: 'right', width: 80 }, { sortable: true, dataIndex: 'USDDR', header: 'USD' + Zi.LAN.Receivable, //'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; }, // summaryType: 'sum', // summaryRenderer: Ext.util.Format.numberRenderer('00.00'), align: 'right', width: 80 }, { sortable: true, dataIndex: 'USDCR', header: 'USD' + Zi.LAN.Handle, //'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; }, // summaryType: 'sum', // summaryRenderer: Ext.util.Format.numberRenderer('00.00'), align: 'right', width: 80 }, { sortable: true, dataIndex: 'USDPROFIT', header: 'USD' + Zi.LAN.profit, //'USD利润', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { if (value == "***") return value; try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, // summaryType: 'sum', // summaryRenderer: Ext.util.Format.numberRenderer('00.00'), 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; }, // summaryType: 'sum', // summaryRenderer: Ext.util.Format.numberRenderer('00.00'), 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) { if (value == "***") return value; 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.MasterSumColumn = this.initMasterSumColumn; //定义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, columns: this.MasterSumColumn, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeChFeeMasterGain, displayInfo: true, displayMsg: Zi.LAN.FenYe , //'当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "" //"没有数据" }) }); this.panelCustMaster = new Ext.Panel({ title: Zi.LAN.ZHUPIAOFEIYONGHEJI, //'客户合计', layout: "border", region: 'center', animate: true, autoScroll: true, id:'panelCustMaster', //containerScroll: true, frame: false, items: [this.gridListMaster] }); //#endregion 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, renderer: function (value, cellmeta) { if (value == '合计') { return Zi.LAN.HEJI; } else if (value == '其他币别') { return Zi.LAN.OTCURR; } else { value = value.replace("普通货", Zi.LAN.PUTONGHUO); value = value.replace("更改单", Zi.LAN.GENGGAIDAN); return value; } } }, { 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',//RMB利润 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.panelCustMaster ] }); this.storeBillList = 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' } } }); //明细表表格 this.InitDrGrid(this.girdDrcolums); this.InitCrGrid(this.girdCrcolums); 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.storeProfitType = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storeProfitType.add({ "DC": "", "NAME": Zi.LAN.HAVETAX }); this.storeProfitType.add({ "DC": "NOTAX", "NAME": Zi.LAN.NOTAX}); this.comboxProfitType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.PROFITTYPE, store: this.storeProfitType, valueField: 'DC', displayField: 'NAME', labelWidth: 90, width: 160, forceSelection: true, id:'PROFITTYPE', name: 'PROFITTYPE', value: '', enableKeyEvents: true, listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { _this.setTotalHead(); } } } }); this.AddGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); this.initgirdcolums = [{ sortable: true, dataIndex: 'BSNO', header: 'BSNO', hidden: true, width: 100 }, { sortable: true, dataIndex: 'OPLBNAME', header: Zi.LAN.ServiceCategory, //业务类别 width: 80, renderer: function (value, cellmeta) { if (value == '海运出口') { return Zi.LAN.HYCK; } else if (value == '海运进口') { return Zi.LAN.HYJK; } else { return value; } } }, { sortable: true, dataIndex: 'OPTYPE', header: Zi.LAN.ChangeSingle, //更改单 width: 80, renderer: function (value, meta) { if (value == '普通货') return Zi.LAN.PUTONGHUO; //是 else return Zi.LAN.GENGGAIDAN; } }, { 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'; value = Zi.LAN.SHENHETONGGUO; } else if (value == '录入状态') { value = Zi.LAN.LURUZHUAGNTAI; } else if (value == '提交审核') { meta.tdCls = 'feestatus_refer'; value = Zi.LAN.TIJIAOSHENHE; } else if (value == '部分结算') { meta.tdCls = 'feestatus_settlepart'; value = Zi.LAN.BUFENJIESUAN; } else if (value == '结算完毕') { meta.tdCls = 'feestatus_settle'; value = Zi.LAN.JIESUANWANBI; } else if (value == '未录入') { value = Zi.LAN.WEILURU; } else if (value == '部分审核') { meta.tdCls = 'feestatus_refer'; value = Zi.LAN.BUFENSHENHE; } else if (value == '部分提交') { meta.tdCls = 'feestatus_refer'; value = Zi.LAN.BUFENTIJIAO; } else if (value == '驳回提交') { meta.tdCls = 'feestatus_nopass'; value = Zi.LAN.BOHUITIJIAO; } else if (value == '部分录入') { value = Zi.LAN.BUFENLURU; } else if (value == '申请修改') { value = Zi.LAN.SHENMODIFY; } else if (value == '申请删除') { value = Zi.LAN.SHENDEL; } 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'; value = Zi.LAN.SHENHETONGGUO; } else if (value == '录入状态') { value = Zi.LAN.LURUZHUAGNTAI; } else if (value == '提交审核') { meta.tdCls = 'feestatus_refer'; value = Zi.LAN.TIJIAOSHENHE; } else if (value == '部分结算') { meta.tdCls = 'feestatus_settlepart'; value = Zi.LAN.BUFENJIESUAN; } else if (value == '结算完毕') { meta.tdCls = 'feestatus_settle'; value = Zi.LAN.JIESUANWANBI; } else if (value == '未录入') { value = Zi.LAN.WEILURU; } else if (value == '部分审核') { meta.tdCls = 'feestatus_refer'; value = Zi.LAN.BUFENSHENHE; } else if (value == '部分提交') { meta.tdCls = 'feestatus_refer'; value = Zi.LAN.BUFENTIJIAO; } else if (value == '驳回提交') { meta.tdCls = 'feestatus_nopass'; value = Zi.LAN.BOHUITIJIAO; } else if (value == '部分录入') { value = Zi.LAN.BUFENLURU; } else if (value == '申请修改') { value = Zi.LAN.SHENMODIFY; } else if (value == '申请删除') { value = Zi.LAN.SHENDEL; } return value; } }, { sortable: true, dataIndex: 'OPSTATUS', header: Zi.LAN.OPSTATUS, //费用状态 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: 'CUSTSERVICE', header: Zi.LAN.CUSTSERVICE, //揽货人 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: 'REMARK', header: Zi.LAN.Remarks, //备注 width: 80 }, { sortable: true, dataIndex: 'REMARK2', header: Zi.LAN.Remarks2, //备注 width: 80 }, { sortable: true, dataIndex: 'TRADETERM', header: Zi.LAN.TRADETERM, width: 80 }, { sortable: true, dataIndex: 'REASON', header: Zi.LAN.REASON, width: 80 }, { sortable: true, dataIndex: 'OP', header: Zi.LAN.Operating, //操作 width: 80 }, { sortable: true, dataIndex: 'DOC', header: Zi.LAN.DOC, //操作 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: 'PLACERECEIPT', header: Zi.LAN.PLACERECEIPT, //收货地 width: 120 }, { sortable: true, dataIndex: 'DESTINATION', header: Zi.LAN.DESTINATION, //目的地 width: 120 }, { sortable: true, dataIndex: 'PORTDISCHARGE', header: Zi.LAN.PORTDISCHARGE, //卸货港 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: '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: 'INVNO', header: Zi.LAN.INVNO, //报关单号 width: 120 }, { sortable: true, dataIndex: 'ORDERNO', header: Zi.LAN.ORDERNO, //报关单号 width: 120 }, { sortable: true, dataIndex: 'COMMISSIONRATE', header: Zi.LAN.COMMISSIONRATE, //报关单号 width: 120 }, { sortable: true, dataIndex: 'GOODSNAME', header: Zi.LAN.GOODSNAME, //报关单号 width: 120 }, { sortable: true, dataIndex: 'BLFRT', header: Zi.LAN.BLFRT, //报关单号 width: 120 }, { sortable: true, dataIndex: 'CARRIER', header: Zi.LAN.CARRIER, //报关单号 width: 120 }, { sortable: true, dataIndex: 'YARD', header: Zi.LAN.YARD, //报关单号 width: 120 }, { sortable: true, dataIndex: 'FORWARDER', header: Zi.LAN.FORWARDER, //报关单号 width: 120 }, { sortable: true, dataIndex: 'ISSUETYPE', header: Zi.LAN.ISSUETYPE, //报关单号 width: 120 }, { sortable: true, dataIndex: 'CONTRACTNO', header: Zi.LAN.CONTRACTNO, //报关单号 width: 120 }, { sortable: true, dataIndex: 'SERVICE', header: Zi.LAN.SERVICE, //报关单号 width: 120 }, { sortable: true, id: '', dataIndex: 'BillFeeStatus', header: Zi.LAN.BillFeeStatus, //'整票状态', width: 60, renderer: function (value, meta) { if (value == '0') { return Zi.LAN.WEITIJIAO; } else if (value == '1') { meta.tdCls = 'feestatus_refer'; return Zi.LAN.ZHENGPIAOTIJIAO; } else if (value == '2') { meta.tdCls = 'feestatus_pass'; return Zi.LAN.SHENHETONGGUO; } else if (value == '4') { meta.tdCls = 'feestatus_nopass'; return Zi.LAN.ZHENGPIAOBOHUI; } else { return ""; } } }, { sortable: true, dataIndex: 'SALEDEPT', header: Zi.LAN.SALEDEPT, //报关单号 width: 120 }, { sortable: true, dataIndex: 'SALECORP', header: Zi.LAN.BLSALECORP, //报关单号 width: 120 }, { sortable: true, dataIndex: 'BLTYPE', header: Zi.LAN.BLTYPE, //报关单号 width: 120, renderer: function (value, cellmeta) { if (value == '整箱') { return Zi.LAN.ZHENGXIANG; } else if (value == '拼箱单票') { return Zi.LAN.PINXIANGDANPIAO; } else if (value == '拼箱分票') { return Zi.LAN.PINXIANGFENPIAO; } else if (value == '拼箱主票') { return Zi.LAN.PINXIANGZHUPIAO; } else if (value == '合票主票') { return Zi.LAN.HEPIAOZHUPIAO; } else if (value == '合票分票') { return Zi.LAN.HEPIAOFENPIAO; } } }, { sortable: true, dataIndex: 'CARGOID', header: Zi.LAN.CARGOID, //报关单号 width: 120 }, { sortable: true, dataIndex: 'DCLASS', header: Zi.LAN.DCLASS, //报关单号 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: { enableTextSelection: true }, 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.comboxProfitType] }); 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); //#region formSearch //#region formSearch枚举参照相关 var BLTYPEDFIELDNAME = 'EnumValueName'; if (strLANGUAGES == "en-us") { BLTYPEDFIELDNAME = 'EnumValueName_2'; } 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: BLTYPEDFIELDNAME, 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: BLTYPEDFIELDNAME, 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.Caozuo, 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/GetCustomRefListRm' } }); //this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.Requester, //委托单位 store: this.storeCustCode, // forceSelection: true, queryMode: 'remote', minChars: 1, queryParam: 'CODENAME', name: 'PS_CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storePrType = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storePrType.add({ "DC": "", "NAME": Zi.LAN.WU}); this.storePrType.add({ "DC": "1", "NAME": Zi.LAN.SHENMODIFY }); this.storePrType.add({ "DC": "2", "NAME": Zi.LAN.ChangeSingle}); this.comboxPrType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.PROFITRED, store: this.storePrType, valueField: 'DC', displayField: 'NAME', forceSelection: true, name: 'PRTYPE' }); 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.storeFeeNameRef.load({ params: { condition: ""} }); this.storeFeeType = Ext.create('DsExt.ux.RefEnumStore', {}); this.storeFeeType.load({ params: { enumTypeId: 96009} }); this.comboxFeeType = Ext.create('DsExt.ux.RefEnumCombox', { fieldLabel: Zi.LAN.FeiYongFanwei, //费用范围 store: this.storeFeeType, forceSelection: true, name: 'FEERANGE' }); this.storeCust = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' } }); // this.storeCust.load({ params: { condition: ""} }); this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SettlementCustomers, //结算客户 store: this.storeCust, // forceSelection: true, queryMode: 'remote', minChars: 1, queryParam: 'CODENAME', 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": Zi.LAN.NO }); this.storeFEEUP.add({ "FSTATUS": "1", "NAME": Zi.LAN.YES}); 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(); } } } }); //#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.onRefreshClick(button, event); var isvisible = true; var issavevalue = false; if (_this.SearchBtn.text == Zi.LAN.HideQuery) isvisible = true else isvisible = false; 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.comboxFEEUP, this.comboxPrType, { 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.storeWorkType = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storeWorkType.add({ "DC": "", "NAME": Zi.LAN.WorkflowAll }); this.storeWorkType.add({ "DC": "SALEORDER", "NAME": Zi.LAN.SaleOrder }); this.storeWorkType.add({ "DC": "FEEAUDIT", "NAME": Zi.LAN.BillSubmit }); this.storeWorkType.add({ "DC": "BLAUDIT", "NAME": Zi.LAN.BsSubmit}); this.comboxWorkType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.Workflow, store: this.storeWorkType, valueField: 'DC', displayField: 'NAME', labelWidth: 50, width:160, forceSelection: true, name: 'WORKTYPE', value: '', enableKeyEvents: true, listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { _this.LoadData(this.opStatus, "", this.RefBillNo); } } } }); this.panelBtn = new Ext.Panel({ region: "north", tbar: [ this.SearchBtn, '-', { xtype: 'button', text: Zi.LAN.ReLoad, //刷新 iconCls: "btnrefresh", handler: function (button, event) { _this.LoadData(this.opStatus, "", this.RefBillNo); // this.onRefreshClick(button, event); // var isvisible = true; // var issavevalue = false; // if (_this.SearchBtn.text == Zi.LAN.HideQuery) // isvisible = true // else // isvisible = false; // if (this.CheckSaveQuery.checked) // issavevalue = true // saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue); }, scope: this }, '-', { text: Zi.LAN.BatchReview, //批量审核 id: "btnBsLock", menu: [ { text: Zi.LAN.SelectedBusinessReview, //所选业务审核 handler: function (menu, event) { _this.onSelAuditClick('0'); } }, { text: Zi.LAN.AllBusinessReview, //全部业务审核 handler: function (menu, event) { _this.onAllAuditClick('0'); } }, { text: Zi.LAN.SelectedBusinessFeeReview, //所选业务审核 handler: function (menu, event) { _this.onSelAuditClick('1'); } }, { text: Zi.LAN.AllBusinessFeeReview, //全部业务审核 handler: function (menu, event) { _this.onAllAuditClick('1'); } }], scope: this }, '-', { text: Zi.LAN.Costlock, //费用锁定 id:Zi.LAN.Costlock, menu: [ { text: Zi.LAN.SelectedBusinesslock, //所选业务锁定 handler: function (menu, event) { _this.winFeeCloseShow.show(); } }, { text: Zi.LAN.SelectedBusinessUnlock, //所选业务解锁 handler: function (menu, event) { _this.onSelUnLockClick(menu, event, 1); } } ], scope: this } , '-', this.CheckAll, '-', this.CheckFeeAll, '-', 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 }, '-', this.comboxWorkType, '-', { 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 } ] }); //#region 申请修改 this.NewFeeShowDr = Ext.widget('form', { frame: true, region: 'east', hidden: true, title: Zi.LAN.FYUpdate, width: 470, trackResetOnLoad: true, autoScroll: true, bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 55, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '业务编号', name: 'BsNo', hidden: true }, { fieldLabel: 'GId', name: 'GId', flex: 0, hidden: true, margins: '0' }, { fieldLabel: Zi.LAN.CostName, //费用名称 readOnly: true, name: 'FeeName' }, { fieldLabel: Zi.LAN.Fyduixiang, readOnly: true, name: 'CustomerName' }, { fieldLabel: Zi.LAN.danweibiaozhun, readOnly: true, name: 'Unit' }, { fieldLabel: Zi.LAN.CustomerCategory, //'单位标准', readOnly: true, name: 'CustomerType' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.NotShuijia, readOnly: true, name: 'UnitPrice', 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; } }, { fieldLabel: Zi.LAN.taxRate, //税率 readOnly: true, name: 'TaxRate' }, { fieldLabel: Zi.LAN.TaxPrice, //含税单价 readOnly: true, name: 'TaxUnitPrice', 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; } } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.jiFeishuliang, readOnly: true, name: 'Quantity' }, { fieldLabel: Zi.LAN.buhanshuie, readOnly: true, name: 'NoTaxAmount', 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; } }, { fieldLabel: Zi.LAN.hsjine, readOnly: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, name: 'Amount' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.Currency, //币别 labelWidth: 40, readOnly: true, name: 'Currency' }, { fieldLabel: Zi.LAN.exchangeRate, //汇率 labelWidth: 40, readOnly: true, name: 'ExChangerate' }, { fieldLabel: Zi.LAN.caiwushui, labelWidth: 60, readOnly: true, name: 'AccTaxRate' }, { fieldLabel: Zi.LAN.WhetherToAdvance, //是否垫付 labelWidth: 60, readOnly: true, name: 'IsAdvancedpay' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.Updateyuanyin, flex: 2, readOnly: true, name: 'Reason' }, { fieldLabel: Zi.LAN.zeperson, //'费用对象', flex: 1, readOnly: true, name: 'MANAGERREF' }, { fieldLabel: Zi.LAN.SALECORP, //'费用对象', flex: 1, readOnly: true, name: 'SALECORP' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.Remarks, //备注 flex: 2, labelWidth: 40, readOnly: true, name: 'Remark' }, { fieldLabel: Zi.LAN.sqperson, readOnly: true, labelWidth: 50, name: 'MODIFIEDUSER' }, { fieldLabel: Zi.LAN.sqtime, readOnly: true, name: 'MODIFIEDTIME' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.ChangeProBefore, labelWidth: 70, readOnly: true, name: 'BPROFIT', 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; } }, { fieldLabel: Zi.LAN.ChangeProfit, //更改后利润 labelWidth: 70, readOnly: true, name: 'APROFIT', 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; } }, { fieldLabel: Zi.LAN.ProfitMargin, //利润差额 labelWidth: 70, readOnly: true, name: 'DIFPROFIT', 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; } } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); this.NewFeeShowCr = Ext.widget('form', { frame: true, region: 'east', hidden: true, title: Zi.LAN.FYUpdate, width: 470, autoScroll: true, trackResetOnLoad: true, bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 55, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '业务编号', name: 'BsNo', hidden: true }, { fieldLabel: 'GId', name: 'GId', flex: 0, hidden: true, margins: '0' }, { fieldLabel: Zi.LAN.CostName, //费用名称 readOnly: true, name: 'FeeName' }, { fieldLabel: Zi.LAN.Fyduixiang, readOnly: true, name: 'CustomerName' }, { fieldLabel: Zi.LAN.danweibiaozhun, readOnly: true, name: 'Unit' }, { fieldLabel: Zi.LAN.CustomerCategory, //'单位标准', readOnly: true, name: 'CustomerType' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.NotShuijia, readOnly: true, name: 'UnitPrice' }, { fieldLabel: Zi.LAN.taxRate, //税率 readOnly: true, name: 'TaxRate' }, { fieldLabel: Zi.LAN.TaxPrice, //含税单价 readOnly: true, name: 'TaxUnitPrice' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.jiFeishuliang, readOnly: true, name: 'Quantity' }, { fieldLabel: Zi.LAN.buhanshuie, readOnly: true, name: 'NoTaxAmount' }, { fieldLabel: Zi.LAN.hsjine, readOnly: true, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, name: 'Amount' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.Currency, //币别 labelWidth: 40, readOnly: true, name: 'Currency' }, { fieldLabel: Zi.LAN.exchangeRate, //汇率 labelWidth: 40, readOnly: true, name: 'ExChangerate' }, { fieldLabel: Zi.LAN.caiwushui, labelWidth: 60, readOnly: true, name: 'AccTaxRate' }, { fieldLabel: Zi.LAN.WhetherToAdvance, //是否垫付 labelWidth: 60, readOnly: true, name: 'IsAdvancedpay' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.Updateyuanyin, flex: 1, readOnly: true, name: 'Reason' }, { fieldLabel: Zi.LAN.zeperson, //'费用对象', flex: 1, readOnly: true, name: 'MANAGERREF' }, { fieldLabel: Zi.LAN.SALECORP, //'费用对象', flex: 1, readOnly: true, name: 'SALECORP' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.Remarks, //备注 flex: 2, labelWidth: 40, readOnly: true, name: 'Remark' }, { fieldLabel: Zi.LAN.sqperson, readOnly: true, labelWidth: 50, name: 'MODIFIEDUSER' }, { fieldLabel: Zi.LAN.sqtime, readOnly: true, name: 'MODIFIEDTIME' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.ChangeProBefore, labelWidth: 70, readOnly: true, name: 'BPROFIT', 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; } }, { fieldLabel: Zi.LAN.ChangeProfit, labelWidth: 70, readOnly: true, name: 'APROFIT', 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; } }, { fieldLabel: Zi.LAN.ProfitMargin, labelWidth: 70, readOnly: true, name: 'DIFPROFIT', 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; } } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); //#endregion 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, split: true, items: [this.gridDrChFee, this.NewFeeShowDr] }); this.panelCrChFee = new Ext.Panel({ // title: '应付费用', layout: "border", anchor: '100% 50%', // region: 'center', frame: true, items: [this.gridCrChFee, this.NewFeeShowCr] }); this.panelFee = new Ext.Panel({ // title: '费用信息', // layout: "border", layout: "anchor", // region: 'north', // height: 560, region: 'center', items: [ this.panelDrChFee, this.panelCrChFee ] }); //#region 布局 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.getCondition(); Ext.apply(store.proxy.extraParams, { condition: _this.BillSql}); }, this); this.CheckAll.addListener('change', function (field, newValue, oldValue, eOpts) { this.CheckChange(field, newValue, oldValue, eOpts); }, this); this.CheckFeeAll.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; if (FeeStatus == 3) { this.NewFeeShowDr.setVisible(true); this.storeChFeeModify.load({ params: { FeeID: GId, ApplyType: 2 }, callback: function (r, options, success) { if (success) { _this.NewFeeShowDr.getForm().loadRecord(_this.storeChFeeModify.getAt(0)); for (i = 0; i < _this.storeBodySum.getCount(); i += 1) { var memberyf = _this.storeBodySum.getAt(i); if (memberyf.data.CURR == '合计') { var ttlprofit = memberyf.data.PR; ttlprofit = parseFloat(ttlprofit).toFixed(2); _this.NewFeeShowDr.getForm().findField('BPROFIT').setValue(ttlprofit); var Amount = _this.NewFeeShowDr.getForm().findField('Amount').getValue(); var ExChangerate = _this.NewFeeShowDr.getForm().findField('ExChangerate').getValue(); var aprofit = Add(ttlprofit, -Mul(oldAmount, oldExChangerate, 2), 2) aprofit = Add(aprofit, Mul(Amount, ExChangerate, 2)); _this.NewFeeShowDr.getForm().findField('APROFIT').setValue(aprofit); var difprofit = Add(aprofit, -ttlprofit, 2); _this.NewFeeShowDr.getForm().findField('DIFPROFIT').setValue(difprofit); if (difprofit < 0) _this.NewFeeShowDr.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' }); } } var modifydata = _this.storeChFeeModify.getAt(0).data; if (record.data.FeeName != modifydata.FeeName) _this.NewFeeShowDr.getForm().findField('FeeName').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('FeeName').setFieldStyle({ color: '#000000' }); if (record.data.CustomerName != modifydata.CustomerName) _this.NewFeeShowDr.getForm().findField('CustomerName').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('CustomerName').setFieldStyle({ color: '#000000' }); if (record.data.Unit != modifydata.Unit) _this.NewFeeShowDr.getForm().findField('Unit').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('Unit').setFieldStyle({ color: '#000000' }); if (record.data.UnitPrice != modifydata.UnitPrice) _this.NewFeeShowDr.getForm().findField('UnitPrice').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('UnitPrice').setFieldStyle({ color: '#000000' }); if (record.data.TaxRate != modifydata.TaxRate) _this.NewFeeShowDr.getForm().findField('TaxRate').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('TaxRate').setFieldStyle({ color: '#000000' }); if (record.data.TaxUnitPrice != modifydata.TaxUnitPrice) _this.NewFeeShowDr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#000000' }); if (record.data.Quantity != modifydata.Quantity) _this.NewFeeShowDr.getForm().findField('Quantity').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('Quantity').setFieldStyle({ color: '#000000' }); if (record.data.NoTaxAmount != modifydata.NoTaxAmount) _this.NewFeeShowDr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#000000' }); if (record.data.Amount != modifydata.Amount) _this.NewFeeShowDr.getForm().findField('Amount').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('Amount').setFieldStyle({ color: '#000000' }); if (record.data.Currency != modifydata.Currency) _this.NewFeeShowDr.getForm().findField('Currency').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('Currency').setFieldStyle({ color: '#000000' }); if (record.data.ExChangerate != modifydata.ExChangerate) _this.NewFeeShowDr.getForm().findField('ExChangerate').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('ExChangerate').setFieldStyle({ color: '#000000' }); if (record.data.AccTaxRate != modifydata.AccTaxRate) _this.NewFeeShowDr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowDr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#000000' }); } }, scope: this }); } else { this.NewFeeShowDr.setVisible(false); } 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; if (FeeStatus == 3) { this.NewFeeShowCr.setVisible(true); this.storeChFeeModify.load({ params: { FeeID: GId, ApplyType: 2 }, callback: function (r, options, success) { if (success) { _this.NewFeeShowCr.getForm().loadRecord(_this.storeChFeeModify.getAt(0)); for (i = 0; i < _this.storeBodySum.getCount(); i += 1) { var memberyf = _this.storeBodySum.getAt(i); if (memberyf.data.CURR == '合计') { var ttlprofit = memberyf.data.PR; ttlprofit = parseFloat(ttlprofit).toFixed(2); _this.NewFeeShowCr.getForm().findField('BPROFIT').setValue(ttlprofit); var Amount = _this.NewFeeShowCr.getForm().findField('Amount').getValue(); var ExChangerate = _this.NewFeeShowCr.getForm().findField('ExChangerate').getValue(); var aprofit = Add(ttlprofit, Mul(oldAmount, oldExChangerate, 2), 2) aprofit = Add(aprofit, -Mul(Amount, ExChangerate, 2)); _this.NewFeeShowCr.getForm().findField('APROFIT').setValue(aprofit); var difprofit = Add(aprofit, -ttlprofit,2); _this.NewFeeShowCr.getForm().findField('DIFPROFIT').setValue(difprofit); if (difprofit < 0) _this.NewFeeShowCr.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' }); } } var modifydata = _this.storeChFeeModify.getAt(0).data; if (record.data.FeeName != modifydata.FeeName) _this.NewFeeShowCr.getForm().findField('FeeName').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('FeeName').setFieldStyle({ color: '#000000' }); if (record.data.CustomerName != modifydata.CustomerName) _this.NewFeeShowCr.getForm().findField('CustomerName').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('CustomerName').setFieldStyle({ color: '#000000' }); if (record.data.Unit != modifydata.Unit) _this.NewFeeShowCr.getForm().findField('Unit').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('Unit').setFieldStyle({ color: '#000000' }); if (record.data.UnitPrice != modifydata.UnitPrice) _this.NewFeeShowCr.getForm().findField('UnitPrice').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('UnitPrice').setFieldStyle({ color: '#000000' }); if (record.data.TaxRate != modifydata.TaxRate) _this.NewFeeShowCr.getForm().findField('TaxRate').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('TaxRate').setFieldStyle({ color: '#000000' }); if (record.data.TaxUnitPrice != modifydata.TaxUnitPrice) _this.NewFeeShowCr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#000000' }); if (record.data.Quantity != modifydata.Quantity) _this.NewFeeShowCr.getForm().findField('Quantity').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('Quantity').setFieldStyle({ color: '#000000' }); if (record.data.NoTaxAmount != modifydata.NoTaxAmount) _this.NewFeeShowCr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#000000' }); if (record.data.Amount != modifydata.Amount) _this.NewFeeShowCr.getForm().findField('Amount').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('Amount').setFieldStyle({ color: '#000000' }); if (record.data.Currency != modifydata.Currency) _this.NewFeeShowCr.getForm().findField('Currency').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('Currency').setFieldStyle({ color: '#000000' }); if (record.data.ExChangerate != modifydata.ExChangerate) _this.NewFeeShowCr.getForm().findField('ExChangerate').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('ExChangerate').setFieldStyle({ color: '#000000' }); if (record.data.AccTaxRate != modifydata.AccTaxRate) _this.NewFeeShowCr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#FF4500' }); else _this.NewFeeShowCr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#000000' }); } }, scope: this }); } else { this.NewFeeShowCr.setVisible(false); } 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.storeBillList.load({ params: { condition: this.BillSql }, // 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(); // 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.storeChFeeGain.load({ params: { bsno: bsno }, // callback: function (r, options, success) { // if (success) { // _this.formtotal.getForm().loadRecord(_this.storeChFeeGain.getAt(0)); // } // }, // scope: this // }); // } // } // }, // scope: this // }); _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; if (OPTYPE == '更改单') { var ViewFee = Ext.getCmp('ViewFee'); ViewFee.enable(); this.isAmend = '1'; } else { var ViewFee = Ext.getCmp('ViewFee'); ViewFee.disable(); this.isAmend = '0'; } this.feeDrGridCheckBoxModel.deselectAll(); this.feeCrGridCheckBoxModel.deselectAll(); //this.feeCrGridCheckBoxModel.setChecked(false); this.strOPTYPE = OPTYPE; this.stroplb = record.data.OPLB.toLowerCase(); this.strBSNO = record.data.BSNO; this.strMBSNO = record.data.PARENTID; this.FeeStatus = record.data.FEESTATUS; var isAll = '0'; if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' this.NewFeeShowCr.setVisible(false); this.NewFeeShowDr.setVisible(false); var condition = this.getFeeCondition(); this.storeDrChFee.removeAll(); this.storeCrChFee.removeAll(); // isAll = this.comboxaddDCType.getValue(); this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: this.stroplb, isAll: isAll, condition: condition, worktype: _this.worktype} }); this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: this.stroplb, isAll: isAll, condition: condition, worktype: _this.worktype} }); // this.storeChFeeGain.load({ params: { bsno: bsno }, // callback: function (r, options, success) { // if (success) { // _this.formtotal.getForm().loadRecord(_this.storeChFeeGain.getAt(0)); // } // }, // scope: this // }); 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, optype: this.stroplb } }); if (record.data.BLTYPE == '拼箱主票' || record.data.BLTYPE == '合票主票' || record.data.BLTYPE == '主票') { //var finded = false; //var children = this.tabTotal.items; //if (children) { // for (var i = 0, len = children.length; i < len; i++) { // if (children.items[i].id) { // if (children.items[i].id == 'panelCustMaster') { // finded = true; // } // } // } //} //if (finded == false) { // this.tabTotal.add(this.panelCustMaster); // this.tabTotal.doLayout(); //} //this.panelCustMaster.setVisible(true); this.storeChFeeMasterGain.load({ params: { bsno: bsno } }); } else { this.storeChFeeMasterGain.removeAll(); //var finded = false; //var children = this.tabTotal.items; //if (children) { // for (var i = 0, len = children.length; i < len; i++) { // if (children.items[i].id) { // if (children.items[i].id == 'panelCustMaster') { // finded = true; // } // } // } //} //if (finded) { // this.tabTotal.remove(this.panelCustMaster); // this.tabTotal.doLayout(); //} //this.panelCustMaster.setVisible(false); } //this.storeChFeeMasterGain.on('beforeload', function (store) { // Ext.apply(store.proxy.extraParams, { bsno: bsno }); //}, this); }, this); if (this.worksql != undefined && this.worksql != '') { this.worksql = this.worksql.replace(/@@/g, '=') this.sqlcontext = this.worksql; this.onDsQuery(); } else { this.InitData(); } LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery); this.gridBillList.reconfigure(this.storeBillList, this.girdcolums); //#region 费用锁定 this.CheckAccMonth = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.XiuGaiKuaiji, checked: false, width: 120 }); this.CheckBsClose = new Ext.form.Checkbox({ fieldLabel: '同时业务封账', checked: false, width: 100 }); 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' }, this.CheckBsClose ] } ]//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/MsBaseInfo/GetUserModuleEnable', params: { modulename: "modAuditOnlyFeeDr" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success) { this.panelDrChFee.anchor = '100% 100%'; this.panelCrChFee.setVisible(false); this.tabTotal.setHeight(0); this.tabTotal.setTitle(''); this.tabTotal.collapsed = false; this.tabTotal.collapsible = false; this.tabTotal.removeAll(); this.onlyfeedr = 1; } } else { } }, scope: this }); Ext.Ajax.request({ waitMsg: '', url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', params: { modulename: "modAuditOnlyFeeCr" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success) { this.panelCrChFee.anchor = '100% 100%'; this.panelDrChFee.setVisible(false); this.tabTotal.setHeight(0); this.tabTotal.setTitle(''); this.tabTotal.collapsed = false; this.tabTotal.collapsible = false; this.tabTotal.removeAll(); this.onlyfeecr = 1; } } else { } }, scope: this }); Ext.Ajax.request({ waitMsg: '', url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', params: { modulename: "modFeeAuditNoFEEClock" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success != true) { } else { var btnFeeLock = Ext.getCmp(Zi.LAN.Costlock); btnFeeLock.setVisible(false); } } else { } }, scope: this }); Ext.Ajax.request({ waitMsg: '', url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', params: { modulename: "modBsLockBig" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success != true) { _this.CheckBsClose.setVisible(false); } else { _this.CheckBsClose.setVisible(true); } } else { } }, scope: this }); }, //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.worktype = this.comboxWorkType.getValue(); 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 and (wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeRecvPayAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeModifyAudit',ch_fee.GID) " // + " or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeSeaiRecvPayAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeSeaiModifyAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('ApplyFeeAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('ApplyFeeModify',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('BulkFeeAudit',ch_fee.GID) or " // + " wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('BulkFeeModify',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeOpOpOtherRecvPayAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeOpOtherModifyAudit',ch_fee.GID) ) ) "; this.BillSql = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID left join workflow_step st " this.BillSql = this.BillSql + " on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) where v_op_bill.BSNO=ch_fee.BSNO " if (this.worktype =='SALEORDER') this.BillSql = this.BillSql + " and ch_fee.IsCrmOrderFee=1 " else if (this.worktype != '') this.BillSql = this.BillSql + " and isnull(ch_fee.IsCrmOrderFee,0)=0 " if (this.worktype == 'BLAUDIT') this.BillSql = this.BillSql + " and wu.TYPENO=602 " else if (this.worktype == 'FEEAUDIT') this.BillSql = this.BillSql + " and (wu.TYPENO=1 or wu.TYPENO=3 or wu.TYPENO=11 or wu.TYPENO=13 or wu.TYPENO=101 or wu.TYPENO=103 or wu.TYPENO=104 or wu.TYPENO=106 or wu.TYPENO=107 or wu.TYPENO=109 or wu.TYPENO=204 or wu.TYPENO=206 or wu.TYPENO=301 or wu.TYPENO=303 or wu.TYPENO=304 or wu.TYPENO=601) " this.BillSql = this.BillSql+ " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + userid + "' and (ch_fee.FEESTATUS=2 or ch_fee.FEESTATUS=3 or ch_fee.FEESTATUS=4)) "; // 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) "; //+" and wu.WORKFLOWID IN (SELECT GID FROM v_workflow WHERE TYPENAME='FeeRecvPayAudit' or TYPENAME='FeeModifyAudit' " // + " or TYPENAME='FeeSeaiRecvPayAudit' or TYPENAME='FeeSeaiModifyAudit' or TYPENAME='ApplyFeeAudit' " // + " or TYPENAME='ApplyFeeModify' or TYPENAME='BulkFeeAudit' or TYPENAME='BulkFeeModify' or TYPENAME='FeeOpOpOtherRecvPayAudit' " // + " or TYPENAME='FeeOpOtherModifyAudit' or TYPENAME='AireFeeAudit' or TYPENAME='AireFeeModify' " // + " or TYPENAME='AiriFeeAudit' or TYPENAME='AiriFeeModify' or TYPENAME='RailwayFeeAudit' or TYPENAME='RailwayFeeModify')) "; _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'; if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); _this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll, worktype: _this.worktype} }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll, worktype: _this.worktype} }); _this.storeBodySum.load({ params: { bsno: bsno, oplb: optype }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno, optype: optype} }); _this.storeChFeeAmendGain.load({ params: { bsno: bsno, optype: optype} }); // _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); }, 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.Receivable + ":" + returnfloat(rmbdr) + "    " + LOCALCURR + "" + Zi.LAN.Handle + ": " + returnfloat(rmbcr) + "   " + LOCALCURR + "" + Zi.LAN.profit + ":" + returnfloat(rmbprofit) + "   |"; } if (usddr != 0 || usdcr != 0 || usdprofit != 0) { var feecolor = 'green'; if (usdprofit < 0) feecolor = 'red'; usdlb = "   USD" + Zi.LAN.Receivable + ": " + returnfloat(usddr) + "   " + Zi.LAN.profitUSD + ":" + returnfloat(usdcr) + "   " + Zi.LAN.USDprofit + "" + returnfloat(usdprofit) + "   |"; } if (otdr != 0 || otcr != 0 || otprofit != 0) { otlb = "   " + Zi.LAN.ReceivableOther + ": " + returnfloat(otdr) + "    " + Zi.LAN.HandleOther + ":" + returnfloat(otcr) + "   " + 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) + ""; ttllb = ttllb + "  " + Zi.LAN.noacctaxttldr + ": " + returnfloat(noacctaxttldr) + "   " + Zi.LAN.acctaxttldr + ":" + returnfloat(acctaxttldr) + "   " + Zi.LAN.noacctaxttlcr + "" + returnfloat(noacctaxttlcr) + "  " + Zi.LAN.acctaxttlcr + "" + returnfloat(acctaxttlcr) + ""; } 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; var PROFITTYPE = Ext.getCmp('PROFITTYPE').getValue(); if (PROFITTYPE == 'NOTAX') { for (i = 0; i < this.storeBodySum.getCount(); i += 1) { var memberyf = this.storeBodySum.getAt(i); if (memberyf.data.CURR == LOCALCURR) { rmbdr = memberyf.data.NORATEDR; rmbcr = memberyf.data.NORATECR; rmbprofit = memberyf.data.NORATEPR; } else if (memberyf.data.CURR == 'USD') { usddr = memberyf.data.NORATEDR; usdcr = memberyf.data.NORATECR; usdprofit = memberyf.data.NORATEPR; } if (memberyf.data.CURR == '其他币别') { otdr = memberyf.data.NORATEDR; otcr = memberyf.data.NORATECR; otprofit = memberyf.data.NORATEPR; } if (memberyf.data.CURR == '合计') { ttldr = memberyf.data.NORATEDR; ttlcr = memberyf.data.NORATECR; ttlprofit = memberyf.data.NORATEPR; profitrate = memberyf.data.NOTAXPROFITRATE; noacctaxttldr = memberyf.data.NOACCTAXRATEDR; noacctaxttlcr = memberyf.data.NOACCTAXRATECR; acctaxttldr = memberyf.data.ACCTAXDR; acctaxttlcr = memberyf.data.ACCTAXCR; } } } else { 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, worktype: _this.worktype }, 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'; if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); _this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll, worktype: _this.worktype} }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll, worktype: _this.worktype} }); _this.storeBodySum.load({ params: { bsno: bsno, oplb: optype }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno} }); _this.storeChFeeAmendGain.load({ params: { bsno: bsno} }); } } }, 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, worktype: _this.worktype }, 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'; if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); _this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll, worktype: _this.worktype} }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll, worktype: _this.worktype} }); _this.storeBodySum.load({ params: { bsno: bsno, oplb: optype }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno} }); _this.storeChFeeAmendGain.load({ params: { bsno: bsno} }); } } }, scope: this }); }, CheckChange: function (field, newValue, oldValue, eOpts) { this.onRefreshClick(); }, CheckLiRun: function () { //看利润是否为负值 如否(为正值)返回true 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; ttlprofit = ref.ttlprofit; if (ttlprofit >= 0) { return true; } else return false; }, onAuditNewClick: function (button, event, type) { //SR2019122600002 青岛航都 负利润时告警确认 fulirun = this.CheckLiRun(); _this = this; if (!fulirun) { Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.SureAudit_Profit, function (btn) { if (btn == 'yes') { _this.DoAuditNew(type); } else { return } }); } else { _this.DoAuditNew(type); } }, DoAuditNew: function (type) { var GidStr = ''; 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.FirstShenH, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var Gid = rec.data.GId; var IsAudit = rec.data.IsAudit; var canAudit = feeStatus == 2; if (canAudit == false) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.OnlyShenHe, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (IsAudit == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.RoleShenHe, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (GidStr == '') GidStr = Gid; else { GidStr = GidStr + ',' + Gid; } bodyAddDatas.push(rec); } } } _this = this; if (GidStr == '') { } else { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: Zi.LAN.ZZShenHe, url: '/Account/Chfee_Audit/AuditList', params: { optype: _this.stroplb, bill: jsonbodyAddDatas, bsno: this.strBSNO, mblno: this.strMBSNO, isamend: _this.isAmend, 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.ZZShenHe, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { if (type == 1) { _this.storeDrChFee.reload(); } else { _this.storeCrChFee.reload(); } Ext.Ajax.request({ waitMsg: Zi.LAN.ZZTiJiao, url: '/Account/Chfee_Audit/UpLock', params: { bsno: _this.strBSNO, optype: _this.stroplb }, callback: function (options, success, response) { if (success) { _this.UpListStatus(_this.strBSNO); var result = Ext.JSON.decode(response.responseText); if (!result.Success) { return; } else { return; } } else { return; } }, scope: this }); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onAuditBackNewClick: function (button, event, type) { if (this.FeeStatus == true) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LocalBoHui, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var GidStr = ''; 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.SelectFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var Gid = rec.data.GId; var IsAudit = rec.data.IsAudit; var canAudit = feeStatus == 2 || feeStatus == 0; if (canAudit == false) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi1, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } if (rec.data.Settlement != 0) { canAudit = false; Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi2, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (rec.data.Invoice != 0) { canAudit = false; Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi3, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (rec.data.OrderAmount != 0) { canAudit = false; Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi4, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (rec.data.OrderInvoice != 0) { canAudit = false; Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi5, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (this.AUDITNOBACK == 1) { if (feeStatus == 0) { canAudit = false; Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '费用已审核通过,不允许驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } if (canAudit == false) { } else { if (IsAudit == -1) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi6, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (GidStr == '') GidStr = Gid; else { GidStr = GidStr + ',' + Gid; } bodyAddDatas.push(rec); } } } _this = this; if (GidStr == '') { } else { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.MessageBox.show({ title: Zi.LAN.Tishi7, msg: Zi.LAN.Tishi8, width: 300, buttons: Ext.MessageBox.OKCANCEL, multiline: true, fn: function (btn, text) { if (btn == "ok") { Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiBh, url: '/Account/Chfee_Audit/AuditBack', params: { optype: _this.stroplb, bill: jsonbodyAddDatas, reasean: text, isamend: _this.isAmend, 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 { if (type == 1) { _this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); } _this.UpListStatus(_this.strBSNO); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } } }); } }, onNoIvoiceClick: function (button, event, type) { var GidStr = ''; 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.StopFaPiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var Gid = rec.data.GId; var Settlement = rec.data.Settlement; var Invoice = rec.data.Invoice; var OrderInvoice = rec.data.OrderInvoice; if ( Invoice != 0 || Invoice != 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.NOtUpdate, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (GidStr == '') GidStr = Gid; else { GidStr = GidStr + ',' + Gid; } } } _this = this; if (GidStr == '') { } else { Ext.Ajax.request({ waitMsg: Zi.LAN.ZZTiJiao, url: '/Account/Chfee_Audit/NoIvoice', params: { bill: GidStr }, 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 { if (type == 1) { _this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); } } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onCancelNoInvoiceClick: function (button, event, type) { var GidStr = ''; 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.JinJinFP, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var Gid = rec.data.GId; var Settlement = rec.data.Settlement; var Invoice = rec.data.Invoice; var OrderInvoice = rec.data.OrderInvoice; if (Invoice != 0 || Invoice != 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.NOtUpdate, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (GidStr == '') GidStr = Gid; else { GidStr = GidStr + ',' + Gid; } } } _this = this; if (GidStr == '') { } else { Ext.Ajax.request({ waitMsg: Zi.LAN.ZZTiJiao, url: '/Account/Chfee_Audit/CancelNoIvoice', params: { bill: GidStr }, 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 { if (type == 1) { _this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); } } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onAuditShenClick: function (button, event, type) { fulirun = this.CheckLiRun(); _this = this; if (!fulirun) { Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.SureConfirm_Profit, function (btn) { if (btn == 'yes') { _this.DoAuditShenClick(button, event,type); } else { return } }); } else { _this.DoAuditShenClick(button, event,type); } }, DoAuditShenClick: function (button, event, type) { if (this.FeeStatus == true) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LocalBoHui, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var GidStr = ''; 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.SelectPiZhun, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var Gid = rec.data.GId; var IsAudit = rec.data.IsAudit; var canAudit = feeStatus == 3 || feeStatus == 4; if (canAudit == false) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectFYZT, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (IsAudit == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.RoleShenHe, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (GidStr == '') GidStr = Gid; else { GidStr = GidStr + ',' + Gid; } bodyAddDatas.push(rec); } } } _this = this; if (GidStr == '') { } else { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: Zi.LAN.ZZShenHe, url: '/Account/Chfee_Audit/AuditShenNew', params: { optype: _this.stroplb, bill: jsonbodyAddDatas, isamend: _this.isAmend, 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.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FYPizhun, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); if (type == 1) { _this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); this.NewFeeShowDr.setVisible(false); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); this.NewFeeShowCr.setVisible(false); } this.UpListStatus(_this.strBSNO); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onAuditBackShenClick: function (button, event, type) { if (this.FeeStatus == true) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LocalBoHui, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } _this = this; var GidStr = ''; 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.SelectPiZhun, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var Gid = rec.data.GId; var IsAudit = rec.data.IsAudit; var canAudit = feeStatus == 3 || feeStatus == 4; if (canAudit == false) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FYZTBH, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } if (canAudit == false) { } else { if (IsAudit == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.BHRole, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (GidStr == '') GidStr = Gid; else { GidStr = GidStr + ',' + Gid; } bodyAddDatas.push(rec); } } } _this = this; if (GidStr == '') { } else { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.MessageBox.show({ title: Zi.LAN.Tishi7, msg: Zi.LAN.Tishi8, width: 300, buttons: Ext.MessageBox.OKCANCEL, multiline: true, fn: function (btn, text) { if (btn == "ok") { Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiBh, url: '/Account/Chfee_Audit/AuditBackShen', params: { optype: _this.stroplb, bill: jsonbodyAddDatas, reasean: text, isamend: _this.isAmend, 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.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.BHSuccess, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); if (type == 1) { _this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); this.NewFeeShowDr.setVisible(false); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll, worktype: _this.worktype} }); this.NewFeeShowCr.setVisible(false); } this.UpListStatus(_this.strBSNO); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } } }); } }, 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(); this.gridBillList.getSelectionModel().select(memberyf) } }; } 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 IsOpen = record.data.IsOpen; var WorkFlowName = "FeeOpOpOtherRecvPayAudit"; if (IsOpen == '1' || IsOpen == 'True') { WorkFlowName = "YjFeefyAudit"; } else if ((this.strOPTYPE == '更改单') && (this.AMENDSELFWORKFLOW == 1)) { WorkFlowName = "AmendFeefyAudit"; } else { if (feeStatus == 3 || feeStatus == 4) { WorkFlowName = "FeeOpOtherModifyAudit"; if (this.stroplb == "op_seae" || this.stroplb == "op_seaeorder") { 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" || this.stroplb == "op_seaeorder") { 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; var openUrl = "../../Account/Chfee_payapplication/Map?bsno=" + Gid + "&name="; window.open(openUrl, openType, openSet); }, onViewDetailClick: function (button, event, type) { var openSet = "height=740, 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.LocalWTFY, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return false; } }, //#endregion onSelAuditClick: function (type) { fulirun = this.CheckLiRun(); _this = this; if (!fulirun) { Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.SureAudit_Profit, function (btn) { if (btn == 'yes') { _this.DoSelAuditClick(type); } else { return } }); } else { _this.DoSelAuditClick(type); } }, DoSelAuditClick: function (type) { 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); } var feesql = ''; if (type=='1') feesql =this.feesqlcontext; 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/SelAudit', params: { data: jsonbodyAddDatas, worktype: _this.worktype, feesql: feesql }, 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(); _this.storeDrChFee.reload(); _this.storeCrChFee.reload(); Ext.MessageBox.hide(); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onCopyAuditClick: function (type) { fulirun = this.CheckLiRun(); _this = this; if (!fulirun) { Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.SureAudit_Profit, function (btn) { if (btn == 'yes') { _this.DoCopyAuditClick(type); } else { return } }); } else { _this.DoCopyAuditClick(type); } }, DoCopyAuditClick: function(type) { _this = this; var GidStr = ''; if (type == '1') { var records = this.feeDrGridCheckBoxModel.selected.items; this.storeCrChFee.each(function (record) { if (record.data.ISSEL == '1') records.push(record); }); ; } else if (type == '2') { var records = this.feeCrGridCheckBoxModel.selected.items; this.storeDrChFee.each(function (record) { if (record.data.ISSEL == '1') records.push(record); }); }; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FirstShenH, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var Gid = rec.data.GId; var IsAudit = rec.data.IsAudit; var canAudit = feeStatus == 2; if (canAudit == false) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.OnlyShenHe, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (IsAudit == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.RoleShenHe, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (GidStr == '') GidStr = Gid; else { GidStr = GidStr + ',' + Gid; } bodyAddDatas.push(rec); } } } _this = this; if (GidStr == '') { } else { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: Zi.LAN.ZZShenHe, url: '/Account/Chfee_Audit/AuditList', params: { optype: _this.stroplb, bill: jsonbodyAddDatas, bsno: this.strBSNO, mblno: this.strMBSNO, isamend: _this.isAmend, 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.ZZShenHe, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { if (type == 1) { _this.storeDrChFee.reload(); } else { _this.storeCrChFee.reload(); } Ext.Ajax.request({ waitMsg: Zi.LAN.ZZTiJiao, url: '/Account/Chfee_Audit/UpLock', params: { bsno: _this.strBSNO, optype: _this.stroplb }, callback: function (options, success, response) { if (success) { _this.UpListStatus(_this.strBSNO); var result = Ext.JSON.decode(response.responseText); if (!result.Success) { return; } else { return; } } else { return; } }, scope: this }); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onAllAuditClick: function (type) { if (this.storeBillList.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.NoYWShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var feesql = ''; if (type == '1') feesql = this.feesqlcontext; _this = this; Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.sureAllAudit, function (btn) { if (btn == 'yes') {//正在删除数据... Ext.Msg.wait(Zi.LAN.ZZShenHe); Ext.Ajax.request({ waitMsg: Zi.LAN.zzaiLoacal, url: '/Account/Chfee_Audit/AllAudit', params: { condition: _this.BillSql, worktype: _this.worktype, feesql: feesql }, 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.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); // _this.onRefreshClick(); _this.storeBillList.reload(); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, this); }, //#region 费用锁定 onSelFeeLockClick: function (menu, event, type) { var GidStr = ''; var records = this.AddGridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.selectLocalYW, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } if (this.CheckAccMonth.checked) { this.IsAccDate = '1' } else this.IsAccDate = '0' if (_this.CheckBsClose.checked) { this.isbslock = '1' } else this.isbslock = '0' var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; var Gid = rec.data.BSNO; var status = rec.data.FEESTATUS if (status != true) { bodyAddDatas.push(rec); } } _this = this; 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.Ajax.request({ waitMsg: Zi.LAN.zzaiLoacal, url: '/Account/Chfee_lock/SelFeeLock', params: { data: jsonbodyAddDatas, isAccDate: _this.IsAccDate, AccDate: _this.AccDate, isbslock: _this.isbslock }, 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.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.storeBillList.reload(); _this.winFeeCloseShow.close(); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, onSelUnLockClick: function (menu, event, type) { var records = this.AddGridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.HUMIDITY, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } // var strGids = ""; var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; var Gid = rec.data.BSNO; var status = rec.data.FEESTATUS if (status = true) { bodyAddDatas.push(rec); strGids += "," + Gid; } } // if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYuou, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { if (strGids != "") { strGids = strGids.toString().substr(1); } Ext.Ajax.request({ waitMsg: Zi.LAN.NowPanduansuoding, url: '/Account/Chfee_lock/isSelUnLock', params: { strGids: strGids }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success) { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: Zi.LAN.JieChuSuoDingNow, url: '/Account/Chfee_lock/SelUnLock', params: { data: jsonbodyAddDatas, type: type }, 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.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.JiechuSuodingSuccess, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.storeBillList.reload(); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert(Zi.LAN.Error, response.responseText); } }, scope: this }); } }, //#endregion getFeeStatus: function () { var feeStatus = this.EditRecord.get('FEESTATUS'); return feeStatus; }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); }, //onClearClick getCondition: function () { this.worktype = this.comboxWorkType.getValue(); var form = this.formSearch.getForm(); var sql = " ISCANCEL<>'1' "; /* var sqldata = form.getValues(); sql = Ext.JSON.encode(sqldata); */ var feestr = this.getFeeCondition(); this.feesqlcontext = feestr; if (feestr != '') feestr = " and " + feestr; var StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID left join workflow_step st " StrAudit = StrAudit + " on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) where v_op_bill.BSNO=ch_fee.BSNO " if (this.worktype == 'BLAUDIT') StrAudit = StrAudit + " and wu.TYPENO=602 " else if (this.worktype == 'FEEAUDIT') StrAudit = StrAudit + " and (wu.TYPENO=1 or wu.TYPENO=3 or wu.TYPENO=11 or wu.TYPENO=13 or wu.TYPENO=101 or wu.TYPENO=103 or wu.TYPENO=104 or wu.TYPENO=106 or wu.TYPENO=107 or wu.TYPENO=109 or wu.TYPENO=204 or wu.TYPENO=206 or wu.TYPENO=301 or wu.TYPENO=303 or wu.TYPENO=304 or wu.TYPENO=601) " StrAudit = StrAudit+ " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + userid + "' and (ch_fee.FEESTATUS=2 or ch_fee.FEESTATUS=3 or ch_fee.FEESTATUS=4)" StrAudit = StrAudit+ feestr + " ) "; 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, " (ISNULL(CUSTNO,'')+' '+ISNULL(MBLNO,'')+' '+ISNULL(HBLNO,'')+' '+ISNULL(CUSTOMNO,'')+' '+ISNULL(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 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 + ") "); }; var PRTYPE = form.findField('PRTYPE').getValue(); if (PRTYPE == '1') { var prtypestr = " EXISTS (select 1 from (select m.BSNO,SUM(case when f.FEETYPE=1 then case when APPLYTYPE=2 then m.AMOUNT*m.EXCHANGERATE else -m.AMOUNT*m.EXCHANGERATE end else case when APPLYTYPE=2 then -m.AMOUNT*m.EXCHANGERATE else m.AMOUNT*m.EXCHANGERATE end end) as pramount " + "from ch_fee_modify m left join ch_fee f on (f.GID=m.FEEID) where APPLYSTATUS=1 AND (APPLYTYPE=1 OR APPLYTYPE=2) and f.GID is not null GROUP BY m.BSNO) as PR " + " WHERE v_op_bill.BSNO=PR.BSNO AND PR.pramount<0 ) "; sql = sql + getAndConSql(sql, prtypestr, prtypestr); } else if (PRTYPE == '2') { sql = sql + getAndConSql(sql, PRTYPE, " OPTYPE='更改单' AND EXISTS (select 1 from v_op_gain_sum WHERE v_op_bill.BSNO=v_op_gain_sum.BSNO AND (v_op_gain_sum.TTLDR-v_op_gain_sum.TTLCR)<0 ) "); } else if (PRTYPE == '4') { } return sql; }, getFeeCondition: function () { var form = this.formSearch.getForm(); this.worktype = this.comboxWorkType.getValue(); 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 + "'"); if (this.worktype == 'SALEORDER') if (feesql == '') feesql = feesql + " ch_fee.IsCrmOrderFee=1 "; else feesql = feesql + " and ch_fee.IsCrmOrderFee=1 " else if (this.worktype != '') if (feesql == '') feesql = feesql + " isnull(ch_fee.IsCrmOrderFee,0)=0 "; else feesql = feesql + " and isnull(ch_fee.IsCrmOrderFee,0)=0 " return feesql; }, setSaveBtnStatus: function (enable) { var bsbtnSave = Ext.getCmp('pcbtnSave'); var bsbtnSaveAndClose = Ext.getCmp('pcbtnSaveAndClose'); var bsbtnSaveAndNew = Ext.getCmp('pcbtnSaveAndNew'); var pcbtnNew = Ext.getCmp('pcbtnNew'); if (enable) { bsbtnSave.enable(); bsbtnSaveAndClose.enable(); bsbtnSaveAndNew.enable(); pcbtnNew.enable(); } else { //bsbtnSave.disable(); //bsbtnSaveAndClose.disable(); bsbtnSaveAndNew.disable(); pcbtnNew.disable(); } }, 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 oplb = record.data.OPLB; var rptname = 'MSCHFEAUDITSEL'; if (this.stroplb == "op_seae") { rptname = "MSCHFEAUDITSEAE"; } if (this.stroplb == "op_seai") { rptname = "MSCHFEAUDITSEAI"; } if (this.stroplb == "op_aire") { rptname = "MSCHFEAUDITAIRE"; } if (this.stroplb == "op_airi") { rptname = "MSCHFEAUDITAIRI"; } if (this.stroplb == "op_apply") { rptname = "MSCHFEAUDITAPPLY"; } if (this.stroplb == "op_bulk") { rptname = "MSCHFEAUDITBULK"; } if (this.stroplb == "op_other" || this.stroplb == "tMsWlPcHead" || this.stroplb == "OpCtnBsCard") { rptname = "MSCHFEAUDITOTHER"; } if (this.stroplb == "op_railway") { rptname = "MSCHFEAUDITRAILWAY"; } if (this.stroplb == "op_seaeorder") { rptname = "MSCHFEAUDITSELORDER"; } if (this.worktype == 'SALEORDER') rptname = rptname + "ORDER"; var sortstr = ''; if (this.sortfield != '' && this.sortdire != '') { sortstr = this.sortfield + ' ' + this.sortdire; } var printType = 'MSCHFEAUDITSEL'; var sql1 = "SELECT * FROM V_OP_BILL WHERE BSNO='" + BSNO + "' order by 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, '', rptname,1); } else PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } });