<template>
  <el-container>
    <el-header style="margin-top: 10px">
      <el-button icon="el-icon-search" type="primary" @click="queryTermDialog = true">检索条件</el-button>
      <el-divider direction="vertical"></el-divider>
      <el-button v-if="shenHeQuanXian()" :disabled="queryTerm.list.length === 0" icon="el-icon-upload" type="success"
                 @click="upldAllList"> 选中上传
      </el-button>
      <el-button v-if="shenHeQuanXian()" :disabled="queryTerm.list.length === 0" icon="el-icon-upload" type="warning"
                 @click="upldSelections"> 全部上传
      </el-button>
      <el-button v-if="shenHeQuanXian()" :disabled="queryTerm.list.length === 0" icon="el-icon-download" type="success"
                 @click="exportExcel">导出 Execl
      </el-button>
      <el-button icon="el-icon-refresh-left" type="primary" @click="shuaXin">刷新数据</el-button>
      <el-button v-if="shenHeQuanXian()" type="success" @click="xianZhiShiJianClick">设置限制时间</el-button>
      <xian-zhi-shi-jian ref="xianZhiShiJian"></xian-zhi-shi-jian>
    </el-header>
    <el-main>
      <el-table ref="tableRef" :data="queryTerm.list" :height="store.state.app.windowSize.h / 1.2" border
                highlight-current-row
                stripe @selection-change="handleSelectionChange">
        <el-table-column fixed type="selection" width="35"></el-table-column>
        <el-table-column fixed label="姓名" prop="psnName">
          <template #default="scope">
            <el-button type="text" @click="jieSuanDanXinXi(scope.row)">
              <span v-html="auditName(scope.row)"></span>
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="出院科室" prop="outDeptName">
          <template #default="scope">
            <el-button
                v-if="scope.row.outDept === dept || shenHeQuanXian"
                type="text"
                @click="huoQuXiuGaiYiShen(scope.row.referPhysician, scope.row.referPhysicianName, scope.row.patNo, scope.row.times)"
            >
              {{ scope.row.outDeptName }}
            </el-button>
            <span v-else>{{ scope.row.outDeptName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="住院号/门诊号" prop="patNo"></el-table-column>
        <el-table-column label="性别" prop="gendName" width="40"></el-table-column>
        <el-table-column label="住院天数" prop="actIptDays"></el-table-column>
        <el-table-column label="医疗类别" prop="iptMedType">
          <template #default="scope">
            <el-button type="text" @click="clickToModifyMedicalCategory(scope.row)">{{
                getIptMedName(scope.row.iptMedType)
              }}
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="诊断编码" prop="disDiag"></el-table-column>
        <el-table-column label="诊断名称" prop="disDiagComment"></el-table-column>
        <el-table-column label="治疗方式" prop="operationName"></el-table-column>
        <el-table-column label="总费用" prop="medfeeSumamt"></el-table-column>
        <el-table-column label="报销金额" prop="fundPaySumamt"></el-table-column>
        <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
        <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
        <el-table-column label="结算时间" prop="setlTime"></el-table-column>
        <el-table-column label="医疗类别" prop="medTypeName"></el-table-column>
        <el-table-column label="清算机构" prop="clrOptinsName"></el-table-column>
        <el-table-column label="管床医生" prop="referPhysicianName"></el-table-column>
        <el-table-column label="转科室" prop="zhuanKeName"></el-table-column>
        <el-table-column label="申请备注" prop="reqRemark"></el-table-column>
        <el-table-column v-if="shenHeQuanXian()" label="结算单">
          <template #default="scope">
            <el-button @click="jieSuanDanClick(scope.row)">查看结算单</el-button>
          </template>
        </el-table-column>
      </el-table>
      <jie-suan-dan-da-ying v-if="daYingJieSuanDanRef.dialog" :data="daYingJieSuanDanRef"
                            @close="daYingJieSuanDanRef.dialog = false"></jie-suan-dan-da-ying>
      <el-pagination
          :current-page="queryTerm.currentPage"
          :page-size="queryTerm.pageSize"
          :page-sizes="[10, 20, 30, 40, 50, 100]"
          :total="queryTerm.total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
      >
      </el-pagination>
    </el-main>
    <el-dialog v-model="queryTermDialog" title="数据筛选" width="60%">
      <el-form ref="queryTermRef" :model="queryTerm" label-width="120px" size="mini">
        <el-row>
          <el-col :span="24">
            <el-form-item label="日期范围" prop="dateRange">
              <el-date-picker
                  v-model="queryTerm.dateRange"
                  :shortcuts="clockinShortcuts"
                  end-placeholder="结束日期"
                  placeholder="选择日期"
                  range-separator="至"
                  size="mini"
                  start-placeholder="开始日期"
                  style="width: 280px"
                  type="daterange"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="结算类型" prop="clrType">
              <el-select v-model="queryTerm.clrType" placeholder="结算类别" style="width: 100px">
                <el-option v-for="item in clrTypes" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="住院号" prop="patNo">
              <el-input v-model="queryTerm.patNo" clearable placeholder="住院号"
                        style="width: 120px" @blur="patNo = $event.target.value.trim()" @keyup.enter="query"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="出院科室" prop="disDept">
              <el-select v-model="queryTerm.outDept" :collapse-tags="true" clearable filterable multiple
                         placeholder="出院科室">
                <el-option v-for="item in disDepts" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="医疗类别" prop="medType">
              <el-select v-model="queryTerm.medType" :collapse-tags="true" clearable filterable multiple
                         placeholder="医疗类别">
                <el-option v-for="item in medTypes" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="上传类型" prop="psnType">
              <el-select v-model="queryTerm.flag">
                <el-option v-for="item in flags" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="管床医生" prop="referPhysician">
              <el-select v-model="queryTerm.referPhysician" :remote-method="remoteMethod" clearable filterable
                         placeholder="管床医生"
                         remote reserve-keyword>
                <el-option v-for="item in referPhysicians" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="险种类型" prop="insutype">
              <el-select v-model="queryTerm.insutype" :collapse-tags="true" clearable filterable multiple
                         placeholder="险种类型">
                <el-option v-for="item in insutypes" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="人员类别" prop="psnType">
              <el-select v-model="queryTerm.psnType" :collapse-tags="true" clearable filterable multiple
                         placeholder="人员类别">
                <el-option v-for="item in getPsnType" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="结算机构" prop="clrOptins">
              <el-select v-model="queryTerm.clrOptins" :collapse-tags="true" clearable filterable multiple
                         placeholder="结算机构">
                <el-option v-for="item in clrOptins" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="审核类型" prop="auditFlag">
              <el-select v-model="queryTerm.auditFlag">
                <el-option v-for="item in auditFlags" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="申报类型" prop="auditFlag">
              <el-select v-model="queryTerm.decTypes" :collapse-tags="true" clearable filterable multiple>
                <el-option v-for="item in decTypes" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="spanWidth">
            <el-form-item label="支付类型" prop="hiPaymtd">
              <el-select v-model="queryTerm.hiPaymtd" :collapse-tags="true" clearable>
                <el-option v-for="item in hiPaymtdData" :key="item.code" :label="item.name" :value="item.code">
                  <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                  <el-divider direction="vertical"></el-divider>
                  <span>{{ item.name }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-button icon="el-icon-search" size="small" type="primary" @click="query">查询</el-button>
      <el-button icon="el-icon-search" size="small" type="primary" @click="zhongKongTiaoJian">总控数据条件</el-button>

      <el-button icon="el-icon-refresh-right" size="small" type="warning" @click="chongZhi">重置</el-button>
      <el-divider direction="vertical"></el-divider>
    </el-dialog>
    <el-dialog v-model="xiuGaiYiShen" title="修改管床医生">
      <el-select v-model="guanChuangYiShen.yiShenCode" :remote-method="remoteMethod" clearable filterable remote
                 reserve-keyword>
        <el-option v-for="item in referPhysicians" :key="item.code" :label="item.name" :value="item.code">
          <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
          <el-divider direction="vertical"></el-divider>
          <span>{{ item.name }}</span>
        </el-option>
      </el-select>
      <el-divider direction="vertical"></el-divider>
      <el-button @click="xiuGaiGuanChuangYiShenClick">修改</el-button>
    </el-dialog>
    <jie-suan-dan-xiang-qing v-if="jieSuanDanDataDialog" :data="jieSuanDanData" @close="jieSuanDanDataDialog = false"
                             @shuaXin="shuaXin"></jie-suan-dan-xiang-qing>
    <Progress/>
    <el-dialog v-model="medType.dialog" title="修改住院医疗类别">
      <el-radio-group v-model="medType.iptMedType">
        <el-radio :label="1">住院</el-radio>
        <el-radio :label="2">日间手术</el-radio>
      </el-radio-group>
      <el-divider direction="vertical"></el-divider>
      <el-button @click="clickToSaveMedicalCategory">保存</el-button>
    </el-dialog>
  </el-container>
</template>

<script>
import {clockinShortcuts} from '@/data/shortcuts'
import {onMounted, ref, unref, watch} from 'vue'
import store from '../../../store'
import {getClrTypes, getInsutypes} from '@/api/medical-insurance/si-dict'
import {getDateRangeFormatDate} from '@/utils/date'
import {
  getMedType,
  huoQuJieSuanRenYuan,
  jieSuanDanKeXiuGaiXinXi,
  modifyMedicalCategory,
  upldSetlList,
  upldSetlListTimes,
  xiuGaiGuanChuangYiShen
} from '@/api/medical-insurance/si-setl-upload'
import {clrOptinsData, decTypes, getPsnType} from '../../../data'
import {getDept} from '@/api/yibao/xiang-mu-lu-ru'
import JieSuanDanXiangQing from '../../../components/si-sheet-upload/jie-suan-dan-xiu-gai/JieSuanDanXiangQing.vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import Progress from '../../../components/progress/Index.vue'
import {downloadExcel} from '@/utils/excel'
import {getRenYuan} from '@/api/public-api'
import {
  auditFlags,
  auditName,
  huoQuZhongKongChaXunTiaoJian,
  shenHeQuanXian
} from '@/components/si-sheet-upload/jieSuanDanXiuGai'
import XianZhiShiJian from '../../../components/si-sheet-upload/XianZhiShiJian.vue'
import {stringIsBlank, stringNotBlank} from '@/utils/blank-utils'
import JieSuanDanDaYing from '../../../components/si-sheet-upload/jieSuanDanDaYing.vue'

export default {
  name: 'SetSheetUpload',
  components: {JieSuanDanDaYing, XianZhiShiJian, JieSuanDanXiangQing, Progress},
  setup: function () {
    const queryTerm = ref({
      startTime: '',
      endTime: '',
      patNo: '', // 0406567
      referPhysician: shenHeQuanXian() ? '' : store.state.user.info.code,
      insutype: [],
      dateRange: [clockinShortcuts[0].value[0], clockinShortcuts[0].value[1]],
      outDept: [],
      clrType: '21',
      medType: [],
      clrOptins: [],
      decTypes: [],
      flag: 0,
      hiPaymtd: 0,
      auditFlag: 4,
      psnType: [],
      currentPage: 1,
      pageSize: 40,
      total: 0,
      list: [],
    })
    const dept = store.state.user.info.deptCode
    // 表单
    const queryTermRef = ref(null)
    // 表格的宽度
    const spanWidth = ref(8)
    // 查询的 对话框
    const queryTermDialog = ref(true)
    // 结算单信息
    const jieSuanDanData = ref({})
    // 险种类型
    const insutypes = ref([])
    // 出院科室
    const disDepts = ref([])
    // 结算类别
    const clrTypes = ref([])
    // 医疗类别
    const medTypes = ref([])
    // 结算机构
    const clrOptins = ref([])
    // 管床医生
    const referPhysicians = ref([])

    const selections = ref([])
    // 表格 ref
    const tableRef = ref(null)

    const jieSuanDanDataDialog = ref(false)

    const handleSelectionChange = (val) => {
      selections.value = val
    }

    const query = async () => {
      let form = unref(queryTermRef)
      if (!form) return
      try {
        await form.validate()
        let dates = getDateRangeFormatDate(queryTerm.value.dateRange)
        queryTerm.value.startTime = dates.startTime
        queryTerm.value.endTime = dates.endTime
        queryTerm.value.total = 0
        queryTerm.value.currentPage = 1
        huoQuJieSuanRenYuan(queryTerm.value).then((res) => {
          queryTerm.value.list = res === null ? [] : res.records
          queryTerm.value.total = res.total
          queryTermDialog.value = false
        })
      } catch (error) {
      }
    }

    const queryCurrentPage = async () => {
      let form = unref(queryTermRef)
      if (!form) return
      try {
        await form.validate()
        let dates = getDateRangeFormatDate(queryTerm.value.dateRange)
        queryTerm.value.startTime = dates.startTime
        queryTerm.value.endTime = dates.endTime
        huoQuJieSuanRenYuan(queryTerm.value).then((res) => {
          queryTerm.value.list = res.records
        })
      } catch (error) {
      }
    }

    watch(
        () => store.state.app.windowSize.w,
        () => {
          const w = store.state.app.windowSize.w
          if (w >= 1500) {
            spanWidth.value = 8
          } else if (w >= 1300) {
            spanWidth.value = 12
          } else {
            spanWidth.value = 24
          }
        }
    )

    const upldAllList = () => {
      if (queryTerm.value.clrType !== '21') {
        ElMessage({
          message: '结算类别请选择为【住院】！',
          type: 'warning',
          showClose: true,
        })
        return
      }
      upldSetlList(selections.value)
    }

    const upldSelections = () => {
      if (queryTerm.value.clrType !== '21') {
        ElMessage({
          message: '结算类别请选择为【住院】！',
          type: 'warning',
          showClose: true,
        })
        return
      }
      if (queryTerm.value.list.length === 0) {
        ElMessage({
          message: '请先查询出数据',
          type: 'warning',
          showClose: true,
        })
        return
      }
      upldSetlListTimes(queryTerm.value)
    }

    const handleSizeChange = (val) => {
      queryTerm.value.pageSize = val
      query()
    }

    const handleCurrentChange = (val) => {
      queryTerm.value.currentPage = val
      queryCurrentPage()
      tableRef.value.$refs.bodyWrapper.scrollTop = 0
    }

    const chongZhi = () => {
      unref(queryTermRef).resetFields()
    }

    const jieSuanDanXinXi = (val) => {
      if (queryTerm.value.clrType !== '21') {
        ElMessage({
          message: '结算类别请选择为【住院】！',
          type: 'warning',
          showClose: true,
        })
        return
      }
      jieSuanDanKeXiuGaiXinXi(val.patNo, val.times, val.ledgerSn).then((res) => {
        jieSuanDanData.value = res
        jieSuanDanData.value.medType = val.medType
        jieSuanDanData.value.actIptDays = val.actIptDays
        jieSuanDanData.value.outDeptName = val.outDeptName
        jieSuanDanData.value.medTypeName = val.medTypeName
        jieSuanDanData.value.insutypeName = val.insutypeName
        jieSuanDanData.value.disDiag = val.disDiag
        jieSuanDanData.value.disDiagComment = val.disDiagComment
        jieSuanDanData.value.medfeeSumamt = val.medfeeSumamt
        jieSuanDanData.value.fundPaySumamt = val.fundPaySumamt
        jieSuanDanData.value.decType = val.decType
        jieSuanDanData.value.upload = val
        jieSuanDanData.value.shenHeXinXi = {
          id: val.id,
          reqOpId: val.reqOpId,
          reqOpName: val.reqOpName,
          reqOpDate: val.reqOpDate,
          reqRemark: val.reqRemark,
          auditStaff: val.auditStaff,
          auditName: val.auditName,
          auditDate: val.auditDate,
          auditRemark: val.auditRemark,
          auditFlag: val.auditFlag,
        }
        jieSuanDanDataDialog.value = true
      })
    }

    const exportExcel = () => {
      if (queryTerm.value.total > 0) {
        ElMessageBox.prompt('导出文件名字', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          inputPattern: /\S/,
          inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
        })
            .then(({value}) => {
              const data = {
                param: queryTerm.value,
                url: '/setlListUpld/exportExcel',
                fileName: `${value}.xlsx`,
                jdt: true,
              }
              setTimeout(() => {
                downloadExcel(data)
              }, 500)
            })
            .catch((e) => {
            })
      } else {
        ElMessage.error('请先查询出数据')
      }
    }

    const remoteMethod = (val) => {
      if (val.length > 1) {
        getRenYuan(val).then((res) => {
          referPhysicians.value = res
        })
      }
    }

    const shuaXin = () => {
      queryCurrentPage()
    }

    /* 限制时间 */
    const xianZhiShiJian = ref(null)
    const xianZhiShiJianClick = () => {
      xianZhiShiJian.value.xianZhiShiJianDialog = true
    }

    /* 修改管床医生 */
    const guanChuangYiShen = ref({
      yiShenCode: '',
      patNo: '',
      times: 0,
    })
    const xiuGaiYiShen = ref(false)
    const huoQuXiuGaiYiShen = (code, name, patNo, times) => {
      if (stringNotBlank(code)) {
        referPhysicians.value = [{code: code, name: name}]
        guanChuangYiShen.value.yiShenCode = code
      }
      xiuGaiYiShen.value = true
      guanChuangYiShen.value.patNo = patNo
      guanChuangYiShen.value.times = times
    }

    const xiuGaiGuanChuangYiShenClick = () => {
      xiuGaiGuanChuangYiShen(guanChuangYiShen.value.patNo, guanChuangYiShen.value.times, guanChuangYiShen.value.yiShenCode).then((res) => {
        xiuGaiYiShen.value = false
        shuaXin()
      })
    }

    const zhongKongTiaoJian = () => {
      if (!shenHeQuanXian()) {
        queryTerm.value.outDept = [store.state.user.info.deptCode]
        referPhysicians.value = [{code: store.state.user.info.code, name: store.state.user.info.name}]
      }
      queryTerm.value.medType = ['22', '2101']
      queryTerm.value.insutype = huoQuZhongKongChaXunTiaoJian(insutypes.value, ['340', '350', '360', '510', '410'])
      queryTerm.value.psnType = huoQuZhongKongChaXunTiaoJian(getPsnType, ['13'])
      queryTerm.value.clrOptins = huoQuZhongKongChaXunTiaoJian(clrOptins.value, ['439900', '430121'])
    }

    const daYingJieSuanDanRef = ref({
      dialog: false,
      patNo: '',
      times: 0,
      ledgerSn: 0,
    })
    const jieSuanDanClick = (val) => {
      daYingJieSuanDanRef.value.dialog = true
      daYingJieSuanDanRef.value.patNo = val.patNo
      daYingJieSuanDanRef.value.times = val.times
      daYingJieSuanDanRef.value.ledgerSn = val.ledgerSn
    }

    let medType = $ref({
      dialog: false,
      setlId: '',
      iptMedType: 1,
    })
    const clickToModifyMedicalCategory = ({setlId, iptMedType}) => {
      if (stringIsBlank(setlId)) {
        return ElMessage.error('该患者没有结算ID')
      }
      medType.dialog = true
      medType.setlId = setlId
      medType.iptMedType = iptMedType
    }

    const clickToSaveMedicalCategory = () => {
      modifyMedicalCategory(medType.iptMedType, medType.setlId)
      query()
    }

    function getIptMedName(val) {
      switch (val) {
        case 1:
          return "住院"
        case  2:
          return "日间手术"
        default:
          return ""
      }
    }

    onMounted(() => {
      getInsutypes().then((res) => {
        insutypes.value = res
        getClrTypes().then((res2) => {
          clrTypes.value = res2
        })
      })
      getMedType().then((res) => {
        medTypes.value = res
      })
      getDept().then((res) => {
        disDepts.value = res
      })
      clrOptins.value = clrOptinsData
    })
    return {
      queryTerm,
      clockinShortcuts,
      handleSizeChange,
      handleCurrentChange,
      insutypes,
      query,
      upldAllList,
      upldSelections,
      disDepts,
      clrTypes,
      medTypes,
      getPsnType,
      queryTermDialog,
      chongZhi,
      queryTermRef,
      store,
      spanWidth,
      jieSuanDanXinXi,
      jieSuanDanData,
      handleSelectionChange,
      exportExcel,
      referPhysicians,
      clrOptins,
      jieSuanDanDataDialog,
      remoteMethod,
      auditFlags,
      shuaXin,
      xianZhiShiJian,
      xianZhiShiJianClick,
      shenHeQuanXian,
      guanChuangYiShen,
      huoQuXiuGaiYiShen,
      xiuGaiGuanChuangYiShenClick,
      xiuGaiYiShen,
      auditName,
      dept,
      decTypes,
      zhongKongTiaoJian,
      daYingJieSuanDanRef,
      jieSuanDanClick,
      flags: ref([
        {code: 0, name: '全部'},
        {code: 1, name: '未传'},
        {code: 2, name: '已传'},
      ]),
      hiPaymtdData: [
        {code: 1, name: '按项目'},
        {code: 2, name: '单病种'},
        {code: 3, name: '按病种分值'},
        {code: 4, name: '基本诊断相关分组（DRG）'},
        {code: 5, name: '按床日'},
        {code: 6, name: '按人次'},
        {code: 9, name: '其他'},
        {code: 0, name: '全部'},
      ],
      tableRef,
      getIptMedName,
      medType,
      clickToModifyMedicalCategory,
      clickToSaveMedicalCategory,
      medTypeData: [
        {code: 1, name: '住院'},
        {code: 1, name: '日间手术'}
      ]
    }
  },
}
</script>
