|  | @@ -0,0 +1,111 @@
 | 
	
		
			
				|  |  | +<script setup lang="ts">
 | 
	
		
			
				|  |  | +import {onMounted, ref} from "vue";
 | 
	
		
			
				|  |  | +import {getJcIdByPatNo, getExamineDetail} from '@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing'
 | 
	
		
			
				|  |  | +import CyAutoSize from "@/components/cy/auto-size/cy-auto-size.vue";
 | 
	
		
			
				|  |  | +import XcOption from "@/components/xiao-chan/select/XcOption.vue";
 | 
	
		
			
				|  |  | +import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
 | 
	
		
			
				|  |  | +import {dateBr} from "@/utils/moment-utils";
 | 
	
		
			
				|  |  | +import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const props = defineProps({
 | 
	
		
			
				|  |  | +  patNo: String,
 | 
	
		
			
				|  |  | +  times: Number
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const jcIdList = ref<string[]>([])
 | 
	
		
			
				|  |  | +const currentId = ref('')
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const orderData = ref([])
 | 
	
		
			
				|  |  | +const details = ref({})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +function queryDetails() {
 | 
	
		
			
				|  |  | +  getExamineDetail(currentId.value).then(res => {
 | 
	
		
			
				|  |  | +    orderData.value = res
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const formItems = [
 | 
	
		
			
				|  |  | +  {prop: 'applyDate', label: '时间'},
 | 
	
		
			
				|  |  | +  {prop: 'applyDoctorName', label: '医生'},
 | 
	
		
			
				|  |  | +  {prop: 'textJc', label: '所见'},
 | 
	
		
			
				|  |  | +  {prop: 'textZd', label: '诊断'}
 | 
	
		
			
				|  |  | +]
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +function rowClick(row) {
 | 
	
		
			
				|  |  | +  details.value = row
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +async function queryData() {
 | 
	
		
			
				|  |  | +  if (!props.patNo) {
 | 
	
		
			
				|  |  | +    return
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  const res = await getJcIdByPatNo(props.patNo).catch(err => {
 | 
	
		
			
				|  |  | +    return []
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +  const temp: string[] = res
 | 
	
		
			
				|  |  | +  if (temp.length > 0) {
 | 
	
		
			
				|  |  | +    currentId.value = temp[0]
 | 
	
		
			
				|  |  | +    const tempData = []
 | 
	
		
			
				|  |  | +    temp.forEach(item => {
 | 
	
		
			
				|  |  | +      tempData.push({
 | 
	
		
			
				|  |  | +        code: item,
 | 
	
		
			
				|  |  | +        name: item
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    jcIdList.value = tempData
 | 
	
		
			
				|  |  | +  } else {
 | 
	
		
			
				|  |  | +    jcIdList.value = []
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  queryDetails()
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +onMounted(() => {
 | 
	
		
			
				|  |  | +  queryData()
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +defineExpose({
 | 
	
		
			
				|  |  | +  queryData
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<template>
 | 
	
		
			
				|  |  | +  <div style="width: 100%; height: 100%; display: flex ">
 | 
	
		
			
				|  |  | +    <div style="width: 300px; height: 100%">
 | 
	
		
			
				|  |  | +      <cy-auto-size>
 | 
	
		
			
				|  |  | +        <template #default="{width, height}">
 | 
	
		
			
				|  |  | +          <xc-table :local-data="orderData"
 | 
	
		
			
				|  |  | +                    @rowClick="rowClick"
 | 
	
		
			
				|  |  | +                    layout="total,  prev, pager, next"
 | 
	
		
			
				|  |  | +                    :final-height="height - 40" small>
 | 
	
		
			
				|  |  | +            <el-table-column prop="orderName" label="检查名"/>
 | 
	
		
			
				|  |  | +            <el-table-column prop="applyDate" label="时间">
 | 
	
		
			
				|  |  | +              <template #header>
 | 
	
		
			
				|  |  | +                <el-select v-model="currentId">
 | 
	
		
			
				|  |  | +                  <xc-el-option :data="jcIdList"/>
 | 
	
		
			
				|  |  | +                </el-select>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template #default="{row}">
 | 
	
		
			
				|  |  | +                <span v-html="dateBr(row.applyDate)"></span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +          </xc-table>
 | 
	
		
			
				|  |  | +        </template>
 | 
	
		
			
				|  |  | +      </cy-auto-size>
 | 
	
		
			
				|  |  | +    </div>
 | 
	
		
			
				|  |  | +    <div class="details_main">
 | 
	
		
			
				|  |  | +      <el-form>
 | 
	
		
			
				|  |  | +        <el-form-item v-for="item in formItems" :label="item.label + ':'">
 | 
	
		
			
				|  |  | +          {{ details[item.prop] }}
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +    </div>
 | 
	
		
			
				|  |  | +  </div>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<style scoped lang="scss">
 | 
	
		
			
				|  |  | +.details_main {
 | 
	
		
			
				|  |  | +  flex: 1;
 | 
	
		
			
				|  |  | +  overflow: auto;
 | 
	
		
			
				|  |  | +  padding: 10px;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</style>
 |