浏览代码

志愿数、签名、报名

shilipojs 2 年之前
父节点
当前提交
149d62df7d

+ 2 - 6
doc/Mind/PrimaryElective.cs

@@ -164,13 +164,9 @@ namespace mxdemo.Mind
         List<ElectiveOptionalMajor> getOptionalMajors();
 
         // 初选报名。这里简化原型里的操作,直接提交,如需排序,调sortElectiveSelected接口,并刷新getPrimaryElectivesx
-        void submitPrimaryElective(ElectiveSelectModel model);
+        void submitPrimaryElective(ElectiveSelectModel[] models, ElectiveEsign esign);
 
-        // 调整排序。这里简化原型里的操作,并刷新getPrimaryElectives
-        void sortPrimaryElective(ElectiveSelectModel model);
-
-        // 取消报名
-        void cancelPrimaryElective(ElectiveSelectModel model);
+        void esign(ElectiveEsign esign);
 
         // 返回学生测评推荐专业以及匹配情况
         List<RecommendMajor> getRecommendMajor();

+ 18 - 0
src/api/webApi/elective/selected-subject.js

@@ -44,7 +44,25 @@ export function getStudentElectiveModels(params) {
   })
 }
 
+// 初选报名
 
+export function submitElectiveModels(data) {
+  return request({
+    url: '/front/elective/enroll/submitElectiveModels',
+    method: 'post',
+    data
+  })
+}
+
+
+// 学生报名签名
+export function saveEsign(data) {
+  return request({
+    url: '/front/elective/enroll/esign',
+    method: 'post',
+    data
+  })
+}
 
 
 

+ 37 - 23
src/views/system/user/profile/components/esign-dialog.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- 做使用el-dialog做签字的弹框 -->
-    <el-dialog title="签字" :visible.sync="dialogVisible" width="800px" append-to-body>
+    <el-dialog title="签字" v-if="dialogVisible" :visible.sync="dialogVisible" width="800px" append-to-body>
       <!-- 使用这个签名组件 -->
       <vue-esign
         ref="esign"
@@ -13,18 +13,18 @@
         :lineColor="lineColor"
         :bgColor.sync="bgColor"
       />
-      <span slot="footer" class="dialog-footer fx-row jc-between">
-           <el-popover
-             placement="top-start"
-             title="协议"
-             width="200"
-             trigger="click"
-             content="协议内容">
-             <el-button slot="reference">协议</el-button>
-        </el-popover>
+      <span slot="footer" class="dialog-footer fx-row jc-end">
+<!--           <el-popover-->
+<!--             placement="top-start"-->
+<!--             title="协议"-->
+<!--             width="200"-->
+<!--             trigger="click"-->
+<!--             content="协议内容">-->
+<!--             <el-button slot="reference">协议</el-button>-->
+<!--        </el-popover>-->
 
         <div>
-          <el-button @click="handleGenerate" type="primary">生成签字图片</el-button>
+          <el-button @click="handleGenerate" type="primary">保存</el-button>
           <el-button @click="handleReset">清空画板</el-button>
           <el-button @click="dialogVisible = false">取消</el-button>
         </div>
@@ -32,11 +32,12 @@
     </el-dialog>
   </div>
 </template>
-
 <script>
+import { submitElectiveModels,saveEsign } from '@/api/webApi/elective/selected-subject'
 export default {
   data() {
     return {
+      selectedList: [],
       dialogVisible: false, // 弹框是否开启
       lineWidth: 3, // 画笔的线条粗细
       lineColor: "#000000", // 画笔的颜色
@@ -46,38 +47,51 @@ export default {
     };
   },
   methods: {
-    open() {
+    open(selectedList) {
+      this.selectedList = selectedList
       this.dialogVisible = true
     },
     // 清空画板
     handleReset() {
       this.$refs.esign.reset();
     },
+    saveELective() {
+      submitElectiveModels({
+        models:this.selectedList}).then(res => {
+          console.log(res)
+      })
+    },
     // 生成签字图
     handleGenerate() {
       this.$refs.esign
         .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
         .then((res) => {
+          console.log(this.selectedList)
           this.resultImg = res;
+          this.saveELective()
+          //
+          // 在这里向后端发请求把转换后的base64文件传给后端,后端接收以后再转换成图片做静态图片存储
+          // 当然也可以把base64转成流文件blob格式的,类似上传给后端这样,具体哪种方式看后端要求
+          console.log(this.resultImg);
+          // setTimeout(() => {
+          //   // 这里要使用定时器稍微延后以后就能取到base64数据了,当然也可以再加一个确认按钮,如:确认使用这张base64签名图片
+          //   // 点击确认以后,在其回调函数中,再把base64的签名图片传给后端用于存储
+          //   console.log(this.resultImg);
+          // }, 200);
         })
         .catch((err) => {
           // 画布没有签字时会执行这里提示一下
           this.$message({
             type: "warning",
-            message: "请签名后再生成签字图片",
+            message: "请签名",
           });
+          return
         });
 
-      // 在这里向后端发请求把转换后的base64文件传给后端,后端接收以后再转换成图片做静态图片存储
-      // 当然也可以把base64转成流文件blob格式的,类似上传给后端这样,具体哪种方式看后端要求
-      setTimeout(() => {
-        // 这里要使用定时器稍微延后以后就能取到base64数据了,当然也可以再加一个确认按钮,如:确认使用这张base64签名图片
-        // 点击确认以后,在其回调函数中,再把base64的签名图片传给后端用于存储
-        console.log('我是签字后的base64图片',this.resultImg);
-      }, 200);
-      this.dialogVisible = false;
+
+      this.dialogVisible = true;
     },
-  },
+  }
 };
 </script>
 

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

@@ -56,7 +56,9 @@
     <!-- 初录 多志愿拖拽 -->
     <div v-if="this.generation.current == 1">
       <p>您的选科志愿: <span v-for="(item,index) in selectedList">
-      {{ item.groupName }}{{ index + 1 < selectedList.length ? '、' : '' }}</span>
+      {{ item.groupName }}
+<!--        {{ index + 1 < selectedList.length ? '、' : '' }}-->
+      </span>
       </p>
       <test-drage ref="drage" :sortList="selectedList"></test-drage>
       <el-button @click="commit" type="primary">提交</el-button>
@@ -154,9 +156,9 @@ export default {
       activeStep: '',
       regInfo: '',
       dialogVisible: false,
-      selectedList: [],
       singleList: [], // 单志愿列表
-      rows: []
+      rows: [],
+      selectedList:[]
     }
   },
   computed: {
@@ -285,18 +287,16 @@ export default {
       this.$refs.aiDialog.open(this.formatRows)
     },
     commit() {
-      console.log(this.selectedList)
-      if (this.generation == 0) {
+      if (this.generation.current == 1) {
         const real = this.selectedList.filter(item => {
           return item.selected == true
         })
-        if (real.length < this.preferenceCount) {
-          this.$message.warning(`初录报名需要选择${this.preferenceCount}个志愿`)
+        if (real.length < this.generation.status.preferenceCount) {
+          this.$message.warning(`初录报名需要选择${this.generation.status.preferenceCount}个志愿`)
           return
         }
       }
-
-      this.$refs.esignDialog.open()
+      this.$refs.esignDialog.open(this.selectedList)
     },
     toSelect(row) {
       const preferenceCount = this.generation.status.preferenceCount
@@ -322,7 +322,7 @@ export default {
           return selected.groupId == row.groupId
         }))
         this.selectedList.splice(start, 1)
-
+        this.$refs.drage.init(this.selectedList)
       }).catch(() => {
         this.$message({
           type: 'info',

+ 0 - 6
src/views/system/user/profile/components/test-drage.vue

@@ -20,12 +20,6 @@
 </template>
 <script>
 export default {
-  // props: {
-  //   sortList: {
-  //     type: Array,
-  //     default:_ => []
-  //   }
-  // },
   data() {
     return {
       dragIndex: '',

+ 3 - 3
src/views/system/user/profile/round-select.vue

@@ -148,15 +148,15 @@ export default {
     },
     getOptionalMajors() {
       getOptionalMajors().then(res => {
-        this.optionalMajors = res.data.reverse().splice(0, 6)
+        this.optionalMajors = res.data
       })
     },
     loadStudentSelected() {
       getStudentSelected().then(res => {
         console.log('getStudentSelected', res)
         const status = res.data['selectResult']
-        status.currentGeneration = status.currentGeneration || 9
-        status.preferenceCount = status.preferenceCount || 3
+        status.currentGeneration = res.data.currentGeneration || 9
+        status.preferenceCount = res.data.preferenceCount || 3
         this.selectObj = res.data['selectResult']
         this.allowSelect = res.data.allowSelect
       })