BasePanel.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. dataIndex : "ve_name",
  77. width : 250.0
  78. }, {
  79. text : "状态",
  80. dataIndex : "ve_status",
  81. width : 90.0
  82. }, {
  83. text : "类型",
  84. dataIndex : "ve_type",
  85. width : 110.0
  86. }, {
  87. text : "税率",
  88. xtype: 'numbercolumn',
  89. dataIndex : "ve_taxrate",
  90. width : 80.0,
  91. renderer : function(v) {
  92. return Ext.util.Format.number(v, '0');
  93. }
  94. }, {
  95. text : "结算天数",
  96. xtype: 'numbercolumn',
  97. dataIndex : "ve_promisedays",
  98. width : 110.0,
  99. renderer : function(v) {
  100. return Ext.util.Format.number(v, '0');
  101. }
  102. },{
  103. text: '应付余额',
  104. xtype: 'numbercolumn',
  105. dataIndex : 've_leftamount',
  106. width : 120,
  107. renderer : function(v) {
  108. var arr = (v + '.').split('.');
  109. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  110. var format = '0,000.' + xr.join();
  111. return Ext.util.Format.number(v, format);
  112. }
  113. }, {
  114. text : "备注",
  115. dataIndex : "ve_text1",
  116. width : 250.0
  117. }]
  118. },
  119. refresh:function(){
  120. this.items.items[0].store.load()
  121. }
  122. });