BasePanel.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. Ext.define('saas.view.document.vendor.BasePanel', {
  2. extend: 'saas.view.core.base.BasePanel',
  3. xtype: 'document-vendor-basepanel',
  4. controller: 'document-vendor-basepanel',
  5. viewModel: 'document-vendor-basepanel',
  6. deleteMoreMsg: '删除的供应商资料将不能恢复,请确认是否删除?',
  7. deleteOneMsg: '删除的供应商资料将不能恢复,请确认是否删除?',
  8. searchField:[
  9. {
  10. xtype : "textfield",
  11. name : "ve_code",
  12. width:150,
  13. emptyText:'编号'
  14. }, {
  15. xtype : "textfield",
  16. name : "ve_name",
  17. width:150,
  18. emptyText:'名称'
  19. },{
  20. xtype : "remotecombo",
  21. storeUrl:'/api/document/vendorkind/getCombo',
  22. name : "ve_type",
  23. emptyText : "供应商类型",
  24. width:110,
  25. hiddenBtn:true
  26. },{
  27. xtype: 'combobox',
  28. name: 've_statuscode',
  29. queryMode: 'local',
  30. displayField: 've_status',
  31. valueField: 've_statuscode',
  32. emptyText :'状态',
  33. width:110,
  34. editable:false,
  35. store: Ext.create('Ext.data.ArrayStore', {
  36. fields: ['ve_statuscode', 've_status'],
  37. data: [
  38. ["ALL", "全部"],
  39. ["OPEN", "已开启"],
  40. ["CLOSE", "已关闭"]
  41. ]
  42. }),
  43. getCondition: function(value) {
  44. if(value == 'ALL'||value == null) {
  45. return '1=1';
  46. }else {
  47. return 've_statuscode=\'' + value + '\'';
  48. }
  49. }
  50. }],
  51. //字段属性
  52. caller:'Vendor',
  53. _formXtype:'document-vendor-formpanel',
  54. _title:'供应商资料',
  55. _deleteUrl:'/api/document/vendor/delete',
  56. _batchOpenUrl:'/api/document/vendor/batchOpen',
  57. _batchCloseUrl:'/api/document/vendor/batchClose',
  58. _batchDeleteUrl:'/api/document/vendor/batchDelete',
  59. gridConfig: {
  60. idField: 'id',
  61. codeField: 've_code',
  62. statusCodeField:'ve_statuscode',
  63. dataUrl: '/api/document/vendor/list',
  64. columns : [{
  65. text : "供应商id",
  66. width : 0,
  67. dataIndex : "id",
  68. xtype : "numbercolumn",
  69. },{
  70. text : "供应商编号",
  71. width : 150.0,
  72. dataIndex : "ve_code"
  73. }, {
  74. text : "供应商名称",
  75. dataIndex : "ve_name",
  76. width : 250.0
  77. }, {
  78. text : "状态",
  79. dataIndex : "ve_status",
  80. width : 90.0
  81. }, {
  82. text : "类型",
  83. dataIndex : "ve_type",
  84. width : 110.0
  85. }, {
  86. text : "税率",
  87. xtype: 'numbercolumn',
  88. dataIndex : "ve_taxrate",
  89. width : 80.0,
  90. renderer : function(v) {
  91. return Ext.util.Format.number(v, '0');
  92. }
  93. }, {
  94. text : "结算天数",
  95. xtype: 'numbercolumn',
  96. dataIndex : "ve_promisedays",
  97. width : 110.0,
  98. renderer : function(v) {
  99. return Ext.util.Format.number(v, '0');
  100. }
  101. },{
  102. text: '应付余额',
  103. xtype: 'numbercolumn',
  104. dataIndex : 've_leftamount',
  105. width : 120,
  106. renderer : function(v) {
  107. var arr = (v + '.').split('.');
  108. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  109. var format = '0,000.' + xr.join();
  110. return Ext.util.Format.number(v, format);
  111. }
  112. }, {
  113. text : "备注",
  114. dataIndex : "ve_text1",
  115. width : 250.0
  116. }]
  117. },
  118. refresh:function(){
  119. this.items.items[0].store.load()
  120. }
  121. });