BasePanel.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. ["ENABLE", "已启用"],
  40. ["BANNED", "已禁用"]
  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. caller: 'Vendor',
  65. columns : [{
  66. text : "供应商id",
  67. width : 0,
  68. dataIndex : "id",
  69. xtype : "numbercolumn",
  70. },{
  71. text : "供应商编号",
  72. width : 150.0,
  73. dataIndex : "ve_code"
  74. },{
  75. text : "供应商简称",
  76. width : 150.0,
  77. dataIndex : "ve_shortname"
  78. }, {
  79. text : "供应商名称",
  80. dataIndex : "ve_name",
  81. width : 250.0
  82. }, {
  83. text : "状态",
  84. dataIndex : "ve_status",
  85. width : 90.0
  86. }, {
  87. text : "类型",
  88. dataIndex : "ve_type",
  89. width : 110.0
  90. }, {
  91. text : "税率",
  92. xtype: 'numbercolumn',
  93. dataIndex : "ve_taxrate",
  94. width : 80.0,
  95. renderer : function(v) {
  96. return Ext.util.Format.number(v, '0');
  97. }
  98. }, {
  99. text : "结算天数",
  100. xtype: 'numbercolumn',
  101. dataIndex : "ve_promisedays",
  102. width : 110.0,
  103. renderer : function(v) {
  104. return Ext.util.Format.number(v, '0');
  105. }
  106. },{
  107. text: '应付余额',
  108. xtype: 'numbercolumn',
  109. dataIndex : 've_leftamount',
  110. width : 120,
  111. renderer : function(v) {
  112. var arr = (v + '.').split('.');
  113. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  114. var format = '0,000.' + xr.join();
  115. return Ext.util.Format.number(v, format);
  116. }
  117. }, {
  118. text : "备注",
  119. dataIndex : "ve_remark",
  120. width : 250.0
  121. }]
  122. },
  123. refresh:function(){
  124. this.items.items[0].store.load()
  125. }
  126. });