|
@@ -0,0 +1,275 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container calendar-list-container">
|
|
|
+ <!-- 查询和其他操作 -->
|
|
|
+ <div class="filter-container">
|
|
|
+ <!-- <el-select v-model="listQuery.type" clearable placeholder="证书类型" style="top: -4px; width: 200px">
|
|
|
+ <el-option :key="item.type" v-for="item in typeList" :label="item.name" :value="item.type">
|
|
|
+ </el-option>
|
|
|
+ </el-select> -->
|
|
|
+ <el-select v-model="listQuery.status" clearable placeholder="审批状态" style="top: -4px; width: 200px">
|
|
|
+ <el-option :key="item.type" v-for="item in statusTypeList" :label="item.name" :value="item.type">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 查询结果 -->
|
|
|
+ <el-table size="small" :data="list" v-loading="listLoading"
|
|
|
+ element-loading-text="正在查询中。。。" border fit highlight-current-row>
|
|
|
+ <el-table-column type="index" label="序号" header-align="center" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="证书">
|
|
|
+ <template slot-scope="props">
|
|
|
+ <a style="color: #1e80ff;" target="_blank" :href="props.row.file">{{ props.row.title }}</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="类型" prop="typeName">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="上传人" prop="userName">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="180px" label="公司" prop="companyName">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="180px" label="部门" prop="deptName">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="获得积分" prop="integral">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="审核状态" prop="statusName">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="日期" prop="createTime">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="操作" width="100px" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="primary" size="small" @click="handleView(scope.row)">审批</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div class="pagination-container">
|
|
|
+ <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
+ :current-page="listQuery.page" :page-sizes="[10, 20, 30, 50]" :page-size="listQuery.limit"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 添加或修改对话框 -->
|
|
|
+ <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="45%">
|
|
|
+ <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px"
|
|
|
+ style="width: 700px; margin-left: 50px">
|
|
|
+ <el-form-item label="证书类型" prop="type">
|
|
|
+ <el-select v-model="dataForm.type" filterable placeholder="请选择" style="width: 350px">
|
|
|
+ <el-option :key="item.type" v-for="item in typeList" :label="item.name" :value="item.type">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleComplete(0)">通过</el-button>
|
|
|
+ <el-button type="warning" @click="handleComplete(1)">不通过</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <style>
|
|
|
+ .demo-table-expand {
|
|
|
+ font-size: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .demo-table-expand label {
|
|
|
+ width: 200px;
|
|
|
+ color: #99a9bf;
|
|
|
+ }
|
|
|
+
|
|
|
+ .demo-table-expand .el-form-item {
|
|
|
+ margin-right: 0;
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ import {
|
|
|
+ types,
|
|
|
+ complete,
|
|
|
+ list,
|
|
|
+ } from "@/api/certManage";
|
|
|
+ import waves from "@/directive/waves"; // 水波纹指令
|
|
|
+ import Tinymce from "@/components/Tinymce";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ components: { Tinymce },
|
|
|
+ directives: { waves },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ typeVisible: false,
|
|
|
+ fileImgUrl: this.upLoadUrl,
|
|
|
+ recipientsList: [],
|
|
|
+ typeList: [],
|
|
|
+ statusTypeList: [
|
|
|
+ {
|
|
|
+ type: 0,
|
|
|
+ name: "审核中",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ name: "通过",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 2,
|
|
|
+ name: "不通过",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ subTypeList: [
|
|
|
+ {
|
|
|
+ type: 0,
|
|
|
+ name: "奖状",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ name: "邮件",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ list: [
|
|
|
+ ],
|
|
|
+ delarr: [],
|
|
|
+ multipleSelection: [],
|
|
|
+ total: 0,
|
|
|
+ listLoading: false,
|
|
|
+ listQuery: {
|
|
|
+ page: 1,
|
|
|
+ limit: 10,
|
|
|
+ // type: "",
|
|
|
+ status: "",
|
|
|
+ },
|
|
|
+ dataForm: {
|
|
|
+ type: undefined,
|
|
|
+ flag:'',
|
|
|
+ certificateId:'',
|
|
|
+ },
|
|
|
+ dialogFormVisible: false,
|
|
|
+ dialogStatus: "",
|
|
|
+ textMap: {
|
|
|
+ update: "证书审核",
|
|
|
+ create: "创建",
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ type: [{ required: true, message: "请选择证书类型", trigger: "blur" }],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getTypeList();
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getTypeList(){
|
|
|
+ types().then(response => {
|
|
|
+ this.typeList = response.data.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ this.listLoading = true;
|
|
|
+ list(this.listQuery)
|
|
|
+ .then((response) => {
|
|
|
+ this.list = response.data.data.items;
|
|
|
+ this.total = response.data.data.total;
|
|
|
+ this.listLoading = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.list = [];
|
|
|
+ this.total = 0;
|
|
|
+ this.listLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleFilter() {
|
|
|
+ this.listQuery.page = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.listQuery.limit = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.listQuery.page = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
+ handleView(row) {
|
|
|
+ this.dataForm.type = '';
|
|
|
+ this.dataForm.certificateId =row.id;
|
|
|
+ this.dialogStatus = "update";
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs["dataForm"].clearValidate();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleComplete(flag){
|
|
|
+ if(flag==0){
|
|
|
+ this.$refs["dataForm"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.dataForm.flag = flag;
|
|
|
+ complete(this.dataForm).then(() => {
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ this.$notify({
|
|
|
+ title: "成功",
|
|
|
+ message: "审批成功",
|
|
|
+ type: "success",
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.dataForm.flag = flag;
|
|
|
+ complete(this.dataForm).then(() => {
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ this.$notify({
|
|
|
+ title: "成功",
|
|
|
+ message: "审批成功",
|
|
|
+ type: "success",
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ };
|
|
|
+ </script>
|
|
|
+ <style>
|
|
|
+ .ad-avatar-uploader .el-upload {
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
+ border-radius: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ad-avatar-uploader .el-upload:hover {
|
|
|
+ border-color: #409eff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ad-avatar-uploader-icon {
|
|
|
+ font-size: 28px;
|
|
|
+ color: #8c939d;
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ line-height: 178px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ad-avatar {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|