BasePanel.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. deleteMoreMsg: '删除的客户资料将不能恢复,请确认是否删除?',
  7. deleteOneMsg: '删除的客户资料将不能恢复,请确认是否删除?',
  8. searchField:[{
  9. xtype:'customerDbfindTrigger',
  10. name : "cu_code",
  11. emptyText : "客户编号",
  12. width:140,
  13. },{
  14. xtype : "textfield",
  15. name : "cu_name",
  16. emptyText : "客户名称",
  17. width:140,
  18. },{
  19. xtype : "remotecombo",
  20. storeUrl:'/api/document/customerkind/getCombo',
  21. name : "cu_type",
  22. emptyText : "客户类型",
  23. width:140,
  24. hiddenBtn:true
  25. },{
  26. xtype : "textfield",
  27. name : "cu_sellername",
  28. emptyText : "业务员",
  29. width:120,
  30. },{
  31. xtype : "textfield",
  32. name : "cu_promisedays",
  33. emptyText : "承付天数",
  34. width:120,
  35. getCondition: function(value) {
  36. if(value.indexOf("=")>=0||value.indexOf("<")>=0||value.indexOf(">")>=0){
  37. return ' cu_promisedays ' + value;
  38. }else if(value){
  39. return ' cu_promisedays = ' + value;
  40. }else{
  41. return '1=1';
  42. }
  43. }
  44. },{
  45. xtype : "textfield",
  46. name : "cu_credit",
  47. emptyText : "额度",
  48. width:70,
  49. dataIndex : "cu_credit",
  50. getCondition: function(value) {
  51. if(value.indexOf("=")>=0||value.indexOf("<")>=0||value.indexOf(">")>=0){
  52. return ' cu_credit ' + value;
  53. }else if(value){
  54. return ' cu_credit = ' + value;
  55. }else{
  56. return '1=1';
  57. }
  58. }
  59. },{
  60. xtype: 'combobox',
  61. name: 'cu_statuscode',
  62. queryMode: 'local',
  63. displayField: 'cu_status',
  64. valueField: 'cu_statuscode',
  65. emptyText :'状态',
  66. editable:false,
  67. width:100,
  68. store: Ext.create('Ext.data.ArrayStore', {
  69. fields: ['cu_statuscode', 'cu_status'],
  70. data: [
  71. ["ALL", "全部"],
  72. ["OPEN", "已开启"],
  73. ["CLOSE", "已关闭"]
  74. ]
  75. }),
  76. getCondition: function(value) {
  77. if(value == 'ALL'||value==null) {
  78. return '1=1';
  79. }else {
  80. return 'cu_statuscode=\'' + value + '\'';
  81. }
  82. }
  83. }],
  84. //字段属性
  85. _formXtype:'document-customer-formpanel',
  86. _title:'客户资料',
  87. _deleteUrl:'/api/document/customer/delete/',
  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. text : "客户状态",
  155. dataIndex : "cu_status",
  156. },
  157. {
  158. text : "客户状态码",
  159. dataIndex : "cu_statuscode",
  160. hidden:true
  161. },
  162. {
  163. text : "默认客户地址",
  164. dataIndex : "ca_address",
  165. hidden:true
  166. },
  167. {
  168. text : "默认客户联系人",
  169. dataIndex : "cc_name",
  170. hidden:true
  171. }]
  172. },
  173. refresh:function(){
  174. this.items.items[0].store.load()
  175. }
  176. });