QueryPanelController.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. dbfinds:[
  15. {
  16. from:'id',to:'pi_custid'
  17. },{
  18. from:'cu_code',to:'pi_custcode'
  19. },{
  20. from:'cu_name',to:'pi_custname'
  21. }],
  22. dbtpls:[
  23. {
  24. field:'cu_code',width:100
  25. },{
  26. field:'cu_name',width:100
  27. }],
  28. dbColumns:[
  29. {
  30. conditionCode:'id',
  31. "text": "客户ID",
  32. "flex": 0,
  33. "dataIndex": "id",
  34. "width": 100,
  35. "xtype": "",
  36. "items": null
  37. },{
  38. conditionCode:'cu_code',
  39. "text": "客户编号",
  40. "flex": 1,
  41. "dataIndex": "cu_code",
  42. "width": 100,
  43. "xtype": "",
  44. "items": null
  45. }, {
  46. conditionCode:'cu_name',
  47. "text": "客户名称",
  48. "flex": 1,
  49. "dataIndex": "cu_name",
  50. "xtype": "",
  51. "items": null
  52. }, {
  53. conditionCode:'cu_type',
  54. "text": "客户类型",
  55. "flex": 0,
  56. "dataIndex": "cu_type",
  57. "width": 200,
  58. "xtype": "",
  59. "items": null
  60. }]
  61. }) ;
  62. }
  63. },
  64. // 物料编号
  65. 'dbfindtrigger[name=pd_prodcode]':{
  66. beforerender:function(f){
  67. Ext.apply(f,{
  68. dataUrl:'/api/document/product/list',
  69. addXtype: 'document-product-formpanel',
  70. addTitle: '物料资料',
  71. dbfinds:[{
  72. from:'pr_code',to:'pd_prodcode'
  73. }, {
  74. from:'pr_detail',to:'pr_detail'
  75. }],
  76. dbtpls:[
  77. {
  78. field:'pr_code',width:100
  79. },{
  80. field:'pr_detail',width:100
  81. }],
  82. defaultCondition: "pr_statuscode='OPEN'",
  83. dbSearchFields:[{
  84. emptyText:'输入物料编号、名称或规格',
  85. xtype : "textfield",
  86. name : "search",
  87. width: 200,
  88. getCondition: function(v) {
  89. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  90. },
  91. allowBlank : true,
  92. columnWidth : 0.25
  93. }],
  94. dbColumns:[{
  95. "text": "物料ID",
  96. "hidden": true,
  97. "dataIndex": "id",
  98. }, {
  99. "text": "物料编号",
  100. "dataIndex": "pr_code",
  101. "width": 200,
  102. }, {
  103. "text": "物料名称",
  104. "width": 200,
  105. "dataIndex": "pr_detail",
  106. }, {
  107. "text": "规格",
  108. "dataIndex": "pr_spec",
  109. "width": 100,
  110. }, {
  111. "text": "单位",
  112. "dataIndex": "pr_spec",
  113. "width": 100,
  114. },{
  115. "text": "仓库id",
  116. "dataIndex": "pr_whid",
  117. "hidden": true,
  118. },{
  119. "text": "仓库编号",
  120. "dataIndex": "pr_whcode",
  121. "hidden": true,
  122. },{
  123. "text": "仓库",
  124. "dataIndex": "pr_whname",
  125. "width": 200,
  126. },{
  127. "text": "总库存数",
  128. "dataIndex": "po_onhand",
  129. "width": 100,
  130. },{
  131. "text": "类型",
  132. "dataIndex": "pr_kind",
  133. "width": 100,
  134. },{
  135. "text": "型号",
  136. "dataIndex": "pr_orispeccode",
  137. "width": 100,
  138. },{
  139. "text": "品牌",
  140. "dataIndex": "pr_brand",
  141. "width": 100,
  142. },{
  143. "text": "供应商",
  144. "dataIndex": "pr_vendname",
  145. "width": 100,
  146. },{
  147. "text": "最小包装",
  148. "dataIndex": "pr_zxbzs",
  149. "width": 100,
  150. },{
  151. "text": "L/T",
  152. "dataIndex": "pr_leadtime",
  153. "width": 100,
  154. }]
  155. }) ;
  156. }
  157. }
  158. });
  159. }
  160. });