FormPanelController.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. Ext.define('saas.view.money.payBalance.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.money-paybalance-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. // 供应商名称
  8. 'dbfindtrigger[name=pb_vendname]':{
  9. beforerender: function (f) {
  10. Ext.apply(f, {
  11. dataUrl: '/api/document/vendor/list',
  12. addXtype: 'document-vendor-formpanel',
  13. addTitle: '供应商资料',
  14. dbfinds: [{
  15. from: 've_code',
  16. to: 'pd_vendcode'
  17. }, {
  18. from: 've_name',
  19. to: 'pb_vendname'
  20. },{
  21. from: 've_leftamount',
  22. to: 've_leftamount'
  23. }],
  24. dbtpls: [{
  25. field: 've_code',
  26. width: 100
  27. }, {
  28. field: 've_name',
  29. width: 100
  30. },{
  31. field:'ve_leftamount',
  32. width: 100
  33. }],
  34. defaultCondition: "ve_statuscode='OPEN'",
  35. dbSearchFields:[{
  36. emptyText:'输入供应商编号或名称',
  37. xtype : "textfield",
  38. name : "search",
  39. getCondition: function(v) {
  40. return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
  41. },
  42. allowBlank : true,
  43. columnWidth : 0.25
  44. }],
  45. dbColumns:[{
  46. "text": "供应商ID",
  47. "hidden": true,
  48. "dataIndex": "id",
  49. "width": 100,
  50. "xtype": "numbercolumn"
  51. },{
  52. "text": "供应商编号",
  53. "flex": 1,
  54. "dataIndex": "ve_code",
  55. "width": 100
  56. }, {
  57. "text": "供应商名称",
  58. "flex": 1,
  59. "dataIndex": "ve_name",
  60. "width": 100
  61. }, {
  62. "text": "供应商类型",
  63. "flex": 0,
  64. "dataIndex": "ve_type",
  65. "width": 200,
  66. "items": null
  67. }, {
  68. "text": "税率",
  69. "flex": 1,
  70. "dataIndex": "ve_taxrate",
  71. "width": 100
  72. }, {
  73. "text":"应付款金额",
  74. "flex":1,
  75. "dataIndex":"ve_leftamount",
  76. "width":100
  77. },{
  78. "text": "承付天数",
  79. "flex": 1,
  80. "dataIndex": "ve_promisedays",
  81. "width": 100
  82. }, {
  83. "text": "纳税人识别号",
  84. "flex": 1,
  85. "dataIndex": "ve_bankaccount",
  86. "width": 100
  87. }, {
  88. "text": "开户银行",
  89. "flex": 1,
  90. "dataIndex": "ve_bankaccount",
  91. "width": 100
  92. }, {
  93. "text": "银行账户",
  94. "flex": 1,
  95. "dataIndex": "ve_bankcode",
  96. "width": 100
  97. }]
  98. });
  99. }
  100. },
  101. });
  102. },
  103. addCombo:function(){
  104. var combo=this.ownerCmp;
  105. Ext.create('Ext.window.Window',{
  106. layout:'vbox',
  107. bodyPadding: 15,
  108. width:500,
  109. items:[{
  110. fieldLabel:'实际值',
  111. xtype:'textfield'
  112. },{
  113. fieldLabel:'显示值',
  114. xtype:'textfield'
  115. }],
  116. buttons:[{
  117. text:'确认',
  118. handler:function(b){
  119. combo.setValue('ok');
  120. b.up('window').close();
  121. }
  122. }],
  123. renderTo:this.ownerCmp.ownerCt.getEl()
  124. }).show();
  125. },
  126. turnIn: function() {
  127. var me = this,
  128. form = me.getView(),
  129. id = form.getForm().findField(form._idField);
  130. form.BaseUtil.request({
  131. url: form._turnInUrl+id.value,
  132. method: 'GET',
  133. })
  134. .then(function(localJson) {
  135. if(localJson.success){
  136. showToast('转单成功');
  137. }
  138. })
  139. .catch(function(res) {
  140. console.error(res);
  141. showToast('转单失败: ' + res.message);
  142. });
  143. }
  144. });