FormPanelController.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.purchase-purchaseout-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. /**放大镜新增demo*/
  8. "field[name=combo]":{
  9. beforerender:function(f){
  10. f.addHandler=me.addCombo;
  11. }
  12. },
  13. //放大镜赋值关系 以及 tpl模板
  14. 'dbfindtrigger[name=pi_vendname]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. dataUrl:'/api/document/vendor/list',
  18. // dataUrl:'http://localhost:9480/vendor/list',
  19. addXtype: 'document-vendor-formpanel',
  20. addTitle: '供应商资料',
  21. defaultCondition:"ve_statuscode='OPEN'",
  22. dbfinds:[{
  23. from:'ve_id',to:'pi_vendid'
  24. },{
  25. from:'ve_code',to:'pi_vendcode'
  26. },{
  27. from:'ve_name',to:'pi_vendname'
  28. }],
  29. dbtpls:[{
  30. field:'ve_code',width:100
  31. },{
  32. field:'ve_name',width:100
  33. }],
  34. //放大镜窗口字段
  35. dbSearchFields:[{
  36. emptyText:'输入供应商编号或名称',
  37. xtype : "textfield",
  38. name : "ve_name",
  39. allowBlank : true,
  40. columnWidth : 0.25,
  41. getCondition:function(v){
  42. return "(upper(ve_name) like '%"+v.toUpperCase()+"%' or upper(ve_code) like '%"+v.toUpperCase()+"%')";
  43. }
  44. }],
  45. dbColumns:[{
  46. conditionCode:'ve_id',
  47. "text": "供应商ID",
  48. "flex": 0,
  49. "dataIndex": "ve_id",
  50. "width": 0,
  51. "xtype": "",
  52. "items": null
  53. },{
  54. conditionCode:'ve_code',
  55. "text": "供应商编号",
  56. "flex": 1,
  57. "dataIndex": "ve_code",
  58. "width": 100,
  59. "xtype": "",
  60. "items": null
  61. }, {
  62. conditionCode:'ve_name',
  63. "text": "供应商名称",
  64. "flex": 1,
  65. "dataIndex": "ve_name",
  66. "xtype": "",
  67. "items": null
  68. }, {
  69. conditionCode:'ve_type',
  70. "text": "供应商类型",
  71. "flex": 0,
  72. "dataIndex": "ve_type",
  73. "width": 200,
  74. "xtype": "",
  75. "items": null
  76. }]
  77. }) ;
  78. }
  79. },
  80. //放大镜赋值关系 以及 tpl模板
  81. 'multidbfindtrigger[name=pd_prodcode]':{
  82. beforerender:function(f){
  83. Ext.apply(f,{
  84. dataUrl:'/api/document/product/list',
  85. // dataUrl:'http://localhost:9480/product/list',
  86. addXtype: 'document-product-formpanel',
  87. addTitle: '物料资料',
  88. dbfinds:[{
  89. from:'id',to:'pd_prodid'
  90. },{
  91. from:'pr_code',to:'pd_prodcode'
  92. },{
  93. from:'pr_detail',to:'pr_detail'
  94. },{
  95. from:'pr_unit',to:'pd_unit'
  96. },{
  97. from:'pr_whid',to:'pd_whid'
  98. },{
  99. from:'pr_whcode',to:'pd_whcode'
  100. },{
  101. from:'pr_whname',to:'pd_whname'
  102. }],
  103. dbtpls:[{
  104. field:'pr_code',width:100
  105. },{
  106. field:'pr_detail',width:100
  107. },{
  108. field:'pr_unit',width:100
  109. }],
  110. defaultCondition: "pr_statuscode='OPEN'",
  111. dbSearchFields:[{
  112. emptyText:'输入物料编号、名称或规格',
  113. xtype : "textfield",
  114. name : "search",
  115. width: 200,
  116. getCondition: function(v) {
  117. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  118. },
  119. allowBlank : true,
  120. columnWidth : 0.25
  121. }],
  122. //窗口列设置
  123. dbColumns:[{
  124. "text": "物料ID",
  125. "hidden": true,
  126. "dataIndex": "id",
  127. }, {
  128. "text": "物料编号",
  129. "dataIndex": "pr_code",
  130. "width": 100,
  131. "xtype": "",
  132. "items": null
  133. }, {
  134. "text": "物料名称",
  135. "width": 100,
  136. "dataIndex": "pr_detail",
  137. "xtype": "",
  138. "items": null
  139. }, {
  140. "text": "规格",
  141. "flex": 0,
  142. "dataIndex": "pr_spec",
  143. "width": 100,
  144. "xtype": "",
  145. "items": null
  146. }, {
  147. "text": "单位",
  148. "flex": 0,
  149. "dataIndex": "pr_spec",
  150. "width": 100,
  151. "xtype": "",
  152. "items": null
  153. },{
  154. "text": "仓库id",
  155. "flex": 0,
  156. "dataIndex": "pr_whid",
  157. "width": 0,
  158. "xtype": "",
  159. "items": null
  160. },{
  161. "text": "仓库编号",
  162. "flex": 0,
  163. "dataIndex": "pr_whcode",
  164. "width": 0,
  165. "xtype": "",
  166. "items": null
  167. },{
  168. "text": "仓库",
  169. "flex": 0,
  170. "dataIndex": "pr_whname",
  171. "width": 100,
  172. "xtype": "",
  173. "items": null
  174. },{
  175. "text": "总库存数",
  176. "flex": 0,
  177. "dataIndex": "po_onhand",
  178. "width": 100,
  179. "xtype": "",
  180. "items": null
  181. },{
  182. "text": "类型",
  183. "flex": 0,
  184. "dataIndex": "pr_kind",
  185. "width": 100,
  186. "xtype": "",
  187. "items": null
  188. },{
  189. "text": "型号",
  190. "flex": 0,
  191. "dataIndex": "pr_orispeccode",
  192. "width": 100,
  193. "xtype": "",
  194. "items": null
  195. },{
  196. "text": "品牌",
  197. "flex": 0,
  198. "dataIndex": "pr_brand",
  199. "width": 100,
  200. "xtype": "",
  201. "items": null
  202. },{
  203. "text": "供应商",
  204. "flex": 0,
  205. "dataIndex": "pr_vendname",
  206. "width": 100,
  207. "xtype": "",
  208. "items": null
  209. },{
  210. "text": "最小包装",
  211. "flex": 0,
  212. "dataIndex": "pr_zxbzs",
  213. "width": 100,
  214. "xtype": "",
  215. "items": null
  216. },{
  217. "text": "L/T",
  218. "flex": 0,
  219. "dataIndex": "pr_leadtime",
  220. "width": 100,
  221. "xtype": "",
  222. "items": null
  223. }]
  224. }) ;
  225. }
  226. },
  227. //放大镜赋值关系 以及 tpl模板
  228. 'dbfindtrigger[name=pd_whname]':{
  229. beforerender:function(f){
  230. Ext.apply(f,{
  231. dataUrl:'/api/document/warehouse/list',
  232. // dataUrl:'http://localhost:9480/warehouse/list',
  233. addXtype: 'other-warehouse',
  234. addTitle: '仓库资料',
  235. defaultCondition:"wh_statuscode='OPEN'",
  236. dbfinds:[{
  237. from:'id',to:'pd_whid'
  238. },{
  239. from:'wh_code',to:'pd_whcode'
  240. },{
  241. from:'wh_description',to:'pd_whname'
  242. }],
  243. dbtpls:[{
  244. field:'pd_whcode',width:100
  245. },{
  246. field:'pd_whname',width:100
  247. }],
  248. dbSearchFields:[{
  249. emptyText:'输入仓库编号或名称',
  250. xtype : "textfield",
  251. name : "wh_code",
  252. allowBlank : true,
  253. columnWidth : 0.25,
  254. getCondition:function(v){
  255. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  256. }
  257. }],
  258. dbColumns:[{
  259. "text": "仓库ID",
  260. "flex": 0,
  261. "dataIndex": "id",
  262. "width": 0,
  263. "xtype": "",
  264. "items": null
  265. },{
  266. "text": "仓库编号",
  267. "flex": 1,
  268. "dataIndex": "wh_code",
  269. "width": 100,
  270. "xtype": "",
  271. "items": null
  272. },{
  273. "text": "仓库名称",
  274. "flex": 1,
  275. "dataIndex": "wh_description",
  276. "xtype": "",
  277. "items": null
  278. },{
  279. "text": "仓库类型",
  280. "flex": 1,
  281. "dataIndex": "wh_type",
  282. "xtype": "",
  283. "items": null
  284. }]
  285. }) ;
  286. }
  287. }
  288. });
  289. },
  290. addCombo:function(){
  291. var combo=this.ownerCmp;
  292. Ext.create('Ext.window.Window',{
  293. layout:'vbox',
  294. bodyPadding: 15,
  295. width:500,
  296. items:[{
  297. fieldLabel:'实际值',
  298. xtype:'textfield'
  299. },{
  300. fieldLabel:'显示值',
  301. xtype:'textfield'
  302. }],
  303. buttons:[{
  304. text:'确认',
  305. handler:function(b){
  306. combo.setValue('ok');
  307. b.up('window').close();
  308. }
  309. }],
  310. renderTo:this.ownerCmp.ownerCt.getEl()
  311. }).show();
  312. }
  313. });