SaleRecController.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. Ext.define('saas.view.sale.report.SaleRecController', {
  2. extend: 'saas.view.core.report.ReportPanelController',
  3. alias: 'controller.sale-report-salerec',
  4. init: function (form) {
  5. this.control({
  6. //放大镜赋值关系 以及 tpl模板
  7. 'dbfindtrigger[name=rb_custname]':{
  8. beforerender:function(f){
  9. Ext.apply(f,{
  10. dataUrl:'/api/document/customer/dbfind',
  11. addXtype: 'document-customer-formpanel',
  12. addTitle: '客户资料',
  13. defaultCondition:"cu_statuscode='OPEN'",
  14. dbfinds:[
  15. {
  16. from:'id',to:'id',ignore:true
  17. },{
  18. from:'cu_code',to:'cu_code'
  19. },{
  20. from:'cu_name',to:'rb_custname'
  21. },{
  22. from:'ca_address',to:'ca_address'
  23. }],
  24. dbtpls:[{
  25. field:'cu_code',width:100
  26. },{
  27. field:'cu_name',width:100
  28. }],
  29. dbSearchFields:[{
  30. emptyText:'输入客户编号或客户名称',
  31. xtype : "textfield",
  32. name : "search",
  33. getCondition: function(v) {
  34. return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
  35. },
  36. allowBlank : true,
  37. columnWidth : 0.25
  38. }],
  39. dbColumns:[
  40. {
  41. "text": "客户ID",
  42. "flex": 0,
  43. "dataIndex": "id",
  44. "width": 0,
  45. "xtype": "",
  46. "items": null
  47. },{
  48. "text": "客户编号",
  49. "flex": 1,
  50. "dataIndex": "cu_code",
  51. "width": 100,
  52. "xtype": "",
  53. "items": null
  54. }, {
  55. "text": "客户名称",
  56. "flex": 1,
  57. "dataIndex": "cu_name",
  58. "xtype": "",
  59. "items": null
  60. }, {
  61. "text": "客户类型",
  62. "flex": 1,
  63. "dataIndex": "cu_type",
  64. "width": 200,
  65. "xtype": "",
  66. "items": null
  67. }, {
  68. "text": "业务员编号",
  69. "flex": 1,
  70. "dataIndex": "cu_sellercode",
  71. "width": 100
  72. }, {
  73. "text": "业务员",
  74. "flex": 1,
  75. "dataIndex": "cu_sellername",
  76. "width": 100
  77. }, {
  78. "text": "税率",
  79. "flex": 1,
  80. "dataIndex": "cu_taxrate",
  81. "width": 100,
  82. xtype: 'numbercolumn',
  83. align: 'end'
  84. }, {
  85. "text": "承付天数",
  86. "flex": 1,
  87. "dataIndex": "cu_promisedays",
  88. "width": 100,
  89. xtype: 'numbercolumn',
  90. align: 'end',
  91. renderer : function(v) {
  92. return Ext.util.Format.number(v, '0');
  93. }
  94. }, {
  95. "text": "额度",
  96. "flex": 1,
  97. "dataIndex": "cu_credit",
  98. "width": 100,
  99. xtype: 'numbercolumn',
  100. align: 'end'
  101. }, {
  102. "text": "客户地址",
  103. "flex": 1,
  104. "dataIndex": "ca_address",
  105. "width": 250
  106. }]
  107. }) ;
  108. }
  109. }
  110. });
  111. }
  112. });