ClassDetail.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. Ext.define('school.view.basic.class.ClassDetail', {
  2. extend: 'school.view.core.form.FormPanel',
  3. xtype: 'classdetail',
  4. controller: 'classdetail',
  5. viewModel: 'classdetail',
  6. //字段属性
  7. _title: '班级信息',
  8. _idField: 'clazz_id',
  9. _codeField: null,
  10. // _readUrl: 'http://10.1.80.180:9520/api/school/class/read',
  11. _readUrl: '/api/school/class/read',
  12. // _saveUrl: 'http://10.1.80.180:9520/api/school/class/save',
  13. _saveUrl: '/api/school/class/save',
  14. _deleteUrl: '/api/school/class/delete',
  15. initId: 0,
  16. initComponent: function () {
  17. Ext.apply(this, {
  18. defaultItems: [{
  19. xtype: 'hidden',
  20. name: 'clazz_id',
  21. fieldLabel: 'id',
  22. group: '班级信息',
  23. }, {
  24. xtype: "textfield",
  25. name: "clazz_name",
  26. fieldLabel: "班级名称",
  27. columnWidth: 0.5,
  28. group: '班级信息',
  29. allowBlank: false
  30. }, {
  31. // xtype: 'textfield',
  32. // name: 'code',
  33. // fieldLabel: '班级代码',
  34. // }, {
  35. xtype: 'gradecombo',
  36. name: 'clazz_grade',
  37. fieldLabel: '所属年级',
  38. columnWidth: 0.5,
  39. group: '班级信息',
  40. allowBlank: false
  41. }, {
  42. xtype: "textfield",
  43. name: "clazz_adress",
  44. fieldLabel: "班级地址",
  45. columnWidth: 1,
  46. group: '班级信息',
  47. }, {
  48. xtype: "textfield",
  49. name: 'clazz_status',
  50. fieldLabel: "状态",
  51. columnWidth: 0.5,
  52. group: '班级信息',
  53. }, {
  54. xtype: "textfield",
  55. name: 'clazz_remarks',
  56. fieldLabel: '备注',
  57. columnWidth: 0.5,
  58. group: '班级信息',
  59. }, {
  60. name: "detail0",
  61. xtype: "detailGridField",
  62. detnoColumn: 'sd_detno',
  63. storeModel: 'school.model.basic.Student',
  64. allowEmpty: true,
  65. showCount: false,
  66. readOnly: true,
  67. group: '学生信息',
  68. columns: [{
  69. text: 'id',
  70. dataIndex: 'stu_id',
  71. hidden: true
  72. }, {
  73. text: '编号',
  74. dataIndex: 'stu_number'
  75. }, {
  76. text: '姓名',
  77. dataIndex: 'stu_name'
  78. }, {
  79. text: '性别',
  80. dataIndex: 'stu_sex',
  81. renderer: function(v, m , r) {
  82. return v == 1 ? '男' : (v == 0 ? '女' : '未知')
  83. }
  84. }, {
  85. text: '出生日期',
  86. dataIndex: 'stu_birthday',
  87. xtype: 'datecolumn',
  88. format: 'Y-m-d'
  89. }, {
  90. text: '年龄',
  91. dataIndex: 'stu_age'
  92. }, {
  93. text: '家庭住址',
  94. dataIndex: 'stu_address'
  95. }, {
  96. text: '入学时间',
  97. dataIndex: 'stu_enroll_date',
  98. xtype: 'datecolumn',
  99. format: 'Y-m-d'
  100. }, {
  101. text: '毕业时间',
  102. dataIndex: 'stu_graduate_date',
  103. xtype: 'datecolumn',
  104. format: 'Y-m-d'
  105. }, {
  106. text: '备注',
  107. dataIndex: 'stu_remarks'
  108. }]
  109. }, {
  110. name: "detail1",
  111. xtype: "detailGridField",
  112. idColumn: 'teacher_clazz_id',
  113. detnoColumn: 'no',
  114. storeModel: 'school.model.basic.Subject',
  115. deleteDetailUrl: '/api/school/class/deleteDetail',
  116. allowEmpty: true,
  117. showCount: false,
  118. group: '学科信息',
  119. columns: [{
  120. text: 'id',
  121. dataIndex: 'teacher_clazz_id',
  122. hidden: true
  123. }, {
  124. text: '学科id',
  125. dataIndex: 'subject_id',
  126. hidden: true,
  127. editor: {
  128. xtype: 'textfield'
  129. }
  130. /**
  131. * TODO 未写入id
  132. */
  133. }, {
  134. text: '学科',
  135. dataIndex: 'subject_name',
  136. xtype: 'subjectcolumn',
  137. listeners: {
  138. select: function(column, combo, record, e) {
  139. column.up('grid').selection.set('subject_id', record.get('subject_id'));
  140. }
  141. }
  142. }, {
  143. text: '任课教师id',
  144. dataIndex: 'teacher_id',
  145. hidden: true,
  146. editor: {
  147. xtype: 'textfield'
  148. }
  149. }, {
  150. text: '任课教师',
  151. dataIndex: 'teacher_name',
  152. editor: {
  153. addTitle: '教师',
  154. xtype: 'dbfindtrigger',
  155. //数据接口
  156. dataUrl:'/api/school/mirror/findTeacher',
  157. //联想设置
  158. dbtpls:[{
  159. field:'teacher_name',width:150
  160. }],
  161. dbfinds:[{
  162. from: 'teacher_name', to: 'teacher_name',
  163. }, {
  164. from: 'teacher_id', to: 'teacher_id'
  165. }],
  166. defaultCondition: "1=1",
  167. dbSearchFields:[{
  168. emptyText:'请输入教师工号或姓名',
  169. xtype : "textfield",
  170. name : "search",
  171. getCondition: function(v) {
  172. return "(upper(teacher_name) like '%"+v.toUpperCase()+"%' or upper(teacher_number) like '%"+v.toUpperCase()+"%')";
  173. },
  174. allowBlank : true,
  175. width:300
  176. }],
  177. //放大镜窗口列表
  178. dbColumns:[{
  179. text: "ID",
  180. dataIndex: "teacher_id",
  181. hidden:true,
  182. xtype: "numbercolumn"
  183. }, {
  184. text: '工号',
  185. dataIndex: 'teacher_number',
  186. width: 110
  187. }, {
  188. text: "姓名",
  189. dataIndex: "teacher_name",
  190. width: 110
  191. }]
  192. }
  193. }]
  194. }]
  195. });
  196. this.callParent();
  197. },
  198. });