You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/MsRptCustDrCr/MsRptCustDrCrIndex.js

1481 lines
65 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.MsRptCustDrCrIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptCustDrCrIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptCustDrCrIndex, Ext.Panel, {
PageSize: 2000,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1=2',
bslistsortfield: '',
bslistsortdire: '',
salelistsortfield: '',
salelistsortdire: '',
custlistsortfield: '',
custlistsortdire: '',
oplistsortfield: '',
oplistsortdire: '',
bssourcelistsortfield: '',
bssourcelistsortdire: '',
bssourcedetaillistsortfield: '',
bssourcedetaillistsortdire: '',
initUIComponents: function () {
this.formname = 'MsRptCustDrCrIndex';
Ext.define('Accitemsmb', {
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'GID', type: 'string' },
{ name: 'ACCID', type: 'string' },
{ name: 'ACCNAME', type: 'string' },
{ name: 'ACCIDNAME', type: 'string' },
{ name: 'DC', type: 'string' },
{ name: 'ISFCY', type: 'string' },
{ name: 'REMARKS', type: 'string' },
{ name: 'DETAILED', type: 'string' }
]
});
Ext.define('MsFeeCurr', {
extend: 'Ext.data.Model',
idProperty: 'CURR',
fields: [
{ name: 'CURR', type: 'string' },
{ name: 'DEFRATE', type: 'number' }
]
});
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'ACCYEAR', type: 'string' },
{ name: 'ACCMONTH', type: 'string' },
{ name: 'CUSTNAME', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'UPMONTHDRBAL', type: 'number' },
{ name: 'MONTHDR', type: 'number' },
{ name: 'MONTHDRSTL', type: 'number' },
{ name: 'MONTHDRBAL', type: 'number' },
{ name: 'UPMONTHTTLDRBAL', type: 'number' },
{ name: 'MONTHTTLDR', type: 'number' },
{ name: 'MONTHTTLDRSTL', type: 'number' },
{ name: 'MONTHTTLDRBAL', type: 'number' },
{ name: 'UPMONTHCRBAL', type: 'number' },
{ name: 'MONTHCR', type: 'number' },
{ name: 'MONTHCRSTL', type: 'number' },
{ name: 'MONTHCRBAL', type: 'number' },
{ name: 'UPMONTHTTLCRBAL', type: 'number' },
{ name: 'MONTHTTLCR', type: 'number' },
{ name: 'MONTHTTLCRSTL', type: 'number' },
{ name: 'MONTHTTLCRBAL', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptCustDrCr/CustListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdcolums = [{
sortable: true,
dataIndex: 'ACCYEAR',
text: Zi.LAN.ACCYEAR,
//text: '年',
width: 80
}, {
sortable: true,
dataIndex: 'ACCMONTH',
text: Zi.LAN.ACCMONTH,
//text: '月',
width: 40
}, {
sortable: true,
dataIndex: 'CUSTNAME',
text: Zi.LAN.CUSTNAME,
//text: '委托单位',
width: 110
}, {
sortable: true,
dataIndex: 'CURRENCY',
text: Zi.LAN.CURRENCY,
//text: '币别',
width: 60
}, {
text: Zi.LAN.UPMONTH,
//text: '上月结余',
dataIndex: 'UPMONTH',
columns: [{
sortable: true,
dataIndex: 'UPMONTHDRBAL',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'UPMONTHTTLDRBAL',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'UPMONTHCRBAL',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'UPMONTHTTLCRBAL',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: Zi.LAN.BYFS,
//text: '本月发生',
dataIndex: 'MONTH',
columns: [{
sortable: true,
dataIndex: 'MONTHDR',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLDR',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHCR',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLCR',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: Zi.LAN.MONTHSTL,
//text: '本月结算',
dataIndex: 'MONTHSTL',
columns: [{
sortable: true,
dataIndex: 'MONTHDRSTL',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLDRSTL',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHCRSTL',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLCRSTL',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: Zi.LAN.MONTHBAL,
//text: '本月结余',
dataIndex: 'MONTHBAL',
columns: [{
sortable: true,
dataIndex: 'MONTHDRBAL',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLDRBAL',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHCRBAL',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLCRBAL',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}
];
// this.girdcolums = this.initgirdcolums;
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.initgirdcolums, 1);
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LOADING },//msg: Zi.LAN.LOADING 数据加载中,请稍等...
trackMouseOver: true,
disableSelection: false,
viewConfig: {
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('CURRENCY');
if (feeStatus == 'USD') return 'feestatus_pass';
else if (feeStatus != 'USD' && feeStatus != 'RMB') return 'feestatus_refer';
}
},
columns: this.girdcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: Zi.LAN.displayMsg,//'当前显示 {0} - {1}条记录 /共 {2}条记录'
emptyMsg: Zi.LAN.emptyMsg//"没有数据"
})
});
// this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.girdcolums, 1);
// this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
// var openUrl = "/Account/Chfee_settlement/SettementView";
// if (record.data.BILLTYPE == 'M')
// openUrl = "/Account/Chfee_management/CMView";
// if (record.data.BILLTYPE == 'Y')
// openUrl = "/Import/CWAdvancePayment/Edit";
// window.open(openUrl, openType, openSet);
}, this);
_this = this;
this.storeListSum = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'CURRENCY', type: 'string' },
{ name: 'UPMONTHDRBAL', type: 'number' },
{ name: 'MONTHDR', type: 'number' },
{ name: 'MONTHDRSTL', type: 'number' },
{ name: 'MONTHDRBAL', type: 'number' },
{ name: 'UPMONTHTTLDRBAL', type: 'number' },
{ name: 'MONTHTTLDR', type: 'number' },
{ name: 'MONTHTTLDRSTL', type: 'number' },
{ name: 'MONTHTTLDRBAL', type: 'number' },
{ name: 'UPMONTHCRBAL', type: 'number' },
{ name: 'MONTHCR', type: 'number' },
{ name: 'MONTHCRSTL', type: 'number' },
{ name: 'MONTHCRBAL', type: 'number' },
{ name: 'UPMONTHTTLCRBAL', type: 'number' },
{ name: 'MONTHTTLCR', type: 'number' },
{ name: 'MONTHTTLCRSTL', type: 'number' },
{ name: 'MONTHTTLCRBAL', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptCustDrCr/SumListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdsumcolums = [{
sortable: true,
dataIndex: 'CURRENCY',
text: Zi.LAN.CURRENCY,
//text: '币别',
width: 60
}, {
text: Zi.LAN.UPMONTH,
//text: '上月结余',
dataIndex: 'UPMONTH',
columns: [{
sortable: true,
dataIndex: 'UPMONTHDRBAL',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'UPMONTHTTLDRBAL',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'UPMONTHCRBAL',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'UPMONTHTTLCRBAL',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: Zi.LAN.MONTH,
//text: '本月发生',
dataIndex: 'MONTH',
columns: [{
sortable: true,
dataIndex: 'MONTHDR',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLDR',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHCR',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLCR',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: Zi.LAN.MONTHSTL,
//text: '本月结算',
dataIndex: 'MONTHSTL',
columns: [{
sortable: true,
dataIndex: 'MONTHDRSTL',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLDRSTL',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHCRSTL',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLCRSTL',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}, {
text: Zi.LAN.MONTHBAL,
//text: '本月结余',
dataIndex: 'MONTHBAL',
columns: [{
sortable: true,
dataIndex: 'MONTHDRBAL',
text: Zi.LAN.FeeDr,
//text: '应收',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLDRBAL',
text: Zi.LAN.UPMONTHTTLDRBAL,
//text: '应收合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHCRBAL',
text: Zi.LAN.FeeCr,
//text: '应付',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'MONTHTTLCRBAL',
text: Zi.LAN.UPMONTHTTLCRBAL,
//text: '应付合计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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}]
}
];
// this.girdcolums = this.initgirdcolums;
this.girdsumcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bssum', this.initgirdsumcolums, 1);
this.gridListSum = new Ext.grid.GridPanel({
store: this.storeListSum,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LOADING },//msg: Zi.LAN.LOADING 数据加载中,请稍等...
trackMouseOver: true,
disableSelection: false,
columns: this.girdsumcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
loadMask: { msg: Zi.LAN.LOADING },//msg: Zi.LAN.LOADING 数据加载中,请稍等...
})
});
//#region formSearch
//#region formSearch枚举参照相关
_this = this;
//#endregion
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: ""} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CUSTOMERNAME,
//fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreOpLb.load({ params: { enumTypeId: 96005} });
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PS_OPLB,
//fieldLabel: '业务类型',
store: this.StoreOpLb,
forceSelection: true,
name: 'PS_OPLB',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.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.PS_SALE,
//fieldLabel: '揽货人',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeAddDCType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeAddDCType.add({ "DC": "", "NAME": Zi.LAN.ALL });//"全部"
this.storeAddDCType.add({ "DC": "1", "NAME": Zi.LAN.YingShouFee });//"应收"
this.storeAddDCType.add({ "DC": "2", "NAME": Zi.LAN.YingFuFee });//"应付"
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.DCTYPE,
//fieldLabel: '收付',
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
// labelWidth: 50,
forceSelection: true,
name: 'DC',
enableKeyEvents: true,
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
_this.InitGrid();
}
}
}
});
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.BSSOURCE,
//fieldLabel: '业务来源',
store: this.storeSource,
forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var recs = DsStoreQueryBy(this.storeSource, 'SourceID', records[0].data.SourceID);
if (recs.getCount() > 0) {
var data = recs.getAt(0).data;
var s = "SOURCEID='" + data.SourceID + "'";
this.storeSourceDetail.load({ params: { condition: s} });
} else {
var BSSOURCEDETAIL = this.formSearch.getForm().findField('BSSOURCEDETAIL');
BSSOURCEDETAIL.setValue('');
}
}
}
}
});
Ext.define('SubComp', {
extend: 'Ext.data.Model',
fields: [
{ name: 'GID', type: 'string' },
{ name: 'NAME', type: 'string' },
{ name: 'ENNAME', type: 'string' }
]
});
this.StoreSubComp = Ext.create('DsExt.ux.RefTableStore', {
model: 'SubComp',
proxy: { url: '/MvcShipping/MsBaseInfo/GetCompanyEN' }
});
this.StoreSubComp.load({ params: { condition: ""} });
this.comboxSubComp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SUBCOMP,
//fieldLabel: '所属公司',
store: this.StoreSubComp,
name: 'SUBCOMP',
// flex: 0.5,
// labelWidth: 55,
valueField: 'GID',
displayField: 'NAME',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//所属部门
this.storeDept = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DeptModel',
proxy: { url: '/CommMng/BasicDataRef/GetDeptList' }
});
this.storeDept.load();
this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SALEDEPT,
//fieldLabel: '所属部门', //'所属部门',
store: this.storeDept,
// flex: 0.5,
// labelWidth: 55,
forceSelection: true,
name: 'SALEDEPT',
valueField: 'DeptName',
displayField: 'DeptName'
//,hidden: true
});
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: [
{
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.PS_MONTH,
//fieldLabel: '统计月份',
format: 'Y-m',
xtype: 'monthfield',
name: 'PS_MONTH',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCustCode, this.comboxSalesCode, this.comboxOpLb, this.comboxBSSOURCE, this.comboxSubComp
]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [this.comboxaddDCType, this.comboxDept, {
xtype: 'radiogroup',
fieldLabel: Zi.LAN.分析对象,
//fieldLabel: '分析对象',
id: 'rdOBJNAME',
columns: 6,
vertical: true,
flex: 4,
items: [
{ id: 'rdoCustome', boxLabel: Zi.LAN.CUSTOMERNAME, name: 'OBJNAME', inputValue: 'CUSTOMERNAME', checked: true },//'委托单位'
{ id: 'rdoBsSource', boxLabel: Zi.LAN.BSSOURCE, name: 'OBJNAME', inputValue: 'BSSOURCE' },//'业务来源'
{ id: 'rdoBsSourceDetail', boxLabel: Zi.LAN.BSSOURCEDETAIL, name: 'OBJNAME', inputValue: 'BSSOURCEDETAIL' },//'来源明细'
{ id: 'rdoSale', boxLabel: Zi.LAN.PS_SALE, name: 'OBJNAME', inputValue: 'SALE' },//'揽货人'
{ id: 'rdoBsType', boxLabel: Zi.LAN.ServiceCategory, name: 'OBJNAME', inputValue: 'OPLBNAME' },//'业务类别'
],
listeners: {
change: function (rd, newValue, oldValue, eOpts) {
_this.InitGrid();
}
}
}]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.BLANKFIELD,
//fieldLabel: '记忆查询条件',
checked: true,
width: 120
});
_this = this;
this.SearchBtn = new Ext.Button({
text: Zi.LAN.HideQuery,
//text:'隐藏查询',
handler: function () {
if (_this.SearchBtn.text == Zi.LAN.HideQuery) {//'隐藏查询'
_this.panelSearch.hide();
_this.SearchBtn.setText(Zi.LAN.SearchBtn2);//"显示查询"
} else {
_this.panelSearch.show();
_this.SearchBtn.setText(Zi.LAN.HideQuery);//"隐藏查询"
}
}
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: Zi.LAN.Refresh,
//text:"执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
text: Zi.LAN.btnExportExcel,
//text:"导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-',
{
text: Zi.LAN.btnprint,
//text:"打印",
iconCls: 'btnprint',
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', this.SearchBtn, {
xtype: 'button',
width: 90,
text: Zi.LAN.ClearSql,
//text:"清空条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
text: Zi.LAN.SaveGrid,
//text:"保存列表样式",
id: "btntest",
menu: [
{
text: Zi.LAN.FEESTATUSREF,
//text:"保存列表",
handler: function (button, event) {
_this.onSaveGridClick(button, event);
}
}, {
text: Zi.LAN.FEESTATUSREF,
//text:"列表初始化",
handler: function (button, event) {
_this.oninitGridClick(button, event);
}
}],
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
items: [this.formSearch]
});
this.panelBody = new Ext.Panel({
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [
this.gridList]
});
this.panelSum = new Ext.Panel({
title: Zi.LAN.SUM2 ,//'合 计',
layout: "border",
height: 150,
region: 'south',
margin: '0 0',
split: true,
frame: true,
items: [this.gridListSum]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.panelBody, this.panelSum]
});
this.storeList.on('beforeload', function (store) {
if (!this.checkSearchCondition())
return;
var rdOBJNAME = Ext.getCmp('rdOBJNAME');
var OBJNAME = rdOBJNAME.getValue();
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql, groupfield: OBJNAME });
}, this);
var gcolumns = this.gridList.columns;
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
this.LoadPeriod();
}, //end initUIComponents
InitGrid: function () {
var form = this.formSearch.getForm();
var rdOBJNAME = Ext.getCmp('rdOBJNAME');
var rOBJNAME = rdOBJNAME.getValue();
var DC = form.findField('DC').getValue();
var objnamestr = '委托单位';
var OBJNAME = rOBJNAME.OBJNAME;
if (OBJNAME == 'BSSOURCE') objnamestr = '业务来源'
else if (OBJNAME == 'BSSOURCEDETAIL') objnamestr = '来源明细'
else if (OBJNAME == 'SALE') objnamestr = '来源明细'
else if (OBJNAME == 'OPLBNAME') objnamestr = '业务类别';
var agirdcolums = this.initgirdcolums;
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'CUSTNAME') {
agirdcolums[j].text = objnamestr;
}
if (DC == '1') {
if (agirdcolums[j].dataIndex == 'UPMONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCR') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCR') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDR') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDR') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHSTL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHBAL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
} else if (DC == '2') {
if (agirdcolums[j].dataIndex == 'UPMONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCR') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCR') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDR') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDR') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHSTL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHBAL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
}
}
this.gridList.reconfigure(this.storeList, agirdcolums);
agirdcolums = this.initgirdsumcolums;
for (var j = 0; j < agirdcolums.length; j++) {
if (DC == '1') {
if (agirdcolums[j].dataIndex == 'UPMONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCR') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCR') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDR') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDR') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHSTL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHBAL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
}
}
} else if (DC == '2') {
if (agirdcolums[j].dataIndex == 'UPMONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'UPMONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTH') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCR') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCR') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDR') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDR') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHSTL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRSTL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRSTL') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
if (agirdcolums[j].dataIndex == 'MONTHBAL') {
for (var m = 0; m < agirdcolums[j].columns.length; m++) {
if (agirdcolums[j].columns[m].dataIndex == 'MONTHCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLCRBAL') {
agirdcolums[j].columns[m].hidden = false;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
if (agirdcolums[j].columns[m].dataIndex == 'MONTHTTLDRBAL') {
agirdcolums[j].columns[m].hidden = true;
}
}
}
}
}
this.gridListSum.reconfigure(this.storeListSum, agirdcolums);
this.onRefreshClick();
},
LoadPeriod: function (opstatus) {
Ext.Ajax.request({
waitMsg: Zi.LAN.OnSelect,//'正在查询主表数据...',
url: '/Account/ChMonthClose/GetNowPeriod',
params: {
condition: ''
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
this.formSearch.getForm().findField('PS_MONTH').setValue(data.CLOSEPERIOD);
this.onRefreshClick();
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);//'请求出现错误,请重试'
}
},
scope: this
});
},
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
var form = this.formSearch.getForm();
var PS_MONTH = form.findField('PS_MONTH').getRawValue();
if (PS_MONTH == '' || PS_MONTH == null || PS_MONTH == undefined) {
Ext.Msg.alert(Zi.LAN.TiShi, Zi.LAN.PS_MONTH+" "+Zi.LAN.NoNull);
return;
}
var rdOBJNAME = Ext.getCmp('rdOBJNAME');
var OBJNAME = rdOBJNAME.getValue();
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql, groupfield: OBJNAME },
waitMsg: Zi.LAN.NowSelect,//"正在查询数据...",
scope: this
});
this.storeListSum.load({
params: { condition: sql },
waitMsg: Zi.LAN.NowSelect,//"正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
var PS_MONTH = form.findField('PS_MONTH').getRawValue();
var myDate = new Date(PS_MONTH + '-01');
var myyear = myDate.getFullYear();
var mymonth = myDate.getMonth();
var mymonth = Add(mymonth, 1);
sql = sql + getAndConSql(sql, myyear, " YEAR='" + myyear + "'");
sql = sql + getAndConSql(sql, mymonth, " MONTH='" + mymonth + "'");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
var SALE = form.findField('PS_SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "SALE='" + SALE + "'");
var SALEDEPT = form.findField('SALEDEPT').getValue();
sql = sql + getAndConSql(sql, SALEDEPT, "SALEDEPT='" + SALEDEPT + "'");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "OPLBNAME='" + OPLB + "'");
var SUBCOMP = form.findField('SUBCOMP').getValue();
sql = sql + getAndConSql(sql, SUBCOMP, "CORPID='" + SUBCOMP + "'");
var BSSOURCE = form.findField('BSSOURCE').getValue();
sql = sql + getAndConSql(sql, BSSOURCE, "BSSOURCE='" + BSSOURCE + "'");
var DC = form.findField('DC').getValue();
if (DC == '1') {
sql = sql + ' and (UPMONTHDRBAL<>0 or MONTHDR<>0 or MONTHDRSTL<>0 or MONTHDRBAL<>0 or UPMONTHTTLDRBAL<>0 or MONTHTTLDR<>0 or MONTHTTLDRSTL<>0 or MONTHTTLDRBAL<>0) ';
}
if (DC == '2') {
sql = sql + ' and (UPMONTHCRBAL<>0 or MONTHCR<>0 or MONTHCRSTL<>0 or MONTHCRBAL<>0 or UPMONTHTTLCRBAL<>0 or MONTHTTLCR<>0 or MONTHTTLCRSTL<>0 or MONTHTTLCRBAL<>0) ';
}
return sql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert(Zi.LAN.TiShi, Zi.LAN.SelectConditionValError);//'查询条件赋值错误,请检查。
return false;
}
return true;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = "MsRptCustDrCrIndex";
return ret;
},
onSaveGridClick: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.girdcolums, 1, true);
},
oninitGridClick: function (button, event) {
var agirdcolums = this.initgirdcolums;
this.gridList.reconfigure(this.storeList, agirdcolums);
this.girdcolums = DsTruck.SaveGridPanel(USERID, this.formname + 'bs', this.gridList.columns, this.initgirdcolums, 1, true);
},
onExportClick: function (button, event) {
grid2Excel(this.gridList, '应收应付总账');//'应收应付总账'
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var form = this.formSearch.getForm();
var PS_MONTH = form.findField('PS_MONTH').getRawValue();
if (PS_MONTH == '' || PS_MONTH == null || PS_MONTH == undefined) {
Ext.Msg.alert(Zi.LAN.TiShi, Zi.LAN.PS_MONTH+" "+Zi.LAN.NoNull);
//Ext.Msg.alert('提示', '统计月份不能为空!');
return;
}
var rdOBJNAME = Ext.getCmp('rdOBJNAME');
var ROBJNAME = rdOBJNAME.getValue();
var OBJNAME = ROBJNAME.OBJNAME;
Ext.Msg.wait(Zi.LAN.HandlingDataAndWait);//'正在组织数据, 请稍侯..'
Ext.Ajax.request({
waitMsg: Zi.LAN.HandlingData,//'正在组织数据...'
url: '/MvcShipping/MsRptCustDrCr/CustListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: _this.sqlcontext,
groupfield: OBJNAME,
printstr: 'true'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.Data;
var printType = 'MSRPTCUSTDRCR';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: Zi.LAN.E, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.Retry ,
msg: Zi.LAN.ServerResponseError,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
});