FormPanelController.js 5.7 KB

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