|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
<div class="m-right-block fr mh576" style="position: relative;">
|
|
|
<div class="right-block-bd">
|
|
|
- <div class="mb10 tc mt20">
|
|
|
- <span class="p-ico2 worm-ico-o"></span>
|
|
|
- 注:<span class="txt-o"></span> 完成40个学时的岗位培训才可报名考试
|
|
|
- </div>
|
|
|
+ <div class="ng-scope" v-if="planId==0">
|
|
|
|
|
|
- <div class="ng-scope">
|
|
|
+ <div class="mb10 tc mt20">
|
|
|
+ <span class="p-ico2 worm-ico-o"></span>
|
|
|
+ 注:<span class="txt-o"></span> 完成40个学时的岗位培训才可报名考试
|
|
|
+ </div>
|
|
|
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row>
|
|
|
<el-table-column label="考试分期" align="center">
|
|
|
<template slot-scope="{row, $index}">
|
|
@@ -51,8 +51,6 @@
|
|
|
<el-table-column label="状态" fixed="right" align="center" width="100">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-button v-if="row.isPass==1" type="text" size="small" style="color: green;">考试通过</el-button>
|
|
|
- <!-- <el-button v-else-if="row.isPass==2" @click="reJoinTrainPlan( row )" type="primary" size="small">立即补考</el-button>
|
|
|
- <el-button v-else-if="row.isApply >0" type="text" size="small" style="color: green;">已经报考</el-button> -->
|
|
|
<el-button v-else @click="joinTrainPlan( row )" type="primary" size="small">报名考试</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -64,56 +62,75 @@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
+ <div v-else >
|
|
|
+ <div class="mb10 mt20">
|
|
|
+ <el-button type="primary" class="ml30" @click="planId=0"> 返回考试计划</el-button>
|
|
|
+ </div>
|
|
|
+ <el-form label-position="right" label-width="100px" width="500" >
|
|
|
+ <el-form-item label="考试科目">
|
|
|
+ <el-select v-model="courseId" clearable style="width: 220px;">
|
|
|
+ <el-option v-for="(item,index) in courses"
|
|
|
+ :value="item.courseId"
|
|
|
+ :key="index" :label="item.courseName"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- </div>
|
|
|
- <el-dialog title="报名考试确认" class="fc tc" :visible.sync="joinTrainPlanDialog"
|
|
|
- width="400px" :append-to-body="true"
|
|
|
- @close="joinTrainPlanDialog= false">
|
|
|
+ <el-form-item label="考试计划">
|
|
|
+ <el-select v-model="planId" clearable>
|
|
|
+ <el-option v-for="(item,index) in list"
|
|
|
+ :value="item.planId"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form label-position="right" label-width="100px">
|
|
|
- <el-form-item label="选择考试科目">
|
|
|
- <el-select v-model="courseId" clearable>
|
|
|
- <el-option v-for="(item,index) in courses"
|
|
|
- :value="item.courseId"
|
|
|
- :key="index" :label="item.courseName"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="考试信息">
|
|
|
- <span style="margin-left: 20px;float: left;">
|
|
|
- <el-button type="text" v-if="curCourse.isPass==1"> 已经通过 </el-button>
|
|
|
- <el-button type="text" v-else-if="curCourse.resitCount==0"> 首次考试</el-button>
|
|
|
- <div type="text" class="tl" v-else-if="curCourse.resitCount>=2">
|
|
|
- <p class="tl" style="color: red;">本次费用50元</p>
|
|
|
- </div>
|
|
|
- <div type="text" class="tl" v-else>
|
|
|
- <p class="tl">参考{{curCourse.resitCount}}次</p>
|
|
|
- <p class="tl" style="color: red;">备注: 前两次补考免费,之后补考50元</p>
|
|
|
- </div>
|
|
|
|
|
|
- </span>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
|
|
|
- <div class="qrcode" v-if="qrcodeUrl && curCourse.isPass!=1">
|
|
|
- <img :src="qrcodeUrl" />
|
|
|
- </div>
|
|
|
+ <el-form-item label="支付凭证" v-if="payLog.status>=2">
|
|
|
+ <vue-viewer class="preview" width="200px" height="200px" :thumb="payLog.buyImg"
|
|
|
+ :full="payLog.buyImg">
|
|
|
+ </vue-viewer>
|
|
|
|
|
|
- <div slot="footer" class="dialog-footer tc">
|
|
|
- <el-button @click="joinTrainPlanDialog = false" type="warning">关闭</el-button>
|
|
|
+ <do-upload v-if="payLog.status==2" @onFinish="(img)=>{payLog.buyImg=img;}" imgType="buyImg" placeholder="上传凭证">
|
|
|
|
|
|
- <span v-if="curCourse.isPass !=1">
|
|
|
- <el-button type="primary" v-if="curCourse.resitCount>=2" @click="doResitTrainPlan">确 定</el-button>
|
|
|
- <el-button type="primary" v-else @click="doJoinTrainPlan">确 定</el-button>
|
|
|
- </span>
|
|
|
+ </do-upload>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="备注信息">
|
|
|
+ <el-input type="textarea" v-model="payLog.marks" style="width: 220px;"> </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="温馨提示" v-if="payLog.status==0">
|
|
|
+ <div>
|
|
|
+ <div type="text" class="tl">
|
|
|
+ <p class="tl" style="color: red;">第{{curCourse.resitCount}}次参考</p>
|
|
|
+ <p class="tl" style="color: red;">首次免费,补考费用60元</p>
|
|
|
+ <p class="tl" style="color: red;">补考流程:报名 》审核 》缴费 》确认</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width="100px">
|
|
|
+ <el-button type="primary" v-if="payLog.status==1" :disabled="true" class="confirmImg">等待审核</el-button>
|
|
|
+ <el-button type="primary" @click="buyPayLog()" v-else-if="payLog.status==2" class="confirmImg">确认支付</el-button>
|
|
|
+ <el-button type="warning" v-else-if="payLog.status==3" class="confirmImg">
|
|
|
+ 等待财务确认
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" :disabled="true" v-else-if="payLog.status==4" class="confirmImg" >
|
|
|
+ 报名完成,等待安排考试
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="applyPayLog()" v-else class="confirmImg">确定报考</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {httpServer} from "@/components/httpServer/httpServer.js";
|
|
|
import { toDate} from "@/utils/date.js";
|
|
|
+ import DoUpload from '@/components/upload/bigImg.vue'
|
|
|
import { MessageBox } from "element-ui";
|
|
|
export default {
|
|
|
name: "Index",
|
|
@@ -123,7 +140,8 @@
|
|
|
size: 10,
|
|
|
total: 20,
|
|
|
planId: 0,
|
|
|
- courseId: 0,
|
|
|
+ applyId: 0,
|
|
|
+ courseId: '',
|
|
|
list: [],
|
|
|
courses: [],
|
|
|
qrcodeUrl:'',
|
|
@@ -131,23 +149,29 @@
|
|
|
outTradeNo: "",
|
|
|
timer: null,
|
|
|
plans: {},
|
|
|
+ payLogs:{ },
|
|
|
+ payLog:{ marks:'', replyMarks:'', buyImg:'', status:2},
|
|
|
curCourse:{},
|
|
|
+ curPlan:{},
|
|
|
joinTrainPlanDialog: false,
|
|
|
listLoading: false
|
|
|
};
|
|
|
},
|
|
|
+ components:{DoUpload},
|
|
|
watch:{
|
|
|
courseId(courseId){
|
|
|
for( let i in this.courses){
|
|
|
if( this.courses[i].courseId == courseId){
|
|
|
this.curCourse = this.courses[i]
|
|
|
- this.qrcodeUrl = ""
|
|
|
+ this.applyId = this.curCourse.applyId;
|
|
|
+ this.loadPayLog();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
beforeMount() {
|
|
|
this.getData()
|
|
|
+ this.loadPayLog();
|
|
|
},
|
|
|
filters: {
|
|
|
toStartEnd(row) {
|
|
@@ -157,41 +181,7 @@
|
|
|
},
|
|
|
toDate
|
|
|
},
|
|
|
- beforeDestroy() {
|
|
|
- if (this.timer) window.clearInterval(this.timer);
|
|
|
- },
|
|
|
methods: {
|
|
|
- initTimer() {
|
|
|
- if (this.timer) window.clearInterval(this.timer);
|
|
|
- this.tickCount = 0;
|
|
|
- this.timer = window.setInterval(() => {
|
|
|
- this.tickCount++;
|
|
|
- this.tickTimer();
|
|
|
- }, 2000);
|
|
|
- },
|
|
|
- tickTimer() {
|
|
|
- if (this.tickCount > 30) {
|
|
|
- if (this.timer) window.clearInterval(this.timer);
|
|
|
- this.qrcodeUrl = "";
|
|
|
- return
|
|
|
- }
|
|
|
- let outTradeNo = this.outTradeNo;
|
|
|
- httpServer("weixin.iswxPay", { outTradeNo }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- if (!!res.data) {
|
|
|
- if (this.timer) window.clearInterval(this.timer);
|
|
|
- MessageBox("支付成功", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- showClose: true,
|
|
|
- type: "sucess",
|
|
|
- });
|
|
|
- this.qrcodeUrl = "";
|
|
|
- this.joinTrainPlanDialog = false
|
|
|
- this.getData();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
getData() {
|
|
|
this.listLoading = true
|
|
|
httpServer('Train.GetTrainPlanList', {}).then(res => {
|
|
@@ -203,7 +193,7 @@
|
|
|
let planId = this.courses[i].planId
|
|
|
if (planId) plans[planId] = this.courses[i]
|
|
|
}
|
|
|
- this.plans = plans
|
|
|
+ this.plans = plans;
|
|
|
this.list = this.list.map(v => {
|
|
|
let item = plans[v.planId];
|
|
|
v.resitCount = 0
|
|
@@ -219,55 +209,54 @@
|
|
|
this.listLoading = false
|
|
|
})
|
|
|
},
|
|
|
- joinTrainPlan(row) {
|
|
|
- if (this.courses.length < 1) {
|
|
|
- this.$message.errorMsg("报考信息还未确认")
|
|
|
- return
|
|
|
- }
|
|
|
- this.planId = row.planId;
|
|
|
- this.courseId = this.courses[0].courseId;
|
|
|
- this.curCourse = this.courses[0];
|
|
|
- this.joinTrainPlanDialog = true;
|
|
|
- },
|
|
|
- reJoinTrainPlan(row) {
|
|
|
- if (this.courses.length < 1) {
|
|
|
- this.$message.errorMsg("报考信息还未确认")
|
|
|
- return
|
|
|
- }
|
|
|
- this.planId = row.planId;
|
|
|
- this.courseId = this.courses[0].courseId;
|
|
|
- this.joinTrainPlanDialog = true;
|
|
|
+ buyPayLog(){
|
|
|
+ let {planId, applyId} = this
|
|
|
+ let param = {planId, applyId}
|
|
|
+ let uuid = `${planId}_${applyId}`;
|
|
|
+ param.marks = this.payLog.marks||'';
|
|
|
+ param.buyImg = this.payLog.buyImg||'';
|
|
|
+ httpServer('User.buyPayLog', param).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ Object.assign( this.payLog, res.data );
|
|
|
+ this.payLogs[uuid] = this.payLog;
|
|
|
+ this.$message.successMsg("报名成功")
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- doResitTrainPlan(){
|
|
|
- let {applyId} = this.curCourse;
|
|
|
- let planId = this.planId;
|
|
|
- if( this.curCourse.isPass == 1) return;
|
|
|
- httpServer('Weixin.DoWxpayTrain', {planId,applyId}).then(res => {
|
|
|
+ applyPayLog(){
|
|
|
+ let {planId, applyId} = this
|
|
|
+ let uuid = `${planId}_${applyId}`;
|
|
|
+ let param = {planId, applyId}
|
|
|
+ param.marks = this.payLog.marks||'';
|
|
|
+ httpServer('User.ApplyPayLog', param).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- let { outTradeNo, showUrl,fee } = res.data;
|
|
|
- this.qrcode = true;
|
|
|
- this.qrcodeUrl = showUrl
|
|
|
- this.outTradeNo = outTradeNo;
|
|
|
- this.initTimer();
|
|
|
+ Object.assign( this.payLog, res.data );
|
|
|
+ this.payLogs[uuid] = this.payLog;
|
|
|
+ this.$message.successMsg("支付成功");
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- doJoinTrainPlan() {
|
|
|
- if( this.curCourse.isPass==1){
|
|
|
- this.$message.successMsg('考试已经通过', 2)
|
|
|
+ loadPayLog( ){
|
|
|
+ let {planId, applyId} = this;
|
|
|
+ let uuid = `${planId}_${applyId}`;
|
|
|
+ if( this.payLogs[uuid]){
|
|
|
+ this.payLog = this.payLogs[uuid];
|
|
|
return
|
|
|
}
|
|
|
- let {applyId} = this.curCourse;
|
|
|
- let { planId, courseId } = this
|
|
|
- if (!planId || !courseId) return;
|
|
|
- httpServer('Train.JoinTrainPlan', {planId, courseId, applyId}).then(res => {
|
|
|
+ httpServer('Train.GetPlanPayLog', {planId,applyId}).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.$message.successMsg('报名成功', 1)
|
|
|
- this.getData()
|
|
|
- this.joinTrainPlanDialog = false
|
|
|
+ this.payLogs[uuid] = res.data||{};
|
|
|
+ this.payLog = res.data||{};
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ joinTrainPlan(row) {
|
|
|
+ if ( this.courses.length < 1 ) {
|
|
|
+ this.$message.errorMsg("报考信息还未确认")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.planId = row.planId;
|
|
|
+ },
|
|
|
|
|
|
handleCurrentChange: function(page) {
|
|
|
this.page = page
|
|
@@ -278,4 +267,7 @@
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
+ .confirmImg{
|
|
|
+ width: 220px;
|
|
|
+ }
|
|
|
</style>
|