FormPanelController.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-appropriationinout-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=pu_vendcode]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. dataUrl:basePath+'document/vendor/list',
  18. // dataUrl:'http://localhost:9480/vendor/list',
  19. dbfinds:[{
  20. from:'ve_id',to:'pi_vendid'
  21. },{
  22. from:'ve_code',to:'pu_vendcode'
  23. },{
  24. from:'ve_name',to:'pu_vendname'
  25. }],
  26. dbtpls:[{
  27. field:'ve_code',width:100
  28. },{
  29. field:'ve_name',width:100
  30. }],
  31. dbColumns:[{
  32. conditionCode:'ve_id',
  33. "text": "供应商ID",
  34. "flex": 0,
  35. "dataIndex": "ve_id",
  36. "width": 0,
  37. "xtype": "",
  38. "items": null
  39. },{
  40. conditionCode:'ve_code',
  41. "text": "供应商编号",
  42. "flex": 1,
  43. "dataIndex": "ve_code",
  44. "width": 100,
  45. "xtype": "",
  46. "items": null
  47. }, {
  48. conditionCode:'ve_name',
  49. "text": "供应商名称",
  50. "flex": 1,
  51. "dataIndex": "ve_name",
  52. "xtype": "",
  53. "items": null
  54. }, {
  55. conditionCode:'ve_type',
  56. "text": "供应商类型",
  57. "flex": 0,
  58. "dataIndex": "ve_type",
  59. "width": 200,
  60. "xtype": "",
  61. "items": null
  62. }]
  63. }) ;
  64. }
  65. },
  66. //放大镜赋值关系 以及 tpl模板
  67. 'dbfindtrigger[name=pd_prodcode]':{
  68. beforerender:function(f){
  69. Ext.apply(f,{
  70. dataUrl:basePath+'document/product/list',
  71. // dataUrl:'http://localhost:9480/product/list',
  72. dbfinds:[{
  73. from:'id',to:'pd_prodid'
  74. },{
  75. from:'pr_code',to:'pd_prodcode'
  76. },{
  77. from:'pr_detail',to:'pr_detail'
  78. },{
  79. from:'pr_unit',to:'pd_unit'
  80. }],
  81. dbtpls:[{
  82. field:'pr_code',width:100
  83. },{
  84. field:'pr_detail',width:100
  85. },{
  86. field:'pr_unit',width:100
  87. }],
  88. dbColumns:[{
  89. "text": "物料ID",
  90. "flex": 0,
  91. "dataIndex": "pr_id",
  92. "width": 0,
  93. "xtype": "",
  94. "items": null
  95. },{
  96. "text": "物料编号",
  97. "flex": 1,
  98. "dataIndex": "pr_code",
  99. "width": 100,
  100. "xtype": "",
  101. "items": null
  102. }, {
  103. "text": "物料名称",
  104. "flex": 1,
  105. "dataIndex": "pr_detail",
  106. "xtype": "",
  107. "items": null
  108. }, {
  109. "text": "物料规格",
  110. "flex": 0,
  111. "dataIndex": "pr_spec",
  112. "width": 200,
  113. "xtype": "",
  114. "items": null
  115. }, {
  116. "text": "物料单位",
  117. "flex": 0,
  118. "dataIndex": "pr_unit",
  119. "width": 200,
  120. "xtype": "",
  121. "items": null
  122. }]
  123. }) ;
  124. }
  125. },
  126. //放大镜赋值关系 以及 tpl模板
  127. 'dbfindtrigger[name=pd_whname]':{
  128. beforerender:function(f){
  129. Ext.apply(f,{
  130. dataUrl:basePath+'document/warehouse/list',
  131. // dataUrl:'http://localhost:9480/warehouse/list',
  132. dbfinds:[{
  133. from:'id',to:'pd_whid'
  134. },{
  135. from:'wh_code',to:'pd_whcode'
  136. },{
  137. from:'wh_description',to:'pd_whname'
  138. }],
  139. dbtpls:[{
  140. field:'pd_whcode',width:100
  141. },{
  142. field:'pd_whname',width:100
  143. }],
  144. dbColumns:[{
  145. "text": "仓库ID",
  146. "flex": 0,
  147. "dataIndex": "id",
  148. "width": 0,
  149. "xtype": "",
  150. "items": null
  151. },{
  152. "text": "仓库编号",
  153. "flex": 1,
  154. "dataIndex": "wh_code",
  155. "width": 100,
  156. "xtype": "",
  157. "items": null
  158. }, {
  159. "text": "仓库名称",
  160. "flex": 1,
  161. "dataIndex": "wh_description",
  162. "xtype": "",
  163. "items": null
  164. }, ]
  165. }) ;
  166. }
  167. },
  168. //放大镜赋值关系 以及 tpl模板
  169. 'dbfindtrigger[name=pd_inwhname]':{
  170. beforerender:function(f){
  171. Ext.apply(f,{
  172. dataUrl:basePath+'document/warehouse/list',
  173. // dataUrl:'http://localhost:9480/warehouse/list',
  174. dbfinds:[{
  175. from:'id',to:'pd_inwhid'
  176. },{
  177. from:'wh_code',to:'pd_inwhcode'
  178. },{
  179. from:'wh_description',to:'pd_inwhname'
  180. }],
  181. dbtpls:[{
  182. field:'pd_inwhcode',width:100
  183. },{
  184. field:'pd_inwhname',width:100
  185. }],
  186. dbColumns:[{
  187. "text": "仓库ID",
  188. "flex": 0,
  189. "dataIndex": "id",
  190. "width": 0,
  191. "xtype": "",
  192. "items": null
  193. },{
  194. "text": "仓库编号",
  195. "flex": 1,
  196. "dataIndex": "wh_code",
  197. "width": 100,
  198. "xtype": "",
  199. "items": null
  200. }, {
  201. "text": "仓库名称",
  202. "flex": 1,
  203. "dataIndex": "wh_description",
  204. "xtype": "",
  205. "items": null
  206. }, ]
  207. }) ;
  208. }
  209. }
  210. });
  211. },
  212. addCombo:function(){
  213. var combo=this.ownerCmp;
  214. Ext.create('Ext.window.Window',{
  215. layout:'vbox',
  216. bodyPadding: 15,
  217. width:500,
  218. items:[{
  219. fieldLabel:'实际值',
  220. xtype:'textfield'
  221. },{
  222. fieldLabel:'显示值',
  223. xtype:'textfield'
  224. }],
  225. buttons:[{
  226. text:'确认',
  227. handler:function(b){
  228. combo.setValue('ok');
  229. b.up('window').close();
  230. }
  231. }],
  232. renderTo:this.ownerCmp.ownerCt.getEl()
  233. }).show();
  234. }
  235. });