QueryPanelController.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. Ext.define('saas.view.sale.saleIn.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.sale-salein-querypanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. // 客户名称
  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. dbSearchFields:[{
  24. emptyText:'输入客户编号或客户名称',
  25. xtype : "textfield",
  26. name : "search",
  27. getCondition: function(v) {
  28. return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
  29. },
  30. allowBlank : true,
  31. columnWidth : 0.25
  32. }],
  33. dbColumns:[
  34. {
  35. "text": "客户ID",
  36. "flex": 0,
  37. "dataIndex": "id",
  38. "width": 0,
  39. "xtype": "",
  40. "items": null
  41. },{
  42. "text": "客户编号",
  43. "flex": 1,
  44. "dataIndex": "cu_code",
  45. "width": 100,
  46. "xtype": "",
  47. "items": null
  48. }, {
  49. "text": "客户名称",
  50. "flex": 1,
  51. "dataIndex": "cu_name",
  52. "xtype": "",
  53. "items": null
  54. }, {
  55. "text": "客户类型",
  56. "flex": 1,
  57. "dataIndex": "cu_type",
  58. "width": 200,
  59. "xtype": "",
  60. "items": null
  61. }, {
  62. "text": "业务员编号",
  63. "flex": 1,
  64. "dataIndex": "cu_sellercode",
  65. "width": 100
  66. }, {
  67. "text": "业务员",
  68. "flex": 1,
  69. "dataIndex": "cu_sellername",
  70. "width": 100
  71. }, {
  72. "text": "税率",
  73. "flex": 1,
  74. "dataIndex": "cu_taxrate",
  75. "width": 100,
  76. xtype: 'numbercolumn',
  77. align: 'end'
  78. }, {
  79. "text": "承付天数",
  80. "flex": 1,
  81. "dataIndex": "cu_promisedays",
  82. "width": 100,
  83. xtype: 'numbercolumn',
  84. align: 'end'
  85. }, {
  86. "text": "额度",
  87. "flex": 1,
  88. "dataIndex": "cu_credit",
  89. "width": 100,
  90. xtype: 'numbercolumn',
  91. align: 'end'
  92. }, {
  93. "text": "客户地址",
  94. "flex": 1,
  95. "dataIndex": "ca_address",
  96. "width": 250
  97. }]
  98. }) ;
  99. }
  100. },
  101. // 物料编号
  102. 'dbfindtrigger[name=pd_prodcode]':{
  103. beforerender:function(f){
  104. Ext.apply(f,{
  105. dataUrl:'/api/document/product/list',
  106. addXtype: 'document-product-formpanel',
  107. addTitle: '物料资料',
  108. dbfinds:[{
  109. from:'pr_code',to:'pd_prodcode',ignore:true
  110. }, {
  111. from:'pr_detail',to:'pr_detail'
  112. }],
  113. dbtpls:[
  114. {
  115. field:'pr_code',width:100
  116. },{
  117. field:'pr_detail',width:100
  118. }],
  119. defaultCondition: "pr_statuscode='OPEN'",
  120. dbSearchFields:[{
  121. emptyText:'输入物料编号、名称或规格',
  122. xtype : "textfield",
  123. name : "search",
  124. width: 200,
  125. getCondition: function(v) {
  126. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  127. },
  128. allowBlank : true,
  129. columnWidth : 0.25
  130. }],
  131. dbColumns:[{
  132. "text": "物料ID",
  133. "hidden": true,
  134. "dataIndex": "id",
  135. }, {
  136. "text": "物料编号",
  137. "dataIndex": "pr_code",
  138. "width": 200,
  139. }, {
  140. "text": "物料名称",
  141. "width": 200,
  142. "dataIndex": "pr_detail",
  143. }, {
  144. "text": "规格",
  145. "dataIndex": "pr_spec",
  146. "width": 100,
  147. }, {
  148. "text": "单位",
  149. "dataIndex": "pr_spec",
  150. "width": 100,
  151. },{
  152. "text": "仓库id",
  153. "dataIndex": "pr_whid",
  154. "hidden": true,
  155. },{
  156. "text": "仓库编号",
  157. "dataIndex": "pr_whcode",
  158. "hidden": true,
  159. },{
  160. "text": "仓库",
  161. "dataIndex": "pr_whname",
  162. "width": 200,
  163. },{
  164. "text": "总库存数",
  165. "dataIndex": "po_onhand",
  166. "width": 100,
  167. xtype: 'numbercolumn',
  168. align: 'end'
  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. xtype: 'numbercolumn',
  190. align: 'end'
  191. },{
  192. "text": "L/T",
  193. "dataIndex": "pr_leadtime",
  194. "width": 100,
  195. }]
  196. }) ;
  197. }
  198. }
  199. });
  200. }
  201. });