<template>
  <div class="content">
    <el-form ref="elForm" :model="formData" size="mini" label-width="100px">
      <div class="tit">个人信息</div>

      <el-col>
        <el-row>
          <el-col :span="8">
            <el-form-item label="姓名" prop="name">
              <el-input
                v-model="formData.name"
                placeholder="请输入姓名"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="电话" prop="phone">
              <el-input
                v-model="formData.phone"
                placeholder="请输入电话"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="6">
            <el-form-item label="住址" prop="address">
              <el-input
                v-model="formData.address"
                placeholder="请输入家庭住址"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col> -->
          <el-col :span="8">
            <el-form-item label="所属成员" prop="field104">
              <el-input
                v-model="formData.field104"
                placeholder="请输入所属成员"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="省" prop="province" style="flex: 1">
            <el-select
              :disabled="isCheck"
              v-model="formData.province"
              placeholder="请选择省"
              clearable
              @change="province_change"
              :style="{ width: '100%' }"
            >
              <el-option
                v-for="(item, index) in datas.provinceOptions"
                :key="index"
                :label="item.province_name"
                :value="item.province_code"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="市" prop="city" style="flex: 1">
            <el-select
              :disabled="isCheck"
              v-model="formData.city"
              placeholder="请选择市"
              clearable
              @change="city_change"
              :style="{ width: '100%' }"
            >
              <el-option
                v-for="(item, index) in datas.cityOptions"
                :key="index"
                :label="item.city_name"
                :value="item.city_code"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="区" prop="area" style="flex: 1">
            <el-select
              :disabled="isCheck"
              v-model="formData.area"
              placeholder="请选择区"
              clearable
              @change="area_change"
              :style="{ width: '100%' }"
            >
              <el-option
                v-for="(item, index) in datas.areaOptions"
                :key="index"
                :label="item.area_name"
                :value="item.area_code"
              ></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="镇" prop="street" style="flex: 1">
            <el-select
              :disabled="isCheck"
              v-model="formData.street"
              placeholder="请选择镇"
              clearable
              @change="street_change"
              :style="{ width: '100%' }"
            >
              <el-option
                v-for="(item, index) in datas.streetOptions"
                :key="index"
                :label="item.street_name"
                :value="item.street_code"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="村社小队" prop="address" style="flex: 1.5">
            <el-input
              :disabled="isCheck"
              v-model="formData.address"
              placeholder="请输入村社小队"
              clearable
              :style="{ width: '100%' }"
            ></el-input>
          </el-form-item>
        </el-row>
      </el-col>

      <p class="tit">常住人口</p>
      <el-col>
        <div v-for="(item, index) in formData.family" :key="index">
          <el-row>
            <el-col :span="6">
              <el-form-item label="姓名" prop="name">
                <el-input
                  v-model="item.name"
                  placeholder="请输入姓名"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6" class="dates">
              <el-form-item label="出生日期" prop="field110">
                <el-date-picker
                  :disabled="true"
                  v-model="item.birth_time"
                  style="width: 14vw"
                  placeholder="请输入出生日期"
                  clearable
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="就业情况" prop="field111">
                <el-select
                  :disabled="true"
                  v-model="item.work"
                  placeholder="请输入就业情况"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <el-option
                    v-for="(items, indexs) in workLists"
                    :key="indexs"
                    :label="items.name"
                    :value="items.id"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="电话" prop="field140">
                <el-input
                  v-model="item.phone"
                  :disabled="true"
                  placeholder="请输入电话"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="技能特长" prop="field119">
                <el-input
                  v-model="item.skills"
                  placeholder="请输入技能特长"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>

        <el-form-item label-width="150px" label="是否有婴幼儿">
          <el-switch v-model="formData.child"></el-switch>
        </el-form-item>
        <p style="padding: 0 0 20px 10px">
          <el-button type="primary" size="medium" @click="addFamilyMember">
            添加家庭成员
          </el-button>
          &nbsp;
          <el-button
            v-if="formData.child"
            type="primary"
            @click="addKids"
            size="medium"
          >
            添加婴幼儿
          </el-button>
        </p>
      </el-col>
      <div v-for="(item, index) in formData.child_arr" v-if="formData.child">
        <el-col>
          <el-row>
            <el-col :span="6">
              <el-form-item label="儿子姓名" prop="field125">
                <el-input
                  v-model="item.name"
                  placeholder="请输入儿子姓名"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="年龄" prop="field133" class="dates">
                <el-date-picker
                  v-model="item.birth"
                  :style="{ width: '100%' }"
                  placeholder="请选择出生日期"
                  clearable
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="年领" prop="field134">
                <el-input
                  v-model="item.age"
                  clearable
                  :disabled="true"
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>

            <el-col :span="4" v-if="formData.child_arr[index].age < 3">
              <el-form-item label-width="4vw" label="" prop="field156">
                <el-radio-group v-model="item.feeding" size="medium">
                  <el-radio
                    v-for="(items, indexs) in datas.feedsList"
                    :key="index"
                    :label="items.value"
                    >{{ items.label }}</el-radio
                  >
                </el-radio-group>
              </el-form-item>
            </el-col>

            <el-col :span="6" v-if="formData.child_arr[index].age >= 3">
              <el-form-item label="年纪" prop="field141">
                <el-input
                  v-model="item.grade"
                  placeholder="请输入年纪"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row v-if="formData.child_arr[index].age >= 3">
            <el-col :span="12">
              <el-form-item label="补课情况" prop="field135">
                <el-checkbox-group v-model="item.lessons" size="medium">
                  <el-checkbox
                    v-for="(items, indexs) in datas.subjs"
                    :key="indexs"
                    :label="items.value"
                    >{{ items.label }}</el-checkbox
                  >
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="备注" prop="field138">
                <el-input
                  v-model="item.notes"
                  placeholder="请输入备注"
                  clearable
                  type="textarea"
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>

        <el-col v-if="formData.child_arr[index].age < 3">
          <el-row>
            <el-col :span="24">
              <el-form-item label="备注" prop="field157">
                <el-input
                  v-model="item.notes"
                  placeholder="请输入备注"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
      </div>

      <p class="tit">家庭情况</p>
      <el-col>
        <el-row>
          <el-col :span="8">
            <el-form-item
              label="汽车是否能到家"
              prop="field162"
              label-width="200px"
            >
              <el-switch v-model="formData.highway"></el-switch>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item
              label="是否使用智能手机"
              prop="smart_phone"
              label-width="200px"
            >
              <el-switch v-model="formData.smart_phone"></el-switch>
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="formData.smart_phone">
            <el-form-item
              label="请留下您的微信号"
              label-width="200px"
              prop="field164"
            >
              <el-input
                v-model="formData.wechat"
                placeholder="请请留下您的微信号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>
      <p class="tit">养殖信息</p>

      <el-col>
        <el-row>
          <el-col :span="8">
            <el-form-item label="耕地总面积" prop="field166">
              <el-input
                v-model="formData.cultivated_area"
                placeholder="请输入耕地总面积"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="10">
            <el-form-item label="土地规划" prop="field167">
              <el-checkbox-group v-model="formData.planning" size="medium">
                <el-checkbox
                  v-for="(item, index) in datas.plantList"
                  :key="index"
                  :label="item.value"
                  >{{ item.label }}</el-checkbox
                >
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="有无种培训/注册成立公司经历"
              prop="field168"
              label-width="230px"
            >
              <el-switch v-model="formData.breeding_training"></el-switch>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>

      <el-col :span="24" v-if="formData.breeding_training">
        <el-form-item label="备注" prop="field169">
          <el-input
            v-model="formData.notes"
            placeholder="请输入备注"
            clearable
            :style="{ width: '100%' }"
          >
          </el-input>
        </el-form-item>
      </el-col>

      <p class="tit">土地具体信息</p>
      <div v-for="(item, index) in formData.farmland">
        <el-col>
          <el-row>
            <el-col :span="6">
              <el-form-item label="种养殖类别" prop="field171">
                <el-input
                  v-model="item.breeding_time"
                  placeholder="如  土豆"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="种养殖面积" prop="field172">
                <el-input
                  v-model="item.area"
                  placeholder="请输入面积"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="种植开始时" prop="field173" class="dates">
                <el-date-picker
                  v-model="item.breeding_time"
                  :style="{ width: '100%' }"
                  placeholder="请选择种植开始时"
                  clearable
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="上市时间" prop="field174" class="dates">
                <el-date-picker
                  v-model="item.mature_time"
                  :style="{ width: '100%' }"
                  placeholder="请选择上市时间"
                  clearable
                ></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row
            ><el-col :span="8">
              <el-form-item label="产量" prop="field175">
                <el-input
                  v-model="item.yield"
                  placeholder="请输入产量"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="农资农具使用情况"
                label-width="150px"
                prop="field176"
              >
                <el-input
                  v-model="item.farm_tools"
                  placeholder="请输入农资农具使用情况"
                  clearable
                  :style="{ width: '100%' }"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="预售卖价格" prop="field177">
                <el-input
                  v-model="item.pre_price"
                  placeholder="请输入预售卖价格"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item> </el-col
          ></el-row>
        </el-col>

        <el-col>
          <el-row>
            <el-col :span="6">
              <el-form-item label="销售方式" prop="field180">
                <el-checkbox-group v-model="item.method_sales" size="medium">
                  <el-checkbox
                    v-for="(items, indexs) in datas.sellType"
                    :key="indexs"
                    :label="items.value"
                    >{{ items.label }}</el-checkbox
                  >
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label-width="100px" prop="field179">
                <el-radio-group v-model="item.ecological_farming" size="medium">
                  <el-radio label="1">是否生态种植</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>

            <el-col :span="4">
              <el-form-item label-width="100px" prop="field182">
                <el-radio-group v-model="item.promote" size="medium">
                  <el-radio label="1">有无宣传推广</el-radio>

                  >
                </el-radio-group>
              </el-form-item>
            </el-col>

            <el-col :span="4">
              <el-form-item label-width="100px" prop="field181">
                <el-radio-group v-model="item.processing_storage" size="medium">
                  <el-radio label="1">有无加工仓储</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label-width="100px" prop="field183">
                <el-radio-group v-model="item.transportation" size="medium">
                  <el-radio label="1">有无运输</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
      </div>
      <p style="padding: 0 0 20px 10px">
        <el-button type="primary" size="medium" @click="addLand">
          添加土地信息
        </el-button>
      </p>
      <el-col>
        <el-row>
          <el-col :span="8">
            <el-form-item label="种植诉求" prop="field189">
              <el-input
                v-model="formData.demand"
                placeholder="请输入种植诉求"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="政策补助" prop="field190">
              <el-input
                v-model="formData.policy_subsidies"
                placeholder="请输入政策补助"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label-width="4vw" prop="field188">
              <el-radio-group
                v-model="formData.expand_business_needs"
                size="medium"
              >
                <el-radio
                  v-for="(item, index) in field188Options"
                  :key="index"
                  :label="item.value"
                  >{{ item.label }}</el-radio
                >
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>
      <p class="tit">
        更新时间 <span style="font-size: 14px">2022年12月30日</span>
      </p>
      <div
        v-for="(item, index) in formData.housingDecoration"
        v-if="formData.housingDecoration[0]?.field101"
        :key="index"
      >
        <el-col>
          <el-row>
            <el-col :span="4">
              <el-form-item label-width="100px" prop="field101">
                <el-radio-group v-model="item.field101" size="medium">
                  <el-radio :label="1">修房</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label-width="100px" prop="field102">
                <el-radio-group v-model="item.field102" size="medium">
                  <el-radio label="1">自建</el-radio>
                  <el-radio label="2">外包</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="建设面积" prop="field103">
                <el-input
                  v-model="item.field103"
                  placeholder="请输入建设面积"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="房屋风格" prop="field104">
                <el-select
                  :disabled="isCheck"
                  v-model="formData.province"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <el-option
                    v-for="(item, index) in datas.houseStyle"
                    :key="index"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="修建地址" prop="field105">
                <el-input
                  v-model="item.field105"
                  placeholder="请输入修建地址"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="预算" prop="field106">
                <el-input
                  v-model="item.field106"
                  placeholder="请输入预算"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="2">
              <el-form-item label-width="50px" prop="field108">
                <el-radio-group v-model="item.field102" size="medium">
                  <el-radio label="1">绿化</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="3">
              <el-form-item label-width="100px" prop="field109">
                <el-radio-group v-model="item.field102" size="medium">
                  <el-radio label="1">装修</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="3">
              <el-form-item label-width="0" prop="field110">
                <el-radio-group v-model="item.field102" size="medium">
                  <el-radio :label="1">私人建设</el-radio>
                  <el-radio :label="2">公共建设</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-row>
            <el-col :span="8">
              <el-form-item
                label="建筑、在建土地"
                label-width="150px"
                prop="field113"
              >
                <img
                  src="https://img0.baidu.com/it/u=1617940732,1879989235&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
                  alt="图片加载失败"
                  style="width: 200px"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-button
                type="primary"
                size="medium"
                style="position: absolute; bottom: 2vh"
              >
                分析该信息
              </el-button>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-form-item label="分析结论" prop="field114">
            <el-input
              v-model="item.field114"
              placeholder="请输入分析结论"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 分割线 -->
        <div style="box-sizing: border-box; padding: 0 2vw">
          <p
            style="
              border: 1px solid #bfbfbf;
              margin-bottom: 6px;
              text-align: center;
            "
          ></p>
        </div>
      </div>
      <div
        v-for="(item, index) in formData.housingDecoration"
        v-if="formData.housingDecoration[0]?.field101"
        :key="index"
      >
        <el-col>
          <el-row>
            <el-col :span="8">
              <el-form-item label-width="100px" prop="field101">
                <el-radio-group v-model="item.field101" size="medium">
                  <el-radio :label="1">装房</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="房屋面积" prop="field103">
                <el-input
                  v-model="item.field103"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="房屋风格" prop="field104">
                <el-select
                  :disabled="isCheck"
                  v-model="formData.province"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <el-option
                    v-for="(item, index) in datas.houseStyle"
                    :key="index"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="地点" prop="field105">
                <el-input
                  v-model="item.field105"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label-width="100px" prop="field110">
                <el-radio-group v-model="item.field102" size="medium">
                  <el-radio :label="1">私人建设</el-radio>
                  <el-radio :label="2">公共建设</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="预算" prop="field103">
                <el-input
                  v-model="item.field103"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <!-- 分割线 -->
        <div style="box-sizing: border-box; padding: 0 2vw">
          <p
            style="
              border: 1px solid #bfbfbf;
              margin-bottom: 6px;
              text-align: center;
            "
          ></p>
        </div>
      </div>
      <!-- <el-col :span="24">
        <el-form-item label-width="100px" prop="field115">
          <el-button type="primary" size="medium" @click="addDecoration">
            添加分析
          </el-button>
        </el-form-item>
      </el-col> -->

      <el-col v-if="formData.fanxin">
        <el-row>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field101">
              <el-radio-group v-model="formData.fanxin" size="medium">
                <el-radio :label="1">翻新</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="维护内容" prop="field102">
              <el-select
                v-model="formData.field102"
                placeholder="请选择维护内容"
                clearable
                :style="{ width: '100%' }"
              >
                <el-option
                  v-for="(item, index) in datas.weihu"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field103">
              <el-radio-group v-model="formData.field103" size="medium">
                <el-radio label="1">换房</el-radio>
                <el-radio label="2">修房</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <div style="box-sizing: border-box; padding: 0 2vw">
          <p
            style="
              border: 1px solid #bfbfbf;
              margin-bottom: 6px;
              text-align: center;
            "
          ></p>
        </div>
      </el-col>

      <!-- 买卖房屋 -->
      <el-col v-if="formData.sellhouse">
        <el-row>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field104">
              <el-radio-group v-model="formData.sellhouse" size="medium">
                <el-radio :label="1">买房</el-radio>
                <el-radio :label="2">卖房</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="9">
            <el-form-item label="位置" prop="field105">
              <el-input
                v-model="formData.field105"
                placeholder="请输入位置"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="9">
            <el-form-item label="房型" prop="field106">
              <el-select
                v-model="formData.field106"
                placeholder="请选择房型"
                clearable
                :style="{ width: '100%' }"
              >
                <el-option
                  v-for="(item, index) in datas.houseStyle"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="几房" prop="field107">
              <el-input
                v-model="formData.field107"
                placeholder="请输入几房"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="面积" prop="field108">
              <el-input
                v-model="formData.field108"
                placeholder="请输入面积"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="朝向" prop="field109">
              <el-input
                v-model="formData.field109"
                placeholder="请输入朝向"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="楼层" prop="field110">
              <el-input
                v-model="formData.field110"
                placeholder="请输入楼层"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field111">
              <el-radio-group v-model="formData.field111" size="medium">
                <el-radio label="1">精装</el-radio>
                <el-radio label="2">清水</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="预算" prop="field112">
              <el-input
                v-model="formData.field112"
                placeholder="预算"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field113">
              <el-radio-group v-model="formData.field113" size="medium">
                <el-radio label="1">按揭</el-radio>
                <el-radio label="2">全款</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <div style="box-sizing: border-box; padding: 0 2vw">
          <p
            style="
              border: 1px solid #bfbfbf;
              margin-bottom: 6px;
              text-align: center;
            "
          ></p>
        </div>
      </el-col>

      <el-col :span="24">
        <el-form-item label="分析汇总" prop="field116">
          <el-input
            v-model="formData.field116"
            type="textarea"
            placeholder="请输入分析汇总"
            :autosize="{ minRows: 4, maxRows: 4 }"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-col>
      <p style="text-align: center">
        <el-button type="primary" size="medium" @click="addDecoration">
          确认发送
        </el-button>
      </p>
      <p class="tit">
        历史信息 <span style="font-size: 14px">2022年12月30日</span>
      </p>
      <div v-for="(item, index) in formData.historyDecoration" :key="index">
        <el-col>
          <el-row>
            <el-col :span="4">
              <el-form-item label-width="100px" prop="field101">
                <el-radio-group v-model="item.field101" size="medium">
                  <el-radio :label="1">修房</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label-width="100px" prop="field102">
                <el-radio-group v-model="item.field102" size="medium">
                  <el-radio :label="1">自建</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="建设面积" prop="field103">
                <el-input
                  v-model="item.field103"
                  placeholder="请输入建设面积"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="房屋风格" prop="field104">
                <el-input
                  v-model="item.field104"
                  placeholder="请输入房屋风格"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="修建地址" prop="field105">
                <el-input
                  v-model="item.field105"
                  placeholder="请输入修建地址"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="预算" prop="field106">
                <el-input
                  v-model="item.field106"
                  placeholder="请输入预算"
                  clearable
                  :style="{ width: '100%' }"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="2">
              <el-form-item label-width="50px" prop="field108">
                <el-checkbox-group v-model="item.field108" size="medium">
                  <el-checkbox :label="1">无绿化</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :span="3">
              <el-form-item label-width="100px" prop="field109">
                <el-checkbox-group v-model="item.field109" size="medium">
                  <el-checkbox :label="1">有装修</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :span="3">
              <el-form-item label-width="0" prop="field110">
                <el-radio-group v-model="item.field102" size="medium">
                  <el-radio :label="1">私人建设</el-radio>
                  <el-radio :label="2">公共建设</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-row>
            <el-col :span="8">
              <el-form-item
                label="建筑、在建土地"
                label-width="150px"
                prop="field113"
              >
                <img
                  src="https://img0.baidu.com/it/u=1617940732,1879989235&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
                  alt="图片加载失败"
                  style="width: 200px"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-form-item label="分析结论" prop="field114">
            <el-input
              v-model="item.field114"
              placeholder="请输入分析结论"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </div>

      <el-col :span="24">
        <el-form-item label="分析汇总" prop="field116">
          <el-input
            v-model="formData.field116"
            type="textarea"
            placeholder="请输入分析汇总"
            :autosize="{ minRows: 4, maxRows: 4 }"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-col>
      <p style="text-align: center">已于2012年12月12日12:12:12发送</p>

      <p class="tit">深/粗加工</p>
      <el-col>
        <el-row>
          <el-col :span="12">
            <el-form-item label-width="100px" prop="field101">
              <el-radio-group v-model="formData.isWorkshop" size="medium">
                <el-radio :label="1">厂房</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="诉求" prop="field116">
              <el-input
                v-model="formData.field116"
                placeholder="请输入诉求"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>
      <el-col v-if="formData.isWorkshop">
        <el-row>
          <el-col :span="6">
            <el-form-item label="经营类型" prop="field117">
              <el-select
                v-model="formData.field117"
                placeholder="请选择经营类型"
                clearable
                :style="{ width: '100%' }"
              >
                <el-option
                  v-for="(item, index) in field117Options"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                  :disabled="item.disabled"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="地点" prop="field118">
              <el-input
                v-model="formData.field118"
                placeholder="请输入地点"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="人数" prop="field121">
              <el-input
                v-model="formData.field121"
                placeholder="请输入人数"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field126">
              <el-radio-group v-model="formData.field126" size="medium">
                <el-radio :label="1">有无食堂</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="原材料来源" prop="field127">
              <el-checkbox-group v-model="formData.field127" size="medium">
                <el-checkbox label="1">本队</el-checkbox>
                <el-checkbox label="2">外面配送</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="请输入自动化办公程度"
              label-width="160px"
              prop="field128"
            >
              <el-input
                v-model="formData.field128"
                placeholder="请输入程度请输入自动化办公程度"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field129">
              <el-radio-group v-model="formData.isbrand" size="medium">
                <el-radio :label="1">有无品牌</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6" v-if="formData.isbrand">
            <el-form-item label="品牌填写" prop="field130">
              <el-input
                v-model="formData.field130"
                placeholder="请输入品牌填写"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field131">
              <el-radio-group v-model="formData.field131" size="medium">
                <el-radio :label="1">有无宣传推广</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field132">
              <el-radio-group v-model="formData.field132" size="medium">
                <el-radio :label="1">有无运输</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field133">
              <el-radio-group v-model="formData.isRecruit" size="medium">
                <el-radio :label="1">有无用工需求</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6" v-if="formData.isRecruit">
            <el-form-item label="需求量填写" prop="field135">
              <el-input
                v-model="formData.field135"
                placeholder="请输入需求量填写"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="formData.isRecruit ? 6 : 12">
            <el-form-item label="存储情况" prop="field136">
              <el-input
                v-model="formData.field136"
                placeholder="请输入存储情况"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>

      <el-col v-else>
        <el-row>
          <el-col :span="formData.isBuildLand ? 6 : 12">
            <el-form-item label-width="100px" prop="field102">
              <el-radio-group v-model="formData.isBuildLand" size="medium">
                <el-radio :label="1">有无建设用地</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6" v-if="formData.isBuildLand">
            <el-form-item label="面积" prop="field104">
              <el-input
                v-model="formData.field104"
                placeholder="请输入面积"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6" v-if="formData.isBuildLand">
            <el-form-item label="经营地点" prop="field107">
              <el-input
                v-model="formData.field107"
                placeholder="请输入经营地点"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="formData.isBuildLand ? 6 : 12">
            <el-form-item label="材料来源" prop="field109">
              <el-checkbox-group v-model="formData.field109" size="medium">
                <el-checkbox label="1">本队</el-checkbox>
                <el-checkbox label="2">外面配送</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field110">
              <el-radio-group v-model="formData.field110" size="medium">
                <el-radio :label="1">有无销售渠道</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field111">
              <el-radio-group v-model="formData.field111" size="medium">
                <el-radio :label="1">有无技术指导</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field112">
              <el-radio-group v-model="formData.isbrand" size="medium">
                <el-radio :label="1">有无品牌</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4" v-if="formData.isbrand">
            <el-form-item label="品牌" prop="field113">
              <el-input
                v-model="formData.field113"
                placeholder="请输入品牌"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field114">
              <el-radio-group v-model="formData.field114" size="medium">
                <el-radio :label="1">有无宣传推广</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field115">
              <el-radio-group v-model="formData.field115" size="medium">
                <el-radio :label="1">有无运输</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>

      <p class="tit">开设店铺</p>
      <el-col>
        <el-row>
          <el-col :span="12">
            <el-form-item label-width="100px" prop="field101">
              <el-radio-group v-model="formData.isShop" size="medium">
                <el-radio :label="1">有无门面</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="经营诉求" prop="field102">
              <el-input
                v-model="formData.field102"
                placeholder="请输入经营诉求"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="门市面积" prop="field103">
              <el-input
                v-model="formData.field103"
                placeholder="请输入门市面积"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="地点" prop="field104">
              <el-input
                v-model="formData.field104"
                placeholder="请输入地点"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="经营类型" prop="field106">
              <el-select
                v-model="formData.field106"
                placeholder="请选择经营类型"
                clearable
                :style="{ width: '100%' }"
              >
                <el-option
                  v-for="(item, index) in datas.field106Options"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="库存情况" prop="field108">
              <el-input
                v-model="formData.field108"
                placeholder="请输入库存情况"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="服务对象" prop="field135">
              <el-checkbox-group v-model="formData.field126" size="medium">
                <el-checkbox
                  v-for="(items, indexs) in datas.field109Options"
                  :key="indexs"
                  :label="items.value"
                  >{{ items.label }}</el-checkbox
                >
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label-width="100px" prop="field115">
              <el-radio-group v-model="formData.field115" size="medium">
                <el-radio :label="1">有无营业执照</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field113">
              <el-radio-group v-model="formData.isStock" size="medium">
                <el-radio :label="1">有无进货渠道</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6" v-if="formData.isStock">
            <el-form-item label="进货渠道" prop="field114">
              <el-input
                v-model="formData.field114"
                placeholder="请输入进货渠道"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field115">
              <el-radio-group v-model="formData.isOnline" size="medium">
                <el-radio :label="1">有无线上展示</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6" v-if="formData.isOnline">
            <el-form-item label="线上平台" prop="field116">
              <el-input
                v-model="formData.field116"
                placeholder="请输入线上平台"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>
      <p class="tit">宴席</p>
      <el-col>
        <el-row>
          <el-col :span="20">
            <el-form-item label="类型" prop="field101a">
              <el-checkbox-group
                v-model="formData.banquetList"
                @change="test"
                size="medium"
              >
                <el-checkbox
                  v-for="(item, index) in datas.banquetList"
                  :key="index"
                  :label="item.value"
                  >{{ item.label }}</el-checkbox
                >
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item
              label-width="0"
              prop="field102a"
              v-if="formData.banquetList.includes(5)"
            >
              <el-radio-group v-model="formData.field102a" size="medium">
                <el-radio :label="1">有无墓地</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="时间" prop="field103a">
              <el-input
                v-model="formData.field103a"
                placeholder="请输入时间"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="地点" prop="field104a">
              <el-input
                v-model="formData.field104a"
                placeholder="请输入地点"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="人物" prop="field105a">
              <el-input
                v-model="formData.field105a"
                placeholder="请输入人物"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label-width="100px" prop="field106a">
              <el-radio-group v-model="formData.field106a" size="medium">
                <el-radio
                  v-for="(item, index) in datas.field106aOptions"
                  :key="index"
                  :label="item.value"
                  >{{ item.label }}</el-radio
                >
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="0" prop="field107a">
              <el-radio-group v-model="formData.field107a" size="medium">
                <el-radio :label="1">有无歌舞演绎</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="0" prop="field108a">
              <el-radio-group v-model="formData.field108a" size="medium">
                <el-radio :label="1">有无交通工具</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label-width="0" prop="field109a">
              <el-radio-group v-model="formData.field109a" size="medium">
                <el-radio :label="1">有无住宿</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>

      <p class="tit">日常生活采购</p>
      <el-col>
        <el-row>
          <el-col :span="8">
            <el-form-item label="交通工具" prop="field104">
              <el-radio-group v-model="formData.field104" size="medium">
                <el-radio
                  v-for="(item, index) in datas.field104Options"
                  :key="index"
                  :label="item.value"
                  >{{ item.label }}</el-radio
                >
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item
              label-width="150px"
              label="生活用品消费金额"
              prop="field105"
            >
              <el-input
                v-model="formData.field105"
                placeholder="请输入生活用品消费金额"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="常用品类" prop="field106">
              <el-input
                v-model="formData.field106"
                placeholder="请输入常用品类"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label-width="100px" prop="field101">
              <el-radio-group v-model="formData.isSmoke" size="medium">
                <el-radio :label="1">是否抽烟喝酒</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="formData.isSmoke">
            <el-form-item label="品牌" prop="field102">
              <el-input
                v-model="formData.field102"
                placeholder="请输入品牌"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="水电气话费" prop="field103">
              <el-input
                v-model="formData.field103"
                placeholder="请输入水电气话费"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>

      <p class="tit">公益</p>
      <el-col>
        <el-row>
          <el-col :span="4">
            <el-form-item label-width="100px" prop="field107">
              <el-radio-group v-model="formData.isWelfare" size="medium">
                <el-radio :label="1">有无公益拍卖品牌</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item
              label-width="150px"
              label="可提供的拍卖产品"
              prop="field109"
              v-if="formData.isWelfare"
            >
              <el-input
                v-model="formData.field109"
                placeholder="请输入可提供的拍卖产品"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label-width="100px" prop="field110">
              <el-radio-group v-model="formData.isNeedWelfare" size="medium">
                <el-radio :label="1">有无需求的工艺产品或服务</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item
              label-width="150px"
              label="想要的商品/服务"
              prop="field111"
              v-if="formData.isNeedWelfare"
            >
              <el-input
                v-model="formData.field111"
                placeholder="请输入想要的商品/服务"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>

      <p class="tit">家庭情况说明</p>

      <el-col :span="24">
        <el-form-item label="家庭情况说明" prop="field113">
          <el-input
            v-model="formData.familySituation"
            type="textarea"
            placeholder="请输入家庭情况说明"
            :autosize="{ minRows: 4, maxRows: 4 }"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-col>
      <p class="tit">家庭总诉求</p>

      <el-col :span="24">
        <el-form-item label="家庭总诉求" prop="field114">
          <el-input
            v-model="formData.familyAppeal"
            type="textarea"
            placeholder="请输入家庭总诉求"
            :autosize="{ minRows: 4, maxRows: 4 }"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-col>

      <el-col :span="24">
        <el-form-item size="large">
          <el-button type="primary" @click="submitForm">提交</el-button>
          <el-button @click="resetForm">重置</el-button>
        </el-form-item>
      </el-col>
    </el-form>
  </div>
</template>
<script lang="ts" setup name="test">
import { ref, reactive } from "vue";
import {
  apiCityList,
  apiAreaList,
  apiStreetList,
  apiProvinceList,
} from "@/api/common";
const formData = reactive({
  name: undefined,
  phone: "",
  age: "",
  //   province_id: "",
  //   area_id: "",
  //   street_id: "",
  //   village_id: "",
  //   brigade_id: "",
  province: "",
  city: "",
  area: "",
  street: "",
  address: "详细地址",
  //   常住人口
  family: [{ name: "", birth_time: "", work: "", phone: "", skills: "" }],
  child: undefined,
  child_arr: [
    {
      name: "",
      birth: "",
      age: 0,
      class: "",
      lessons: [],
      notes: "",
      feeding: "",
    },
  ],
  highway: undefined,
  smart_phone: undefined,
  wechat: "",
  cultivated_area: "",
  planning: "",
  planting_company: "",
  notes: "",
  breeding_training: undefined,
  farmland: [
    {
      breeding_type: "",
      area: "",
      breeding_time: "",
      mature_time: "",
      yield: "",
      ecological_farming: "",
      farm_tools: "",
      pre_price: "",
      method_sales: [],
      processing_storage: "",
      promote: "",
      expand_business_needs: 0, //是否有扩大经营需求
      demand: "没有述求", //种养殖述求
      policy_subsidies: "无补助", //政策补助
    },
  ],
  expand_business_needs: "",
  demand: "",
  //   sadsadas
  //   住房装修
  housingDecoration: [
    {
      field101: 1,
      field102: [],
      field103: undefined,
      field104: undefined,
      field105: undefined,
      field106: undefined,
      field108: [],
      field109: [],
      field110: [],
      field113: null,
      field114: undefined,
      field115: undefined,
      field116: undefined,
    },
  ],
  // 买卖房
  sellhouse: 1,
  // 翻新
  fanxin: 1,
  historyDecoration: [
    {
      field101: undefined,
      field102: [],
      field103: undefined,
      field104: undefined,
      field105: undefined,
      field106: undefined,
      field108: [],
      field109: [],
      field110: [],
      field113: null,
      field114: undefined,
      field115: undefined,
      field116: undefined,
    },
  ],
  //   深粗加工
  //   厂房
  isWorkshop: 0,
  //   建设用地
  isBuildLand: 0,
  //   品牌
  isbrand: 0,
  // 用工需求
  isRecruit: 0,
  field101: 1,
  field116: undefined,
  field102: 1,
  field104: undefined,
  field107: undefined,
  field109: [],
  field110: 1,
  field111: 1,
  field112: undefined,
  field113: undefined,
  field114: 1,
  field115: undefined,
  field117: undefined,
  field118: undefined,
  field121: undefined,
  field126: undefined,
  field127: [],
  field128: undefined,
  field129: 1,
  field130: undefined,
  field131: 1,
  field132: 1,
  field133: 1,
  field135: undefined,
  field136: undefined,
  // 结束
  //   开设店铺
  isShop: 0,
  //有无进货渠道
  isStock: 0,
  //   有无先上展示
  isOnline: 0,
  field103: undefined,
  field106: undefined,
  field108: undefined,
  //   宴席
  //   宴席类型
  banquetList: [],
  field102a: undefined,
  field103a: undefined,
  field104a: undefined,
  field105a: undefined,
  field106a: undefined,
  field107a: "",
  field108a: "",
  field109a: "",
  // 日常生活采购
  isSmoke: 0,
  //   公益
  isWelfare: 0,
  isNeedWelfare: 0,
  //   家庭情况说明
  familySituation: "",
  // 家庭总诉求
  familyAppeal: "",
});

const workLists = reactive([
  { name: "做工地的", id: 1 },
  { name: "厂里打工", id: 2 },
  { name: "公司职员", id: 3 },
  { name: "政府上班", id: 4 },
  { name: "种地", id: 5 },
  { name: "在家赋闲", id: 6 },
  { name: "其他", id: 7 },
]);
const isCheck = ref(false);
const datas = reactive({
  subjs: [
    {
      label: "语文",
      value: 1,
    },
    {
      label: "数学",
      value: 2,
    },
    {
      label: "英语",
      value: 3,
    },
    {
      label: "艺术类",
      value: 4,
    },
    {
      label: "其他",
      value: 5,
    },
  ],
  feedsList: [
    {
      label: "母乳",
      value: 1,
    },
    {
      label: "奶粉",
      value: 2,
    },
  ],
  plantList: [
    {
      label: "自己种",
      value: 1,
    },
    {
      label: "出租",
      value: 2,
    },
    {
      label: "代种养",
      value: "",
    },
    {
      label: "租更多地扩大种植",
      value: "",
    },
  ],
  // 房屋风格
  houseStyle: [
    {
      label: "中式",
      value: 1,
    },
    {
      label: "美式",
      value: 2,
    },
    {
      label: "欧式",
      value: 3,
    },
    {
      label: "简约",
      value: 4,
    },
    {
      label: "奢华",
      value: 5,
    },
    {
      label: "别墅/四合院",
      value: 6,
    },
    {
      label: "其他",
      value: 7,
    },
  ],
  //   维护内容
  weihu: [
    {
      label: "房顶",
      value: 1,
    },
    {
      label: "厕所",
      value: 2,
    },
    {
      label: "管线",
      value: 3,
    },
    {
      label: "电器",
      value: 4,
    },
  ],
  field102Options: [
    {
      label: "别墅",
      value: 1,
    },
    {
      label: "洋房",
      value: 2,
    },
    {
      label: "高层",
      value: 3,
    },
    {
      label: "楼梯房",
      value: 4,
    },
  ],
  //   生态种植
  ecologyPlant: [
    {
      label: "非生态种植",
      value: 1,
    },
  ],
  sellType: [
    {
      label: "自销",
      value: 1,
    },
    {
      label: "定点销售",
      value: 2,
    },
  ],
  // 宣传
  publicize: [
    {
      label: "有无宣传推广",
      value: 1,
    },
  ],
  //经营类型
  field106Options: [
    {
      label: "超市",
      value: 1,
    },
    {
      label: "生鲜",
      value: 2,
    },
    {
      label: "饭店",
      value: 3,
    },
    {
      label: "五金",
      value: 4,
    },
    {
      label: "杂货",
      value: 5,
    },
    {
      label: "服装",
      value: 6,
    },
    {
      label: "文具",
      value: 7,
    },
    {
      label: "其他",
      value: 8,
    },
  ],
  //   服务对象
  field109Options: [
    {
      label: "学生",
      value: 1,
    },
    {
      label: "家庭客户",
      value: 2,
    },
    {
      label: "青年客户",
      value: 3,
    },
    {
      label: "老年人",
      value: 4,
    },
    {
      label: "游客",
      value: 5,
    },
  ],
  //   宴席类型
  banquetList: [
    {
      label: "婚宴",
      value: 1,
    },
    {
      label: "寿宴",
      value: 2,
    },
    {
      label: "满月酒",
      value: 3,
    },
    {
      label: "其它庆功宴",
      value: 4,
    },
    {
      label: "白事",
      value: 5,
    },
  ],
  //
  field106aOptions: [
    {
      label: "酒店",
      value: 1,
    },
    {
      label: "一条龙",
      value: 2,
    },
    {
      label: "只请厨师",
      value: 3,
    },
  ],
  //   交通工具
  field104Options: [
    {
      label: "电瓶车",
      value: 1,
    },
    {
      label: "摩托车",
      value: 2,
    },
    {
      label: "小汽车",
      value: 3,
    },
  ],
  provinceOptions: [],
  cityOptions: [],
  areaOptions: [],
  streetOptions: [],
});
const test = () => {
  console.log(formData.banquetList);
};
const field181Options = reactive([
  {
    label: "有加工仓储",
    value: 1,
  },
]);
const field183Options = reactive([
  {
    label: "有运输",
    value: 1,
  },
]);
const field188Options = reactive([
  {
    label: "是否想要扩大经营",
    value: 1,
  },
]);
const addFamilyMember = () => {
  formData.family.push({
    name: "",
    birth_time: "",
    work: "",
    phone: "",
    skills: "",
  });
};
const addKids = () => {
  formData.child_arr.push({
    name: "",
    birth: "",
    age: 0,
    class: "",
    lessons: [],
    notes: "",
    feeding: "",
  });
};
const addLand = () => {
  formData.farmland.push({
    breeding_type: "",
    cultivated_area: "",
    breeding_time: "",
    mature_time: "",
    yield: "",
    ecological_farming: "",
    farm_tools: "",
    pre_price: "",
    method_sales: [],
    processing_storage: "",
    promote: "",
    transportation: "",
    notes: "",
  });
};
// const addDecoration = () => {
//   formData.housingDecoration.push({
//     field102: [],
//     field103: undefined,
//     field104: undefined,
//     field105: undefined,
//     field106: undefined,
//     field108: [],
//     field109: [],
//     field110: [],
//     field113: null,
//     field114: undefined,
//     field115: undefined,
//     field116: undefined,
//   });
// };
const submitForm = () => {
  console.log(formData);
  //   this.$refs["elForm"].validate((valid) => {
  //     if (!valid) return;
  //     // TODO 提交表单
  //   });
};
const resetForm = () => {
  //   this.$refs["elForm"].resetFields();
};
// 计算年龄
const getAge = (i: number) => {
  let curDate = formData.child_arr[i].birth;
  var val =
    curDate.getFullYear() +
    "-" +
    (curDate.getMonth() + 1) +
    "-" +
    curDate.getDate();
  let currentYear = new Date().getFullYear(); //当前的年份
  let calculationYear = new Date(val).getFullYear(); //计算的年份
  const wholeTime = currentYear + val.substring(4); //周岁时间
  const calculationAge = currentYear - calculationYear; //按照年份计算的年龄
  //判断是否过了生日
  if (new Date().getTime() > new Date(wholeTime).getTime()) {
    formData.child_arr[i].age = calculationAge;
  } else {
    formData.child_arr[i].age = calculationAge - 1;
  }
};
//获取省份
function province_change(value: string) {
  getCityList();
}
function city_change(value: string) {
  getAreaList();
}
function area_change(value: string) {
  getStreetList();
}
function street_change(value: string) {
  formData.street = value;
}
const getProvinceList = async () => {
  const data = await apiProvinceList({});
  datas["provinceOptions"] = data;
};
const getCityList = async () => {
  const data = await apiCityList({ city: formData.province });
  datas["cityOptions"] = data;
};
const getAreaList = async () => {
  const data = await apiAreaList({ area: formData.city });
  datas["areaOptions"] = data;
};
const getStreetList = async () => {
  const data = await apiStreetList({ street: formData.area });
  datas["streetOptions"] = data;
};
getProvinceList();
</script>
<style lang="scss">
.content {
  background-color: #fff;
}

.tit {
  font-size: 1.2rem;
  margin: 10px 0;
  background-color: #f6f6f6;
}

.dates {
  .el-input__inner {
    width: 14vw;
  }
}
</style>
