<template>
  <div class="home">
    <nav-bar />
    <van-form @submit="postFrom">
      <p><label>*</label>1、身份类别</p>
      <van-field name="mz_radio_sf" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group
            v-model="mz_radio_sf"
            class="radio_dx"
            @change="mz_radio_sf_change(mz_radio_sf)"
          >
            <van-cell-group>
              <van-cell>
                <van-radio name="1">现役军人</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">军队文职人员</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">军人家属</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">离退休干部</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">退役军人（含消防救援人员）</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">公务员</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="7">事业单位</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="8">企业</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="9">自由职业</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="10">学生</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="11">其他</van-radio>
                <van-field
                  type="text"
                  border
                  placeholder="请输入"
                  name="mz_sf_field"
                  v-model="mz_sf_field"
                  v-if="mz_sf_field_show"
                ></van-field>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>2、费用类别</p>
      <van-field name="mz_radio_fylb" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_fylb" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">军队医改</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">医保（异地）</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">居民医保</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">从业</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">自费</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>3、我来医院看病是因为</p>
      <van-field name="mz_radio_kbyy" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group
            v-model="mz_radio_kbyy"
            class="radio_dx"
            @change="mz_radio_kbyy_change(mz_radio_kbyy)"
          >
            <van-cell-group>
              <van-cell>
                <van-radio name="1">离家近</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">听熟人介绍</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">报纸广告介绍</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">服务好</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">知名度高</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">医保定点单位</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="7">交通方便</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="8">医疗费用较低</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="9">其他</van-radio>
                <van-field
                  type="text"
                  name="mz_kbyy_field"
                  v-model="mz_kbyy_field"
                  border
                  placeholder="请输入"
                  v-if="mz_kbyy_field_show"
                ></van-field>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>4、根据当天来院就医体验，您对本医院的服务评价</p>
      <van-field name="mz_radio_jyjyfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_jyjyfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>5、您对导医人员的服务</p>
      <van-field name="mz_radio_ydryfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_ydryfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>6、您对挂号、划价、收费处工作人员的服务</p>
      <van-field name="mz_radio_ghsfryfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_ghsfryfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>7、您对门急诊医生的诊疗服务</p>
      <van-field name="mz_radio_jzyswf" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_jzyswf" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>8、您对门急诊护士的服务</p>
      <van-field name="mz_radio_jzhsfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_jzhsfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>9、您对医学影像科(B超、心电图)人员的服务</p>
      <van-field name="mz_radio_bcfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_bcfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>10、您对医学影像科（CT\磁共振\DR）服务</p>
      <van-field name="mz_radio_ctfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_ctfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>11、您对检验科的服务</p>
      <van-field name="mz_radio_jyfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_jyfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>12、您对药剂科人员的服务</p>
      <van-field name="mz_radio_yjfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_yjfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>13、您对体检中心人员的服务</p>
      <van-field name="mz_radio_tjryfw" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_tjryfw" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p>
        <label>*</label
        >14、您认为我院门诊急需加强的专科是（可多选，至多选择三项）
      </p>
      <van-field name="check_jqmz" :rules="formRyles.rulesRadio">
        <template #input>
          <van-checkbox-group
            v-model="check_jqmz"
            class="radio_dx"
            :max="3"
            @change="check_jqmz_change(check_jqmz)"
          >
            <van-cell-group>
              <van-cell>
                <van-checkbox name="1">五官科</van-checkbox>
              </van-cell>
              <van-cell>
                <van-checkbox name="2">皮肤科</van-checkbox>
              </van-cell>
              <van-cell>
                <van-checkbox name="3">妇儿科</van-checkbox>
              </van-cell>
              <van-cell>
                <van-checkbox name="4">儿 科</van-checkbox>
              </van-cell>
              <van-cell>
                <van-checkbox name="5">骨 科</van-checkbox>
              </van-cell>
              <van-cell>
                <van-checkbox name="6">疼痛科</van-checkbox>
              </van-cell>
              <van-cell>
                <van-checkbox name="7">其他</van-checkbox>
                <van-field
                  type="text"
                  border
                  placeholder="请输入"
                  name="mz_jqmz_field"
                  v-model="mz_jqmz_field"
                  v-if="mz_jqmz_field_show"
                ></van-field>
              </van-cell>
            </van-cell-group>
          </van-checkbox-group>
        </template>
      </van-field>
      <p><label>*</label>15、您就诊时，是否能一次性解决当天的就医需求</p>
      <van-field name="mz_radio_ycxjjxq" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_ycxjjxq" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">是</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">否</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p>
        <label>*</label>16、您就诊时是否遇到过医务人员不注重保护个人隐私的情况：
      </p>
      <van-field name="mz_radio_bhysqk" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_bhysqk" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">是</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">否</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>17、您认为在医院用药是否满足需求</p>
      <van-field name="mz_radio_yymzxq" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_yymzxq" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">能够满足需求</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">不能满足需求，种类太少</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">慢性病开药量太少</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">有些常用的药需要自费</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">不给出院带药</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="6">未经历</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>18、您对就医指引标识是否满意</p>
      <van-field name="mz_radio_jyzybs" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_jyzybs" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">标识清楚，能够通过指引找到位置</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">有标识，但不易找到位置</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">没有标识，但问询后可以找到</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">没有标识也无人可问询</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>19、您对门诊环境条件的评价</p>
      <van-field name="mz_radio_mzhjtj" :rules="formRyles.rulesRadio">
        <template #input>
          <van-radio-group v-model="mz_radio_mzhjtj" class="radio_dx">
            <van-cell-group>
              <van-cell>
                <van-radio name="1">很满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="2">满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="3">一般</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="4">不满意</van-radio>
              </van-cell>
              <van-cell>
                <van-radio name="5">很不满意</van-radio>
              </van-cell>
            </van-cell-group>
          </van-radio-group>
        </template>
      </van-field>
      <p><label>*</label>20、请您填写对我院就医服务的建议、意见和要求</p>
      <van-field
        type="text"
        placeholder="请输入"
        name="mz_jy_field"
        v-model="mz_jy_field"
        :rules="formRyles.rulesField"
      ></van-field>
      <p><label>*</label>21、您的姓名</p>
      <van-field
        type="text"
        placeholder="请输入"
        name="mz_xm_field"
        v-model="mz_xm_field"
        :rules="formRyles.rulesField"
      ></van-field>
      <p><label>*</label>22、您的手机号码</p>
      <van-field
        type="number"
        placeholder="请输入"
        name="mz_ph_field"
        v-model="mz_ph_field"
        maxlength="11"
        :rules="formRyles.mobile"
      ></van-field>
      <div style="margin: 16px;">
        <van-button
          round
          block
          type="info"
          native-type="submit"
          @click="goVanFieldControl()"
          >提交</van-button
        >
      </div>
    </van-form>
  </div>
</template>

<script>
import Vue from "vue";
import { Tab, Tabs, Toast } from "vant";
import { Form } from "vant";
import { Field } from "vant";
import { getQuestions,sendZYData } from "@/request/api";

export default {
  name: "myd_mz.vue",
  data() {
    return {
      questions: [],

      check_jqmz: [],

      mz_radio_sf: "",
      mz_radio_fylb: "",

      mz_radio_kbyy: "",
      mz_radio_jyjyfw: "",
      mz_radio_ydryfw: "",
      mz_radio_ghsfryfw: "",
      mz_radio_jzyswf: "",
      mz_radio_jzhsfw: "",
      mz_radio_bcfw: "",
      mz_radio_ctfw: "",
      mz_radio_jyfw: "",
      mz_radio_yjfw: "",
      mz_radio_tjryfw: "",
      mz_radio_ycxjjxq: "",
      mz_radio_bhysqk: "",
      mz_radio_yymzxq: "",
      mz_radio_jyzybs: "",
      mz_radio_mzhjtj: "",

      mz_sf_field: "",
      mz_kbyy_field: "",
      mz_jy_field: "",
      mz_xm_field: "",
      mz_ph_field: "",
      mz_jqmz_field: "",

      mz_sf_field_show: false,
      mz_kbyy_field_show: false,
      mz_jqmz_field_show: false,

      formRyles: {
        mobile: [
          { required: true, message: "请填正确的手机号" },
          {
            pattern: /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/,
            message: "手机格式错误",
          },
        ],
        rulesRadio: [{ required: true, message: "请选择选项" }],
        rulesField: [{ required: true, message: "请输入内容" }],
      },
    };
  },
  created() {
    let params = {
      type_id: "102",
    };

    getQuestions(params).then((res) => {
      if (res.code === 200) {
        this.questions = res.data;
      } else {
        Toast(res.message);
      }
    });
  },
  methods: {
    //定位未填写的必填项第一项
    goVanFieldControl() {
      //延迟获取error标签数据组，放外面会导致获取过快导致null
      setTimeout(() => {
        let isError = document.getElementsByClassName("van-field--error"); // 获取错误内容标签
        if (isError.length !== 0) {
          isError[0].scrollIntoView({
            behavior: "smooth",
            block: "start",
            inline: "start",
          }); // 只定位到第一个必填项位置
        }
      }, 500);
    },
    mz_radio_sf_change(val) {
      if (val !== "11") {
        this.mz_sf_field_show = false;
        this.mz_sf_field = "";
      } else {
        this.mz_sf_field_show = true;
      }
    },
    mz_radio_kbyy_change(val) {
      if (val !== "9") {
        this.mz_kbyy_field_show = false;
        this.mz_kbyy_field = "";
      } else {
        this.mz_kbyy_field_show = true;
      }
    },
    check_jqmz_change(val) {
      if (!val.includes("7")) {
        this.mz_jqmz_field_show = false;
        this.mz_jqmz_field = "";
      } else {
        this.mz_jqmz_field_show = true;
      }
    },
    postFrom(value) {
      let formData = [];
      let i = 102001;

      for (var val in value) {
        var newData = this.questions.find(
          (item) => item.question_id + "" === i + ""
        );
        if (
          newData.question_content !== undefined &&
          newData.question_content !== ""
        ) {
          var str = newData.question_content;
          var jsonObj = JSON.parse(str.trim());
        }
        if (val === "mz_radio_sf" && value[val] === "11") {
          let data = {
            question_id: i + "",
            question_title: jsonObj["11"],
            question_answer: "11",
            question_comment: value["mz_sf_field"],
            type_id: "102",
            question_type: "01",
            tenant_id: "1",
            deleted: "0",
            updater: localStorage.getItem("userid"),
            username: value["mz_xm_field"],
            usertel: value["mz_ph_field"],
          };

          formData.push(data);
          i++;
        } else if (val === "mz_sf_field") {
          continue;
        } else if (val === "mz_radio_kbyy" && value[val] === "9") {
          let data = {
            question_id: i + "",
            question_title: jsonObj["9"],
            question_answer: "9",
            question_comment: value["mz_kbyy_field"],
            type_id: "102",
            question_type: "01",
            tenant_id: "1",
            deleted: "0",
            updater: localStorage.getItem("userid"),
            username: value["mz_xm_field"],
            usertel: value["mz_ph_field"],
          };
          formData.push(data);
          i++;
        } else if (val === "mz_kbyy_field") {
          continue;
        } else if (val === "check_jqmz" && value[val].includes("7")) {
          let obj = [];
          let tem = value[val];
          for (var v in tem) {
            obj.push(jsonObj[tem[v]]);
          }
          let data = {
            question_id: i + "",
            question_title: obj.toString(),
            question_answer: value[val].toString(),
            question_comment: value["mz_jqmz_field"],
            type_id: "102",
            question_type: "02",
            tenant_id: "1",
            deleted: "0",
            updater: localStorage.getItem("userid"),
            username: value["mz_xm_field"],
            usertel: value["mz_ph_field"],
          };
          formData.push(data);
          i++;
        } else if (val === "check_jqmz" && !value[val].includes("7")) {
          let obj = [];
          let tem = value[val];
          for (var v in tem) {
            obj.push(jsonObj[tem[v]]);
          }
          let data = {
            question_id: i + "",
            question_title: obj.toString(),
            question_answer: value[val].toString(),
            type_id: "102",
            question_type: "02",
            tenant_id: "1",
            deleted: "0",
            updater: localStorage.getItem("userid"),
            username: value["mz_xm_field"],
            usertel: value["mz_ph_field"],
          };
          formData.push(data);
          i++;
        } else if (val === "mz_jqmz_field") {
          continue;
        } else if (val === "mz_jy_field") {
          let data = {
            question_id: i + "",
            question_title: value["mz_jy_field"],
            question_answer: value["mz_jy_field"],
            type_id: "102",
            question_type: "01",
            tenant_id: "1",
            deleted: "0",
            updater: localStorage.getItem("userid"),
            username: value["mz_xm_field"],
            usertel: value["mz_ph_field"],
          };
          formData.push(data);
          i++;
        } else if (val === "mz_ph_field") {
          continue;
        } else if (val === "mz_xm_field") {
          continue;
        } else {
          let data = {
            question_id: i + "",
            question_title: jsonObj[value[val]],
            question_answer: value[val],
            type_id: "102",
            question_type: "01",
            tenant_id: "1",
            deleted: "0",
            updater: localStorage.getItem("userid"),
            username: value["mz_xm_field"],
            usertel: value["mz_ph_field"],
          };
          formData.push(data);
          i++;
        }
      }

      console.log(value); //连接后端接口，发送数据
      sendZYData(formData).then((res) => {
        if (res.code === 200) {
          Toast(res.message);
          this.$router.push({ path: "/Succ" });
        }
      });
    },
  },
};
</script>

<style scoped>
.radio_dx {
  margin: 0.2rem 0.2rem 0.2rem 0.2rem;
  width: 100%;
}

p {
  background-color: #e5f4fb;
  padding: 0.3rem 0.3rem 0.3rem 0.3rem;
  font-size: large;
  color: #333333;
}

p label {
  color: red;
}
</style>
