<!-- 设备收发管理详情 -- 检定流程 -->
<script name="SendReceiveDetailOrder" lang="ts" setup>
import certificationMonitor from '../components/certificationMonitor.vue'
import ProcessConfig from './processConfig.vue'
import { getTaskDetail } from '@/api/business/manager/task'
const props = defineProps({
  pageType: { // 页面类型
    type: String,
    default: 'detail',
  },
  orderId: { // 任务单id
    type: String,
    required: true,
  },
  sampleId: { // 样品id
    type: String,
    required: true,
  },
})
const roleType = ref('distribute') // 角色类型: distribute待分发(分发人员), dispatch待分配(实验室分配工作人员),
const measureProcessList = ref([]) as any // 检定流程
const measureSendBackList = ref([]) as any // 退回流程

// 获取检定流程
const getInfo = () => {
  // 获取任务详情
  getTaskDetail({ orderId: props.orderId!, sampleId: props.sampleId! }).then((res: any) => {
    measureProcessList.value = res.data.measureProcessList
    measureSendBackList.value = res.data.measureSendBackList
  })
}
onMounted(() => {
  nextTick(() => {
    getInfo()
  })
})
</script>

<template>
  <!-- 检定流程 -->
  <detail-block v-if="measureProcessList.length" title="检定流程">
    <process-config ref="processConfigRef" :type="roleType" :order-id="props.orderId!" :list="measureProcessList" :sample-id="props.sampleId!" :detail="true" />
  </detail-block>
  <!-- 退回流程 -->
  <detail-block v-if="measureSendBackList.length" title="退回流程">
    <process-config ref="processConfigRef" measure-type="sendBack" :type="roleType" :order-id="props.orderId!" :list="measureSendBackList" :sample-id="props.sampleId!" :detail="true" />
  </detail-block>
  <!-- 证书监控 -->
  <detail-block title="证书监控">
    <certification-monitor :sample-id="props.sampleId!" :order-id="props.orderId!" />
  </detail-block>
</template>
