张延森 3 years ago
parent
commit
241df8d142
1 changed files with 11 additions and 2 deletions
  1. 11
    2
      src/pages/History/Item.jsx

+ 11
- 2
src/pages/History/Item.jsx View File

@@ -7,11 +7,20 @@ export default (props) => {
7 7
   const { barData, person } = props;
8 8
 
9 9
   const { tagType, tagText } = useMemo(() => {
10
+    let reportStat = null;
11
+    if (barData.reqStat < '3') {
12
+      reportStat = '无报告'
13
+    } else if (barData.reqStat < '6') {
14
+      reportStat = '报告未出'
15
+    } else {
16
+      reportStat = '阴性'
17
+    }
18
+
10 19
     const hasReport = barData.reqStat === '6'
11 20
 
12 21
     return {
13 22
       tagType: hasReport ? 'success' : undefined,
14
-      tagText: hasReport ? '阴性' : '报告未出',
23
+      tagText: reportStat,
15 24
      }
16 25
   }, [barData])
17 26
 
@@ -21,7 +30,7 @@ export default (props) => {
21 30
         <BarCode ratio={0.5} height={60} code={barData.barcode} />
22 31
       </View>
23 32
       <View className='history-item-info'>
24
-        <View>{person?.personName}</View>
33
+        <View>{barData.patName}</View>
25 34
         <View>{barData.sampledDt || <View style={{ color: 'red' }} >未采样</View>}</View>
26 35
         <View>
27 36
           <Tag size='large' type={tagType}>{tagText}</Tag>