BasePanelController.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. Ext.define('saas.view.document.vendor.BasePanelController', {
  2. extend: 'saas.view.core.base.BasePanelController',
  3. alias: 'controller.document-vendor-basepanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. // 主表-供应商名称
  8. 'dbfindtrigger[name=ve_code]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. //数据接口
  12. dataUrl:'/api/document/vendor/list',
  13. addXtype: 'document-vendor-formpanel',
  14. addTitle: '供应商资料',
  15. defaultCondition:"ve_statuscode='OPEN'",
  16. //赋值
  17. dbfinds:[{
  18. from:'id',to:'id',ignore:true
  19. },{
  20. from:'ve_code',to:'ve_code'
  21. },{
  22. from:'ve_name',to:'ve_name'
  23. },{
  24. from:'ve_type',to:'ve_type'
  25. },{
  26. from:'ve_promisedays',to:'ve_promisedays'
  27. },{
  28. from:'ve_statuscode',to:'ve_statuscode'
  29. },{
  30. from:'ve_name',to:'ve_name'
  31. }],
  32. //联想设置
  33. dbtpls:[{
  34. field:'ve_code',width:100
  35. },{
  36. field:'ve_name',width:100
  37. }],
  38. defaultCondition: "ve_statuscode='OPEN'",
  39. dbSearchFields:[{
  40. emptyText:'输入供应商编号或名称',
  41. xtype : "textfield",
  42. name : "search",
  43. getCondition: function(v) {
  44. return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
  45. },
  46. allowBlank : true,
  47. columnWidth : 0.25
  48. }],
  49. //放大镜窗口列表
  50. dbColumns:[{
  51. "text": "供应商ID",
  52. "hidden": true,
  53. "dataIndex": "id",
  54. "width": 100,
  55. "xtype": "numbercolumn"
  56. },{
  57. "text": "供应商编号",
  58. "dataIndex": "ve_code",
  59. "width": 200
  60. }, {
  61. "text": "供应商名称",
  62. "dataIndex": "ve_name",
  63. "width": 200
  64. }, {
  65. "text": "供应商类型",
  66. "dataIndex": "ve_type",
  67. "width": 180,
  68. "items": null
  69. }, {
  70. "text": "税率",
  71. "dataIndex": "ve_taxrate",
  72. "width": 100,
  73. xtype: 'numbercolumn'
  74. }, {
  75. "text": "承付天数",
  76. "dataIndex": "ve_promisedays",
  77. "width": 100,
  78. xtype: 'numbercolumn',
  79. renderer : function(v) {
  80. return Ext.util.Format.number(v, '0');
  81. }
  82. }, {
  83. "text": "纳税人识别号",
  84. "dataIndex": "ve_bankaccount",
  85. "width": 150
  86. }, {
  87. "text": "开户银行",
  88. "dataIndex": "ve_bankaccount",
  89. "width": 100
  90. }, {
  91. "text": "银行账户",
  92. "dataIndex": "ve_bankcode",
  93. "width": 100
  94. }]
  95. }) ;
  96. }
  97. }
  98. });
  99. }
  100. });