Commit 57015c75 authored by zhengke's avatar zhengke

修改

parent f7caed24
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<q-radio v-model="item.ChooseType" :val="1" label="从题库选题" /> <q-radio v-model="item.ChooseType" :val="1" label="从题库选题" />
<template v-if="item.ChooseType==1"> <template v-if="item.ChooseType==1">
<span style="position:relative;top:2px;">{{item.QuestionTypeNum}} 道 抽 <span style="position:relative;top:2px;">{{item.QuestionTypeNum}} 道 抽
<el-input style="width:100px;" size="small" :disabled="item.QuestionTypeNum<=0" v-model="item.ChooseNum" @keyup.native="checkInteger(item,'ChooseNum')" maxlength="5"></el-input> <el-input style="width:100px;" size="small" :disabled="item.QuestionTypeNum<=0" @input="getMaxInput(item)" v-model="item.ChooseNum" @keyup.native="checkInteger(item,'ChooseNum')" maxlength="5"></el-input>
&nbsp;&nbsp;</span> &nbsp;&nbsp;</span>
</template> </template>
</span> </span>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.ChooseList" :key="subIndex"> <div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.ChooseList" :key="subIndex">
{{subItem.DifficultyTypeName}} (共 {{subItem.DifficultyTypeName}} (共
{{subItem.DifficultyTypeCount}} 道) 抽 {{subItem.DifficultyTypeCount}} 道) 抽
<el-input style="width:100px;" size="small" :disabled="subItem.DifficultyTypeCount<=0" @keyup.native="checkInteger(subItem,'ChooseNum')" v-model="subItem.ChooseNum" maxlength="5"></el-input> <el-input style="width:100px;" size="small" :disabled="subItem.DifficultyTypeCount<=0" @input="getMaxMiniInput(subItem)" @keyup.native="checkInteger(subItem,'ChooseNum')" v-model="subItem.ChooseNum" maxlength="5"></el-input>
&nbsp;&nbsp; &nbsp;&nbsp;
</div> </div>
</template> </template>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<br /> <br />
<div class="row"> <div class="row">
<q-btn color="accent" size="sm" @click="setPaperTemplate" class="q-mr-md" label="保存"  /> <q-btn color="accent" size="sm" @click="setPaperTemplate" class="q-mr-md" label="保存" :loading="saveLoading" />
</div> </div>
<questionbankForm v-if="isShowQuestionBank"  @close="closeExamForm"  @success="getBankData"> <questionbankForm v-if="isShowQuestionBank"  @close="closeExamForm"  @success="getBankData">
</questionbankForm> </questionbankForm>
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
BankList: [], BankList: [],
MoreQuestionTypeId: "", //更多题型 MoreQuestionTypeId: "", //更多题型
questionTypeList: [], //问题列表 questionTypeList: [], //问题列表
saveLoading:false
} }
}, },
created() { created() {
...@@ -142,6 +143,17 @@ ...@@ -142,6 +143,17 @@
}, },
methods: { methods: {
//设置最大值
getMaxInput(item){
if(item.ChooseNum>item.QuestionTypeNum){
item.ChooseNum='';
}
},
getMaxMiniInput(item){
if(item.ChooseNum>item.DifficultyTypeCount){
item.ChooseNum='';
}
},
//获取题型列表 //获取题型列表
getQuestionType() { getQuestionType() {
queryQuestionTypeList({}).then(res => { queryQuestionTypeList({}).then(res => {
...@@ -345,7 +357,7 @@ ...@@ -345,7 +357,7 @@
if (!this.$refs.TemplateNum.hasError) { if (!this.$refs.TemplateNum.hasError) {
let TotalNum = 0; let TotalNum = 0;
for(let i=0;i<this.templateMsg.TemplateData.length;i++){ for(let i=0;i<this.templateMsg.TemplateData.length;i++){
if(this.templateMsg.TemplateData[i].ChooseType==1&&this.templateMsg.TemplateData[i].ChooseNum==''){ if(this.templateMsg.TemplateData[i].ChooseType==1&&this.templateMsg.TemplateData[i].ChooseNum===''){
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -363,7 +375,9 @@ ...@@ -363,7 +375,9 @@
}) })
return return
} }
this.saveLoading=true;
savePaperTemplate(this.templateMsg).then(res => { savePaperTemplate(this.templateMsg).then(res => {
this.saveLoading=false;
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
......
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