BasePanel.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. columnWidth : 0.25,
  11. },{
  12. xtype : "textfield",
  13. name : "cu_name",
  14. emptyText : "客户名称",
  15. columnWidth : 0.25
  16. },{
  17. editable:false,
  18. hiddenBtn:true,
  19. xtype : "remotecombo",
  20. storeUrl:'/api/document/customerkind/getCombo',
  21. name : "cu_type",
  22. emptyText : "请选择客户类型",
  23. columnWidth : 0.25
  24. },{
  25. xtype : "textfield",
  26. name : "cu_sellername",
  27. emptyText : "业务员",
  28. columnWidth : 0.25,
  29. },{
  30. xtype : "textfield",
  31. name : "cu_promisedays",
  32. emptyText : "承付天数",
  33. columnWidth : 0.25,
  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. columnWidth : 0.25,
  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. fieldLabel: '状态',
  62. queryMode: 'local',
  63. displayField: 'cu_status',
  64. valueField: 'cu_statuscode',
  65. emptyText :'全部',
  66. editable:false,
  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. //dataUrl: 'http://192.168.253.31:8560/api/document/customer/list',
  97. columns : [
  98. {
  99. text : "客户id",
  100. width : 0,
  101. dataIndex : "id",
  102. xtype : "numbercolumn",
  103. },{
  104. text : "客户编号",
  105. width : 200.0,
  106. dataIndex : "cu_code",
  107. },
  108. {
  109. text : "客户名称",
  110. dataIndex : "cu_name"
  111. },
  112. {
  113. text : "客户UU",
  114. dataIndex : "cu_uu"
  115. },
  116. {
  117. text : "类型",
  118. dataIndex : "cu_type"
  119. },
  120. {
  121. text : "业务员编号",
  122. dataIndex : "cu_sellercode"
  123. },
  124. {
  125. text : "业务员",
  126. dataIndex : "cu_sellername"
  127. },{
  128. text : "税率",
  129. dataIndex : "cu_taxrate",
  130. xtype: 'numbercolumn'
  131. },{
  132. text : "承付天数",
  133. xtype: 'numbercolumn',
  134. dataIndex : "cu_promisedays",
  135. renderer : function(v) {
  136. return Ext.util.Format.number(v, '0');
  137. }
  138. },
  139. {
  140. text : "额度",
  141. xtype: 'numbercolumn',
  142. dataIndex : "cu_credit",
  143. renderer : function(v) {
  144. var arr = (v + '.').split('.');
  145. var xr = (new Array(arr[1].length)).fill('0');
  146. var format = '0,000.' + xr.join();
  147. return Ext.util.Format.number(v, format);
  148. }
  149. },
  150. {
  151. text : "开户银行",
  152. dataIndex : "cu_bankaccount"
  153. },{
  154. text : "银行账户",
  155. dataIndex : "cu_bankcode"
  156. },{
  157. text : "客户状态",
  158. dataIndex : "cu_status",
  159. flex : 1.0
  160. },
  161. {
  162. text : "客户状态码",
  163. dataIndex : "cu_statuscode",
  164. width : 0
  165. },
  166. {
  167. text : "默认客户地址",
  168. dataIndex : "ca_address",
  169. width : 0
  170. },
  171. {
  172. text : "默认客户联系人",
  173. dataIndex : "cc_name",
  174. width : 0
  175. }]
  176. },
  177. refresh:function(){
  178. this.items.items[0].store.load()
  179. }
  180. });