SaleProfitController.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. 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. align: 'end'
  88. }, {
  89. "text": "承付天数",
  90. "flex": 1,
  91. "dataIndex": "cu_promisedays",
  92. "width": 100,
  93. xtype: 'numbercolumn',
  94. align: 'end',
  95. renderer : function(v) {
  96. return Ext.util.Format.number(v, '0');
  97. }
  98. }, {
  99. "text": "额度",
  100. "flex": 1,
  101. "dataIndex": "cu_credit",
  102. "width": 100,
  103. xtype: 'numbercolumn',
  104. align: 'end'
  105. }, {
  106. "text": "客户地址",
  107. "flex": 1,
  108. "dataIndex": "ca_address",
  109. "width": 250
  110. }]
  111. }) ;
  112. }
  113. },
  114. //放大镜赋值关系 以及 tpl模板
  115. 'dbfindtrigger[name=sd_prodcode]':{
  116. beforerender:function(f){
  117. Ext.apply(f,{
  118. dataUrl:'/api/document/product/list',
  119. addXtype: 'document-product-formpanel',
  120. addTitle: '物料资料',
  121. dbfinds:[
  122. {
  123. from:'pr_code',to:'sd_prodcode'
  124. }, {
  125. from:'pr_detail',to:'pr_detail'
  126. }, {
  127. from:'pr_spec',to:'pr_spec'
  128. }],
  129. dbtpls:[{
  130. field:'pr_code',width:100
  131. },{
  132. field:'pr_detail',width:100
  133. }],
  134. defaultCondition: "pr_statuscode='OPEN'",
  135. dbSearchFields:[{
  136. emptyText:'输入物料编号、名称或规格',
  137. xtype : "textfield",
  138. name : "search",
  139. width: 200,
  140. getCondition: function(v) {
  141. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  142. },
  143. allowBlank : true,
  144. columnWidth : 0.25
  145. }],
  146. dbColumns:[{
  147. "text": "物料ID",
  148. "hidden": true,
  149. "dataIndex": "id",
  150. }, {
  151. "text": "物料编号",
  152. "dataIndex": "pr_code",
  153. "width": 200,
  154. }, {
  155. "text": "物料名称",
  156. "width": 200,
  157. "dataIndex": "pr_detail",
  158. }, {
  159. "text": "规格",
  160. "dataIndex": "pr_spec",
  161. "width": 100,
  162. }, {
  163. "text": "单位",
  164. "dataIndex": "pr_unit",
  165. "width": 100,
  166. },{
  167. "text": "仓库id",
  168. "dataIndex": "pr_whid",
  169. "hidden": true,
  170. },{
  171. "text": "仓库编号",
  172. "dataIndex": "pr_whcode",
  173. "hidden": true,
  174. },{
  175. "text": "仓库",
  176. "dataIndex": "pr_whname",
  177. "width": 200,
  178. },{
  179. "text": "总库存数",
  180. "dataIndex": "po_onhand",
  181. "width": 100,
  182. xtype: 'numbercolumn',
  183. align:'end'
  184. },{
  185. "text": "类型",
  186. "dataIndex": "pr_kind",
  187. "width": 100,
  188. },{
  189. "text": "型号",
  190. "dataIndex": "pr_orispeccode",
  191. "width": 100,
  192. },{
  193. "text": "品牌",
  194. "dataIndex": "pr_brand",
  195. "width": 100,
  196. },{
  197. "text": "供应商",
  198. "dataIndex": "pr_vendname",
  199. "width": 100,
  200. },{
  201. "text": "最小包装",
  202. "dataIndex": "pr_zxbzs",
  203. "width": 100,
  204. xtype: 'numbercolumn',
  205. align:'end'
  206. },{
  207. "text": "L/T",
  208. "dataIndex": "pr_leadtime",
  209. "width": 100,
  210. }]
  211. }) ;
  212. }
  213. }
  214. });
  215. }
  216. });