FormController.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. Ext.define('saas.view.test.order.FormController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.test-order-formcontroller',
  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=puVendcode]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. conditionCode:'ve_code',
  18. dataUrl:'http://192.168.253.41:8800/purchase/component/dbfind/vendor',
  19. dbfinds:[{
  20. from:'vendCode',to:'puVendcode'
  21. },{
  22. from:'vendName',to:'puVendname'
  23. }],
  24. dbtpls:[{
  25. field:'vendCode',width:100
  26. },{
  27. field:'vendName',width:100
  28. }],
  29. dbColumns:[{
  30. "text": "供应商ID",
  31. "flex": 0,
  32. "dataIndex": "vendId",
  33. "width": 0,
  34. "xtype": "",
  35. "items": null
  36. },{
  37. "text": "供应商编号",
  38. "flex": 1,
  39. "dataIndex": "vendCode",
  40. "width": 100,
  41. "xtype": "",
  42. "items": null
  43. }, {
  44. "text": "供应商名称",
  45. "flex": 1,
  46. "dataIndex": "vendName",
  47. "xtype": "",
  48. "items": null
  49. }, {
  50. "text": "供应商类型",
  51. "flex": 0,
  52. "dataIndex": "vendType",
  53. "width": 200,
  54. "xtype": "",
  55. "items": null
  56. }]
  57. }) ;
  58. }
  59. },
  60. //放大镜赋值关系 以及 tpl模板
  61. 'dbfindtrigger[name=pdProdcode]':{
  62. beforerender:function(f){
  63. Ext.apply(f,{
  64. conditionCode:'pr_code',
  65. dataUrl:'http://192.168.253.41:8800/purchase/component/dbfind/product',
  66. dbfinds:[{
  67. from:'pr_code',to:'pdVendcode'
  68. }],
  69. dbtpls:[{
  70. field:'pr_code',width:100
  71. },{
  72. field:'pr_detail',width:100
  73. }],
  74. dbColumns:[{
  75. "text": "物料ID",
  76. "flex": 0,
  77. "dataIndex": "pr_id",
  78. "width": 0,
  79. "xtype": "",
  80. "items": null
  81. },{
  82. "text": "物料编号",
  83. "flex": 1,
  84. "dataIndex": "pr_code",
  85. "width": 100,
  86. "xtype": "",
  87. "items": null
  88. }, {
  89. "text": "物料名称",
  90. "flex": 1,
  91. "dataIndex": "pr_detail",
  92. "xtype": "",
  93. "items": null
  94. }, {
  95. "text": "物料规格",
  96. "flex": 0,
  97. "dataIndex": "pr_spec",
  98. "width": 200,
  99. "xtype": "",
  100. "items": null
  101. }]
  102. }) ;
  103. }
  104. }
  105. });
  106. },
  107. addCombo:function(){
  108. var combo=this.ownerCmp;
  109. Ext.create('Ext.window.Window',{
  110. layout:'vbox',
  111. bodyPadding: 15,
  112. width:500,
  113. items:[{
  114. fieldLabel:'实际值',
  115. xtype:'textfield'
  116. },{
  117. fieldLabel:'显示值',
  118. xtype:'textfield'
  119. }],
  120. buttons:[{
  121. text:'确认',
  122. handler:function(b){
  123. combo.setValue('ok');
  124. b.up('window').close();
  125. }
  126. }],
  127. renderTo:this.ownerCmp.ownerCt.getEl()
  128. }).show();
  129. }
  130. });