Ext.namespace('Shipping'); Shipping.MsOpCtnBsCtnChfeeAudit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsOpCtnBsCtnChfeeAudit.superclass.constructor.call(this); }; Ext.extend(Shipping.MsOpCtnBsCtnChfeeAudit, Ext.Panel, { ParentWin: null, //弹出式 ParentPanel: null, //Tab页编辑模式 OpStatus: 'add', EditRecord: null, RefBillNo: '*', DataLoading: true, stroplb: '', strBSNO: '', FeeStatus: '', feeType: 0, PageSize: 30, sqlcontext: '', initUIComponents: function () { Ext.Ajax.timeout = 120000; this.formname = 'FormMsOpCtnBsCtnChfeeAudit'; this.openertype = getUrlParam("opener"); this.editGID = ""; //明细表-数据集 this.storeDrChFee = Ext.create('Ext.data.Store', { model: 'MsChFee', remoteSort: false, proxy: { type: 'ajax', url: '/Account/Chfee_Audit/GetDataList', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.storeCrChFee = Ext.create('Ext.data.Store', { model: 'MsChFee', remoteSort: false, proxy: { type: 'ajax', url: '/Account/Chfee_Audit/GetDataList', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.storeChFeeGain = Ext.create('Ext.data.Store', { model: 'MsChFeeGain', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsChFee/GetOPGainList', reader: { id: 'GId', root: 'data', totalProperty: 'totalCount' } } }); this.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: '仅需审核业务', checked: true, width: 120 }); this.CheckFeeAll = new Ext.form.Checkbox({ fieldLabel: '费用明细仅显示待审核', labelWidth: 130, checked: false, 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: '费用状态', renderer: function (value, p, record) { return record.data.FeeStatus_Ref; }, width: 66 }, { sortable: true, dataIndex: 'FeeName', header: '应收费用名称', width: 100 }, { sortable: true, dataIndex: 'FeeDescription', header: '费用英文名称', width: 120 }, { sortable: true, dataIndex: 'CustomerType', header: '客户类别', width: 80 }, { sortable: true, dataIndex: 'CustomerName', header: '结算对象', width: 120 }, { sortable: true, dataIndex: 'Unit', header: '单位标准', width: 60 }, { sortable: true, dataIndex: 'UnitPrice', header: '单价', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'TaxUnitPrice', header: '含税单价', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Quantity', header: '数量', width: 60 }, { sortable: true, dataIndex: 'TaxRate', header: '税率', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 60 }, { sortable: true, dataIndex: 'NoTaxAmount', header: '不含税金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Amount', header: '金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Currency', header: '币别', width: 40 }, { sortable: true, dataIndex: 'ExChangerate', header: '汇率', align: 'right', width: 60 }, { sortable: true, dataIndex: 'AccTaxRate', header: '进项税率', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Remark', header: '备注', width: 150 }, { sortable: true, dataIndex: 'IsAdvancedpay', header: '是否垫付', width: 60 }, { sortable: true, dataIndex: 'IsInvoice', header: '不开发票', width: 60 }, { sortable: true, dataIndex: 'FeeFrt', header: 'FRT', width: 40 }, { sortable: true, dataIndex: 'Commissionrate', header: '佣金比率', width: 60 }, { sortable: true, dataIndex: 'OpName', header: '录入人', width: 60 }, { sortable: true, dataIndex: 'EnterDate', header: '录入日期', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Auditoperator', header: '审核人', width: 60 }, { sortable: true, dataIndex: 'AuditDate', header: '审核日期', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Settlement', header: '结算金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Invoice', header: '已开票金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'InvoiceNum', header: '发票号码', width: 80 }, { sortable: true, dataIndex: 'PreAmount', header: '预估金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'INPUTMODE', header: '录入方式', width: 80 }, { sortable: true, dataIndex: 'WmsOutBsNo', header: '相关业务号', 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: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.feeDrGridCheckBoxModel, selType: 'cellmodel', viewConfig: { autoFill: true, getRowClass: function (record, rowIndex, rowParams, store) { var feeStatus = record.get('FeeStatus'); return Shipping.FeeGetRowClass(feeStatus); } }, tbar: [{ xtype: 'label', labelAlign: 'right', width: 60, html: "应收费用" }, { text: '审核通过', id:"drbtn1", tooltip: '审核通过', iconCls: "btnsubmit", handler: function (button, event) { this.onAuditNewClick(button, event, 1); }, scope: this }, { text: '驳回提交', id: "drbtn2", tooltip: '驳回提交', iconCls: "btncancel", handler: function (button, event) { this.onAuditBackNewClick(button, event, 1); }, scope: this }, { text: '禁开发票', tooltip: '禁开发票', id: "drbtn3", handler: function (button, event) { this.onNoIvoiceClick(button, event, 1); }, scope: this }, { text: '解禁发票', tooltip: '解禁发票', id: "drbtn4", handler: function (button, event) { this.onCancelNoInvoiceClick(button, event, 1); }, scope: this }, { text: '批准申请', tooltip: '批准申请', id: "drbtn5", iconCls: "btnsubmit", handler: function (button, event) { this.onAuditShenClick(button, event, 1); }, scope: this }, { text: '驳回申请', tooltip: '驳回申请', id: "drbtn6", iconCls: "btncancel", handler: function (button, event) { this.onAuditBackShenClick(button, event, 1); }, scope: this }, { text: '历史申请', tooltip: '历史申请', id: "drbtn7", handler: function (button, event) { this.onHistryShenClick(button, event, 1); }, scope: this }, '-', { text: '查看信息', tooltip: '查看信息', id: "drbtn8", handler: function (button, event) { this.onViewDetailClick(button, event, 1); }, scope: this }, '-', { text: "保存列表样式", menu: [ { text: "保存", handler: function (button, event) { _this.girdDrcolums = DsTruck.SaveGridPanel(userid, 'FEEDRGRIDAD', _this.gridDrChFee.columns, _this.girdDrcolums, 0, true); } }, { text: "初始化", 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 }], 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: '费用状态', renderer: function (value, p, record) { return record.data.FeeStatus_Ref; }, width: 66 }, { sortable: true, dataIndex: 'FeeName', header: '应付费用名称', width: 100 }, { sortable: true, dataIndex: 'FeeDescription', header: '费用英文名称', width: 120 }, { sortable: true, dataIndex: 'CustomerType', header: '客户类别', width: 80 }, { sortable: true, dataIndex: 'CustomerName', header: '结算对象', width: 120 }, { sortable: true, dataIndex: 'Unit', header: '单位标准', width: 60 }, { sortable: true, dataIndex: 'UnitPrice', header: '单价', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 3, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'TaxUnitPrice', header: '含税单价', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Quantity', header: '数量', width: 60 }, { sortable: true, dataIndex: 'TaxRate', header: '税率', align: 'right', width: 60 }, { sortable: true, dataIndex: 'NoTaxAmount', header: '不含税金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Amount', header: '金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Currency', header: '币别', width: 40 }, { sortable: true, dataIndex: 'ExChangerate', header: '汇率', align: 'right', width: 60 }, { sortable: true, dataIndex: 'AccTaxRate', header: '销项税率', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'Remark', header: '备注', width: 150 }, { sortable: true, dataIndex: 'IsAdvancedpay', header: '是否垫付', width: 60 }, { sortable: true, dataIndex: 'IsInvoice', header: '不开发票', width: 60 }, { sortable: true, dataIndex: 'FeeFrt', header: 'FRT', width: 40 }, { sortable: true, dataIndex: 'Commissionrate', header: '佣金比率', width: 60 }, { sortable: true, dataIndex: 'OpName', header: '录入人', width: 60 }, { sortable: true, dataIndex: 'EnterDate', header: '录入日期', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Auditoperator', header: '审核人', width: 60 }, { sortable: true, dataIndex: 'AuditDate', header: '审核日期', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 80 }, { sortable: true, dataIndex: 'Settlement', header: '结算金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'OrderAmount', header: '申请金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'PreAmount', header: '预估金额', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'INPUTMODE', header: '录入方式', width: 80 }, { sortable: true, dataIndex: 'WmsOutBsNo', header: '相关业务号', 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: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.feeCrGridCheckBoxModel, selType: 'cellmodel', viewConfig: { autoFill: true, getRowClass: function (record, rowIndex, rowParams, store) { var feeStatus = record.get('FeeStatus'); return Shipping.FeeGetRowClass(feeStatus); } }, tbar: [{ xtype: 'label', labelAlign: 'right', width: 60, html: "应付费用" }, { text: '审核通过', tooltip: '审核通过', id: "crbtn1", iconCls: "btnsubmit", handler: function (button, event) { this.onAuditNewClick(button, event, 2); }, scope: this }, { text: '驳回提交', tooltip: '驳回提交', id: "crbtn2", iconCls: "btncancel", handler: function (button, event) { this.onAuditBackNewClick(button, event, 2); }, scope: this }, { text: '禁开发票', tooltip: '禁开发票', id: "crbtn3", handler: function (button, event) { this.onNoIvoiceClick(button, event, 2); }, scope: this }, { text: '解禁发票', tooltip: '解禁发票', id: "crbtn4", handler: function (button, event) { this.onCancelNoInvoiceClick(button, event, 2); }, scope: this }, { text: '批准申请', tooltip: '批准申请', id: "crbtn5", iconCls: "btnsubmit", handler: function (button, event) { this.onAuditShenClick(button, event, 2); }, scope: this }, { text: '驳回申请', tooltip: '驳回申请', id: "crbtn6", iconCls: "btncancel", handler: function (button, event) { this.onAuditBackShenClick(button, event, 2); }, scope: this }, { text: '历史申请', tooltip: '历史申请', id: "crbtn7", handler: function (button, event) { this.onHistryShenClick(button, event, 2); }, scope: this }, '-', { text: '查看信息', tooltip: '查看信息', id: "crbtn8", handler: function (button, event) { this.onViewDetailClick(button, event, 2); }, scope: this }, '-', { text: "保存列表样式", menu: [ { text: "保存", handler: function (button, event) { _this.girdCrcolums = DsTruck.SaveGridPanel(userid, 'FEECRGRIDAD', _this.gridCrChFee.columns, _this.girdCrcolums, 0, true); } }, { text: "初始化", 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: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: [{ header: "总 计", sortable: false, align: 'center', dataIndex: 'CURR', width: 160 }, { header: '应收不含税', 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: '应收含税', 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: '应付不含税', 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: '应付含税', 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: '利润不含税', 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: '利润含税', 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: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: [{ sortable: true, dataIndex: 'CUSTOMERNAME', header: '结算对象', width: 110 }, { sortable: true, dataIndex: 'RMBDR', header: 'RMB应收', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'RMBCR', header: 'RMB应付', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'RMBPROFIT', header: 'RMB利润', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'USDDR', header: 'USD应收', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'USDCR', header: 'USD应付', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'USDPROFIT', header: 'USD利润', 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: '其他币别应收', 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: '其他币别应付', 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: '其他币别利润', 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: '合计应收', 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: '合计应付', 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: '合计利润', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 } ] }); this.panelCustSum = new Ext.Panel({ title: '客户合计', layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.gridListCust] }); this.panelCurrSum = new Ext.Panel({ title: '币别合计', layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.gridSum] }); this.tabTotal = new Ext.TabPanel({ activeTab: 0, autoWidth: true, border: true, height: 180, frame: false, region: 'south', enableHdMenu: false, // region: 'center', title: "利润统计", collapsed: true, collapsible: true, split: true, enableTabScroll: true, items: [ this.panelCustSum, this.panelCurrSum ] }); this.storeBillList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'MsOpCtnBsCard', remoteSort: true, proxy: { type: 'ajax', timeout: 120000, url: '/MvcContainer/MsOpCtnBsCard/GetDataList', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } } }); //明细表表格 this.InitDrGrid(this.girdDrcolums); this.InitCrGrid(this.girdCrcolums); this.Pagenum = Ext.create('Ext.form.field.Number', { name: 'bottles', fieldLabel: '每页记录数', labelAlign: 'right', value: this.PageSize, maxValue: 100000, width: 180, minValue: 0, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.AddGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); this.initgirdcolums = [{ sortable: true, dataIndex: 'GID', header: 'GID', hidden: true, width: 120 }, { sortable: true, id: '', dataIndex: '', header: '', width: 0 }, { sortable: true, dataIndex: 'COMPANYID', header: 'COMPANYID', hidden: true, width: 120 }, { sortable: true, dataIndex: 'CTNNO', header: '箱号', width: 200 }, { sortable: true, dataIndex: 'APPLYNO', header: '放箱申请编号', width: 120 }, { sortable: true, dataIndex: 'CTNPROP', header: '箱属', width: 200 }, { sortable: true, dataIndex: 'BSNO', header: '业务编号', width: 200 }, { sortable: true, dataIndex: 'ISCLOSE', header: '锁定', width: 100, renderer: function (value, cellmeta) { if (value == 'true') { return ""; } } }, { sortable: true, dataIndex: 'IS_PUTCTN', header: '放箱通知发送', width: 100, renderer: function (value, cellmeta) { if (value == 'true') { return "是"; } } }, { sortable: true, dataIndex: 'PUTCTNDATE', header: '放箱通知发送时间', width: 100 }, { sortable: true, dataIndex: 'CUSTOMERNAME', header: '委托单位', width: 200 }, { sortable: true, dataIndex: 'GOODSNAME', header: '货物名称', width: 100 }, { sortable: true, dataIndex: 'PREGOODSNAME', header: '前装货品名', width: 100 }, { sortable: true, dataIndex: 'ETD', header: '开船日期', width: 100 }, { sortable: true, dataIndex: 'ETA', header: '到港日期', width: 100 }, { sortable: true, dataIndex: 'AGENTNAME', header: '目的港代理', width: 100 }, { sortable: true, dataIndex: 'CUR_PORT', header: '当前位置', width: 100 }, { sortable: true, dataIndex: 'CUR_DATE', header: '当前时间', width: 100 }, { sortable: true, dataIndex: 'CYCLE_DAY', header: '周期', width: 100 }, { sortable: true, dataIndex: 'CUSTNO', header: '委托编号', width: 200 }, { sortable: true, dataIndex: 'OP', header: '操作', width: 200 }, { sortable: true, dataIndex: 'MBLNO', header: '主提单号', width: 200 }, { sortable: true, dataIndex: 'CARRIER', header: '船公司', width: 200 }, { sortable: true, dataIndex: 'PORTLOAD_STATOIN', header: '起运港场站', width: 200 }, { sortable: true, dataIndex: 'PORTLOAD_CNT_TIME', header: '起运港提箱日期', width: 200 }, { sortable: true, dataIndex: 'LOADFACTORY', header: '装货工厂', width: 200 }, { sortable: true, dataIndex: 'PORTLOAD', header: '起运港', width: 200 }, { sortable: true, dataIndex: 'DESTPORT', header: '目的港', width: 100 }, { sortable: true, dataIndex: 'DEST_CNT_TIME', header: '目的港提箱日期', width: 200 }, { sortable: true, dataIndex: 'DEST_RTCNT_TIME', header: '目的港还箱日期', width: 200 }, { sortable: true, dataIndex: 'DESTPORT_STATOIN', header: '目的港场站', width: 200 }, { sortable: true, dataIndex: 'DETAIN_CTN_DAYS', header: '滞箱天数', width: 200 }, { sortable: true, dataIndex: 'PRE_CNT_TIME', header: '预计提箱日期', width: 200 }, { sortable: true, dataIndex: 'IS_RETURE_EMPTY', header: '是否返空', width: 100 }, { sortable: true, dataIndex: 'IS_POD_CLEAN', header: '否目的港清洗', width: 100 }, { sortable: true, dataIndex: 'IS_BOOKING', header: '是否订舱', width: 200 }, { sortable: true, dataIndex: 'I_CUSTNO', header: '空返委托编号', width: 100 }, { sortable: true, dataIndex: 'I_MBLNO', header: '空返提单号', width: 120 }, { sortable: true, dataIndex: 'I_CARRIER', header: '空返船公司', width: 100 }, { sortable: true, dataIndex: 'I_CONTRACT', header: '运费约价', width: 100 }, { sortable: true, dataIndex: 'I_PORTLOAD_CNT_TIME', header: '空返起运港提箱日期', width: 100 }, { sortable: true, dataIndex: 'I_PORTLOAD', header: '空返起运港', width: 100 }, { sortable: true, dataIndex: 'I_ETD', header: '空返开船日期', width: 100 }, { sortable: true, dataIndex: 'I_DESTPORT', header: '空返目的港', width: 100 }, { sortable: true, dataIndex: 'I_ETA', header: '空返到港日期', width: 100 }, { sortable: true, dataIndex: 'I_DESTPORT_STATOIN', header: '空返目的港场站', width: 100 }, { sortable: true, dataIndex: 'I_DEST_CNT_TIME', header: '空返目的港提箱日期', width: 100 }, { sortable: true, dataIndex: 'I_DEST_RTCNT_TIME', header: '空返目的港还箱日期', width: 100 }, { sortable: true, dataIndex: 'PORTLOAD_FREE_DAYS', header: '起运港免箱使天数', width: 100 }, { sortable: true, dataIndex: 'PORTLOAD_OVER_DAYS', header: '起运港超期天数', width: 100 }, { sortable: true, dataIndex: 'PORTLOAD_OVER_DAYS_FEE', header: '起运港箱使费/天', width: 100 }, { sortable: true, dataIndex: 'PORTLOAD_OVER_DAYS_AMT', header: '起运港箱使费', width: 100 }, { sortable: true, dataIndex: 'DESTPORT_FREE_DAYS', header: '目的港免箱使天数', width: 100 }, { sortable: true, dataIndex: 'DESTPORT_OVER_DAYS', header: '目的港超期天数', width: 100 }, { sortable: true, dataIndex: 'DESTPORT_OVER_DAYS_FEE', header: '目的港箱使费/天', width: 100 }, { sortable: true, dataIndex: 'DESTPORT_OVER_DAYS_AMT', header: '目的港箱使费', width: 100 }, { sortable: true, dataIndex: 'BOOKGOODNAME', header: '订舱品名', width: 100 }, { sortable: true, dataIndex: 'CUSTOMGOODNAME', header: '报关品名', width: 100 }, { sortable: true, dataIndex: 'TRUCKNAME', header: '录车队', width: 100 }, { sortable: true, dataIndex: 'INPUTBYREF', header: '录入人', width: 100 }, { sortable: true, dataIndex: 'INPUTTIME', header: '录入时间', width: 100 } ]; this.girdcolums = this.initgirdcolums; this.gridBillList = new Ext.grid.GridPanel({ store: this.storeBillList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, 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: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有要审核的数据" }), this.Pagenum] }); this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列 this.gridBillList.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.OpenEditWin(record); // DsOpenEditWin("/TruckMng/MsWlPc/Edit"); }, this); //#region formSearch //#region formSearch 查询面板 _this = this; //客户加载_委托单位 this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); //委托单位 _this = this; this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '委托单位', store: this.storeCustCode, forceSelection: true, name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.formSearch = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [{//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '箱号', name: 'CTNNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '编号', name: 'BSNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxCustCode, { fieldLabel: '开船日期', format: 'Y-m-d', xtype: 'datefield', name: 'ETDbgn', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到', format: 'Y-m-d', xtype: 'datefield', name: 'ETDend', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { xtype: 'button', width: 90, text: "执行查询", iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); }, scope: this }, { xtype: 'button', width: 90, text: "高级查询", iconCls: "btnmore", handler: function (button, event) { var sql = this.getCondition(); var winAccess = new Shipping.DsQuery({ }); winAccess.StoreList = this.storeList; winAccess.formname = this.formname; winAccess.condition = sql; winAccess.show(); return; }, scope: this }] } ]//end items(fieldset 1) }]//end root items }); //#endregion formSearch //查询工具条 this.CheckAll = new Ext.form.Checkbox({ fieldLabel: '仅需审核业务', checked: true, width: 120 }); this.CheckFeeAll = new Ext.form.Checkbox({ fieldLabel: '费用明细仅显示待审核', labelWidth: 130, checked: false, width: 150 }); _this = this; this.SearchBtn = new Ext.Button({ text: '显示查询', handler: function () { if (_this.SearchBtn.text == '隐藏查询') { _this.panelSearch.hide(); _this.SearchBtn.setText("显示查询"); } else { _this.panelSearch.show(); _this.SearchBtn.setText("隐藏查询"); } } }); this.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: '费用查看范围', store: this.storeAddDCType, valueField: 'DC', displayField: 'NAME', forceSelection: true, name: 'DC', value: '0' }); this.panelBtn = new Ext.Panel({ region: "north", tbar: [ this.SearchBtn, '-', { xtype: 'button', text: '刷新', iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); var isvisible = true; var issavevalue = false; if (_this.SearchBtn.text == '隐藏查询') isvisible = true else isvisible = false; if (this.CheckSaveQuery.checked) issavevalue = true saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue); }, scope: this }, '-', { text: "批量审核", id: "btnBsLock", menu: [ { text: "所选业务审核", handler: function (menu, event) { _this.onSelAuditClick(menu, event); } }, { text: "全部业务审核", handler: function (menu, event) { _this.onAllAuditClick(menu, event); } }], scope: this }, '-', this.CheckAll, '-', this.CheckFeeAll, '-', //this.CheckSaveQuery, '-', { text: "导出Excel", id: "btnExportExcel", iconCls: 'btnexcel', handler: function (button, event) { this.onExportClick(button, event); }, scope: this }, { text: "打开", iconCls: "btnright", id: "OPEN", handler: function (button, event) { this.onOpenClick(button, event); }, scope: this }, '-' , { text: "保存列表样式", id: "btntest", menu: [ { text: "保存", handler: function (button, event) { this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridBillList.columns, _this.girdcolums, 1, true); } }, { text: "初始化", 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 } ] }); //#region 申请修改 this.NewFeeShowDr = Ext.widget('form', { frame: true, region: 'east', hidden: true, title: '费用修改新值', width: 600, 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: '费用名称', readOnly: true, name: 'FeeName' }, { fieldLabel: '费用对象', readOnly: true, name: 'CustomerName' }, { fieldLabel: '单位标准', readOnly: true, name: 'Unit' }, { fieldLabel: '不含税价', readOnly: true, name: 'UnitPrice' }, { fieldLabel: '税率', readOnly: true, name: 'TaxRate' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '含税单价', readOnly: true, name: 'TaxUnitPrice' },{ fieldLabel: '计费数量', readOnly: true, name: 'Quantity' }, { fieldLabel: '不含税额', readOnly: true, name: 'NoTaxAmount' }, { fieldLabel: '含税金额', readOnly: true, name: 'Amount' }, { fieldLabel: '币别', labelWidth: 40, readOnly: true, name: 'Currency' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: '汇率', labelWidth: 40, readOnly: true, name: 'ExChangerate' }, { fieldLabel: '财务税率', labelWidth: 40, readOnly: true, name: 'AccTaxRate' }, { fieldLabel: '是否垫付', labelWidth: 40, readOnly: true, name: 'IsAdvancedpay' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '修改原因', readOnly: true, flex: 1, name: 'Reason' },{ fieldLabel: '备注', flex: 1, labelWidth: 40, readOnly: true, name: 'Remark' }] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); this.NewFeeShowCr = Ext.widget('form', { frame: true, region: 'east', hidden: true, title: '费用修改新值', width: 600, 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: '费用名称', readOnly: true, name: 'FeeName' }, { fieldLabel: '费用对象', readOnly: true, name: 'CustomerName' }, { fieldLabel: '单位标准', readOnly: true, name: 'Unit' }, { fieldLabel: '不含税价', readOnly: true, name: 'UnitPrice' }, { fieldLabel: '税率', readOnly: true, name: 'TaxRate' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '含税单价', readOnly: true, name: 'TaxUnitPrice' },{ fieldLabel: '计费数量', readOnly: true, name: 'Quantity' }, { fieldLabel: '不含税额', readOnly: true, name: 'NoTaxAmount' }, { fieldLabel: '含税金额', readOnly: true, name: 'Amount' }, { fieldLabel: '币别', labelWidth: 40, readOnly: true, name: 'Currency' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: '汇率', labelWidth: 40, readOnly: true, name: 'ExChangerate' }, { fieldLabel: '财务税率', labelWidth: 40, readOnly: true, name: 'AccTaxRate' }, { fieldLabel: '是否垫付', labelWidth: 40, readOnly: true, name: 'IsAdvancedpay' }, { fieldLabel: '修改原因', readOnly: true, name: 'Reason' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '备注', flex: 1, labelWidth: 40, readOnly: true, name: 'Remark' }] } ]//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: 45, 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%', frame: true, split:true, items: [this.gridCrChFee, this.NewFeeShowCr] }); this.panelFee = new Ext.Panel({ // title: '费用信息', // layout: "border", layout: "anchor", split: true, // region: 'north', // height: 560, region: 'center', items: [ this.panelDrChFee, this.panelCrChFee ] }); //#region 布局 Ext.apply(this, { split: true, 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.sqlcontext }); }, 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; 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)); 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); } }, this); this.gridCrChFee.getSelectionModel().on('select', function (model, record, index) { var FeeStatus = record.data.FeeStatus; var GId = record.data.GId; 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)); 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); } }, this); // 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.GID; var optype = 'OpCtnBsCard'; this.stroplb = 'OpCtnBsCard'; this.strBSNO = record.data.GID; this.FeeStatus = '0'; var isAll = '3'; if (this.CheckFeeAll.checked) isAll = '1' else isAll = '0' // isAll = this.comboxaddDCType.getValue(); this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: this.stroplb, isAll: isAll} }); this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: this.stroplb, 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 // }); this.storeBodySum.load({ params: { bsno: bsno }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); this.storeChFeeGain.load({ params: { bsno: bsno} }); }, this); this.InitData(); LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery); this.gridBillList.reconfigure(this.storeBillList, this.girdcolums); }, //end initUIComponents //#region 加载数据 InitData: function () { var condition = ''; /* if (this.ParentPanel) { var ret = this.ParentPanel.OprationSwap(); this.opStatus = ret[0]; this.StoreList = ret[1]; this.editRecord = ret[2]; this.RefBillNo = ret[3]; } */ this.panelSearch.hide(); this.LoadData(this.opStatus, condition, this.RefBillNo); }, //end InitData LoadData: function (opstatus, condition, refbillno) { this.feeCrSerialNo = 0; this.feeCrBodyDel = []; this.feeCrSerialNo = 0; this.feeCrBodyDel = []; this.opStatus = opstatus; this.PageSize = this.Pagenum.getValue(); this.storeBillList.pageSize = this.PageSize; this.BillSql = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID left join workflow_step st " + " on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) where b.GID=ch_fee.BSNO " + " 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)) "; if (this.isotheropen()) { BSNO = getUrlParam("BSNO"); this.BillSql = " APPLYNO=(select APPLYNO from v_op_bs where BSNO='" + BSNO + "') "; //this.panelBtn.hide(); this.setSaveBtnStatus(false); } // this.BillSql = " EXISTS (select 1 from ch_fee where b.GID=ch_fee.BSNO and FEESTATUS in (2,3,4) ) "; _this = this; this.sqlcontext = this.BillSql; this.storeBillList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql }, waitMsg: "正在查询数据...", 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} }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll} }); _this.storeBodySum.load({ params: { bsno: bsno }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno} }); // _this.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 == '人民币') { rmbdr = memberyf.data.DR; rmbcr = memberyf.data.CR; rmbprofit = memberyf.data.PR; } else if (memberyf.data.CURR == '美元') { 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 rmblb = ""; var usdlb = ""; var otlb = ""; var ttllb = ""; if (rmbdr != 0 || rmbcr != 0 || rmbprofit != 0) { rmblb = "   RMB应收:" + returnfloat(rmbdr) + "    RMB应付: " + returnfloat(rmbcr) + "   RMB利润:" + returnfloat(rmbprofit) + "   |"; } if (usddr != 0 || usdcr != 0 || usdprofit != 0) { usdlb = "   USD应收: " + returnfloat(usddr) + "   USD应付:" + returnfloat(usdcr) + "   USD利润" + returnfloat(usdprofit) + "   |"; } if (otdr != 0 || otcr != 0 || otprofit != 0) { otlb = "   其他币别应收: " + returnfloat(otdr) + "    其他币别应付:" + returnfloat(otcr) + "   其他币别利润" + returnfloat(otprofit) + "   |"; } if (ttldr != 0 || ttlcr != 0 || ttlprofit != 0) { ttllb = "   合计应收: " + returnfloat(ttldr) + "   合计应付:" + returnfloat(ttlcr) + "   合计利润" + returnfloat(ttlprofit) + "  利润率" + returnfloat(profitrate) + ""; } this.tabTotal.setTitle("利润合计:" + rmblb + usdlb + otlb + ttllb); }, //#endregion //#region 明细操作 onRefreshClick: function (button, event) { // var girdcolums = this.gridList.getColumnMode(); this.BillSql = this.getCondition(); _this = this; this.PageSize = this.Pagenum.getValue(); this.storeBillList.pageSize = this.PageSize; this.sqlcontext = this.BillSql; this.storeBillList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql }, waitMsg: "正在查询数据...", 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} }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll} }); _this.storeBodySum.load({ params: { bsno: bsno }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno} }); } } }, scope: this }); }, onDsQuery: function () { //var girdcolums = this.gridList.getColumnMode(); this.PageSize = this.Pagenum.getValue(); this.storeBillList.pageSize = this.PageSize; var sql = this.sqlcontext; this.storeBillList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: sql }, waitMsg: "正在查询数据...", 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} }); _this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll} }); _this.storeBodySum.load({ params: { bsno: bsno }, callback: function (r, options, success) { if (success) { _this.setTotalHead(); } } }); _this.storeChFeeGain.load({ params: { bsno: bsno} }); } } }, scope: this }); }, CheckChange: function (field, newValue, oldValue, eOpts) { this.onRefreshClick(); }, onAuditNewClick: 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: '提示', msg: '请先选择要审核的费用!', 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: '提示', msg: '只能费用状态为[提交审核]的费用才能审核通过', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (IsAudit == 0) { Ext.Msg.show({ title: '提示', msg: '你没有审核此费用的权限!', 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 { Ext.Ajax.request({ waitMsg: '正在审核...', url: '/Account/Chfee_Audit/Audit', params: { optype: _this.stroplb, bill: GidStr }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { if (type == 1) { _this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} }); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} }); } Ext.Ajax.request({ waitMsg: '正在提交数据...', 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('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onAuditBackNewClick: function (button, event, type) { if (this.FeeStatus == true) { Ext.Msg.show({ title: '提示', msg: '此票业务已锁定,不允许驳回!', 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: '提示', msg: '请先选择要驳回的费用!', 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: '提示', msg: '只能费用状态为[提交审核]或[审核通过]的费用才能驳回提交', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } if (rec.data.Settlement != 0) { canAudit = false; Ext.Msg.show({ title: '提示', msg: '当前费用已结算无法驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (rec.data.Invoice != 0) { canAudit = false; Ext.Msg.show({ title: '提示', msg: '当前费用已开出发票无法驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (rec.data.OrderAmount != 0) { canAudit = false; Ext.Msg.show({ title: '提示', msg: '当前费用已申请费用无法驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (rec.data.OrderInvoice != 0) { canAudit = false; Ext.Msg.show({ title: '提示', msg: '当前费用已申请开票无法驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } if (canAudit == false) { } else { if (IsAudit == -1) { Ext.Msg.show({ title: '提示', msg: '你没有审核此费用的权限!', 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: '确认驳回', msg: '请输入驳回原因:', width: 300, buttons: Ext.MessageBox.OKCANCEL, multiline: true, fn: function (btn, text) { if (btn == "ok") { Ext.Ajax.request({ waitMsg: '正在驳回提交...', url: '/Account/Chfee_Audit/AuditBack', params: { optype: _this.stroplb, bill: jsonbodyAddDatas, reasean: text, isamend:'0' }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { if (type == 1) { _this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} }); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} }); } _this.UpListStatus(_this.strBSNO); } } else { Ext.MessageBox.alert('请求出现错误,请重试', 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: '提示', msg: '请先选择要禁开发票的费用!', 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 (Settlement != 0 || Invoice != 0 || Invoice != 0) { Ext.Msg.show({ title: '提示', msg: '已结算或开出发票及申请开票后,不允许修改是否开票状态!', 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: '正在提交数据...', 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: '提示', 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} }); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} }); } } } else { Ext.MessageBox.alert('请求出现错误,请重试', 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: '提示', msg: '请先选择要解禁开发票的费用!', 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 (Settlement != 0 || Invoice != 0 || Invoice != 0) { Ext.Msg.show({ title: '提示', msg: '已结算或开出发票及申请开票后,不允许修改是否开票状态!', 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: '正在提交数据...', 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: '提示', 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} }); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} }); } } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onAuditShenClick: function (button, event, type) { if (this.FeeStatus == true) { Ext.Msg.show({ title: '提示', msg: '此票业务已锁定,不允许驳回!', 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: '提示', msg: '请先选择要批准申请的费用!', 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: '提示', msg: '只能费用状态为[申请修改]或[申请删除]的费用才能审核通过', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } else { if (IsAudit == 0) { Ext.Msg.show({ title: '提示', msg: '你没有批准此费用的权限!', 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: '正在审核...', url: '/Account/Chfee_Audit/AuditShenNew', params: { optype: _this.stroplb, bill: jsonbodyAddDatas }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: '提示', msg: "费用批准成功!", 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} }); this.NewFeeShowDr.setVisible(false); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} }); this.NewFeeShowCr.setVisible(false); } this.UpListStatus(_this.strBSNO); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onAuditBackShenClick: function (button, event, type) { if (this.FeeStatus == true) { Ext.Msg.show({ title: '提示', msg: '此票业务已锁定,不允许驳回!', 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: '提示', msg: '请先选择要驳回申请的费用!', 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: '提示', msg: '只能费用状态为[申请修改]或[申请删除]的费用才能驳回提交', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } if (canAudit == false) { } else { if (IsAudit == 0) { Ext.Msg.show({ title: '提示', msg: '你没有批驳回此费用的权限!', 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: '确认驳回', msg: '请输入驳回原因:', width: 300, buttons: Ext.MessageBox.OKCANCEL, multiline: true, fn: function (btn, text) { if (btn == "ok") { Ext.Ajax.request({ waitMsg: '正在驳回提交...', url: '/Account/Chfee_Audit/AuditBackShen', params: { optype: _this.stroplb, bill: jsonbodyAddDatas, reasean: text, isamend:'0' }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: '提示', msg: "驳回申请成功!", 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} }); this.NewFeeShowDr.setVisible(false); } else { _this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} }); this.NewFeeShowCr.setVisible(false); } this.UpListStatus(_this.strBSNO); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } } }); } }, UpListStatus: function (bsno) { Ext.Ajax.request({ waitMsg: '正在查询主表数据...', 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: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } var data = result.data; for (i = 0; i < this.storeBillList.getCount(); i += 1) { var memberyf = this.storeBillList.getAt(i); if (memberyf.data.BSNO == bsno) { memberyf.data.DRFEESTATUS = data.DRFEESTATUS; memberyf.data.CRFEESTATUS = data.CRFEESTATUS; memberyf.data.FEESTATUS = data.FEESTATUS; memberyf.data.FEESTATUSREF = data.FEESTATUSREF; memberyf.commit(); } }; } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, onViewDetailClick: function (button, event, type) { var openSet = "height=540, width=890, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 540) / 2 + ",Left= " + (screen.width - 890) / 2 var openType = "_blank"; //打开费用“历史信息查询”页面 var openUrl = "../../Shipping/FeeHistory.aspx?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type; window.open(openUrl, openType, openSet); }, getAllowOperationDetail: function () { var feeStatus = 0; if (feeStatus == '0' || feeStatus == false || feeStatus == 'false') return true; else { Ext.Msg.show({ title: '错误', msg: "此票委托已费用已锁定,不允许操作费用!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return false; } }, //#endregion onSelAuditClick: function (menu, event) { var GidStr = ''; var records = this.AddGridCheckBoxModel.selected.items; if (records.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择要审核的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bodyAddDatas = []; for (var i = 0; i < records.length; i++) { var rec = records[i]; bodyAddDatas.push(rec); } if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: '提示', msg: '没有要锁定的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Msg.wait('正在审核...'); Ext.Ajax.request({ waitMsg: '正在锁定...', url: '/Account/Chfee_Audit/SelCtnBsCardAudit', params: { data: jsonbodyAddDatas }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.onRefreshClick(); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onAllAuditClick: function (menu, event) { if (this.storeBillList.length == 0) { Ext.Msg.show({ title: '提示', msg: '没有业务需审核,请首先检索需审核的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } _this = this; Ext.Msg.wait('正在审核...'); Ext.Ajax.request({ waitMsg: '正在锁定...', url: '/Account/Chfee_Audit/AllCtnBscardAudit', params: { condition: _this.BillSql }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.onRefreshClick(); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, OprationSwap: function () { var ret = new Array(); ret[0] = this.OprationStatus; ret[1] = this.storeBillList; ret[2] = this.SelectedRecord; return ret; }, getFeeStatus: function () { var feeStatus = this.EditRecord.get('FEESTATUS'); return feeStatus; }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); }, //onClearClick getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; // var StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where b.GID=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0 and (wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeOpOpOtherRecvPayAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeOpOtherModifyAudit',ch_fee.GID) ) )"; StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID left join workflow_step st " + " on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) where b.GID=ch_fee.BSNO " + " 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)) "; if (this.DataLoading) { return StrAudit } var BSNO = form.findField('BSNO').getValue(); // sql = sql + getAndConSql(sql, BSNO, " (BSNO like '%" + BSNO + "%' or CUSTNO like '%" + BSNO + "%' or I_CUSTNO like '%" + BSNO + "%' or MBLNO like '%" + BSNO + "%' ) "); sql = sql + getAndConSql(sql, BSNO, " (BSNO like '%" + BSNO + "%' ) "); var CTNNO = form.findField('CTNNO').getValue(); sql = sql + getAndConSql(sql, CTNNO, "CTNNO like '%" + CTNNO + "%'"); var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue(); sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'"); var expDateBgn = form.findField('ETDbgn').getRawValue(); sql = sql + getAndConSql(sql, expDateBgn, "ETD>='" + expDateBgn + "'"); var expDateEnd = form.findField('ETDend').getRawValue(); sql = sql + getAndConSql(sql, expDateEnd, "ETD<='" + expDateEnd + " 23:59:59'"); if (this.CheckAll.checked) { sql = sql + getAndConSql(sql, StrAudit, StrAudit); }; return sql; }, getFeeCondition: function () { var form = this.formSearch.getForm(); var feesql = ' '; var CUSTNAME = form.findField('CUSTNAME').getValue(); feesql = feesql + getAndConSql(feesql, CUSTNAME, "f.CUSTOMERNAME='" + CUSTNAME + "'"); return feesql; }, setSaveBtnStatus: function (enable) { var drbtn1 = Ext.getCmp("drbtn1"); var drbtn2 = Ext.getCmp("drbtn2"); var drbtn3 = Ext.getCmp("drbtn3"); var drbtn4 = Ext.getCmp("drbtn4"); var drbtn5 = Ext.getCmp("drbtn5"); var drbtn6 = Ext.getCmp("drbtn6"); var drbtn7 = Ext.getCmp("drbtn7"); var drbtn8 = Ext.getCmp("drbtn8"); var crbtn1 = Ext.getCmp("crbtn1"); var crbtn2 = Ext.getCmp("crbtn2"); var crbtn3 = Ext.getCmp("crbtn3"); var crbtn4 = Ext.getCmp("crbtn4"); var crbtn5 = Ext.getCmp("crbtn5"); var crbtn6 = Ext.getCmp("crbtn6"); var crbtn7 = Ext.getCmp("crbtn7"); var crbtn8 = Ext.getCmp("crbtn8"); var btnBsLock = Ext.getCmp("btnBsLock"); if (enable) { //bsbtnSave.enable(); //bsbtnSaveAndClose.enable(); //bsbtnSaveAndNew.enable(); //drbtn1.enable(); } else { drbtn1.disable(); drbtn2.disable(); drbtn3.disable(); drbtn4.disable(); drbtn5.disable(); drbtn6.disable(); drbtn7.disable(); drbtn8.disable(); crbtn1.disable(); crbtn2.disable(); crbtn3.disable(); crbtn4.disable(); crbtn5.disable(); crbtn6.disable(); crbtn7.disable(); crbtn8.disable(); btnBsLock.disable(); } } , //#region 导出Excel onExportClick: function (button, event) { GridExportExcelPage(this.gridBillList, "业务卡费用审核"); }, //#endregion onOpenClick: function (button, event) { var selections = this.gridBillList.getSelectionModel().getSelection(); if (selections.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } record = selections[0]; this.OpenEditWin(record); } , OpenEditWin: function (record) { this.SelectedRecord = record; this.OprationStatus = 'edit'; DsOpenEditWin('/MvcContainer/MsOpCtnBsCard/CtnStatusEdit', record.data.GID); } , isotheropen: function () { if (isNullorEmpty(this.opener())) return false; return true; } , opener: function () { return this.openertype; } });