<template>
  <div class="app-container">

    <!-- 搜索工作栏 -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="用户ID" prop="userId">
        <el-input v-model="queryParams.userId" placeholder="请输入用户ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="就诊卡id" prop="cardId">
        <el-input v-model="queryParams.cardId" placeholder="请输入就诊卡id" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="病人名称" prop="name">
        <el-input v-model="queryParams.name" placeholder="请输入病人名称" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="科室名称" prop="ksmc">
        <el-input v-model="queryParams.ksmc" placeholder="请输入科室名称" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="医生名称" prop="ysmc">
        <el-input v-model="queryParams.ysmc" placeholder="请输入医生名称" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="院区 ID" prop="subHospitalID">
        <el-input v-model="queryParams.subHospitalID" placeholder="请输入院区 ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="票据编号" prop="reptNum">
        <el-input v-model="queryParams.reptNum" placeholder="请输入票据编号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="操作类型" prop="lockType">
        <el-select v-model="queryParams.lockType" placeholder="请选择操作类型" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="订单 ID" prop="hisOrderNO">
        <el-input v-model="queryParams.hisOrderNO" placeholder="请输入订单 ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="排班 ID" prop="scheduleId">
        <el-input v-model="queryParams.scheduleId" placeholder="请输入排班 ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="医生编码" prop="doctorCode">
        <el-input v-model="queryParams.doctorCode" placeholder="请输入医生编码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="科室编码" prop="departCode">
        <el-input v-model="queryParams.departCode" placeholder="请输入科室编码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="分时 ID" prop="parTimeId">
        <el-input v-model="queryParams.parTimeId" placeholder="请输入分时 ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="锁号时间" prop="lockTime">
        <el-date-picker v-model="queryParams.lockTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="患者 ID" prop="patientId">
        <el-input v-model="queryParams.patientId" placeholder="请输入患者 ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="手机号码" prop="mobile">
        <el-input v-model="queryParams.mobile" placeholder="请输入手机号码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="就诊序号" prop="serialNo">
        <el-input v-model="queryParams.serialNo" placeholder="请输入就诊序号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="就诊地址" prop="location">
        <el-input v-model="queryParams.location" placeholder="请输入就诊地址" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="号票编号" prop="ticketNo">
        <el-input v-model="queryParams.ticketNo" placeholder="请输入号票编号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="取号确认订单ID" prop="orderNo">
        <el-input v-model="queryParams.orderNo" placeholder="请输入取号确认订单ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="取号确认时间段" prop="timeInterval">
        <el-input v-model="queryParams.timeInterval" placeholder="请输入取号确认时间段" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="出诊日期" prop="registerdate">
        <el-date-picker v-model="queryParams.registerdate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="诊查费" prop="clinicFee">
        <el-input v-model="queryParams.clinicFee" placeholder="请输入诊查费" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="挂号费" prop="registrationFee">
        <el-input v-model="queryParams.registrationFee" placeholder="请输入挂号费" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="收费性质" prop="payNature">
        <el-input v-model="queryParams.payNature" placeholder="请输入收费性质" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="支付方式" prop="payType">
        <el-select v-model="queryParams.payType" placeholder="请选择支付方式" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="交易 ID" prop="powerTranID">
        <el-input v-model="queryParams.powerTranID" placeholder="请输入交易 ID" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="交易 卡号(扫码支付)" prop="powerTranCARD">
        <el-input v-model="queryParams.powerTranCARD" placeholder="请输入交易 卡号(扫码支付)" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="MISPOS终端号" prop="terminalId">
        <el-input v-model="queryParams.terminalId" placeholder="请输入MISPOS终端号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="自费支付金额" prop="zFAmount">
        <el-input v-model="queryParams.zFAmount" placeholder="请输入自费支付金额" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="医保账户金额" prop="yBZHAmount">
        <el-input v-model="queryParams.yBZHAmount" placeholder="请输入医保账户金额" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="医保统筹金额" prop="yBTCAmount">
        <el-input v-model="queryParams.yBTCAmount" placeholder="请输入医保统筹金额" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="医保结算信息" prop="yBOutMsg">
        <el-input v-model="queryParams.yBOutMsg" placeholder="请输入医保结算信息" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="HIS 工号" prop="hisOperNum">
        <el-input v-model="queryParams.hisOperNum" placeholder="请输入HIS 工号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="交易检索号(银行)" prop="referNo">
        <el-input v-model="queryParams.referNo" placeholder="请输入交易检索号(银行)" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="token" prop="token">
        <el-input v-model="queryParams.token" placeholder="请输入token" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="允许退号标志  N 不允许 Y 允许" prop="appFlag">
        <el-input v-model="queryParams.appFlag" placeholder="请输入允许退号标志  N 不允许 Y 允许" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="单据状态 1 已退费 0 正常" prop="appStatus">
        <el-select v-model="queryParams.appStatus" placeholder="请选择单据状态 1 已退费 0 正常" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="1 预约挂号 2 今日挂号" prop="appType">
        <el-select v-model="queryParams.appType" placeholder="请选择1 预约挂号 2 今日挂号" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="提交时间" prop="ctime">
        <el-date-picker v-model="queryParams.ctime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="修改时间" prop="utime">
        <el-date-picker v-model="queryParams.utime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @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"
                   v-hasPermi="['system:reserve8:create']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
                   v-hasPermi="['system:reserve8:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <!-- 列表 -->
    <el-table v-loading="loading" :data="list">
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="就诊卡id" align="center" prop="cardId" />
      <el-table-column label="病人名称" align="center" prop="name" />
      <el-table-column label="科室名称" align="center" prop="ksmc" />
      <el-table-column label="医生名称" align="center" prop="ysmc" />
      <el-table-column label="院区 ID" align="center" prop="subHospitalID" />
      <el-table-column label="票据编号" align="center" prop="reptNum" />
      <el-table-column label="操作类型" align="center" prop="lockType" />
      <el-table-column label="订单 ID" align="center" prop="hisOrderNO" />
      <el-table-column label="排班 ID" align="center" prop="scheduleId" />
      <el-table-column label="医生编码" align="center" prop="doctorCode" />
      <el-table-column label="科室编码" align="center" prop="departCode" />
      <el-table-column label="分时 ID" align="center" prop="parTimeId" />
      <el-table-column label="锁号时间" align="center" prop="lockTime" />
      <el-table-column label="患者 ID" align="center" prop="patientId" />
      <el-table-column label="手机号码" align="center" prop="mobile" />
      <el-table-column label="就诊序号" align="center" prop="serialNo" />
      <el-table-column label="就诊地址" align="center" prop="location" />
      <el-table-column label="号票编号" align="center" prop="ticketNo" />
      <el-table-column label="取号确认订单ID" align="center" prop="orderNo" />
      <el-table-column label="取号确认时间段" align="center" prop="timeInterval" />
      <el-table-column label="出诊日期" align="center" prop="registerdate" />
      <el-table-column label="诊查费" align="center" prop="clinicFee" />
      <el-table-column label="挂号费" align="center" prop="registrationFee" />
      <el-table-column label="收费性质" align="center" prop="payNature" />
      <el-table-column label="支付方式" align="center" prop="payType" />
      <el-table-column label="交易 ID" align="center" prop="powerTranID" />
      <el-table-column label="交易 卡号(扫码支付)" align="center" prop="powerTranCARD" />
      <el-table-column label="MISPOS终端号" align="center" prop="terminalId" />
      <el-table-column label="自费支付金额" align="center" prop="zFAmount" />
      <el-table-column label="医保账户金额" align="center" prop="yBZHAmount" />
      <el-table-column label="医保统筹金额" align="center" prop="yBTCAmount" />
      <el-table-column label="医保结算信息" align="center" prop="yBOutMsg" />
      <el-table-column label="HIS 工号" align="center" prop="hisOperNum" />
      <el-table-column label="交易检索号(银行)" align="center" prop="referNo" />
      <el-table-column label="token" align="center" prop="token" />
      <el-table-column label="允许退号标志  N 不允许 Y 允许" align="center" prop="appFlag" />
      <el-table-column label="单据状态 1 已退费 0 正常" align="center" prop="appStatus" />
      <el-table-column label="1 预约挂号 2 今日挂号" align="center" prop="appType" />
      <el-table-column label="提交时间" align="center" prop="ctime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.ctime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="修改时间" align="center" prop="utime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.utime) }}</span>
        </template>
      </el-table-column>
      <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="['system:reserve8:update']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                     v-hasPermi="['system:reserve8:delete']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
                @pagination="getList"/>

    <!-- 对话框(添加 / 修改) -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="就诊卡id" prop="cardId">
          <el-input v-model="form.cardId" placeholder="请输入就诊卡id" />
        </el-form-item>
        <el-form-item label="病人名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入病人名称" />
        </el-form-item>
        <el-form-item label="科室名称" prop="ksmc">
          <el-input v-model="form.ksmc" placeholder="请输入科室名称" />
        </el-form-item>
        <el-form-item label="医生名称" prop="ysmc">
          <el-input v-model="form.ysmc" placeholder="请输入医生名称" />
        </el-form-item>
        <el-form-item label="院区 ID" prop="subHospitalID">
          <el-input v-model="form.subHospitalID" placeholder="请输入院区 ID" />
        </el-form-item>
        <el-form-item label="票据编号" prop="reptNum">
          <el-input v-model="form.reptNum" placeholder="请输入票据编号" />
        </el-form-item>
        <el-form-item label="操作类型" prop="lockType">
          <el-select v-model="form.lockType" placeholder="请选择操作类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="订单 ID" prop="hisOrderNO">
          <el-input v-model="form.hisOrderNO" placeholder="请输入订单 ID" />
        </el-form-item>
        <el-form-item label="排班 ID" prop="scheduleId">
          <el-input v-model="form.scheduleId" placeholder="请输入排班 ID" />
        </el-form-item>
        <el-form-item label="医生编码" prop="doctorCode">
          <el-input v-model="form.doctorCode" placeholder="请输入医生编码" />
        </el-form-item>
        <el-form-item label="科室编码" prop="departCode">
          <el-input v-model="form.departCode" placeholder="请输入科室编码" />
        </el-form-item>
        <el-form-item label="分时 ID" prop="parTimeId">
          <el-input v-model="form.parTimeId" placeholder="请输入分时 ID" />
        </el-form-item>
        <el-form-item label="锁号时间" prop="lockTime">
          <el-date-picker clearable v-model="form.lockTime" type="date" value-format="timestamp" placeholder="选择锁号时间" />
        </el-form-item>
        <el-form-item label="患者 ID" prop="patientId">
          <el-input v-model="form.patientId" placeholder="请输入患者 ID" />
        </el-form-item>
        <el-form-item label="手机号码" prop="mobile">
          <el-input v-model="form.mobile" placeholder="请输入手机号码" />
        </el-form-item>
        <el-form-item label="就诊序号" prop="serialNo">
          <el-input v-model="form.serialNo" placeholder="请输入就诊序号" />
        </el-form-item>
        <el-form-item label="就诊地址" prop="location">
          <el-input v-model="form.location" placeholder="请输入就诊地址" />
        </el-form-item>
        <el-form-item label="号票编号" prop="ticketNo">
          <el-input v-model="form.ticketNo" placeholder="请输入号票编号" />
        </el-form-item>
        <el-form-item label="取号确认订单ID" prop="orderNo">
          <el-input v-model="form.orderNo" placeholder="请输入取号确认订单ID" />
        </el-form-item>
        <el-form-item label="取号确认时间段" prop="timeInterval">
          <el-input v-model="form.timeInterval" placeholder="请输入取号确认时间段" />
        </el-form-item>
        <el-form-item label="出诊日期" prop="registerdate">
          <el-date-picker clearable v-model="form.registerdate" type="date" value-format="timestamp" placeholder="选择出诊日期" />
        </el-form-item>
        <el-form-item label="诊查费" prop="clinicFee">
          <el-input v-model="form.clinicFee" placeholder="请输入诊查费" />
        </el-form-item>
        <el-form-item label="挂号费" prop="registrationFee">
          <el-input v-model="form.registrationFee" placeholder="请输入挂号费" />
        </el-form-item>
        <el-form-item label="收费性质" prop="payNature">
          <el-input v-model="form.payNature" placeholder="请输入收费性质" />
        </el-form-item>
        <el-form-item label="支付方式" prop="payType">
          <el-select v-model="form.payType" placeholder="请选择支付方式">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="交易 ID" prop="powerTranID">
          <el-input v-model="form.powerTranID" placeholder="请输入交易 ID" />
        </el-form-item>
        <el-form-item label="交易 卡号(扫码支付)" prop="powerTranCARD">
          <el-input v-model="form.powerTranCARD" placeholder="请输入交易 卡号(扫码支付)" />
        </el-form-item>
        <el-form-item label="MISPOS终端号" prop="terminalId">
          <el-input v-model="form.terminalId" placeholder="请输入MISPOS终端号" />
        </el-form-item>
        <el-form-item label="自费支付金额" prop="zFAmount">
          <el-input v-model="form.zFAmount" placeholder="请输入自费支付金额" />
        </el-form-item>
        <el-form-item label="医保账户金额" prop="yBZHAmount">
          <el-input v-model="form.yBZHAmount" placeholder="请输入医保账户金额" />
        </el-form-item>
        <el-form-item label="医保统筹金额" prop="yBTCAmount">
          <el-input v-model="form.yBTCAmount" placeholder="请输入医保统筹金额" />
        </el-form-item>
        <el-form-item label="医保结算信息" prop="yBOutMsg">
          <el-input v-model="form.yBOutMsg" placeholder="请输入医保结算信息" />
        </el-form-item>
        <el-form-item label="HIS 工号" prop="hisOperNum">
          <el-input v-model="form.hisOperNum" placeholder="请输入HIS 工号" />
        </el-form-item>
        <el-form-item label="交易检索号(银行)" prop="referNo">
          <el-input v-model="form.referNo" placeholder="请输入交易检索号(银行)" />
        </el-form-item>
        <el-form-item label="token" prop="token">
          <el-input v-model="form.token" placeholder="请输入token" />
        </el-form-item>
        <el-form-item label="允许退号标志  N 不允许 Y 允许" prop="appFlag">
          <el-input v-model="form.appFlag" placeholder="请输入允许退号标志  N 不允许 Y 允许" />
        </el-form-item>
        <el-form-item label="单据状态 1 已退费 0 正常" prop="appStatus">
          <el-radio-group v-model="form.appStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="1 预约挂号 2 今日挂号" prop="appType">
          <el-select v-model="form.appType" placeholder="请选择1 预约挂号 2 今日挂号">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="提交时间" prop="ctime">
          <el-date-picker clearable v-model="form.ctime" type="date" value-format="timestamp" placeholder="选择提交时间" />
        </el-form-item>
        <el-form-item label="修改时间" prop="utime">
          <el-date-picker clearable v-model="form.utime" type="date" value-format="timestamp" 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 { createReserve8, updateReserve8, deleteReserve8, getReserve8, getReserve8Page, exportReserve8Excel } from "@/api/system/reserve8";

export default {
  name: "Reserve8",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 预约挂号列表
      list: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        userId: null,
        cardId: null,
        name: null,
        ksmc: null,
        ysmc: null,
        subHospitalID: null,
        reptNum: null,
        lockType: null,
        hisOrderNO: null,
        scheduleId: null,
        doctorCode: null,
        departCode: null,
        parTimeId: null,
        lockTime: [],
        patientId: null,
        mobile: null,
        serialNo: null,
        location: null,
        ticketNo: null,
        orderNo: null,
        timeInterval: null,
        registerdate: [],
        clinicFee: null,
        registrationFee: null,
        payNature: null,
        payType: null,
        powerTranID: null,
        powerTranCARD: null,
        terminalId: null,
        zFAmount: null,
        yBZHAmount: null,
        yBTCAmount: null,
        yBOutMsg: null,
        hisOperNum: null,
        referNo: null,
        token: null,
        appFlag: null,
        appStatus: null,
        appType: null,
        ctime: [],
        utime: [],
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 执行查询
      getReserve8Page(this.queryParams).then(response => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    /** 取消按钮 */
    cancel() {
      this.open = false;
      this.reset();
    },
    /** 表单重置 */
    reset() {
      this.form = {
        id: undefined,
        userId: undefined,
        cardId: undefined,
        name: undefined,
        ksmc: undefined,
        ysmc: undefined,
        subHospitalID: undefined,
        reptNum: undefined,
        lockType: undefined,
        hisOrderNO: undefined,
        scheduleId: undefined,
        doctorCode: undefined,
        departCode: undefined,
        parTimeId: undefined,
        lockTime: undefined,
        patientId: undefined,
        mobile: undefined,
        serialNo: undefined,
        location: undefined,
        ticketNo: undefined,
        orderNo: undefined,
        timeInterval: undefined,
        registerdate: undefined,
        clinicFee: undefined,
        registrationFee: undefined,
        payNature: undefined,
        payType: undefined,
        powerTranID: undefined,
        powerTranCARD: undefined,
        terminalId: undefined,
        zFAmount: undefined,
        yBZHAmount: undefined,
        yBTCAmount: undefined,
        yBOutMsg: undefined,
        hisOperNum: undefined,
        referNo: undefined,
        token: undefined,
        appFlag: undefined,
        appStatus: undefined,
        appType: undefined,
        ctime: undefined,
        utime: undefined,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加预约挂号";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id;
      getReserve8(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改预约挂号";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (!valid) {
          return;
        }
        // 修改的提交
        if (this.form.id != null) {
          updateReserve8(this.form).then(response => {
            this.$modal.msgSuccess("修改成功");
            this.open = false;
            this.getList();
          });
          return;
        }
        // 添加的提交
        createReserve8(this.form).then(response => {
          this.$modal.msgSuccess("新增成功");
          this.open = false;
          this.getList();
        });
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const id = row.id;
      this.$modal.confirm('是否确认删除预约挂号编号为"' + id + '"的数据项?').then(function() {
          return deleteReserve8(id);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      // 处理查询参数
      let params = {...this.queryParams};
      params.pageNo = undefined;
      params.pageSize = undefined;
      this.$modal.confirm('是否确认导出所有预约挂号数据项?').then(() => {
          this.exportLoading = true;
          return exportReserve8Excel(params);
        }).then(response => {
          this.$download.excel(response, '预约挂号.xls');
          this.exportLoading = false;
        }).catch(() => {});
    }
  }
};
</script>
