ClassDetail.js 7.1 KB

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