zhuth 7 tahun lalu
induk
melakukan
2a800d5340

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

@@ -45,7 +45,40 @@ Ext.define('school.view.interaction.homework.List', {
                 hiddenTools: false,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '删除'
+                    text: '删除',
+                    handler: function() {
+                        let grid = this.up('grid'),
+                        selectedRecords = grid.getSelection();
+                        let data;
+
+                        data = selectedRecords.map(function(r) {
+                            return {
+                                id: r.get('task_id')
+                            };
+                        });
+
+                        if(data.length == 0) {
+                            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+                            return;
+                        }
+
+                        grid.setLoading(true);
+                        school.util.BaseUtil.request({
+                            // url: 'http://10.1.80.47:9560/teacher/batchDelete',
+                            url: '/api/school/homework/batchDelete',
+                            method: 'POST',
+                            params: JSON.stringify({
+                                baseDTOs: data
+                            })
+                        }).then(function(res) {
+                            grid.setLoading(false);
+                            school.util.BaseUtil.showSuccessToast('成功删除' + data.length + '条记录');
+                            grid.store.loadPage(grid.store.currentPage);
+                        }).catch(function(e) {
+                            grid.setLoading(false);
+                            school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
+                        });
+                    }
                 }, {
                     xtype: 'button',
                     text: '新增',

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

@@ -46,7 +46,40 @@ Ext.define('school.view.interaction.notice.List', {
                 hiddenTools: false,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '删除'
+                    text: '删除',
+                    handler: function() {
+                        let grid = this.up('grid'),
+                        selectedRecords = grid.getSelection();
+                        let data;
+
+                        data = selectedRecords.map(function(r) {
+                            return {
+                                id: r.get('notify_id')
+                            };
+                        });
+
+                        if(data.length == 0) {
+                            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+                            return;
+                        }
+
+                        grid.setLoading(true);
+                        school.util.BaseUtil.request({
+                            // url: 'http://10.1.80.47:9560/teacher/batchDelete',
+                            url: '/api/school/notice/batchDelete',
+                            method: 'POST',
+                            params: JSON.stringify({
+                                baseDTOs: data
+                            })
+                        }).then(function(res) {
+                            grid.setLoading(false);
+                            school.util.BaseUtil.showSuccessToast('成功删除' + data.length + '条记录');
+                            grid.store.loadPage(grid.store.currentPage);
+                        }).catch(function(e) {
+                            grid.setLoading(false);
+                            school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
+                        });
+                    }
                 }, {
                     xtype: 'button',
                     text: '新增',

+ 2 - 5
frontend/pc-web/app/view/basic/class/ClassDetail.js

@@ -10,11 +10,8 @@ Ext.define('school.view.basic.class.ClassDetail', {
     _codeField: null,
 
     _readUrl: '/api/school/class/read',
-    _saveUrl: '/api/purchase/purchase/save',
-    _auditUrl: '/api/purchase/purchase/audit',
-    _unAuditUrl: '/api/purchase/purchase/unAudit',
-    _deleteUrl: '/api/purchase/purchase/delete',
-    _turnInUrl: '/api/purchase/purchase/turnProdin',
+    _saveUrl: '/api/school/class/save',
+    _deleteUrl: '/api/school/class/delete',
 
     initId: 0,
     initComponent: function () {

+ 4 - 3
frontend/pc-web/app/view/basic/class/ClassInfoController.js

@@ -108,7 +108,7 @@ Ext.define('school.view.basic.class.ClassInfoController', {
         store = tree.store,
         record = store.getAt(row);
 
-        me.showTreeAddWin(record.data, record);
+        me.showTreeAddWin(record);
 
     },
 
@@ -156,17 +156,18 @@ Ext.define('school.view.basic.class.ClassInfoController', {
         });
     },
 
-    showTreeAddWin: function(data, record) {
+    showTreeAddWin: function(record, count) {
         let me = this,
         view = me.getView(),
         refs = me.getReferences(),
         treeList = refs.treelist,
         listCard = refs.listcard,
         win = refs.treeaddwin,
+        data = record.data,
         id = data.id,
         _id = data._id,
         type = data.type,
-        childCount = record.childNodes.length;
+        childCount = count >= 0 ? count : record.childNodes.length;
 
         let title = type == 'SCHOOL' ? '新增年级' : '新增班级';
         let sumType = type == 'SCHOOL' ? 'GRADE' : 'CLASS';

+ 3 - 1
frontend/pc-web/app/view/basic/class/ListCard.js

@@ -91,9 +91,11 @@ Ext.define('school.view.basic.class.ListCard', {
             cardList = Ext.Array.merge(list, [{
                 addBtn: true,
                 id: node.data.id,
+                _id: node.data._id,
                 type: node.data.type,
                 itemCls: 'item-add',
-                textCls: 'text-add x-ss ss-add'
+                textCls: 'text-add x-ss ss-add',
+                count: list.length
             }]);
 
             currentlist.loadData(cardList);

+ 1 - 1
frontend/pc-web/app/view/basic/class/ListCardController.js

@@ -22,7 +22,7 @@ Ext.define('school.view.basic.class.ListCardController', {
         var node;
 
         if(!!record.get('addBtn')) {
-            classInfoController.showTreeAddWin(record.data);
+            classInfoController.showTreeAddWin(record, record.get('count'));
         }else {
             node = rootNode.findChild('id', record.get('id'), true);
             view.showNode(node);

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

@@ -24,6 +24,10 @@ Ext.define('school.view.basic.student.StudentDetail', {
     initComponent: function () {
         Ext.apply(this, {
             defaultItems: [{
+                xtype: 'hidden',
+                name: 'stu_id',
+                fieldLabel: 'id',
+            }, {
                 xtype: 'textfield',
                 name: 'stu_number',
                 fieldLabel: '学号'