From 746bdcb49d537de9f1654bc365c3f12bbeaa54a0 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 04 Aug 2021 08:56:29 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises

---
 src/views/trainingRegistration/data.js   |   12 ------
 src/views/trainApply/index.vue           |   76 +++++++++++++++++++++++++++++++++++++-
 src/views/trainingRegistration/index.vue |    2 +
 src/views/applydetailed/index.vue        |   13 +++++-
 4 files changed, 87 insertions(+), 16 deletions(-)

diff --git a/src/views/applydetailed/index.vue b/src/views/applydetailed/index.vue
index 82ec0d1..8fd3d19 100644
--- a/src/views/applydetailed/index.vue
+++ b/src/views/applydetailed/index.vue
@@ -440,7 +440,7 @@
                     res: "data",
                     },
                     tip: "请上传 .xls,.xlsx 标准格式文件",
-                    action: "/api/blade-user/import-user",
+                    action: "/api/apply/import-apply",
                 },
                 {
                     label: "模板下载",
@@ -641,9 +641,18 @@
         },
         handleTemplate() {
             window.open(
-                `/api/blade-user/export-template`
+                `/api/apply/export-template`
             );
         },
+        uploadAfter(res, done, loading, column) {
+            window.console.log(column);
+            this.excelBox = false;
+            this.refreshChange();
+            done();
+        },
+        refreshChange() {
+            this.questionBankOnLoad(this.page, this.query);
+        },
     }
 }
 </script>
diff --git a/src/views/trainApply/index.vue b/src/views/trainApply/index.vue
index 429e3e8..57af7a2 100644
--- a/src/views/trainApply/index.vue
+++ b/src/views/trainApply/index.vue
@@ -6,7 +6,7 @@
  * menu-name 报名考试
  */
 <template>
-    <el-row class="morpheus-box-apply-exam">
+    <el-row class="morpheus-box-apply-exam-1">
         <el-col :span="24" class="hasButOne">
             <el-card>
                 <div class="exam-card-body">
@@ -38,6 +38,14 @@
                                 @click="handleExport"
                                 >导出
                             </el-button>
+                            <el-button
+                                type="success"
+                                size="small"
+                                plain
+                                icon="el-icon-upload2"
+                                @click="handleImport"
+                                >导入
+                            </el-button>
                         </template>
 
                         <template slot-scope="{ type,row }" slot="menu">
@@ -52,6 +60,25 @@
                         </template>
 
                     </avue-crud>
+
+                     <el-dialog
+                        title="清册数据导入"
+                        append-to-body
+                        :visible.sync="excelBox"
+                        width="555px"
+                        >
+                        <avue-form
+                            :option="excelOption"
+                            v-model="excelForm"
+                            :upload-after="uploadAfter"
+                        >
+                            <template slot="excelTemplate">
+                            <el-button type="primary" @click="handleTemplate">
+                                点击下载<i class="el-icon-download el-icon--right"></i>
+                            </el-button>
+                            </template>
+                        </avue-form>
+                    </el-dialog>
 
                 </div>
 
@@ -82,6 +109,7 @@
     data () {
 
         return {
+            excelBox: false,
             questionBankOption: {
                 // 操作栏多余按钮去除
                 delBtn: false,
@@ -239,7 +267,8 @@
                             required: true,
                             message: "请选择准考证号",
                             trigger: "blur"
-                        }]
+                        }],
+                        width:100,
                     },
                     {
                         label: "身份证号",
@@ -390,6 +419,32 @@
             },
             questionBankQuery: {},
             questionBankSelectionList: [],
+            excelForm: {},
+            excelOption: {
+                submitBtn: false,
+                emptyBtn: false,
+                column: [
+                {
+                    label: "模板上传",
+                    prop: "excelFile",
+                    type: "upload",
+                    drag: true,
+                    loadText: "模板上传中,请稍等",
+                    span: 24,
+                    propsHttp: {
+                    res: "data",
+                    },
+                    tip: "请上传 .xls,.xlsx 标准格式文件",
+                    action: "/api/trainingRegistration/import-trainingRegistration",
+                },
+                {
+                    label: "模板下载",
+                    prop: "excelTemplate",
+                    formslot: true,
+                    span: 24,
+                },
+                ],
+            },
         }
     },
 
@@ -576,6 +631,23 @@
                 window.open(`/api/trainingRegistration/export-apply?examId=${this.$route.query.id}`);
             });
         },
+        handleImport() {
+            this.excelBox = true;
+        },
+        handleTemplate() {
+            window.open(
+                `/api/apply/export-template`
+            );
+        },
+        uploadAfter(res, done, loading, column) {
+            window.console.log(column);
+            this.excelBox = false;
+            this.refreshChange();
+            done();
+        },
+        refreshChange() {
+            this.questionBankOnLoad(this.page, this.query);
+        },
     }
 }
 </script>
diff --git a/src/views/trainingRegistration/data.js b/src/views/trainingRegistration/data.js
index a53d540..cd66727 100644
--- a/src/views/trainingRegistration/data.js
+++ b/src/views/trainingRegistration/data.js
@@ -101,7 +101,6 @@
         searchSpan: 6,
         searchLabelWidth: 110,
         search: true,
-        overHidden: true
     },
     {
         label: "考试名称",
@@ -118,24 +117,13 @@
             trigger: "blur"
         }],
         hide: true,
-        searchSpan: 5,
-        searchLabelWidth: 110,
-        // search: true,
-        overHidden: true
     },
     {
         label: "考试名称",
         prop: "trainExamName",
-        rules: [{
-            required: true,
-            message: "请输入考试名称",
-            trigger: "blur"
-        }],
         editDisplay: false,
         addDisplay: false,
         searchLabelWidth: 110,
-        // search: true,
-        overHidden: true
     },
     {
         label: "报名时间",
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
index 0c11297..6feb547 100644
--- a/src/views/trainingRegistration/index.vue
+++ b/src/views/trainingRegistration/index.vue
@@ -37,6 +37,7 @@
           @click="revoke(row)"
           :size="size"
           :type="type"
+           :disabled="row.cancel==2"
           >撤销报名</el-button
         >
         <el-button
@@ -44,6 +45,7 @@
           @click="affirmApply(row)"
           :size="size"
           :type="type"
+          :disabled="row.cancel==2"
           >确认报名</el-button>
       </template>
     </avue-crud>

--
Gitblit v1.9.3