BasePanel.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 : "textfield",
  10. name : "cu_name",
  11. width:150,
  12. emptyText:'客户编号或名称',
  13. getCondition: function(value) {
  14. return ' (cu_code like\'%' + value + '%\''
  15. +' or cu_name like \'%'+value+'%\' ) ';
  16. }
  17. },{
  18. xtype : "remotecombo",
  19. storeUrl:'/api/document/customerkind/getCombo',
  20. name : "cu_type",
  21. emptyText : "类型",
  22. width:110,
  23. hiddenBtn:true
  24. },{
  25. xtype: 'combobox',
  26. name: 'cu_statuscode',
  27. queryMode: 'local',
  28. displayField: 'cu_status',
  29. valueField: 'cu_statuscode',
  30. emptyText :'状态',
  31. editable:false,
  32. width:90,
  33. store: Ext.create('Ext.data.ArrayStore', {
  34. fields: ['cu_statuscode', 'cu_status'],
  35. data: [
  36. ["ALL", "全部"],
  37. ["OPEN", "已开启"],
  38. ["CLOSE", "已关闭"]
  39. ]
  40. }),
  41. getCondition: function(value) {
  42. if(value == 'ALL'||value==null) {
  43. return '1=1';
  44. }else {
  45. return 'cu_statuscode=\'' + value + '\'';
  46. }
  47. }
  48. },{
  49. xtype : "textfield",
  50. name : "cu_sellername",
  51. emptyText : "业务员",
  52. width:110
  53. }],
  54. //字段属性
  55. caller:'Customer',
  56. _formXtype:'document-customer-formpanel',
  57. _title:'客户资料',
  58. _deleteUrl:'/api/document/customer/delete',
  59. _batchOpenUrl:'/api/document/customer/batchOpen',
  60. _batchCloseUrl:'/api/document/customer/batchClose',
  61. _batchDeleteUrl:'/api/document/customer/batchDelete',
  62. gridConfig: {
  63. idField: 'id',
  64. codeField: 'cu_code',
  65. statusCodeField:'cu_statuscode',
  66. dataUrl: '/api/document/customer/list',
  67. columns : [
  68. {
  69. text : "客户id",
  70. hidden:true,
  71. dataIndex : "id",
  72. xtype : "numbercolumn",
  73. },{
  74. text : "客户编号",
  75. width : 150.0,
  76. dataIndex : "cu_code"
  77. },
  78. {
  79. text : "客户名称",
  80. width : 250.0,
  81. dataIndex : "cu_name"
  82. }, {
  83. text : "状态",
  84. dataIndex : "cu_status",
  85. width : 90.0
  86. }, {
  87. text : "类型",
  88. dataIndex : "cu_type",
  89. width : 110.0
  90. }, {
  91. text : "税率",
  92. dataIndex : "cu_taxrate",
  93. xtype: 'numbercolumn',
  94. width : 110.0,
  95. renderer : function(v) {
  96. return Ext.util.Format.number(v, '0');
  97. }
  98. }, {
  99. text : "结算天数",
  100. xtype: 'numbercolumn',
  101. dataIndex : "cu_promisedays",
  102. renderer : function(v) {
  103. return Ext.util.Format.number(v, '0');
  104. }
  105. }, {
  106. text: '应收余额',
  107. xtype: 'numbercolumn',
  108. dataIndex: 'cu_leftamount',
  109. width: 120,
  110. renderer : function(v) {
  111. var arr = (v + '.').split('.');
  112. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  113. var format = '0,000.' + xr.join();
  114. return Ext.util.Format.number(v, format);
  115. }
  116. }, {
  117. text : "业务员",
  118. dataIndex : "cu_sellername",
  119. width: 110
  120. }, {
  121. text : "备注",
  122. dataIndex : "cu_text1",
  123. width: 250
  124. }]
  125. },
  126. refresh:function(){
  127. this.items.items[0].store.load()
  128. }
  129. });