BasePanel.js 4.1 KB

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