浏览代码

新增匯入API #327

osbert 4 年之前
父节点
当前提交
9f80516b3d

+ 10 - 0
TEAMModelOS/ClientApp/src/api/stuAccount.js

@@ -40,6 +40,16 @@ export default {
     format.students.push(...data)
     return post('/student/student-manage', format)
   },
+  // 匯入
+  ImportStudent: function(schoolId, data) {
+    let format = {
+      grant_type: 'import',
+      schoolId: schoolId,
+      students: []
+    }
+    format.students.push(...data)
+    return post('/student/student-manage', format)
+  },
   updateStudent: function(data) {
     return post('/api/Student/upsert', data)
   },

+ 6 - 2
TEAMModelOS/ClientApp/src/view/student-account/ImportStudent.vue

@@ -428,8 +428,12 @@
             saveFileData() {
                 if (this.isError == 0) {
                     this.uploadLoading = true
-
-                    this.$api.stuAccount.saveStudent(this.schoolCode, this.tableData).then(
+                    //整理TtableData
+                    let temp = this.tableData.map((item) => {
+                        item.classNo = item.classId
+                        return item
+                    })
+                    this.$api.stuAccount.ImportStudent(this.schoolCode, temp).then(
                         (res) => {
                             if (res.error == null) {
                                 this.$emit('importStudentInfo', res.students)