BasePanel.js 5.0 KB

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