<template>
  <view class="screeningRecord">
    <view class="screeningRecordItem" v-for="(item,index) in screeningResultData" :key="index">
      <!-- <view>筛查日期：{{ item.screeningDate }}</view> -->
      <view style="font-size: 16px;font-weight: 900;">{{ item.screeningDate }}</view>
      <view style="border-bottom: 1px solid #EDEDED;margin: 8px 0;"></view>
      <view>筛查医院：{{ item.deptName }}</view>
      <view>责任医生：{{ item.doctorName}}</view>
      <view style="border-bottom: 1px solid #EDEDED;margin: 10px 0;"></view>
      <view style="color: #346CF2;text-align: center;font-size: 30rpx;" @click="goToScreeningResult(item)">
        <span>查看筛查结果</span>
      </view>
    </view>
    
  </view>
</template>

<script>
  // import { screeningResultList } from "@/service/api/jsApi.js"
  import { screeningResultList } from '@/api/pagesB/screeningRecord/screeningRecord.js'
  export default {
    data() {
      return {
        screeningResultData:[],
        registerId:""
      };
    },
    onLoad(e) {
      if(e) {
        this.registerId = e.registerId
      }
      this.getScreeningResultList()
    },
    methods:{
      //获取结果记录列表
      getScreeningResultList() {
        screeningResultList(this.registerId).then(res => {
          console.log(res);
          this.screeningResultData = res.data.rows
        })
      },
      goToScreeningResult(item) {
        uni.navigateTo({
          url:`../screeningResult/screeningResult?screeningId=${item.screeningId}&registerId=${this.registerId}&type=1`
        })
      }
    }
  }
</script>

<style lang="scss">
  .screeningRecord {
    width: 94%;
    margin: 10px auto;

    .screeningRecordItem {
      margin-top: 10px;
      padding: 10px 20px;
      background-color: #fff;
      line-height: 30px;
      border-radius: 10px;
    }
  }
</style>
