BasePanel.js 4.0 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: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. hidden: true
  82. },
  83. {
  84. text : "客户名称",
  85. width : 250.0,
  86. dataIndex : "cu_name"
  87. }, {
  88. text : "状态",
  89. dataIndex : "cu_status",
  90. width : 80.0
  91. }, {
  92. text : "类型",
  93. dataIndex : "cu_type",
  94. width : 100.0
  95. }, {
  96. text : "税率(%)",
  97. dataIndex : "cu_taxrate",
  98. xtype: 'numbercolumn',
  99. width : 80.0,
  100. renderer : function(v) {
  101. return saas.util.BaseUtil.numberFormat(v, 2, false);
  102. }
  103. }, {
  104. text : "结算天数",
  105. xtype: 'numbercolumn',
  106. dataIndex : "cu_promisedays",
  107. renderer : function(v) {
  108. return Ext.util.Format.number(v, '0');
  109. }
  110. }, {
  111. text: '应收余额',
  112. xtype: 'numbercolumn',
  113. dataIndex: 'cu_leftamount',
  114. width: 120,
  115. renderer : function(v) {
  116. return saas.util.BaseUtil.numberFormat(v, 2, true);
  117. }
  118. }, {
  119. text : "业务员",
  120. dataIndex : "cu_sellername",
  121. width: 110
  122. }, {
  123. text : "备注",
  124. dataIndex : "cu_remark",
  125. width: 250
  126. }]
  127. },
  128. refresh:function(){
  129. this.items.items[0].store.load()
  130. }
  131. });