BasePanel.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. {
  81. text : "客户名称",
  82. width : 250.0,
  83. dataIndex : "cu_name"
  84. }, {
  85. text : "状态",
  86. dataIndex : "cu_status",
  87. width : 90.0
  88. }, {
  89. text : "类型",
  90. dataIndex : "cu_type",
  91. width : 110.0
  92. }, {
  93. text : "税率",
  94. dataIndex : "cu_taxrate",
  95. xtype: 'numbercolumn',
  96. width : 110.0,
  97. renderer : function(v) {
  98. return Ext.util.Format.number(v, '0');
  99. }
  100. }, {
  101. text : "结算天数",
  102. xtype: 'numbercolumn',
  103. dataIndex : "cu_promisedays",
  104. renderer : function(v) {
  105. return Ext.util.Format.number(v, '0');
  106. }
  107. }, {
  108. text: '应收余额',
  109. xtype: 'numbercolumn',
  110. dataIndex: 'cu_leftamount',
  111. width: 120,
  112. renderer : function(v) {
  113. var arr = (v + '.').split('.');
  114. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  115. var format = '0,000.' + xr.join();
  116. return Ext.util.Format.number(v, format);
  117. }
  118. }, {
  119. text : "业务员",
  120. dataIndex : "cu_sellername",
  121. width: 110
  122. }, {
  123. text : "备注",
  124. dataIndex : "cu_text1",
  125. width: 250
  126. }]
  127. },
  128. refresh:function(){
  129. this.items.items[0].store.load()
  130. }
  131. });