Ext . namespace ( 'Shipping' ) ;
Shipping . MsChBankdataStlMateIndex = function ( config ) {
Ext . applyIf ( this , config ) ;
this . initUIComponents ( ) ;
window . Shipping . MsChBankdataStlMateIndex . superclass . constructor . call ( this ) ;
} ;
Ext . extend ( Shipping . MsChBankdataStlMateIndex , Ext . Panel , {
PageSize : 30 ,
OprationStatus : null , //仅当弹出界面时使用
SelectedRecord : null ,
initUIComponents : function ( ) {
this . invsqlcontext = '' ;
this . formname = "MsChBankdataIndex" ; //页面名称
//定义数据集
this . storeList = Ext . create ( 'Ext.data.Store' , {
pageSize : this . PageSize ,
model : 'MsChBankdata' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/Account/Chfee_bankdata/GetDataList' ,
reader : {
id : 'GID' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . GridCheckBoxModel = Ext . create ( 'Ext.selection.CheckboxModel' ) ;
//定义Grid
this . gridList = new Ext . grid . GridPanel ( {
store : this . storeList ,
enableHdMenu : false ,
region : 'center' ,
selModel : this . GridCheckBoxModel ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
columns : [ {
sortable : true ,
dataIndex : 'PCNO' ,
header : '批次号' ,
width : 30
} , {
sortable : true ,
dataIndex : 'SFNO' ,
header : '顺序号' ,
width : 20
} , {
sortable : true ,
dataIndex : 'TRANSTYPE' ,
header : '交易类型' ,
width : 40
} , {
sortable : true ,
dataIndex : 'DRAWEE_BANK' ,
header : '付款人开户行' ,
width : 120
} , {
sortable : true ,
dataIndex : 'DRAWEE_ACCOUNT' ,
header : '付款人账号' ,
width : 120
} , {
sortable : true ,
dataIndex : 'DRAWEE_NAME' ,
header : '付款人名称' ,
width : 160
} , {
sortable : true ,
dataIndex : 'PAYEE_BANK' ,
header : '收款人开户行' ,
width : 120
} , {
sortable : true ,
dataIndex : 'PAYEE_ACCOUNT' ,
header : '收款人账号' ,
width : 120
} , {
sortable : true ,
dataIndex : 'CURRENCY' ,
header : '币别' ,
width : 40
} , {
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>' ;
}
}
else {
return value ;
}
}
catch ( e ) {
return value ;
}
return value ;
} ,
align : 'right' ,
width : 80
} , {
sortable : true ,
dataIndex : 'TRANSNO' ,
header : '流水号' ,
width : 70
} , {
sortable : true ,
dataIndex : 'PAYEE_NAME' ,
header : '收款人名称' ,
width : 160
} , {
sortable : true ,
dataIndex : 'IMPORTDATE' ,
header : '导入日期' ,
width : 80
} , {
sortable : true ,
dataIndex : 'IMPORTER' ,
header : '导入人' ,
width : 80
} , {
sortable : true ,
dataIndex : 'ISFIT' ,
header : '是否匹配' ,
width : 40
} , {
sortable : true ,
dataIndex : 'FITCOUNT' ,
header : '匹配数量' ,
width : 60
} , {
sortable : true ,
dataIndex : 'INVNO' ,
header : '发票号' ,
width : 100
} , {
sortable : true ,
dataIndex : 'FITDATE' ,
header : '匹配日期' ,
width : 100
} , {
sortable : true ,
dataIndex : 'FITTYPE' ,
header : '匹配类型' ,
width : 100
} , {
sortable : true ,
dataIndex : 'ATTITIONAL' ,
header : '交易附言' ,
width : 100
} , {
sortable : true ,
dataIndex : 'REMARK' ,
header : '备注' ,
width : 100
} , {
sortable : true ,
dataIndex : 'SUMMARY' ,
header : '摘要' ,
width : 100
}
] ,
// paging bar on the bottom
bbar : Ext . create ( 'Ext.PagingToolbar' , {
store : this . storeList ,
displayInfo : true ,
displayMsg : '当前显示 {0} - {1}条记录 /共 {2}条记录' ,
emptyMsg : "没有数据"
} )
} ) ;
this . gridList . addListener ( 'itemdblclick' , function ( dataview , record , item , index , e , b ) {
//this.SelectedRecord = record;
//this.OprationStatus = 'edit';
//var openSet = "height=400, 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_jinzhang/Edit";
//window.open(openUrl, openType, openSet);
} , this ) ;
this . gridList . getSelectionModel ( ) . on ( 'select' , function ( model , record , index ) {
if ( record . data . ISFIT ) {
var bsno = record . data . GID ;
var sql = "" ;
sql = " BILLNO IN (SELECT BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + bsno + "') " ;
isloadfee = false ;
this . storeFitStlList . load ( {
params : { start : 0 , limit : 1000 , condition : sql } ,
callback : function ( r , options , success ) {
if ( success ) {
isloadfee = true ;
}
}
} ) ;
} else {
this . storeFitStlList . removeAll ( ) ;
}
} , this ) ;
//#region formSearch
this . StoreISFIT = Ext . create ( 'Ext.data.Store' , {
fields : [ 'OpLb' ]
} ) ;
this . StoreISFIT . add ( { "OpLb" : "全部" } ) ;
this . StoreISFIT . add ( { "OpLb" : "已匹配" } ) ;
this . StoreISFIT . add ( { "OpLb" : "未匹配" } ) ;
this . comboxISFIT = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '是否匹配' ,
store : this . StoreISFIT ,
forceSelection : true ,
value : '未匹配' ,
name : 'ISFIT' ,
valueField : 'OpLb' ,
displayField : 'OpLb' ,
enableKeyEvents : true ,
listeners : {
keyup : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} ) ;
this . StoreTRANSTYPE = Ext . create ( 'Ext.data.Store' , {
fields : [ 'OpLb' ]
} ) ;
this . StoreTRANSTYPE . add ( { "OpLb" : "全部" } ) ;
this . StoreTRANSTYPE . add ( { "OpLb" : "来账" } ) ;
this . StoreTRANSTYPE . add ( { "OpLb" : "往账" } ) ;
this . comboxTRANSTYPE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '交易类型' ,
store : this . StoreTRANSTYPE ,
forceSelection : true ,
value : '' ,
name : 'TRANSTYPE' ,
valueField : 'OpLb' ,
displayField : 'OpLb' ,
enableKeyEvents : true ,
listeners : {
keyup : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} ) ;
_this = this ;
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 : [ this . comboxTRANSTYPE , {
fieldLabel : '银行账号' ,
name : 'ACCOUNT' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '批次号' ,
name : 'PCNo' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '流水号' ,
name : 'TRANSNO' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '付款人名称' ,
name : 'CustName' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} , this . comboxISFIT , {
fieldLabel : '从导入日期' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ExpDateBgn' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '到导入日期' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ExpDateEnd' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
}
]
}
] //end items(fieldset 1)
} //end fieldset 1
] //end root items
} ) ;
//#endregion formSearch
//查询工具条
this . panelBtn = new Ext . Panel ( {
region : "north" ,
tbar : [
{
text : '导入流水' , //"EXCEL导入",
iconCls : "btnexportexcel" ,
handler : function ( button , event ) {
this . onImportBillClick ( 1 ) ;
} ,
scope : this
} , '-' ,
{
text : "自动匹配" ,
handler : function ( button , event ) {
this . onAutoPIPEIClick ( ) ;
} ,
scope : this
} , '-' ,
{
text : "执行查询" ,
iconCls : "btnrefresh" ,
handler : function ( button , event ) {
this . onRefreshClick ( button , event ) ;
} ,
scope : this
} ,
{
text : "重置条件" ,
iconCls : "btnreset" ,
handler : function ( button , event ) {
var form = this . formSearch . getForm ( ) ;
form . reset ( ) ;
} ,
scope : this
} , '-' ,
{
text : "删除" ,
iconCls : "btndelete" ,
id : "btndelete" ,
handler : function ( button , event ) {
this . onDeleteClick ( button , event ) ;
} ,
scope : this
} , '-' ,
{
text : "取消匹配" ,
handler : function ( button , event ) {
this . DelBankDataDetail ( button , event ) ;
} ,
scope : this
}
]
} ) ;
this . panelTop = new Ext . Panel ( {
layout : "border" ,
region : "north" ,
height : 80 ,
items : [ this . formSearch , this . panelBtn ]
} ) ;
//定义数据集
this . storeStlList = Ext . create ( 'Ext.data.Store' , {
pageSize : this . PageSize ,
model : 'MsChSettlement' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/Account/Chfee_settlement/GetDataListAll' ,
reader : {
id : 'BILLNO' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . StlPagenum = 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 . onRefreshInvClick ( ) ;
}
}
}
} ) ;
this . initStlgirdcolums = [ {
sortable : true ,
dataIndex : 'BILLNO' ,
header : Zi . LAN . BillNo ,
width : 120 ,
renderer : function ( value , meta ) {
meta . tdCls = 'mblno' ;
btnurl = getGridCopyButton ( value ) ;
return btnurl + value ;
}
} , {
sortable : true ,
dataIndex : 'BILLSTATUS' ,
header : Zi . LAN . BillStatus ,
width : 60 ,
renderer : function ( value , meta , record ) {
value = record . data . BILLSTATUSREF ;
if ( value == '锁定' ) {
meta . tdCls = 'feestatus_pass' ;
}
return record . data . BILLSTATUSREF ;
}
} , {
sortable : true ,
dataIndex : 'BILLTYPEREF' ,
header : '类型' ,
width : 120
} , {
sortable : true ,
dataIndex : 'CUSTOMERNAME' ,
header : Zi . LAN . CustomerName ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLEMODEREF' ,
header : Zi . LAN . JieSuanLeiBie ,
width : 100
} , {
sortable : true ,
dataIndex : 'SETTLETYPEREF' ,
header : Zi . LAN . SettlementType ,
width : 100
} , {
sortable : true ,
dataIndex : 'CURR' ,
header : Zi . LAN . Currency ,
width : 50
} , {
sortable : true ,
dataIndex : 'AMOUNTRMB' ,
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' ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTUSD' ,
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' ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTOT' ,
header : Zi . LAN . OtherCurrency ,
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' ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
width : 120
} , {
sortable : true ,
dataIndex : 'NOINVOICE' ,
header : Zi . LAN . WeiKaiPiao ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLETIME' ,
header : Zi . LAN . SettlementTime ,
width : 100
} , {
sortable : true ,
dataIndex : 'SETTLEUSERREF' ,
header : Zi . LAN . SettlementUser ,
width : 100
} , {
sortable : true ,
dataIndex : 'ACCOUNTREF' ,
header : Zi . LAN . JieSuanAccount ,
width : 150
} , {
sortable : true ,
dataIndex : 'BANKCODE' ,
header : Zi . LAN . BANKCODE ,
width : 150
} , {
sortable : true ,
dataIndex : 'ISEXPORT' ,
header : Zi . LAN . IsExportCerft ,
width : 120
} , {
sortable : true ,
dataIndex : 'ISNOTVOU' ,
header : Zi . LAN . ISNOTVOU ,
width : 120 ,
renderer : function ( value , meta , record ) {
if ( value == true ) {
value = Zi . LAN . YES ;
} else value = Zi . LAN . NO ;
return value ;
}
} , {
sortable : true ,
dataIndex : 'REMARK' ,
header : Zi . LAN . Remark ,
width : 160
} , {
sortable : true ,
dataIndex : 'INVNO' ,
header : Zi . LAN . InvoiceNumber ,
width : 160
} , {
sortable : true ,
dataIndex : 'SETTLENO' ,
header : Zi . LAN . SettlementNo ,
width : 160
} , {
sortable : true ,
dataIndex : 'FEEAMOUNT' ,
header : Zi . LAN . OriginalMoney ,
width : 100 ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'VOUCHERNO' ,
header : Zi . LAN . VoucherNo ,
width : 100 ,
renderer : function ( value , meta , record ) {
var openSet = "height=1000, width=950, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + ( screen . height - 250 ) / 2 + ",Left= " + ( screen . width - 600 ) / 2
var openType = "_blank" ;
var openUrl = "" ;
openUrl = "../../MvcShipping/MsCwVouchersGl/Edit?handle=check&ordno=" + record . data . VOUNO ;
var winstr = "window.open(this.href,'" + openType + "','" + openSet + "')" ;
value = '<a href="' + openUrl + '" onclick="' + winstr + ';return false">' + value + '</a>'
return value ;
}
} , {
sortable : true ,
dataIndex : 'SALECORP' ,
header : Zi . LAN . DepartmentName ,
width : 100
} , {
sortable : true ,
dataIndex : 'ACCOUNTS_MONEY' ,
header : Zi . LAN . BookKeepingData ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'PREPAY_MONEY' ,
header : Zi . LAN . YuShouZhiReport ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'AHSR_MONEY' ,
header : Zi . LAN . ShiShouZhiReport ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'FINANCIAL_MONEY' ,
header : Zi . LAN . FinanceCose ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'ADVANCE_MONEY' ,
header : Zi . LAN . YuShouZhiQuReport ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'BILLDATE' ,
header : Zi . LAN . BILLDATE ,
width : 100
} , {
sortable : true ,
dataIndex : 'SHENNO' ,
header : Zi . LAN . SHENNO ,
width : 100
} , {
sortable : true ,
dataIndex : 'INVSHENNO' ,
header : Zi . LAN . INVSHENNO ,
width : 100
} , {
sortable : true ,
dataIndex : 'CUSTBANK' ,
header : Zi . LAN . JSDanWeiBank ,
width : 100
} , {
sortable : true ,
dataIndex : 'CUSTACCOUNT' ,
header : Zi . LAN . JSDanWeiAccount ,
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITTIME' ,
header : Zi . LAN . LOCKTIME ,
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITUSERREF' ,
header : Zi . LAN . LOCKUSERREF ,
width : 100
} , {
sortable : true ,
dataIndex : 'DELETETIME' ,
header : Zi . LAN . UNLOCKTIME ,
width : 100
} , {
sortable : true ,
dataIndex : 'DELETEUSERREF' ,
header : Zi . LAN . UNLOCKUSERREF ,
width : 100
}
] ;
this . Stlgirdcolums = this . initStlgirdcolums ;
this . StlGridCheckBoxModel = Ext . create ( 'Ext.selection.CheckboxModel' ) ;
this . StlgridList = new Ext . grid . GridPanel ( {
store : this . storeStlList ,
enableHdMenu : false ,
region : 'center' ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
selModel : this . StlGridCheckBoxModel ,
viewConfig : {
enableTextSelection : true ,
autoFill : true ,
getRowClass : function ( record , rowIndex , rowParams , store ) {
var ISDELETE = record . get ( 'ISDELETE' ) ;
if ( ISDELETE == 'True' )
return 'feestatus_Del' ;
if ( record . get ( 'PTORRED' ) == "2" )
return 'text_red' ;
if ( record . get ( 'SETRED' ) == "1" || record . get ( 'SETRED' ) == "True" )
return 'text_blue' ;
var BILLSTATUSREF = record . get ( 'BILLSTATUSREF' ) ;
if ( BILLSTATUSREF == '已锁定' ) return 'feestatus_settle' ;
}
} ,
columns : this . Stlgirdcolums ,
// paging bar on the bottom
bbar : [ Ext . create ( 'Ext.PagingToolbar' , {
store : this . storeStlList ,
displayInfo : true ,
displayMsg : '当前显示 {0} - {1}条记录 /共 {2}条记录' ,
emptyMsg : "没有数据"
} ) , this . StlPagenum ]
} ) ;
this . StlgridList . addListener ( 'itemdblclick' , function ( dataview , record , item , index , e , b ) {
this . SelectedRecord = record ;
this . OprationStatus = 'edit' ;
if ( record . data . SETTLEMODE == 1 )
DsOpenEditWin ( '/Account/Chfee_settlement/RecvAppEdit' ) ;
else if ( record . data . SETTLEMODE == 3 )
DsOpenEditWin ( '/Account/Chfee_settlement/RecvInvEdit' ) ;
else
DsOpenEditWin ( '/Account/Chfee_settlement/RecvBLEdit' ) ;
} , this ) ;
this . Stlgirdcolums = DsTruck . GetGridPanel ( USERID , this . formname + 'Stl' , this . Stlgirdcolums , 1 ) ; //使用者id, 表名, 中间column数组, 跳过一开始的几列
this . Stlgirdcolums . unshift ( new Ext . grid . RowNumberer ( ) ) ;
this . StlgridList . reconfigure ( this . storeStlList , this . Stlgirdcolums ) ;
this . StlgridList . addListener ( 'sortchange' , function ( ct , column , direction , eOpts ) {
this . sortfield = column . dataIndex ;
this . sortdire = direction ;
} , this ) ;
//#region formSearch
this . storeCust = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'DsShipping.ux.CustomRefModel' ,
proxy : { url : '/CommMng/BasicDataRef/GetCustomRefListRm' }
} ) ;
this . storeCust . load ( { params : { condition : "" } } ) ;
this . comboxCust = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '结算单位' ,
store : this . storeCust ,
queryMode : 'remote' ,
minChars : 0 ,
queryParam : 'CODENAME' ,
// forceSelection: true,
name : 'CustName' ,
valueField : 'CustName' ,
displayField : 'CodeAndName' ,
enableKeyEvents : true ,
listeners : {
keyup : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshClick ( ) ;
}
}
}
} ) ;
this . StlformSearch = Ext . widget ( 'form' , {
frame : true ,
region : 'north' ,
height : 40 ,
bodyPadding : 5 ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 1 ,
labelWidth : 60 ,
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' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshInvClick ( ) ;
}
}
}
} , {
fieldLabel : '结算单号' ,
name : 'BillNo' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshInvClick ( ) ;
}
}
}
} , this . comboxCust , {
fieldLabel : '结算日期' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
labelWidth : 65 ,
name : 'ExpDateBgn' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshInvClick ( ) ;
}
}
}
} , {
fieldLabel : '结算日期' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
labelWidth : 65 ,
name : 'ExpDateEnd' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_this . onRefreshInvClick ( ) ;
}
}
}
} , {
xtype : 'button' ,
width : 90 ,
text : "执行查询" ,
iconCls : "btnrefresh" ,
handler : function ( button , event ) {
this . onRefreshInvClick ( button , event ) ;
} ,
scope : this
} , {
xtype : 'button' ,
width : 90 ,
text : "高级查询" ,
iconCls : "btnmore" ,
handler : function ( button , event ) {
var sql = this . getStlCondition ( ) ;
var winAccess = new Shipping . DsQuery ( {
} ) ;
winAccess . StoreList = this . storeInvList ;
winAccess . formname = this . formname ;
winAccess . condition = sql ;
winAccess . show ( ) ;
return ;
} ,
scope : this
} , {
xtype : 'button' ,
width : 90 ,
text : "手动匹配" ,
handler : function ( button , event ) {
this . onPIPEIClick ( button , event ) ;
} ,
scope : this
}
//, '-',
//{
// text: "手动匹配",
// xtype: 'button',
// width: 90,
// iconCls: "btnrefresh",
// handler: function (button, event) {
// this.onPIPEIClick();
// },
// scope: this
//}
]
}
] //end items(fieldset 1)
} //end fieldset 1
] //end root items
} ) ;
this . paneladd = new Ext . Panel ( {
title : '结算列表' ,
layout : "border" ,
region : 'south' ,
height : 320 ,
split : true ,
items : [
this . StlformSearch , this . StlgridList
]
} ) ;
//#endregion formSearch
this . storeFitStlList = Ext . create ( 'Ext.data.Store' , {
pageSize : this . PageSize ,
model : 'MsChSettlement' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/Account/Chfee_settlement/GetDataListAll' ,
reader : {
id : 'BILLNO' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . initFitStlgirdcolums = [ {
sortable : true ,
dataIndex : 'BILLNO' ,
header : Zi . LAN . BillNo ,
width : 120 ,
renderer : function ( value , meta ) {
meta . tdCls = 'mblno' ;
btnurl = getGridCopyButton ( value ) ;
return btnurl + value ;
}
} , {
sortable : true ,
dataIndex : 'BILLSTATUS' ,
header : Zi . LAN . BillStatus ,
width : 60 ,
renderer : function ( value , meta , record ) {
value = record . data . BILLSTATUSREF ;
if ( value == '锁定' ) {
meta . tdCls = 'feestatus_pass' ;
}
return record . data . BILLSTATUSREF ;
}
} , {
sortable : true ,
dataIndex : 'CUSTOMERNAME' ,
header : Zi . LAN . CustomerName ,
width : 120
} , {
sortable : true ,
dataIndex : 'BILLTYPEREF' ,
header : '类型' ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLEMODEREF' ,
header : Zi . LAN . JieSuanLeiBie ,
width : 100
} , {
sortable : true ,
dataIndex : 'SETTLETYPEREF' ,
header : Zi . LAN . SettlementType ,
width : 100
} , {
sortable : true ,
dataIndex : 'CURR' ,
header : Zi . LAN . Currency ,
width : 50
} , {
sortable : true ,
dataIndex : 'AMOUNTRMB' ,
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' ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTUSD' ,
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' ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTOT' ,
header : Zi . LAN . OtherCurrency ,
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' ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
width : 120
} , {
sortable : true ,
dataIndex : 'NOINVOICE' ,
header : Zi . LAN . WeiKaiPiao ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLETIME' ,
header : Zi . LAN . SettlementTime ,
width : 100
} , {
sortable : true ,
dataIndex : 'SETTLEUSERREF' ,
header : Zi . LAN . SettlementUser ,
width : 100
} , {
sortable : true ,
dataIndex : 'ACCOUNTREF' ,
header : Zi . LAN . JieSuanAccount ,
width : 150
} , {
sortable : true ,
dataIndex : 'BANKCODE' ,
header : Zi . LAN . BANKCODE ,
width : 150
} , {
sortable : true ,
dataIndex : 'ISEXPORT' ,
header : Zi . LAN . IsExportCerft ,
width : 120
} , {
sortable : true ,
dataIndex : 'ISNOTVOU' ,
header : Zi . LAN . ISNOTVOU ,
width : 120 ,
renderer : function ( value , meta , record ) {
if ( value == true ) {
value = Zi . LAN . YES ;
} else value = Zi . LAN . NO ;
return value ;
}
} , {
sortable : true ,
dataIndex : 'REMARK' ,
header : Zi . LAN . Remark ,
width : 160
} , {
sortable : true ,
dataIndex : 'INVNO' ,
header : Zi . LAN . InvoiceNumber ,
width : 160
} , {
sortable : true ,
dataIndex : 'SETTLENO' ,
header : Zi . LAN . SettlementNo ,
width : 160
} , {
sortable : true ,
dataIndex : 'FEEAMOUNT' ,
header : Zi . LAN . OriginalMoney ,
width : 100 ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'VOUCHERNO' ,
header : Zi . LAN . VoucherNo ,
width : 100 ,
renderer : function ( value , meta , record ) {
var openSet = "height=1000, width=950, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + ( screen . height - 250 ) / 2 + ",Left= " + ( screen . width - 600 ) / 2
var openType = "_blank" ;
var openUrl = "" ;
openUrl = "../../MvcShipping/MsCwVouchersGl/Edit?handle=check&ordno=" + record . data . VOUNO ;
var winstr = "window.open(this.href,'" + openType + "','" + openSet + "')" ;
value = '<a href="' + openUrl + '" onclick="' + winstr + ';return false">' + value + '</a>'
return value ;
}
} , {
sortable : true ,
dataIndex : 'SALECORP' ,
header : Zi . LAN . DepartmentName ,
width : 100
} , {
sortable : true ,
dataIndex : 'ACCOUNTS_MONEY' ,
header : Zi . LAN . BookKeepingData ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'PREPAY_MONEY' ,
header : Zi . LAN . YuShouZhiReport ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'AHSR_MONEY' ,
header : Zi . LAN . ShiShouZhiReport ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'FINANCIAL_MONEY' ,
header : Zi . LAN . FinanceCose ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'ADVANCE_MONEY' ,
header : Zi . LAN . YuShouZhiQuReport ,
width : 100 ,
summaryType : 'sum' ,
summaryRenderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) {
value = usMoney ( value , 2 , '' , true ) ;
return value ;
} ,
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 ;
}
} , {
sortable : true ,
dataIndex : 'BILLDATE' ,
header : Zi . LAN . BILLDATE ,
width : 100
} , {
sortable : true ,
dataIndex : 'SHENNO' ,
header : Zi . LAN . SHENNO ,
width : 100
} , {
sortable : true ,
dataIndex : 'INVSHENNO' ,
header : Zi . LAN . INVSHENNO ,
width : 100
} , {
sortable : true ,
dataIndex : 'CUSTBANK' ,
header : Zi . LAN . JSDanWeiBank ,
width : 100
} , {
sortable : true ,
dataIndex : 'CUSTACCOUNT' ,
header : Zi . LAN . JSDanWeiAccount ,
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITTIME' ,
header : Zi . LAN . LOCKTIME ,
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITUSERREF' ,
header : Zi . LAN . LOCKUSERREF ,
width : 100
} , {
sortable : true ,
dataIndex : 'DELETETIME' ,
header : Zi . LAN . UNLOCKTIME ,
width : 100
} , {
sortable : true ,
dataIndex : 'DELETEUSERREF' ,
header : Zi . LAN . UNLOCKUSERREF ,
width : 100
}
] ;
this . FitStlgirdcolums = this . initFitStlgirdcolums ;
this . FitStlGridCheckBoxModel = Ext . create ( 'Ext.selection.CheckboxModel' ) ;
this . FitStlgridList = new Ext . grid . GridPanel ( {
store : this . storeFitStlList ,
enableHdMenu : false ,
region : 'center' ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
selModel : this . FitStlGridCheckBoxModel ,
viewConfig : {
enableTextSelection : true ,
autoFill : true ,
getRowClass : function ( record , rowIndex , rowParams , store ) {
var ISDELETE = record . get ( 'ISDELETE' ) ;
if ( ISDELETE == 'True' )
return 'feestatus_Del' ;
if ( record . get ( 'PTORRED' ) == "2" )
return 'text_red' ;
if ( record . get ( 'SETRED' ) == "1" || record . get ( 'SETRED' ) == "True" )
return 'text_blue' ;
var BILLSTATUSREF = record . get ( 'BILLSTATUSREF' ) ;
if ( BILLSTATUSREF == '已锁定' ) return 'feestatus_settle' ;
}
} ,
columns : this . FitStlgirdcolums ,
// paging bar on the bottom
bbar : [ Ext . create ( 'Ext.PagingToolbar' , {
store : this . storeFitStlList ,
displayInfo : true ,
displayMsg : '当前显示 {0} - {1}条记录 /共 {2}条记录' ,
emptyMsg : "没有数据"
} ) ]
} ) ;
this . FitStlgridList . addListener ( 'itemdblclick' , function ( dataview , record , item , index , e , b ) {
} , this ) ;
this . FitStlgirdcolums = DsTruck . GetGridPanel ( USERID , this . formname + 'FitStl' , this . FitStlgirdcolums , 1 ) ; //使用者id, 表名, 中间column数组, 跳过一开始的几列
this . FitStlgirdcolums . unshift ( new Ext . grid . RowNumberer ( ) ) ;
this . FitStlgridList . reconfigure ( this . storeFitStlList , this . FitStlgirdcolums ) ;
this . FitStlgridList . addListener ( 'sortchange' , function ( ct , column , direction , eOpts ) {
this . sortfield = column . dataIndex ;
this . sortdire = direction ;
} , this ) ;
this . panelFit = new Ext . Panel ( {
title : '匹配结算信息' ,
layout : "border" ,
split : true ,
region : 'east' ,
width : 320 ,
items : [
this . FitStlgridList
]
} ) ;
this . panelcenter = new Ext . Panel ( {
layout : "border" ,
region : 'center' ,
items : [
this . gridList , this . panelFit
]
} ) ;
Ext . apply ( this , {
items : [ this . panelTop , this . panelcenter , this . paneladd ]
} ) ;
this . storeList . on ( 'beforeload' , function ( store ) {
var sql = this . getCondition ( ) ;
Ext . apply ( store . proxy . extraParams , { condition : sql } ) ;
} , this ) ;
this . onRefreshClick ( ) ;
_this = this ;
this . formFit = Ext . widget ( 'form' , {
region : 'north' ,
frame : true ,
bodyPadding : 5 ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 1 ,
labelWidth : 60 ,
msgTarget : 'qtip'
} ,
items : [
{ //fieldset 1
xtype : 'fieldset' ,
defaultType : 'textfield' ,
layout : 'anchor' ,
defaults : {
anchor : '100%'
} ,
items : [ {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ {
fieldLabel : '结算日期' , //从业务日期
format : 'Y-m-d' ,
//labelWidth: 80,
xtype : 'datefield' ,
name : 'PS_INVDATEBGN'
} , {
fieldLabel : '至结算日期' , //至业务日期
format : 'Y-m-d' ,
labelWidth : 80 ,
xtype : 'datefield' ,
name : 'PS_INVDATEEND'
}
]
}
] //end items(fieldset 1)
} //end fieldset 1
] //end root items
} ) ; //end this.formEdit
_thisFitIndex = this ;
this . winFitShow = Ext . create ( 'Ext.window.Window' , {
title : '匹配范围' , //"批量修改",
width : 420 ,
//height : 120,
//plain : true,
iconCls : "addicon" ,
resizable : false ,
// 是否可以拖动
// draggable:false,
collapsible : true , // 允许缩放条
closeAction : 'close' ,
closable : true ,
modal : 'true' ,
buttonAlign : "center" ,
bodyStyle : "padding:0 0 0 0" ,
items : [ this . formFit ] ,
buttons : [ {
text : '确认匹配' , //"确认修改",
minWidth : 70 ,
handler : function ( ) {
_thisFitIndex . onFitClick ( )
}
} , {
text : '关闭' , //"关闭",
minWidth : 70 ,
handler : function ( ) {
_thisFitIndex . winFitShow . close ( ) ;
}
} ]
} ) ;
} , //end initUIComponents
onRefreshClick : function ( button , event ) {
var sql = this . getCondition ( ) ;
this . storeList . load ( {
params : { start : 0 , limit : this . PageSize , sort : '' , condition : sql } ,
waitMsg : "正在查询数据..." ,
scope : this
} ) ;
} ,
onFitClick : function ( ) {
var sql = this . getCondition ( ) ;
var fitsql = this . getFitInvCondition ( ) ;
//var PS_INVDATEBGN=this.formFit.getForm().findField('PS_INVDATEBGN').getRawValue();
//var PS_INVDATEEND = this.formFit.getForm().findField('PS_INVDATEEND').getRawValue();
Ext . Ajax . request ( {
waitMsg : Zi . LAN . Msg _Adding ,
url : '/Account/Chfee_bankdata/AddAutoBankDataStlDetail' ,
params : {
condition : sql ,
fitcondition : fitsql
} ,
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 {
this . storeList . reload ( ) ;
this . storeInvList . reload ( ) ;
_thisFitIndex . winFitShow . close ( ) ;
}
} else {
Ext . MessageBox . alert ( '错误' , response . responseText ) ;
}
} ,
scope : this
} ) ;
} ,
onDeleteClick : function ( button , event ) {
var selections = this . gridList . getSelectionModel ( ) . getSelection ( ) ;
if ( selections . length == 0 ) {
Ext . Msg . show ( { title : '提示' , msg : '请先选择单据!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
var bodyAddDatas = [ ] ;
for ( var i = 0 ; i < selections . length ; i ++ ) {
var rec = selections [ i ] ;
if ( rec . data . ISFIT == 'true' ) {
Ext . Msg . show ( { title : '提示' , msg : '已匹配发票,无法删除!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
} else {
bodyAddDatas . push ( rec ) ;
}
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll ( bodyAddDatas ) ;
Ext . MessageBox . confirm ( '提示' , '确定删除该记录吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Ajax . request ( {
waitMsg : '正在删除数据...' ,
url : '/Account/Chfee_bankdata/DeleteList' ,
params : {
data : jsonbodyAddDatas
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
this . storeList . reload ( ) ;
Ext . Msg . show ( { title : '提示' , msg : '删除成功!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
success : function ( response , options ) {
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
} , //onDeleteClick
DelBankDataDetail : function ( button , event ) {
var selections = this . gridList . getSelectionModel ( ) . getSelection ( ) ;
if ( selections . length == 0 ) {
Ext . Msg . show ( { title : '提示' , msg : '请先选择单据!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
var bodyAddDatas = [ ] ;
for ( var i = 0 ; i < selections . length ; i ++ ) {
var rec = selections [ i ] ;
if ( rec . data . ISFIT ) {
bodyAddDatas . push ( rec ) ;
} else {
Ext . Msg . show ( { title : '提示' , msg : '未匹配发票,无法取消!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll ( bodyAddDatas ) ;
Ext . MessageBox . confirm ( '提示' , '确定取消匹配吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Ajax . request ( {
waitMsg : '正在处理数据...' ,
url : '/Account/Chfee_bankdata/DelBankDataDetail' ,
params : {
data : jsonbodyAddDatas
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
this . storeList . reload ( ) ;
this . storeFitInvList . removeAll ( ) ;
Ext . Msg . show ( { title : '提示' , msg : '取消匹配成功!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
success : function ( response , options ) {
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
} , //onDeleteClick
onRefreshInvClick : function ( button , event ) {
saveQuerySetting ( this . formname , this . StlformSearch , true , true ) ;
var sql = this . getStlCondition ( ) ;
this . stlsqlcontext = sql ;
this . PageSize = this . StlPagenum . getValue ( ) ;
this . storeStlList . pageSize = this . PageSize ;
this . storeStlList . load ( {
params : { start : 0 , limit : this . PageSize , sort : '' , condition : sql } ,
waitMsg : "正在查询数据..." ,
scope : this
} ) ;
} ,
onDsQuery : function ( button , event ) {
var sql = this . stlsqlcontext ;
this . PageSize = this . Pagenum . getValue ( ) ;
this . storeStlList . pageSize = this . PageSize ;
this . storeStlList . load ( {
params : { start : 0 , limit : this . PageSize , sort : '' , condition : sql } ,
waitMsg : "正在查询数据..." ,
scope : this
} ) ;
} ,
onAutoPIPEIClick : function ( ) {
this . winFitShow . show ( ) ;
} ,
onPIPEIClick : function ( ) {
var selections = this . GridCheckBoxModel . selected . items ;
if ( selections . length == 0 ) {
Ext . Msg . show ( { title : '提示' , msg : '请选择要匹配的银行流水' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ; //请先选择要更新的业务!
return ;
}
var billno = selections [ 0 ] . data . GID ;
var selectedRecords = this . StlGridCheckBoxModel . selected . items ;
var bodyAddDatas = [ ] ;
for ( var i = 0 ; i < selectedRecords . length ; i ++ ) {
var rec = selectedRecords [ i ] ;
bodyAddDatas . push ( rec ) ;
}
if ( bodyAddDatas . length == 0 ) {
Ext . Msg . show ( { title : '提示' , msg : '没有要匹配的结算信息' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
} ;
var jsonbodyAddDatas = ConvertRecordsToJsonAll ( bodyAddDatas ) ;
Ext . Ajax . request ( {
waitMsg : Zi . LAN . Msg _Adding ,
url : '/Account/Chfee_bankdata/AddBankDataStlDetail' ,
params : {
billno : billno ,
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 {
this . storeList . reload ( ) ;
this . storeStlList . reload ( ) ;
}
} else {
Ext . MessageBox . alert ( '错误' , response . responseText ) ;
}
} ,
scope : this
} ) ;
} ,
onImportBillClick : function ( type ) {
var BSNO = "" ;
me = this ;
var url = '/Account/Chfee_bankdata/ImpExcel' ;
var imgform = new Ext . FormPanel ( {
region : 'center' ,
labelWidth : 20 ,
frame : true ,
autoScroll : false ,
border : false ,
fileUpload : true ,
items : [ {
xtype : 'fileuploadfield' ,
id : 'DsLoadExcel' ,
name : 'DsLoadExcel' ,
emptyText : '请选择EXCEL文件' , //'请选择EXCEL文件',
fieldLabel : 'EXCEL' , //'EXCEL',
buttonText : '选择文件' , //'选择文件',
allowBlank : false ,
width : 200 ,
buttonCfg :
{
iconCls : 'uploaddialog'
} ,
anchor : '98%'
} ] ,
buttons : [ {
text : '上传' , //'上传',
type : 'submit' ,
handler : function ( ) {
var UserFilePath = Ext . getCmp ( 'DsLoadExcel' ) . getValue ( ) ;
if ( ! CheckFileExt ( UserFilePath , /.xls|.xlsx|.csv/i ) ) {
Ext . Msg . show ( { title : '错误' , msg : '请选择正确的EXCEL文件' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ; //'请确认你上传的文件为EXCEL文件!'
return ;
}
if ( ! imgform . form . isValid ( ) ) { return ; }
imgform . form . submit ( {
url : url ,
waitMsg : '正在操作数据...' ,
method : 'POST' ,
params : {
bsno : BSNO
} ,
success : function ( form , action ) {
win . close ( this ) ;
_this . storeList . reload ( ) ;
} ,
failure : function ( form , action ) {
form . reset ( ) ;
if ( action . failureType == Ext . form . Action . SERVER _INVALID )
Ext . MessageBox . alert ( '警告' , action . result . Message ) ;
}
} ) ;
}
} , {
text : '关闭' , //'关闭',
type : 'submit' ,
handler : function ( ) {
win . close ( this ) ;
}
} ]
} ) ;
var win = new Ext . Window ( {
title : "上传EXCEL" , //"上传EXCEL",
width : 380 ,
height : 120 ,
modal : true ,
resizable : false ,
border : false ,
items : imgform
} ) ;
win . show ( ) ;
return ;
} ,
getCondition : function ( ) {
var form = this . formSearch . getForm ( ) ;
if ( ! form . isValid ( ) ) {
Ext . Msg . alert ( '提示' , '查询条件赋值错误,请检查。' ) ;
return '' ;
}
var sql = '' ;
var PCNo = form . findField ( 'PCNo' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , PCNo , "PCNO=" + PCNo ) ;
var custName = form . findField ( 'CustName' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , custName , "DRAWEE_NAME like '%" + custName + "%'" ) ;
var TRANSNO = form . findField ( 'TRANSNO' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , TRANSNO , "TRANSNO like '%" + TRANSNO + "%'" ) ;
var expDateBgn = form . findField ( 'ExpDateBgn' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateBgn , "IMPORTDATE >='" + expDateBgn + "'" ) ;
var expDateEnd = form . findField ( 'ExpDateEnd' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateEnd , "IMPORTDATE <='" + expDateEnd + " 23:59:59'" ) ;
var ISFIT = form . findField ( 'ISFIT' ) . getValue ( ) ;
if ( ISFIT == '已匹配' )
sql = sql + getAndConSql ( sql , ISFIT , "ISFIT=1" ) ;
else if ( ISFIT == '未匹配' )
sql = sql + getAndConSql ( sql , ISFIT , "ISNULL(ISFIT,0)=0" ) ;
return sql ;
} ,
getStlCondition : function ( ) {
var form = this . StlformSearch . getForm ( ) ;
if ( ! form . isValid ( ) ) {
Ext . Msg . alert ( '提示' , '查询条件赋值错误,请检查。' ) ;
return '' ;
}
var sql = '' ;
sql = " CM.BILLNO NOT IN (SELECT BILLNO FROM ch_fee_bankdata_fitdetail) " ;
var CustNo = form . findField ( 'BsNo' ) . getValue ( ) ;
// sql = sql + getAndConSql(sql, customNo, "BILLNO like '%" + customNo + "%'");
sql = sql + getAndConSql ( sql , CustNo , "EXISTS (SELECT 1 FROM CH_FEE_DO d left join v_op_bill b on (b.BSNO=D.BSNO) WHERE D.BILLNO=CM.BILLNO AND b.CUSTNO+b.MBLNO+B.HBLNO+B.ORDERNO like '%" + CustNo + "%' )" ) ;
var BILLNO = form . findField ( 'BillNo' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , BILLNO , " BILLNO like '%" + BILLNO + "%' " ) ;
var custName = form . findField ( 'CustName' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , custName , " CUSTOMERNAME='" + custName + "' " ) ;
var expDateBgn = form . findField ( 'ExpDateBgn' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateBgn , "SETTLETIME >='" + expDateBgn + "'" ) ;
var expDateEnd = form . findField ( 'ExpDateEnd' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateEnd , "SETTLETIME <='" + expDateEnd + " 23:59:59'" ) ;
return sql ;
} ,
getFitInvCondition : function ( ) {
var form = this . formFit . getForm ( ) ;
if ( ! form . isValid ( ) ) {
Ext . Msg . alert ( '提示' , '查询条件赋值错误,请检查。' ) ;
return '' ;
}
var sql = '' ;
sql = " NOT EXISTS (select 1 from ch_fee_bankdata_fitdetail WHERE CM.BILLNO=ch_fee_bankdata_fitdetail.BILLNO) " ;
var expDateBgn = form . findField ( 'PS_INVDATEBGN' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateBgn , "SETTLETIME >='" + expDateBgn + "'" ) ;
var expDateEnd = form . findField ( 'PS_INVDATEEND' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateEnd , "SETTLETIME <='" + expDateEnd + " 23:59:59'" ) ;
return sql ;
} ,
OprationSwap : function ( ) {
var ret = new Array ( ) ;
ret [ 0 ] = this . OprationStatus ;
ret [ 1 ] = this . storeList ;
ret [ 2 ] = this . SelectedRecord ;
return ret ;
}
} ) ;