SaleController.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. Ext.define('saas.view.sale.report.SaleController', {
  2. extend: 'saas.view.core.report.ReportPanelController',
  3. alias: 'controller.sale-report-sale',
  4. init: function (form) {
  5. this.control({
  6. //放大镜赋值关系 以及 tpl模板
  7. 'dbfindtrigger[name=sa_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:'sa_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. }, {
  84. "text": "承付天数",
  85. "flex": 1,
  86. "dataIndex": "cu_promisedays",
  87. "width": 100,
  88. xtype: 'numbercolumn',
  89. align: 'end',
  90. renderer : function(v) {
  91. return Ext.util.Format.number(v, '0');
  92. }
  93. }, {
  94. "text": "额度",
  95. "flex": 1,
  96. "dataIndex": "cu_credit",
  97. "width": 100,
  98. xtype: 'numbercolumn',
  99. }, {
  100. "text": "客户地址",
  101. "flex": 1,
  102. "dataIndex": "ca_address",
  103. "width": 250
  104. }]
  105. }) ;
  106. }
  107. }
  108. });
  109. }
  110. });