Kind.js 2.4 KB

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