|
@@ -84,7 +84,7 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
- <el-card class="box-card">
|
|
|
+ <el-card class="box-card" v-if="activeItems.length > 0">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span>报名信息</span>
|
|
|
</div>
|
|
@@ -113,10 +113,14 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="input-container" v-else>
|
|
|
+ <div class="input-container" v-else-if="item.type == 3">
|
|
|
<div class="label"><span v-if="item.isRequire">*</span>{{item.question}}</div>
|
|
|
<el-input type="text" v-model="item.inputValue" :maxlength="item.answer[0].option_limit" :disabled="formType!=0" :placeholder="`请输入${item.question}`"></el-input>
|
|
|
</div>
|
|
|
+ <div class="input-container" v-else>
|
|
|
+ <div class="label"><span v-if="item.isRequire">*</span>{{item.question}}</div><br/>
|
|
|
+ <ImageUpload :fileList="item.inputValue" :limit="1" :isEdit="formType==0" :fileType="['image','video']"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
<el-card class="box-card" v-if="formType != 0">
|
|
@@ -237,28 +241,35 @@
|
|
|
})
|
|
|
},
|
|
|
getActiveList(){
|
|
|
- getActiveList({}).then(res => {
|
|
|
+ getActiveList({pageNum: 1,pageSize: -1,status: 1}).then(res => {
|
|
|
this.activeList = res.data.records
|
|
|
})
|
|
|
},
|
|
|
getActiveDetail(id,items){
|
|
|
getActiveDetail({id}).then(res => {
|
|
|
- res.data.promotionQuestionnaireItems.forEach(item=>{
|
|
|
+ this.formData.activeDate = [res.data.startTime,res.data.endTime]
|
|
|
+ res.data.promotionQuestionnaireItems.forEach((item,index)=>{
|
|
|
item.answer = JSON.parse(item.answer)
|
|
|
if(items){
|
|
|
- items.forEach(it=>{
|
|
|
- item.answer.forEach(it1 => {
|
|
|
- JSON.parse(it.answer).forEach(it2 => {
|
|
|
- if(it1.option_value == it2.option_value && it2.active){
|
|
|
- it1.active = true;
|
|
|
- }else{
|
|
|
- it.active = false;
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ item.answer.forEach((it,ind) => {
|
|
|
+ let data = JSON.parse(items[index].answer)
|
|
|
+ if(data[ind]?.active){
|
|
|
+ it.active = true;
|
|
|
+ }else{
|
|
|
+ it.active = false;
|
|
|
+ }
|
|
|
+ if(items[index].type == 3){
|
|
|
+ item.inputValue = data[ind]?.option_value
|
|
|
+ }else if(item.type == 4){
|
|
|
+ item.inputValue = [{url: data[ind]?.option_value}]
|
|
|
+ }
|
|
|
})
|
|
|
}else{
|
|
|
- item.inputValue = '';
|
|
|
+ if(item.type == 4){
|
|
|
+ item.inputValue = []
|
|
|
+ }else{
|
|
|
+ item.inputValue = '';
|
|
|
+ }
|
|
|
item.answer.forEach(it => {
|
|
|
it.active = false;
|
|
|
})
|
|
@@ -294,6 +305,10 @@
|
|
|
if(this.activeItems[i].type == 3 && !this.activeItems[i].inputValue) {
|
|
|
return this.$message.warning(`请输入${this.activeItems[i].question}`)
|
|
|
}
|
|
|
+ // 图片视频
|
|
|
+ if(this.activeItems[i].type == 4 && this.activeItems[i].inputValue.length==0) {
|
|
|
+ return this.$message.warning(`请上传${this.activeItems[i].question}`)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 生成题目提交信息
|
|
@@ -312,6 +327,12 @@
|
|
|
activeItems[index].answer = JSON.stringify(activeItems[index].answer);
|
|
|
items.push(activeItems[index]);
|
|
|
}
|
|
|
+ // 图片视频
|
|
|
+ if (activeItems[index].type == 4 && activeItems[index].inputValue.length > 0) {
|
|
|
+ activeItems[index].answer[0].option_value = activeItems[index].inputValue[0].url;
|
|
|
+ activeItems[index].answer = JSON.stringify(activeItems[index].answer);
|
|
|
+ items.push(activeItems[index]);
|
|
|
+ }
|
|
|
}
|
|
|
add({
|
|
|
promotionQuestionnaireId: this.formData.promotionActivityId,
|