Sfoglia il codice sorgente

选科报名修复

shilipojs 2 anni fa
parent
commit
fb21c0f82d
1 ha cambiato i file con 28 aggiunte e 3 eliminazioni
  1. 28 3
      src/views/system/user/profile/components/report-table.vue

+ 28 - 3
src/views/system/user/profile/components/report-table.vue

@@ -28,7 +28,7 @@
       <template #signUp="{row}">
         <span class="f-red" v-if="!row.allowSelect">无法报名</span>
         <div v-else>
-          <span v-if="generation.current > 1" @click="commit" class="btn-green">报名</span>
+          <span v-if="generation.current > 1" @click="singleCommit(row)" class="btn-green">报名</span>
           <div v-else>
             <span class="f-red btn-red" v-if="row.selected" @click="toUnSelect(row)">取消报名</span>
             <span class="btn-green" v-else @click="toSelect(row)">报名</span>
@@ -390,6 +390,32 @@ export default {
       // AI 分析 跳转
       this.$refs.aiDialog.open(this.formatRows)
     },
+    singleCommit(row) {
+      this.$confirm(`是否要提交报名`, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        row.selected = true
+        console.log(row)
+        const arrRow = [row]
+        submitElectiveModels({
+          models: [row]
+          // esign:this.base64Img
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('报名成功')
+            this.refreshData()
+          }
+          console.log(res)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消提交'
+        })
+      })
+    },
     commit() {
       if (this.generation.current == 1) {
         const real = this.activeModels.selectedList.filter(item => {
@@ -412,8 +438,7 @@ export default {
         }).then(res => {
           if (res.code == 200) {
             this.$message.success('报名成功')
-            this.loadStudentSelected()
-            this.getStudentElectiveModels()
+            this.refreshData()
           }
           console.log(res)
         })