|
@@ -20,7 +20,7 @@ a {
|
|
|
.item-main {
|
|
.item-main {
|
|
|
// margin:34px;
|
|
// margin:34px;
|
|
|
// height:600px;
|
|
// height:600px;
|
|
|
- background: #FFFFFF;
|
|
|
|
|
|
|
+ background: #ffffff;
|
|
|
width: 356px;
|
|
width: 356px;
|
|
|
height: 575px;
|
|
height: 575px;
|
|
|
overflow: auto;
|
|
overflow: auto;
|
|
@@ -31,12 +31,12 @@ a {
|
|
|
left: 4px;
|
|
left: 4px;
|
|
|
// box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.13);
|
|
// box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.13);
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
|
- border:1px solid #ccc;
|
|
|
|
|
|
|
+ border: 1px solid #ccc;
|
|
|
.el-form.over_y {
|
|
.el-form.over_y {
|
|
|
max-height: calc(100vh - 340px);
|
|
max-height: calc(100vh - 340px);
|
|
|
overflow: visible;
|
|
overflow: visible;
|
|
|
}
|
|
}
|
|
|
- .tpl_form{
|
|
|
|
|
|
|
+ .tpl_form {
|
|
|
border: none;
|
|
border: none;
|
|
|
}
|
|
}
|
|
|
/deep/.el-form-item__label {
|
|
/deep/.el-form-item__label {
|
|
@@ -96,14 +96,14 @@ a {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-.survey_dialog{
|
|
|
|
|
- .el-dialog{
|
|
|
|
|
|
|
+.survey_dialog {
|
|
|
|
|
+ .el-dialog {
|
|
|
// width:25%;
|
|
// width:25%;
|
|
|
width: 400px;
|
|
width: 400px;
|
|
|
height: 750px;
|
|
height: 750px;
|
|
|
margin-top: 20px !important;
|
|
margin-top: 20px !important;
|
|
|
background: url("../../assets/survey_bg.png") no-repeat;
|
|
background: url("../../assets/survey_bg.png") no-repeat;
|
|
|
- background-size:100% 100%;
|
|
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
border-radius: 60px;
|
|
border-radius: 60px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -301,12 +301,18 @@ a {
|
|
|
:show-close="false"
|
|
:show-close="false"
|
|
|
:title="dialogTitle"
|
|
:title="dialogTitle"
|
|
|
:visible.sync="dialogVisible1"
|
|
:visible.sync="dialogVisible1"
|
|
|
- class="survey_dialog" width="400px"
|
|
|
|
|
|
|
+ class="survey_dialog"
|
|
|
|
|
+ width="400px"
|
|
|
>
|
|
>
|
|
|
<div class="item-main">
|
|
<div class="item-main">
|
|
|
<img src="../../assets/survey_logo.png" alt="" class="survey_logo" />
|
|
<img src="../../assets/survey_logo.png" alt="" class="survey_logo" />
|
|
|
<h5 align="center" class="tpl_title">{{ title }}</h5>
|
|
<h5 align="center" class="tpl_title">{{ title }}</h5>
|
|
|
- <el-form ref="form" :model="form2" class="tpl_form over_y" :rules="rules1.rules">
|
|
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ ref="form2"
|
|
|
|
|
+ :model="form2"
|
|
|
|
|
+ class="tpl_form over_y"
|
|
|
|
|
+ :rules="rules1.rules"
|
|
|
|
|
+ >
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
v-for="(item, index) in widgetList"
|
|
v-for="(item, index) in widgetList"
|
|
|
:key="index"
|
|
:key="index"
|
|
@@ -381,8 +387,8 @@ a {
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="saveResult"
|
|
@click="saveResult"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- :disabled="form2.status==0"
|
|
|
|
|
- >{{this.form2.status==1?"提交":"该问卷已禁用"}}</el-button
|
|
|
|
|
|
|
+ :disabled="form2.status == 0"
|
|
|
|
|
+ >{{ this.form2.status == 1 ? "提交" : "该问卷已禁用" }}</el-button
|
|
|
>
|
|
>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
@@ -505,7 +511,7 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
// checked: [],
|
|
// checked: [],
|
|
|
rules1: {
|
|
rules1: {
|
|
|
- rules:{}
|
|
|
|
|
|
|
+ rules: {},
|
|
|
},
|
|
},
|
|
|
qrcodeUrl: "",
|
|
qrcodeUrl: "",
|
|
|
cur_message_id: null,
|
|
cur_message_id: null,
|
|
@@ -614,7 +620,7 @@ export default {
|
|
|
row.status = res.data.data;
|
|
row.status = res.data.data;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
this.$api.editMessageStatus({ id: row.id }).then((res) => {
|
|
this.$api.editMessageStatus({ id: row.id }).then((res) => {
|
|
|
row.status = res.data.data;
|
|
row.status = res.data.data;
|
|
|
});
|
|
});
|
|
@@ -689,7 +695,7 @@ export default {
|
|
|
this.message_id = row.id;
|
|
this.message_id = row.id;
|
|
|
this.widgetList = [];
|
|
this.widgetList = [];
|
|
|
this.form2 = {};
|
|
this.form2 = {};
|
|
|
- this.form2.status = row.status
|
|
|
|
|
|
|
+ this.form2.status = row.status;
|
|
|
this.$api.getMessageInfo({ id: row.id }).then((res) => {
|
|
this.$api.getMessageInfo({ id: row.id }).then((res) => {
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
this.widgetList = res.data.data.widget;
|
|
this.widgetList = res.data.data.widget;
|
|
@@ -706,20 +712,28 @@ export default {
|
|
|
_this.$set(_this.form2, i.label, i.result);
|
|
_this.$set(_this.form2, i.label, i.result);
|
|
|
}
|
|
}
|
|
|
//组装rules
|
|
//组装rules
|
|
|
- if(i.type=="input"&&i.require){
|
|
|
|
|
- rules1[i.label] = [{ required: true, message: i.placeholder, trigger: "blur" }]
|
|
|
|
|
|
|
+ if (i.type == "input" && i.require) {
|
|
|
|
|
+ rules1[i.label] = [
|
|
|
|
|
+ { required: true, message: i.placeholder, trigger: "blur" },
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
- if(i.type=="textarea"&&i.require){
|
|
|
|
|
- rules1[i.label] = [{ required: true, message: i.placeholder, trigger: "blur" }]
|
|
|
|
|
|
|
+ if (i.type == "textarea" && i.require) {
|
|
|
|
|
+ rules1[i.label] = [
|
|
|
|
|
+ { required: true, message: i.placeholder, trigger: "blur" },
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
- if(i.type=="radio"&&i.require){
|
|
|
|
|
- rules1[i.label] = [{ required: true, message: i.placeholder, trigger: "change" }]
|
|
|
|
|
|
|
+ if (i.type == "radio" && i.require) {
|
|
|
|
|
+ rules1[i.label] = [
|
|
|
|
|
+ { required: true, message: i.placeholder, trigger: "change" },
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
- if(i.type=="checkbox"&&i.require){
|
|
|
|
|
- rules1[i.label] = [{ required: true, message: i.placeholder, trigger: "change" }]
|
|
|
|
|
|
|
+ if (i.type == "checkbox" && i.require) {
|
|
|
|
|
+ rules1[i.label] = [
|
|
|
|
|
+ { required: true, message: i.placeholder, trigger: "change" },
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- this.$set(this.rules1,"rules",rules1)
|
|
|
|
|
|
|
+ this.$set(this.rules1, "rules", rules1);
|
|
|
// debugger
|
|
// debugger
|
|
|
this.dialogVisible1 = true;
|
|
this.dialogVisible1 = true;
|
|
|
}
|
|
}
|
|
@@ -816,23 +830,27 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
saveResult() {
|
|
saveResult() {
|
|
|
- let result = JSON.stringify(this.form2);
|
|
|
|
|
- this.$api
|
|
|
|
|
- .saveSurveyResult({
|
|
|
|
|
- message_id: this.message_id,
|
|
|
|
|
- result: result,
|
|
|
|
|
- })
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- if (res.data.code == 0) {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- message: "保存成功!",
|
|
|
|
|
|
|
+ this.$refs["form2"].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ let result = JSON.stringify(this.form2);
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .saveSurveyResult({
|
|
|
|
|
+ message_id: this.message_id,
|
|
|
|
|
+ result: result,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: "保存成功!",
|
|
|
|
|
+ });
|
|
|
|
|
+ this.dialogVisible1 = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.data.message);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
- } else {
|
|
|
|
|
- this.$message.error(res.data.message);
|
|
|
|
|
- }
|
|
|
|
|
- this.dialogVisible1 = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
save() {
|
|
save() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|