Kind.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. autoScroll: true,
  8. layout:'fit',
  9. controller:'document-kind',
  10. viewModel: {
  11. type: 'document-kind'
  12. },
  13. tbar: [{
  14. xtype: 'segmentedbutton',
  15. reference: 'dataKind',
  16. value: 'customerkind',
  17. bind:'{segmented}',
  18. items: [{
  19. text: '客户',
  20. value: 'customerkind'
  21. }, {
  22. text: '供应商',
  23. value: 'vendorkind'
  24. }, {
  25. text: '商品',
  26. value: 'productkind'
  27. }, {
  28. text: '收支',
  29. value: 'inoutkind'
  30. }],
  31. listeners: {
  32. toggle: 'onKindToggle'
  33. }
  34. },'->',
  35. {
  36. xtype:'button',
  37. text:'新增',
  38. listeners: {
  39. click: 'onAdd'
  40. }
  41. },{
  42. xtype:'button',
  43. text:'刷新',
  44. listeners: {
  45. click: 'onRefresh'
  46. }
  47. }],
  48. items:[{
  49. xtype:'grid',
  50. reference: 'document-kind-Grid',
  51. margin: '10 0 0 0',
  52. flex: 1,
  53. frame:true,
  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_name',
  84. flex: 1
  85. }],
  86. keyField:'vk_id',
  87. dataField:'vk_name',
  88. reqUrl:'http://192.168.253.41:9480/api/document/vendorkind/save'
  89. },
  90. productkind:{
  91. columns: [{
  92. text: '物料类型',
  93. dataIndex: 'pk_kind',
  94. flex: 1
  95. }],
  96. keyField:'pk_id',
  97. },
  98. inoutkind:{
  99. columns: [{
  100. text: '收支类型',
  101. dataIndex: 'io_kind',
  102. flex: 1
  103. }],
  104. keyField:'io_id'
  105. }
  106. }
  107. })