对接接口

上级 f270b986
...@@ -101,15 +101,15 @@ ...@@ -101,15 +101,15 @@
v-show="scope.row.status == 1" v-show="scope.row.status == 1"
size="small" size="small"
@click="onAndDownLine(scope.row)" @click="onAndDownLine(scope.row)"
>上线</el-button >上线
> </el-button>
<el-button <el-button
type="primary" type="primary"
v-show="scope.row.status == 2" v-show="scope.row.status == 2"
size="small" size="small"
@click="onAndDownLine(scope.row)" @click="onAndDownLine(scope.row)"
>下线</el-button >下线
> </el-button>
<!-- <el-button type="primary" size="small" @click="reviewQuestion(scope.row)">查看题库</el-button> --> <!-- <el-button type="primary" size="small" @click="reviewQuestion(scope.row)">查看题库</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
...@@ -166,7 +166,8 @@ ...@@ -166,7 +166,8 @@
maxlength="30" maxlength="30"
placeholder="标题最多30字符" placeholder="标题最多30字符"
style="width: 300px;" style="width: 300px;"
></el-input> >
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="题库导入" prop="fileName"> <el-form-item label="题库导入" prop="fileName">
<el-col :span="12"> <el-col :span="12">
...@@ -258,11 +259,13 @@ ...@@ -258,11 +259,13 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="基本信息" v-show="questionEditList.showType == 2"> <el-form-item label="基本信息" v-show="questionEditList.showType == 2">
<el-checkbox-group v-model="questionEditList.baseInfoList"> <el-checkbox v-model="userBase.name" label="true">姓名</el-checkbox>
<el-checkbox label="1">姓名</el-checkbox> <el-checkbox v-model="userBase.mobile" label="true"
<el-checkbox label="2">手机号</el-checkbox> >手机号</el-checkbox
<el-checkbox label="3">地址</el-checkbox> >
</el-checkbox-group> <el-checkbox v-model="userBase.address" label="true"
>地址</el-checkbox
>
</el-form-item> </el-form-item>
<div v-show="questionEditList.showType == 2"> <div v-show="questionEditList.showType == 2">
<el-form-item class="submit-btn" label="头图"> <el-form-item class="submit-btn" label="头图">
...@@ -327,10 +330,7 @@ ...@@ -327,10 +330,7 @@
label="登录权限控制" label="登录权限控制"
v-show="questionEditList.showType == 2" v-show="questionEditList.showType == 2"
> >
<el-checkbox-group <el-checkbox-group v-model="loginAuthList" class="login-auth">
v-model="questionEditList.loginAuthList"
class="login-auth"
>
<el-checkbox label="1">云鹊医APP</el-checkbox> <el-checkbox label="1">云鹊医APP</el-checkbox>
<el-checkbox label="2">云鹊医H5</el-checkbox> <el-checkbox label="2">云鹊医H5</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
...@@ -405,17 +405,18 @@ export default { ...@@ -405,17 +405,18 @@ export default {
submitButtomUrl: "", submitButtomUrl: "",
promptCopy: "", promptCopy: "",
headDiagramUrl: "", headDiagramUrl: "",
baseInfoList: [], //基本信息
questionIntro: "", questionIntro: "",
loginAuthList: [], //登录权限控制
limitNumFlag: "0", //填写次数flag limitNumFlag: "0", //填写次数flag
limitNum: 1 //填写次数 limitNum: 1 //填写次数
}, },
loginAuthList: [], //登录权限控制
userBase: {}, //基本信息
rules: { rules: {
name: [{ required: true, message: "请输入问卷标题", trigger: "blur" }], name: [
fileName: [
{ {
required: true required: true,
message: "请输入问卷标题",
trigger: "blur"
} }
], ],
promptCopy: [ promptCopy: [
...@@ -503,13 +504,20 @@ export default { ...@@ -503,13 +504,20 @@ export default {
submitButtomUrl: "", submitButtomUrl: "",
promptCopy: "您已成功提交问卷,感谢您的参与!", promptCopy: "您已成功提交问卷,感谢您的参与!",
headDiagramUrl: "", headDiagramUrl: "",
baseInfoList: [],
questionIntro: "", questionIntro: "",
loginAuthList: ["1"],
limitNumFlag: "0", limitNumFlag: "0",
limitNum: 1 limitNum: 1
} }
); );
vm.loginAuthList = ["1"];
vm.userBase = Object.assign(
{},
{
address: false,
mobile: false,
name: false
}
);
vm.fileName = ""; vm.fileName = "";
vm.fileArray = []; vm.fileArray = [];
vm.excelFileName = ""; vm.excelFileName = "";
...@@ -523,22 +531,35 @@ export default { ...@@ -523,22 +531,35 @@ export default {
vm.excelFileName = ""; vm.excelFileName = "";
vm.fileName = ""; vm.fileName = "";
vm.fileArray = []; vm.fileArray = [];
vm.GET("/campaign/adminQuestionnaire/getQuestionnaireById", { vm.GET("/campaign/adminQuestionnaire/getQuestionnaireById", {
id: row.id id: row.id
}).then(res => { }).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
console.log(res.data); // console.log(res.data);
vm.questionEditList = Object.assign({}, res.data); vm.questionEditList = Object.assign(
if (!res.data.limitNum || res.data.limitNum < 1) { {},
vm.questionEditList = Object.assign({}, vm.questionEditList, { res.data.data.questionnaireInfo
limitNumFlag: "0", );
limitNum: 1
}); vm.questionEditList = Object.assign({}, vm.questionEditList, {
} else { limitNumFlag: res.data.data.limitNum < 1 ? "1" : "0",
vm.questionEditList = Object.assign({}, vm.questionEditList, { limitNum: res.data.data.limitNum < 1 ? 1 : res.data.data.limitNum
limitNumFlag: "1" });
});
} vm.loginAuthList = [];
res.data.data.loginAuthInfo.map(u => {
vm.loginAuthList.push(u.value);
});
const userBaseData = JSON.parse(
res.data.data.questionnaireInfo.userBase
);
vm.userBase = Object.assign({}, vm.userBase, {
address: Boolean(userBaseData.address),
mobile: Boolean(userBaseData.mobile),
name: Boolean(userBaseData.name)
});
} }
}); });
}, },
...@@ -552,7 +573,7 @@ export default { ...@@ -552,7 +573,7 @@ export default {
}; };
} else { } else {
req = { req = {
id: row.id, id: row.id,
status: 1 status: 1
}; };
} }
...@@ -671,9 +692,25 @@ export default { ...@@ -671,9 +692,25 @@ export default {
submitQuestion() { submitQuestion() {
let req = { let req = {
model: vm.questionEditList, model: vm.questionEditList,
fileArray: vm.fileArray fileArray: vm.fileArray,
loginAuth: []
}; };
console.log(vm.questionEditList.questionIntro); if (vm.questionEditList.limitNumFlag == 1) {
req.model.limitNum = -1;
}
vm.userBase = Object.assign({}, vm.userBase, {
address: Number(vm.userBase.address),
mobile: Number(vm.userBase.mobile),
name: Number(vm.userBase.name)
});
req.model.userBase = JSON.stringify(vm.userBase);
vm.loginAuthList.map(u => {
req.loginAuth.push({
value: u
});
});
console.log(req);
if (vm.questionEditList.showType == 1) { if (vm.questionEditList.showType == 1) {
// 单题显示 // 单题显示
vm.questionEditList.questionIntro = ""; vm.questionEditList.questionIntro = "";
...@@ -728,48 +765,61 @@ export default { ...@@ -728,48 +765,61 @@ export default {
.question-wrap { .question-wrap {
.question-content { .question-content {
background: #fff; background: #fff;
.add-question { .add-question {
float: right; float: right;
margin: 10px; margin: 10px;
} }
.table-empty { .table-empty {
img { img {
width: 100px; width: 100px;
} }
p { p {
margin-top: -50px; margin-top: -50px;
} }
} }
} }
.submit-btn { .submit-btn {
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
p { p {
font-size: 12px; font-size: 12px;
} }
.avatar-uploader { .avatar-uploader {
float: right; float: right;
.el-button { .el-button {
margin-left: 10px; margin-left: 10px;
} }
.head-btn { .head-btn {
margin-top: 48px !important; margin-top: 48px !important;
} }
} }
.uploat-content { .uploat-content {
float: left; float: left;
.bg-img { .bg-img {
width: 150px; width: 150px;
height: 30px; height: 30px;
} }
.head-bg-img { .head-bg-img {
width: 80px; width: 80px;
height: 80px; height: 80px;
} }
} }
} }
.login-auth { .login-auth {
width: 400px; width: 400px;
.el-checkbox { .el-checkbox {
display: inline-block; display: inline-block;
width: 150px; width: 150px;
...@@ -778,5 +828,3 @@ export default { ...@@ -778,5 +828,3 @@ export default {
} }
} }
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册