QueryPanelController.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. Ext.define('saas.view.sale.sale.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.sale-sale-querypanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=sa_custname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/customer/dbfind',
  12. addXtype: 'document-customer-formpanel',
  13. addTitle: '客户资料',
  14. defaultCondition:"cu_statuscode='OPEN'",
  15. dbfinds:[{
  16. from:'cu_id',to:'sa_custid',ignore:true
  17. },{
  18. from:'cu_code',to:'sa_custcode'
  19. },{
  20. from:'cu_name',to:'sa_custname'
  21. }],
  22. dbtpls:[{
  23. field:'cu_code',width:100
  24. },{
  25. field:'cu_name',width:100
  26. }],
  27. dbSearchFields:[{
  28. emptyText:'输入客户编号或客户名称',
  29. xtype : "textfield",
  30. name : "search",
  31. getCondition: function(v) {
  32. return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
  33. },
  34. allowBlank : true,
  35. columnWidth : 0.25
  36. }],
  37. dbColumns:[
  38. {
  39. conditionCode:'id',
  40. "text": "客户ID",
  41. "flex": 0,
  42. "dataIndex": "id",
  43. "width": 0,
  44. "xtype": "",
  45. "items": null
  46. },{
  47. conditionCode:'cu_code',
  48. "text": "客户编号",
  49. "flex": 1,
  50. "dataIndex": "cu_code",
  51. "width": 100,
  52. "xtype": "",
  53. "items": null
  54. }, {
  55. conditionCode:'cu_name',
  56. "text": "客户名称",
  57. "flex": 1,
  58. "dataIndex": "cu_name",
  59. "xtype": "",
  60. "items": null
  61. }, {
  62. conditionCode:'cu_type',
  63. "text": "客户类型",
  64. "flex": 1,
  65. "dataIndex": "cu_type",
  66. "width": 200,
  67. "xtype": "",
  68. "items": null
  69. }, {
  70. "text": "业务员编号",
  71. "flex": 1,
  72. "dataIndex": "cu_sellercode",
  73. "width": 100
  74. }, {
  75. "text": "业务员",
  76. "flex": 1,
  77. "dataIndex": "cu_sellername",
  78. "width": 100
  79. }, {
  80. "text": "税率",
  81. "flex": 1,
  82. "dataIndex": "cu_taxrate",
  83. "width": 100
  84. }, {
  85. "text": "承付天数",
  86. "flex": 1,
  87. "dataIndex": "cu_promisedays",
  88. "width": 100
  89. }, {
  90. "text": "额度",
  91. "flex": 1,
  92. "dataIndex": "cu_credit",
  93. "width": 100
  94. }, {
  95. "text": "客户地址",
  96. "flex": 1,
  97. "dataIndex": "ca_address",
  98. "width": 250
  99. }]
  100. }) ;
  101. }
  102. },
  103. //放大镜赋值关系 以及 tpl模板
  104. 'dbfindtrigger[name=pr_detail]':{
  105. beforerender:function(f){
  106. Ext.apply(f,{
  107. dataUrl:'/api/document/product/list',
  108. addXtype: 'document-product-formpanel',
  109. addTitle: '物料资料',
  110. dbfinds:[{
  111. from:'pr_code',to:'sd_prodcode'
  112. },{
  113. from:'pr_detail',to:'pr_detail'
  114. }],
  115. dbtpls:[{
  116. field:'pr_code',width:100
  117. },{
  118. field:'pr_detail',width:100
  119. }],
  120. defaultCondition: "pr_statuscode='OPEN'",
  121. dbSearchFields:[{
  122. emptyText:'输入物料编号、名称或规格',
  123. xtype : "textfield",
  124. name : "search",
  125. width: 200,
  126. getCondition: function(v) {
  127. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  128. },
  129. allowBlank : true,
  130. columnWidth : 0.25
  131. }],
  132. dbColumns:[{
  133. "text": "物料ID",
  134. "hidden": true,
  135. "dataIndex": "id",
  136. }, {
  137. "text": "物料编号",
  138. "dataIndex": "pr_code",
  139. "width": 200,
  140. }, {
  141. "text": "物料名称",
  142. "width": 200,
  143. "dataIndex": "pr_detail",
  144. }, {
  145. "text": "规格",
  146. "dataIndex": "pr_spec",
  147. "width": 100,
  148. }, {
  149. "text": "单位",
  150. "dataIndex": "pr_spec",
  151. "width": 100,
  152. },{
  153. "text": "仓库id",
  154. "dataIndex": "pr_whid",
  155. "hidden": true,
  156. },{
  157. "text": "仓库编号",
  158. "dataIndex": "pr_whcode",
  159. "hidden": true,
  160. },{
  161. "text": "仓库",
  162. "dataIndex": "pr_whname",
  163. "width": 200,
  164. },{
  165. "text": "总库存数",
  166. "dataIndex": "po_onhand",
  167. "width": 100,
  168. },{
  169. "text": "类型",
  170. "dataIndex": "pr_kind",
  171. "width": 100,
  172. },{
  173. "text": "型号",
  174. "dataIndex": "pr_orispeccode",
  175. "width": 100,
  176. },{
  177. "text": "品牌",
  178. "dataIndex": "pr_brand",
  179. "width": 100,
  180. },{
  181. "text": "供应商",
  182. "dataIndex": "pr_vendname",
  183. "width": 100,
  184. },{
  185. "text": "最小包装",
  186. "dataIndex": "pr_zxbzs",
  187. "width": 100,
  188. },{
  189. "text": "L/T",
  190. "dataIndex": "pr_leadtime",
  191. "width": 100,
  192. }]
  193. }) ;
  194. }
  195. }
  196. });
  197. }
  198. });