BasePanel.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. Ext.define('saas.view.document.customer.BasePanel', {
  2. extend: 'saas.view.core.base.BasePanel',
  3. xtype: 'document-customer-basepanel',
  4. controller: 'document-customer-basepanel',
  5. viewModel: 'document-customer-basepanel',
  6. searchField:[{
  7. xtype : "textfield",
  8. name : "cu_code",
  9. emptyText : "客户编号",
  10. width:90,
  11. },{
  12. xtype : "textfield",
  13. name : "cu_name",
  14. emptyText : "客户名称",
  15. width:90,
  16. },{
  17. editable:false,
  18. hiddenBtn:true,
  19. xtype : "remotecombo",
  20. storeUrl:'/api/document/customerkind/getCombo',
  21. name : "cu_type",
  22. emptyText : "客户类型",
  23. width:120,
  24. },{
  25. xtype : "textfield",
  26. name : "cu_sellername",
  27. emptyText : "业务员",
  28. width:120,
  29. },{
  30. xtype : "textfield",
  31. name : "cu_promisedays",
  32. emptyText : "承付天数",
  33. width:120,
  34. getCondition: function(value) {
  35. if(value.indexOf("=")>=0||value.indexOf("<")>=0||value.indexOf(">")>=0){
  36. return ' cu_promisedays ' + value;
  37. }else if(value){
  38. return ' cu_promisedays = ' + value;
  39. }else{
  40. return '1=1';
  41. }
  42. }
  43. },{
  44. xtype : "textfield",
  45. name : "cu_credit",
  46. emptyText : "额度",
  47. width:70,
  48. dataIndex : "cu_credit",
  49. getCondition: function(value) {
  50. if(value.indexOf("=")>=0||value.indexOf("<")>=0||value.indexOf(">")>=0){
  51. return ' cu_credit ' + value;
  52. }else if(value){
  53. return ' cu_credit = ' + value;
  54. }else{
  55. return '1=1';
  56. }
  57. }
  58. },{
  59. xtype: 'combobox',
  60. name: 'cu_statuscode',
  61. queryMode: 'local',
  62. displayField: 'cu_status',
  63. valueField: 'cu_statuscode',
  64. emptyText :'状态',
  65. editable:false,
  66. width:100,
  67. store: Ext.create('Ext.data.ArrayStore', {
  68. fields: ['cu_statuscode', 'cu_status'],
  69. data: [
  70. ["ALL", "全部"],
  71. ["OPEN", "已开启"],
  72. ["CLOSE", "已关闭"]
  73. ]
  74. }),
  75. getCondition: function(value) {
  76. if(value == 'ALL'||value==null) {
  77. return '1=1';
  78. }else {
  79. return 'cu_statuscode=\'' + value + '\'';
  80. }
  81. }
  82. }],
  83. //字段属性
  84. _formXtype:'document-customer-formpanel',
  85. _title:'客户资料',
  86. _deleteUrl:'/api/document/customer/delete/',
  87. // _dataUrl:'/api/ducument/customer/list',
  88. _batchOpenUrl:'/api/document/customer/batchOpen',
  89. _batchCloseUrl:'/api/document/customer/batchClose',
  90. _batchDeleteUrl:'/api/document/customer/batchDelete',
  91. gridConfig: {
  92. idField: 'id',
  93. codeField: 'cu_code',
  94. statusCodeField:'cu_statuscode',
  95. dataUrl: '/api/document/customer/list',
  96. columns : [
  97. {
  98. text : "客户id",
  99. hidden:true,
  100. dataIndex : "id",
  101. xtype : "numbercolumn",
  102. },{
  103. text : "客户编号",
  104. width : 200.0,
  105. dataIndex : "cu_code",
  106. },
  107. {
  108. text : "客户名称",
  109. dataIndex : "cu_name"
  110. },
  111. {
  112. text : "客户UU",
  113. dataIndex : "cu_uu"
  114. },
  115. {
  116. text : "类型",
  117. dataIndex : "cu_type"
  118. },
  119. {
  120. text : "业务员编号",
  121. dataIndex : "cu_sellercode"
  122. },
  123. {
  124. text : "业务员",
  125. dataIndex : "cu_sellername"
  126. },{
  127. text : "税率",
  128. dataIndex : "cu_taxrate",
  129. xtype: 'numbercolumn'
  130. }, {
  131. text: '应收款余额',
  132. dataIndex: 'cu_leftamount',
  133. width: 120,
  134. xtype: 'numbercolumn'
  135. }, {
  136. text : "承付天数",
  137. xtype: 'numbercolumn',
  138. dataIndex : "cu_promisedays",
  139. renderer : function(v) {
  140. return Ext.util.Format.number(v, '0');
  141. }
  142. },
  143. {
  144. text : "额度",
  145. xtype: 'numbercolumn',
  146. dataIndex : "cu_credit",
  147. renderer : function(v) {
  148. var arr = (v + '.').split('.');
  149. var xr = (new Array(arr[1].length)).fill('0');
  150. var format = '0,000.' + xr.join();
  151. return Ext.util.Format.number(v, format);
  152. }
  153. },
  154. {
  155. text : "开户银行",
  156. dataIndex : "cu_bankaccount"
  157. },{
  158. text : "银行账户",
  159. dataIndex : "cu_bankcode"
  160. },{
  161. text : "客户状态",
  162. dataIndex : "cu_status",
  163. },
  164. {
  165. text : "客户状态码",
  166. dataIndex : "cu_statuscode",
  167. hidden:true
  168. },
  169. {
  170. text : "默认客户地址",
  171. dataIndex : "ca_address",
  172. hidden:true
  173. },
  174. {
  175. text : "默认客户联系人",
  176. dataIndex : "cc_name",
  177. hidden:true
  178. }]
  179. },
  180. refresh:function(){
  181. this.items.items[0].store.load()
  182. }
  183. });