ソースを参照

多学号问题

WANG 6 年 前
コミット
b2028b5d49
1 ファイル変更53 行追加5 行削除
  1. 53 5
      src/modules/examwork/view/student.vue

+ 53 - 5
src/modules/examwork/view/student.vue

@@ -291,7 +291,7 @@
                       size="mini"
                       type="danger"
                       icon="el-icon-refresh"
-                      @click="unbindStudentCode(scope.row)"
+                      @click="showUnbindStudentCode(scope.row)"
                       >解绑学号
                     </el-button>
                   </el-dropdown-item>
@@ -322,6 +322,34 @@
           </el-pagination>
         </div>
 
+        <!-- 解绑学号-->
+        <el-dialog
+          title="解绑学号"
+          width="50%"
+          :visible.sync="unbindStudentCodeDialog"
+        >
+          <el-table
+            :data="unbindStudentCodeData.tableData"
+            border
+            style="width: 100%;text-align:center;"
+          >
+            <el-table-column prop="name" label="姓名" />
+            <el-table-column prop="identityNumber" label="身份证" />
+            <el-table-column prop="name" label="学号" />
+            <el-table-column label="操作" width="100">
+              <div slot-scope="scope">
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click="unbindStudentCode(scope.row)"
+                  icon="el-icon-delete"
+                  >解绑
+                </el-button>
+              </div>
+            </el-table-column>
+          </el-table>
+        </el-dialog>
+
         <!-- 考试记录 -->
         <el-dialog
           title="学生考试记录"
@@ -516,6 +544,11 @@ export default {
       photoDialog: false,
       photo: { url: "" },
 
+      unbindStudentCodeDialog: false,
+      unbindStudentCodeData: {
+        tableData: []
+      },
+
       errMessages: [],
       uploadAction: EXCHANGE_API + "/facepp/add",
       uploadData: {},
@@ -719,16 +752,31 @@ export default {
         }
       }
     },
+    showUnbindStudentCode(row) {
+      this.unbindStudentCodeData.tableData = [];
+      for (let cur of row.studentCodeList) {
+        this.unbindStudentCodeData.tableData.push({
+          studentCode: cur,
+          rootOrgId: row.rootOrgId,
+          name: row.name,
+          identityNumber: row.identityNumber
+        });
+      }
+      debugger;
+      this.unbindStudentCodeDialog = true;
+    },
     unbindStudentCode(row) {
-      var stuIds = this.checkIds(row);
-      if (!stuIds) return;
+      var params = new URLSearchParams({
+        studentCode: row.studentCode,
+        rootOrgId: row.rootOrgId
+      });
       this.$confirm("是否解绑学号?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        var url = CORE_API + "/student/unbindStudentCode/" + stuIds;
-        this.$httpWithMsg.put(url).then(response => {
+        var url = CORE_API + "/student/unbindStudentCode?" + params;
+        this.$httpWithMsg.post(url).then(response => {
           console.log(response);
           this.$notify({
             type: "success",