QueryPanelController.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. Ext.define('saas.view.sale.saleout.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.sale-saleout-querypanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pi_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. {
  17. from:'id',to:'pi_custid',ignore:true
  18. },{
  19. from:'cu_code',to:'pi_custcode'
  20. },{
  21. from:'cu_name',to:'pi_custname'
  22. },{
  23. from:'ca_address',to:'ca_address'
  24. }],
  25. dbtpls:[
  26. {
  27. field:'cu_code',width:100
  28. },{
  29. field:'cu_name',width:100
  30. }],
  31. dbSearchFields:[{
  32. emptyText:'输入客户编号或客户名称',
  33. xtype : "textfield",
  34. name : "search",
  35. getCondition: function(v) {
  36. return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
  37. },
  38. allowBlank : true,
  39. columnWidth : 0.25
  40. }],
  41. dbColumns:[
  42. {
  43. "text": "客户ID",
  44. "flex": 0,
  45. "dataIndex": "id",
  46. "width": 0,
  47. "xtype": "",
  48. "items": null
  49. },{
  50. "text": "客户编号",
  51. "flex": 1,
  52. "dataIndex": "cu_code",
  53. "width": 100,
  54. "xtype": "",
  55. "items": null
  56. }, {
  57. "text": "客户名称",
  58. "flex": 1,
  59. "dataIndex": "cu_name",
  60. "xtype": "",
  61. "items": null
  62. }, {
  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. // 物料编号
  104. 'dbfindtrigger[name=pd_prodcode]':{
  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:'pd_prodcode'
  112. }, {
  113. from:'pr_detail',to:'pr_detail'
  114. }],
  115. dbtpls:[
  116. {
  117. field:'pr_code',width:100
  118. },{
  119. field:'pr_detail',width:100
  120. }],
  121. defaultCondition: "pr_statuscode='OPEN'",
  122. dbSearchFields:[{
  123. emptyText:'输入物料编号、名称或规格',
  124. xtype : "textfield",
  125. name : "search",
  126. width: 200,
  127. getCondition: function(v) {
  128. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  129. },
  130. allowBlank : true,
  131. columnWidth : 0.25
  132. }],
  133. dbColumns:[{
  134. "text": "物料ID",
  135. "hidden": true,
  136. "dataIndex": "id",
  137. }, {
  138. "text": "物料编号",
  139. "dataIndex": "pr_code",
  140. "width": 200,
  141. }, {
  142. "text": "物料名称",
  143. "width": 200,
  144. "dataIndex": "pr_detail",
  145. }, {
  146. "text": "规格",
  147. "dataIndex": "pr_spec",
  148. "width": 100,
  149. }, {
  150. "text": "单位",
  151. "dataIndex": "pr_spec",
  152. "width": 100,
  153. },{
  154. "text": "仓库id",
  155. "dataIndex": "pr_whid",
  156. "hidden": true,
  157. },{
  158. "text": "仓库编号",
  159. "dataIndex": "pr_whcode",
  160. "hidden": true,
  161. },{
  162. "text": "仓库",
  163. "dataIndex": "pr_whname",
  164. "width": 200,
  165. },{
  166. "text": "总库存数",
  167. "dataIndex": "po_onhand",
  168. "width": 100,
  169. },{
  170. "text": "类型",
  171. "dataIndex": "pr_kind",
  172. "width": 100,
  173. },{
  174. "text": "型号",
  175. "dataIndex": "pr_orispeccode",
  176. "width": 100,
  177. },{
  178. "text": "品牌",
  179. "dataIndex": "pr_brand",
  180. "width": 100,
  181. },{
  182. "text": "供应商",
  183. "dataIndex": "pr_vendname",
  184. "width": 100,
  185. },{
  186. "text": "最小包装",
  187. "dataIndex": "pr_zxbzs",
  188. "width": 100,
  189. },{
  190. "text": "L/T",
  191. "dataIndex": "pr_leadtime",
  192. "width": 100,
  193. }]
  194. }) ;
  195. }
  196. }
  197. });
  198. }
  199. });