FormPanelController.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Ext.define('saas.view.sale.saleout.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.sale-saleout-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=pd_prodcode]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. conditionCode:'pr_code',
  18. dataUrl:basePath+'document/product/getProductsByCondition',
  19. dbfinds:[{
  20. from:'pr_code',to:'pd_prodcode',
  21. from:'pr_unit',to:'pd_unit'
  22. }],
  23. dbtpls:[{
  24. field:'pr_code',width:100
  25. },{
  26. field:'pr_detail',width:100
  27. },{
  28. field:'pr_unit',width:100
  29. }],
  30. dbColumns:[{
  31. "text": "物料ID",
  32. "flex": 0,
  33. "dataIndex": "pr_id",
  34. "width": 0,
  35. "xtype": "",
  36. "items": null
  37. },{
  38. "text": "物料编号",
  39. "flex": 1,
  40. "dataIndex": "pr_code",
  41. "width": 100,
  42. "xtype": "",
  43. "items": null
  44. }, {
  45. "text": "物料名称",
  46. "flex": 1,
  47. "dataIndex": "pr_detail",
  48. "xtype": "",
  49. "items": null
  50. }, {
  51. "text": "物料规格",
  52. "flex": 0,
  53. "dataIndex": "pr_spec",
  54. "width": 200,
  55. "xtype": "",
  56. "items": null
  57. }, {
  58. "text": "物料单位",
  59. "flex": 0,
  60. "dataIndex": "pr_unit",
  61. "width": 200,
  62. "xtype": "",
  63. "items": null
  64. }]
  65. }) ;
  66. }
  67. }
  68. });
  69. },
  70. addCombo:function(){
  71. var combo=this.ownerCmp;
  72. Ext.create('Ext.window.Window',{
  73. layout:'vbox',
  74. bodyPadding: 15,
  75. width:500,
  76. items:[{
  77. fieldLabel:'实际值',
  78. xtype:'textfield'
  79. },{
  80. fieldLabel:'显示值',
  81. xtype:'textfield'
  82. }],
  83. buttons:[{
  84. text:'确认',
  85. handler:function(b){
  86. combo.setValue('ok');
  87. b.up('window').close();
  88. }
  89. }],
  90. renderTo:this.ownerCmp.ownerCt.getEl()
  91. }).show();
  92. }
  93. });