QueryPanelController.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. {
  96. "text": "物料ID",
  97. "hidden": true,
  98. "dataIndex": "id",
  99. },{
  100. "text": "物料编号",
  101. "flex": 1,
  102. "dataIndex": "pr_code",
  103. "width": 100,
  104. "xtype": "",
  105. "items": null
  106. }, {
  107. "text": "物料名称",
  108. "flex": 1,
  109. "dataIndex": "pr_detail",
  110. "xtype": "",
  111. "items": null
  112. }, {
  113. "text": "规格",
  114. "flex": 1,
  115. "dataIndex": "pr_spec",
  116. "width": 200,
  117. "xtype": "",
  118. "items": null
  119. }, {
  120. "text": "单位",
  121. "flex": 1,
  122. "dataIndex": "pr_unit",
  123. "width": 200,
  124. "xtype": "",
  125. "items": null
  126. }, {
  127. "text": "品牌",
  128. "flex": 1,
  129. "dataIndex": "pr_brand",
  130. "width": 200,
  131. "xtype": "",
  132. "items": null
  133. }, {
  134. "text": "供应商ID",
  135. "flex": 0,
  136. "dataIndex": "pr_vendid",
  137. "width": 0,
  138. "xtype": "",
  139. "items": null
  140. }, {
  141. "text": "供应商编号",
  142. "flex": 1,
  143. "dataIndex": "pr_vendcode",
  144. "width": 200,
  145. "xtype": "",
  146. "items": null
  147. }, {
  148. "text": "供应商名称",
  149. "flex": 1,
  150. "dataIndex": "pr_vendname",
  151. "width": 200,
  152. "xtype": "",
  153. "items": null
  154. }, {
  155. "text": "最小包装量",
  156. "flex": 1,
  157. "dataIndex": "pr_zxbzs",
  158. "width": 200,
  159. "xtype": "",
  160. "items": null
  161. }]
  162. }) ;
  163. }
  164. }
  165. });
  166. }
  167. });