|
@@ -0,0 +1,510 @@
|
|
|
+<template>
|
|
|
+ <div id="article" v-loading="loading">
|
|
|
+ <Search
|
|
|
+ ref="search"
|
|
|
+ :formList="formList"
|
|
|
+ :formData="formData"
|
|
|
+ @onSubmit="search"
|
|
|
+ ></Search>
|
|
|
+ <div style="text-align: right; margin-bottom: 10px">
|
|
|
+ <el-button :size="$store.state.defaultSize" @click="downcerts" type="primary"
|
|
|
+ >批量下载证书</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="$store.state.defaultSize" @click="centerDialogVisible = true" type="primary"
|
|
|
+ >导入证书信息</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="$store.state.defaultSize" @click="centerDialogVisible2 = true" type="primary"
|
|
|
+ >导入学员照片</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="$store.state.defaultSize" @click="add" type="primary"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="$store.state.defaultSize" @click="delPL" type="primary"
|
|
|
+ >批量删除</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <Table
|
|
|
+ ref="table"
|
|
|
+ :tableData="tableData"
|
|
|
+ :tableList="tableList"
|
|
|
+ :rowKey="'_certId'"
|
|
|
+ :check="true"
|
|
|
+ @selectionChange="selectionChange"
|
|
|
+ >
|
|
|
+ <template slot="_studentImg" slot-scope="props">
|
|
|
+ <el-image
|
|
|
+ v-if="props.scope.row._studentImg"
|
|
|
+ style="width: 70px; height: 100px"
|
|
|
+ :src="$methods.splitImgHost(props.scope.row._studentImg)"
|
|
|
+ :preview-src-list="[$methods.splitImgHost(props.scope.row._studentImg)]"
|
|
|
+ >
|
|
|
+ </el-image>
|
|
|
+ </template>
|
|
|
+ <template #right="scope"
|
|
|
+ ><el-button @click="edit(scope.row)" type="text" size="small"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="del(scope.row)" type="text" size="small"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ <Pagination
|
|
|
+ :pageindex="formData.pageindex"
|
|
|
+ :pagesize="formData.pagesize"
|
|
|
+ :total="total"
|
|
|
+ @handleSizeChange="handleSizeChange"
|
|
|
+ @handleCurrentChange="handleCurrentChange"
|
|
|
+ ></Pagination>
|
|
|
+ <Operation ref="operation"></Operation>
|
|
|
+ <Operation-sh ref="operationsh"></Operation-sh>
|
|
|
+ <!-- <pl-update-box :dialogVisible.sync="plUpdateBox" /> -->
|
|
|
+ <el-dialog
|
|
|
+ title="批量导入证书信息(excel文件)"
|
|
|
+ :visible.sync="centerDialogVisible"
|
|
|
+ width="30%" top="500"
|
|
|
+ center>
|
|
|
+ <div class="updateBox">
|
|
|
+ <div class="first">导入excel文件:</div>
|
|
|
+ <div class="second">
|
|
|
+ <label class="labels" for="update1"
|
|
|
+ ><i class="el-icon-upload" style="color: #007aff"></i
|
|
|
+ ><span>选择并导入证书excel</span></label
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ type="file"
|
|
|
+ id="update1"
|
|
|
+ style="display: none"
|
|
|
+ @change="updateFile"
|
|
|
+ />
|
|
|
+ <span @click="down">下载导入excel模板</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div>导入结果:成功{{ successnum }}条,失败{{ errornum }}条</div>
|
|
|
+ <el-table :data="gridData">
|
|
|
+ <el-table-column property="date" label="姓名" width="150"></el-table-column>
|
|
|
+ <el-table-column property="name" label="身份证" width="200"></el-table-column>
|
|
|
+ <el-table-column property="address" label="单位名称"></el-table-column>
|
|
|
+ </el-table>-->
|
|
|
+</el-dialog>
|
|
|
+<el-dialog
|
|
|
+ title="批量导入学员照片(zip压缩包)"
|
|
|
+ :visible.sync="centerDialogVisible2"
|
|
|
+ width="30%" top="500"
|
|
|
+ center>
|
|
|
+ <div class="updateBox">
|
|
|
+ <div class="first">导入zip文件:</div>
|
|
|
+ <div class="second">
|
|
|
+ <label class="labels" for="update2"
|
|
|
+ ><i class="el-icon-upload" style="color: #007aff"></i
|
|
|
+ ><span>选择并导入照片zip</span></label
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ type="file"
|
|
|
+ id="update2"
|
|
|
+ style="display: none"
|
|
|
+ @change="updateFile2"
|
|
|
+ />
|
|
|
+ <span @click="down2">下载导入zip模板</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div>导入结果:成功{{ successnum }}条,失败{{ errornum }}条</div>
|
|
|
+ <el-table :data="gridData">
|
|
|
+ <el-table-column property="date" label="姓名" width="150"></el-table-column>
|
|
|
+ <el-table-column property="name" label="身份证" width="200"></el-table-column>
|
|
|
+ <el-table-column property="address" label="单位名称"></el-table-column>
|
|
|
+ </el-table>-->
|
|
|
+</el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Search from "@/components/search/index.vue";
|
|
|
+import Table from "@/components/table/index.vue";
|
|
|
+import Pagination from "@/components/pagination/index.vue";
|
|
|
+import Operation from "./operation.vue";
|
|
|
+export default {
|
|
|
+ components: { Search, Operation, Table, Pagination },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ formList: [
|
|
|
+ {
|
|
|
+ label: "考试结果:",
|
|
|
+ prop: "ExamStatus",
|
|
|
+ scope: "options",
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: "合格",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "不合格",
|
|
|
+ value: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "缺考",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "状态:",
|
|
|
+ prop: "Status",
|
|
|
+ scope: "options",
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: "正常",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "官网隐藏",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "证件头像:",
|
|
|
+ prop: "StudentImg",
|
|
|
+ scope: "options",
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: "已上传",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "未上传",
|
|
|
+ value: "0",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "考试时间:",
|
|
|
+ prop: "ExamTime",
|
|
|
+ scope: "date",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "关键字:",
|
|
|
+ prop: "KeyVal",
|
|
|
+ placeholder:"姓名/身份证/证书编号"
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ formData: { pageindex: 1, pagesize: 10 },
|
|
|
+ tableData: [],
|
|
|
+ tableList: [
|
|
|
+ {
|
|
|
+ label: "姓名",
|
|
|
+ prop: "_name",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "身份证号",
|
|
|
+ prop: "_idNum",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "单位名称",
|
|
|
+ prop: "_company",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "考试时间",
|
|
|
+ prop: "_examTime",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "成绩",
|
|
|
+ prop: "_score",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "考试结果",
|
|
|
+ prop: "examStatusName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "证书编号",
|
|
|
+ prop: "_certNum",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "发证时间",
|
|
|
+ prop: "_issueDate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "学员照片",
|
|
|
+ prop: "_studentImg",
|
|
|
+ scope: "slot",
|
|
|
+ slotName: "_studentImg",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "_remarks",
|
|
|
+ },
|
|
|
+
|
|
|
+ ],
|
|
|
+ total: 0,
|
|
|
+ routerTableData: [],
|
|
|
+ checkbox: [], //当前选中
|
|
|
+ centerDialogVisible: false,
|
|
|
+ centerDialogVisible2: false,
|
|
|
+ fullscreenLoading: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ selectionChange(e) {
|
|
|
+ this.checkbox = e;
|
|
|
+ },
|
|
|
+ search(e) {
|
|
|
+ if (e === "search") {
|
|
|
+ this.formData.pageindex = 1;
|
|
|
+ }
|
|
|
+ if (e === "init") {
|
|
|
+ this.formData = { pageindex: 1, pagesize: 10 };
|
|
|
+ this.clearCheck();
|
|
|
+ }
|
|
|
+ this.$api.XfSysBussinessGetCertList(this.formData).then((res) => {
|
|
|
+ this.tableData = res.Data.List || [];
|
|
|
+ this.total = res.Data.TotalCount;
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ if(item._examTime){
|
|
|
+ item._examTime= item._examTime.replace("T"," ").substr(0,16);
|
|
|
+ }
|
|
|
+ if(item._issueDate){
|
|
|
+ item._issueDate= item._issueDate.substr(0,10);
|
|
|
+ }
|
|
|
+ item.statusName= item._status==-1?"已删除":item._status==0?"官网隐藏":"正常";
|
|
|
+ item.examStatusName= item._examStatus==0?"缺考":item._examStatus==1?"合格":"不合格";
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ add() {
|
|
|
+ this.$refs.operation.showInit();
|
|
|
+ },
|
|
|
+ edit(item) {
|
|
|
+ this.$api
|
|
|
+ .XfSysBussinessGetCertModel({ id: item._certId })
|
|
|
+ .then((res) => {
|
|
|
+ if(res.Data._examTime){
|
|
|
+ res.Data._examTime= res.Data._examTime.replace("T"," ").substr(0,16);
|
|
|
+ }
|
|
|
+ if(res.Data._issueDate){
|
|
|
+ res.Data._issueDate= res.Data._issueDate.substr(0,10);
|
|
|
+ }
|
|
|
+ this.$refs.operation.showInit(res.Data);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clearCheck() {
|
|
|
+ this.checkbox = [];
|
|
|
+ this.$refs.table.$refs.table.clearSelection();
|
|
|
+ },
|
|
|
+ delPL() {
|
|
|
+ if (this.checkbox.length > 0) {
|
|
|
+ this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let array = this.checkbox.map((item) => {
|
|
|
+ return item._certId;
|
|
|
+ });
|
|
|
+ this.$api.XfSysBussinessDelCerts({ idarr: array }).then((res) => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ this.clearCheck();
|
|
|
+ this.search();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error("请勾选需要删除的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ del(item) {
|
|
|
+ this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$api
|
|
|
+ .XfSysBussinessDelCerts({ idarr: [item._certId] })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ this.clearCheck();
|
|
|
+ this.search();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ downcerts(){
|
|
|
+ var postdata=this.formData;
|
|
|
+ var tips="确定生成当前查询条件下考试合格的学员证书吗?";
|
|
|
+ if (this.checkbox.length > 0) {
|
|
|
+ let array = this.checkbox.map((item) => {
|
|
|
+ return item._certId;
|
|
|
+ });
|
|
|
+ postdata={ ids: array.join() };
|
|
|
+ tips="确定生成当前选中考试合格学员的证书吗?";
|
|
|
+ } else {
|
|
|
+ if(!this.tableData||this.tableData.length==0){
|
|
|
+ this.$message.error("当前无数据,请先查询显示是否有可下载的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$confirm(tips, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '证书生成中...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ this.$api.XfSysBussinessDownCerts(postdata).then((res) => {
|
|
|
+ loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: res.Message,
|
|
|
+ });
|
|
|
+ this.$methods.exportData(res.Data,false)
|
|
|
+ this.clearCheck();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消下载",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCurrentChange(e) {
|
|
|
+ this.formData.pageindex = e;
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ handleSizeChange(e) {
|
|
|
+ this.formData.pageindex = 1;
|
|
|
+ this.formData.pagesize = e;
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ updateFile(e) {
|
|
|
+ var self = this;
|
|
|
+ var file = e.target.files[0];
|
|
|
+ if (file === undefined) return;
|
|
|
+ var type = e.target.value.toLowerCase().split(".").splice(-1);
|
|
|
+ let typeList = ["xlsx"];
|
|
|
+ if (!typeList.includes(type[0])) {
|
|
|
+ self.$message.error("上传格式需为:.xlsx");
|
|
|
+ e.target.value = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (file.size > 10 * 1024 * 1024) {
|
|
|
+ self.$message.error("文件不得大于10MB");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("file", file); //存储在oss的文件路径
|
|
|
+ formData.append("pathname", "cert");
|
|
|
+ formData.append("busnessname", "certexcel");
|
|
|
+ this.$api
|
|
|
+ .XfSysBussinessUploadFile(formData)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("上传成功")
|
|
|
+ this.search(2)
|
|
|
+ this.centerDialogVisible = false
|
|
|
+ }).finally(()=>{
|
|
|
+ e.target.value = "";
|
|
|
+ })
|
|
|
+ },
|
|
|
+ updateFile2(e) {
|
|
|
+ var self = this;
|
|
|
+ var file = e.target.files[0];
|
|
|
+ if (file === undefined) return;
|
|
|
+ var type = e.target.value.toLowerCase().split(".").splice(-1);
|
|
|
+ let typeList = ["zip"];
|
|
|
+ if (!typeList.includes(type[0])) {
|
|
|
+ self.$message.error("上传格式需为:.zip");
|
|
|
+ e.target.value = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (file.size > 100 * 1024 * 1024) {
|
|
|
+ self.$message.error("文件不得大于100MB");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("file", file); //存储在oss的文件路径
|
|
|
+ formData.append("pathname", "cert");
|
|
|
+ formData.append("busnessname", "certzip");
|
|
|
+ this.$api
|
|
|
+ .XfSysBussinessUploadFile(formData)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("上传成功")
|
|
|
+ this.search(2)
|
|
|
+ this.centerDialogVisible2 = false
|
|
|
+ }).finally(()=>{
|
|
|
+ e.target.value = "";
|
|
|
+ })
|
|
|
+ },
|
|
|
+ down() {
|
|
|
+ this.$methods.exportData('TempUploadFile/certmodel.xlsx',false)
|
|
|
+ },
|
|
|
+ down2() {
|
|
|
+ this.$methods.exportData('TempUploadFile/zip文件示例:人员照片和证书文件打包上传.zip',false)
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.updateBox {
|
|
|
+ display: flex;
|
|
|
+ & > .first {
|
|
|
+ width: 150px;
|
|
|
+ text-align: end;
|
|
|
+ height: 32px;
|
|
|
+ line-height: 32px;
|
|
|
+ }
|
|
|
+ & > .second {
|
|
|
+ flex: 0.9;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ & > .labels {
|
|
|
+ font-weight: 400;
|
|
|
+ width: 100%;
|
|
|
+ height: 32px;
|
|
|
+ line-height: 32px;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid #007aff;
|
|
|
+ text-align: center;
|
|
|
+ user-select: none;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #aaa;
|
|
|
+ background-color: rgb(221, 238, 255);
|
|
|
+ }
|
|
|
+ & > span {
|
|
|
+ cursor: pointer;
|
|
|
+ user-select: none;
|
|
|
+ color: #007aff;
|
|
|
+ margin-top: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ text-decoration: underline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|