|
@@ -67,7 +67,7 @@
|
|
|
|
|
|
|
|
|
<el-dialog title="申请开通课程" class="fc tc" :visible.sync="buyCourseDialog" :append-to-body="true" >
|
|
|
- <el-form label-width="80" label-position="left" :inline="false">
|
|
|
+ <el-form label-width="80" label-position="left" :inline="false" :model="buyForm" status-icon :rules="rules" ref="elForm">
|
|
|
<div align="left" style="font-size: 16px;">
|
|
|
<p><span class="buyForm-title">单位名称:</span> 三明市城市建设项目服务中心 </p>
|
|
|
<p><span class="buyForm-title">开户银行:</span>中国工商银行股份有限公司三明下洋支行 </p>
|
|
@@ -88,7 +88,7 @@
|
|
|
|
|
|
<el-row align="left">
|
|
|
<el-col :lg="12" class="pl20 pr20">
|
|
|
- <el-form-item lable="报考岗位" >
|
|
|
+ <el-form-item lable="报考岗位" prop="courseName">
|
|
|
<label slot="label">报考岗位</label>
|
|
|
<el-input v-model="buyForm.courseName" type="text" placeholder="报考岗位"></el-input>
|
|
|
</el-form-item>
|
|
@@ -96,7 +96,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :lg="12" class="pl20 pr20">
|
|
|
- <el-form-item lable="证书编号" >
|
|
|
+ <el-form-item lable="证书编号" prop="rzCode" >
|
|
|
<label slot="label">证书编号</label>
|
|
|
<el-input v-model="buyForm.rzCode" type="text" placeholder="证书编号"></el-input>
|
|
|
</el-form-item>
|
|
@@ -114,7 +114,7 @@
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="buyImg">
|
|
|
<img :src="buyForm.buyImg" :onerror="errorImg" class="setting-img" @click="showImg(buyForm.buyImg)">
|
|
|
<do-upload @onFinish="uploadBuyImg" :mins="50" :maxs="500" placeholder="上传支付凭证"> </do-upload>
|
|
|
</el-form-item>
|
|
@@ -241,6 +241,11 @@
|
|
|
media: {},
|
|
|
commitmentDialog: false,
|
|
|
exampleImg: exampleImg,
|
|
|
+ rules:{
|
|
|
+ rzCode: [{required:true, message:'请输入证书编号'}],
|
|
|
+ courseName:[{required:true, message:'请输入报考岗位'}],
|
|
|
+ buyImg:[{required:true, message:'请上传凭证'}]
|
|
|
+ },
|
|
|
errorImg: 'this.src="' + require('../../../assets/images/no-data_hash5abcd2ef62.png') + '"'
|
|
|
};
|
|
|
},
|
|
@@ -304,23 +309,35 @@
|
|
|
});
|
|
|
},
|
|
|
buyCourse(){
|
|
|
- let {marks, buyImg, course_id, courseName, rzCode, name} = this.buyForm;
|
|
|
- if( courseName != name ){
|
|
|
- this.$message.errorMsg("报考岗位有误", 1)
|
|
|
- return;
|
|
|
- }
|
|
|
- let param = {marks, buyImg, courseId:course_id, courseName, rzCode }
|
|
|
- httpServer("course.buyCourse", param).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message.successMsg("申请购买成功", 1);
|
|
|
- this.buyForm.temp.buyImg = this.buyForm.buyImg
|
|
|
- this.buyForm.temp.marks = this.buyForm.marks
|
|
|
- this.buyForm.temp.is_pay = 0
|
|
|
- this.buyForm.temp.courseName = this.buyForm.courseName;
|
|
|
- this.buyForm.temp.rzCode = this.buyForm.rzCode
|
|
|
- this.buyCourseDialog = false
|
|
|
+ this.$refs["elForm"].validate((valid) => {
|
|
|
+ if (!valid) return;
|
|
|
+ let {marks, buyImg, course_id, courseName, rzCode, name} = this.buyForm;
|
|
|
+ if( courseName != name ){
|
|
|
+ this.$message.errorMsg("报考岗位有误", 1)
|
|
|
+ return;
|
|
|
}
|
|
|
- });
|
|
|
+ if( !buyImg ){
|
|
|
+ this.$message.errorMsg("请上传支付凭证", 1)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if( !rzCode && !courseName ){
|
|
|
+ this.$message.errorMsg("填写报考信息", 1)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let param = {marks, buyImg, courseId:course_id, courseName, rzCode }
|
|
|
+ httpServer("course.buyCourse", param).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.successMsg("申请购买成功", 1);
|
|
|
+ this.buyForm.temp.buyImg = this.buyForm.buyImg
|
|
|
+ this.buyForm.temp.marks = this.buyForm.marks
|
|
|
+ this.buyForm.temp.is_pay = 0
|
|
|
+ this.buyForm.temp.courseName = this.buyForm.courseName;
|
|
|
+ this.buyForm.temp.rzCode = this.buyForm.rzCode
|
|
|
+ this.buyCourseDialog = false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
confirmCommitment(){
|
|
|
this.commitmentDialog = false;
|