You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

217 lines
6.6 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.BlInvApp = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
Shipping.BlInvApp.superclass.constructor.call(this);
};
Ext.extend(Shipping.BlInvApp, Ext.Window, {
StoreList: null,
formname: '',
start: 0,
limit: 100,
condition: '',
returnsql: null,
initUIComponents: function () {
Ext.define('MsCUSTOMERNAME', {
extend: 'Ext.data.Model',
idProperty: 'CUSTOMERNAME',
fields: [
{ name: 'CUSTOMERNAME', type: 'string' }
]
});
// Ext.define('Chfee_add_detail', {
// extend: 'Ext.data.Model',
// idProperty: 'CH_ID',
// fields: [
// { name: 'BSNO', type: 'string' },
// { name: 'CH_ID', type: 'string' },
// { name: 'FeeType', type: 'number' },
// { name: 'FeeType_Ref', type: 'string' },
// { name: 'Amount', type: 'number' },
// { name: 'FeeName', type: 'string' },
// { name: 'CustomerName', type: 'string' },
// { name: 'AccTaxRate', type: 'number' },
// { name: 'BalAmount', type: 'number' },
// { name: 'StlAmount', type: 'number' },
// { name: 'Currency', type: 'string' },
// { name: 'ExChangerate', type: 'number' },
// { name: 'DoAmount', type: 'number' },
// { name: 'Remark', type: 'string' }
// ]
// });
this.StoreDateCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeNowInvCurrList' }
});
this.StoreDateCurr.load({ params: { condition: ""} });
this.storeCustList = Ext.create('Ext.data.Store', {
model: 'MsCUSTOMERNAME',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_invoiceapplication/GetBLInvAppData',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListCust = new Ext.grid.GridPanel({
store: this.storeCustList,
enableHdMenu: false,
region: 'west',
width:150,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selType: 'cellmodel',
columns: [ {
sortable: true,
dataIndex: 'MsCUSTOMERNAME',
header: '客户名称',
width: 120
}
]
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: ""} });
this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '发票申请币别',
store: this.StoreCurr,
forceSelection: true,
allowBlank: false,
name: 'CURR',
value:'RMB',
valueField: 'CURR',
displayField: 'CURR'
});
this.storeCurrExrate = Ext.create('Ext.data.Store', {
fields: ['CURR', 'EXRATE', 'DFEXRATE']
});
// this.storeAddFeeList = Ext.create('Ext.data.Store', {
// pageSize: this.PageSize,
// model: 'Chfee_add_detail',
// remoteSort: true,
// proxy: {
// type: 'ajax',
// url: '/Account/Chfee_invoiceapplication/GetFeeDetailList',
// reader: {
// id: 'BSNO',
// root: 'data',
// totalProperty: 'totalCount'
// }
// }
// });
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCurr]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: []
}]
}],
buttons: [{
text: "确认添加",
id: 'btnQuery',
handler: function (button, event) {
_thisQuery.execSql();
},
scope: this
}, {
text: "关闭",
handler: function (button, event) {
var win = this.up("window");
win.close();
}
}]
});
_thissearch = this;
Ext.apply(this, {
height: 250,
closable: true,
draggable: true,
layout: "border",
title: '生成发票申请',
defaultButton: 'btnQuery',
resizable: false,
items: [this.gridListCust, this.formSearch],
layout: "border",
width: 500,
xtype: "window",
id: "DsInvAppWin",
listeners: {
scope: this,
'beforeshow': function (thewin, eOpts) {
this.storeCustList.load({ params: { condition: this.condition },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
}
}
}
});
}
}
});
}, //onDeleteClick
execSql: function () {
var storeList = this.StoreList;
var sql = this.getCondition();
parentWin = window._thisfee;
if (parentWin == NaN || parentWin == null)
parentWin = window._this;
parentWin.sqlcontext = sql;
parentWin.onDsQuery();
var win = Ext.getCmp("DsInvAppWin");
win.close();
}
});