FormPanelController.js 5.3 KB

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