ClassDetail.js 7.4 KB

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