Kind.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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_name',
  66. flex: 1
  67. }],
  68. keyField:'id',
  69. dataField:'ck_name',
  70. reqUrl:'http://192.168.253.41:9480/customerkind/save',
  71. delUrl:'http://192.168.253.41:9480/customerkind/delete'
  72. },
  73. vendorkind:{
  74. columns: [{
  75. text: '供应商类型',
  76. dataIndex: 'vk_name',
  77. flex: 1
  78. }],
  79. keyField:'id',
  80. dataField:'vk_name',
  81. reqUrl:'http://192.168.253.41:9480/api/document/vendorkind/save',
  82. delUrl:'http://192.168.253.41:9480/api/document/vendorkind/delete'
  83. },
  84. productkind:{
  85. columns: [{
  86. text: '物料类型',
  87. dataIndex: 'pk_kind',
  88. flex: 1
  89. }],
  90. keyField:'pk_id',
  91. },
  92. inoutkind:{
  93. columns: [{
  94. text: '收支类型',
  95. dataIndex: 'io_kind',
  96. flex: 1
  97. }],
  98. keyField:'io_id'
  99. }
  100. }
  101. })