BasePanel.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. searchField:[{
  7. xtype : "dbfindtrigger",
  8. name : "ve_code",
  9. emptyText : "供应商编号",
  10. width:140,
  11. },{
  12. xtype : "textfield",
  13. name : "ve_name",
  14. emptyText : "供应商名称",
  15. width:140,
  16. },{
  17. xtype : "remotecombo",
  18. storeUrl:'/api/document/vendorkind/getCombo',
  19. name : "ve_type",
  20. emptyText : "供应商类型",
  21. width:140,
  22. hiddenBtn:true
  23. },{
  24. xtype : "textfield",
  25. name : "ve_promisedays",
  26. emptyText : "承付天数",
  27. width:120,
  28. getCondition: function(value) {
  29. if(value.indexOf("=")>=0||value.indexOf("<")>=0||value.indexOf(">")>=0){
  30. return ' ve_promisedays '+value;
  31. }else if(value){
  32. return ' ve_promisedays = '+value;
  33. }else{
  34. return '1=1';
  35. }
  36. }
  37. },{
  38. xtype: 'combobox',
  39. name: 've_statuscode',
  40. queryMode: 'local',
  41. displayField: 've_status',
  42. valueField: 've_statuscode',
  43. emptyText :'状态',
  44. width:100,
  45. editable:false,
  46. store: Ext.create('Ext.data.ArrayStore', {
  47. fields: ['ve_statuscode', 've_status'],
  48. data: [
  49. ["ALL", "全部"],
  50. ["OPEN", "已开启"],
  51. ["CLOSE", "已关闭"]
  52. ]
  53. }),
  54. getCondition: function(value) {
  55. if(value == 'ALL'||value == null) {
  56. return '1=1';
  57. }else {
  58. return 've_statuscode=\'' + value + '\'';
  59. }
  60. }
  61. }],
  62. //字段属性
  63. _formXtype:'document-vendor-formpanel',
  64. _title:'供应商资料',
  65. // _dataUrl:'/api/ducument/vendor/list',
  66. _deleteUrl:'/api/document/vendor/delete/',
  67. _batchOpenUrl:'/api/document/vendor/batchOpen',
  68. _batchCloseUrl:'/api/document/vendor/batchClose',
  69. _batchDeleteUrl:'/api/document/vendor/batchDelete',
  70. gridConfig: {
  71. idField: 'id',
  72. codeField: 've_code',
  73. statusCodeField:'ve_statuscode',
  74. dataUrl: '/api/document/vendor/list',
  75. columns : [{
  76. text : "供应商id",
  77. width : 0,
  78. dataIndex : "id",
  79. xtype : "numbercolumn",
  80. },{
  81. text : "供应商编号",
  82. width : 200.0,
  83. dataIndex : "ve_code",
  84. xtype : "",
  85. },
  86. {
  87. text : "供应商名称",
  88. dataIndex : "ve_name",
  89. width : 120.0,
  90. xtype : "",
  91. },
  92. {
  93. text : "类型",
  94. dataIndex : "ve_type",
  95. width : 120.0,
  96. xtype : "",
  97. },
  98. {
  99. text : "供应商状态码",
  100. dataIndex : "ve_statuscode",
  101. width : 0,
  102. xtype : ""
  103. },
  104. {
  105. text : "税率",
  106. dataIndex : "ve_taxrate",
  107. width : 120.0,
  108. xtype : "",
  109. align:'end'
  110. }, {
  111. text : "承付天数",
  112. xtype: 'numbercolumn',
  113. dataIndex : "ve_promisedays",
  114. width : 120.0,
  115. align:'end',
  116. renderer : function(v) {
  117. return Ext.util.Format.number(v, '0');
  118. }
  119. }, {
  120. text : "纳税人识别号",
  121. dataIndex : "ve_nsrzh",
  122. width : 120.0,
  123. xtype : ""
  124. }, {
  125. text : "开户银行",
  126. dataIndex : "ve_bankcode",
  127. width : 120.0,
  128. xtype : ""
  129. }, {
  130. text : "银行账户",
  131. dataIndex : "ve_bankaccount",
  132. width : 120.0,
  133. xtype : ""
  134. }, {
  135. text : "状态",
  136. dataIndex : "ve_status",
  137. width : 120.0,
  138. xtype : ""
  139. },{
  140. text: '应收款余额',
  141. dataIndex : 've_leftamount',
  142. width : 120,
  143. renderer : function(v) {
  144. var arr = (v + '.').split('.');
  145. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  146. var format = '0,000.' + xr.join();
  147. return Ext.util.Format.number(v, format);
  148. },
  149. }]
  150. },
  151. refresh:function(){
  152. this.items.items[0].store.load()
  153. }
  154. });