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/MsRptCwFunds/MsRptCwFundsIndex.js

979 lines
34 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.MsRptCwFundsIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptCwFundsIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptCwFundsIndex, 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 = 'MsRptCwFundsIndex';
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: 'GID', type: 'string' },
{ name: 'BILLDATE', type: 'string' },
{ name: 'BILLNO', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'FEENAME', type: 'string' },
{ name: 'ACCOUNT', type: 'string' },
{ name: 'ACCOUNTREF', type: 'string' },
{ name: 'FEETYPE', type: 'string' },
{ name: 'BILLTYPE', type: 'string' },
{ name: 'SETTLEUSER', type: 'string' },
{ name: 'SETTLETIME', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'EXCHANGERATE', type: 'number' },
{ name: 'DR', type: 'number' },
{ name: 'CR', type: 'number' },
{ name: 'AMOUNTDR', type: 'number' },
{ name: 'AMOUNTCR', type: 'number' },
{ name: 'BALANCE', type: 'number' },
{ name: 'BALANCEHKD', type: 'number' },
{ name: 'AMOUNTUSDDR', type: 'number' },
{ name: 'AMOUNTUSDCR', type: 'number' },
{ name: 'BALANCEUSD', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptCwFunds/ListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BILLDATE',
header: '发生日期',
width: 80
}, {
sortable: true,
dataIndex: 'BILLNO',
header: '单据号码',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '客户名称',
width: 110
}, {
sortable: true,
dataIndex: 'FEENAME',
header: '费用科目',
width: 110
}, {
sortable: true,
dataIndex: 'FEETYPE',
header: '收付',
width: 30
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: '币别',
width: 40
}, {
sortable: true,
dataIndex: 'ACCOUNTREF',
header: '银行账户',
width: 150
}, {
sortable: true,
dataIndex: 'REMARK',
header: '说明',
width: 150
}, {
sortable: true,
dataIndex: 'DR',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'CR',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'EXCHANGERATE',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}
// , {
// sortable: true,
// dataIndex: 'BALANCE',
// 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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
// align: 'right',
// width: 100
// }, {
// sortable: true,
// dataIndex: 'BALANCEUSD',
// 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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
// align: 'right',
// width: 100
// }, {
// sortable: true,
// dataIndex: 'BALANCEHKD',
// 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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
// align: 'right',
// width: 100
// }
];
// 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: "数据加载中,请稍等..." },
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: '当前显示 {0} - {1}条记录 /共 {2}条记录',
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: 'BALANCERMB', type: 'number' },
{ name: 'BALANCEHKD', type: 'number' },
{ name: 'BALANCEUSD', type: 'number' },
{ name: 'BALANCETTL', type: 'number' },
{ name: 'NODRTTL', type: 'number' },
{ name: 'NOCRTTL', type: 'number' },
{ name: 'TTL', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptCwFunds/SumListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdsumcolums = [{
sortable: true,
dataIndex: 'BALANCERMB',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'BALANCEUSD',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'BALANCEHKD',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'BALANCETTL',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'NODRTTL',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'NOCRTTL',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 100
}, {
sortable: true,
dataIndex: 'TTL',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 100
}
];
// 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: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdsumcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
//#region formSearch
//#region formSearch枚举参照相关
_this = this;
//#endregion
this.StoreBANK = Ext.create('DsExt.ux.RefTableStore', {
model: 'BANK',
proxy: { url: '/MvcShipping/MsBaseInfo/GetBANKList' }
});
this.StoreBANK.load({ params: { condition: ""} });
this.comboxBANK = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '银行账号',
store: this.StoreBANK,
forceSelection: true,
name: 'ACCOUNT',
valueField: 'GID',
displayField: 'ACCBANKNAME'
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: ""} });
this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '币别',
store: this.StoreCurr,
forceSelection: true,
name: 'CURR',
valueField: 'CURR',
displayField: 'CURR'
});
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: '结算单位',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storeAccitems = Ext.create('DsExt.ux.RefTableStore', {
model: 'Accitemsmb',
proxy: { url: '/CommMng/BasicDataRef/GetMngAccitems' }
});
this.storeAccitems.load({ params: { condition: ""} });
this.comboxAccitems = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '费用科目',
store: this.storeAccitems,
name: 'FEENAME',
valueField: 'ACCNAME',
displayField: 'ACCIDNAME'
});
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: '开始日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '结束日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND',
flex: 1,
value: new Date(),
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxBANK, this.comboxCurr, this.comboxCustCode, this.comboxAccitems
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: '记忆查询条件',
checked: true,
width: 120
});
_this = this;
this.SearchBtn = new Ext.Button({
text: '隐藏查询',
handler: function () {
if (_this.SearchBtn.text == '隐藏查询') {
_this.panelSearch.hide();
_this.SearchBtn.setText("显示查询");
} else {
_this.panelSearch.show();
_this.SearchBtn.setText("隐藏查询");
}
}
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
var isvisible = true;
var issavevalue = false;
if (_this.SearchBtn.text == '隐藏查询')
isvisible = true
else
isvisible = false;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
scope: this
}, '-', this.SearchBtn, {
xtype: 'button',
width: 90,
text: "清空条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, this.CheckSaveQuery, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
menu: [
{ text: "保存列表",
handler: function (button, event) {
_this.onSaveGridClick(button, event);
}
}, { 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: 45,
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: '合 计',
layout: "border",
height: 120,
region: 'south',
margin: '0 0',
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 sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
// LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
}, //end initUIComponents
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
var form = this.formSearch.getForm();
var form = this.formSearch.getForm();
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
// if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) {
// Ext.Msg.alert('提示', '开始业务日期不能为空!');
// return;
// }
// if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) {
// Ext.Msg.alert('提示', '结束业务日期不能为空!');
// return;
// }
// var expDate_Mindate = form.findField('PS_EXPDATEBGN').getValue();
// var expDate_Maxdate = form.findField('PS_EXPDATEEND').getValue();
// if (expDate_Mindate > expDate_Maxdate) {
// Ext.Msg.alert('提示', '业务开始日期不能大于结束日期!');
// return;
// }
var ACCOUNT = form.findField('ACCOUNT').getValue();
// if (ACCOUNT == '' || ACCOUNT == null || ACCOUNT == undefined) {
// Ext.Msg.alert('提示', '银行账户不能为空!');
// return;
// }
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql, startdate: expDate_Min, enddate: expDate_Max, account: ACCOUNT },
waitMsg: "正在查询数据...",
scope: this
});
var sumsql = this.getSumCondition();
var nosumsql = this.getNoSumCondition();
this.storeListSum.load({
params: { condition: sumsql, nocondition: nosumsql },
waitMsg: "正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " BILLDATE>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " BILLDATE<='" + expDate_Max + " 23:59:59'");
var ACCOUNT = form.findField('ACCOUNT').getValue();
sql = sql + getAndConSql(sql, ACCOUNT, "ACCOUNT='" + ACCOUNT + "'");
var CURR = form.findField('CURR').getValue();
sql = sql + getAndConSql(sql, CURR, "CURRENCY='" + CURR + "'");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
var FEENAME = form.findField('FEENAME').getValue();
sql = sql + getAndConSql(sql, FEENAME, "FEENAME='" + FEENAME + "'");
return sql;
},
getSumCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " BILLDATE<='" + expDate_Max + " 23:59:59'");
var ACCOUNT = form.findField('ACCOUNT').getValue();
sql = sql + getAndConSql(sql, ACCOUNT, "ACCOUNT='" + ACCOUNT + "'");
var CURR = form.findField('CURR').getValue();
sql = sql + getAndConSql(sql, CURR, "CURRENCY='" + CURR + "'");
return sql;
},
getNoSumCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " B.OPDATE<='" + expDate_Max + " 23:59:59'");
var ACCOUNT = form.findField('ACCOUNT').getValue();
sql = sql + getAndConSql(sql, ACCOUNT, "1=2");
var CURR = form.findField('CURR').getValue();
sql = sql + getAndConSql(sql, CURR, "1=2");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "1=2");
var FEENAME = form.findField('FEENAME').getValue();
sql = sql + getAndConSql(sql, FEENAME, "1=2");
return sql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return false;
}
return true;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = "MsRptCwFundsIndex";
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) {
GridExportExcelPage(this.gridList);
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var form = this.formSearch.getForm();
var form = this.formSearch.getForm();
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) {
Ext.Msg.alert('提示', '开始业务日期不能为空!');
return;
}
if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) {
Ext.Msg.alert('提示', '结束业务日期不能为空!');
return;
}
var expDate_Mindate = form.findField('PS_EXPDATEBGN').getValue();
var expDate_Maxdate = form.findField('PS_EXPDATEEND').getValue();
if (expDate_Mindate > expDate_Maxdate) {
Ext.Msg.alert('提示', '业务开始日期不能大于结束日期!');
return;
}
var ACCOUNT = form.findField('ACCOUNT').getValue();
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsRptCwFunds/SumListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: _this.sqlcontext,
startdate: expDate_Min,
account: ACCOUNT,
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 = 'MSRPTCWFUNDS';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
});