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/MsRptCwBaoXiao/MsRptCwBaoXiaoIndex.js

1011 lines
36 KiB
JavaScript

3 years ago

Ext.namespace('Shipping');
Shipping.MsRptCwBaoXiaoIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptCwBaoXiaoIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptCwBaoXiaoIndex, 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 = 'MsRptCwBaoXiaoIndex';
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' }
]
});
Ext.define('MsCompanysEntity', {
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'GID', type: 'string' }, //GID
{ name: 'CODENAME', type: 'string' }, //CODENAME
{ name: 'NAME', type: 'string' }, //NAME
{ name: 'FULLNAME', type: 'string' }, //FULLNAME
{ name: 'ENNAME', type: 'string' }, //公司英文名称
{ name: 'ADDRESS', type: 'string' }, //ADDRESS
{ name: 'ENADDRESS', type: 'string' }, //公司英文地址
{ name: 'POSTCODE', type: 'string' }, //POSTCODE
{ name: 'OFFICEPHONE', type: 'string' }, //OFFICEPHONE
{ name: 'FAX', type: 'string' }, //FAX
{ name: 'EMAIL', type: 'string' }, //EMAIL
{ name: 'WEBSITEURL', type: 'string' }, //WEBSITEURL
{ name: 'LICENSECODE', type: 'string' }, //LICENSECODE
{ name: 'TAXCODE', type: 'string' }, //TAXCODE
//{name: 'LOGO', type: 'byte[]' }, //徽标
{ name: 'CREATEUSER', type: 'string' }, //CREATEUSER
{ name: 'CREATETIME', type: 'DateTime' }, //CREATETIME
{ name: 'MODIFIEDUSER', type: 'string' }, //更新人gid
{ name: 'MODIFIEDTIME', type: 'DateTime' }, //更新时间
{ name: 'ISDELETED', type: 'bool' }, //ISDELETED
{ name: 'ISDISABLE', type: 'bool' }, //ISDISABLE
{ name: 'PARENTID', type: 'string' }, //PARENTID
{ name: 'BILLRISES', type: 'string' }, //发票抬头
{ name: 'CHEQUEPAYABLE', type: 'string' }, //支票抬头
{ name: 'PRTHEADXML1', type: 'string' }, //打印抬头1
{ name: 'PRTHEADXML2', type: 'string' }, //打印抬头2
{ name: 'PRTHEADXML3', type: 'string' }, //打印抬头3
{ name: 'PRTHEADXML4', type: 'string' }, //打印抬头4
{ name: 'PRTHEADXML5', type: 'string' }, //打印抬头5
{ name: 'BANKSHEAD', type: 'string' }, //BANKSHEAD
{ name: 'LOCALCURR', type: 'string' }, //本地货币
{ name: 'WORKFLOWMSG', type: 'string' }, //是否启用消息提示
{ name: 'GPSUSER', type: 'string' }, //GPSUser
{ name: 'GPSPASSWORD', type: 'string' }, //GPSPassWord
{ name: 'ORGANIZATIONCODE', type: 'string' },
{ name: 'MODIFIEDUSERNAME', type: 'string' },
{ name: 'DBNAME', type: 'string' },
{ name: 'LOGOURL', type: 'string' }
]
});
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'GID', type: 'string' },
{ name: 'ENTERDATE', type: 'string' },
{ name: 'OPTYPE', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'REASON', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'AMOUNTDR', 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/MsRptCwBaoXiao/ListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdcolums = [{
sortable: true,
dataIndex: 'ENTERDATE',
header: '发生日期',
width: 80
}, {
sortable: true,
dataIndex: 'OPTYPE',
header: '单据类型',
width: 120
}, {
sortable: true,
dataIndex: 'GID',
header: '单据号码',
width: 120
}, {
sortable: true,
dataIndex: 'OP',
header: '借款人',
width: 110
}, {
sortable: true,
dataIndex: 'REASON',
header: '借款类型',
width: 110
}, {
sortable: true,
dataIndex: 'JKTYPE',
header: '借款方式',
width: 110
}, {
sortable: true,
dataIndex: 'REMARK',
header: '说明',
width: 150
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: '币别',
width: 40
}, {
sortable: true,
dataIndex: 'AMOUNTDR',
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: '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.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.storeOpCode3 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.storeOpCode3.load();
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '借款人', //'操 作',
store: this.storeOpCode3,
forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.storeREASON = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeREASON.load({ params: { enumTypeId: 96018 } });
this.comboxREASON = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '借款类型',
store: this.storeREASON,
forceSelection: true,
name: 'REASON',
value:'备用金'
});
this.storeJKTYPE = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeJKTYPE.load({ params: { enumTypeId: 36 } });
this.comboxJKTYPE = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '借款方式',
forceSelection: true,
store: this.storeJKTYPE,
name: 'JKTYPE',
//readOnly: true,
id: "JKTYPE"
});
this.storeSaleCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCompanysEntity',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
this.storeSaleCompany.load({ params: { condition: "" } });
this.comboxSaleCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属分部', //'委托分公司',
store: this.storeSaleCompany,
forceSelection: true,
id: 'SALECORPID',
name: 'SALECORPID',
valueField: 'GID',
displayField: 'NAME'
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [this.comboxREASON,{
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.comboxOP, this.comboxCurr, this.comboxJKTYPE, this.comboxSaleCompany
]
}
]//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.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},
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, " ENTERDATE>='" + expDate_Min + "'");
//var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
//sql = sql + getAndConSql(sql, expDate_Max, " ENTERDATE<='" + expDate_Max + " 23:59:59'");
var OP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, OP, "OP='" + OP + "'");
var CURR = form.findField('CURR').getValue();
sql = sql + getAndConSql(sql, CURR, "CURRENCY='" + CURR + "'");
var OP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, OP, "OP='" + OP + "'");
var REASON = form.findField('REASON').getValue();
sql = sql + getAndConSql(sql, REASON, "REASON='" + REASON + "'");
var SALECORPID = Ext.getCmp("SALECORPID").getValue();
sql = sql + getAndConSql(sql, SALECORPID, "SALECORPID = '" + SALECORPID + "'");
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
});
}
}
});
}
});