Browse Source

课程表状态控制

zhuth 7 years ago
parent
commit
b4f9bfaaf7

+ 2 - 2
frontend/pc-web/app/view/Interaction/score/Detail.js

@@ -9,7 +9,7 @@ Ext.define('school.view.interaction.score.Detail', {
     _idField: 'si_id',
     _codeField: null,
 
-    // _readUrl: 'http://10.1.80.47:9520/api/school/score/read',
+    // _readUrl: 'http://10.1.80.36:9520/api/school/score/read',
     _readUrl: '/api/school/score/read',
     // _saveUrl: 'http://10.1.80.47:9520/api/school/score/save',
     // _saveUrl: '/api/sale/sss/update',
@@ -71,7 +71,7 @@ Ext.define('school.view.interaction.score.Detail', {
                 rowViewModel: {},
                 columns: [{
                     text: '学生编号',
-                    dataIndex: 'sd_id'
+                    dataIndex: 'sd_stuNumber'
                 }, {
                     text: '姓名',
                     dataIndex: 'sd_stu'

+ 2 - 1
frontend/pc-web/app/view/Interaction/score/List.js

@@ -137,7 +137,8 @@ Ext.define('school.view.interaction.score.List', {
                     hidden: true
                 }, {
                     text: '考试标题',
-                    dataIndex: 'si_examtitle'
+                    dataIndex: 'si_examtitle',
+                    width: 200
                 }, {
                     text: '考试时间',
                     dataIndex: 'si_examdate',

+ 17 - 5
frontend/pc-web/app/view/Interaction/timetable/Detail.js

@@ -350,11 +350,23 @@ Ext.define('school.view.interaction.timetable.Detail', {
                     hidden: true
                 }]
             }],
-            // toolBtns: [{
-            //     xtype: 'button',
-            //     text: '发布',
-            //     handler: 'onPublish'
-            // }]
+            toolBtns: [{
+                xtype: 'button',
+                text: '启用',
+                hidden: true,
+                bind: {
+                    hidden: '{!id || status == 1}'
+                },
+                handler: 'onPublish'
+            }, {
+                xtype: 'button',
+                text: '禁用',
+                hidden: true,
+                bind: {
+                    hidden: '{!id || status == 0}'
+                },
+                handler: 'onRePublish'
+            }]
         });
         this.callParent();
     },

+ 47 - 1
frontend/pc-web/app/view/Interaction/timetable/DetailController.js

@@ -9,9 +9,55 @@ Ext.define('school.view.interaction.timetable.DetailController', {
         form.initId = id;
         school.util.FormUtil.loadData(form).then(function(data) {
             var newId = form.xtype + '-' + data.main.id;
-            var newTitle = form._title + '(' + data.main.id + ')';
+            var newTitle = form._title + '(' + data.main.name + ')';
     
             school.util.BaseUtil.refreshTabTitle(newId, newTitle);
         });
     },
+
+    onPublish: function() {
+        let me = this,
+        view = me.getView(),
+        viewModel = me.getViewModel(),
+        id = viewModel.data.id;
+        view.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.180:9520/api/school/curriculum/publish/' + id,
+            url: '/api/school/curriculum/publish/' + id,
+            method: 'POST'
+        })
+        .then(function() {
+            view.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('启用成功');
+            viewModel.set('status', 1);
+            me.refresh();
+        })
+        .catch(function(e) {
+            view.setLoading(false);
+            school.util.BaseUtil.showErrorToast('启用失败: ' + e.message);
+        });
+    },
+
+    onRePublish: function() {
+        let me = this,
+        view = me.getView(),
+        viewModel = me.getViewModel(),
+        id = viewModel.data.id;
+        view.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.180:9520/api/school/curriculum/republish/' + id,
+            url: '/api/school/curriculum/republish/' + id,
+            method: 'POST'
+        })
+        .then(function() {
+            view.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('禁用成功');
+            viewModel.set('status', 0);
+            me.refresh();
+        })
+        .catch(function(e) {
+            view.setLoading(false);
+            school.util.BaseUtil.showErrorToast('禁用失败: ' + e.message);
+        });
+    },
 });

+ 1 - 1
frontend/pc-web/app/view/Interaction/timetable/List.js

@@ -106,7 +106,7 @@ Ext.define('school.view.interaction.timetable.List', {
                 addTitle: '课程表',
                 addXtype: 'interaction-timetable-detail',
                 idField: 'id',
-                codeField: 'id',
+                codeField: 'name',
                 detailField: 'name',
                 dataUrl: me.dataUrl,
                 caller: null,

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

@@ -15,7 +15,7 @@ Ext.define('school.view.basic.student.StudentDetail', {
     _auditdateField: null,
     // _readUrl: 'http://10.1.80.47:9560/student/read',
     _readUrl: '/api/school/student/read',
-    // _saveUrl: 'http://10.1.80.47:9560/student/save',
+    // _saveUrl: 'http://10.1.80.36:9520/api/school/student/save',
     _saveUrl: '/api/school/student/save',
     // _deleteUrl: 'http://10.1.80.47:9560/student/delete',
     _deleteUrl: '/api/school/student/delete',