BasePanel.js 3.9 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: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. ["OPEN", "已开启"],
  44. ["CLOSE", "已关闭"]
  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. columns : [
  69. {
  70. text : "客户id",
  71. hidden:true,
  72. dataIndex : "id",
  73. xtype : "numbercolumn",
  74. },{
  75. text : "客户编号",
  76. width : 150.0,
  77. dataIndex : "cu_code"
  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_text1",
  124. width: 250
  125. }]
  126. },
  127. refresh:function(){
  128. this.items.items[0].store.load()
  129. }
  130. });