From 85e31ab46cfa76de986e6084e7e4dfda35ac98e6 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 12 Aug 2021 10:44:55 +0800
Subject: [PATCH] 培训报名修改,路由修改

---
 src/views/traincompany/index.vue |   57 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 9 deletions(-)

diff --git a/src/views/traincompany/index.vue b/src/views/traincompany/index.vue
index 45401ce..1a2384b 100644
--- a/src/views/traincompany/index.vue
+++ b/src/views/traincompany/index.vue
@@ -30,14 +30,21 @@
     >
 
       <template slot-scope="{ type,row }" slot="menu">
-                            <el-button
-                            :type="type"
-                            size="small"
-                            icon="el-icon-edit"
-                            @click="handleTrainApply(row)"
-                            >报名
-                            </el-button>
-                        </template>
+          <el-button
+          :type="type"
+          size="small"
+          icon="el-icon-edit"
+          @click="handleTrainApply(row)"
+          >报名
+          </el-button>
+          <el-button
+          :type="type"
+          size="small"
+          icon="el-icon-edit"
+          @click="handleTrainApplyBatch(row)"
+          >批量报名
+          </el-button>
+      </template>
     </avue-crud>
 
     <el-dialog
@@ -268,13 +275,45 @@
     })
   },
   methods: {
-    handleTrainApply(row){
+    //保安公司批量报名
+    handleTrainApplyBatch(row){
       this.dialogDisable = true;
       this.optionTrainApply.column.trainingUnitId = row.departmentid;
       this.formTrainApply = {
         trainingUnitId: row.departmentid
       }
     },
+    //未持证保安人员报名
+    handleTrainApply(row,done,loading){
+      row['userId'] = this.userInfo.user_id;
+      row['trainingUnitId'] = row.departmentid;
+      adddata(row).then(
+        (res) => {
+          // this.onLoad(this.page);
+          if(res.data.data==201){
+              this.$message({
+                type: "warning",
+                message:"已报名,不能重复报名",
+              });
+          }else if(res.data.data==201){
+              this.$message({
+                type: "warning",
+                message:"报名失败",
+              });
+          }else{
+              this.$message({
+                type: "success",
+                message:"报名成功",
+              });
+          }
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
     //关闭窗口清除数据
     closeDialog(){
       this.$refs.formTrainApply.resetFields();

--
Gitblit v1.9.3