ProdInOutPost.js.svn-base 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Ext.define('erp.view.scm.reserve.ProdInOutPost',{
  2. extend: 'Ext.Viewport',
  3. layout: {
  4. type: 'vbox',
  5. align: 'center',
  6. pack: 'center'
  7. },
  8. initComponent : function(){
  9. var me = this;
  10. Ext.apply(me, {
  11. items: [{
  12. width: 450,
  13. height: 220,
  14. bodyStyle: 'background: #f1f1f1;',
  15. xtype: 'form',
  16. title: '批量过账',
  17. layout: {
  18. type: 'vbox',
  19. align: 'center'
  20. },
  21. items: [{
  22. margin : '15 0 0 0',
  23. xtype: 'condatefield',
  24. fieldLabel: '日期',
  25. allowBlank: false,
  26. readOnly: true,
  27. labelWidth: 80,
  28. id: 'date',
  29. name: 'date',
  30. width: 400
  31. },{
  32. margin: '5 0 0 5',
  33. xtype:'combo',
  34. fieldLabel:'单据类型',
  35. name:'pclass',
  36. id:'pclass',
  37. editable: false,
  38. displayField: 'display',
  39. valueField: 'value',
  40. queryMode: 'local',
  41. store : new Ext.data.Store({
  42. fields: ['display', 'value'],
  43. data: []
  44. }),
  45. labelWidth: 80,
  46. width: 400
  47. }],
  48. buttonAlign: 'center',
  49. buttons: [{
  50. xtype: 'erpConfirmButton',
  51. height: 26
  52. },{
  53. xtype:'erpCloseButton',
  54. height: 26
  55. }]
  56. }]
  57. });
  58. me.getComboData(caller, 'pclass', function(data){
  59. me.down('#pclass').store.loadData(data);
  60. });
  61. me.callParent(arguments);
  62. },
  63. getComboData: function(table, field, callback) {
  64. var me = this;
  65. Ext.Ajax.request({
  66. url : basePath + 'common/getFieldsDatas.action',
  67. params: {
  68. caller: 'DataListCombo',
  69. fields: 'dlc_value,dlc_display',
  70. condition: 'dlc_caller=\'' + table + '\' AND dlc_fieldname=\'' + field + '\''
  71. },
  72. method : 'post',
  73. callback : function(options,success,response){
  74. var localJson = new Ext.decode(response.responseText);
  75. if(localJson.exceptionInfo){
  76. showError(localJson.exceptionInfo);return;
  77. }
  78. if(localJson.success){
  79. var data = Ext.decode(localJson.data), arr = new Array();
  80. for(var i in data) {
  81. arr.push({
  82. display: data[i].DLC_VALUE,
  83. value: data[i].DLC_DISPLAY
  84. });
  85. }
  86. callback.call(me, arr);
  87. }
  88. }
  89. });
  90. }
  91. });