reviewList.vue 2.38 KB
<template>
  <view>
    <view class="wBox">
      <view class="tt">
        审核信息
      </view>
      <view>
        <view v-for="(n,index) in recordList" :key="index" class="stepItem">
          <view class="time">{{ n.auditTime || '待审批' }}</view>
          <view class="content">
            <view class="status">
              <text v-if="n.auditResult==1" class="text-success">审核通过</text>
              <text v-if="n.auditResult==0" class="text-danger"> 审核拒绝</text>
            </view>
            <!-- <view class="name">{{index+1}}</view> -->
            <view class="deptName">{{ n.auditDeptName }}</view>
            <view v-if="n.auditResult==0">
              备注:{{ n.auditMsg || '/' }}
            </view>
          </view>
        </view>
      </view>
    </view>
  
  </view>
</template>

<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import _ from 'underscore'
import to from 'await-to-js'
import {
  onMounted,
  ref
} from 'vue'
import {
  onLoad,
  onShow
} from '@dcloudio/uni-app'

const app = getApp();
const userType = ref('')
const recordList = ref([])

onLoad(async (option) => {
  console.log(option)
  if (!option.type || option.type == 1) await getMyRecentFN()
  if (option.type == 2) await getMyRecentExamFn()
})

async function getMyRecentFN() {
  const [err, res] = await to(api.getMyRecent())
  if (!err && res.data && res.data.auditLogs) {
    try {
      recordList.value = JSON.parse(res.data.auditLogs) || []
    } catch (e) {
      recordList.value = []
    }
  }
}

async function getMyRecentExamFn() {
  const [err, res] = await to(api.getMyRecentExam())
  if (!err && res.data && res.data.auditLogs) {
    try {
      recordList.value = JSON.parse(res.data.auditLogs) || []
    } catch (e) {
      recordList.value = []
    }
  }
}
</script>

<style lang="scss" scoped>
.wBox {
  width: 700rpx;
  padding: 30rpx;
  margin: 20rpx auto;
  background: #FFFFFF;
  box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1);
  border-radius: 15rpx;
  
  .tt {
    color: #0A1629;
    margin: 0 0 30rpx;
    font-size: 30rpx;
  }
  
  .ddd {
    font-size: 28rpx;
    color: #333;
    margin: 0 0 10rpx;
    
    .lab {
      color: #999;
      display: inline-block;
      text-align: justify;
    }
  }
}
</style>