FormPanelController.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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:'/api/document/vendor/list',
  18. // dataUrl:'http://localhost:9480/vendor/list',
  19. addXtype: 'document-vendor-formpanel',
  20. addTitle: '供应商资料',
  21. dbfinds:[{
  22. from:'id',to:'pi_vendid'
  23. },{
  24. from:'ve_code',to:'pi_vendcode'
  25. },{
  26. from:'ve_name',to:'pi_vendname'
  27. }],
  28. dbtpls:[{
  29. field:'ve_code',width:100
  30. },{
  31. field:'ve_name',width:100
  32. }],
  33. //联想查询条件
  34. dbtplfield:"ve_name",
  35. //放大镜窗口字段
  36. dbSearchFields:[{
  37. xtype : "textfield",
  38. name : "ve_name",
  39. fieldLabel : "供应商名称",
  40. columnWidth : 0.25
  41. }],
  42. dbColumns:[{
  43. conditionCode:'id',
  44. "text": "供应商ID",
  45. "flex": 0,
  46. "dataIndex": "id",
  47. "width": 0,
  48. "xtype": "",
  49. "items": null
  50. },{
  51. conditionCode:'ve_code',
  52. "text": "供应商编号",
  53. "flex": 1,
  54. "dataIndex": "ve_code",
  55. "width": 100,
  56. "xtype": "",
  57. "items": null
  58. }, {
  59. conditionCode:'ve_name',
  60. "text": "供应商名称",
  61. "flex": 1,
  62. "dataIndex": "ve_name",
  63. "xtype": "",
  64. "items": null
  65. }, {
  66. conditionCode:'ve_type',
  67. "text": "供应商类型",
  68. "flex": 0,
  69. "dataIndex": "ve_type",
  70. "width": 200,
  71. "xtype": "",
  72. "items": null
  73. }]
  74. }) ;
  75. }
  76. },
  77. //放大镜赋值关系 以及 tpl模板
  78. 'dbfindtrigger[name=pi_custname]':{
  79. beforerender:function(f){
  80. Ext.apply(f,{
  81. addXtype: 'document-customer-formpanel',
  82. addTitle: '客户资料',
  83. dataUrl:'/api/document/customer/list',
  84. // dataUrl:'http://localhost:9480/customer/list',
  85. dbfinds:[{
  86. from:'id',to:'pi_custid'
  87. },{
  88. from:'cu_code',to:'pi_custcode'
  89. },{
  90. from:'cu_name',to:'pi_custname'
  91. }],
  92. dbtpls:[{
  93. field:'pi_custcode',width:100
  94. },{
  95. field:'pi_custname',width:100
  96. }],
  97. //联想查询条件
  98. dbtplfield:"cu_name",
  99. //放大镜窗口字段
  100. dbSearchFields:[{
  101. xtype : "textfield",
  102. name : "cu_name",
  103. fieldLabel : "客户名称",
  104. columnWidth : 0.25
  105. }],
  106. dbColumns:[{
  107. conditionCode:'id',
  108. "text": "客户ID",
  109. "flex": 0,
  110. "dataIndex": "id",
  111. "width": 0,
  112. "xtype": "",
  113. "items": null
  114. },{
  115. conditionCode:'cu_code',
  116. "text": "客户编号",
  117. "flex": 1,
  118. "dataIndex": "cu_code",
  119. "width": 100,
  120. "xtype": "",
  121. "items": null
  122. }, {
  123. conditionCode:'cu_name',
  124. "text": "客户名称",
  125. "flex": 1,
  126. "dataIndex": "cu_name",
  127. "xtype": "",
  128. "items": null
  129. }]
  130. }) ;
  131. }
  132. },
  133. //放大镜赋值关系 以及 tpl模板
  134. 'multidbfindtrigger[name=pd_prodcode]':{
  135. beforerender:function(f){
  136. Ext.apply(f,{
  137. dataUrl:'/api/document/product/list',
  138. // dataUrl:'http://localhost:9480/product/list',
  139. addXtype: 'document-product-formpanel',
  140. addTitle: '物料资料',
  141. dbfinds:[{
  142. from:'id',to:'pd_prodid'
  143. },{
  144. from:'pr_code',to:'pd_prodcode'
  145. },{
  146. from:'pr_detail',to:'pr_detail'
  147. },{
  148. from:'pr_spec',to:'pr_spec'
  149. }],
  150. dbtpls:[{
  151. field:'pr_code',width:100
  152. },{
  153. field:'pr_detail',width:100
  154. },{
  155. field:'pr_spec',width:100
  156. }],
  157. dbColumns:[{
  158. "text": "物料ID",
  159. "flex": 0,
  160. "dataIndex": "pr_id",
  161. "width": 0,
  162. "xtype": "",
  163. "items": null
  164. },{
  165. "text": "物料编号",
  166. "flex": 1,
  167. "dataIndex": "pr_code",
  168. "width": 100,
  169. "xtype": "",
  170. "items": null
  171. }, {
  172. "text": "物料名称",
  173. "flex": 1,
  174. "dataIndex": "pr_detail",
  175. "xtype": "",
  176. "items": null
  177. }, {
  178. "text": "物料规格",
  179. "flex": 0,
  180. "dataIndex": "pr_spec",
  181. "width": 200,
  182. "xtype": "",
  183. "items": null
  184. }, {
  185. "text": "物料单位",
  186. "flex": 0,
  187. "dataIndex": "pr_unit",
  188. "width": 200,
  189. "xtype": "",
  190. "items": null
  191. }]
  192. }) ;
  193. }
  194. },
  195. //放大镜赋值关系 以及 tpl模板
  196. 'dbfindtrigger[name=pd_whname]':{
  197. beforerender:function(f){
  198. Ext.apply(f,{
  199. dataUrl:'/api/document/warehouse/list',
  200. // dataUrl:'http://localhost:9480/warehouse/list',
  201. addXtype: 'other-warehouse',
  202. addTitle: '仓库资料',
  203. dbfinds:[{
  204. from:'id',to:'pd_whid'
  205. },{
  206. from:'wh_code',to:'pd_whcode'
  207. },{
  208. from:'wh_description',to:'pd_whname'
  209. }],
  210. dbtpls:[{
  211. field:'pd_whcode',width:100
  212. },{
  213. field:'pd_whname',width:100
  214. }],
  215. dbColumns:[{
  216. "text": "仓库ID",
  217. "flex": 0,
  218. "dataIndex": "id",
  219. "width": 0,
  220. "xtype": "",
  221. "items": null
  222. },{
  223. "text": "仓库编号",
  224. "flex": 1,
  225. "dataIndex": "wh_code",
  226. "width": 100,
  227. "xtype": "",
  228. "items": null
  229. }, {
  230. "text": "仓库名称",
  231. "flex": 1,
  232. "dataIndex": "wh_description",
  233. "xtype": "",
  234. "items": null
  235. }, ]
  236. }) ;
  237. }
  238. },
  239. //放大镜赋值关系 以及 tpl模板
  240. 'dbfindtrigger[name=pd_inwhname]':{
  241. beforerender:function(f){
  242. Ext.apply(f,{
  243. dataUrl:'/api/document/warehouse/list',
  244. // dataUrl:'http://localhost:9480/warehouse/list',
  245. addXtype: 'other-warehouse',
  246. addTitle: '仓库资料',
  247. dbfinds:[{
  248. from:'id',to:'pd_inwhid'
  249. },{
  250. from:'wh_code',to:'pd_inwhcode'
  251. },{
  252. from:'wh_description',to:'pd_inwhname'
  253. }],
  254. dbtpls:[{
  255. field:'pd_inwhcode',width:100
  256. },{
  257. field:'pd_inwhname',width:100
  258. }],
  259. dbColumns:[{
  260. "text": "仓库ID",
  261. "flex": 0,
  262. "dataIndex": "id",
  263. "width": 0,
  264. "xtype": "",
  265. "items": null
  266. },{
  267. "text": "仓库编号",
  268. "flex": 1,
  269. "dataIndex": "wh_code",
  270. "width": 100,
  271. "xtype": "",
  272. "items": null
  273. }, {
  274. "text": "仓库名称",
  275. "flex": 1,
  276. "dataIndex": "wh_description",
  277. "xtype": "",
  278. "items": null
  279. }, ]
  280. }) ;
  281. }
  282. },
  283. //放大镜赋值关系 以及 tpl模板
  284. 'dbfindtrigger[name=pd_inwhname]':{
  285. beforerender:function(f){
  286. Ext.apply(f,{
  287. dataUrl:'/api/document/warehouse/list',
  288. // dataUrl:'http://localhost:9480/warehouse/list',
  289. dbfinds:[{
  290. from:'id',to:'pd_inwhid'
  291. },{
  292. from:'wh_code',to:'pd_inwhcode'
  293. },{
  294. from:'wh_description',to:'pd_inwhname'
  295. }],
  296. dbtpls:[{
  297. field:'pd_inwhcode',width:100
  298. },{
  299. field:'pd_inwhname',width:100
  300. }],
  301. dbColumns:[{
  302. "text": "仓库ID",
  303. "flex": 0,
  304. "dataIndex": "id",
  305. "width": 0,
  306. "xtype": "",
  307. "items": null
  308. },{
  309. "text": "仓库编号",
  310. "flex": 1,
  311. "dataIndex": "wh_code",
  312. "width": 100,
  313. "xtype": "",
  314. "items": null
  315. }, {
  316. "text": "仓库名称",
  317. "flex": 1,
  318. "dataIndex": "wh_description",
  319. "xtype": "",
  320. "items": null
  321. }, ]
  322. }) ;
  323. }
  324. }
  325. });
  326. },
  327. addCombo:function(){
  328. var combo=this.ownerCmp;
  329. Ext.create('Ext.window.Window',{
  330. layout:'vbox',
  331. bodyPadding: 15,
  332. width:500,
  333. items:[{
  334. fieldLabel:'实际值',
  335. xtype:'textfield'
  336. },{
  337. fieldLabel:'显示值',
  338. xtype:'textfield'
  339. }],
  340. buttons:[{
  341. text:'确认',
  342. handler:function(b){
  343. combo.setValue('ok');
  344. b.up('window').close();
  345. }
  346. }],
  347. renderTo:this.ownerCmp.ownerCt.getEl()
  348. }).show();
  349. }
  350. });