<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
      <el-form-item label="所属宠物ID" prop="petId">
        <el-input
          v-model="queryParams.petId"
          placeholder="请输入所属宠物ID"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <template v-if="showMoreCondition">
      <el-form-item label="干粮备注" prop="dryFoodRemarks">
        <el-input
          v-model="queryParams.dryFoodRemarks"
          placeholder="请输入干粮备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="湿粮备注" prop="wetFoodRemarks">
        <el-input
          v-model="queryParams.wetFoodRemarks"
          placeholder="请输入湿粮备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="尿垫备注" prop="peePadRemarks">
        <el-input
          v-model="queryParams.peePadRemarks"
          placeholder="请输入尿垫备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="服务用品摆放备注" prop="additionalServicesRemarks">
        <el-input
          v-model="queryParams.additionalServicesRemarks"
          placeholder="请输入服务用品摆放备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
    </template>
      <el-form-item class="flex_one tr">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button :icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" size="mini" @click="showMoreCondition = !showMoreCondition">{{showMoreCondition ? '收起条件' : '展开条件'}}</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['mall:petCare:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['mall:petCare:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['mall:petCare:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['mall:petCare:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="petCareList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="所属宠物ID" align="center" prop="petId" v-if="columns[0].visible"/>
      <el-table-column label="是否包含干粮" align="center" prop="includeDryFood" v-if="columns[1].visible"/>
      <el-table-column label="干粮摆放位置-图片" align="center" prop="dryFoodLocation" v-if="columns[2].visible">
      <template slot-scope="{ row }">
        <el-image v-if="row.dryFoodLocation" :src="row.dryFoodLocation" :preview-src-list="[row.dryFoodLocation]" class="small-img"/>
      </template>
      </el-table-column>
      <el-table-column label="干粮喂养重量" align="center" prop="dryFoodFeedWeight" v-if="columns[3].visible"/>
      <el-table-column label="干粮喂养批次_天" align="center" prop="dryFoodFeedFrequencyDays" v-if="columns[4].visible"/>
      <el-table-column label="干粮喂养批次_次" align="center" prop="dryFoodFeedFrequencyTimes" v-if="columns[5].visible"/>
       <el-table-column label="干粮备注" align="center" prop="dryFoodRemarks" v-if="columns[6].visible"/>
      <el-table-column label="是否包含湿粮" align="center" prop="includeWetFood" v-if="columns[7].visible"/>
      <el-table-column label="湿粮摆放位置-图片" align="center" prop="wetFoodLocation" v-if="columns[8].visible"/>
      <el-table-column label="湿粮喂养重量" align="center" prop="wetFoodFeedWeight" v-if="columns[9].visible"/>
      <el-table-column label="湿粮喂养批次_天" align="center" prop="wetFoodFeedFrequencyDays" v-if="columns[10].visible"/>
      <el-table-column label="湿粮喂养批次_次" align="center" prop="wetFoodFeedFrequencyTimes" v-if="columns[11].visible"/>
       <el-table-column label="湿粮备注" align="center" prop="wetFoodRemarks" v-if="columns[12].visible"/>
      <el-table-column label="是否包含自制食品" align="center" prop="includeHomemadeFood" v-if="columns[13].visible"/>
      <el-table-column label="自制食品摆放位置-图片" align="center" prop="homemadeFoodLocation" v-if="columns[14].visible"/>
      <el-table-column label="自制饭制作和喂食说明" align="center" prop="homemadeFoodInstructions" v-if="columns[15].visible"/>
      <el-table-column label="是否包含生骨肉" align="center" prop="includeRawMeat" v-if="columns[16].visible"/>
      <el-table-column label="生骨肉摆放位置-图片" align="center" prop="rawMeatLocation" v-if="columns[17].visible"/>
      <el-table-column label="生骨肉喂食说明" align="center" prop="rawMeatFeedingInstructions" v-if="columns[18].visible"/>
      <el-table-column label="是否包含保健品" align="center" prop="includeHealthSupplements" v-if="columns[19].visible"/>
      <el-table-column label="保健品摆放位置-图片" align="center" prop="healthSupplementsLocation" v-if="columns[20].visible"/>
      <el-table-column label="保健品喂养方式说明" align="center" prop="healthSupplementsFeedingInstructions" v-if="columns[21].visible"/>
      <el-table-column label="是否包含零食" align="center" prop="includeSnacks" v-if="columns[22].visible"/>
      <el-table-column label="零食摆放位置-图片" align="center" prop="snacksLocation" v-if="columns[23].visible"/>
      <el-table-column label="零食喂养方式" align="center" prop="snacksFeedingMethod" v-if="columns[24].visible"/>
      <el-table-column label="其它备注" align="center" prop="otherRemark" v-if="columns[25].visible"/>
      <el-table-column label="食盆/自动喂食器摆放位置-图片" align="center" prop="feedingTrayAutomaticFeederLocation" v-if="columns[26].visible"/>
      <el-table-column label="其他信息" align="center" prop="feedingTrayAutomaticFeederRemarks" v-if="columns[27].visible"/>
      <el-table-column label="饮用水摆放位置-图片" align="center" prop="waterBowlLocation" v-if="columns[28].visible"/>
      <el-table-column label="饮用水添加要求" align="center" prop="waterBowlRemarks" v-if="columns[29].visible"/>
      <el-table-column label="是否有清洁要求" align="center" prop="cleaningRequirements" v-if="columns[30].visible"/>
      <el-table-column label="厕所、猫砂摆放位置-图片" align="center" prop="litterBoxLocation" v-if="columns[31].visible"/><el-table-column label="猫砂更换频次_天" align="center" prop="litterBoxChangeFrequencyDays" v-if="columns[33].visible"/>
      <el-table-column label="猫砂更换频次_次" align="center" prop="litterBoxChangeFrequencyTimes" v-if="columns[32].visible"/>
      <el-table-column label="其他信息" align="center" prop="litterBoxRemarks" v-if="columns[34].visible"/>
      <el-table-column label="尿垫摆放位置-图片" align="center" prop="peePadLocation" v-if="columns[35].visible"/>
      <el-table-column label="是否更换尿垫" align="center" prop="changePeePad" v-if="columns[36].visible"/>
      <el-table-column label="尿垫备注" align="center" prop="peePadRemarks" v-if="columns[37].visible"/>
      <el-table-column label="是否选择附加服务" align="center" prop="additionalService" v-if="columns[38].visible"/>
      <el-table-column label="陪玩用具摆放位置-图片" align="center" prop="playtimeService" v-if="columns[39].visible"/>
      <el-table-column label="陪玩用具摆放位置-图片" align="center" prop="playtimeToolsLocation" v-if="columns[40].visible"/>
      <el-table-column label="希望的互动方式和要求" align="center" prop="playtimeRequirements" v-if="columns[41].visible"/>
      <el-table-column label="是否选择活动区吸毛" align="center" prop="furCleaningService" v-if="columns[42].visible"/>
      <el-table-column label="吸毛用品摆放位置-图片" align="center" prop="furCleaningToolsLocation" v-if="columns[43].visible"/>
      <el-table-column label="请说明吸毛区和要求" align="center" prop="furCleaningRequirements" v-if="columns[44].visible"/>
      <el-table-column label="是否选择毛发梳理" align="center" prop="groomingService" v-if="columns[45].visible"/>
      <el-table-column label="毛发梳理用品摆放位置-图片" align="center" prop="groomingToolsLocation" v-if="columns[46].visible"/>
      <el-table-column label="请说明毛发梳理要求" align="center" prop="groomingRequirements" v-if="columns[47].visible"/>
      <el-table-column label="是否选择食具深度清洁" align="center" prop="deepCleaningService" v-if="columns[48].visible"/>
      <el-table-column label="是否选择喂药上药" align="center" prop="administerMedication" v-if="columns[49].visible"/>
      <el-table-column label="食具深度清洁备注" align="center" prop="deepCleaningRemarks" v-if="columns[50].visible"/>
      <el-table-column label="附加服务用品摆放位置-图片" align="center" prop="additionalServicesPlacement" v-if="columns[51].visible"/>
      <el-table-column label="附加服务用品摆放备注" align="center" prop="additionalServicesPlacementRemark" v-if="columns[52].visible"/>
      <el-table-column label="服务用品摆放备注" align="center" prop="additionalServicesRemarks" v-if="columns[53].visible"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['mall:petCare:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['mall:petCare:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改宠物护理信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
        <el-form-item label="所属宠物ID" prop="petId">
          <el-input v-model="form.petId" placeholder="请输入所属宠物ID" />
        </el-form-item>
        <el-form-item label="是否包含干粮" prop="includeDryFood">
          <el-input v-model="form.includeDryFood" placeholder="请输入是否包含干粮" />
        </el-form-item>
        <el-form-item label="干粮摆放位置-图片" prop="dryFoodLocation">
          <el-input v-model="form.dryFoodLocation" placeholder="请输入干粮摆放位置-图片" />
        </el-form-item>
        <el-form-item label="干粮喂养重量" prop="dryFoodFeedWeight">
          <el-input v-model="form.dryFoodFeedWeight" placeholder="请输入干粮喂养重量" />
        </el-form-item>
        <el-form-item label="干粮喂养批次_天" prop="dryFoodFeedFrequencyDays">
          <el-input v-model="form.dryFoodFeedFrequencyDays" placeholder="请输入干粮喂养批次_天" />
        </el-form-item>
        <el-form-item label="干粮喂养批次_次" prop="dryFoodFeedFrequencyTimes">
          <el-input v-model="form.dryFoodFeedFrequencyTimes" placeholder="请输入干粮喂养批次_次" />
        </el-form-item>
        <el-form-item label="干粮备注" prop="dryFoodRemarks">
          <el-input v-model="form.dryFoodRemarks" placeholder="请输入干粮备注" />
        </el-form-item>
        <el-form-item label="是否包含湿粮" prop="includeWetFood">
          <el-input v-model="form.includeWetFood" placeholder="请输入是否包含湿粮" />
        </el-form-item>
        <el-form-item label="湿粮摆放位置-图片" prop="wetFoodLocation">
          <el-input v-model="form.wetFoodLocation" placeholder="请输入湿粮摆放位置-图片" />
        </el-form-item>
        <el-form-item label="湿粮喂养重量" prop="wetFoodFeedWeight">
          <el-input v-model="form.wetFoodFeedWeight" placeholder="请输入湿粮喂养重量" />
        </el-form-item>
        <el-form-item label="湿粮喂养批次_天" prop="wetFoodFeedFrequencyDays">
          <el-input v-model="form.wetFoodFeedFrequencyDays" placeholder="请输入湿粮喂养批次_天" />
        </el-form-item>
        <el-form-item label="湿粮喂养批次_次" prop="wetFoodFeedFrequencyTimes">
          <el-input v-model="form.wetFoodFeedFrequencyTimes" placeholder="请输入湿粮喂养批次_次" />
        </el-form-item>
        <el-form-item label="湿粮备注" prop="wetFoodRemarks">
          <el-input v-model="form.wetFoodRemarks" placeholder="请输入湿粮备注" />
        </el-form-item>
        <el-form-item label="是否包含自制食品" prop="includeHomemadeFood">
          <el-input v-model="form.includeHomemadeFood" placeholder="请输入是否包含自制食品" />
        </el-form-item>
        <el-form-item label="自制食品摆放位置-图片" prop="homemadeFoodLocation">
          <el-input v-model="form.homemadeFoodLocation" placeholder="请输入自制食品摆放位置-图片" />
        </el-form-item>
        <el-form-item label="自制饭制作和喂食说明" prop="homemadeFoodInstructions">
          <el-input v-model="form.homemadeFoodInstructions" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否包含生骨肉" prop="includeRawMeat">
          <el-input v-model="form.includeRawMeat" placeholder="请输入是否包含生骨肉" />
        </el-form-item>
        <el-form-item label="生骨肉摆放位置-图片" prop="rawMeatLocation">
          <el-input v-model="form.rawMeatLocation" placeholder="请输入生骨肉摆放位置-图片" />
        </el-form-item>
        <el-form-item label="生骨肉喂食说明" prop="rawMeatFeedingInstructions">
          <el-input v-model="form.rawMeatFeedingInstructions" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否包含保健品" prop="includeHealthSupplements">
          <el-input v-model="form.includeHealthSupplements" placeholder="请输入是否包含保健品" />
        </el-form-item>
        <el-form-item label="保健品摆放位置-图片" prop="healthSupplementsLocation">
          <el-input v-model="form.healthSupplementsLocation" placeholder="请输入保健品摆放位置-图片" />
        </el-form-item>
        <el-form-item label="保健品喂养方式说明" prop="healthSupplementsFeedingInstructions">
          <el-input v-model="form.healthSupplementsFeedingInstructions" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否包含零食" prop="includeSnacks">
          <el-input v-model="form.includeSnacks" placeholder="请输入是否包含零食" />
        </el-form-item>
        <el-form-item label="零食摆放位置-图片" prop="snacksLocation">
          <el-input v-model="form.snacksLocation" placeholder="请输入零食摆放位置-图片" />
        </el-form-item>
        <el-form-item label="零食喂养方式" prop="snacksFeedingMethod">
          <el-input v-model="form.snacksFeedingMethod" placeholder="请输入零食喂养方式" />
        </el-form-item>
        <el-form-item label="其它备注" prop="otherRemark">
          <el-input v-model="form.otherRemark" placeholder="请输入其它备注" />
        </el-form-item>
        <el-form-item label="食盆/自动喂食器摆放位置-图片" prop="feedingTrayAutomaticFeederLocation">
          <el-input v-model="form.feedingTrayAutomaticFeederLocation" placeholder="请输入食盆/自动喂食器摆放位置-图片" />
        </el-form-item>
        <el-form-item label="其他信息" prop="feedingTrayAutomaticFeederRemarks">
          <el-input v-model="form.feedingTrayAutomaticFeederRemarks" placeholder="请输入其他信息" />
        </el-form-item>
        <el-form-item label="饮用水摆放位置-图片" prop="waterBowlLocation">
          <el-input v-model="form.waterBowlLocation" placeholder="请输入饮用水摆放位置-图片" />
        </el-form-item>
        <el-form-item label="饮用水添加要求" prop="waterBowlRemarks">
          <el-input v-model="form.waterBowlRemarks" placeholder="请输入饮用水添加要求" />
        </el-form-item>
        <el-form-item label="是否有清洁要求" prop="cleaningRequirements">
          <el-input v-model="form.cleaningRequirements" placeholder="请输入是否有清洁要求" />
        </el-form-item>
        <el-form-item label="厕所、猫砂摆放位置-图片" prop="litterBoxLocation">
          <el-input v-model="form.litterBoxLocation" placeholder="请输入厕所、猫砂摆放位置-图片" />
        </el-form-item>
        <el-form-item label="猫砂更换频次_天" prop="litterBoxChangeFrequencyDays">
          <el-input v-model="form.litterBoxChangeFrequencyDays" placeholder="请输入猫砂更换频次_天" />
        </el-form-item>
        <el-form-item label="猫砂更换频次_次" prop="litterBoxChangeFrequencyTimes">
          <el-input v-model="form.litterBoxChangeFrequencyTimes" placeholder="请输入猫砂更换频次_次" />
        </el-form-item>
        <el-form-item label="其他信息" prop="litterBoxRemarks">
          <el-input v-model="form.litterBoxRemarks" placeholder="请输入其他信息" />
        </el-form-item>
        <el-form-item label="尿垫摆放位置-图片" prop="peePadLocation">
          <el-input v-model="form.peePadLocation" placeholder="请输入尿垫摆放位置-图片" />
        </el-form-item>
        <el-form-item label="是否更换尿垫" prop="changePeePad">
          <el-input v-model="form.changePeePad" placeholder="请输入是否更换尿垫" />
        </el-form-item>
        <el-form-item label="尿垫备注" prop="peePadRemarks">
          <el-input v-model="form.peePadRemarks" placeholder="请输入尿垫备注" />
        </el-form-item>
        <el-form-item label="是否选择附加服务" prop="additionalService">
          <el-input v-model="form.additionalService" placeholder="请输入是否选择附加服务" />
        </el-form-item>
        <el-form-item label="陪玩用具摆放位置-图片" prop="playtimeService">
          <el-input v-model="form.playtimeService" placeholder="请输入陪玩用具摆放位置-图片" />
        </el-form-item>
        <el-form-item label="陪玩用具摆放位置-图片" prop="playtimeToolsLocation">
          <el-input v-model="form.playtimeToolsLocation" placeholder="请输入陪玩用具摆放位置-图片" />
        </el-form-item>
        <el-form-item label="希望的互动方式和要求" prop="playtimeRequirements">
          <el-input v-model="form.playtimeRequirements" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否选择活动区吸毛" prop="furCleaningService">
          <el-input v-model="form.furCleaningService" placeholder="请输入是否选择活动区吸毛" />
        </el-form-item>
        <el-form-item label="吸毛用品摆放位置-图片" prop="furCleaningToolsLocation">
          <el-input v-model="form.furCleaningToolsLocation" placeholder="请输入吸毛用品摆放位置-图片" />
        </el-form-item>
        <el-form-item label="请说明吸毛区和要求" prop="furCleaningRequirements">
          <el-input v-model="form.furCleaningRequirements" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否选择毛发梳理" prop="groomingService">
          <el-input v-model="form.groomingService" placeholder="请输入是否选择毛发梳理" />
        </el-form-item>
        <el-form-item label="毛发梳理用品摆放位置-图片" prop="groomingToolsLocation">
          <el-input v-model="form.groomingToolsLocation" placeholder="请输入毛发梳理用品摆放位置-图片" />
        </el-form-item>
        <el-form-item label="请说明毛发梳理要求" prop="groomingRequirements">
          <el-input v-model="form.groomingRequirements" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否选择食具深度清洁" prop="deepCleaningService">
          <el-input v-model="form.deepCleaningService" placeholder="请输入是否选择食具深度清洁" />
        </el-form-item>
        <el-form-item label="是否选择喂药上药" prop="administerMedication">
          <el-input v-model="form.administerMedication" placeholder="请输入是否选择喂药上药" />
        </el-form-item>
        <el-form-item label="食具深度清洁备注" prop="deepCleaningRemarks">
          <el-input v-model="form.deepCleaningRemarks" placeholder="请输入食具深度清洁备注" />
        </el-form-item>
        <el-form-item label="附加服务用品摆放位置-图片" prop="additionalServicesPlacement">
          <el-input v-model="form.additionalServicesPlacement" placeholder="请输入附加服务用品摆放位置-图片" />
        </el-form-item>
        <el-form-item label="附加服务用品摆放备注" prop="additionalServicesPlacementRemark">
          <el-input v-model="form.additionalServicesPlacementRemark" placeholder="请输入附加服务用品摆放备注" />
        </el-form-item>
        <el-form-item label="服务用品摆放备注" prop="additionalServicesRemarks">
          <el-input v-model="form.additionalServicesRemarks" placeholder="请输入服务用品摆放备注" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listPetCare, getPetCare, delPetCare, addPetCare, updatePetCare, exportPetCare } from "@/api/ums/petCare";

export default {
  name: "PetCare",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 宠物护理信息表格数据
      petCareList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        petId: null,
        feedRequirements: null,
        includeDryFood: null,
        dryFoodLocation: null,
        dryFoodFeedWeight: null,
        dryFoodFeedFrequencyDays: null,
        dryFoodFeedFrequencyTimes: null,
        dryFoodRemarks: null,
        includeWetFood: null,
        wetFoodLocation: null,
        wetFoodFeedWeight: null,
        wetFoodFeedFrequencyDays: null,
        wetFoodFeedFrequencyTimes: null,
        wetFoodRemarks: null,
        includeHomemadeFood: null,
        homemadeFoodLocation: null,
        homemadeFoodInstructions: null,
        includeRawMeat: null,
        rawMeatLocation: null,
        rawMeatFeedingInstructions: null,
        includeHealthSupplements: null,
        healthSupplementsLocation: null,
        healthSupplementsFeedingInstructions: null,
        includeSnacks: null,
        snacksLocation: null,
        snacksFeedingMethod: null,
        otherRemark: null,
        feedingTrayAutomaticFeederLocation: null,
        feedingTrayAutomaticFeederRemarks: null,
        waterBowlLocation: null,
        waterBowlRemarks: null,
        cleaningRequirements: null,
        litterBoxLocation: null,
        litterBoxAddingWeight: null,
        litterBoxChangeFrequencyDays: null,
        litterBoxChangeFrequencyTimes: null,
        litterBoxRemarks: null,
        peePadLocation: null,
        changePeePad: null,
        peePadRemarks: null,
        additionalService: null,
        playtimeService: null,
        playtimeToolsLocation: null,
        playtimeRequirements: null,
        furCleaningService: null,
        furCleaningToolsLocation: null,
        furCleaningRequirements: null,
        groomingService: null,
        groomingToolsLocation: null,
        groomingRequirements: null,
        deepCleaningService: null,
        administerMedication: null,
        administerMedicationLocation: null,
        deepCleaningToolsLocation: null,
        administerMedicationRemarks: null,
        deepCleaningRemarks: null,
        additionalServicesPlacement: null,
        additionalServicesPlacementRemark: null,
        additionalServicesRemarks: null,
        walkDog:null,
        walkDogToolsLocation:null,
        walkDogRainyDay:null,
        walkDogDuration:null,
        dogBehavior:null,
        favoriteRegion:null,
        favoriteRoute:null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      },
      columns: [
            { key: 1, label: "所属宠物ID", visible:  true  },
            { key: 2, label: "是否包含干粮", visible:  true  },
            { key: 3, label: "干粮摆放位置-图片", visible:  true  },
            { key: 4, label: "干粮喂养重量", visible:  true  },
            { key: 5, label: "干粮喂养批次_天", visible:  true  },
            { key: 6, label: "干粮喂养批次_次", visible:  true  },
            { key: 7, label: "干粮备注", visible:  true  },
            { key: 8, label: "是否包含湿粮", visible:  true  },
            { key: 9, label: "湿粮摆放位置-图片", visible:  false  },
            { key: 10, label: "湿粮喂养重量", visible:  false  },
            { key: 11, label: "湿粮喂养批次_天", visible:  false  },
            { key: 12, label: "湿粮喂养批次_次", visible:  false  },
            { key: 13, label: "湿粮备注", visible:  false  },
            { key: 14, label: "是否包含自制食品", visible:  false  },
            { key: 15, label: "自制食品摆放位置-图片", visible:  false  },
            { key: 16, label: "自制饭制作和喂食说明（备注）", visible:  false  },
            { key: 17, label: "是否包含生骨肉", visible:  false  },
            { key: 18, label: "生骨肉摆放位置-图片", visible:  false  },
            { key: 19, label: "生骨肉喂食说明（备注）", visible:  false  },
            { key: 20, label: "是否包含保健品", visible:  false  },
            { key: 21, label: "保健品摆放位置-图片", visible:  false  },
            { key: 22, label: "保健品喂养方式说明（备注）", visible:  false  },
            { key: 23, label: "是否包含零食", visible:  false  },
            { key: 24, label: "零食摆放位置-图片", visible:  false  },
            { key: 25, label: "零食喂养方式（备注）", visible:  false  },
            { key: 26, label: "其它备注", visible:  false  },
            { key: 27, label: "食盆/自动喂食器摆放位置-图片", visible:  false  },
            { key: 28, label: "其他信息", visible:  false  },
            { key: 29, label: "饮用水摆放位置-图片", visible:  false  },
            { key: 30, label: "饮用水添加要求", visible:  false  },
            { key: 31, label: "是否有清洁要求", visible:  false  },
            { key: 32, label: "厕所、猫砂摆放位置-图片", visible:  false  },
            { key: 34, label: "猫砂更换频次_天", visible:  false  },
            { key: 35, label: "猫砂更换频次_次", visible:  false  },
            { key: 36, label: "其他信息", visible:  false  },
            { key: 37, label: "尿垫摆放位置-图片", visible:  false  },
            { key: 38, label: "是否更换尿垫", visible:  false  },
            { key: 39, label: "尿垫备注", visible:  false  },
            { key: 40, label: "是否选择附加服务", visible:  false  },
            { key: 41, label: "陪玩用具摆放位置-图片", visible:  false  },
            { key: 42, label: "陪玩用具摆放位置-图片", visible:  false  },
            { key: 43, label: "希望的互动方式和要求（备注）", visible:  false  },
            { key: 44, label: "是否选择活动区吸毛", visible:  false  },
            { key: 45, label: "吸毛用品摆放位置-图片", visible:  false  },
            { key: 46, label: "请说明吸毛区和要求（备注）", visible:  false  },
            { key: 47, label: "是否选择毛发梳理", visible:  false  },
            { key: 48, label: "毛发梳理用品摆放位置-图片", visible:  false  },
            { key: 49, label: "请说明毛发梳理要求（备注）", visible:  false  },
            { key: 50, label: "是否选择食具深度清洁", visible:  false  },
            { key: 51, label: "是否选择喂药上药", visible:  false  },
            { key: 52, label: "食具深度清洁备注", visible:  false  },
            { key: 53, label: "附加服务用品摆放位置-图片", visible:  false  },
            { key: 54, label: "附加服务用品摆放备注", visible:  false  },
            { key: 55, label: "服务用品摆放备注", visible:  false  },
         ],
      showMoreCondition: false
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询宠物护理信息列表 */
    getList() {
      this.loading = true;
      listPetCare(this.queryParams).then(response => {
        this.petCareList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        petId: null,
        feedRequirements: null,
        includeDryFood: null,
        dryFoodLocation: null,
        dryFoodFeedWeight: null,
        dryFoodFeedFrequencyDays: null,
        dryFoodFeedFrequencyTimes: null,
        dryFoodRemarks: null,
        includeWetFood: null,
        wetFoodLocation: null,
        wetFoodFeedWeight: null,
        wetFoodFeedFrequencyDays: null,
        wetFoodFeedFrequencyTimes: null,
        wetFoodRemarks: null,
        includeHomemadeFood: null,
        homemadeFoodLocation: null,
        homemadeFoodInstructions: null,
        includeRawMeat: null,
        rawMeatLocation: null,
        rawMeatFeedingInstructions: null,
        includeHealthSupplements: null,
        healthSupplementsLocation: null,
        healthSupplementsFeedingInstructions: null,
        includeSnacks: null,
        snacksLocation: null,
        snacksFeedingMethod: null,
        otherRemark: null,
        feedingTrayAutomaticFeederLocation: null,
        feedingTrayAutomaticFeederRemarks: null,
        waterBowlLocation: null,
        waterBowlRemarks: null,
        cleaningRequirements: null,
        litterBoxLocation: null,
        litterBoxAddingWeight: null,
        litterBoxChangeFrequencyDays: null,
        litterBoxChangeFrequencyTimes: null,
        litterBoxRemarks: null,
        peePadLocation: null,
        changePeePad: null,
        peePadRemarks: null,
        additionalService: null,
        playtimeService: null,
        playtimeToolsLocation: null,
        playtimeRequirements: null,
        furCleaningService: null,
        furCleaningToolsLocation: null,
        furCleaningRequirements: null,
        groomingService: null,
        groomingToolsLocation: null,
        groomingRequirements: null,
        deepCleaningService: null,
        administerMedication: null,
        deepCleaningRemarks: null,
        additionalServicesPlacement: null,
        additionalServicesPlacementRemark: null,
        additionalServicesRemarks: null,
        walkDog:null,
        walkDogToolsLocation:null,
        walkDogRainyDay:null,
        walkDogDuration:null,
        dogBehavior:null,
        favoriteRegion:null,
        favoriteRoute:null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.$router.push({ path: '/petCare/edit' });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.$router.push({ path: '/petCare/edit', query: { id: row.id } });
    },
    // handleAdd() {
      // this.reset();
      // this.open = true;
      // this.title = "添加宠物护理信息";
    // },
    // /** 修改按钮操作 */
    // handleUpdate(row) {
    //   this.reset();
    //   const id = row.id || this.ids
    //   getPetCare(id).then(response => {
    //     this.form = response.data;
    //     this.open = true;
    //     this.title = "修改宠物护理信息";
    //   });
    // },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updatePetCare(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPetCare(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除宠物护理信息编号为"' + ids + '"的数据项？').then(function() {
        return delPetCare(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    // /** 导出按钮操作 */
    // handleExport() {
    //   const queryParams = this.queryParams;
    //   this.$modal.confirm('是否确认导出所有宠物护理信息数据项？').then(() => {
    //     this.exportLoading = true;
    //     return exportPetCare(queryParams);
    //   }).then(response => {
    //     this.download(response.msg);
    //     this.exportLoading = false;
    //   }).catch(() => {});
    // }
    /** 导出按钮操作 */
    handleExport() {
      this.download('ums/petCare/export', {
        ...this.queryParams
      }, `petCare_${new Date().getTime()}.xlsx`)
      // const queryParams = this.queryParams;
      // this.$modal.confirm('是否确认导出所有宠物档案数据项？').then(() => {
      //   this.exportLoading = true;
      //   return exportPmsPet(queryParams);
      // }).then(response => {
      //   this.download(response.msg);
      //   this.exportLoading = false;
      // }).catch(() => {});
    }
  }
};
</script>
