miaofuhao 1 yıl önce
ebeveyn
işleme
d8a7432f63

+ 2 - 0
CMS1.0/src/views/main/followUp/followUpPlan/followUpPlan.vue

@@ -188,9 +188,11 @@ const cardListRef = ref(null)
188 188
 onActivated(() => {
189 189
   activatedFlag.value = true
190 190
   planId.value  = ''
191
+  planData.value = []
191 192
   geFollowUpList();
192 193
 })
193 194
 onMounted(() => {
195
+  planData.value = []
194 196
   geFollowUpList()
195 197
 });
196 198
 function handleKeyUpEnter() {

+ 18 - 16
CMS1.0/src/views/main/patientFile/patientFileList/cpns/logs/log.vue

@@ -24,23 +24,25 @@ const props = defineProps({
24 24
 const emit = defineEmits(['getLogs'])
25 25
 
26 26
 const logs = ref([]);
27
-
28
-onMounted(async () => {
29
-
30
-    const result = await getPatientLogs({
31
-        patientId: props.patientId,
32
-    });
33
-
34
-    if (result.data && result.data.length > 0) {
35
-        logs.value = result.data
36
-
37
-        // 父组件可能未加载完成,所以延迟1s推送数据
38
-        setTimeout(() => {
39
-            emit('getLogs', logs.value)
40
-        }, 1000)
41
-    }
27
+watch(props, (nweProps) => {
28
+  initMethod(nweProps);
29
+});
30
+onMounted(() => {
31
+    initMethod()
42 32
 })
43
-    
33
+function initMethod() {
34
+    getPatientLogs({
35
+        patientId: props.patientId,
36
+    }).then((res) => {
37
+        if (res.state === 'success') {
38
+            logs.value = res.data;
39
+            // 父组件可能未加载完成,所以延迟1s推送数据
40
+            setTimeout(() => {
41
+                emit('getLogs', logs.value)
42
+            }, 1000)
43
+        }
44
+    })
45
+}   
44 46
 </script>
45 47
 
46 48
 <style lang="scss" scoped>

+ 7 - 4
CMS1.0/src/views/main/patientFile/patientFileList/cpns/visitLogs/visitLogs.vue

@@ -38,14 +38,18 @@ const props = defineProps({
38 38
         default: '',
39 39
     }
40 40
 });
41
-
41
+watch(props, (nweProps) => {
42
+  initMethod(nweProps);
43
+});
42 44
 const logs = ref([]);
43 45
 const taskResultsMap = ArrayToMap(taskResults, 'value');
44 46
 
45 47
 
46 48
 onMounted(() => {
47 49
     // 通过患者编号获取随访记录
48
-
50
+    initMethod()
51
+})
52
+function initMethod() {
49 53
     getVisitResults({
50 54
         patientFiles: props.patientId,
51 55
     }).then((res) => {
@@ -53,8 +57,7 @@ onMounted(() => {
53 57
             logs.value = res.data;
54 58
         }
55 59
     })
56
-})
57
-
60
+}
58 61
 /**
59 62
  * TODO:跳转到问卷详情页面
60 63
  */