ClassDetail.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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: 'http://10.1.80.180:9520/api/school/class/deleteDetail',
  116. deleteDetailUrl: '/api/school/class/deleteDetail',
  117. allowEmpty: true,
  118. showCount: false,
  119. group: '学科信息',
  120. columns: [{
  121. text: 'id',
  122. dataIndex: 'teacher_clazz_id',
  123. hidden: true
  124. }, {
  125. text: '学科id',
  126. dataIndex: 'subject_id',
  127. hidden: true,
  128. editor: {
  129. xtype: 'textfield'
  130. }
  131. /**
  132. * TODO 未写入学科id
  133. */
  134. }, {
  135. text: '学科',
  136. dataIndex: 'subject_name',
  137. xtype: 'subjectcolumn',
  138. listeners: {
  139. select: function(column, combo, record, e) {
  140. column.up('grid').selection.set('subject_id', record.get('subject_id'));
  141. }
  142. }
  143. }, {
  144. text: '任课教师id',
  145. dataIndex: 'teacher_id',
  146. hidden: true,
  147. editor: {
  148. xtype: 'textfield'
  149. }
  150. }, {
  151. text: '任课教师',
  152. dataIndex: 'teacher_name',
  153. editor: {
  154. addTitle: '教师',
  155. xtype: 'dbfindtrigger',
  156. //数据接口
  157. dataUrl:'/api/school/mirror/findTeacher',
  158. //联想设置
  159. dbtpls:[{
  160. field:'teacher_name',width:150
  161. }],
  162. dbfinds:[{
  163. from: 'teacher_name', to: 'teacher_name',
  164. }, {
  165. from: 'teacher_id', to: 'teacher_id'
  166. }],
  167. defaultCondition: "1=1",
  168. dbSearchFields:[{
  169. emptyText:'请输入教师工号或姓名',
  170. xtype : "textfield",
  171. name : "search",
  172. getCondition: function(v) {
  173. return "(upper(teacher_name) like '%"+v.toUpperCase()+"%' or upper(teacher_number) like '%"+v.toUpperCase()+"%')";
  174. },
  175. allowBlank : true,
  176. width:300
  177. }],
  178. //放大镜窗口列表
  179. dbColumns:[{
  180. text: "ID",
  181. dataIndex: "teacher_id",
  182. hidden:true,
  183. xtype: "numbercolumn"
  184. }, {
  185. text: '工号',
  186. dataIndex: 'teacher_number',
  187. width: 110
  188. }, {
  189. text: "姓名",
  190. dataIndex: "teacher_name",
  191. width: 110
  192. }]
  193. }
  194. }]
  195. }]
  196. });
  197. this.callParent();
  198. },
  199. });