FormPanelController.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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: basePath + 'document/customer/list',
  12. //赋值
  13. dbfinds:[{
  14. from: 'id', to: 'rb_custid'
  15. }, {
  16. from:'cu_code', to:'rb_custcode'
  17. },{
  18. from:'cu_name', to:'rb_custname'
  19. }],
  20. //联想设置
  21. dbtpls:[{
  22. field:'cu_code',width:100
  23. },{
  24. field:'cu_name',width:100
  25. }],
  26. //联想查询条件
  27. dbCondition:"CONCAT(cu_code, cu_name) like '{0}%'",
  28. //放大镜窗口字段
  29. dbSearchFields:[{
  30. xtype : "textfield",
  31. name : "cu_name",
  32. conditionExpression:"cu_name like '{0}%'",//传入后台条件 替换占位符
  33. fieldLabel : "客户名称",
  34. columnWidth : 0.25
  35. }],
  36. //放大镜窗口列表
  37. dbColumns:[{
  38. "text": "ID",
  39. "flex": 0,
  40. "dataIndex": "id",
  41. "width": 0,
  42. "xtype": "",
  43. "items": null
  44. },{
  45. "text": "供应商编号",
  46. "flex": 1,
  47. "dataIndex": "cu_code",
  48. "width": 100,
  49. "xtype": "",
  50. "items": null
  51. }, {
  52. "text": "供应商名称",
  53. "flex": 1,
  54. "dataIndex": "cu_name",
  55. "xtype": "",
  56. "items": null
  57. }]
  58. }) ;
  59. }
  60. },
  61. 'dbfindtrigger[name=rd_bankname]':{
  62. beforerender:function(f){
  63. Ext.apply(f,{
  64. //数据接口
  65. dataUrl: basePath + 'document/customer/list',
  66. //赋值
  67. dbfinds:[{
  68. from: 'id', to: 'rb_custid'
  69. }, {
  70. from:'cu_code', to:'rb_custcode'
  71. },{
  72. from:'cu_name', to:'rb_custname'
  73. }],
  74. //联想设置
  75. dbtpls:[{
  76. field:'cu_code',width:100
  77. },{
  78. field:'cu_name',width:100
  79. }],
  80. //联想查询条件
  81. dbCondition:"CONCAT(cu_code, cu_name) like '{0}%'",
  82. //放大镜窗口字段
  83. dbSearchFields:[{
  84. xtype : "textfield",
  85. name : "cu_name",
  86. conditionExpression:"cu_name like '{0}%'",//传入后台条件 替换占位符
  87. fieldLabel : "客户名称",
  88. columnWidth : 0.25
  89. }],
  90. //放大镜窗口列表
  91. dbColumns:[{
  92. "text": "ID",
  93. "flex": 0,
  94. "dataIndex": "id",
  95. "width": 0,
  96. "xtype": "",
  97. "items": null
  98. },{
  99. "text": "供应商编号",
  100. "flex": 1,
  101. "dataIndex": "cu_code",
  102. "width": 100,
  103. "xtype": "",
  104. "items": null
  105. }, {
  106. "text": "供应商名称",
  107. "flex": 1,
  108. "dataIndex": "cu_name",
  109. "xtype": "",
  110. "items": null
  111. }]
  112. }) ;
  113. }
  114. },
  115. });
  116. },
  117. addCombo:function(){
  118. var combo=this.ownerCmp;
  119. Ext.create('Ext.window.Window',{
  120. layout:'vbox',
  121. bodyPadding: 15,
  122. width:500,
  123. items:[{
  124. fieldLabel:'实际值',
  125. xtype:'textfield'
  126. },{
  127. fieldLabel:'显示值',
  128. xtype:'textfield'
  129. }],
  130. buttons:[{
  131. text:'确认',
  132. handler:function(b){
  133. combo.setValue('ok');
  134. b.up('window').close();
  135. }
  136. }],
  137. renderTo:this.ownerCmp.ownerCt.getEl()
  138. }).show();
  139. },
  140. turnIn: function() {
  141. var me = this,
  142. form = me.getView(),
  143. id = form.getForm().findField(form._idField);
  144. form.BaseUtil.request({
  145. url: form._turnInUrl+id.value,
  146. method: 'GET',
  147. })
  148. .then(function(localJson) {
  149. if(localJson.success){
  150. showToast('转单成功');
  151. }
  152. })
  153. .catch(function(res) {
  154. console.error(res);
  155. showToast('转单失败: ' + res.message);
  156. });
  157. }
  158. });