<template>
  <div class="app-container">
    <el-row :gutter="20">
      <el-col :span="4" :xs="24">
        <dept-tree-one :userId="user.userData.dept.parentId" :isFive="true" :isJl="true" :expandOnClickNode="false"
                       :showCheckbox="false"
                       @handleNodeClick="handleNodeClick">
        </dept-tree-one>
      </el-col>
      <el-col :span="20" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
                 label-width="90px">
          <!--<el-form-item label="行政区划" prop="xzqh">-->
          <!--<RegionCascaderSelect v-model="xzqh" style="width: 100%" valueProp="code" :isDataRoot="true">-->
          <!--</RegionCascaderSelect>-->
          <!--</el-form-item>-->
          <el-form-item label="老人状态" prop="status">
            <el-select v-model="queryParams.status" placeholder="请选择老人状态" clearable>
              <el-option v-for="dict in dict.type.GL003" :key="dict.value" :label="dict.label" :value="dict.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="姓名" prop="sqrXm">
            <el-input
              v-model="queryParams.sqrXm"
              placeholder="请输入申请人姓名"
              clearable

              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="身份证号" prop="sqrZjhm">
            <el-input
              v-model="queryParams.sqrZjhm"
              placeholder="请输入申请人身份证号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="联系电话" prop="sqrLxdh">
            <el-input
              v-model="queryParams.sqrLxdh"
              placeholder="请输入申请人联系电话"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="健康状况" prop="state">
            <el-select v-model="queryParams.jkzkDjzt" placeholder="请选择健康状况" clearable>
              <el-option v-for="dict in dict.type.GL010" :key="dict.value" :label="dict.label" :value="dict.value">
              </el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="年龄段" prop="nld">
            <el-select v-model="queryParams.nld" placeholder="请选择年龄段" clearable>
              <el-option v-for="item in options"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"/>
            </el-select>
          </el-form-item>

          <el-form-item label="是否低保" prop="isdb">
            <el-select v-model="queryParams.isdb" placeholder="请选择是否低保" clearable>
              <el-option v-for="dict in dict.type.CZ035" :key="dict.value" :label="dict.label" :value="dict.value"/>
            </el-select>
          </el-form-item>

          <el-form-item label="补贴标准" prop="pc">
            <el-select v-model="queryParams.pc" placeholder="请选择补贴标准" clearable>
              <el-option
                v-for="dict in dict.type.GL013"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>


          <el-form-item>
            <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-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"
                  >新增</el-button>
                </el-col>

          <el-col :span="1.5">
            <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleImport(true)" v-hasPermi="['gljt:temp:exprot']"
            >导入
            </el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>

        <el-table v-loading="loading" :data="gljtLrList">
          <el-table-column label="序号" align="center" width="55">
            <template slot-scope="scope">
              {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
            </template>
          </el-table-column>

          <el-table-column label="姓名" align="center" prop="sqrXm"/>
          <el-table-column label="性别" align="center" prop="xb">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.C0007" :value="scope.row.xb"/>
            </template>
          </el-table-column>
          <el-table-column label="补贴标准" align="center" prop="pc"  width="100">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.GL013" :value="scope.row.pc"/>
            </template>
          </el-table-column>
          <el-table-column label="身份证号" align="center" prop="sqrZjhm" width="180"/>
          <el-table-column label="行政区划" align="center" prop="xzqhName" width="350"/>
          <el-table-column label="联系电话" align="center" prop="sqrLxdh" width="160"/>
          <el-table-column label="数据状态" align="center" prop="isImport">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.GL019" :value="scope.row.isImport"/>
            </template>
          </el-table-column>
          <el-table-column label="始发年月" align="center" prop="ffyf">
            <template slot-scope="scope">
              {{scope.row.ffyf&&scope.row.ffyf.length>=6?scope.row.ffyf.slice(0,4)+'-'+scope.row.ffyf.slice(-2):scope.row.ffyf}}
            </template>
          </el-table-column>
          <el-table-column label="健康状况" align="center" prop="jkzkDjzt" width="120">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.GL010" :value="scope.row.jkzkDjzt"/>
            </template>
          </el-table-column>
          <el-table-column label="老人状态" align="center" prop="status">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.GL003" :value="scope.row.status"/>
            </template>
          </el-table-column>

          <!--<el-table-column label="申请人头像" align="center" prop="tx" />-->
          <!--<el-table-column label="出生日期" align="center" prop="csrq" width="180">-->
          <!--<template slot-scope="scope">-->
          <!--<span>{{ special(scope.row.csrq) }}</span>-->
          <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column label="居住地址" align="center" prop="jzdz" />-->
          <!--<el-table-column label="创建人行政区划编码" align="center" prop="createAreaCode" />-->
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="280">
            <template slot-scope="scope">
              <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              >修改</el-button>
              <!--<el-button-->
              <!--size="mini"-->
              <!--type="text"-->
              <!--icon="el-icon-plus"-->
              <!--@click="handleAdd(scope.row)"-->
              <!--v-hasPermi="['gljt:jkzkDj:add']"-->
              <!--&gt;健康状况登记-->
              <!--</el-button>-->

              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleXq(scope.row)"
                v-hasPermi="['gljt:gljtLr:edit']"
              >详情
              </el-button>
              <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row,scope.$index)"
              v-hasPermi="['gljt:temp:exprot']"
              >删除</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-col>
    </el-row>
    <!-- 添加或修改高龄津贴申请老人信息对话框 -->
    <el-dialog v-dialog-drag :title="title" :visible.sync="open"  width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <h3>基本信息</h3>
        <div class="grid3">
          <el-form-item label="姓名" prop="sqrXm">
            <label slot="label"
            >姓<span style="opacity: 0">姓名</span>名</label
            >
            <el-input
              v-model="form.sqrXm"
              @change="changHm"
              placeholder="请输入申请人姓名"
            />
          </el-form-item>
          <el-form-item label="性别" prop="xb">
            <label slot="label"
            >性<span style="opacity: 0">性别</span>别</label
            >
            <el-select disabled v-model="form.xb" placeholder="请选择性别">
              <el-option
                v-for="dict in dict.type.C0007"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item  label="出生日期" prop="csrq">
            <el-date-picker
              disabled
              clearable
              v-model="form.csrq"
              type="date"
              value-format="yyyyMMdd"
              placeholder="请选择出生日期"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="民族" prop="mz">
            <label slot="label"
            >民<span style="opacity: 0">民族</span>族</label
            >
            <el-select v-model="form.mz" placeholder="请选择民族">
              <el-option
                v-for="dict in dict.type.C0009"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="身份证号" prop="sqrZjhm">
            <el-input
              v-model="form.sqrZjhm"
              placeholder="请输入申请人身份证号"
              @change="changeZjhm"
            />
          </el-form-item>
          <el-form-item label="发证机关" prop="fzjg">
            <el-input
              v-model="form.fzjg"
              placeholder="请输入发证机关"
            />
          </el-form-item>
          <el-form-item label="户籍社区" prop="xzqh">
            <RegionCascaderSelect
              v-model="form.xzqh"
              style="width: 100%"
              valueProp="code"
              :isDataRoot="true"
            >
            </RegionCascaderSelect>
          </el-form-item>
          <el-form-item label="护理等级" prop="sndj">
            <el-select v-model="form.sndj" placeholder="请选择护理等级">
              <el-option
                v-for="dict in dict.type.GL021"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="联系电话" prop="sqrLxdh">
            <el-input
              v-model="form.sqrLxdh"
              placeholder="请输入申请人联系电话"
            />
          </el-form-item>
          <el-form-item label="联系电话2" prop="sqrLxdh2 ">
            <el-input
              v-model="form.sqrLxdh2"
              placeholder="请输入申请人联系电话"
            />
          </el-form-item>
          <el-form-item label="居住区划" prop="xjdxzqh">
            <RegionCascaderSelect
              v-model="form.xjdxzqh"
              style="width: 100%"
              valueProp="code"
              :isJl="false"
              :isDataRoot="false"
            >
            </RegionCascaderSelect>
          </el-form-item>
          <el-form-item
            label="户籍地址"
            prop="hjdz"
            style="grid-column: 1 / span 3"
          >
            <el-input
              v-model="form.hjdz"
              placeholder="请输入户籍地址"
            />
          </el-form-item>
          <el-form-item
            label="现居地址"
            prop="jzdz"
            style="grid-column: 1 / span 3"
          >
            <el-input
              v-model="form.jzdz"
              placeholder="请输入详情居住地址"
            />
          </el-form-item>
          <!--是否显示是否迁入配置-->
          <!--<el-form-item label="是否迁入" prop="isqr" v-if="user.qxpz&&user.qxpz.isqr&&user.qxpz.isqr=='1'">-->
            <!--<el-radio-group v-model="form.isqr" @change="chengeIsqr">-->
              <!--<el-radio-->
                <!--v-for="dict in dict.type.CZ035"-->
                <!--:key="dict.value"-->
                <!--:label="dict.value"-->
              <!--&gt;{{ dict.label }}-->
              <!--</el-radio>-->
            <!--</el-radio-group>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="迁入日期" prop="qrsj" v-if="form.isqr=='1'&&user.qxpz.isqr&&user.qxpz.isqr=='1'">-->
            <!--<el-date-picker-->
              <!--clearable-->
              <!--v-model="form.qrsj"-->
              <!--@change="getQxBfPz"-->
              <!--type="date"-->
              <!--value-format="yyyyMMdd"-->
              <!--placeholder="请选择迁入日期"-->
            <!--&gt;-->
            <!--</el-date-picker>-->
          <!--</el-form-item>-->
        </div>
        <h3>银行卡信息</h3>
        <div style="display: flex">
          <div style="flex: 2" class="grid2">
            <el-form-item label="开户银行" prop="khyh">
              <el-cascader
                style="width: 100%;"
                :props="props"
                :options="dict.tree.C0044"
                v-model="form.khyh"
                placeholder="请选择开户银行"
                clearable
              />
            </el-form-item>
            <el-form-item label="银行网点" prop="khwd">
              <el-input v-model="form.khwd" placeholder="请输入银行网点" />
            </el-form-item>
            <el-form-item label="账号" prop="yhzh">
              <label slot="label"
              >账<span style="opacity: 0">账号</span>号</label
              >
              <el-input v-model="form.yhzh" placeholder="请输入银行账号" />
            </el-form-item>
            <el-form-item label="户名" prop="khmc">
              <label slot="label"
              >户<span style="opacity: 0">户名</span>名</label
              >
              <el-input
                disabled
                v-model="form.khmc"
                placeholder="请输入户名"
              />
            </el-form-item>
          </div>
        </div>
        <h3>监护人信息</h3>
        <div style="display: flex">
          <div style="flex: 2" class="grid2">
            <el-form-item label="姓名" prop="jhrXm">
              <label slot="label"
              >姓<span style="opacity: 0">姓名</span>名</label
              >
              <el-input
                v-model="form.jhrXm"
                placeholder="请输入监护人姓名"
              />
            </el-form-item>
            <el-form-item label="身份证号" prop="jhrZjhm">
              <el-input
                v-model="form.jhrZjhm"
                placeholder="请输入监护人身份证号"
              />
            </el-form-item>
            <el-form-item label="联系电话" prop="jhrLxdh">
              <el-input
                v-model="form.jhrLxdh"
                placeholder="请输入监护人联系电话"
              />
            </el-form-item>
            <el-form-item label="与老人关系" prop="jhrGx">
              <el-select
                v-model="form.jhrGx"
                placeholder="请选择监护人与申请人关系"
                clearable
              >
                <el-option
                  v-for="dict in dict.type.C0032"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              label="居住地址"
              prop="jhrJzdz"
              style="grid-column: 1 / span 2"
            >
              <el-input
                v-model="form.jhrJzdz"
                maxlength="200"
                placeholder="请输入监护人居住地址"
              />
            </el-form-item>
          </div>
        </div>
        <h3>低保信息</h3>
        <div class="grid2">
            <el-form-item label="是否低保" prop="isdb">
              <el-radio-group v-model="form.isdb" @change="changeDb">
                <el-radio
                  v-for="dict in dict.type.CZ035"
                  :key="dict.value"
                  :label="dict.value"
                >{{ dict.label }}
                </el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item
              label="低保证号"
              prop="dbzh"
              v-if="form.isdb == '1'"
            >
              <el-input v-model="form.dbzh" placeholder="请输入低保证号" />
            </el-form-item>
        </div>
        <h3>津贴标准信息</h3>
        <div class="grid2">
          <el-form-item label="申请标准">
            <dict-tag :options="dict.type.GL013" :value="form.pc" />
          </el-form-item>
          <el-form-item label="始发年月" prop="ffyf">
            <el-date-picker
              clearable
              v-model="form.ffyf"
              type="month"
              value-format="yyyyMM"
              placeholder="请输入始发年月"
              :picker-options="ffyfPickerOptions"
            >
            </el-date-picker>
          </el-form-item>
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" :loading="submitFormLoading">保 存</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 老人详情 -->
    <el-dialog v-dialog-drag :title="title" :visible.sync="openXq" width="1200px" append-to-body custom-class="custom">
      <el-scrollbar wrapClass="scrollbar-wrap1">
        <h3>基本信息</h3>
        <table class="table">
          <tr>
            <td>姓名</td>
            <td>{{ form.sqrXm }}</td>
            <td>身份证号</td>
            <td>{{ form.sqrZjhm }}</td>
            <td rowspan="5" colspan="2">
              <image-preview style="width: 100%;height: 300px;" :src="form.tx" v-if="form.tx"></image-preview>
            </td>
          </tr>
          <tr>
            <td>性别</td>
            <td>{{ form.xb }}</td>
            <td>出生日期</td>
            <td>{{ special(form.csrq) }}</td>
          </tr>
          <tr>
            <td>联系电话</td>
            <td>{{ form.sqrLxdh }}</td>
            <td>联系电话2</td>
            <td>{{form.sqrLxdh2}}</td>

          </tr>
          <tr>
            <td>户籍地址</td>
            <td colspan="3">{{ form.hjdz }}</td>
          </tr>
          <tr>
            <td>居住地址</td>
            <td colspan="3">{{ form.jzdz }}</td>
          </tr>
          <tr>

            <td>户籍区划</td>
            <td colspan="5">{{ form.xzqhName }}</td>
          </tr>
          <tr>
            <td>是否低保</td>
            <td>{{ form.isdb }}</td>
            <td>低保证号</td>
            <td colspan="2">{{ form.dbzh }}</td>
          </tr>
          <tr>
            <td>开户银行</td>
            <td>{{ form.khyh }}</td>
            <td>银行账号</td>
            <td colspan="2">{{ form.yhzh }}</td>
          </tr>
          <tr>
            <td>补贴标准</td>
            <td>{{ translateDict('GL013', form.pc) }}</td>
            <td>始发年月</td>
            <td colspan="2">{{form.ffyf&&form.ffyf.length>=6?form.ffyf.slice(0,4)+'-'+form.ffyf.slice(-2):form.ffyf}}
            </td>
          </tr>
          <tr>
            <td>开户名称</td>
            <td colspan="4">{{ form.khmc }}</td>
          </tr>
          <tr>
            <td>健康状况</td>
            <td>{{ translateDict('GL010', form.jkzkDjzt) }}</td>
            <td>健康状况检测时间</td>
            <td colspan="2">{{ special(form.lastJkzkTime,'time') }}</td>
          </tr>
          <tr>
            <td>数据状态</td>
            <td colspan="4">{{ translateDict('GL019', form.isImport) }}</td>
          </tr>
        </table>
      </el-scrollbar>
    </el-dialog>

    <el-dialog el-dialog v-dialog-drag title="老人变更历史" :visible.sync="openBgls" width="1400px" append-to-body>
      <el-table v-loading="loading2" :data="gljtLrHiList">
        <el-table-column label="序号" align="center">
          <template slot-scope="scope">
            {{(queryParams2.pageNum-1)*queryParams2.pageSize + scope.$index + 1}}
          </template>
        </el-table-column>
        <el-table-column label="姓名" align="center" prop="sqrXm"/>
        <el-table-column label="性别" align="center" prop="xb">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.C0007" :value="scope.row.xb"/>
          </template>
        </el-table-column>
        <el-table-column label="身份证号" align="center" prop="sqrZjhm" width="180"/>
        <el-table-column label="行政区划" align="center" prop="xzqhName" width="320"/>
        <el-table-column label="联系电话" align="center" prop="sqrLxdh" width="150"/>
        <el-table-column label="补贴标准" align="center" prop="pc" >
          <template slot-scope="scope">
            <dict-tag :options="dict.type.GL013" :value="scope.row.pc"/>
          </template>
        </el-table-column>
        <el-table-column label="变动原因" align="center" prop="bdyy" width="120">
          <template slot-scope="scope">
            <span>{{ translateDict('GL005', scope.row.bdyy)}}</span>
          </template>
        </el-table-column>
        <el-table-column label="变动时间" align="center" prop="bdsj" width="180">
          <template slot-scope="scope">
            <span>{{ special(scope.row.bdsj,'time') }}</span>
          </template>
        </el-table-column>

        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="90">
          <template slot-scope="scope">
<!--            <el-button v-if="scope.row.bdyy==='0' || scope.row.bdyy==='1'" size="mini" type="text" icon="el-icon-edit" @click="handleDy(scope.row)"-->
<!--                       v-hasPermi="['gljt:gljtSq:edit']">打印-->
<!--            </el-button>-->
            <el-button v-if = "scope.row.bdyy === '0'"
                       size="mini"
                       type="text"
                       icon="el-icon-edit"
                       @click="handleDy1(scope.row)"
            >申请打印
            </el-button>
            <el-button v-if = "scope.row.bdyy === '1'"
                       size="mini"
                       type="text"
                       icon="el-icon-edit"
                       @click="handleDy2(scope.row)"
            >变更打印
            </el-button>
            <el-button v-if="['2','3','4','11'].includes(scope.row.bdyy)"
                       size="mini"
                       type="text"
                       icon="el-icon-edit"
                       @click="handleDy3(scope.row)"
            >变更打印
            </el-button>
            <el-button v-if="['5','6','7','9','10'].includes(scope.row.bdyy)"
                       size="mini"
                       type="text"
                       icon="el-icon-edit"
                       @click="handleDy4(scope.row)"
            >停发打印
            </el-button>
            <el-button v-if = "scope.row.bdyy === '8'"
                       size="mini"
                       type="text"
                       icon="el-icon-edit"
                       @click="handleDy5(scope.row)"
            >重新发放打印
            </el-button>
          </template>
        </el-table-column>

      </el-table>

      <pagination
        v-show="total2>0"
        :total="total2"
        :page.sync="queryParams2.pageNum"
        :limit.sync="queryParams2.pageSize"
        @pagination="getListBg"
      />
    </el-dialog>

    <!-- 用户导入对话框 -->
    <el-dialog v-dialog-drag title="导入老人信息" :visible.sync="upload.open" width="400px" append-to-body>
      <el-form ref="uploadForm" :model="upload.form" label-width="100px">

<!--        <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"-->
<!--                   :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"-->
<!--                   :auto-upload="false" drag>-->
<!--          <i class="el-icon-upload"></i>-->
<!--          <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>-->
<!--          <div class="el-upload__tip text-center" slot="tip">-->
<!--            <span>仅允许导入xls、xlsx格式文件。</span>-->
<!--            &lt;!&ndash;          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"&ndash;&gt;-->
<!--            &lt;!&ndash;                   @click="importTemplate">下载模板&ndash;&gt;-->
<!--            &lt;!&ndash;          </el-link>&ndash;&gt;-->
<!--          </div>-->
<!--        </el-upload>-->

        <el-upload
          ref="upload"
          :limit="1"
          accept=".xlsx, .xls"
          :headers="upload.headers"
          :action="isUser? upload.url2:upload.url"
          :data="upload.form"
          :disabled="upload.isUploading"
          :on-progress="handleFileUploadProgress"
          :on-success="handleFileSuccess"
          :auto-upload="false"
          drag
        >
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
          <div class="el-upload__tip text-center" slot="tip" >
            <span>仅允许导入xls、xlsx格式文件。</span>
                                  <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
                                           @click="importTemplate">下载模板
                                  </el-link>
          </div>
        </el-upload>

        <el-form-item label="行政区划" prop="xzqh" style="margin-top: 10px">

          <RegionCascaderSelect
            v-if="isUser"
            v-model="upload.form.xzqh"
            style="width: 100%"
            valueProp="code"
            :checkStrictly="false"
            :isDataRoot="true"
          >
          </RegionCascaderSelect>
          <el-input
            v-else
            v-model="upload.form.xzqh"
            placeholder="请输入行政区划编码"
            clearable
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm" :loading="upload.submitLoading">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import {listGljtLrHi} from "@/api/gljt/gljtLrHi";
  import {getQxDfPz} from "@/api/gljt/gljtSq";
  import {addGljtLr, delGljtLr, getGljtLr, listGljtLr, updateGljtLr, adminRemove} from "@/api/gljt/gljtLr";
  import {chineseOne, idCard, Regular,Mobile} from '@/utils/regular'
  import {addJkzkDj} from "@/api/gljt/jkzkDj";
  import sqXq from "../gljtSq/sqXq"
  import {mapState} from 'vuex'
  import {decrypt_ECB, encrypt_ECB, encrypt_ECBdef} from "@/api/tool/sm4";
  import {Constant} from '@/utils/constant';
  import {delSwzm} from "@/api/gljt/swzm";
  import {getToken} from "@/utils/auth";
  const axios = require('axios');
  export default {
    name: "GljtLr",
    dicts: ["GL021","C0009",'GL005', 'GL007', 'GL010', 'C0007', 'C0032', 'C0044', 'GL002', 'GL003', 'CZ035', 'GL009', 'GL013', 'GL019'],
    components: {
      sqXq
    },
    computed: {
      ...mapState(['user']),
    },
    data() {
      return {
        isUser:false,
        pickerOptions: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          }]
        },
        ffyfPickerOptions: {
          disabledDate: (time) => {
            return false;
          },
        },
        props: {
          emitPath: false,
          checkStrictly: false,
        },
        btbzId: '',
        // 用户导入参数
        upload: {
          // 是否显示弹出层
          open: false,
          // 是否禁用上传
          isUploading: false,
          submitLoading: false,
          // 设置上传的请求头部
          headers: {Authorization: 'Bearer ' + getToken()},
          form: {
            xzqh: '', // 行政区划编码
          },
          // 上传的地址
          url: process.env.VUE_APP_BASE_API + '/gljt/gljtLr/importData',
          url2: process.env.VUE_APP_BASE_API + '/gljt/gljtLr/importData2'
        },
        // 补贴标准
        parmarBtbz: {
          dictType: 'btbz',
        },
        para1: "",
        options: [{value: '1', label: '80~89周岁'}, {value: '2', label: '90~99周岁'}, {value: '3', label: '100周岁以上'}],
        // 遮罩层
        loading: true,
        loading2: true,
        submitFormLoading: false,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total2: 0,
        // 高龄津贴申请老人信息历史表格数据
        gljtLrHiList: [],
        // 总条数
        total: 0,
        // 高龄津贴申请老人信息表格数据
        gljtLrList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        openXq: false,
        openBgls: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          isImport: 1,
          pc: null,
          // status: "1",
          sqrXm: null,
          sqrZjhm: null,
          jkzkDjzt: null,
          nld: null,
          isdb: null,
          btbzId: null,
          sqrLxdh: null,
        },
        queryParams2: {
          pageNum: 1,
          pageSize: 10,
          sqrZjhm: null,
        },
        // 表单参数
        form: {},
        formXq: {},
        // 表单校验
        rules: {
          xb: [
            { required: true, message: "申请人性别不能为空", trigger: "change" },
          ],
          csrq: [
            {
              required: true,
              message: "申请人出生日期不能为空",
              trigger: "blur",
            },
          ],
          sqrXm: [
            { required: true, message: "申请人姓名不能为空", trigger: "blur" },
            { max: 72, message: "申请人姓名不能超过72个字符", trigger: "blur" },
            { validator: chineseOne, trigger: "blur" },
          ],
          sqrZjhm: [
            {
              required: true,
              message: "申请人身份证号不能为空",
              trigger: "blur",
            },
            {
              max: 72,
              message: "申请人身份证号不能超过72个字符",
              trigger: "blur",
            },
            { validator: idCard, trigger: "blur" },
          ],
          sqrLxdh: [
            {
              required: true,
              message: "申请人联系电话不能为空",
              trigger: "blur",
            },
            { validator: Mobile, trigger: "blur" },
            {
              max: 64,
              message: "申请人联系电话不能超过64个字符",
              trigger: "blur",
            },
          ],
          mz: [{ required: true, message: "民族不能为空", trigger: "blur" }],
          sndj: [
            { required: true, message: "护理等级不能为空", trigger: "blur" },
          ],
          hjdz: [
            {required: true, message: "申请人户籍地址不能为空", trigger: "blur"},
          ],
          yhzh: [
            { required: true, message: "银行账号不能为空", trigger: "blur" },
            // {max: 72, message: '银行账号不能超过72个字符', trigger: 'blur'},
          ],
          khyh: [
            { required: true, message: "开户银行不能为空", trigger: "blur" },
            // {max: 4, message: '开户银行不能超过4个字符', trigger: 'blur'},
          ],
          fzjg: [
            { required: true, message: "发证机关不能为空", trigger: "blur" },
          ],
          jzdz: [
            {
              required: true,
              message: "申请人详情居住地址不能为空",
              trigger: "blur",
            },
          ],
          xzqh: [
            { required: true, message: "行政区划不能为空", trigger: "blur" },
            // {max: 12, message: '行政区划不能超过12个字符', trigger: 'blur'},
          ],
          ffyf: [
            { required: true, message: "始发年月不能为空", trigger: "blur" },
            { max: 8, message: "开始发放月份不能超过8个字符", trigger: "blur" },
          ],
        }
      };
    },
    created() {
      this.getList();
    },
    methods: {
      getGender() {
        return this.form.sqrZjhm.charAt(16) % 2 === 0 ? '2' : '1';
      },
      getBirthDate() {
        const year = this.form.sqrZjhm.substr(6, 4);
        const month = this.form.sqrZjhm.substr(10, 2);
        const day = this.form.sqrZjhm.substr(12, 2);
        return `${year}${month}${day}`;
      },
      changeZjhm(){
        if(this.form.sqrZjhm&&this.form.sqrZjhm.length===18){
          this.form.csrq=this.getBirthDate();
          this.form.xb=this.getGender();
          this.getQxDfPz();
        }else{
          this.form.csrq='';
          this.form.sqrXm='';
        }
      },
      changeDb() {
        this.form.dbzh = "";
        this.form.dbzm = "";
        this.getQxDfPz();
      },
      //获取默认的发放月份、标准、月份禁用的时间
      async getQxDfPz(is) {
        if (!this.form.csrq) {
          return;
        }

        let res = await getQxDfPz({ csrq: this.form.csrq, isdb: this.form.isdb});
        this.form.pc = res.data.pc;
      },
      changHm() {
        this.form.khmc = this.form.sqrXm;
      },
      handleImport(is) {
        this.isUser=is;
        this.upload.form.xzqh = '';
        this.upload.submitLoading = false;
        this.upload.open = true;
      },
      handleFileUploadProgress(event, file, fileList) {
        this.upload.isUploading = true;
      },
      // 文件上传成功处理
      handleFileSuccess(response, file, fileList) {
        this.upload.open = false;
        this.upload.isUploading = false;
        this.upload.submitLoading = false;
        this.$refs.upload.clearFiles();
        this.upload.form.xzqh = ''; // 重置表单
        this.$alert('<div style=\'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;\'>' + response.msg + '</div>', '导入结果', {dangerouslyUseHTMLString: true});
        this.getList();
      },
      // 提交上传文件
      submitFileForm() {
        if (!this.upload.form.xzqh) {
          this.$message.warning('请输入行政区划编码');
          return;
        }
        console.log(this.upload.form.xzqh,'this.upload.form.xzqh');
        if(this.isUser){
          this.upload.form.xzqh=this.upload.form.xzqh[this.upload.form.xzqh.length-1]
        }
        this.upload.submitLoading = true;
        this.$refs.upload.submit();
      },
      // 节点单击事件
      handleNodeClick(data) {
        if (data && data.code) {
          this.queryParams.xzqh = data.code;
        } else {
          this.queryParams.xzqh = null;
        }
        this.handleQuery()
      },
      changeDataBtbzId(btbzData) {
        this.queryParams.btbzId = btbzData;

      },
      /** 查询高龄津贴申请老人信息列表 */
      getList() {
        this.btbzId = this.user.userData.dept.locationCode;
        this.loading = true;
        listGljtLr(this.queryParams).then(response => {
          this.gljtLrList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.submitFormLoading = false;
        this.form = {
          isdb: "0",
          id: null,
          isImport:"1",
          status:"1",
          xzqh: null,
          sqrZjzm: null,
          sqrZjbm: null,
          sqrXm: null,
          fzjg: null,
          qfrq:null,
          yb: null,
          mz: null,
          sndj: null,
          sqrZjhm: null,
          sqrLxdh: null,
          sqrLxdh2: null,
          tx: null,
          xb: null,
          csrq: null,
          jzdz: null,
          hjdz: null,
          ffyf: null,
          pc: null,
          sqbfys: null,
          sqbfje: null,
          bfksyf:null,
          dbrZjzm: null,
          dbrZjbm: null,
          dbrXm: null,
          dbrZjhm: null,
          dbrLxdh: null,
          gx: null,
          jhrGx: null,
          dbrJzdz: null,
          yhzjz: null,
          hkbzm: null,
          hkbbm: null,
          khyh: null,
          yhzh: null,
          khmc: null,
          fj: null,
          tfdbrXm: null,
          tfbdrLxdh: null,
          tfsj: null,
          tfyy: null,
          tffj: null,
          dbzh: null, //低保证号
          sqms: null, //申请描述
          sqbfj: null,
          jhrXm: null, // 监护人姓名
          jhrZjhm: null, // 监护人证件号码
          jhrLxdh: null, // 监护人联系电话
          jhrJzdz: null, // 监护人居住地址
          jhrZjzm: null, // 监护人证件照正面
          jhrZjbm: null, // 监护人证件照背面
          xjdxzqh: null, // 现居地行政区划
          khwd: null, // 开户网点
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {

        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.queryParams.jkzkDjzt = '';
        this.queryParams.glsqsjRange = '';
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "新增存量老人信息";
      },
      getTime() {
        // 获取当前年月日时分秒
        // 获取当前日期和时间
        const now = new Date();
        // 获取年份
        const year = now.getFullYear();
        // 获取月份（注意：月份是从0开始的，1月是0，12月是11）
        const month = String(now.getMonth() + 1).padStart(2, '0');
        // 获取日期
        const day = String(now.getDate()).padStart(2, '0');
        // 获取小时
        const hours = String(now.getHours()).padStart(2, '0');
        // 获取分钟
        const minutes = String(now.getMinutes()).padStart(2, '0');
        // 获取秒数
        const seconds = String(now.getSeconds()).padStart(2, '0');
        return year + month + day + hours + minutes + seconds;
      },
      handleXq(row) {
        this.reset();
        const id = row.id || this.ids;
        getGljtLr(id).then(response => {
          // this.form = response.data;
          this.form = {
            ...response.data,
            isdb: this.translateDict('CZ035', response.data.isdb),
            iszc: this.translateDict('CZ035', response.data.iszc),
            istk: this.translateDict('CZ035', response.data.istk),
            gx: this.translateDict('C0032', response.data.gx),
            khyh: this.translateDict('C0044', response.data.khyh),
            xb: this.translateDict('C0007', response.data.xb),
            // sqShjg: this.translateDict('GL007', response.data.sqShjg),
            // jdShjg: this.translateDict('GL007', response.data.jdShjg),
            // mzShjg: this.translateDict('GL007', response.data.mzShjg),
          };
          this.openXq = true;
          this.title = "老人信息详情";
        });
      },
      translateDict(type, value) {
        return this.selectDictLabel(this.dict.type[type], value);
      },
      handleBgls(row) {
        this.queryParams2.sqrZjhm = row.sqrZjhm;
        this.openBgls = true;
        this.getListBg();
      },
      /** 查询高龄津贴申请老人信息历史列表 */
      getListBg() {
        this.loading2 = true;
        listGljtLrHi(this.queryParams2).then(response => {
          this.gljtLrHiList = response.rows;
          this.total2 = response.total;
          this.loading2 = false;
        });
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const id = row.id || this.ids
        getGljtLr(id).then(response => {
          this.form = response.data;
          this.form.xzqh = this.form.xzqhCode
            ? JSON.stringify(this.form.xzqhCode.split(","))
            : [];
          /****** sks 需要改动的地方 start ******/
          // this.copyForm=this.deepCopy(response.data)
          /****** sks 需要改动的地方 end ******/
          this.open = true;
          this.title = "修改存量老人信息";
        });
      },
      handleDy(row) {
        this.reset();
        console.log('scope.row:    ',row)
        const id = row.id;
        let tj;
        let sss1;

        if(row.bdyy === '0'){
          tj = JSON.parse(JSON.stringify({lrId: id,bdyyType:'0'}));
          sss1 = {tab: {tab: 'jtsq', qh: this.user.userData.dept.locationCode.substring(0, 6)}, sys: {dpt: this.user.userData.dept.deptName + '高龄老年人生活津贴申请确认表', dt: Date.now()}, tj: tj}
        } else if(row.bdyy === '1'){
          tj = JSON.parse(JSON.stringify({lrId: id,bdyyType:'1'}));
          sss1 = {tab: {tab: 'jtsq', qh: this.user.userData.dept.locationCode.substring(0, 6)}, sys: {dpt: this.user.userData.dept.deptName + '高龄老年人生活津贴申请确认表', dt: Date.now()}, tj: tj}
        }else{
          tj = JSON.parse(JSON.stringify({lrId: id}));
          sss1 = {tab: {tab: 'jtsq', qh: this.user.userData.dept.locationCode.substring(0, 6)}, sys: {dpt: this.user.userData.dept.deptName + '高龄老年人生活津贴申请确认表', dt: Date.now()}, tj: tj}
        }

        let ssss = encrypt_ECBdef(JSON.stringify(sss1));
        let para = encodeURIComponent(ssss);

        // window.open(Constant.DY_URL + "?tj=" + para, "_blank");
        window.open(Constant.DY_URL+"/getprint?tj=" + para, "_blank");
      },
      handleDy1(row) {
        this.reset();
        const id = row.id;
        const tj = JSON.parse(JSON.stringify({ lrId: id,bdyyType:'0' }));
        const sss1 = {tab: {tab: "jtsq", qh: this.user.userData.dept.locationCode.substring(0, 6),},
          sys: {dpt: this.user.userData.dept.deptName + "高龄老年人生活津贴申请信息表", dt: Date.now(),}, tj: tj};
        let ssss = encrypt_ECBdef(JSON.stringify(sss1));
        let para = encodeURIComponent(ssss);
        // window.open(Constant.DY_URL + "?tj=" + para, "_blank");
        window.open(Constant.DY_URL+"/getprint?tj=" + para, "_blank");
      },
      handleDy2(row) {
        this.reset();
        const id = row.id;
        const tj = JSON.parse(JSON.stringify({ lrId: id,bdyyType:'1' }));
        const sss1 = {tab: {tab: "jtbg", qh: this.user.userData.dept.locationCode.substring(0, 6),},
          sys: {dpt: this.user.userData.dept.deptName + "高龄老年人生活津贴变更信息表", dt: Date.now(),}, tj: tj};
        let ssss = encrypt_ECBdef(JSON.stringify(sss1));
        let para = encodeURIComponent(ssss);
        // window.open(Constant.DY_URL + "?tj=" + para, "_blank");
        window.open(Constant.DY_URL+"/getprint?tj=" + para, "_blank");
      },
      handleDy3(row) {
        this.reset();
        const id = row.id;
        const tj = JSON.parse(JSON.stringify({ lrHiId: id }));
        const sss1 = {tab: {tab: "jtbg", qh: this.user.userData.dept.locationCode.substring(0, 6),},
          sys: {dpt: this.user.userData.dept.deptName + "高龄老年人生活津贴变更信息表", dt: Date.now(),}, tj: tj};
        let ssss = encrypt_ECBdef(JSON.stringify(sss1));
        let para = encodeURIComponent(ssss);
        // window.open(Constant.DY_URL + "?tj=" + para, "_blank");
        window.open(Constant.DY_URL+"/getprint?tj=" + para, "_blank");
      },
      handleDy4(row) {
        this.reset();
        const id = row.id;
        const tj = JSON.parse(JSON.stringify({ lrHiId: id }));
        const sss1 = {tab: {tab: "jttf", qh: this.user.userData.dept.locationCode.substring(0, 6),},
          sys: {dpt: this.user.userData.dept.deptName + "高龄老年人生活津贴停发信息表", dt: Date.now(),}, tj: tj};
        let ssss = encrypt_ECBdef(JSON.stringify(sss1));
        let para = encodeURIComponent(ssss);
        // window.open(Constant.DY_URL + "?tj=" + para, "_blank");
        window.open(Constant.DY_URL+"/getprint?tj=" + para, "_blank");
      },
      handleDy5(row) {
        this.reset();
        const id = row.id;
        const tj = JSON.parse(JSON.stringify({ lrHiId: id }));
        const sss1 = {tab: {tab: "jtbf", qh: this.user.userData.dept.locationCode.substring(0, 6),},
          sys: {dpt: this.user.userData.dept.deptName + "高龄老年人生活津贴补发信息表", dt: Date.now(),}, tj: tj};
        let ssss = encrypt_ECBdef(JSON.stringify(sss1));
        let para = encodeURIComponent(ssss);

        // window.open(Constant.DY_URL + "?tj=" + para, "_blank");
        window.open(Constant.DY_URL+"/getprint?tj=" + para, "_blank");
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            this.submitFormLoading = true;
            let xzqh = "";
            if (this.form.xzqh !== null) {
              if (Array.isArray(this.form.xzqh)) {
                xzqh = this.form.xzqh[this.form.xzqh.length - 1];
              } else {
                let data = JSON.parse(this.form.xzqh);
                xzqh = data[data.length - 1];
              }
            }
            if (this.form.id != null) {
              /****** sks 需要改动的地方 start ******/
              updateGljtLr({...this.form,xzqh:xzqh}).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              }).finally(() => this.submitFormLoading = false);
            } else {
              addGljtLr({...this.form,xzqh:xzqh}).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
                /****** sks 需要改动的地方 start ******/
                // if (this.queryParams.pageSize===this.gljtLrList.length)
                // {
                //   this.gljtLrList.pop();
                // }
                // this.gljtLrList.unshift({...this.form,id:response.data});
                // this.total++;
                /****** sks 需要改动的地方 end ******/
              }).finally(() => this.submitFormLoading = false);
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row, index) {
        const ids = row.id || this.ids;
        const xh = (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
        this.$modal.confirm('确认删除' + this.changeDelData(row, 'sqrXm', '姓名', xh) + '的记录？').then(function () {
          return delGljtLr(ids);
        }).then(() => {
          this.getList();
          /****** sks 需要改动的地方 ind参数需要传进来 start ******/
          // this.gljtLrList.splice(index,1);
          // if(this.gljtLrList.length===0)
          // {
          //   this.getList();
          // }else {
          //   this.total--;
          // }
          this.$modal.msgSuccess("删除成功");
          /****** sks 需要改动的地方 end ******/
        }).catch(() => {
        });
      },
      importTemplate() {
        window.open('https://www.jlyanglao.com/uploadPath/2025/04/07/高龄津贴存量数据导入模版_20250407161108A743.xlsx', '_blank');
        // this.download('organization/ygJbxx/importTemplate', {
        // }, `员工基本信息_模板_${new Date().getTime()}.xlsx`)
      },
      /** 导出按钮操作 */
      // handleExport() {
      //   this.download('gljt/gljtLr/export', {
      //     ...this.queryParams
      //   }, `gljtLr_${new Date().getTime()}.xlsx`)
      // }
      handleExport() {

        // const sss = '{"tab": {"tab": "jtmd","qh": "220581"},"sys": {"dpt": "高龄津贴老人名册(梅河口市民政局)", "dt": 1737166588286},"tj": "pageNum": 1, "pageSize": 10, "sqrXm": "KHL4klREmfAfnRt6uc22aw==", "sqrZjhm": "U3yt5efh7IaPA0zf7j1aesXea/61g1ufXyzb4/gp52o=", "sqrLxdh": "oHo4Aadk/p2RBcF/dswCRA==", "jkzkDjzt": "0"}}';

        let tj = JSON.parse(JSON.stringify(this.queryParams));

        tj.sqrXm == null || tj.sqrXm == '' ? delete tj.sqrXm : tj.sqrXm = encrypt_ECBdef(tj.sqrXm);
        tj.sqrLxdh == null || tj.sqrLxdh == '' ? delete tj.sqrLxdh : tj.sqrLxdh = encrypt_ECBdef(tj.sqrLxdh);
        tj.sqrZjhm == null || tj.sqrZjhm == '' ? delete tj.sqrZjhm : tj.sqrZjhm = encrypt_ECBdef(tj.sqrZjhm);
        tj.jkzkDjzt == null || tj.jkzkDjzt == '' ? delete tj.jkzkDjzt : tj.jkzkDjzt = tj.jkzkDjzt;
        tj.nld == null || tj.nld == '' ? delete tj.nld : tj.nld = tj.nld;
        tj.isdb == null || tj.isdb == '' ? delete tj.isdb : tj.isdb = tj.isdb;
        tj.status == null || tj.status == '' ? delete tj.status : tj.btbzId = tj.status;
        tj.pc == null || tj.pc == '' ? delete tj.pc : tj.btbzId = tj.pc;
        let deptL;
        if (this.queryParams.xzqh) {
          deptL = this.queryParams.xzqh;
        } else {
          deptL = this.user.userData.dept.locationCode;
        }
        const sss1 = {
          tab: {tab: 'jtmd', qh: deptL},
          sys: {dpt: '高龄津贴老人名册(' + this.user.userData.dept.deptName + ')', dt: Date.now()},
          tj: tj
        }
        let ssss = encrypt_ECBdef(JSON.stringify(sss1));
        let para = encodeURIComponent(ssss);
        window.open(Constant.DY_URL+"/getprintdata?tj=" + para, "_blank");
        // window.open(Constant.DY_URL + "data?tj=" + para, "_blank");
      },

      /** 导出按钮操作 */
      handleExport2() {
        this.download('gljt/gljtLr/exportGljtLrExcel', {
          ...this.queryParams
        }, `享受高龄津贴老人台卡.xlsx`)
      },

      handleAdmin(row, index) {
        const sfzh = row.sqrZjhm;
        this.$modal.confirm('该操作会清空一切该老人在系统内的任何记录，务必确认后再操作').then(function () {
          const param = {
            sqrZjhm: sfzh
          }
          adminRemove(param).then(response => {
            this.$modal.msgSuccess("清除成功");
            this.getList();
          }).finally(() => this.submitFormLoading = false);
        }).then(() => {
          this.$modal.msgSuccess("清除成功");
          this.getList();
        }).catch(() => {});
      },

    }
  };
</script>
<style scoped lang="scss">
  @import "@/assets/styles/common/common.scss";

  .imgStyle {
    width: 171.2px;
    height: 108px;
  }

  .tableStyle {
    width: 100%;
    border: none;

    tr {
      td {
        height: 70px;
        width: auto;
        border: none;
        padding: 0;
        vertical-align: initial;
      }

      td:nth-child(odd) {
        text-align: left;
        background: transparent;
      }
    }

    ::v-deep .el-form-item {
      /*margin-bottom: 0;*/
      margin-right: 0;


      .el-date-editor {
        .el-input__suffix-inner {
          width: 8px;
        }
      }

      .tx-error {
        color: #ff4949;
        font-size: 12px;
        line-height: 1;
        padding-top: 2px;
        position: absolute;
        top: 100%;
        left: 36%;
      }

      .el-cascader {
        width: 100%;
      }
    }

    ::v-deep .el-form-item2 {
      .el-upload--picture-card {
        height: 250px;
        width: 250px;
        line-height: 250px;
      }

      .component-upload-image {
        width: 100%;
        text-align: center;
      }

      .el-upload-list--picture-card {
        height: 250px;
        width: 250px;

        .el-upload-list__item {
          height: 250px;
          width: 250px;
          margin: 0;
        }
      }
    }

    ::v-deep .uploadStyle {
      .el-upload--picture-card {
        width: 171.2px;
        height: 108px;
        line-height: 108px;
      }

      .el-upload-list--picture-card {
        width: 171.2px;
        height: 108px;

        .el-upload-list__item {
          width: 171.2px;
          height: 108px;
          margin: 0;
        }
      }
    }
  }
  .grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /*grid-template-rows: 50px 50px;*/
  }
  .grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /*grid-template-rows: 50px 50px;*/
  }
</style>
