Skip to content

Commit

Permalink
addInvestigates 增加添加问卷请求发送的数据
Browse files Browse the repository at this point in the history
  • Loading branch information
suvvm committed Nov 27, 2019
1 parent 88038b7 commit 29ed88e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions pages/investigates/addInvestigates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<view>
<van-button icon="share" size="large" type="primary" @click="submit()">提交审核</van-button>
<van-button icon="plus" size="large" type="info" @click="addTag()">新增问题</van-button>
<van-cell-group>
<van-field v-model="name" label="问卷名" placeholder="请输入问卷名" required />
<van-field v-model="description" rows="1" autosize label="问卷简介" type="textarea" placeholder="请输入简介"/>
</van-cell-group>
<van-collapse v-model="activeNames">
<van-collapse-item title="选择标签" name="1">
<van-checkbox-group v-model="result" :max="3">
Expand Down Expand Up @@ -87,7 +91,8 @@
<script>
export default {
data() {
return {
return {
name: "",
questionList: [{stem:"徐英豪是不是沙雕",options:[{option:"A",value:""}],type:3}],
userInfo: {},
showAddQst: false,
Expand All @@ -100,8 +105,8 @@
mdfKey: 0,
tags: [],
activeNames: [],
result: []
result: [],
description: ""
}
},
onLoad() {
Expand Down Expand Up @@ -187,19 +192,22 @@
});
this.questionList.splice(0,1);
var rp = require('request-promise');
var rp = require('request-promise');
var options = {
method: 'POST',
uri: 'http://localhost:8080',
uri: 'http://localhost:8080/insertInvestigate',
form: {
description: this.description,
name: this.name,
ownerId: this.userInfo.id,
invDetails: JSON.stringify(this.questionList),
tags: JSON.stringify(this.result)
}
};
rp(options).then(res => {
this.$toast.clear();
this.$toast.success('提交成功,请耐心等待审核');
this.onRefresh();
// console.log(res);
}).catch(err => {
this.$toast.clear();
Expand Down

0 comments on commit 29ed88e

Please sign in to comment.