FormPanelController.js 13 KB

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