StudentDetail.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. Ext.define('school.view.basic.student.StudentDetail', {
  2. extend: 'school.view.core.form.FormPanel',
  3. xtype: 'basic-student-studentdetail',
  4. controller: 'basic-student-studentdetail',
  5. // viewModel: 'sale-b2b-purchasedetail',
  6. //字段属性
  7. _title: '学生信息',
  8. _idField: 'stu_id',
  9. _codeField: 'stu_number',
  10. _statusField: null,
  11. _statusCodeField: null,
  12. _auditmanField: null,
  13. _auditdateField: null,
  14. // _readUrl: 'http://10.1.80.47:9560/student/read',
  15. _readUrl: '/api/school/student/read',
  16. // _saveUrl: 'http://10.1.80.47:9560/student/save',
  17. _saveUrl: '/api/school/student/save',
  18. // _deleteUrl: 'http://10.1.80.47:9560/student/delete',
  19. _deleteUrl: '/api/school/student/delete',
  20. initId: 0,
  21. initComponent: function () {
  22. Ext.apply(this, {
  23. defaultItems: [{
  24. xtype: 'hidden',
  25. name: 'stu_id',
  26. fieldLabel: 'id',
  27. }, {
  28. xtype: 'textfield',
  29. name: 'stu_number',
  30. fieldLabel: '学号',
  31. allowBlank: false
  32. }, {
  33. xtype: 'textfield',
  34. name: 'stu_name',
  35. fieldLabel: '姓名',
  36. allowBlank: false
  37. }, {
  38. xtype: 'combobox',
  39. name: 'stu_sex',
  40. fieldLabel: '性别',
  41. displayField: 'name',
  42. valueField: 'value',
  43. editable: false,
  44. store: {
  45. type: 'store_gender'
  46. },
  47. minChars: 0,
  48. queryMode: 'local',
  49. allowBlank: false
  50. }, {
  51. xtype: 'textfield',
  52. name: 'stu_native',
  53. fieldLabel: '籍贯'
  54. }, {
  55. xtype: 'ethnicitycombobox',
  56. name: 'stu_nation',
  57. fieldLabel: '民族',
  58. }, {
  59. xtype: 'combobox',
  60. name: 'stu_political',
  61. fieldLabel: '政治面貌',
  62. displayField: 'name',
  63. valueField: 'name',
  64. editable: false,
  65. store: Ext.create('Ext.data.ArrayStore', {
  66. fields: ['name'],
  67. data: [
  68. ['中共党员'],
  69. ['中共预备党员'],
  70. ['共青团员'],
  71. ['群众']
  72. ]
  73. }),
  74. minChars: 0,
  75. queryMode: 'local'
  76. }, {
  77. xtype: 'datefield',
  78. name: 'stu_birthday',
  79. fieldLabel: '出生日期',
  80. allowBlank: false
  81. }, {
  82. xtype: 'numberfield',
  83. name: 'stu_age',
  84. fieldLabel: '年龄'
  85. }, {
  86. xtype: "textfield",
  87. name: "stu_address",
  88. fieldLabel: "家庭住址",
  89. columnWidth: 0.5,
  90. allowBlank: false
  91. }, {
  92. xtype: 'datefield',
  93. name: 'stu_enroll_date',
  94. fieldLabel: '入学日期',
  95. allowBlank: false
  96. }, {
  97. xtype: 'gradecombo',
  98. name: 'stu_grade',
  99. valueField: 'name',
  100. fieldLabel: '年级',
  101. listeners: {
  102. select: function (combo, record, eOpts) {
  103. combo.up('form').getForm().findField('clazz_id').setValue(null);
  104. combo.up('form').getForm().findField('stu_class').setValue(null);
  105. }
  106. },
  107. allowBlank: false
  108. }, {
  109. xtype: 'textfield',
  110. name: 'clazz_id',
  111. fieldLabel: '班级id',
  112. hidden: true,
  113. allowBlank: false
  114. }, {
  115. xtype: 'classcombo',
  116. name: 'stu_class',
  117. fieldLabel: '班级',
  118. valueField: 'name',
  119. listeners: {
  120. expand: function (combo, eOpts) {
  121. combo.store.clearFilter();
  122. var gradeCombo = combo.up('form').getForm().findField('stu_grade');
  123. var gradeName = gradeCombo.getValue();
  124. var filter = new Ext.util.Filter({
  125. property: 'gradeName',
  126. value: gradeName
  127. });
  128. if (!!gradeName) {
  129. combo.store.setFilters([filter]);
  130. }
  131. },
  132. select: function (combo, record, eOpts) {
  133. combo.up('form').getForm().findField('clazz_id').setValue(record.get('value'));
  134. combo.up('form').getForm().findField('stu_grade').setValue(record.get('gradeName'));
  135. }
  136. },
  137. allowBlank: false
  138. }, {
  139. name: "parent",
  140. xtype: "detailGridField",
  141. idColumn: 'parent_stu_id',
  142. detnoColumn: 'sd_detno',
  143. storeModel: 'school.model.basic.StudentParents',
  144. // deleteDetailUrl: 'http://10.1.80.47:9560/student/deleteDetail',
  145. deleteDetailUrl: '/api/school/student/deleteDetail',
  146. allowEmpty: true,
  147. showCount: false,
  148. columns: [{
  149. text: '关系id',
  150. dataIndex: 'parent_stu_id',
  151. hidden: true
  152. }, {
  153. text: '家长id',
  154. dataIndex: 'parent_id',
  155. hidden: true
  156. }, {
  157. text: '家长姓名',
  158. dataIndex: 'parents_name',
  159. editor: {
  160. xtype: 'textfield'
  161. }
  162. }, {
  163. text: '联系电话',
  164. dataIndex: 'pa_phone',
  165. editor: {
  166. xtype: 'numberfield'
  167. }
  168. }, {
  169. text: '关系',
  170. dataIndex: 'ps_relation',
  171. editor: {
  172. xtype: 'combobox',
  173. displayField: 'name',
  174. valueField: 'name',
  175. editable: true,
  176. store: Ext.create('Ext.data.ArrayStore', {
  177. fields: ['name'],
  178. data: [['父子'], ['母子'], ['兄弟'], ['兄妹'], ['姐弟'], ['姐妹'], ['祖孙'], ['其他']]
  179. }),
  180. queryMode: 'local'
  181. },
  182. }]
  183. }],
  184. });
  185. this.callParent();
  186. },
  187. });