ztx.vue 10.5 KB
<template>
  <div class="">
    <div class="from-Card">
      <el-form
        v-show="showSearch" ref="queryRef" size="small" :model="queryParams" :inline="true"
        label-position="top"
      >
        <el-row style="width: 100%;">
          <el-col :span="4">
            <el-form-item label="结算编号" prop="flowCode">
              <el-input
                v-model="queryParams.flowCode"
                placeholder="请输入结算编号"
                clearable
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="缴费编号" prop="examCode">
              <el-input
                v-model="queryParams.examCode"
                placeholder="请输入缴费编号"
                clearable
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="名称" prop="mergeName">
              <el-input
                v-model="queryParams.mergeName"
                placeholder="请输入名称"
                clearable
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="状态" prop="status">
              <el-select v-model="queryParams.status" clearable style="width: 100%;" @change="handleQuery">
                <el-option label="全部" value="" />
                <el-option label="审批中" value="0" />
                <el-option label="审批通过" value="1" />
                <el-option label="审批拒绝" value="2" />
                <el-option label="审批撤回" value="3" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="上报单位" prop="applyName">
              <el-input
                v-model="queryParams.applyName"
                placeholder="请输入上报单位"
                clearable
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="1" />
          <el-col :span="4" :hidden="showCollect">
            <el-form-item label="缴费状态" prop="payStatus">
              <el-select v-model="queryParams.examPayStatus" style="width: 100%;" clearable @change="handleQuery">
                <el-option label="全部" value="" />
                <el-option label="已结算" value="3" />
                <el-option label="已上传凭证" value="5" />
                <el-option label="未上传凭证" value="4" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" :hidden="showCollect">
            <el-form-item label="审核日期" prop="overTimeRange">
              <el-date-picker
                v-model="queryParams.overTimeRange"
                clearable
                type="daterange"
                range-separator="至"
                start-placeholder="开始时间"
                end-placeholder="结束时间"
                value-format="YYYY-MM-DD"
                style="width: 100%;"
                @change="handleQuery"
              />
            </el-form-item>
          </el-col>
          <div class="po-r-btns">
            <el-button size="small" type="primary" @click="handleQuery">搜索</el-button>
            <el-button size="small" @click="resetQuery">重置</el-button>
            <el-button
              v-if="showCollect" size="small" type="primary" link icon="ArrowDown"
              @click="showCollect=!showCollect"
            >展开</el-button>
            <el-button
              v-else size="small" type="primary" link icon="ArrowUp"
              @click="showCollect=!showCollect"
            >收起</el-button>
          </div>
        </el-row>
      </el-form>
      <el-row justify="space-between">
        <div>
          <el-button v-hasPermi="['exam:*']" type="warning" :icon="Download" @click="handleExport">导出</el-button>
        </div>
      </el-row>
    </div>

    <div class="table">
      <el-table v-loading="loading" border :data="infoList" :row-class-name="tableRowClassName">
        <el-table-column type="index" width="55" align="center" label="序号" />
        <el-table-column label="结算编号" align="center" prop="flowCode" width="140" :show-overflow-tooltip="true" />
        <el-table-column label="名称" align="center" prop="mergeName" min-width="180" :show-overflow-tooltip="true" />
        <el-table-column label="考试人数" align="center" prop="totalNum" width="90" />
        <el-table-column label="总金额" align="center" prop="totalAmount" min-width="120" />
        <el-table-column label="上报单位" align="center" prop="memName" min-width="120" :show-overflow-tooltip="true" />
        <el-table-column label="提交时间" align="center" prop="mergeTime" width="140">
          <template #default="scope">
            <span>{{ parseTime(scope.row.mergeTime, '{y}-{m}-{d} {h}:{i}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="审核状态" align="center" prop="statusStr" width="120">
          <template #default="scope">
            <span
              :class="{
                'text-success':scope.row.status=='1',
                'text-danger':scope.row.status=='2',
                'text-warning':scope.row.status=='3'
              }"
            >{{ scope.row.statusStr }}</span>
          </template>
        </el-table-column>
        <el-table-column label="缴费状态" align="center" prop="examPayStatusStr" min-width="120">
          <template #default="scope">
            <div
              :class="{
                ' text-success':scope.row.examPayStatusStr=='已上传凭证',
                'text-danger':scope.row.examPayStatusStr=='未上传凭证',
                'text-warning':scope.row.examPayStatusStr=='已结算'
              }"
            >
              {{ scope.row.examPayStatusStr }}
            </div>
          </template>
        </el-table-column>
        <el-table-column
          label="审核进度"
          align="center"
          prop=""
          min-width="120"
        >
          <template #default="scope">
            <schedule v-if="scope.row.status == 1||scope.row.status == 0" :audit-process="scope.row.auditProcess" />
          </template>
        </el-table-column>
        <el-table-column label="审核日期" align="center" prop="overDate" min-width="120" :show-overflow-tooltip="true">
          <template #default="scope">
            <span>{{ parseTime(scope.row.overDate, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <!--        <el-table-column label="原因" align="center" prop="reason" width="200" :show-overflow-tooltip="true" />-->
        <el-table-column width="260" label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-button type="primary" @click="handleView(scope.row)">查看</el-button>
            <el-button color="#13B5B1" style="--el-color-black:#fff;" :disabled="!(scope.row.status=='0')" type="primary" @click="handleApproval(scope.row)">审批</el-button>
            <el-button :disabled="!(scope.row.isView=='1' && scope.row.status=='1') || scope.row.payStatus=='3'" type="danger" @click="handleBack(scope.row)">撤回</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div v-show="total>0" class="totalCost">
        费用合计:<span>{{ statistical.totalCost?.toFixed(2) }} </span>
        考试人数合计:<span>{{ statistical.totalPerson }} </span>
      </div>
      <pagination
        v-show="total>0"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        :total="total"
        @pagination="getList"
      />
    </div>
  </div>
</template>

<script setup>
import { getVerityMergeList } from '@/api/exam/info'
import { getCurrentInstance, reactive } from '@vue/runtime-core'
import { onMounted, ref, toRefs } from 'vue'
import { parseTime } from '@/utils/ruoyi'
import _ from 'lodash'
import jsonlint from '@/utils/jsonlint/jsonlint'
import { Download } from '@element-plus/icons-vue'
import Schedule from '@/views/member/components/schedule.vue'

const { proxy } = getCurrentInstance()
const emit = defineEmits(['viewExam', 'doApproval', 'doBack', 'viewMerge'])

const infoList = ref([])
const loading = ref(true)
const showSearch = ref(true)
const total = ref(0)
const showCollect = ref(true)
const statistical = ref({})

const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    flowCode: undefined,
    mergeName: undefined,
    applyName: undefined,
    status: '0',
    examCode: undefined,
    type: '1',
    examPayStatus: undefined
  }
})
const { queryParams } = toRefs(data)
const statusArr = ['审批中', '审批通过', '审批拒绝', '审批撤回']

onMounted(() => {
  getList()
})

// // 背景色
const tableRowClassName = ({
  row,
  rowIndex
}) => {
  // console.log(row)

  if (row.status == 1) {
    return 'success-row'
  }
}

/** 查询考级信息列表 */
function getList() {
  loading.value = true
  statistical.value = {
    totalCost: 0,
    totalPerson: 0
  }
  getVerityMergeList(queryParams.value).then(response => {
    const list = []
    _.each(response.rows, r => {
      const item = jsonlint.parse(r.remark)
      item.recordId = r.recordId
      item.status = r.auditStatus
      item.statusStr = statusArr[r.auditStatus]
      item.isView = r.isView
      item.payStatus = r.payStatus
      item.examPayStatusStr = r.examPayStatusStr
      item.sourceData = r
      item.auditProcess = r.auditProcess
      item.overDate = r.overDate
      list.push(item)

      statistical.value.totalCost += (item.totalAmount * 1)
      statistical.value.totalPerson += (item.totalNum * 1)
    })
    infoList.value = list
    total.value = response.total
    loading.value = false
  })
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1
  getList()
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm('queryRef')
  handleQuery()
}

function handleView(row) {
  emit('viewMerge', row)
}

function handleApproval(row) {
  emit('doApproval', row.recordId, { isZtx: true })
}

function handleBack(row) {
  emit('doBack', row)
}

function handleExport() {
  proxy.download('/exam/info/export/verityMergeList', {
    ...queryParams.value
  }, `级位考试审核_${new Date().getTime()}.xlsx`)
}


defineExpose({
  getList
})
</script>