FormPanelController.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. Ext.define('saas.view.money.recBalance.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.money-recbalance-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. 'dbfindtrigger[name=rb_custname]':{
  8. beforerender:function(f){
  9. Ext.apply(f,{
  10. //数据接口
  11. dataUrl: 'http://192.168.253.41:9480/vendor/list',
  12. //赋值
  13. dbfinds:[{
  14. from: 've_id', to: 'rb_custid'
  15. }, {
  16. from:'ve_code', to:'rb_custcode'
  17. },{
  18. from:'ve_name', to:'rb_custname'
  19. }],
  20. //联想设置
  21. dbtpls:[{
  22. field:'ve_code',width:100
  23. },{
  24. field:'ve_name',width:100
  25. }],
  26. //联想查询条件
  27. dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
  28. //放大镜窗口字段
  29. dbSearchFields:[{
  30. xtype : "textfield",
  31. name : "ve_name",
  32. conditionExpression:"ve_name like '{0}%'",//传入后台条件 替换占位符
  33. fieldLabel : "供应商名称",
  34. columnWidth : 0.25
  35. }],
  36. //放大镜窗口列表
  37. dbColumns:[{
  38. "text": "供应商ID",
  39. "flex": 0,
  40. "dataIndex": "ve_id",
  41. "width": 0,
  42. "xtype": "",
  43. "items": null
  44. },{
  45. "text": "供应商编号",
  46. "flex": 1,
  47. "dataIndex": "ve_code",
  48. "width": 100,
  49. "xtype": "",
  50. "items": null
  51. }, {
  52. "text": "供应商名称",
  53. "flex": 1,
  54. "dataIndex": "ve_name",
  55. "xtype": "",
  56. "items": null
  57. }, {
  58. "text": "供应商类型",
  59. "flex": 0,
  60. "dataIndex": "ve_type",
  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. turnIn: function() {
  94. var me = this,
  95. form = me.getView(),
  96. id = form.getForm().findField(form._idField);
  97. form.BaseUtil.request({
  98. url: form._turnInUrl+id.value,
  99. method: 'GET',
  100. })
  101. .then(function(res) {
  102. var localJson = new Ext.decode(res.responseText);
  103. if(localJson.success){
  104. Ext.Msg.alert('提示','转单成功');
  105. }
  106. })
  107. .catch(function() {
  108. Ext.Msg.alert('提示','转单失败');
  109. });
  110. }
  111. });