List.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /**
  2. * 出入校记录
  3. */
  4. Ext.define('school.view.interaction.access.List', {
  5. extend: 'school.view.core.base.BasePanel',
  6. xtype: 'interaction-access-list',
  7. // dataUrl: 'http://10.1.80.180:9520/api/school/record/list',
  8. dataUrl: '/api/school/record/list',
  9. initComponent: function () {
  10. var me = this;
  11. Ext.apply(this, {
  12. searchField: [{
  13. xtype: 'textfield',
  14. name: 'keyword',
  15. fieldLabel: '姓名',
  16. getCondition: function (value) {
  17. return ' (record_name like\'%' + value + '%\') ';
  18. }
  19. }, {
  20. xtype: 'gradecombo',
  21. name: 'grade_name',
  22. fieldLabel: '年级',
  23. listeners: {
  24. select: function (combo, record, eOpts) {
  25. combo.up('form').getForm().findField('clazz_name').setValue(null);
  26. }
  27. }
  28. }, {
  29. xtype: 'classcombo',
  30. name: 'clazz_name',
  31. fieldLabel: '班级',
  32. listeners: {
  33. expand: function (combo, eOpts) {
  34. combo.store.clearFilter();
  35. var gradeCombo = combo.up('form').getForm().findField('grade_name');
  36. var gradeName = gradeCombo.getValue();
  37. var filter = new Ext.util.Filter({
  38. property: 'clazz_grade',
  39. value: gradeName
  40. });
  41. if (!!gradeName) {
  42. combo.store.setFilters([filter]);
  43. }
  44. },
  45. select: function (combo, record, eOpts) {
  46. combo.up('form').getForm().findField('grade_name').setValue(record.get('clazz_grade'));
  47. }
  48. }
  49. }],
  50. caller: null,
  51. _formXtype: null,
  52. _title: null,
  53. _deleteUrl: null,
  54. _batchOpenUrl: null,
  55. _batchCloseUrl: null,
  56. _batchDeleteUrl: null,
  57. gridConfig: {
  58. idField: null,
  59. codeField: null,
  60. statusCodeField: null,
  61. dataUrl: me.dataUrl,
  62. caller: null,
  63. rootProperty: 'data.list',
  64. totalProperty: 'data.total',
  65. actionColumn: [],
  66. selModel: {
  67. type: 'cellmodel'
  68. },
  69. hiddenTools: true,
  70. disableDetail: true,
  71. toolBtns: [],
  72. columns: [{
  73. text: 'id',
  74. dataIndex: 'record_id',
  75. hidden: true
  76. }, {
  77. text: '类型',
  78. dataIndex: 'record_type',
  79. renderer: function(v,m,r) {
  80. return v == 1 ? '入校' : (v == 2 ? '出校' : '其他')
  81. }
  82. }, {
  83. text: '学号',
  84. dataIndex: 'stu_number',
  85. width: 160
  86. }, {
  87. text: '姓名',
  88. dataIndex: 'record_name'
  89. }, {
  90. text: '年级',
  91. dataIndex: 'grade_name'
  92. }, {
  93. text: '班级',
  94. dataIndex: 'clazz_name'
  95. }, {
  96. text: '时间',
  97. dataIndex: 'record_date',
  98. xtype: 'datecolumn',
  99. format: 'Y-m-d H:i:s',
  100. width: 150,
  101. }]
  102. },
  103. });
  104. this.callParent(arguments);
  105. },
  106. refresh: function() {
  107. Ext.StoreMgr.get('store_grade').load();
  108. Ext.StoreMgr.get('store_class').load();
  109. this.items.items[0].store.load();
  110. }
  111. });