QueryPanelController.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. Ext.define('saas.view.stock.make.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.stock-make-querypanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pu_vendname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/vendor/list',
  12. addXtype: 'document-vendor-formpanel',
  13. addTitle: '供应商资料',
  14. dbfinds:[{
  15. from:'ve_code',to:'pu_vendcode'
  16. },{
  17. from:'ve_name',to:'pu_vendname'
  18. }],
  19. dbtpls:[{
  20. field:'ve_code',width:100
  21. },{
  22. field:'ve_name',width:100
  23. }],
  24. defaultCondition: "ve_statuscode='OPEN'",
  25. dbSearchFields:[{
  26. emptyText:'输入供应商编号或名称',
  27. xtype : "textfield",
  28. name : "search",
  29. getCondition: function(v) {
  30. return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
  31. },
  32. allowBlank : true,
  33. columnWidth : 0.25
  34. }],
  35. dbColumns:[{
  36. "text": "供应商ID",
  37. "hidden": true,
  38. "dataIndex": "id",
  39. "width": 100,
  40. "xtype": "numbercolumn"
  41. },{
  42. "text": "供应商编号",
  43. "dataIndex": "ve_code",
  44. "width": 200
  45. }, {
  46. "text": "供应商名称",
  47. "dataIndex": "ve_name",
  48. "width": 200
  49. }, {
  50. "text": "供应商类型",
  51. "dataIndex": "ve_type",
  52. "width": 180,
  53. "items": null
  54. }, {
  55. "text": "税率",
  56. "dataIndex": "ve_taxrate",
  57. "width": 100,
  58. xtype: 'numbercolumn',
  59. align: 'end'
  60. }, {
  61. "text": "承付天数",
  62. "dataIndex": "ve_promisedays",
  63. "width": 100,
  64. xtype: 'numbercolumn',
  65. align: 'end',
  66. renderer : function(v) {
  67. return Ext.util.Format.number(v, '0');
  68. }
  69. }, {
  70. "text": "纳税人识别号",
  71. "dataIndex": "ve_bankaccount",
  72. "width": 150
  73. }, {
  74. "text": "开户银行",
  75. "dataIndex": "ve_bankaccount",
  76. "width": 100
  77. }, {
  78. "text": "银行账户",
  79. "dataIndex": "ve_bankcode",
  80. "width": 100
  81. }]
  82. }) ;
  83. }
  84. },
  85. //放大镜赋值关系 以及 tpl模板
  86. 'dbfindtrigger[name=pd_prodcode]':{
  87. beforerender:function(f){
  88. Ext.apply(f,{
  89. conditionCode:'pr_code',
  90. dataUrl:'/api/document/product/list',
  91. addXtype: 'document-product-formpanel',
  92. addTitle: '物料资料',
  93. dbfinds:[{
  94. from:'pr_code',to:'pd_prodcode',
  95. }, {
  96. from:'pr_detail',to:'pr_detail'
  97. }],
  98. dbtpls:[{
  99. field:'pr_code',width:100
  100. },{
  101. field:'pr_detail',width:100
  102. }],
  103. defaultCondition: "pr_statuscode='OPEN'",
  104. dbSearchFields:[{
  105. emptyText:'输入物料编号、名称或规格',
  106. xtype : "textfield",
  107. name : "search",
  108. width: 200,
  109. getCondition: function(v) {
  110. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  111. },
  112. allowBlank : true,
  113. columnWidth : 0.25
  114. }],
  115. dbColumns:[{
  116. "text": "物料ID",
  117. "hidden": true,
  118. "dataIndex": "id",
  119. }, {
  120. "text": "物料编号",
  121. "dataIndex": "pr_code",
  122. "width": 200,
  123. }, {
  124. "text": "物料名称",
  125. "width": 200,
  126. "dataIndex": "pr_detail",
  127. }, {
  128. "text": "规格",
  129. "dataIndex": "pr_spec",
  130. "width": 100,
  131. }, {
  132. "text": "单位",
  133. "dataIndex": "pr_spec",
  134. "width": 100,
  135. },{
  136. "text": "仓库id",
  137. "dataIndex": "pr_whid",
  138. "hidden": true,
  139. },{
  140. "text": "仓库编号",
  141. "dataIndex": "pr_whcode",
  142. "hidden": true,
  143. },{
  144. "text": "仓库",
  145. "dataIndex": "pr_whname",
  146. "width": 200,
  147. },{
  148. "text": "总库存数",
  149. "dataIndex": "po_onhand",
  150. "width": 100,
  151. xtype: 'numbercolumn',
  152. align: 'end'
  153. },{
  154. "text": "类型",
  155. "dataIndex": "pr_kind",
  156. "width": 100,
  157. },{
  158. "text": "型号",
  159. "dataIndex": "pr_orispeccode",
  160. "width": 100,
  161. },{
  162. "text": "品牌",
  163. "dataIndex": "pr_brand",
  164. "width": 100,
  165. },{
  166. "text": "供应商",
  167. "dataIndex": "pr_vendname",
  168. "width": 100,
  169. },{
  170. "text": "最小包装",
  171. "dataIndex": "pr_zxbzs",
  172. "width": 100,
  173. xtype: 'numbercolumn',
  174. align: 'end'
  175. },{
  176. "text": "L/T",
  177. "dataIndex": "pr_leadtime",
  178. "width": 100,
  179. }]
  180. }) ;
  181. }
  182. },
  183. 'dbfindtrigger[name=ma_prodcode]':{
  184. beforerender:function(f){
  185. Ext.apply(f,{
  186. //数据接口
  187. dataUrl:'/api/document/bom/list',
  188. addXtype: 'document-bom-formpanel',
  189. addTitle: 'BOM资料',
  190. //放大镜赋值设置
  191. dbfinds:[{
  192. from:'bo_motherid',to:'ma_prodid'
  193. },{
  194. from:'bo_mothercode',to:'ma_prodcode'
  195. },{
  196. from:'bo_mothername',to:'ma_proddetail'
  197. },{
  198. from:'pr_spec',to:'ma_prodspec'
  199. },{
  200. from:'bo_version',to:'ma_version'
  201. }],
  202. //联想设置
  203. dbtpls:[{
  204. field:'bo_mothercode',width:100
  205. },{
  206. field:'bo_mothername',width:100
  207. }],
  208. defaultCondition:"bo_statuscode='OPEN'",
  209. //窗口字段设置
  210. dbSearchFields:[{
  211. emptyText:'输入BOM编号或名称',
  212. xtype : "textfield",
  213. name : "search",
  214. width: 200,
  215. getCondition: function(v) {
  216. return "(upper(bo_mothercode) like '%"+v.toUpperCase()+"%' or upper(bo_mothername) like '%"+v.toUpperCase()+"%')";
  217. },
  218. allowBlank : true,
  219. columnWidth : 0.25
  220. }],
  221. //窗口列设置
  222. dbColumns:[{
  223. "text": "物料ID",
  224. "hidden": true,
  225. "dataIndex": "id",
  226. }, {
  227. "text": "产品编号",
  228. "dataIndex": "bo_mothercode",
  229. "width": 200,
  230. }, {
  231. "text": "产品名称",
  232. "width": 200,
  233. "dataIndex": "bo_mothername",
  234. }, {
  235. "text": "产品规格",
  236. "width": 200,
  237. "dataIndex": "pr_spec",
  238. }, {
  239. "text": "版本",
  240. "width": 200,
  241. "dataIndex": "bo_version",
  242. }]
  243. }) ;
  244. }
  245. },
  246. });
  247. }
  248. });