ClassDetail.js 7.4 KB

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