Pārlūkot izejas kodu

班级信息接口对接

zhuth 6 gadi atpakaļ
vecāks
revīzija
aa1475e480

+ 48 - 15
frontend/pc-web/app/view/basic/class/ClassDetail.js

@@ -11,7 +11,7 @@ Ext.define('school.view.basic.class.ClassDetail', {
     _auditmanField: 'pu_auditman',
     _auditdateField: 'pu_auditdate',
     _relationColumn: 'pd_puid',
-    _readUrl: '/api/purchase/purchase/read',
+    _readUrl: '/class/read',
     _saveUrl: '/api/purchase/purchase/save',
     _auditUrl: '/api/purchase/purchase/audit',
     _unAuditUrl: '/api/purchase/purchase/unAudit',
@@ -22,12 +22,12 @@ Ext.define('school.view.basic.class.ClassDetail', {
         Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
-                name: 'currentDetail.id',
+                name: 'clazz_id',
                 fieldLabel: 'id',
                 group: '班级信息',
             }, {
                 xtype: "textfield",
-                name: "currentDetail.name",
+                name: "clazz_name",
                 fieldLabel: "班级名称",
                 columnWidth: 0.5,
                 group: '班级信息',
@@ -43,24 +43,24 @@ Ext.define('school.view.basic.class.ClassDetail', {
                 group: '班级信息',
             }, {
                 xtype: "textfield",
-                name: "address",
+                name: "clazz_adress",
                 fieldLabel: "班级地址",
                 columnWidth: 1,
                 group: '班级信息',
             }, {
                 xtype: "textfield",
-                name: 'status',
+                name: 'clazz_status',
                 fieldLabel: "状态",
                 columnWidth: 0.5,
                 group: '班级信息',
             }, {
                 xtype: "textfield",
-                name: 'remark',
+                name: 'clazz_remarks',
                 fieldLabel: '备注',
                 columnWidth: 0.5,
                 group: '班级信息',
             }, {
-                name: "detailGridField",
+                name: "detail0",
                 xtype: "detailGridField",
                 detnoColumn: 'sd_detno',
                 storeModel: 'school.model.basic.Student',
@@ -70,28 +70,61 @@ Ext.define('school.view.basic.class.ClassDetail', {
                 group: '学生信息',
                 columns: [{
                     text: 'id',
-                    dataIndex: 'student_id',
+                    dataIndex: 'stu_id',
                     hidden: true
                 }, {
-                    text: '号',
-                    dataIndex: 'student_number'
+                    text: '号',
+                    dataIndex: 'stu_number'
                 }, {
                     text: '姓名',
-                    dataIndex: 'student_name'
+                    dataIndex: 'stu_name'
                 }, {
                     text: '性别',
-                    dataIndex: 'student_gender'
+                    dataIndex: 'stu_sex'
                 }, {
                     text: '出生日期',
-                    dataIndex: 'student_birth',
+                    dataIndex: 'stu_birthday',
                     xtype: 'datecolumn',
                     format: 'Y-m-d'
                 }, {
                     text: '年龄',
-                    dataIndex: 'student_age'
+                    dataIndex: 'stu_age'
                 }, {
                     text: '家庭住址',
-                    dataIndex: 'student_address'
+                    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",
+                detnoColumn: 'sd_detno',
+                storeModel: 'school.model.basic.Student',
+                deleteDetailUrl: '/api/sale/sale/deleteDetail',
+                allowEmpty: true,
+                showCount: false,
+                group: '任课教师信息',
+                columns: [{
+                    text: 'id',
+                    dataIndex: 'teacher_id',
+                    hidden: true
+                }, {
+                    text: '姓名',
+                    dataIndex: 'teacher'
+                }, {
+                    text: '学科',
+                    dataIndex: 'subject'
                 }]
             }]
         });

+ 25 - 5
frontend/pc-web/app/view/basic/class/ListCard.js

@@ -54,11 +54,31 @@ Ext.define('school.view.basic.class.ListCard', {
             currentlist.removeAll();
             listCard.setVisible(false);
             classDetail.setVisible(true);
-            viewModel.set('currentDetail', {
-                id: node.data.id,
-                name: node.data.text,
-                grade: node.parentNode.data.text,
-            })
+            classDetail.setLoading(true);
+            school.util.BaseUtil.request({
+                url: '/class/read/' + node.data._id
+            }).then(function(res) {
+                classDetail.setLoading(false);
+                if(res.success) {
+                    let d = res.data;
+                    let o = {
+                        main: d.main
+                    };
+                    if(d.hasOwnProperty('items')) {
+                        o.detail0 = d.items;
+                    }else {
+                        let idx = 1;
+                        while(d.hasOwnProperty('items' + idx)) {
+                            o['detail' + (idx - 1)] = d['items' + idx];
+                            idx++;
+                        }
+                    }
+                    classDetail.initFormData(o);
+                    classDetail.fireEvent('load', classDetail, o);
+                }
+            }).catch(function(e) {
+                school.util.BaseUtil.showErrorToast('请求数据失败: ' + e.message);
+            });
         }else {
             node.expand();
             listCard.setVisible(true);

+ 1 - 1
frontend/pc-web/app/view/basic/staff/StaffList.js

@@ -5,7 +5,7 @@ Ext.define('school.view.basic.staff.StaffList', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'basic-staff-stafflist',
 
-    dataUrl: '/api/basic/staff/list',
+    dataUrl: '/teacher/list',
     initComponent: function() {
         var me = this;
         Ext.apply(this, {

+ 1 - 1
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -14,7 +14,7 @@ Ext.define('school.view.basic.student.StudentDetail', {
     _auditmanField: null,
     _auditdateField: null,
     // _readUrl: 'http://10.1.80.35:8560/api/sale/saledown/read',
-    _readUrl: 'http://10.1.80.35:9560/student/read',
+    _readUrl: '/student/read',
     // _saveUrl: 'http://10.1.80.35:8560/api/sale/saledown/update',
     _saveUrl: '/api/sale/saledown/update',
     // _toSaleUrl: 'http://10.1.80.35:8560/api/sale/saledown/toSale',

+ 1 - 1
frontend/pc-web/app/view/basic/student/StudentList.js

@@ -5,7 +5,7 @@ Ext.define('school.view.basic.student.StudentList', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'basic-student-studentlist',
 
-    dataUrl: 'http://10.1.80.35:9560/student/list',
+    dataUrl: '/student/list',
     initComponent: function() {
         var me = this;
         Ext.apply(this, {

+ 3 - 4
frontend/pc-web/app/view/main/Main.js

@@ -47,10 +47,9 @@ Ext.define('school.view.main.Main', {
                     reference: 'mainprofile',
                     cls:'x-main-master',
                     ui: 'header',
-                    text: '金色阳光希望小学'
-                    // bind: {
-                    //     text: '{company.name}'
-                    // }
+                    bind: {
+                        text: '{schoolName || "学校"}'
+                    }
                 },
                 '->',
                 {

+ 1 - 0
frontend/pc-web/app/view/viewport/ViewportModel.js

@@ -50,6 +50,7 @@ Ext.define('school.view.viewport.ViewportModel', {
                                 s.id = 'school-' + s.id;
                                 let classes = s.children;
                                 classes.map(function(c) {
+                                    c._id = c.id;
                                     c.id = 'class-' + c.id;
                                     return c;
                                 });