Kind.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * Created by zhouy on 2018/10/18.
  3. */
  4. Ext.define('saas.view.document.kind.Kind', {
  5. extend: 'Ext.panel.Panel',
  6. xtype: 'document-kind',
  7. controller:'document-kind',
  8. viewModel: {
  9. type: 'document-kind'
  10. },
  11. tbar: [{
  12. xtype: 'segmentedbutton',
  13. reference: 'dataKind',
  14. value: 'customerkind',
  15. bind:'{segmented}',
  16. items: [{
  17. text: '客户',
  18. value: 'customerkind'
  19. }, {
  20. text: '供应商',
  21. value: 'vendorkind'
  22. }, {
  23. text: '商品',
  24. value: 'productkind'
  25. }, {
  26. text: '收支',
  27. value: 'inoutkind'
  28. }],
  29. listeners: {
  30. toggle: 'onKindToggle'
  31. }
  32. },'->',
  33. {
  34. xtype:'button',
  35. text:'新增',
  36. listeners: {
  37. click: 'onAdd'
  38. }
  39. },{
  40. xtype:'button',
  41. text:'刷新',
  42. listeners: {
  43. click: 'onRefresh'
  44. }
  45. }],
  46. items:[{
  47. xtype:'grid',
  48. reference: 'document-kind-Grid',
  49. margin: '10 0 0 0',
  50. flex: 1,
  51. frame:true,
  52. bind:{
  53. selection: '{selectedCompany}'
  54. },
  55. listeners:{
  56. render:'loadDefualt'
  57. }
  58. }],
  59. etc:{
  60. customerkind:{
  61. columns: [{
  62. text: '客户类型',
  63. dataIndex: 'ck_kind',
  64. flex: 1
  65. }],
  66. formItems:[{
  67. xtype:'hidden',
  68. name:'ck_id'
  69. },{
  70. xtype:'textfield',
  71. name:'ck_kind',
  72. allowBlank:false,
  73. fieldLabel:'类型'
  74. }],
  75. keyField:'ck_id',
  76. reqUrl:''
  77. },
  78. vendorkind:{
  79. columns: [{
  80. text: '供应商类型',
  81. dataIndex: 'vk_kind',
  82. flex: 1
  83. }],
  84. keyField:'vk_id',
  85. reqUrl:''
  86. },
  87. productkind:{
  88. columns: [{
  89. text: '物料类型',
  90. dataIndex: 'pk_kind',
  91. flex: 1
  92. }],
  93. keyField:'pk_id',
  94. },
  95. inoutkind:{
  96. columns: [{
  97. text: '收支类型',
  98. dataIndex: 'io_kind',
  99. flex: 1
  100. }],
  101. keyField:'io_id'
  102. }
  103. }
  104. })