|
|
@@ -180,13 +180,13 @@
|
|
180
|
180
|
</td> -->
|
|
181
|
181
|
|
|
182
|
182
|
<td class="list-item" v-if="item.way === 1">
|
|
183
|
|
- <div class="item-dot" :style="[{ 'background': taskResultsMap[item.callState || ''].color }]"></div>
|
|
184
|
|
- <div class="item-state">{{ taskResultsMap[item.callState || ''].title }}</div>
|
|
|
183
|
+ <div class="item-dot" :style="[{ 'background': (taskResultsMap[item.callState || ''] || {}).color || '#999999' }]"></div>
|
|
|
184
|
+ <div class="item-state">{{ (taskResultsMap[item.callState || ''] || {}).title || '-' }}</div>
|
|
185
|
185
|
</td>
|
|
186
|
186
|
|
|
187
|
187
|
<td class="list-item" v-if="item.way === 2 && item.state">
|
|
188
|
|
- <div class="item-dot" :style="[{ 'background': taskMsgResults[item.state].color }]"></div>
|
|
189
|
|
- <div class="item-state">{{ taskMsgResults[item.state].title }}</div>
|
|
|
188
|
+ <div class="item-dot" :style="[{ 'background': (taskMsgResults[item.state] || {}).color || '#999999' }]"></div>
|
|
|
189
|
+ <div class="item-state">{{ (taskMsgResults[item.state] || {}).title || '-' }}</div>
|
|
190
|
190
|
</td>
|
|
191
|
191
|
<td class="list-item">
|
|
192
|
192
|
|
|
|
@@ -229,10 +229,10 @@
|
|
229
|
229
|
</div>
|
|
230
|
230
|
</template>
|
|
231
|
231
|
|
|
232
|
|
-<script setup>
|
|
233
|
|
-import { onMounted, ref } from 'vue';
|
|
|
232
|
+<script setup name="FollowUpTask">
|
|
|
233
|
+import { onMounted, ref, watch } from 'vue';
|
|
234
|
234
|
import { Search } from '@element-plus/icons-vue'
|
|
235
|
|
-import { useRouter } from 'vue-router';
|
|
|
235
|
+import { useRouter, useRoute, onBeforeRouteUpdate } from 'vue-router';
|
|
236
|
236
|
import { getTasks, getSelfTaskReport } from '@/api/patient/task'
|
|
237
|
237
|
import { getPlans } from '@/api/patient/plan'
|
|
238
|
238
|
import { taskResults,taskMsgResults } from "@/utils/commonDic.js";
|
|
|
@@ -389,6 +389,25 @@ const getReport = () => {
|
|
389
|
389
|
})
|
|
390
|
390
|
}
|
|
391
|
391
|
|
|
|
392
|
+// 刷新数据函数
|
|
|
393
|
+const refreshData = () => {
|
|
|
394
|
+ getTaskList(1);
|
|
|
395
|
+ getReport();
|
|
|
396
|
+}
|
|
|
397
|
+
|
|
|
398
|
+// 监听路由更新
|
|
|
399
|
+// 添加计算属性监听路由参数变化作为备选方案
|
|
|
400
|
+const route = useRoute();
|
|
|
401
|
+const routeQuery = computed(() => route.query);
|
|
|
402
|
+
|
|
|
403
|
+// 监听计算属性变化
|
|
|
404
|
+watch(routeQuery, (newQuery, oldQuery) => {
|
|
|
405
|
+ console.log('路由参数变化:', newQuery, oldQuery);
|
|
|
406
|
+ if (newQuery.refresh === 'true') {
|
|
|
407
|
+ console.log('检测到refresh参数为true,刷新数据');
|
|
|
408
|
+ refreshData();
|
|
|
409
|
+ }
|
|
|
410
|
+}, { deep: true });
|
|
392
|
411
|
|
|
393
|
412
|
const taskResultsMap = ArrayToMap(taskResults, 'value');
|
|
394
|
413
|
|