SaleController.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. conditionCode:'id',
  42. "text": "客户ID",
  43. "flex": 0,
  44. "dataIndex": "id",
  45. "width": 0,
  46. "xtype": "",
  47. "items": null
  48. },{
  49. conditionCode:'cu_code',
  50. "text": "客户编号",
  51. "flex": 1,
  52. "dataIndex": "cu_code",
  53. "width": 100,
  54. "xtype": "",
  55. "items": null
  56. }, {
  57. conditionCode:'cu_name',
  58. "text": "客户名称",
  59. "flex": 1,
  60. "dataIndex": "cu_name",
  61. "xtype": "",
  62. "items": null
  63. }, {
  64. conditionCode:'cu_type',
  65. "text": "客户类型",
  66. "flex": 1,
  67. "dataIndex": "cu_type",
  68. "width": 200,
  69. "xtype": "",
  70. "items": null
  71. }, {
  72. "text": "业务员编号",
  73. "flex": 1,
  74. "dataIndex": "cu_sellercode",
  75. "width": 100
  76. }, {
  77. "text": "业务员",
  78. "flex": 1,
  79. "dataIndex": "cu_sellername",
  80. "width": 100
  81. }, {
  82. "text": "税率",
  83. "flex": 1,
  84. "dataIndex": "cu_taxrate",
  85. "width": 100,
  86. xtype: 'numbercolumn',
  87. }, {
  88. "text": "承付天数",
  89. "flex": 1,
  90. "dataIndex": "cu_promisedays",
  91. "width": 100,
  92. xtype: 'numbercolumn',
  93. align: 'end'
  94. }, {
  95. "text": "额度",
  96. "flex": 1,
  97. "dataIndex": "cu_credit",
  98. "width": 100,
  99. xtype: 'numbercolumn',
  100. }, {
  101. "text": "客户地址",
  102. "flex": 1,
  103. "dataIndex": "ca_address",
  104. "width": 250
  105. }]
  106. }) ;
  107. }
  108. }
  109. });
  110. }
  111. });