dev
This commit is contained in:
parent
1ea06612d1
commit
5063ca3f16
|
|
@ -37,9 +37,8 @@
|
|||
alt="头像"/>
|
||||
</span>
|
||||
<span class="item-name">{{ item.name }}</span>
|
||||
<span class="item-age">{{ item.age || 0 }}岁</span>
|
||||
<span class="item-time">
|
||||
{{ formatListTime(item.createDatetime) || '-' }}
|
||||
{{ formatListTime(item.createDatetime)}}
|
||||
</span>
|
||||
<span class="item-type">{{ item.type == 2 ? '医保' : '自费' }}</span>
|
||||
</li>
|
||||
|
|
@ -51,7 +50,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
import {nextTick, onMounted, ref, watch} from "vue";
|
||||
import {onMounted, ref, watch, onUnmounted} from "vue";
|
||||
import Panel from "@/components/common/Panel.vue";
|
||||
import {post} from "@/utils/request.ts";
|
||||
import {formatListTime, getToday, getThisMonth, getCurrentDate, getEndOfDay} from "@/utils/dateUtils.ts";
|
||||
|
|
@ -68,7 +67,7 @@ const emit = defineEmits(['clickItem', 'changeTab'])
|
|||
const datePickerRef = ref()
|
||||
const clickTab = (item: any) => {
|
||||
curStatus.value = item.status
|
||||
emit('changeTab',item.status)
|
||||
emit('changeTab', item.status)
|
||||
curItem.value = {}
|
||||
}
|
||||
const setDate = function () {
|
||||
|
|
@ -95,13 +94,49 @@ const statusList = ref<any>([
|
|||
}
|
||||
])
|
||||
const itemId = defineModel()
|
||||
let refreshInterval: number | null = null; // 定义定时器变量
|
||||
onMounted(() => {
|
||||
selectedDate.value = getCurrentDate()
|
||||
initStatusList()
|
||||
if (curStatus.value == 1) {
|
||||
init()
|
||||
}
|
||||
// 启动定时器,每秒更新一次
|
||||
refreshInterval = setInterval(() => {
|
||||
initList()
|
||||
}, 1000); // 每1000毫秒(即1秒)执行一次
|
||||
})
|
||||
onUnmounted(() => {
|
||||
// 组件卸载时清除定时器
|
||||
if (refreshInterval !== null) {
|
||||
clearInterval(refreshInterval);
|
||||
refreshInterval = null;
|
||||
}
|
||||
});
|
||||
const initList = async () => {
|
||||
selectedDateStr.value = setDateTip()
|
||||
try {
|
||||
let data: any = await post(apiConfig.RegistrationList, {
|
||||
query: {
|
||||
status: curStatus.value,
|
||||
beginTime: selectedDate.value,
|
||||
endTime: getEndOfDay(new Date(selectedDate.value))
|
||||
}
|
||||
}, {catch_error: true});
|
||||
list.value = data.list
|
||||
if (itemId.value != null) {
|
||||
list.value.forEach((item: any, index: any) => {
|
||||
if (item.id == itemId.value && curStatus.value == 2) {
|
||||
clickLi(item, false)
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
} finally {
|
||||
}
|
||||
initStatusList()
|
||||
}
|
||||
const loading = ref(true)
|
||||
const init = async () => {
|
||||
selectedDateStr.value = setDateTip()
|
||||
|
|
@ -142,11 +177,11 @@ const initStatusList = () => {
|
|||
})
|
||||
}
|
||||
const clickLi = (item: any, showBox: any = true) => {
|
||||
if (!item){
|
||||
if (!item) {
|
||||
return
|
||||
}
|
||||
curItem.value = item
|
||||
if ( item.status == 1 && showBox) {
|
||||
if (item.status == 1 && showBox) {
|
||||
ElMessageBox.confirm(`您将要接诊:${item.name}`, "提示", {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
|
@ -275,8 +310,8 @@ watch(() => selectedDate.value, (newValue, oldValue) => {
|
|||
.list-item {
|
||||
height: 48px;
|
||||
display: flex;
|
||||
padding: 0 26px 0 28px;
|
||||
font-weight: 400;
|
||||
padding: 0 16px;
|
||||
font-size: 14px;
|
||||
color: rgba(34, 42, 57, 0.7);
|
||||
font-style: normal;
|
||||
|
|
@ -308,16 +343,14 @@ watch(() => selectedDate.value, (newValue, oldValue) => {
|
|||
text-overflow: ellipsis; // 显示省略号
|
||||
}
|
||||
|
||||
.item-age {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.item-time {
|
||||
width: 80px;
|
||||
width: 40px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.item-type {
|
||||
width: 40px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
:src="'/static/images/member/' + (item.sex === 1 ? 'man' : 'women') + '.png'"
|
||||
alt=""/>
|
||||
</span>
|
||||
<span class="item-name">{{ item.name || '-' }}</span>
|
||||
<span class="item-level">{{ item.levelName || "-" }}</span>
|
||||
<span class="item-name">{{ item.name }}</span>
|
||||
<span class="item-level">{{ item.levelName }}</span>
|
||||
<span class="item-time">{{ formatListTime(item.lastVisitTime) }}</span>
|
||||
</li>
|
||||
</el-scrollbar>
|
||||
|
|
@ -341,7 +341,7 @@ type StatusKey = 0 | 1 | 2 | 3;
|
|||
type PayTypeKey = 1 | 2 | 3 | 4 | 5;
|
||||
//修改时间格式化
|
||||
const formatDate = (isoStr: any) => {
|
||||
if(!isoStr)return ''
|
||||
if (!isoStr) return ''
|
||||
const date = new Date(isoStr);
|
||||
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
||||
}
|
||||
|
|
@ -459,22 +459,26 @@ const openFlowingWater = () => {
|
|||
padding: 0 24px;
|
||||
color: #000000;
|
||||
cursor: pointer;
|
||||
|
||||
span {
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.item-avatar {
|
||||
width: 20px;
|
||||
height: 100%;
|
||||
margin-right: 10px;
|
||||
|
||||
.image {
|
||||
margin-top: 15px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
.item-name{
|
||||
|
||||
.item-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
white-space: nowrap;
|
||||
|
|
@ -482,10 +486,13 @@ const openFlowingWater = () => {
|
|||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
}
|
||||
.item-level{
|
||||
|
||||
.item-level {
|
||||
width: 50px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.item-time{
|
||||
|
||||
.item-time {
|
||||
width: 50px;
|
||||
font-size: 12px;
|
||||
color: #7a8794;
|
||||
|
|
@ -493,6 +500,17 @@ const openFlowingWater = () => {
|
|||
|
||||
&:hover {
|
||||
background: rgba(#4D6DE4, 0.5);
|
||||
|
||||
.item-name {
|
||||
color: #fff;
|
||||
}
|
||||
.item-level {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item-time {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -500,15 +518,15 @@ const openFlowingWater = () => {
|
|||
background: #4D6DE4;
|
||||
color: #fff;
|
||||
|
||||
.name {
|
||||
.item-name {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.level {
|
||||
.item-level {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.time {
|
||||
.item-time {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
|
@ -550,6 +568,7 @@ const openFlowingWater = () => {
|
|||
flex-direction: column;
|
||||
justify-content: center;
|
||||
margin-right: 24px;
|
||||
|
||||
.detail-top-left-text-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
|
@ -558,7 +577,8 @@ const openFlowingWater = () => {
|
|||
color: #333333;
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
.name{
|
||||
|
||||
.name {
|
||||
white-space: nowrap; /* 防止文本换行 */
|
||||
overflow: hidden; /* 隐藏溢出的文本 */
|
||||
text-overflow: ellipsis; /* 显示省略号 */
|
||||
|
|
|
|||
|
|
@ -24,17 +24,17 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="middel">
|
||||
<span class="default-btn" v-loading="syncCacheLoading" @click="syncCache">同步缓存</span>
|
||||
</div>
|
||||
<div class="op_btn">
|
||||
<el-dropdown placement="bottom">
|
||||
<div class="default-btn" >目录更新</div>
|
||||
<div class="default-btn">目录更新</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="start_type">基础更新</el-dropdown-item>
|
||||
<el-dropdown-item @click="openUpdateBox(1312)">有效期更新</el-dropdown-item>
|
||||
<el-dropdown-item @click="openUpdateBox(1318)">限价信息更新</el-dropdown-item>
|
||||
<el-dropdown-item @click="openUpdateBox(1319)">自付比例更新</el-dropdown-item>
|
||||
<el-dropdown-item @click="openSynchronizedCacheBox()">同步缓存</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
|
|
@ -146,6 +146,16 @@
|
|||
</div>
|
||||
</div>
|
||||
</Mask>
|
||||
<Mask :is-show="isSynchronizedCacheBox" :width="540" :height="347" title="同步缓存" @close="close">
|
||||
<div style="height:100%;padding: 24px">
|
||||
<div class="updateDirectory">
|
||||
<div class="updateDirectory-message">{{ tip_message }}</div>
|
||||
<div class="demo-progress">
|
||||
<el-progress :text-inside="true" :stroke-width="30" :percentage="percent"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Mask>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -373,33 +383,32 @@ const update1319 = (current_page: number) => {
|
|||
}
|
||||
const syncCachePage = ref<any>(1)
|
||||
const syncCacheTotalPage = ref<any>(0)
|
||||
const syncCacheLoading=ref(false)
|
||||
const isSynchronizedCacheBox = ref(false)
|
||||
const syncCache = () => {
|
||||
if(syncCachePage.value==1){
|
||||
syncCacheLoading.value = true
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: "正在同步,请稍后......",
|
||||
type: 'warning',
|
||||
})
|
||||
if (syncCachePage.value == 1) {
|
||||
tip_message.value = "开始同步第一页";
|
||||
}
|
||||
post("social/directory/syncToMongo", {page: syncCachePage.value}).then((res: any) => {
|
||||
if(res.total_page){
|
||||
if (res.total_page) {
|
||||
syncCacheTotalPage.value = res.total_page
|
||||
}
|
||||
if (syncCachePage.value <= syncCacheTotalPage.value) {
|
||||
syncCachePage.value++
|
||||
tip_message.value = "正在同步目录,以同步" + syncCachePage.value + "/" + syncCacheTotalPage.value + "页,请不要强制关闭程序,否则数据不完整";
|
||||
percent.value = Math.floor((syncCachePage.value / syncCacheTotalPage.value) * 100)
|
||||
syncCache()
|
||||
}else{
|
||||
syncCacheLoading.value = false
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: "同步完成",
|
||||
type: 'success',
|
||||
})
|
||||
} else {
|
||||
tip_message.value = "同步完成";
|
||||
isSynchronizedCacheBox.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
const openSynchronizedCacheBox = () => {
|
||||
tip_message.value = "";
|
||||
percent.value = 0
|
||||
isSynchronizedCacheBox.value = true
|
||||
syncCache()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
Loading…
Reference in New Issue