FormPanelController.js 5.6 KB

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