Ext . namespace ( 'Shipping' ) ;
Shipping . MsChBankdataPayIndex = function ( config ) {
Ext . applyIf ( this , config ) ;
this . initUIComponents ( ) ;
window . Shipping . MsChBankdataPayIndex . superclass . constructor . call ( this ) ;
} ;
Ext . extend ( Shipping . MsChBankdataPayIndex , Ext . Panel , {
PageSize : 30 ,
OprationStatus : null , //仅当弹出界面时使用
SelectedRecord : null ,
initUIComponents : function ( ) {
this . invsqlcontext = '' ;
this . formname = "MsChBankdataPayIndex" ; //页面名称
this . GID = getUrlParam ( 'GID' ) ;
//定义数据集
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 . initgirdcolums = [ {
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 : 'TRANSDATE' ,
header : '交易日期' ,
width : 80
} , {
sortable : true ,
dataIndex : 'IMPORTDATE' ,
header : '导入日期' ,
width : 80
} , {
sortable : true ,
dataIndex : 'IMPORTER' ,
header : '导入人' ,
width : 80
} , {
sortable : true ,
dataIndex : 'ISFIT' ,
header : '是否匹配' ,
width : 40 ,
renderer : function ( value , cellmeta ) {
if ( value == 'true' ) {
return "<img src='../../../../TruckMng/Content/Images/yes.png' />" ;
}
}
} , {
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
} , {
sortable : true ,
dataIndex : 'ISSTL' ,
header : '是否结算' ,
width : 40 ,
renderer : function ( value , cellmeta ) {
if ( value == 'true' ) {
return "<img src='../../../../TruckMng/Content/Images/yes.png' />" ;
}
}
} , {
sortable : true ,
dataIndex : 'STLBILLNO' ,
header : '结算单号' ,
width : 100
}
] ;
this . girdcolums = this . initgirdcolums ;
//定义Grid
this . gridList = new Ext . grid . GridPanel ( {
store : this . storeList ,
enableHdMenu : false ,
region : 'center' ,
selModel : this . GridCheckBoxModel ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
viewConfig : {
enableTextSelection : true , //允许复制数据
autoFill : true
,
getRowClass : function ( record , rowIndex , rowParams , store ) {
var TRANSTYPE = record . get ( 'TRANSTYPE' ) ;
if ( TRANSTYPE == '往账' )
return 'text_red' ;
}
} ,
columns : this . girdcolums ,
// 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 . girdcolums = DsTruck . GetGridPanel ( USERID , this . formname , this . girdcolums , 1 ) ; //使用者id, 表名, 中间column数组, 跳过一开始的几列
this . girdcolums . unshift ( new Ext . grid . RowNumberer ( ) ) ;
this . gridList . reconfigure ( this . storeList , this . girdcolums ) ;
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 . storeFitInvList . load ( {
params : { start : 0 , limit : 1000 , condition : sql } ,
callback : function ( r , options , success ) {
if ( success ) {
isloadfee = true ;
}
}
} ) ;
} else {
this . storeFitInvList . removeAll ( ) ;
}
var invsql = " CM.BILLSTATUS IN (0,4,5) and CM.BILLNO NOT IN (SELECT BILLNO FROM ch_fee_bankdata_fitdetail) " ;
invsql = invsql + " and EXISTS (select 1 from ch_fee f left join ch_fee_do d on (d.FEEID=f.GID) WHERE cm.BILLNO=d.BILLNO AND F.AMOUNT<>F.SETTLEMENT) " ;
invsql = invsql + " and EXISTS (select 1 from info_client C WHERE C.SHORTNAME=CM.CUSTOMERNAME AND C.[DESCRIPTION]='" + record . data . PAYEE _NAME + "') " ;
this . storeInvList . load ( {
params : { start : 0 , limit : this . PageSize , condition : invsql } ,
callback : function ( r , options , success ) {
if ( success ) {
isloadfee = true ;
}
}
} ) ;
} , 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 ) {
_thisBankdataPay . 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 ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} ) ;
_thisBankdataPay = 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 ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '批次号' ,
name : 'PCNo' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '流水号' ,
name : 'TRANSNO' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '付款人名称' ,
name : 'CustName' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , this . comboxISFIT , {
fieldLabel : '从交易日期' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ExpDateBgn' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '到交易日期' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ExpDateEnd' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . 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 : "edit_down" ,
id : "cancelStl" ,
handler : function ( button , event ) {
this . DelBankDataDetail ( button , event ) ;
} ,
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
//},
'-' , {
text : "保存列表样式" ,
id : "btntest" ,
menu : [
{
text : "保存" ,
handler : function ( button , event ) {
this . girdcolums = DsTruck . SaveGridPanel ( USERID , _thisBankdataPay . formname , _thisBankdataPay . gridList . columns , _thisBankdataPay . girdcolums , 1 , true ) ;
}
} , {
text : "初始化" ,
handler : function ( menu , event ) {
_thisBankdataPay . girdcolums = DsTruck . SaveGridPanel ( USERID , _thisBankdataPay . formname , _thisBankdataPay . gridList . columns , _thisBankdataPay . initgirdcolums , 1 , true ) ;
}
} ] ,
scope : this
}
]
} ) ;
this . panelTop = new Ext . Panel ( {
layout : "border" ,
region : "north" ,
height : 80 ,
items : [ this . formSearch , this . panelBtn ]
} ) ;
//定义数据集
this . storeInvList = Ext . create ( 'Ext.data.Store' , {
pageSize : this . PageSize ,
model : 'MsChPayapplication' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/Account/Chfee_payapplication/GetDataList' ,
reader : {
id : 'BILLNO' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . InvPagenum = 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 ) {
_thisBankdataPay . onRefreshInvClick ( ) ;
}
}
}
} ) ;
this . initInvgirdcolums = [ {
sortable : true ,
dataIndex : 'BILLNO' ,
header : '申请单号' , //申请单号
width : 120 ,
renderer : function ( value , meta ) {
meta . tdCls = 'mblno' ;
btnurl = getGridCopyButton ( value ) ;
return btnurl + value ;
}
} , {
sortable : true ,
dataIndex : 'BILLSTATUSREF' ,
header : '状态' , //状态
width : 60
} , {
sortable : true ,
dataIndex : 'CUSTOMERNAME' ,
header : '结算单位' , //结算单位
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLETYPEREF' ,
header : '结算方式' , //结算单位
width : 120
} , {
sortable : true ,
dataIndex : 'CURR' ,
header : '币别' , //币别
width : 50
} , {
sortable : true ,
dataIndex : 'AMOUNTRMB' ,
header : 'RMB' ,
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTUSD' ,
header : 'USD' ,
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTOT' ,
header : '其他外币' , //其他外币
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLERMB' ,
header : '结算RMB' , //结算RMB
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLEUSD' ,
header : '结算USD' , //结算USD
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLEOT' ,
header : '结算其他币别' , //结算其他币别
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'APPLYTIME' ,
header : '申请日期' , //申请日期
width : 100
} , {
sortable : true ,
dataIndex : 'APPLICANTNAME' ,
header : '申请人' , //申请人
width : 100
} , {
sortable : true ,
dataIndex : 'PAYABLETIME' ,
header : '申请支付日期' , //申请支付日期
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITTIME' ,
header : '最后审核日期' , //最后审核日期
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITUSER' ,
header : '最后审核人' , //最后审核人
width : 100
} , {
sortable : true ,
dataIndex : 'CUSTBANKNAME' ,
header : '结算对象银行' , //结算对象银行
width : 80
} ,
{
sortable : true ,
dataIndex : 'CUSTACCOUNT' ,
header : '结算对象账户' , //结算对象账户
width : 140
} , {
sortable : true ,
dataIndex : 'REMARK' ,
header : '备注' , //备注
width : 160
} , {
sortable : true ,
dataIndex : 'ISINVOICE' ,
header : '已开发票' , //已开发票
width : 80
} , {
sortable : true ,
dataIndex : 'INVNO' ,
header : '发票号' , //发票号
width : 80
} , {
sortable : true ,
dataIndex : 'INVDATE' ,
header : '发票日期' , //发票号
width : 80
} , {
sortable : true ,
dataIndex : 'INVOICEAMOUNT' ,
header : '开票金额' , //发票号
width : 80
} , {
sortable : true ,
dataIndex : 'SALECORP' ,
header : '所属分部' , //驳回原因
width : 80
} , {
sortable : true ,
dataIndex : 'ISREVINV' ,
header : '收到发票' ,
width : 80 ,
renderer : function ( value , cellmeta ) {
if ( value == 'true' ) {
return Zi . LAN . YES ;
}
}
}
] ;
this . Invgirdcolums = this . initInvgirdcolums ;
this . InvGridCheckBoxModel = Ext . create ( 'Ext.selection.CheckboxModel' ) ;
this . InvgridList = new Ext . grid . GridPanel ( {
store : this . storeInvList ,
enableHdMenu : false ,
region : 'center' ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
selModel : this . InvGridCheckBoxModel ,
tbar : [ {
text : "手动匹配流水" ,
iconCls : "edit_up" ,
handler : function ( button , event ) {
this . onPIPEIClick ( button , event ) ;
} ,
scope : this
} , '-' , {
text : '保存列表样式' , //保存列表样式
menu : [
{
text : '保存' , //保存
handler : function ( button , event ) {
_thisBankdataPay . Invgirdcolums = DsTruck . SaveGridPanel ( USERID , _thisBankdataPay . formname + 'Inv' , _thisBankdataPay . InvgridList . columns , _thisBankdataPay . Invgirdcolums , 1 , true ) ;
}
} , {
text : '初始化' , //初始化
handler : function ( menu , event ) {
_thisBankdataPay . Invgirdcolums = DsTruck . SaveGridPanel ( USERID , _thisBankdataPay . formname + 'Inv' , _thisBankdataPay . InvgridList . columns , _thisBankdataPay . initInvgirdcolums , 1 , true ) ;
_thisBankdataPay . InvgridList . reconfigure ( _thisBankdataPay . storeInvList , _thisBankdataPay . Invgirdcolums ) ;
}
} ] ,
scope : this
} ] ,
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 . Invgirdcolums ,
// paging bar on the bottom
bbar : [ Ext . create ( 'Ext.PagingToolbar' , {
store : this . storeInvList ,
displayInfo : true ,
displayMsg : '当前显示 {0} - {1}条记录 /共 {2}条记录' ,
emptyMsg : "没有数据"
} ) , this . InvPagenum , {
xtype : 'label' ,
id : 'DRSELECTSTR' ,
html : "<font color='green'></font>"
} ]
} ) ;
this . InvgridList . addListener ( 'itemdblclick' , function ( dataview , record , item , index , e , b ) {
this . SelectedRecord = record ;
this . OprationStatus = 'edit' ;
var paytype = record . data . PAYTYPE ;
if ( paytype == '入账申请' ) //入账申请
DsOpenEditWin ( '/Account/Chfee_payapplication/BalEdit' , record . data . BILLNO ) ;
else {
if ( bltype == 'TruckIndex' )
DsOpenEditWin ( '/Account/Chfee_payapplication/TruckBLEdit' , record . data . BILLNO ) ;
else
DsOpenEditWin ( '/Account/Chfee_payapplication/BLEdit' , record . data . BILLNO ) ;
}
} , this ) ;
this . InvgridList . on ( {
selectionchange : function ( sm , selections ) {
if ( selections . length == 0 ) {
var DRSELECTSTR = Ext . getCmp ( 'DRSELECTSTR' ) ;
DRSELECTSTR . setText ( '' , false ) ;
} else {
var storeSelect = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'MsSelectPay' ,
proxy : { url : '/MvcShipping/MsCompanys/GetNoPicDataList' }
} ) ;
var AMOUNTRMB = 0 ;
var AMOUNTUSD = 0 ;
var AMOUNTOT = 0 ;
for ( var i = 0 ; i < selections . length ; i ++ ) {
var memberyf = selections [ i ] ;
var AMOUNTRMB = Add ( AMOUNTRMB , memberyf . data . AMOUNTRMB ) ;
var AMOUNTUSD = Add ( AMOUNTUSD , memberyf . data . AMOUNTUSD ) ;
var AMOUNTOT = Add ( AMOUNTOT , memberyf . data . AMOUNTOT ) ;
}
str = '选中合计:' + '[' ;
if ( AMOUNTRMB != 0 ) {
str = str + 'RMB:' + AMOUNTRMB + ' ' ;
}
if ( AMOUNTUSD != 0 ) {
str = str + 'USD:' + AMOUNTUSD + ' ' ;
}
if ( AMOUNTOT != 0 ) {
str = str + '其他:' + AMOUNTOT + ' ' ;
}
str = str + ']' ;
var DRSELECTSTR = Ext . getCmp ( 'DRSELECTSTR' ) ;
DRSELECTSTR . setText ( str , false ) ;
}
}
} ) ;
this . Invgirdcolums = DsTruck . GetGridPanel ( USERID , this . formname + 'Pay' , this . Invgirdcolums , 1 ) ; //使用者id, 表名, 中间column数组, 跳过一开始的几列
this . Invgirdcolums . unshift ( new Ext . grid . RowNumberer ( ) ) ;
this . InvgridList . reconfigure ( this . storeInvList , this . Invgirdcolums ) ;
this . InvgridList . 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 : 1 ,
queryParam : 'CODENAME' ,
name : 'CustName' ,
valueField : 'CustName' ,
displayField : 'CodeAndName' ,
enableKeyEvents : true ,
listeners : {
keyup : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} ) ;
this . InvformSearch = Ext . widget ( 'form' , {
frame : true ,
region : 'north' ,
height : 40 ,
bodyPadding : 5 ,
fieldDefaults : {
margins : '2 2 2 2' ,
labelAlign : 'right' ,
flex : 1 ,
labelWidth : 90 ,
msgTarget : 'qtip'
} ,
items : [
{ //fieldset 1
xtype : 'container' ,
defaultType : 'textfield' ,
layout : 'anchor' ,
defaults : {
anchor : '100%'
} ,
items : [ {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ {
fieldLabel : '业务编号' , //业务编号
name : 'CustNo' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '申请编号' , //申请编号
name : 'BsNo' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , this . comboxCust , {
fieldLabel : '从付费申请日期' , //从付费申请日期
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ExpDateBgn' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , {
fieldLabel : '至付费申请日期' ,
format : 'Y-m-d' ,
xtype : 'datefield' ,
name : 'ExpDateEnd' ,
enableKeyEvents : true ,
listeners : {
specialkey : function ( field , e ) {
if ( e . getKey ( ) == e . ENTER ) {
_thisBankdataPay . onRefreshClick ( ) ;
}
}
}
} , {
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 . getInvCondition ( ) ;
var winAccess = new Shipping . DsQuery ( {
} ) ;
winAccess . StoreList = this . storeInvList ;
winAccess . formname = this . formname ;
winAccess . condition = sql ;
winAccess . show ( ) ;
return ;
} ,
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 . InvformSearch , this . InvgridList
]
} ) ;
//#endregion formSearch
this . storeFitInvList = Ext . create ( 'Ext.data.Store' , {
pageSize : this . PageSize ,
model : 'MsChPayapplication' ,
remoteSort : true ,
proxy : {
type : 'ajax' ,
url : '/Account/Chfee_payapplication/GetDataList' ,
reader : {
id : 'BILLNO' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
this . initFitInvgirdcolums = [ {
sortable : true ,
dataIndex : 'BILLNO' ,
header : '申请单号' , //申请单号
width : 120 ,
renderer : function ( value , meta ) {
meta . tdCls = 'mblno' ;
btnurl = getGridCopyButton ( value ) ;
return btnurl + value ;
}
} , {
sortable : true ,
dataIndex : 'BILLSTATUSREF' ,
header : '状态' , //状态
width : 60
} , {
sortable : true ,
dataIndex : 'CUSTOMERNAME' ,
header : '结算单位' , //结算单位
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLETYPEREF' ,
header : '结算方式' , //结算单位
width : 120
} , {
sortable : true ,
dataIndex : 'CURR' ,
header : '币别' , //币别
width : 50
} , {
sortable : true ,
dataIndex : 'AMOUNTRMB' ,
header : 'RMB' ,
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTUSD' ,
header : 'USD' ,
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'AMOUNTOT' ,
header : '其他外币' , //其他外币
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLERMB' ,
header : '结算RMB' , //结算RMB
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLEUSD' ,
header : '结算USD' , //结算USD
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'SETTLEOT' ,
header : '结算其他币别' , //结算其他币别
summaryType : 'sum' , align : 'right' ,
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 ;
} ,
align : 'right' ,
width : 120
} , {
sortable : true ,
dataIndex : 'APPLYTIME' ,
header : '申请日期' , //申请日期
width : 100
} , {
sortable : true ,
dataIndex : 'APPLICANTNAME' ,
header : '申请人' , //申请人
width : 100
} , {
sortable : true ,
dataIndex : 'PAYABLETIME' ,
header : '申请支付日期' , //申请支付日期
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITTIME' ,
header : '最后审核日期' , //最后审核日期
width : 100
} , {
sortable : true ,
dataIndex : 'AUDITUSER' ,
header : '最后审核人' , //最后审核人
width : 100
} , {
sortable : true ,
dataIndex : 'CUSTBANKNAME' ,
header : '结算对象银行' , //结算对象银行
width : 80
} ,
{
sortable : true ,
dataIndex : 'CUSTACCOUNT' ,
header : '结算对象账户' , //结算对象账户
width : 140
} , {
sortable : true ,
dataIndex : 'REMARK' ,
header : '备注' , //备注
width : 160
} , {
sortable : true ,
dataIndex : 'ISINVOICE' ,
header : '已开发票' , //已开发票
width : 80
} , {
sortable : true ,
dataIndex : 'INVNO' ,
header : '发票号' , //发票号
width : 80
} , {
sortable : true ,
dataIndex : 'INVDATE' ,
header : '发票日期' , //发票号
width : 80
} , {
sortable : true ,
dataIndex : 'INVOICEAMOUNT' ,
header : '开票金额' , //发票号
width : 80
} , {
sortable : true ,
dataIndex : 'SALECORP' ,
header : '所属分部' , //驳回原因
width : 80
} , {
sortable : true ,
dataIndex : 'ISREVINV' ,
header : '收到发票' ,
width : 80 ,
renderer : function ( value , cellmeta ) {
if ( value == 'true' ) {
return Zi . LAN . YES ;
}
}
}
] ;
this . FitInvgirdcolums = this . initFitInvgirdcolums ;
this . FitInvGridCheckBoxModel = Ext . create ( 'Ext.selection.CheckboxModel' ) ;
this . FitInvgridList = new Ext . grid . GridPanel ( {
store : this . storeFitInvList ,
enableHdMenu : false ,
region : 'center' ,
loadMask : { msg : "数据加载中,请稍等..." } ,
trackMouseOver : true ,
disableSelection : false ,
selModel : this . FitInvGridCheckBoxModel ,
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 . FitInvgirdcolums ,
// paging bar on the bottom
bbar : [ Ext . create ( 'Ext.PagingToolbar' , {
store : this . storeFitInvList ,
displayInfo : true ,
displayMsg : '当前显示 {0} - {1}条记录 /共 {2}条记录' ,
emptyMsg : "没有数据"
} ) ]
} ) ;
this . FitInvgridList . addListener ( 'itemdblclick' , function ( dataview , record , item , index , e , b ) {
} , this ) ;
this . FitInvgirdcolums = DsTruck . GetGridPanel ( USERID , this . formname + 'FitPay' , this . FitInvgirdcolums , 1 ) ; //使用者id, 表名, 中间column数组, 跳过一开始的几列
this . FitInvgirdcolums . unshift ( new Ext . grid . RowNumberer ( ) ) ;
this . FitInvgridList . reconfigure ( this . storeFitInvList , this . FitInvgirdcolums ) ;
this . FitInvgridList . 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 . FitInvgridList
]
} ) ;
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 ) ;
_thisBankdataPay = this ;
if ( _thisBankdataPay . GID == undefined ) {
this . onRefreshClick ( ) ;
} else {
_thisBankdataPay . invsqlcontext = " GID='" + _thisBankdataPay . GID + "'" ;
this . storeList . load ( {
params : { start : 0 , limit : this . PageSize , sort : '' , condition : _thisBankdataPay . invsqlcontext } ,
waitMsg : "正在查询数据..." ,
scope : 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_PAYDATEBGN'
} , {
fieldLabel : '支付申请日期' , //至业务日期
format : 'Y-m-d' ,
labelWidth : 80 ,
xtype : 'datefield' ,
name : 'PS_PAYDATEEND'
}
]
}
] //end items(fieldset 1)
} //end fieldset 1
] //end root items
} ) ; //end this.formEdit
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 ( ) {
_thisBankdataPay . onFitClick ( )
}
} , {
text : '关闭' , //"关闭",
minWidth : 70 ,
handler : function ( ) {
_thisBankdataPay . winFitShow . close ( ) ;
}
} ]
} ) ;
var cancelStl = Ext . getCmp ( 'cancelStl' ) ;
Ext . Ajax . request ( {
waitMsg : '正在查询' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : 'modbankdataCancel'
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success ) {
cancelStl . show ( ) ;
} else {
cancelStl . hide ( ) ;
}
}
} ,
scope : this
} ) ;
} , //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 fitpaysql = this . getFitPayCondition ( ) ;
//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/AddAutoBankDataDetail' ,
params : {
condition : sql ,
fitcondition : fitsql ,
payfitcondition : fitpaysql
} ,
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 ( ) ;
_thisBankdataPay . 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 . InvformSearch , true , true ) ;
var sql = this . getInvCondition ( ) ;
this . invsqlcontext = sql ;
this . PageSize = this . InvPagenum . getValue ( ) ;
this . storeInvList . pageSize = this . PageSize ;
this . storeInvList . load ( {
params : { start : 0 , limit : this . PageSize , sort : '' , condition : sql } ,
waitMsg : "正在查询数据..." ,
scope : this
} ) ;
} ,
onDsQuery : function ( button , event ) {
var sql = this . invsqlcontext ;
this . PageSize = this . Pagenum . getValue ( ) ;
this . storeInvList . pageSize = this . PageSize ;
this . storeInvList . 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 . InvGridCheckBoxModel . 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/AddBankDataPayDetail' ,
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 . storeInvList . 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 ) ;
_thisBankdataPay . 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 TRANSTYPE = form . findField ( 'TRANSTYPE' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , TRANSTYPE , "TRANSTYPE='" + TRANSTYPE + "'" ) ;
var custName = form . findField ( 'CustName' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , custName , " ((TRANSTYPE='来账' AND DRAWEE_NAME like '%" + custName + "%') OR (TRANSTYPE='往账' AND PAYEE_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 , "TRANSDATE >='" + expDateBgn + "'" ) ;
var expDateEnd = form . findField ( 'ExpDateEnd' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateEnd , "TRANSDATE <='" + 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" ) ;
var ACCOUNT = form . findField ( 'ACCOUNT' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , ACCOUNT , " ACCOUNT like '%" + ACCOUNT + "%' " ) ;
return sql ;
} ,
getInvCondition : function ( ) {
var form = this . InvformSearch . getForm ( ) ;
if ( ! form . isValid ( ) ) {
Ext . Msg . alert ( '提示' , '查询条件赋值错误,请检查。' ) ;
return '' ;
}
var sql = '' ;
sql = " CM.BILLSTATUS IN (0,4,5) and CM.BILLNO NOT IN (SELECT BILLNO FROM ch_fee_bankdata_fitdetail) and EXISTS (select 1 from ch_fee f left join ch_fee_do d on (d.FEEID=f.GID) WHERE cm.BILLNO=d.BILLNO AND F.AMOUNT<>F.SETTLEMENT) " ;
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 customNo = form . findField ( 'BsNo' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , customNo , "BILLNO like '%" + customNo + "%'" ) ;
var custName = form . findField ( 'CustName' ) . getValue ( ) ;
sql = sql + getAndConSql ( sql , custName , "CUSTOMERNAME like '%" + custName + "%'" ) ;
var CustNo = form . findField ( 'CustNo' ) . getValue ( ) ;
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 cm.BILLNO=d.BILLNO AND (b.CUSTNO+''+b.MBLNO+''+b.HBLNO+''+b.CUSTOMNO+''+b.ORDERNO) like '%" + CustNo + "%' )" ) ;
var expDateBgn = form . findField ( 'ExpDateBgn' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateBgn , "APPLYTIME >='" + expDateBgn + "'" ) ;
var expDateEnd = form . findField ( 'ExpDateEnd' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateEnd , "APPLYTIME <='" + expDateEnd + "'" ) ;
return sql ;
} ,
getFitInvCondition : function ( ) {
var form = this . formFit . getForm ( ) ;
if ( ! form . isValid ( ) ) {
Ext . Msg . alert ( '提示' , '查询条件赋值错误,请检查。' ) ;
return '' ;
}
var sql = '' ;
sql = " CM.BILLNO NOT IN (SELECT BILLNO FROM ch_fee_bankdata_fitdetail) " ;
var expDateBgn = form . findField ( 'PS_INVDATEBGN' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateBgn , "INVOICEMAKETIME >='" + expDateBgn + "'" ) ;
var expDateEnd = form . findField ( 'PS_INVDATEEND' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateEnd , "INVOICEMAKETIME <='" + expDateEnd + " 23:59:59'" ) ;
return sql ;
} ,
getFitPayCondition : function ( ) {
var form = this . formFit . getForm ( ) ;
if ( ! form . isValid ( ) ) {
Ext . Msg . alert ( '提示' , '查询条件赋值错误,请检查。' ) ;
return '' ;
}
var sql = '' ;
sql = " CM.BILLNO NOT IN (SELECT BILLNO FROM ch_fee_bankdata_fitdetail) " ;
var expDateBgn = form . findField ( 'PS_PAYDATEBGN' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateBgn , "APPLYTIME >='" + expDateBgn + "'" ) ;
var expDateEnd = form . findField ( 'PS_PAYDATEEND' ) . getRawValue ( ) ;
sql = sql + getAndConSql ( sql , expDateEnd , "APPLYTIME <='" + 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 ;
}
} ) ;