Kind.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. defaultType:'',
  14. requires: [
  15. 'Ext.button.Segmented'
  16. ],
  17. tbar: [{
  18. xtype: 'segmentedbutton',
  19. reference: 'dataKind',
  20. value: 'customerkind',
  21. name : 'segmentedbutton',
  22. bind:'{segmented}',
  23. items: [{
  24. name:'customerkind',
  25. text: '客户',
  26. value: 'customerkind',
  27. typeText:'客户类型'
  28. }, {
  29. name:'vendorkind',
  30. text: '供应商',
  31. value: 'vendorkind',
  32. typeText:'供应商类型'
  33. }, {
  34. name:'productkind',
  35. text: '物料',
  36. value: 'productkind',
  37. typeText:'物料类型'
  38. }, {
  39. name:'inoutkind',
  40. text: '收支',
  41. value: 'inoutkind',
  42. typeText:'收支类别'
  43. }],
  44. listeners: {
  45. toggle: 'onKindToggle'
  46. }
  47. },'->',
  48. {
  49. xtype:'button',
  50. text:'新增',
  51. listeners: {
  52. click: 'onAdd'
  53. }
  54. },{
  55. xtype:'button',
  56. text:'刷新',
  57. listeners: {
  58. click: 'onRefresh'
  59. }
  60. }],
  61. items:[{
  62. xtype:'grid',
  63. reference: 'document-kind-Grid',
  64. margin: '10 0 0 0',
  65. flex: 1,
  66. frame:true,
  67. plugins: [{
  68. ptype: 'menuclipboard'
  69. }],
  70. bind:{
  71. selection: '{selectedCompany}'
  72. },
  73. listeners:{
  74. render:'loadDefualt'
  75. }
  76. }],
  77. etc:{
  78. customerkind:{
  79. columns: [{
  80. text: '客户类型',
  81. dataIndex: 'ck_name',
  82. flex: 1
  83. }],
  84. keyField:'id',
  85. reqUrl:'/api/document/customerkind/save',
  86. delUrl:'/api/document/customerkind/delete'
  87. },
  88. vendorkind:{
  89. columns: [{
  90. text: '供应商类型',
  91. dataIndex: 'vk_name',
  92. flex: 1
  93. }],
  94. keyField:'id',
  95. reqUrl:'/api/document/vendorkind/save',
  96. delUrl:'/api/document/vendorkind/delete'
  97. },
  98. productkind:{
  99. columns: [{
  100. text: '物料类型',
  101. dataIndex: 'pt_name',
  102. flex: 1
  103. }],
  104. keyField:'id',
  105. reqUrl:'/api/document/producttype/save',
  106. delUrl:'/api/document/producttype/delete'
  107. },
  108. inoutkind:{
  109. columns: [{
  110. text: '收支名称',
  111. dataIndex: 'ft_name',
  112. flex: 1
  113. },{
  114. text: '收支类别',
  115. dataIndex: 'ft_kind',
  116. flex: 1
  117. }],
  118. keyField:'id',
  119. reqUrl: '/api/document/fundinouttype/save',
  120. delUrl: '/api/document/fundinouttype/delete'
  121. },
  122. maxnumbers:{
  123. columns: [{
  124. text : "单据名称",
  125. width : 200.0,
  126. dataIndex : "mn_caller"
  127. },
  128. {
  129. text : "单据前缀",
  130. dataIndex : "mn_leadcode",
  131. width : 150.0
  132. },
  133. {
  134. text : "单据规则",
  135. dataIndex : "mn_rule",
  136. width : 250.0
  137. },{
  138. text : "流水长度",
  139. dataIndex : "mn_number",
  140. width : 90.0,
  141. xtype: 'numbercolumn',
  142. }],
  143. keyField:'id',
  144. reqUrl:'/api/commons/number/save'
  145. },
  146. personpower:{
  147. columns: [ {
  148. text : "编号",
  149. dataIndex : "code",
  150. width : 150.0,
  151. xtype : "",
  152. },{
  153. text : "角色名称",
  154. width : 200.0,
  155. dataIndex : "name",
  156. xtype : "",
  157. },
  158. {
  159. text : "角色描述",
  160. dataIndex : "description",
  161. width : 250.0
  162. }
  163. ],
  164. keyField:'id',
  165. reqUrl:'/api/account/role/save',
  166. updateUrl:'/api/account/role/update',
  167. },
  168. accountinformation:{
  169. columns:[{
  170. dataIndex:'accountId',
  171. },{
  172. dataIndex: 'roleNames',
  173. width: 150
  174. },{
  175. dataIndex: 'mobile',
  176. width: 110
  177. },{
  178. dataIndex: 'email',
  179. width: 110
  180. }],
  181. reqUrl:'/api/account/account/bind/roles',
  182. },
  183. accountadd:{
  184. columns:[{
  185. dataIndex:'realname',
  186. },{
  187. dataIndex: 'mobile',
  188. },{
  189. dataIndex: 'email',
  190. }],
  191. reqUrl: '/api/account/account/register/add',
  192. }
  193. },
  194. refresh:function(){
  195. var me = this;
  196. var grid = me.items.items[0];
  197. var button = grid.ownerCt.dockedItems.items[0].down('[name='+grid.ownerCt.ownerCt.viewConfig+']');
  198. if(button&&button.xtype!="tbfill"){
  199. button.click();
  200. me.ownerCt.setTitle(button.typeText + '查询');
  201. }
  202. }
  203. })