|
@@ -7,19 +7,60 @@ Ext.define('saas.view.sys.finish.DataList', {
|
|
|
autoScroll: true,
|
|
autoScroll: true,
|
|
|
frame:true,
|
|
frame:true,
|
|
|
layout:'fit',
|
|
layout:'fit',
|
|
|
- dataUrl:'/api/common/finish/list',
|
|
|
|
|
-
|
|
|
|
|
|
|
+ dataUrl:'http://192.168.253.31:8920/endProduct/list',
|
|
|
|
|
+ endAccount:'http://192.168.253.31:8920/endProduct/endAccount',
|
|
|
|
|
+ unEndAccount:'http://192.168.253.31:8920/endProduct/unEndAccount',
|
|
|
tbar: [{
|
|
tbar: [{
|
|
|
- width: 250,
|
|
|
|
|
- name: 'ml_caller',
|
|
|
|
|
- xtype: 'displayfield',
|
|
|
|
|
- fieldLable : '结账日'
|
|
|
|
|
|
|
+ cls:'x-tbar-display',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ name: 'day',
|
|
|
|
|
+ xtype: 'displayfield'
|
|
|
},{
|
|
},{
|
|
|
xtype:'button',
|
|
xtype:'button',
|
|
|
text:'结账',
|
|
text:'结账',
|
|
|
|
|
+ listeners: {
|
|
|
|
|
+ click:function(b){
|
|
|
|
|
+ var grid = b.ownerCt.ownerCt;
|
|
|
|
|
+ grid.BaseUtil.request({
|
|
|
|
|
+ url: grid.endAccount,
|
|
|
|
|
+ params: '',
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(function(localJson) {
|
|
|
|
|
+ if(localJson.success){
|
|
|
|
|
+ showToast('结账成功');
|
|
|
|
|
+ grid.store.loadPage(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(function(res) {
|
|
|
|
|
+ console.error(res);
|
|
|
|
|
+ showToast('结账失败: ' + res.message);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},{
|
|
},{
|
|
|
xtype:'button',
|
|
xtype:'button',
|
|
|
text:'反结账',
|
|
text:'反结账',
|
|
|
|
|
+ listeners: {
|
|
|
|
|
+ click:function(b){
|
|
|
|
|
+ var grid = b.ownerCt.ownerCt;
|
|
|
|
|
+ grid.BaseUtil.request({
|
|
|
|
|
+ url: grid.unEndAccount,
|
|
|
|
|
+ params: '',
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(function(localJson) {
|
|
|
|
|
+ if(localJson.success){
|
|
|
|
|
+ showToast('反结账成功');
|
|
|
|
|
+ grid.store.loadPage(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(function(res) {
|
|
|
|
|
+ console.error(res);
|
|
|
|
|
+ showToast('反结账失败: ' + res.message);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},'->',{
|
|
},'->',{
|
|
|
cls:'x-formpanel-btn-blue',
|
|
cls:'x-formpanel-btn-blue',
|
|
|
xtype:'button',
|
|
xtype:'button',
|
|
@@ -67,6 +108,8 @@ Ext.define('saas.view.sys.finish.DataList', {
|
|
|
pageSize: 11,
|
|
pageSize: 11,
|
|
|
data: [],
|
|
data: [],
|
|
|
proxy: {
|
|
proxy: {
|
|
|
|
|
+ parent:this,
|
|
|
|
|
+ async:false,
|
|
|
timeout:8000,
|
|
timeout:8000,
|
|
|
type: 'ajax',
|
|
type: 'ajax',
|
|
|
url: me.dataUrl,
|
|
url: me.dataUrl,
|
|
@@ -75,8 +118,17 @@ Ext.define('saas.view.sys.finish.DataList', {
|
|
|
},
|
|
},
|
|
|
reader: {
|
|
reader: {
|
|
|
type: 'json',
|
|
type: 'json',
|
|
|
- rootProperty: 'data.list',
|
|
|
|
|
|
|
+ rootProperty: 'data.item.list',
|
|
|
totalProperty: 'data.total',
|
|
totalProperty: 'data.total',
|
|
|
|
|
+ },
|
|
|
|
|
+ listeners:{
|
|
|
|
|
+ endprocessresponse:function(proxy,res){
|
|
|
|
|
+ if(res.status=='200'){
|
|
|
|
|
+ var nowTime = res.responseJson.data.main;
|
|
|
|
|
+ var day = proxy.parent.dockedItems.items[2].down('[name=day]');
|
|
|
|
|
+ day.setValue('当前结算年月:' + nowTime);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
listeners: {
|
|
listeners: {
|
|
@@ -90,6 +142,9 @@ Ext.define('saas.view.sys.finish.DataList', {
|
|
|
size: store.pageSize,
|
|
size: store.pageSize,
|
|
|
condition: JSON.stringify(condition)
|
|
condition: JSON.stringify(condition)
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ datachanged:function(){
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|