|  | @@ -18,10 +18,15 @@
 | 
											
												
													
														|  |        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
 |  |        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
 | 
											
												
													
														|  |      >
 |  |      >
 | 
											
												
													
														|  |        <el-table-column align="center" prop="title" label="调查时间">
 |  |        <el-table-column align="center" prop="title" label="调查时间">
 | 
											
												
													
														|  | 
 |  | +        <template slot-scope="scope">
 | 
											
												
													
														|  | 
 |  | +          <div>
 | 
											
												
													
														|  | 
 |  | +            {{ scope.row.questionTime | formatTimer }}
 | 
											
												
													
														|  | 
 |  | +          </div>
 | 
											
												
													
														|  | 
 |  | +        </template>
 | 
											
												
													
														|  |        </el-table-column>
 |  |        </el-table-column>
 | 
											
												
													
														|  | -      <el-table-column align="center" prop="author" label="调查对象">
 |  | 
 | 
											
												
													
														|  | 
 |  | +      <el-table-column align="center" prop="target" label="调查对象">
 | 
											
												
													
														|  |        </el-table-column>
 |  |        </el-table-column>
 | 
											
												
													
														|  | -      <el-table-column align="center" prop="linkUrl" label="调查人">
 |  | 
 | 
											
												
													
														|  | 
 |  | +      <el-table-column align="center" prop="operatorName" label="调查人">
 | 
											
												
													
														|  |        </el-table-column>
 |  |        </el-table-column>
 | 
											
												
													
														|  |        <el-table-column align="center" prop="id" label="操作">
 |  |        <el-table-column align="center" prop="id" label="操作">
 | 
											
												
													
														|  |          <template slot-scope="scope">
 |  |          <template slot-scope="scope">
 | 
											
										
											
												
													
														|  | @@ -55,8 +60,12 @@
 | 
											
												
													
														|  |        width="800px"
 |  |        width="800px"
 | 
											
												
													
														|  |        v-if="surveyVisible"
 |  |        v-if="surveyVisible"
 | 
											
												
													
														|  |      >
 |  |      >
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -      <surveyMask :form="form"  ref="surveyMask"/>
 |  | 
 | 
											
												
													
														|  | 
 |  | +      <surveyMask
 | 
											
												
													
														|  | 
 |  | +        :form="form"
 | 
											
												
													
														|  | 
 |  | +        ref="surveyMask"
 | 
											
												
													
														|  | 
 |  | +        :isdisabled="isdisabled"
 | 
											
												
													
														|  | 
 |  | +        @close="close"
 | 
											
												
													
														|  | 
 |  | +      />
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |        <span slot="footer" class="dialog-footer">
 |  |        <span slot="footer" class="dialog-footer">
 | 
											
												
													
														|  |          <el-button @click="surveyVisible = false">取 消</el-button>
 |  |          <el-button @click="surveyVisible = false">取 消</el-button>
 | 
											
										
											
												
													
														|  | @@ -66,7 +75,11 @@
 | 
											
												
													
														|  |    </div>
 |  |    </div>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
												
													
														|  | -import { getMusicGroupQuestionnaire, getQuestionDetail } from "./api";
 |  | 
 | 
											
												
													
														|  | 
 |  | +import {
 | 
											
												
													
														|  | 
 |  | +  getMusicGroupQuestionnaire,
 | 
											
												
													
														|  | 
 |  | +  getQuestionDetail,
 | 
											
												
													
														|  | 
 |  | +  getMusicGroupQuestionnaireDetail,
 | 
											
												
													
														|  | 
 |  | +} from "./api";
 | 
											
												
													
														|  |  import surveyMask from "./modals/surveyMask";
 |  |  import surveyMask from "./modals/surveyMask";
 | 
											
												
													
														|  |  import pagination from "@/components/Pagination/index";
 |  |  import pagination from "@/components/Pagination/index";
 | 
											
												
													
														|  |  export default {
 |  |  export default {
 | 
											
										
											
												
													
														|  | @@ -88,39 +101,50 @@ export default {
 | 
											
												
													
														|  |        form: {
 |  |        form: {
 | 
											
												
													
														|  |          questionTime: "",
 |  |          questionTime: "",
 | 
											
												
													
														|  |          target: "",
 |  |          target: "",
 | 
											
												
													
														|  | -        musicGroupId:'',
 |  | 
 | 
											
												
													
														|  | -        questionnaireUserResult:[]
 |  | 
 | 
											
												
													
														|  | 
 |  | +        musicGroupId: "",
 | 
											
												
													
														|  | 
 |  | +        questionnaireUserResultList: [],
 | 
											
												
													
														|  | 
 |  | +        isdisabled: false,
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  |      };
 |  |      };
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    async mounted() {
 |  |    async mounted() {
 | 
											
												
													
														|  |      this.getList();
 |  |      this.getList();
 | 
											
												
													
														|  | -    this.setQuestion()
 |  | 
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    methods: {
 |  |    methods: {
 | 
											
												
													
														|  |      async setQuestion() {
 |  |      async setQuestion() {
 | 
											
												
													
														|  |        try {
 |  |        try {
 | 
											
												
													
														|  |          const res = await getQuestionDetail();
 |  |          const res = await getQuestionDetail();
 | 
											
												
													
														|  | -        this.questionList = res.data;
 |  | 
 | 
											
												
													
														|  | -        this.form.musicGroupId = this.$route.query.id;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        let questionnaireUserResult=
 |  | 
 | 
											
												
													
														|  | -          this.questionList.questionnaireQuestionList.map((item) => {
 |  | 
 | 
											
												
													
														|  | -            if (item.type == "radio") {
 |  | 
 | 
											
												
													
														|  | -              item.questionnaireQuestionItemIdList = null;
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            if (item.type == "checkbox") {
 |  | 
 | 
											
												
													
														|  | -              item.questionnaireQuestionItemIdList = [];
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            if (item.type == "textarea") {
 |  | 
 | 
											
												
													
														|  | -              item.questionnaireQuestionItemIdList = null;
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            return item;
 |  | 
 | 
											
												
													
														|  | -          });
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -          this.$set(this.form, 'questionnaireUserResult',questionnaireUserResult)
 |  | 
 | 
											
												
													
														|  | 
 |  | +        this.setQuestionInfo(res.data);
 | 
											
												
													
														|  |        } catch (e) {}
 |  |        } catch (e) {}
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  | 
 |  | +    setQuestionInfo(data) {
 | 
											
												
													
														|  | 
 |  | +      this.questionList = data;
 | 
											
												
													
														|  | 
 |  | +      this.form.musicGroupId = this.$route.query.id;
 | 
											
												
													
														|  | 
 |  | +      this.form.target = null;
 | 
											
												
													
														|  | 
 |  | +      this.form.id = null;
 | 
											
												
													
														|  | 
 |  | +      this.form.questionTime =null;
 | 
											
												
													
														|  | 
 |  | +      let questionnaireUserResult =
 | 
											
												
													
														|  | 
 |  | +        this.questionList.questionnaireQuestionList.map((item) => {
 | 
											
												
													
														|  | 
 |  | +          if (item.type == "radio") {
 | 
											
												
													
														|  | 
 |  | +            item.questionnaireQuestionItemIdList = null;
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +          if (item.type == "checkbox") {
 | 
											
												
													
														|  | 
 |  | +            item.questionnaireQuestionItemIdList = [];
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +          if (item.type == "textarea") {
 | 
											
												
													
														|  | 
 |  | +            item.questionnaireQuestionItemIdList = null;
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +          item.questionnaireQuestionId = item.id;
 | 
											
												
													
														|  | 
 |  | +          return item;
 | 
											
												
													
														|  | 
 |  | +        });
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +      this.$set(
 | 
											
												
													
														|  | 
 |  | +        this.form,
 | 
											
												
													
														|  | 
 |  | +        "questionnaireUserResultList",
 | 
											
												
													
														|  | 
 |  | +        questionnaireUserResult
 | 
											
												
													
														|  | 
 |  | +      );
 | 
											
												
													
														|  | 
 |  | +      this.$refs.surveyMask.$refs.form.resetFields()
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  |      async getList() {
 |  |      async getList() {
 | 
											
												
													
														|  |        try {
 |  |        try {
 | 
											
												
													
														|  |          const res = await getMusicGroupQuestionnaire({
 |  |          const res = await getMusicGroupQuestionnaire({
 | 
											
										
											
												
													
														|  | @@ -134,20 +158,65 @@ export default {
 | 
											
												
													
														|  |          console.log(e);
 |  |          console.log(e);
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  | -    lookSurvey(row) {},
 |  | 
 | 
											
												
													
														|  | -    resetSurvey(row) {},
 |  | 
 | 
											
												
													
														|  | 
 |  | +    async lookSurvey(row) {
 | 
											
												
													
														|  | 
 |  | +       this.surveyTitle = "查看满意度调查"
 | 
											
												
													
														|  | 
 |  | +      await this.setDetail(row);
 | 
											
												
													
														|  | 
 |  | +      this.isdisabled = true;
 | 
											
												
													
														|  | 
 |  | +      this.surveyVisible = true;
 | 
											
												
													
														|  | 
 |  | +      // 查询详情
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +    async setDetail(row) {
 | 
											
												
													
														|  | 
 |  | +      await this.setQuestion();
 | 
											
												
													
														|  | 
 |  | +      this.activeRow = row;
 | 
											
												
													
														|  | 
 |  | +      try {
 | 
											
												
													
														|  | 
 |  | +        const res = await getMusicGroupQuestionnaireDetail({ id: row.id });
 | 
											
												
													
														|  | 
 |  | +        res.data.questionResult.forEach((asker) => {
 | 
											
												
													
														|  | 
 |  | +          this.form.questionnaireUserResultList.forEach((quest) => {
 | 
											
												
													
														|  | 
 |  | +            if (quest.id == asker.questionnaireQuestionId) {
 | 
											
												
													
														|  | 
 |  | +              quest.questionnaireQuestionItemIdList =
 | 
											
												
													
														|  | 
 |  | +                asker.questionnaireQuestionItemIdList;
 | 
											
												
													
														|  | 
 |  | +              if (
 | 
											
												
													
														|  | 
 |  | +                quest.type == "checkbox" &&
 | 
											
												
													
														|  | 
 |  | +                !Array.isArray(quest.questionnaireQuestionItemIdList)
 | 
											
												
													
														|  | 
 |  | +              ) {
 | 
											
												
													
														|  | 
 |  | +                quest.questionnaireQuestionItemIdList =
 | 
											
												
													
														|  | 
 |  | +                  quest.questionnaireQuestionItemIdList.split(",");
 | 
											
												
													
														|  | 
 |  | +              }
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          });
 | 
											
												
													
														|  | 
 |  | +        });
 | 
											
												
													
														|  | 
 |  | +        this.form.musicGroupId = res.data.musicGroupQuestionnaire.musicGroupId;
 | 
											
												
													
														|  | 
 |  | +        this.form.target = res.data.musicGroupQuestionnaire.target;
 | 
											
												
													
														|  | 
 |  | +        this.form.id = res.data.musicGroupQuestionnaire.id;
 | 
											
												
													
														|  | 
 |  | +        this.form.questionTime = res.data.musicGroupQuestionnaire.questionTime;
 | 
											
												
													
														|  | 
 |  | +      } catch (e) {
 | 
											
												
													
														|  | 
 |  | +        console.log(e);
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +    async resetSurvey(row) {
 | 
											
												
													
														|  | 
 |  | +      this.surveyTitle = "修改满意度调查"
 | 
											
												
													
														|  | 
 |  | +      await this.setDetail(row);
 | 
											
												
													
														|  | 
 |  | +      this.isdisabled = false;
 | 
											
												
													
														|  | 
 |  | +      this.surveyVisible = true;
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  |      deleteSurvey(row) {},
 |  |      deleteSurvey(row) {},
 | 
											
												
													
														|  | -    addSurvey() {
 |  | 
 | 
											
												
													
														|  | 
 |  | +  async  addSurvey() {
 | 
											
												
													
														|  |        (this.activeRow = null), (this.surveyTitle = "新增满意度调查");
 |  |        (this.activeRow = null), (this.surveyTitle = "新增满意度调查");
 | 
											
												
													
														|  | 
 |  | +     await this.setQuestion();
 | 
											
												
													
														|  | 
 |  | +      this.isdisabled = false;
 | 
											
												
													
														|  |        this.surveyVisible = true;
 |  |        this.surveyVisible = true;
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      submitSurvey() {
 |  |      submitSurvey() {
 | 
											
												
													
														|  | -      this.$refs.surveyMask.submitSurvey()
 |  | 
 | 
											
												
													
														|  | 
 |  | +      if (this.isdisabled) {
 | 
											
												
													
														|  | 
 |  | +        this.surveyVisible = false;
 | 
											
												
													
														|  | 
 |  | +        return;
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      this.$refs.surveyMask.submitSurvey();
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +    close() {
 | 
											
												
													
														|  | 
 |  | +      this.surveyVisible = false;
 | 
											
												
													
														|  | 
 |  | +      this.getList();
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  | -       changeSelect(){
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -      this.$forceUpdate()
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |  };
 |  |  };
 | 
											
												
													
														|  |  </script>
 |  |  </script>
 |