BasePanel.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. viewName: 'document-customer-basepanel',
  7. deleteMoreMsg: '删除的客户资料将不能恢复,请确认是否删除?',
  8. deleteOneMsg: '删除的客户资料将不能恢复,请确认是否删除?',
  9. //字段属性
  10. caller:'Customer',
  11. _formXtype:'document-customer-formpanel',
  12. _title:'客户资料',
  13. _deleteUrl:'/api/document/customer/delete',
  14. _batchOpenUrl:'/api/document/customer/batchOpen',
  15. _batchCloseUrl:'/api/document/customer/batchClose',
  16. _batchDeleteUrl:'/api/document/customer/batchDelete',
  17. initComponent: function() {
  18. var me = this;
  19. Ext.apply(me, {
  20. searchField:[{
  21. xtype : "textfield",
  22. name : "cu_code",
  23. width:200,
  24. emptyText:'请输入客户编号或名称',
  25. getCondition: function (v) {
  26. return "(upper(CONCAT(cu_code,'#',cu_name)) like '%" + v.toUpperCase() + "%' )";
  27. }
  28. }, {
  29. xtype : "remotecombo",
  30. storeUrl:'/api/document/customerkind/getCombo',
  31. name : "cu_type",
  32. fieldLabel : "客户类型",
  33. emptyText: '全部',
  34. hiddenBtn:true
  35. }, {
  36. xtype : "employeeDbfindTrigger",
  37. name : "cu_sellername",
  38. fieldLabel:'业务员',
  39. emptyText: '输入人员编号或姓名',
  40. },{
  41. xtype: 'combobox',
  42. name: 'cu_statuscode',
  43. queryMode: 'local',
  44. displayField: 'cu_status',
  45. valueField: 'cu_statuscode',
  46. fieldLabel :'状态',
  47. emptyText: '全部',
  48. editable:false,
  49. store: Ext.create('Ext.data.ArrayStore', {
  50. fields: ['cu_statuscode', 'cu_status'],
  51. data: [
  52. ["ALL", "全部"],
  53. ["ENABLE", "已启用"],
  54. ["BANNED", "已禁用"]
  55. ]
  56. }),
  57. getCondition: function(value) {
  58. if(value == 'ALL'||value==null) {
  59. return '1=1';
  60. }else {
  61. return 'cu_statuscode=\'' + value + '\'';
  62. }
  63. }
  64. }],
  65. gridConfig: {
  66. idField: 'id',
  67. codeField: 'cu_code',
  68. statusCodeField:'cu_statuscode',
  69. dataUrl: '/api/document/customer/list',
  70. caller: 'Customer',
  71. columns : [
  72. {
  73. text : "客户id",
  74. hidden:true,
  75. dataIndex : "id",
  76. xtype : "numbercolumn",
  77. },{
  78. text : "客户编号",
  79. width : 150.0,
  80. dataIndex : "cu_code"
  81. },{
  82. text : "客户简称",
  83. width : 150.0,
  84. dataIndex : "cu_shortname",
  85. hidden: true
  86. },
  87. {
  88. text : "客户名称",
  89. width : 200.0,
  90. dataIndex : "cu_name"
  91. }, {
  92. text : "状态",
  93. dataIndex : "cu_status",
  94. align: 'center',
  95. width : 80.0
  96. }, {
  97. text : "类型",
  98. dataIndex : "cu_type",
  99. width : 100.0
  100. }, {
  101. text : "税率(%)",
  102. dataIndex : "cu_taxrate",
  103. xtype: 'numbercolumn',
  104. width : 80.0,
  105. renderer : function(v, m, r) {
  106. return saas.util.BaseUtil.numberFormat(v, 2, false);
  107. }
  108. }, {
  109. text : "结算天数",
  110. xtype: 'numbercolumn',
  111. dataIndex : "cu_promisedays",
  112. renderer : function(v, m, r) {
  113. return Ext.util.Format.number(v, '0');
  114. }
  115. }, {
  116. text: '币别',
  117. dataIndex: 'cu_currency',
  118. align: 'center',
  119. width: 65
  120. }, {
  121. text : "业务员",
  122. dataIndex : "cu_sellername",
  123. width: 110
  124. }, {
  125. text : "备注",
  126. dataIndex : "cu_remark",
  127. width: 250
  128. }]
  129. }
  130. });
  131. me.callParent(arguments);
  132. },
  133. refresh:function(){
  134. this.items.items[0].store.load()
  135. }
  136. });