FormPanelController.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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=pi_vendname]':{
  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:'id',to:'pi_vendid'
  21. },{
  22. from:'ve_code',to:'pi_vendcode'
  23. },{
  24. from:'ve_name',to:'pi_vendname'
  25. }],
  26. dbtpls:[{
  27. field:'ve_code',width:100
  28. },{
  29. field:'ve_name',width:100
  30. }],
  31. dbColumns:[{
  32. conditionCode:'id',
  33. "text": "供应商ID",
  34. "flex": 0,
  35. "dataIndex": "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=pi_custname]':{
  68. beforerender:function(f){
  69. Ext.apply(f,{
  70. dataUrl:basePath+'document/customer/list',
  71. // dataUrl:'http://localhost:9480/customer/list',
  72. dbfinds:[{
  73. from:'id',to:'pi_custid'
  74. },{
  75. from:'cu_code',to:'pi_custcode'
  76. },{
  77. from:'cu_name',to:'pi_custname'
  78. }],
  79. dbtpls:[{
  80. field:'pi_custcode',width:100
  81. },{
  82. field:'pi_custname',width:100
  83. }],
  84. dbColumns:[{
  85. conditionCode:'id',
  86. "text": "客户ID",
  87. "flex": 0,
  88. "dataIndex": "id",
  89. "width": 0,
  90. "xtype": "",
  91. "items": null
  92. },{
  93. conditionCode:'cu_code',
  94. "text": "客户编号",
  95. "flex": 1,
  96. "dataIndex": "cu_code",
  97. "width": 100,
  98. "xtype": "",
  99. "items": null
  100. }, {
  101. conditionCode:'cu_name',
  102. "text": "客户名称",
  103. "flex": 1,
  104. "dataIndex": "cu_name",
  105. "xtype": "",
  106. "items": null
  107. }]
  108. }) ;
  109. }
  110. },
  111. //放大镜赋值关系 以及 tpl模板
  112. 'dbfindtrigger[name=pd_prodcode]':{
  113. beforerender:function(f){
  114. Ext.apply(f,{
  115. dataUrl:basePath+'document/product/list',
  116. // dataUrl:'http://localhost:9480/product/list',
  117. dbfinds:[{
  118. from:'id',to:'pd_prodid'
  119. },{
  120. from:'pr_code',to:'pd_prodcode'
  121. },{
  122. from:'pr_detail',to:'pr_detail'
  123. },{
  124. from:'pr_spec',to:'pr_spec'
  125. }],
  126. dbtpls:[{
  127. field:'pr_code',width:100
  128. },{
  129. field:'pr_detail',width:100
  130. },{
  131. field:'pr_spec',width:100
  132. }],
  133. dbColumns:[{
  134. "text": "物料ID",
  135. "flex": 0,
  136. "dataIndex": "pr_id",
  137. "width": 0,
  138. "xtype": "",
  139. "items": null
  140. },{
  141. "text": "物料编号",
  142. "flex": 1,
  143. "dataIndex": "pr_code",
  144. "width": 100,
  145. "xtype": "",
  146. "items": null
  147. }, {
  148. "text": "物料名称",
  149. "flex": 1,
  150. "dataIndex": "pr_detail",
  151. "xtype": "",
  152. "items": null
  153. }, {
  154. "text": "物料规格",
  155. "flex": 0,
  156. "dataIndex": "pr_spec",
  157. "width": 200,
  158. "xtype": "",
  159. "items": null
  160. }, {
  161. "text": "物料单位",
  162. "flex": 0,
  163. "dataIndex": "pr_unit",
  164. "width": 200,
  165. "xtype": "",
  166. "items": null
  167. }]
  168. }) ;
  169. }
  170. },
  171. //放大镜赋值关系 以及 tpl模板
  172. 'dbfindtrigger[name=pd_whname]':{
  173. beforerender:function(f){
  174. Ext.apply(f,{
  175. dataUrl:basePath+'document/warehouse/list',
  176. // dataUrl:'http://localhost:9480/warehouse/list',
  177. dbfinds:[{
  178. from:'id',to:'pd_whid'
  179. },{
  180. from:'wh_code',to:'pd_whcode'
  181. },{
  182. from:'wh_description',to:'pd_whname'
  183. }],
  184. dbtpls:[{
  185. field:'pd_whcode',width:100
  186. },{
  187. field:'pd_whname',width:100
  188. }],
  189. dbColumns:[{
  190. "text": "仓库ID",
  191. "flex": 0,
  192. "dataIndex": "id",
  193. "width": 0,
  194. "xtype": "",
  195. "items": null
  196. },{
  197. "text": "仓库编号",
  198. "flex": 1,
  199. "dataIndex": "wh_code",
  200. "width": 100,
  201. "xtype": "",
  202. "items": null
  203. }, {
  204. "text": "仓库名称",
  205. "flex": 1,
  206. "dataIndex": "wh_description",
  207. "xtype": "",
  208. "items": null
  209. }, ]
  210. }) ;
  211. }
  212. },
  213. //放大镜赋值关系 以及 tpl模板
  214. 'dbfindtrigger[name=pd_inwhname]':{
  215. beforerender:function(f){
  216. Ext.apply(f,{
  217. dataUrl:basePath+'document/warehouse/list',
  218. // dataUrl:'http://localhost:9480/warehouse/list',
  219. dbfinds:[{
  220. from:'id',to:'pd_inwhid'
  221. },{
  222. from:'wh_code',to:'pd_inwhcode'
  223. },{
  224. from:'wh_description',to:'pd_inwhname'
  225. }],
  226. dbtpls:[{
  227. field:'pd_inwhcode',width:100
  228. },{
  229. field:'pd_inwhname',width:100
  230. }],
  231. dbColumns:[{
  232. "text": "仓库ID",
  233. "flex": 0,
  234. "dataIndex": "id",
  235. "width": 0,
  236. "xtype": "",
  237. "items": null
  238. },{
  239. "text": "仓库编号",
  240. "flex": 1,
  241. "dataIndex": "wh_code",
  242. "width": 100,
  243. "xtype": "",
  244. "items": null
  245. }, {
  246. "text": "仓库名称",
  247. "flex": 1,
  248. "dataIndex": "wh_description",
  249. "xtype": "",
  250. "items": null
  251. }, ]
  252. }) ;
  253. }
  254. }
  255. });
  256. },
  257. addCombo:function(){
  258. var combo=this.ownerCmp;
  259. Ext.create('Ext.window.Window',{
  260. layout:'vbox',
  261. bodyPadding: 15,
  262. width:500,
  263. items:[{
  264. fieldLabel:'实际值',
  265. xtype:'textfield'
  266. },{
  267. fieldLabel:'显示值',
  268. xtype:'textfield'
  269. }],
  270. buttons:[{
  271. text:'确认',
  272. handler:function(b){
  273. combo.setValue('ok');
  274. b.up('window').close();
  275. }
  276. }],
  277. renderTo:this.ownerCmp.ownerCt.getEl()
  278. }).show();
  279. }
  280. });