SaleProfitController.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. Ext.define('saas.view.sale.report.SaleProfitController', {
  2. extend: 'saas.view.core.report.ReportPanelController',
  3. alias: 'controller.sale-report-saleprofit',
  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:'sa_custcode'
  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. 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. //放大镜赋值关系 以及 tpl模板
  111. 'dbfindtrigger[name=pr_code]':{
  112. beforerender:function(f){
  113. Ext.apply(f,{
  114. dataUrl:'/api/document/product/list',
  115. addXtype: 'document-product-formpanel',
  116. addTitle: '物料资料',
  117. dbfinds:[
  118. {
  119. from:'pr_code',to:'pr_code'
  120. }, {
  121. from:'pr_detail',to:'pr_detail'
  122. }, {
  123. from:'pr_spec',to:'pr_spec'
  124. }],
  125. dbtpls:[{
  126. field:'pr_code',width:100
  127. },{
  128. field:'pr_detail',width:100
  129. }],
  130. defaultCondition: "pr_statuscode='OPEN'",
  131. dbSearchFields:[{
  132. emptyText:'输入物料编号、名称或规格',
  133. xtype : "textfield",
  134. name : "search",
  135. width: 200,
  136. getCondition: function(v) {
  137. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  138. },
  139. allowBlank : true,
  140. columnWidth : 0.25
  141. }],
  142. dbColumns:[{
  143. "text": "物料ID",
  144. "hidden": true,
  145. "dataIndex": "id",
  146. }, {
  147. "text": "物料编号",
  148. "dataIndex": "pr_code",
  149. "width": 200,
  150. }, {
  151. "text": "物料名称",
  152. "width": 200,
  153. "dataIndex": "pr_detail",
  154. }, {
  155. "text": "规格",
  156. "dataIndex": "pr_spec",
  157. "width": 100,
  158. }, {
  159. "text": "单位",
  160. "dataIndex": "pr_unit",
  161. "width": 100,
  162. },{
  163. "text": "仓库id",
  164. "dataIndex": "pr_whid",
  165. "hidden": true,
  166. },{
  167. "text": "仓库编号",
  168. "dataIndex": "pr_whcode",
  169. "hidden": true,
  170. },{
  171. "text": "仓库",
  172. "dataIndex": "pr_whname",
  173. "width": 200,
  174. },{
  175. "text": "总库存数",
  176. "dataIndex": "po_onhand",
  177. "width": 100,
  178. xtype: 'numbercolumn',
  179. align:'end'
  180. },{
  181. "text": "类型",
  182. "dataIndex": "pr_kind",
  183. "width": 100,
  184. },{
  185. "text": "型号",
  186. "dataIndex": "pr_orispeccode",
  187. "width": 100,
  188. },{
  189. "text": "品牌",
  190. "dataIndex": "pr_brand",
  191. "width": 100,
  192. },{
  193. "text": "供应商",
  194. "dataIndex": "pr_vendname",
  195. "width": 100,
  196. },{
  197. "text": "最小包装",
  198. "dataIndex": "pr_zxbzs",
  199. "width": 100,
  200. xtype: 'numbercolumn',
  201. align:'end'
  202. },{
  203. "text": "L/T",
  204. "dataIndex": "pr_leadtime",
  205. "width": 100,
  206. }]
  207. }) ;
  208. }
  209. }
  210. });
  211. }
  212. });