QueryPanelController.js 9.1 KB

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