|
@@ -0,0 +1,303 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <div class="search-term">
|
|
|
|
+ <el-form :inline="true" :model="searchInfo" class="demo-form-inline" label-width="100">
|
|
|
|
+
|
|
|
|
+ <el-form-item label="时间段" prop="daterange">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="searchInfo.dateRange"
|
|
|
|
+ type="daterange"
|
|
|
|
+ format="yyyy-MM-dd"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ style="line-height: 50px; margin: 5px;width: 260px;"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="结束时间" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="学员姓名" prop="nickname" label-width="100">
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="输入姓名"
|
|
|
|
+ v-model="searchInfo.nickname"
|
|
|
|
+ type="text"
|
|
|
|
+ style="width: 210px;"
|
|
|
|
+ clearable
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="身份证" prop="cardId">
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入身份证"
|
|
|
|
+ v-model="searchInfo.cardId"
|
|
|
|
+ type="text"
|
|
|
|
+ style="width: 270px;"
|
|
|
|
+ clearable
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="课程分类" prop="type">
|
|
|
|
+ <drop-search
|
|
|
|
+ :info="searchInfo.type"
|
|
|
|
+ type="type"
|
|
|
|
+ class="user-form-item"
|
|
|
|
+ @select="okSearchType"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="状态" prop="type">
|
|
|
|
+ <el-select placeholder="更多" v-model="searchInfo.isPay" style="width: 120px;">
|
|
|
|
+ <el-option label="等待审核" :value="0"></el-option>
|
|
|
|
+ <el-option label="审核通过" :value="1"></el-option>
|
|
|
|
+ <el-option label="拒绝中" :value="2"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-button type="primary" size="small" @click="doSearch">
|
|
|
|
+ 刷新
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <el-button type="primary" size="small" @click="doExport">
|
|
|
|
+ 导出全部
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-table :data="tableData" border stripe>
|
|
|
|
+ <el-table-column label="ID" prop="id" width="80" align="center"> </el-table-column>
|
|
|
|
+ <el-table-column label="姓名" prop="nickname" width="80" align="center"> </el-table-column>
|
|
|
|
+ <el-table-column label="身份证" prop="cardId" width="170"> </el-table-column>
|
|
|
|
+ <el-table-column label="报考岗位" prop="courseName" width="160">
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <p>{{row.rzCode}} </p>
|
|
|
|
+ <p>{{row.courseName}} </p>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="学历" prop="education" width="120"> </el-table-column>
|
|
|
|
+ <el-table-column label="联系方式" prop="phone" width="120" > </el-table-column>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-table-column label="工作单位" prop="company"> </el-table-column>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-table-column label="备注" prop="marks" min-width="100">
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <p> {{row.certificateStatus||'有效'}}: {{row.startTime}} 到 {{row.endTime||'--'}} </p>
|
|
|
|
+ <p> {{row.marks}} </p>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column label="支付凭证" prop="head_img" width="90" align="center">
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <show-img :src="row.buyImg"></show-img>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column label="提交时间" prop="createAt" width="95" align="center">
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <p>{{row.createAt}} </p>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column
|
|
|
|
+ align="center"
|
|
|
|
+ width="160"
|
|
|
|
+ label="操作"
|
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{row, $index}">
|
|
|
|
+ <el-popover placement="top" width="140" v-model="row._pass">
|
|
|
|
+ <p>你确定收到钱了么?本操作不可逆,您是否继续操作</p>
|
|
|
|
+ <div style="text-align: right; margin: 0">
|
|
|
|
+ <el-button size="mini" type="text" @click="row._pass = false">取消</el-button>
|
|
|
|
+ <el-button type="primary" size="mini" @click="buyCoursePass(row)">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <el-button type="text" icon="el-icon-reset" size="small" slot="reference">通过</el-button>
|
|
|
|
+ </el-popover>
|
|
|
|
+
|
|
|
|
+ <el-button type="text" icon="el-icon-reset" size="small" @click="unpassRow(row, $index)">拒绝</el-button>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="拒绝通过" center :visible.sync="unpassDialog">
|
|
|
|
+ <el-form :model="unpassData" label-width="120px" :rules="rules" ref="elForm">
|
|
|
|
+ <el-form-item prop="marks">
|
|
|
|
+ <el-input v-model="unpassData.marks" type="textarea" placeholder="拒绝理由" clearable></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ </el-form>
|
|
|
|
+ <div class="dialog-footer" slot="footer">
|
|
|
|
+ <el-button @click="unpassDialog = false">取 消</el-button>
|
|
|
|
+ <el-button @click="buyCourseUnPass()" type="primary">确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-pagination
|
|
|
|
+ :current-page="page"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ :page-sizes="[10, 30, 50, 100, 1000]"
|
|
|
|
+ :style="{ float: 'right', padding: '20px' }"
|
|
|
|
+ :total="total"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ ></el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { buyCourseList, postData } from "@/api/study.js";
|
|
|
|
+import { toDatetime, toDate } from "@/utils/date";
|
|
|
|
+import infoList from "@/mixins/infoList";
|
|
|
|
+import { time2str, str2time } from "@/utils/index.js";
|
|
|
|
+import DropSearch from "@/components/select/DropSearch.vue";
|
|
|
|
+import ShowImg from "@/components/customPic/showImg.vue";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "Api",
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ listApi: buyCourseList,
|
|
|
|
+ unpassDialog: false,
|
|
|
|
+ page: 1,
|
|
|
|
+ total: 10,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ searchInfo:{
|
|
|
|
+ isPay:0,
|
|
|
|
+ },
|
|
|
|
+ unpassData:{
|
|
|
|
+ marks:'',
|
|
|
|
+ temp:{}
|
|
|
|
+ },
|
|
|
|
+ tableData: [],
|
|
|
|
+ rules:{
|
|
|
|
+ marks:[{required:true, message:'请留下拒绝原因', min: 1}]
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ components:{ShowImg, DropSearch},
|
|
|
|
+ watch: {
|
|
|
|
+ searchInfo:{
|
|
|
|
+ handler(new_value,old_value){
|
|
|
|
+ this.page = 1;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
+ deep: true,
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mixins: [infoList],
|
|
|
|
+ methods: {
|
|
|
|
+ unpassRow(row, index){
|
|
|
|
+ this.unpassData.temp = row;
|
|
|
|
+ this.unpassData.marks = "";
|
|
|
|
+ this.unpassData.index = index;
|
|
|
|
+ this.unpassDialog = true
|
|
|
|
+ },
|
|
|
|
+ okSearchType(item){
|
|
|
|
+ this.searchInfo.type = item.name
|
|
|
|
+ this.page = 1
|
|
|
|
+ this.getTableData()
|
|
|
|
+ },
|
|
|
|
+ doSearch(){
|
|
|
|
+ this.page = 1;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
+ initEdit( row ){
|
|
|
|
+ row._payNo = row.payNo;
|
|
|
|
+ row.edit = true;
|
|
|
|
+ },
|
|
|
|
+ confirmEdit( row ){
|
|
|
|
+ if( row.payNo == row._payNo){
|
|
|
|
+ row.edit = false
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ let param = {userId: row.userId, "courseId": row.courseId, payNo: row.payNo}
|
|
|
|
+ postData("editBuyCourse", param ).then( res=>{
|
|
|
|
+ if (res.code == 200){
|
|
|
|
+ this.$message.successMsg("编辑完成", 1)
|
|
|
|
+ row.edit = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ buyCoursePass( row ){
|
|
|
|
+ let param = {userId: row.userId, "courseId": row.courseId}
|
|
|
|
+ postData("buyCoursePass", param ).then( res=>{
|
|
|
|
+ if (res.code == 200){
|
|
|
|
+ this.$message.successMsg("审核完成", 1)
|
|
|
|
+ this.getTableData();
|
|
|
|
+ row._pass = false;
|
|
|
|
+ row.isPay = 1
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ doExport(){
|
|
|
|
+ let param =this.handleSearchParam( 100000 );
|
|
|
|
+
|
|
|
|
+ buyCourseList( param ).then( res =>{
|
|
|
|
+ if( res.code == 200){
|
|
|
|
+ this.$message.successMsg("下载完成,生成Excel中", 1)
|
|
|
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
|
|
+ const tHeader = [ '名字', '身份证号码','企业名称','岗位名称','证书编号','联系电话','报名时间','邮箱地址', '证书','订单编号', '凭证地址'];
|
|
|
|
+ const filterVal = ['nickname', 'cardId', 'company', 'courseName', 'rzCode', 'phone', 'createAt', 'email', 'cert', 'payNo', 'buyImg']
|
|
|
|
+ const data = this.formatJson(filterVal, res.data.list)
|
|
|
|
+ excel.export_json_to_excel({
|
|
|
|
+ header: tHeader,
|
|
|
|
+ data,
|
|
|
|
+ filename: "开通记录" + Date.now(),
|
|
|
|
+ autoWidth: true,
|
|
|
|
+ bookType: "xlsx"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ formatJson(filterVal, jsonData) {
|
|
|
|
+ return jsonData.map(v => filterVal.map(j => {
|
|
|
|
+ if( j == 'cert'){
|
|
|
|
+ return `${v.certificateStatus||'未知'}:${v.startTime||'--'} 到 ${v.endTime||'--'}`
|
|
|
|
+ }
|
|
|
|
+ return v[j]
|
|
|
|
+ }))
|
|
|
|
+ },
|
|
|
|
+ buyCourseUnPass( row ){
|
|
|
|
+ this.$refs["elForm"].validate((valid) => {
|
|
|
|
+ if (!valid) return;
|
|
|
|
+ let {userId, courseId} = this.unpassData.temp
|
|
|
|
+ let marks = this.unpassData.marks
|
|
|
|
+ let param = {userId, courseId, marks}
|
|
|
|
+ postData("buyCourseUnPass", param ).then( res=>{
|
|
|
|
+ if (res.code == 200){
|
|
|
|
+ this.$message.successMsg("拒绝完成", 1)
|
|
|
|
+ this.getTableData();
|
|
|
|
+ this.unpassDialog = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ filters: {
|
|
|
|
+ toDatetime,
|
|
|
|
+ toDate
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.getTableData( );
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
+.el-tag--mini {
|
|
|
|
+ margin-left: 5px;
|
|
|
|
+}
|
|
|
|
+.warning {
|
|
|
|
+ color: #dc143c;
|
|
|
|
+}
|
|
|
|
+</style>
|