BasePanel.js 4.1 KB

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