Commit 4cd00f17 authored by 纪泽龙's avatar 纪泽龙

修复一个保存分数的bug

parent 0e27e9e1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05 * @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-13 16:26:33 * @LastEditTime: 2023-01-31 10:12:31
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue * @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -296,7 +296,7 @@ export default { ...@@ -296,7 +296,7 @@ export default {
this.bottomFrom.singleChoiceScore > 0 && this.bottomFrom.singleChoiceScore > 0 &&
this.bottomFrom.multipleChoiceScore > 0 && this.bottomFrom.multipleChoiceScore > 0 &&
this.bottomFrom.judgmentScore > 0 && this.bottomFrom.judgmentScore > 0 &&
this.fobottomFromrm.qualifiedNum > 0 this.bottomFrom.qualifiedNum > 0
) )
) { ) {
this.$message({ this.$message({
......
<template> <template>
<el-form ref="form" :rules="rules" :model="form" label-width="80px"> <div style="padding:10px 0 0 20px">
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<h3>个人信息录入</h3>
<el-form-item label="单位" prop="beyondUnit">
<el-input
style="width: 70%"
placeholder="请输入单位"
v-model="form.beyondUnit"
maxlength="30"
clearable
>
</el-input>
</el-form-item>
<h3>个人信息录入</h3> <el-form-item label="姓名">
<el-form-item label="单位" prop="beyondUnit"> <el-input
<el-input style="width: 70%"
style="width: 70%;" placeholder="请输入姓名"
placeholder="请输入单位" v-model="form.name"
v-model="form.beyondUnit" maxlength="11"
maxlength="30" clearable
clearable> >
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="姓名">
<el-input
style="width: 70%;"
placeholder="请输入姓名"
v-model="form.name"
maxlength="11"
clearable>
</el-input>
</el-form-item>
<el-form-item label="性别">
<el-radio-group v-model="form.sex">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="手机号">
<el-input
style="width: 70%;"
placeholder="手机号"
v-model="form.phoneNum"
type="number"
maxlength="11"
clearable>
</el-input>
</el-form-item>
<el-form-item>
<el-button @click="onSubmit" type="primary" >下一步</el-button>
<el-button>取消</el-button>
</el-form-item>
</el-form>
<el-form-item label="性别">
<el-radio-group v-model="form.sex">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="手机号">
<el-input
style="width: 70%"
placeholder="手机号"
v-model="form.phoneNum"
type="number"
maxlength="11"
clearable
>
</el-input>
</el-form-item>
<el-form-item>
<el-button @click="onSubmit" type="primary">下一步</el-button>
<el-button>取消</el-button>
</el-form-item>
</el-form>
</div>
</template> </template>
<script> <script>
export default { export default {
name: "EnterInformation", name: "EnterInformation",
data() { data() {
return { return {
form: { form: {
beyondUnit: null, beyondUnit: null,
name: null, name: null,
sex: null, sex: null,
phoneNum: null, phoneNum: null,
testBeginTime:null, testBeginTime: null,
},
}
}, },
methods: { };
/** },
* 获取当前时间 methods: {
*/ /**
currentTime() { * 获取当前时间
var date = new Date(); */
var year = date.getFullYear(); //月份从0~11,所以加一 currentTime() {
let month = date.getMonth(); var date = new Date();
var dateArr = [ var year = date.getFullYear(); //月份从0~11,所以加一
date.getMonth() + 1, let month = date.getMonth();
date.getDate(), var dateArr = [
date.getHours(), date.getMonth() + 1,
date.getMinutes(), date.getDate(),
date.getSeconds(), date.getHours(),
]; date.getMinutes(),
//如果格式是MM则需要此步骤,如果是M格式则此循环注释掉 date.getSeconds(),
for (var i = 0; i < dateArr.length; i++) { ];
if (dateArr[i] >= 1 && dateArr[i] <= 9) { //如果格式是MM则需要此步骤,如果是M格式则此循环注释掉
dateArr[i] = "0" + dateArr[i]; for (var i = 0; i < dateArr.length; i++) {
} if (dateArr[i] >= 1 && dateArr[i] <= 9) {
} dateArr[i] = "0" + dateArr[i];
var strDate =
year +
"/" +
dateArr[0] +
"/" +
dateArr[1] +
" " +
dateArr[2] +
":" +
dateArr[3] +
":" +
dateArr[4];
//此处可以拿外部的变量接收 strDate:2022-05-01 13:25:30
//this.date = strDate;
this.form.testBeginTime=strDate;
},
onSubmit() {
this.currentTime();
// let params = this.form;
let params = JSON.stringify(this.form);
console.log(this.form.beyondUnit)
if (!this.form.beyondUnit){
console.log(params.beyondUnit)
this.$message('请输入单位');
}else if (!this.form.name){
this.$message('请输入姓名');
}else if (!this.form.sex){
this.$message('请选择性别');
}else if (!this.form.phoneNum){
this.$message('请输入手机号');
}else if (this.form.phoneNum.length>11){
this.$message('长度超出11位');
} else {
const routeData = this.$router.resolve({
path: '/trainingMaterials', //跳转目标窗口的地址
query: {
params //括号内是要传递给新窗口的参数
}
})
window.open(routeData.href, "_search");
}
},
next() {
if (this.active++ > 2) this.active = 0;
} }
} }
} var strDate =
year +
"/" +
dateArr[0] +
"/" +
dateArr[1] +
" " +
dateArr[2] +
":" +
dateArr[3] +
":" +
dateArr[4];
//此处可以拿外部的变量接收 strDate:2022-05-01 13:25:30
//this.date = strDate;
this.form.testBeginTime = strDate;
},
onSubmit() {
this.currentTime();
// let params = this.form;
let params = JSON.stringify(this.form);
console.log(this.form.beyondUnit);
if (!this.form.beyondUnit) {
console.log(params.beyondUnit);
this.$message("请输入单位");
} else if (!this.form.name) {
this.$message("请输入姓名");
} else if (!this.form.sex) {
this.$message("请选择性别");
} else if (!this.form.phoneNum) {
this.$message("请输入手机号");
} else if (this.form.phoneNum.length > 11) {
this.$message("长度超出11位");
} else {
const routeData = this.$router.resolve({
path: "/trainingMaterials", //跳转目标窗口的地址
query: {
params, //括号内是要传递给新窗口的参数
},
});
window.open(routeData.href, "_search");
}
},
next() {
if (this.active++ > 2) this.active = 0;
},
},
};
</script> </script>
<style> <style>
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment