index.vue 12.8 KB
<template>
  <div class="app-container">
    <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="examCode">
              <el-input
                v-model="queryParams.examCode"
                placeholder="请输入缴费编号"
                clearable
                style="width: 100%;"
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="考段名称" prop="name">
              <el-input
                v-model="queryParams.name"
                placeholder="请输入考段名称"
                clearable
                style="width: 100%;"
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="状态" prop="scoreStatus">
              <el-select v-model="queryParams.scoreStatus" style="width: 100%;" clearable placeholder="全部" @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-option label="审核撤回" value="4" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="申请单位" prop="applyName">
              <el-input
                v-model="queryParams.applyName"
                style="width: 100%;"
                placeholder="请输入申请单位"
                clearable
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="考段考官" prop="examiner">
              <el-input
                v-model="queryParams.examiner"
                style="width: 100%;"
                placeholder="请输入考级考官"
                clearable
                @keyup.enter="handleQuery"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8" :hidden="showCollect">
            <el-form-item label="申请日期" prop="applyTimeRange">
              <el-date-picker
                v-model="queryParams.applyTimeRange"
                style="width: 100%;"
                clearable
                type="daterange"
                range-separator="至"
                start-placeholder="开始时间"
                end-placeholder="结束时间"
                value-format="YYYY-MM-DD"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8" :hidden="showCollect">
            <el-form-item label="考段日期" prop="examTimeRange">
              <el-date-picker
                v-model="queryParams.examTimeRange"
                clearable
                style="width: 100%;"
                type="daterange"
                range-separator="至"
                start-placeholder="开始时间"
                end-placeholder="结束时间"
                value-format="YYYY-MM-DD"
              />
            </el-form-item>
          </el-col>
          <el-col :span="2" />
          <el-col :span="8" :hidden="showCollect">
            <el-form-item label="审核日期" prop="verityTimeRange">
              <el-date-picker
                v-model="queryParams.verityTimeRange"
                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
            :icon="Download"
            type="warning"
            @click="handleExport"
          >导出</el-button>
        </div>
      </el-row>
    </div>

    <!--    <el-row :gutter="10" class="mb8">-->
    <!--      <el-col :span="1.5">-->
    <!--        <el-button-->
    <!--          v-hasPermi="['exam:*']"-->
    <!--          type="warning"-->
    <!--          plain-->
    <!--          @click="handleExport"-->
    <!--        >导出</el-button>-->
    <!--      </el-col>-->
    <!--      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />-->
    <!--    </el-row>-->
    <div class="table">
      <el-table v-loading="loading" :row-class-name="tableRowClassName" :data="infoList" border>
        <el-table-column type="index" width="55" align="center" label="序号" />
        <el-table-column label="缴费编号" align="center" prop="examCode" min-width="120" :show-overflow-tooltip="true" />
        <el-table-column label="考段名称" align="center" prop="name" min-width="220" :show-overflow-tooltip="true" />
        <el-table-column label="申请单位" align="center" prop="memberName" min-width="100" :show-overflow-tooltip="true" />
        <el-table-column label="申请日期" align="center" prop="applyTime" min-width="100">
          <template #default="scope">
            <span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="考段开始日期" align="center" prop="startTime" width="150">
          <template #default="scope">
            <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="考段结束日期" align="center" prop="endTime" width="150">
          <template #default="scope">
            <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="审核通过" align="center" prop="endTime" width="150">
          <template #default="scope">
            <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="考段地点" align="center" prop="address" min-width="100" :show-overflow-tooltip="true" />
        <el-table-column label="考段考官" align="center" prop="examinerNames" :show-overflow-tooltip="true" min-width="100" />
        <el-table-column label="考段考生数" align="center" prop="totalNum" width="90" />
        <el-table-column label="总金额" align="center" prop="totalAmount" min-width="120">
          <template #default="scope">
            <span>{{ (scope.row.totalAmount*1).toFixed(2) }} </span>
          </template>
        </el-table-column>
        <el-table-column label="状态" align="center" prop="scoreStatusStr" min-width="100">
          <template #default="scope">
            <span
              :class="{
                'text-success':scope.row.scoreStatus=='2',
                'text-danger':scope.row.scoreStatus=='3',
                'text-warning':scope.row.scoreStatus=='4'
              }"
            >{{ scope.row.scoreStatusStr }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="审核进度"
          align="center"
          prop=""
          min-width="120"
        >
          <template #default="scope">
            <el-progress v-if="scope.row.scoreStatus == 1||scope.row.scoreStatus == 2" :percentage="scope.row.processCentBar" :format="format" />

          </template>
        </el-table-column>
        <el-table-column label="操作" fixed="right" align="center" width="260" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-button type="primary" @click="handleView(scope.row)">查看</el-button>
            <el-button :disabled="!scope.row.transcript" type="warning" @click="viewTranscript(scope.row)">资料</el-button>
            <el-button
              :disabled="!((scope.row.scoreStatus=='0'||scope.row.scoreStatus=='3' || scope.row.scoreStatus=='4' ) && scope.row.rankStatus == '1')"
              color="#13B5B1" style="--el-color-black:#fff;" @click="scoreEdit(scope.row)"
            >成绩维护
            </el-button>
          </template>
        </el-table-column>
      </el-table>

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


    <exam-view ref="examViewRef" />
    <!--    <view-files ref="viewFilesRef" />-->
    <!--    <div>-->
    <!--      &lt;!&ndash; 通知单 &ndash;&gt;-->
    <!--      <el-link v-show="false" ref="linkRef1" :href="fillImgUrl(transcript?.tz?.[0]?.url)" :underline="false" target="_blank" />-->
    <!--      &lt;!&ndash; 签到表 &ndash;&gt;-->
    <!--      <el-link v-show="false" ref="linkRef2" :href="fillImgUrl(transcript?.qd?.[0]?.url)" :underline="false" target="_blank" />-->
    <!--      &lt;!&ndash; 合照 &ndash;&gt;-->
    <!--      <el-link v-show="false" ref="linkRef3" :href="fillImgUrl(transcript?.hz?.[0]?.url)" :underline="false" target="_blank" />-->
    <!--      &lt;!&ndash; 成绩单 &ndash;&gt;-->
    <!--      <el-link v-show="false" ref="linkRef4" :href="fillImgUrl(transcript?.cj?.[0]?.url)" :underline="false" target="_blank" />-->
    <!--    </div>-->
  </div>
</template>

<script setup name="Rank_Score">
import { getRankScoreList } from '@/api/exam/info'
import { getCurrentInstance, reactive } from '@vue/runtime-core'
import { onMounted, ref, toRefs, watch } from 'vue'
import { parseTime } from '@/utils/ruoyi'
import ExamView from '@/views/exam/rank/apply/components/examView'
import { useRoute, useRouter } from 'vue-router'
import useTagsViewStore from '@/store/modules/tagsView'
// import ViewFiles from '@/views/exam/components/viewRankFiles'
import { Download } from '@element-plus/icons-vue'

const route = useRoute()
const { proxy } = getCurrentInstance()
const router = useRouter()
const showCollect = ref(true)
const infoList = ref([])
const loading = ref(true)
const showSearch = ref(true)
const total = ref(0)
const transcript = ref()
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: undefined,
    applyTimeRange: undefined,
    examTimeRange: undefined,
    applyName: undefined,
    examiner: undefined,
    scoreStatus: undefined,
    examCode: undefined,
    type: '2'
  }
})

const { queryParams } = toRefs(data)

let type
onMounted(() => {
  if (route.path.indexOf('rank') > -1) {
    type = 'rank'
    queryParams.value.type = '2'
  } else if (route.path.indexOf('beyond') > -1) {
    type = 'beyond'
    queryParams.value.type = '3'
  }

  getList()
})

watch(() => useTagsViewStore().reSearch, (val) => {
  if (val) {
    getList()
  }
})

// // 背景色
const tableRowClassName = ({
  row,
  rowIndex
}) => {
  console.log(row.status)
  if (row.scoreStatus == '2') {
    return 'success-row'
  }
}


/** 查询考级信息列表 */
function getList() {
  loading.value = true
  getRankScoreList(queryParams.value).then(response => {
    infoList.value = response.rows
    total.value = response.total
    loading.value = false
  })
}

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

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

function handleView(row) {
  proxy.$refs['examViewRef'].open(row.examId)
}

function scoreEdit(row) {
  router.push(`/${type}/score/modify/${row.examId}?step=2`)
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download('exam/info/export', {
    ...queryParams.value
  }, `段位考试信息_${new Date().getTime()}.xlsx`)
}

// 审核进度
function format(percentage) {
  if (percentage == 0) {
    return (percentage = 0 + '/' + 1)
  }
  if (percentage == 100) {
    return (percentage = 1 + '/' + 1)
  }
}

function viewTranscript(row) {
  console.log(row)
  proxy.download('/exam/info/duanDataDown', {
    examId: row.examId
  }, ``)
  // console.log(transcript.value)
}
</script>
<style lang="scss" scoped>

</style>