| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- Ext.define('school.view.basic.class.ClassDetail', {
- extend: 'school.view.core.form.FormPanel',
- xtype: 'classdetail',
- controller: 'classdetail',
- viewModel: 'classdetail',
- //字段属性
- _title: '班级信息',
- _idField: 'clazz_id',
- _codeField: null,
- // _readUrl: 'http://10.1.80.180:9520/api/school/class/read',
- _readUrl: '/api/school/class/read',
- // _saveUrl: 'http://10.1.80.180:9520/api/school/class/save',
- _saveUrl: '/api/school/class/save',
- _deleteUrl: '/api/school/class/delete',
- initId: 0,
- initComponent: function () {
- Ext.apply(this, {
- defaultItems: [{
- xtype: 'hidden',
- name: 'clazz_id',
- fieldLabel: 'id',
- group: '班级信息',
- }, {
- xtype: "textfield",
- name: "clazz_name",
- fieldLabel: "班级名称",
- readOnly: true,
- columnWidth: 0.5,
- group: '班级信息',
- allowBlank: false
- }, {
- // xtype: 'textfield',
- // name: 'code',
- // fieldLabel: '班级代码',
- // }, {
- xtype: 'gradecombo',
- name: 'clazz_grade',
- fieldLabel: '所属年级',
- columnWidth: 0.5,
- readOnly: true,
- group: '班级信息',
- allowBlank: false
- }, {
- xtype: "textfield",
- name: "clazz_adress",
- fieldLabel: "班级地址",
- columnWidth: 1,
- group: '班级信息',
- }, {
- xtype: "textfield",
- name: 'clazz_status',
- fieldLabel: "状态",
- columnWidth: 0.5,
- hidden: true,
- group: '班级信息',
- }, {
- xtype: "textfield",
- name: 'clazz_remarks',
- fieldLabel: '备注',
- columnWidth: 0.5,
- group: '班级信息',
- }, {
- name: "detail0",
- xtype: "detailGridField",
- detnoColumn: 'sd_detno',
- storeModel: 'school.model.basic.Student',
- allowEmpty: true,
- showCount: false,
- readOnly: true,
- group: '学生信息',
- columns: [{
- text: 'id',
- dataIndex: 'stu_id',
- hidden: true
- }, {
- text: '编号',
- dataIndex: 'stu_number'
- }, {
- text: '姓名',
- dataIndex: 'stu_name'
- }, {
- text: '性别',
- dataIndex: 'stu_sex',
- renderer: function(v, m , r) {
- return v == 1 ? '男' : (v == 0 ? '女' : '未知')
- }
- }, {
- text: '出生日期',
- dataIndex: 'stu_birthday',
- xtype: 'datecolumn',
- format: 'Y-m-d'
- }, {
- text: '年龄',
- dataIndex: 'stu_age'
- }, {
- text: '家庭住址',
- dataIndex: 'stu_address'
- }, {
- text: '入学时间',
- dataIndex: 'stu_enroll_date',
- xtype: 'datecolumn',
- format: 'Y-m-d'
- }, {
- text: '毕业时间',
- dataIndex: 'stu_graduate_date',
- xtype: 'datecolumn',
- format: 'Y-m-d'
- }, {
- text: '备注',
- dataIndex: 'stu_remarks'
- }]
- }, {
- name: "detail1",
- xtype: "detailGridField",
- idColumn: 'teacher_clazz_id',
- detnoColumn: 'no',
- storeModel: 'school.model.basic.Subject',
- // deleteDetailUrl: 'http://10.1.80.180:9520/api/school/class/deleteDetail',
- deleteDetailUrl: '/api/school/class/deleteDetail',
- allowEmpty: true,
- showCount: false,
- group: '学科信息',
- columns: [{
- text: 'id',
- dataIndex: 'teacher_clazz_id',
- hidden: true
- }, {
- text: '学科id',
- dataIndex: 'subject_id',
- hidden: true,
- editor: {
- xtype: 'textfield'
- }
- /**
- * TODO 未写入学科id
- */
- }, {
- text: '学科',
- dataIndex: 'subject_name',
- xtype: 'subjectcolumn',
- listeners: {
- select: function(column, combo, record, e) {
- column.up('grid').selection.set('subject_id', record.get('subject_id'));
- }
- }
- }, {
- text: '任课教师id',
- dataIndex: 'teacher_id',
- hidden: true,
- editor: {
- xtype: 'textfield'
- }
- }, {
- text: '任课教师',
- dataIndex: 'teacher_name',
- editor: {
- addTitle: '教师',
- xtype: 'dbfindtrigger',
- //数据接口
- dataUrl:'/api/school/mirror/findTeacher',
- //联想设置
- dbtpls:[{
- field:'teacher_name',width:150
- }],
- dbfinds:[{
- from: 'teacher_name', to: 'teacher_name',
- }, {
- from: 'teacher_id', to: 'teacher_id'
- }],
- defaultCondition: "1=1",
- dbSearchFields:[{
- emptyText:'请输入教师工号或姓名',
- xtype : "textfield",
- name : "search",
- getCondition: function(v) {
- return "(upper(teacher_name) like '%"+v.toUpperCase()+"%' or upper(teacher_number) like '%"+v.toUpperCase()+"%')";
- },
- allowBlank : true,
- width:300
- }],
- //放大镜窗口列表
- dbColumns:[{
- text: "ID",
- dataIndex: "teacher_id",
- hidden:true,
- xtype: "numbercolumn"
- }, {
- text: '工号',
- dataIndex: 'teacher_number',
- width: 110
- }, {
- text: "姓名",
- dataIndex: "teacher_name",
- width: 110
- }]
- }
- }]
- }]
- });
- this.callParent();
- },
- });
|