安全在线教育平台
zhouwx
11 hours ago 81c81ad6899496bbb46a59c815503f1f90bc4718
src/views/onlineEducation/count/index.vue
@@ -2,14 +2,14 @@
  <div class="app-container">
    <div>
      <el-form style="display: flex;flex-wrap: wrap">
        <el-form-item label="企业:" v-if="state.isAdmin">
        <el-form-item label="单位:" v-if="state.isAdmin">
          <el-select
              v-model="state.queryParams.companyName"
              filterable
              remote
              @change="selectValue"
              reserve-keyword
              placeholder="请输入企业名称"
              placeholder="请输入单位名称"
              remote-show-suffix
              :remote-method="getCompanyList"
              :loading="loadingCompany"
@@ -51,8 +51,8 @@
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="state.dataList" :border="true" row-key="id">
      <el-table-column label="序号" type="index" align="center" width="80" />
      <el-table-column label="企业名称" prop="companyName" align="center" />
      <el-table-column label="企业编号" prop="companyCode" align="center" />
      <el-table-column label="单位名称" prop="companyName" align="center" />
      <el-table-column label="单位编号" prop="companyCode" align="center" />
      <el-table-column label="总批次/人数" prop="sort" align="center"  >
        <template #default="scope">
          <span>{{scope.row.phaseStudentCount && scope.row.phaseCount ? scope.row.phaseCount + '/' +scope.row.phaseStudentCount:''}}</span>
@@ -139,7 +139,7 @@
    state.dataList = res.data.list.map(item => {
      return {
        ...item,
        passRate: item.passStudentCount!=null && item.paperStudentCount!=null ? (item.passStudentCount / item.paperStudentCount).toFixed(2) *100 + '%': ''
        passRate: item.passStudentCount  && item.paperStudentCount ? ((item.passStudentCount / item.paperStudentCount)*100).toFixed(2).replace(/\.00$/, '')  + '%': item.passStudentCount == 0  && item.paperStudentCount == 0? '0%': ''
      }
    })
@@ -186,11 +186,12 @@
//   }, 500)
// }
const setDate = () => {
  let isDate = new Date()
  let sTime = `${isDate.getFullYear()}-${isDate.getMonth() + 1}-${isDate.getDate()-7}`
  let eTime = `${isDate.getFullYear()}-${isDate.getMonth() + 1}-${isDate.getDate()}`
  sTime = `${sTime}`
  eTime = `${eTime}`
  const end = new Date();
  const start = new Date();
  start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  const sTime = moment(start).format('YYYY-MM-DD')
  const eTime = moment(end).format('YYYY-MM-DD')
  searchTime.value = [sTime,eTime];
  state.queryParams.startTime = searchTime.value[0]+' 00:00:00'
  state.queryParams.endTime = searchTime.value[1]+' 00:00:00'