From f8159c1dbb2ffbc0de9d4d13e9b0e0dcc8a95d31 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 06 Aug 2021 16:28:38 +0800
Subject: [PATCH] 通知公告修改,报名考试修改

---
 src/views/trainExam/index.vue    |    1 
 src/views/applyexam/index.vue    |  121 +++++++
 src/views/traincompany/index.vue |  732 +++++++++++++++++++++++++++++++++++++++++++++
 src/views/desk/notice.vue        |   53 +-
 src/styles/element-ui.scss       |    5 
 5 files changed, 880 insertions(+), 32 deletions(-)

diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index 6f6daed..473f6fc 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -149,6 +149,11 @@
     left: 200px !important;
 }
 
+.desk1 .el-card.is-never-shadow.avue-crud__search {
+    width: calc(100% - 410px) !important;
+    left: 200px !important;
+}
+
 .topmenu .el-card.is-never-shadow.avue-crud__search {
     width: calc(100% - 390px) !important;
     left: 220px !important;
diff --git a/src/views/applyexam/index.vue b/src/views/applyexam/index.vue
index e084e1a..c7a6fc3 100644
--- a/src/views/applyexam/index.vue
+++ b/src/views/applyexam/index.vue
@@ -68,6 +68,15 @@
                             >取消报名
                             </el-button>
                             <el-button
+                            style="display:none"
+                            :type="type"
+                            size="small"
+                            icon="el-icon-folder-checked"
+                            :disabled="row.applyStatus==4"
+                            @click="handleAudit(row)"
+                            >审核
+                            </el-button>
+                            <el-button
                             :type="type"
                             size="small"
                             icon="el-icon-receiving"
@@ -78,6 +87,14 @@
                         </template>
 
                     </avue-crud>
+
+                    <el-dialog title="考试资格审核" 
+                                :visible.sync="dialogFormVisible" 
+                                modal-append-to-body='false'
+                                append-to-body='true'
+                                :close-on-click-model="true">
+                        <avue-form ref="formAudit" v-model="Audit" :option="optionAudit" @reset-change="emptytChange" @submit="submit"></avue-form>
+                    </el-dialog>
 
                 </div>
 
@@ -113,6 +130,58 @@
     data () {
 
         return {
+            dialogFormVisible:false,
+            Audit:{},
+            optionAudit:{
+                height: "auto",
+                calcHeight: 30,
+                dialogWidth: 1000,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 6,
+                border: false,
+                index: true,
+                stripe: true,
+                viewBtn: true,
+                addBtn: true,
+                selection: true,
+                excelBtn: false,
+                menuWidth: 230,
+                dialogClickModal: false,
+                column: [
+                    {
+                        label: "审核状态",
+                        search: true,
+                        searchSpan: 5,
+                        span: 24,
+                        prop: "auditStatus",
+                        slot: true,
+                        editDisplay: false,
+                        addDisplay: false,
+                        type: "select",
+                        rules: [{
+                            required: true,
+                            message: "请选择审核类型",
+                            trigger: "blur"
+                        }],
+                        dicData: [{
+                                label: "审核通过",
+                                value: 2
+                            },
+                            {
+                                label: "不通过",
+                                value: 3
+                            }
+                        ]
+                    },
+                    {
+                        label: "审核明细",
+                        span: 24,
+                        type: "textarea",
+                        prop: "auditDetail"
+                    }
+                ],
+            },
             questionBankOption: {
                 // 操作栏多余按钮去除
                 delBtn: false,
@@ -133,7 +202,7 @@
                 searchShow: true,
                 searchMenuSpan: 4,
                 index: true,
-                indexLabel: '序号',
+                indexLabel: '#',
                 //dialogType: 'drawer',
                 dialogClickModal: false,
                 //tree 默认展开
@@ -150,6 +219,7 @@
                         search: true,
                         hide:true,
                         slot: true,
+                        searchSpan:5,
                         // 表单新增时是否禁止
                         addDisabled: false,
                         // 表单新增时是否可见
@@ -170,7 +240,8 @@
                             required: true,
                             message: "请选择保安姓名",
                             trigger: "blur"
-                        }]
+                        }],
+                        width:80
                     },
                     {
                         label: "保安姓名",
@@ -233,6 +304,7 @@
                         prop: "deptName",
                         search: true,
                         slot: true,
+                        searchSpan:5,
                         // 表单新增时是否禁止
                         addDisabled: false,
                         // 表单新增时是否可见
@@ -296,7 +368,7 @@
                             message: "请选择准考证号",
                             trigger: "blur"
                         }],
-                        width: 200
+                        width: 150
                     },
                     {
                         label: "报考证件",
@@ -368,7 +440,7 @@
                                             ? "0" + new Date().getSeconds()
                                             : new Date().getSeconds())),
 
-                        width: 160
+                        width: 150
                     },
                     {
                         label: "考试时间",
@@ -389,11 +461,12 @@
                         editDisplay: true,
                         // 表单编辑时是否为查看模式
                         editDetail: false,
-                        width: 160
+                        width: 150
                     },{
                         label: "报名状态",
                         prop: "applyStatus", 
                         slot: true,
+                        searchSpan:5,
                         // 表单新增时是否禁止
                         addDisabled: false,
                         // 表单新增时是否可见
@@ -410,6 +483,40 @@
                         search:true,
                         type:"select"
                     },
+                    // {
+                    //     label: "审核状态",
+                    //     prop: "examinationType", 
+                    //     slot: true,
+                    //     searchSpan:5,
+                    //     // 表单新增时是否禁止
+                    //     addDisabled: false,
+                    //     // 表单新增时是否可见
+                    //     addDisplay: false,
+                    //     // 表单新增时是否为查看模式
+                    //     addDetail: false,
+                    //     // 表单编辑时是否禁止
+                    //     editDisabled: false,
+                    //     // 表单编辑时是否可见
+                    //     editDisplay: true,
+                    //     // 表单编辑时是否为查看模式
+                    //     editDetail: false,
+                    //     dicData:[
+                    //         {
+                    //             label: '待审核',
+                    //             value: "1"
+                    //         },
+                    //         {
+                    //             label: '审核通过',
+                    //             value: "2"
+                    //         },
+                    //         {
+                    //             label: '审核不通过',
+                    //             value: "3"
+                    //         }
+                    //         ],
+                    //     search:true,
+                    //     type:"select"
+                    // },
                 ]
             },
             questionBankSearch: {},
@@ -613,6 +720,10 @@
                     this.$refs.questionBankCrud.toggleSelection();
                 });
         },
+        handleAudit(row){
+            this.dialogFormVisible = true;
+            this.Audit = row;
+        },
     }
 }
 </script>
diff --git a/src/views/desk/notice.vue b/src/views/desk/notice.vue
index 0a57ea6..403e836 100644
--- a/src/views/desk/notice.vue
+++ b/src/views/desk/notice.vue
@@ -1,5 +1,5 @@
 <template>
-  <basic-container class="desk">
+  <basic-container class="desk1">
     <avue-crud
       :option="option"
       :table-loading="loading"
@@ -27,7 +27,6 @@
           size="small"
           icon="el-icon-delete"
           plain
-          v-if="deptCategory"
           @click="handleDelete"
           >删 除
         </el-button>
@@ -38,19 +37,18 @@
       </template>
       <template slot-scope="{ type, size, row }" slot="menu">
         <el-button
-          v-if="deptCategory"
           :size="size"
           :type="type"
           @click="handleUploadPage(row)"
           >附件上传
         </el-button>
-        <el-button
+        <!-- <el-button
           v-if="!deptCategory"
           :size="size"
           :type="type"
           @click="handleUploadPage(row)"
           >附件查看
-        </el-button>
+        </el-button> -->
       </template>
     </avue-crud>
   </basic-container>
@@ -125,6 +123,7 @@
             defaultValue: "1",
             prop: "category",
             search: true,
+            searchSpan:5,
             rules: [
               {
                 required: true,
@@ -210,10 +209,10 @@
     ...mapGetters(["permission"]),
     permissionList() {
       return {
-        addBtn: this.vaildData(this.permissionAdd, false),
-        viewBtn: this.vaildData(this.permissionView, false),
-        delBtn: this.vaildData(this.permissionDelete, false),
-        editBtn: this.vaildData(this.permissionEdit, false),
+        addBtn: this.vaildData(this.permissionAdd, true),
+        viewBtn: this.vaildData(this.permissionView, true),
+        delBtn: this.vaildData(this.permissionDelete, true),
+        editBtn: this.vaildData(this.permissionEdit, true),
       };
     },
     ids() {
@@ -235,12 +234,12 @@
           ? (that.deptCategory = true)
           : (that.deptCategory = false);
 
-        if (that.deptCategory) {
+        // if (that.deptCategory) {
           that.permissionAdd = this.permission.notice_add;
           that.permissionView = this.permission.notice_view;
           that.permissionDelete = this.permission.notice_delete;
           that.permissionEdit = this.permission.notice_edit;
-        }
+        // }
       });
     },
     //跳转到附近列表页面
@@ -374,18 +373,18 @@
           ? (that.deptCategory = true)
           : (that.deptCategory = false);
 
-        if (that.deptCategory) {
+        // if (that.deptCategory) {
           that.permissionAdd = this.permission.notice_add;
           that.permissionView = this.permission.notice_view;
           that.permissionDelete = this.permission.notice_delete;
           that.permissionEdit = this.permission.notice_edit;
-        }
+        // }
 
         const { releaseTimeRange } = this.query;
-        if (that.deptCategory) {
+        // if (that.deptCategory) {
           params["deptId"] = this.deptId;
           params["jurisdiction"] = this.jurisdiction;
-        }
+        // }
         let values = {
           ...params,
         };
@@ -403,18 +402,18 @@
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
-          this.data.forEach((item) => {
-            if (item.category == 2) {
-              that.option.addBtn = false;
-              that.option.editBtn = false;
-              that.option.delBtn = false;
-            }
-            if (item.category == 1) {
-              that.option.addBtn = true;
-              that.option.editBtn = true;
-              that.option.delBtn = true;
-            }
-          });
+          // this.data.forEach((item) => {
+          //   if (item.category == 2) {
+          //     that.option.addBtn = false;
+          //     that.option.editBtn = false;
+          //     that.option.delBtn = false;
+          //   }
+          //   if (item.category == 1) {
+          //     that.option.addBtn = true;
+          //     that.option.editBtn = true;
+          //     that.option.delBtn = true;
+          //   }
+          // });
           this.loading = false;
           this.selectionClear();
         });
diff --git a/src/views/trainExam/index.vue b/src/views/trainExam/index.vue
index 3f20da8..4aa7515 100644
--- a/src/views/trainExam/index.vue
+++ b/src/views/trainExam/index.vue
@@ -225,6 +225,7 @@
     submit(row,done,loading){
       updateAudit(row).then(
         () => {
+          this.dialogFormVisible = false;
           this.onLoad(this.page);
           this.$message({
             type: "success",
diff --git a/src/views/traincompany/index.vue b/src/views/traincompany/index.vue
new file mode 100644
index 0000000..c7a6fc3
--- /dev/null
+++ b/src/views/traincompany/index.vue
@@ -0,0 +1,732 @@
+/*
+ * @Author: Morpheus
+ * @Date: 2021-07-05 16:31:54
+ * @Last Modified by: Morpheus
+ * @Last Modified time: 2021-07-19 19:39:45
+ * menu-name 报名考试
+ */
+<template>
+    <el-row class="morpheus-box-apply-exam">
+        <el-col :span="24" class="hasButOne">
+            <el-card>
+                <div class="exam-card-body">
+
+                    <avue-crud v-model="obj"
+                               class="company-box"
+                               :option="questionBankOption"
+                               :search.sync="questionBankSearch"
+                               :table-loading="questionBankLoading"
+                               :data="questionBankData"
+                               ref="questionBankCrud"
+                               :page.sync="questionBankPage"
+                               @on-load="questionBankOnLoad"
+                               @selection-change="questionBankSelectionChange"
+                               @search-change="questionBankSearchChange"
+                               @search-reset="questionBankSearchReset"
+                               @current-change="questionBankCurrentChange"
+                               @size-change="questionBankSizeChange"
+                               @row-save="questionBankRowSave"
+                               @row-del="questionBankRowDel">
+
+                        <!-- 自定义按钮 -->
+                        <!-- <template slot="menuLeft">
+                            <el-button type="danger"
+                                       size="mini"
+                                       icon="el-icon-delete"
+                                       plain
+                                       @click="handleDelete">新增
+                            </el-button>
+                            <el-button type="danger"
+                                       size="mini"
+                                       icon="el-icon-delete"
+                                       plain
+                                       @click="handleDelete">删除
+                            </el-button>
+                            <el-button type="danger"
+                                       size="mini"
+                                       icon="el-icon-delete"
+                                       plain
+                                       @click="handleDelete">导出
+                            </el-button>
+                        </template> -->
+
+                        <!-- <template slot="menuLeft">
+                            <el-button type="danger"
+                                       size="small"
+                                       icon="el-icon-delete"
+                                       @click="questionBankHandleDelete">删 除
+                            </el-button>
+                        </template> -->
+
+                        <template slot-scope="{ type,row }" slot="menu">
+                            <el-button
+                            :type="type"
+                            size="small"
+                            icon="el-icon-refresh-left"
+                            :disabled="row.applyStatus==4"
+                            @click="handleCancel(row)"
+                            >取消报名
+                            </el-button>
+                            <el-button
+                            style="display:none"
+                            :type="type"
+                            size="small"
+                            icon="el-icon-folder-checked"
+                            :disabled="row.applyStatus==4"
+                            @click="handleAudit(row)"
+                            >审核
+                            </el-button>
+                            <el-button
+                            :type="type"
+                            size="small"
+                            icon="el-icon-receiving"
+                            :disabled="row.applyStatus==4"
+                            @click="handlePrint(row)"
+                            >准考证打印
+                            </el-button>
+                        </template>
+
+                    </avue-crud>
+
+                    <el-dialog title="考试资格审核" 
+                                :visible.sync="dialogFormVisible" 
+                                modal-append-to-body='false'
+                                append-to-body='true'
+                                :close-on-click-model="true">
+                        <avue-form ref="formAudit" v-model="Audit" :option="optionAudit" @reset-change="emptytChange" @submit="submit"></avue-form>
+                    </el-dialog>
+
+                </div>
+
+            </el-card>
+        </el-col>
+    </el-row>
+</template>
+
+<script>
+
+import {
+    getApplyList,
+    addApply,
+    updateApply,
+    remove
+} from "@/api/examapi/applyexam";
+import { mapState } from 'vuex'
+
+
+var DIC = {
+    applyStatus: [{
+        label: '已报名',
+        value: 2
+    }, {
+        label: '已取消',
+        value: 4
+    }]
+}
+
+
+
+export default {
+    data () {
+
+        return {
+            dialogFormVisible:false,
+            Audit:{},
+            optionAudit:{
+                height: "auto",
+                calcHeight: 30,
+                dialogWidth: 1000,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 6,
+                border: false,
+                index: true,
+                stripe: true,
+                viewBtn: true,
+                addBtn: true,
+                selection: true,
+                excelBtn: false,
+                menuWidth: 230,
+                dialogClickModal: false,
+                column: [
+                    {
+                        label: "审核状态",
+                        search: true,
+                        searchSpan: 5,
+                        span: 24,
+                        prop: "auditStatus",
+                        slot: true,
+                        editDisplay: false,
+                        addDisplay: false,
+                        type: "select",
+                        rules: [{
+                            required: true,
+                            message: "请选择审核类型",
+                            trigger: "blur"
+                        }],
+                        dicData: [{
+                                label: "审核通过",
+                                value: 2
+                            },
+                            {
+                                label: "不通过",
+                                value: 3
+                            }
+                        ]
+                    },
+                    {
+                        label: "审核明细",
+                        span: 24,
+                        type: "textarea",
+                        prop: "auditDetail"
+                    }
+                ],
+            },
+            questionBankOption: {
+                // 操作栏多余按钮去除
+                delBtn: false,
+                editBtn: false,
+                addBtn: true,
+                selection: true,
+                menu: true,
+                // 导出按钮
+                // excelBtn: true,
+                viewBtn: false,
+
+                // title: '题库',
+
+                align: 'center',
+                height: 'auto',
+                calcHeight: 80,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 4,
+                index: true,
+                indexLabel: '#',
+                //dialogType: 'drawer',
+                dialogClickModal: false,
+                //tree 默认展开
+                defaultExpandAll:true,
+                // 操作栏宽度
+                menuWidth: 200,
+
+                column: [
+                    {
+                        label: "保安姓名",
+                        prop: "userId",
+                        type: 'tree',
+                        dicUrl: '',
+                        search: true,
+                        hide:true,
+                        slot: true,
+                        searchSpan:5,
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: true,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: true,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        props: {
+                            label: "title",
+                            value: "id",
+                        },
+                        rules: [{
+                            required: true,
+                            message: "请选择保安姓名",
+                            trigger: "blur"
+                        }],
+                        width:80
+                    },
+                    {
+                        label: "保安姓名",
+                        prop: "name",
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: false,
+                        // 表单编辑时是否可见
+                        editDisplay: false,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        viewDisplay:true,
+                        props: {
+                            label: "title",
+                            value: "id",
+                        },
+                        rules: [{
+                            required: true,
+                            message: "请选择保安姓名",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: "考试名称",
+                        prop: "examName",
+                        type: 'tree',
+                        dicUrl: '/api/exampaper/page-tree?examType=1',
+                        // search: true,
+                        slot: true,
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: true,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: true,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        props: {
+                            label: "examName",
+                            value: "id",
+                        },
+                        rules: [{
+                            required: true,
+                            message: "请选择试卷名称",
+                            trigger: "blur"
+                        }],
+                        width: 220
+                    },
+                    {
+                        label: "所属公司",
+                        prop: "deptName",
+                        search: true,
+                        slot: true,
+                        searchSpan:5,
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: true,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        rules: [{
+                            required: true,
+                            message: "请选择所属公司",
+                            trigger: "blur"
+                        }],
+                        width: 220
+                    },
+                    {
+                        label: "准考证号",
+                        prop: "candidateNo",
+                        slot: true,
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: false,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        rules: [{
+                            required: true,
+                            message: "请选择准考证号",
+                            trigger: "blur"
+                        }],
+                        width: 100
+                    },
+                    {
+                        label: "身份证号",
+                        prop: "idCardNo",
+                        slot: true,
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: false,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        rules: [{
+                            required: true,
+                            message: "请选择准考证号",
+                            trigger: "blur"
+                        }],
+                        width: 150
+                    },
+                    {
+                        label: "报考证件",
+                        prop: "applyCard", 
+                        slot: true,
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: false,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        rules: [{
+                            required: true,
+                            message: "请选择准考证号",
+                            trigger: "blur"
+                        }],
+                    },
+                    // {
+                    //     label: "试卷分数",
+                    //     prop: "paperScore",
+                    //     slot: true,
+                    //     // 表单新增时是否禁止
+                    //     addDisabled: false,
+                    //     // 表单新增时是否可见
+                    //     addDisplay: false,
+                    //     // 表单新增时是否为查看模式
+                    //     addDetail: false,
+                    //     // 表单编辑时是否禁止
+                    //     editDisabled: true,
+                    //     // 表单编辑时是否可见
+                    //     editDisplay: true,
+                    //     // 表单编辑时是否为查看模式
+                    //     editDetail: false
+                    // },
+                    {
+                        label: "报名时间",
+                        prop: "applyTime",
+                        type: "datetime",
+                        // span: 24,
+                        format: 'yyyy-MM-dd HH:mm:ss',
+                        valueFormat: 'yyyy-MM-dd HH:mm:ss',
+                        // 表单新增时是否禁止
+                        addDisabled: true,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: true,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        value: (new Date().getFullYear() + '-' + (new Date().getMonth() + 1 < 10
+                            ? "0" + (new Date().getMonth() + 1)
+                            : new Date().getMonth() + 1) + '-' + (new Date().getDate() < 10
+                                ? "0" + new Date().getDate()
+                                : new Date().getDate()) + ' ' + (new Date().getHours() < 10
+                                    ? "0" + new Date().getHours()
+                                    : new Date().getHours()) + ':' + (new Date().getMinutes() < 10
+                                        ? "0" + new Date().getMinutes()
+                                        : new Date().getMinutes()) + ':' + (new Date().getSeconds() < 10
+                                            ? "0" + new Date().getSeconds()
+                                            : new Date().getSeconds())),
+
+                        width: 150
+                    },
+                    {
+                        label: "考试时间",
+                        prop: "examTime",
+                        type: "datetime",
+                        // span: 24,
+                        format: 'yyyy-MM-dd HH:mm:ss',
+                        valueFormat: 'yyyy-MM-dd HH:mm:ss',
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: false,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        width: 150
+                    },{
+                        label: "报名状态",
+                        prop: "applyStatus", 
+                        slot: true,
+                        searchSpan:5,
+                        // 表单新增时是否禁止
+                        addDisabled: false,
+                        // 表单新增时是否可见
+                        addDisplay: false,
+                        // 表单新增时是否为查看模式
+                        addDetail: false,
+                        // 表单编辑时是否禁止
+                        editDisabled: false,
+                        // 表单编辑时是否可见
+                        editDisplay: true,
+                        // 表单编辑时是否为查看模式
+                        editDetail: false,
+                        dicData:DIC.applyStatus,
+                        search:true,
+                        type:"select"
+                    },
+                    // {
+                    //     label: "审核状态",
+                    //     prop: "examinationType", 
+                    //     slot: true,
+                    //     searchSpan:5,
+                    //     // 表单新增时是否禁止
+                    //     addDisabled: false,
+                    //     // 表单新增时是否可见
+                    //     addDisplay: false,
+                    //     // 表单新增时是否为查看模式
+                    //     addDetail: false,
+                    //     // 表单编辑时是否禁止
+                    //     editDisabled: false,
+                    //     // 表单编辑时是否可见
+                    //     editDisplay: true,
+                    //     // 表单编辑时是否为查看模式
+                    //     editDetail: false,
+                    //     dicData:[
+                    //         {
+                    //             label: '待审核',
+                    //             value: "1"
+                    //         },
+                    //         {
+                    //             label: '审核通过',
+                    //             value: "2"
+                    //         },
+                    //         {
+                    //             label: '审核不通过',
+                    //             value: "3"
+                    //         }
+                    //         ],
+                    //     search:true,
+                    //     type:"select"
+                    // },
+                ]
+            },
+            questionBankSearch: {},
+            questionBankLoading: true,
+            questionBankData: [
+
+            ],
+            questionBankPage: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 16
+            },
+            questionBankQuery: {},
+            questionBankSelectionList: [],
+        }
+    },
+
+    watch: {
+        "form.examname": {
+            // form是表单或者表格绑定的数据集,v-model='form'
+            handler (val) {
+                if (val) {
+                    //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
+                    var address = val.formattedAddress.toString();
+                    if (address.search("县") != -1) {
+                        this.form.address = address.substring(
+                            address.indexOf("县") + 1,
+                            address.length
+                        );
+                    }
+                    if (address.search("区") != -1) {
+                        this.form.address = address.substring(
+                            address.indexOf("区") + 1,
+                            address.length
+                        );
+                    }
+                }
+            },
+            immediate: true,
+        },
+    },
+    created () {
+
+      console.log(this.userInfo)
+
+      if (this.userInfo.role_name.indexOf('ksxtadmin') != -1) {
+
+        this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId="
+      } else {
+        this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId=" + this.userInfo.dept_id
+
+      }
+
+
+    },
+    mounted () {
+
+
+    },
+    computed: {
+        ...mapState({
+            userInfo: state => state.user.userInfo
+        }),
+        ids () {
+            let ids = [];
+            this.questionBankSelectionList.forEach(ele => {
+                ids.push(ele.id);
+            });
+            return ids.join(",");
+        },
+    },
+    methods: {
+        //准考证查看
+        handlePrint(row) {
+            var obj = row;
+            obj["name"] = "准考证信息";
+            this.$router.push({
+                path: `/applyexam/papers`,
+                query: obj,
+            });
+        },
+        questionBankOnLoad (page, params = {}) {
+            this.questionBankLoading = false;
+            getApplyList(page.currentPage, page.pageSize, Object.assign(params, this.questionBankQuery)).then(res => {
+                const data = res.data.data;
+                this.questionBankPage.total = data.total;
+                this.questionBankData = data.records;
+                this.questionBankLoading = false;
+                this.questionBankSelectionClear();
+            });
+        },
+        questionBankSelectionClear () {
+            this.questionBankSelectionList = [];
+            this.$refs.questionBankCrud.toggleSelection();
+        },
+        questionBankSelectionChange (list) {
+            this.questionBankSelectionList = list;
+        },
+        questionBankSearchChange (params, done) {
+            this.questionBankQuery = params;
+            this.questionBankPage.currentPage = 1;
+            this.questionBankOnLoad(this.questionBankPage, params);
+            done();
+        },
+        questionBankSearchReset () {
+            this.questionBankQuery = {};
+            this.questionBankOnLoad(this.questionBankPage);
+        },
+        questionBankCurrentChange (currentPage) {
+            this.questionBankPage.currentPage = currentPage;
+        },
+        questionBankSizeChange (pageSize) {
+            this.questionBankPage.pageSize = pageSize;
+        },
+
+        // 新增
+        questionBankRowSave (row, done, loading) {
+            // debugger;
+            addApply({ userId: row.userId, examId: row.examName, applyTime: row.applyTime }).then((res) => {
+                this.questionBankOnLoad(this.questionBankPage);
+                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();
+            });
+        },
+
+        questionBankRowDel (row) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    return remove(row.id);
+                })
+                .then(() => {
+                    this.questionBankOnLoad(this.questionBankPage);
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    });
+                });
+        },
+
+        //取消报名
+        handleCancel(row){
+            this.$confirm("确定取消报名?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    row.applyStatus = 4;
+                    return updateApply(row);
+                })
+                .then(() => {
+                    this.questionBankOnLoad(this.questionBankPage);
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    });
+                });
+        },
+
+        questionBankHandleDelete () {
+            if (this.questionBankSelectionList.length === 0) {
+                this.$message.warning("请选择至少一条数据");
+                return;
+            }
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    return remove(this.ids);
+                })
+                .then(() => {
+                    this.questionBankOnLoad(this.questionBankPage);
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    });
+                    this.$refs.questionBankCrud.toggleSelection();
+                });
+        },
+        handleAudit(row){
+            this.dialogFormVisible = true;
+            this.Audit = row;
+        },
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

--
Gitblit v1.9.3