|
|
@@ -7,29 +7,47 @@ Ext.define('saas.view.sale.b2b.RecDataList', {
|
|
|
|
|
|
viewName: 'sale-b2b-recdatalist',
|
|
|
|
|
|
-
|
|
|
// dataUrl: 'http://10.1.80.35:8560/api/sale/saledown/list',
|
|
|
- dataUrl: '/api/sale/saledown/list',
|
|
|
+
|
|
|
+ dataUrl: '/api/sale/b2b/apCheck/customer',
|
|
|
|
|
|
initComponent: function() {
|
|
|
var me = this;
|
|
|
Ext.apply(this, {
|
|
|
searchField: [{
|
|
|
+ name:'ar_customer',
|
|
|
xtype: 'textfield',
|
|
|
emptyText: '请输入客户名称'
|
|
|
}, {
|
|
|
+ name:'ar_date',
|
|
|
xtype: 'condatefield',
|
|
|
fieldLabel: '日期',
|
|
|
columnWidth: 0.5
|
|
|
}],
|
|
|
+ toolButtons:[{
|
|
|
+ ignore: true,
|
|
|
+ style:'text-align: center;',
|
|
|
+ xtype:'displayfield',
|
|
|
+ value:'<a href=\"javascript:saas.util.BaseUtil.openTab(\'sale-b2b-reconciliation-datalist\',\'对账列表\',\'maintab-query-salereconciliation\')\">对账详情</a>'
|
|
|
+ }],
|
|
|
gridConfig: {
|
|
|
+ features : [Ext.create('Ext.grid.feature.Grouping',{
|
|
|
+ collapsible:false,
|
|
|
+ showSummaryRow: false,
|
|
|
+ groupHeaderTpl: '客户名称 : {name} (共:{rows.length}条)'
|
|
|
+ })],
|
|
|
+ listeners:{
|
|
|
+ boxready:function(){
|
|
|
+ this.store.group('custName', 'ASC');
|
|
|
+ }
|
|
|
+ },
|
|
|
idField: null,
|
|
|
codeField: null,
|
|
|
statusCodeField: null,
|
|
|
dataUrl: me.dataUrl,
|
|
|
caller: null,
|
|
|
- rootProperty: 'data.list',
|
|
|
- totalProperty: 'data.total',
|
|
|
+ rootProperty: 'data.content',
|
|
|
+ totalProperty: 'data.totalElement',
|
|
|
actionColumn: [],
|
|
|
selModel: {
|
|
|
type: 'cellmodel'
|
|
|
@@ -37,41 +55,147 @@ Ext.define('saas.view.sale.b2b.RecDataList', {
|
|
|
hiddenTools: true,
|
|
|
data: [],
|
|
|
columns : [{
|
|
|
+ text:'apId',
|
|
|
+ dataIndex:'apId',
|
|
|
+ hidden:true
|
|
|
+ },{
|
|
|
text: '客户名称',
|
|
|
- dataIndex: 'khmc',
|
|
|
- width: 200
|
|
|
+ dataIndex: 'custName',
|
|
|
+ hidden:true
|
|
|
}, {
|
|
|
+ text: 'UU',
|
|
|
+ dataIndex: 'custUU',
|
|
|
+ hidden:true
|
|
|
+ },{
|
|
|
text: '币别',
|
|
|
- dataIndex: 'bb',
|
|
|
+ dataIndex: 'currency',
|
|
|
}, {
|
|
|
text: '本期应收',
|
|
|
- dataIndex: 'bqys'
|
|
|
+ xtype:'numbercolumn',
|
|
|
+ dataIndex: 'thisPeriodAmount',
|
|
|
+ renderer: function (v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, false);
|
|
|
+ }
|
|
|
}, {
|
|
|
text: '本期发货',
|
|
|
- dataIndex: 'bqfh'
|
|
|
+ xtype:'numbercolumn',
|
|
|
+ dataIndex: 'thisPeriodSendQty',
|
|
|
+ renderer: function (v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, false);
|
|
|
+ }
|
|
|
}, {
|
|
|
text: '本期未对账',
|
|
|
- dataIndex: 'bqwdz'
|
|
|
+ xtype:'numbercolumn',
|
|
|
+ dataIndex: 'thisPeriodTodoAmount',
|
|
|
+ renderer: function (v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, false);
|
|
|
+ }
|
|
|
}, {
|
|
|
text: '本期已对账',
|
|
|
- dataIndex: 'bqydz'
|
|
|
+ xtype:'numbercolumn',
|
|
|
+ dataIndex: 'thisPeriodDoneAmount',
|
|
|
+ renderer: function (v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, false);
|
|
|
+ }
|
|
|
}, {
|
|
|
text: '本期已收',
|
|
|
- dataIndex: 'bqys'
|
|
|
+ xtype:'numbercolumn',
|
|
|
+ dataIndex: 'thisPeriodReceipt',
|
|
|
+ renderer: function (v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, false);
|
|
|
+ }
|
|
|
}, {
|
|
|
text: '应收总额',
|
|
|
- dataIndex: 'ysze'
|
|
|
+ xtype:'numbercolumn',
|
|
|
+ dataIndex: 'totalAmount',
|
|
|
+ renderer: function (v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, false);
|
|
|
+ }
|
|
|
}, {
|
|
|
text: '操作',
|
|
|
- dataIndex: 'xx',
|
|
|
+ dataIndex: 'op',
|
|
|
ignore: true,
|
|
|
- renderer: function() {
|
|
|
+ renderer: function(v,m,r) {
|
|
|
return '<span style="color: blue;">明细</span>';
|
|
|
+ },
|
|
|
+ listeners: {
|
|
|
+ click: function(tableView, td, row, col, e, record, tr) {
|
|
|
+ var idValue = record.get('apId'),
|
|
|
+ id = 'sale-b2b-recformpanel-formpanel-' + idValue;
|
|
|
+ var ar_date = tableView.ownerCt.ownerCt.down('[name=ar_date]');
|
|
|
+ saas.util.BaseUtil.openTab('sale-b2b-recformpanel-formpanel', "应收对账单("+idValue+")", id, {
|
|
|
+ currency:record.get('currency'),
|
|
|
+ customerUU:record.get('custUU'),
|
|
|
+ suuorname:record.get('custName'),
|
|
|
+ fromDate:new Date(ar_date.value.from).getTime(),
|
|
|
+ endDate:new Date(ar_date.value.to).getTime()
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}]
|
|
|
}
|
|
|
});
|
|
|
|
|
|
me.callParent(arguments);
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理部分字段值
|
|
|
+ */
|
|
|
+ getConditionValue: function (field, value) {
|
|
|
+ var me = this,
|
|
|
+ xtypes = field.getXTypes().split('/'),
|
|
|
+ conditionValue;
|
|
|
+ if (me.isContainsAny(xtypes, ['datefield'])) {
|
|
|
+ conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
|
|
|
+ } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
|
|
|
+ var from = value.from,
|
|
|
+ to = value.to;
|
|
|
+
|
|
|
+ conditionValue = from + ',' + to;
|
|
|
+ } else if (me.isContainsAny(xtypes, ['condatefield'])) {
|
|
|
+ var from = new Date(value.from).getTime(),
|
|
|
+ to = new Date(value.to).getTime();
|
|
|
+
|
|
|
+ conditionValue = {
|
|
|
+ from: from,
|
|
|
+ to: to
|
|
|
+ };
|
|
|
+ } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
|
|
|
+ conditionValue = value;
|
|
|
+ } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
|
|
|
+ conditionValue = value;
|
|
|
+ } else if (me.isContainsAny(xtypes, ['multicombo'])) {
|
|
|
+ conditionValue = value.map ? value.map(function (v) {
|
|
|
+ return v.value;
|
|
|
+ }).join(',') : '';
|
|
|
+ } else {
|
|
|
+ conditionValue = value;
|
|
|
+ }
|
|
|
+
|
|
|
+ return conditionValue;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getExtraParams: function(store, op, condition) {
|
|
|
+ var ar_customer = this.down('[name=ar_customer]');
|
|
|
+ var searchFilter = {}
|
|
|
+ for(var i = 0; i < condition.length; i++) {
|
|
|
+ var con = condition[i];
|
|
|
+ if(con.type == 'date') {
|
|
|
+ searchFilter.fromDate = con.value.from;
|
|
|
+ searchFilter.endDate = con.value.to;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ar_customer.value&&ar_customer.value!=""){
|
|
|
+ searchFilter.keyword = ar_customer.value
|
|
|
+ }
|
|
|
+ var obj = {
|
|
|
+ count:op.config.limit,
|
|
|
+ page:op.config.page,
|
|
|
+ searchFilter:JSON.stringify(searchFilter)
|
|
|
+ };
|
|
|
+
|
|
|
+ return obj;
|
|
|
}
|
|
|
});
|