BasePanel.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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_code",
  11. width:200,
  12. emptyText:'请输入客户编号或名称',
  13. getCondition: function (v) {
  14. return "(upper(CONCAT(cu_code,'#',cu_name)) like '%" + v.toUpperCase() + "%' )";
  15. }
  16. }, {
  17. xtype : "remotecombo",
  18. storeUrl:'/api/document/customerkind/getCombo',
  19. name : "cu_type",
  20. fieldLabel : "客户类型",
  21. emptyText: '全部',
  22. hiddenBtn:true
  23. }, {
  24. xtype : "employeeDbfindTrigger",
  25. name : "cu_sellername",
  26. fieldLabel:'业务员',
  27. emptyText: '输入人员编号或姓名',
  28. },{
  29. xtype: 'combobox',
  30. name: 'cu_statuscode',
  31. queryMode: 'local',
  32. displayField: 'cu_status',
  33. valueField: 'cu_statuscode',
  34. fieldLabel :'状态',
  35. emptyText: '全部',
  36. editable:false,
  37. store: Ext.create('Ext.data.ArrayStore', {
  38. fields: ['cu_statuscode', 'cu_status'],
  39. data: [
  40. ["ALL", "全部"],
  41. ["ENABLE", "已启用"],
  42. ["BANNED", "已禁用"]
  43. ]
  44. }),
  45. getCondition: function(value) {
  46. if(value == 'ALL'||value==null) {
  47. return '1=1';
  48. }else {
  49. return 'cu_statuscode=\'' + value + '\'';
  50. }
  51. }
  52. }],
  53. //字段属性
  54. caller:'Customer',
  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. caller: 'Customer',
  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. text : "客户简称",
  79. width : 150.0,
  80. dataIndex : "cu_shortname"
  81. },
  82. {
  83. text : "客户名称",
  84. width : 250.0,
  85. dataIndex : "cu_name"
  86. }, {
  87. text : "状态",
  88. dataIndex : "cu_status",
  89. width : 90.0
  90. }, {
  91. text : "类型",
  92. dataIndex : "cu_type",
  93. width : 110.0
  94. }, {
  95. text : "税率",
  96. dataIndex : "cu_taxrate",
  97. xtype: 'numbercolumn',
  98. width : 110.0,
  99. renderer : function(v) {
  100. return Ext.util.Format.number(v, '0');
  101. }
  102. }, {
  103. text : "结算天数",
  104. xtype: 'numbercolumn',
  105. dataIndex : "cu_promisedays",
  106. renderer : function(v) {
  107. return Ext.util.Format.number(v, '0');
  108. }
  109. }, {
  110. text: '应收余额',
  111. xtype: 'numbercolumn',
  112. dataIndex: 'cu_leftamount',
  113. width: 120,
  114. renderer : function(v) {
  115. var arr = (v + '.').split('.');
  116. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  117. var format = '0,000.' + xr.join('');
  118. return Ext.util.Format.number(v, format);
  119. }
  120. }, {
  121. text : "业务员",
  122. dataIndex : "cu_sellername",
  123. width: 110
  124. }, {
  125. text : "备注",
  126. dataIndex : "cu_remark",
  127. width: 250
  128. }]
  129. },
  130. refresh:function(){
  131. this.items.items[0].store.load()
  132. }
  133. });