BasePanel.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. _formXtype:'document-customer-formpanel',
  56. _title:'客户资料',
  57. _deleteUrl:'/api/document/customer/delete/',
  58. _batchOpenUrl:'/api/document/customer/batchOpen',
  59. _batchCloseUrl:'/api/document/customer/batchClose',
  60. _batchDeleteUrl:'/api/document/customer/batchDelete',
  61. gridConfig: {
  62. idField: 'id',
  63. codeField: 'cu_code',
  64. statusCodeField:'cu_statuscode',
  65. dataUrl: '/api/document/customer/list',
  66. columns : [
  67. {
  68. text : "客户id",
  69. hidden:true,
  70. dataIndex : "id",
  71. xtype : "numbercolumn",
  72. },{
  73. text : "客户编号",
  74. width : 150.0,
  75. dataIndex : "cu_code"
  76. },
  77. {
  78. text : "客户名称",
  79. width : 250.0,
  80. dataIndex : "cu_name"
  81. }, {
  82. text : "状态",
  83. dataIndex : "cu_status",
  84. width : 90.0
  85. }, {
  86. text : "类型",
  87. dataIndex : "cu_type",
  88. width : 110.0
  89. }, {
  90. text : "税率",
  91. dataIndex : "cu_taxrate",
  92. xtype: 'numbercolumn',
  93. width : 110.0,
  94. renderer : function(v) {
  95. return Ext.util.Format.number(v, '0');
  96. }
  97. }, {
  98. text : "结算天数",
  99. xtype: 'numbercolumn',
  100. dataIndex : "cu_promisedays",
  101. renderer : function(v) {
  102. return Ext.util.Format.number(v, '0');
  103. }
  104. }, {
  105. text: '应收余额',
  106. xtype: 'numbercolumn',
  107. dataIndex: 'cu_leftamount',
  108. width: 120,
  109. renderer : function(v) {
  110. var arr = (v + '.').split('.');
  111. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  112. var format = '0,000.' + xr.join();
  113. return Ext.util.Format.number(v, format);
  114. }
  115. }, {
  116. text : "业务员",
  117. dataIndex : "cu_sellername",
  118. width: 110
  119. }, {
  120. text : "备注",
  121. dataIndex : "cu_text1",
  122. width: 250
  123. }]
  124. },
  125. refresh:function(){
  126. this.items.items[0].store.load()
  127. }
  128. });