BasePanel.js 4.7 KB

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