检索加双击

This commit is contained in:
wuyy 2026-09-04 09:18:22 +08:00
parent e05e4c6556
commit 163cfda204
10 changed files with 75 additions and 19 deletions

View File

@ -39,4 +39,12 @@ export function queryNoReadCount(query?: Object) {
method: 'get',
params: query
})
}
// 批量更新消息状态
export function batchUpdateFlag(query?: Object) {
return request({
url: '/bus/bloodbank/msg/batchUpdateFlag',
method: 'post',
data: query
})
}

View File

@ -28,7 +28,7 @@
<div>
<el-button type="primary" @click="getList" icon="Search">查询</el-button>
<!-- <el-button type="warning" @click="markAllAsRead" icon="Check">一键已读</el-button> -->
<el-button type="warning" @click="markAllAsRead" icon="Check">一键已读</el-button>
</div>
<div class="mt10">
@ -57,11 +57,13 @@
</template>
<script setup lang="ts">
import { queryMsgList, updateMsgFlag } from '@/api/msg'
import { queryMsgList, updateMsgFlag, batchUpdateFlag } from '@/api/msg'
import emitter from '@/utils/mitt'
import dayjs from 'dayjs'
import WsMsgDetails from "@/components/WsMsgDetails/index.vue"
import useUserStore from '@/store/modules/user'
import { ElMessageBox } from 'element-plus'
import { ElMessage } from 'element-plus'
const userInfo = useUserStore()
const msgDetailsRef = useTemplateRef('msgDetailsRef')
@ -91,12 +93,29 @@ const getList = () => {
})
}
const markAllAsRead = () => { }
const markAllAsRead = () => {
const msdIds = msgList.value.filter(item => item.Read_Flag == 'N').map(item => item.msgid)
if (!msdIds.length) return ElMessage.warning('当前页已无未读消息!')
//二次确认是否更新当前页未读消息
ElMessageBox.confirm('是否确认更新当前页未读消息?', '提示', { type: 'warning' }).then(() => {
const data = {
accept_Date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
accept_Person: userInfo.name,
msgIdList: msdIds,
}
batchUpdateFlag(data).then(res => {
if (res.code == 0) {
emitter.emit('resetCount')
getList()
}
})
})
}
const handleDetail = (row) => {
console.log("🚀 ~ handleDetail ~ row:", row)
msgDetailsRef.value.open(row.msgid)
return
const data = {
accept_Date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
accept_Person: userInfo.name,

View File

@ -317,10 +317,12 @@ onMounted(() => {
.msg_box {
width: 50px;
padding-top: 15px;
.item {
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
}
}

View File

@ -105,17 +105,17 @@ onMounted(() => {
initWebSocket({ fullUrl: url })
emitter.on("APPLY_NOTICE", onNewMessage)
emitter.on("newMsg", onNewMessage)
// 读取缓存,防止ws消息比组件挂载早,丢失消息
const cacheRaw = emitter.getCache("APPLY_NOTICE")
const cacheRaw = emitter.getCache("newMsg")
if (cacheRaw) {
onNewMessage(cacheRaw)
}
})
onBeforeUnmount(() => {
emitter.off("APPLY_NOTICE", onNewMessage)
emitter.off("newMsg", onNewMessage)
})
</script>

View File

@ -40,7 +40,7 @@ export function initWebSocket(options: WebSocketInternalOptions) {
const msgType = rawMsg.type;
//根据消息类型发送事件
//APPLY_NOTICE 输血申请保存
emitter.emit(msgType, rawMsg);
emitter.emit("newMsg", rawMsg);
// 重置未读消息数
emitter.emit('resetCount')
} catch (err) {

View File

@ -322,8 +322,8 @@
</el-form>
<!-- 结果表格区 -->
<el-table :data="tableData" border height="450" @row-click="jsRowclick" highlight-current-row
show-overflow-tooltip>
<el-table :data="tableData" border height="450" @row-click="jsRowclick" @row-dblclick="dblClickRow"
highlight-current-row show-overflow-tooltip>
<el-table-column prop="bill_no" label="出库单号" align="center" />
<el-table-column prop="occur_date" label="出库日期" align="center" width="150" />
<el-table-column prop="handle_person" label="发血经手人" align="center">
@ -661,6 +661,11 @@ const jsRowclick = (row) => {
selectRow.value = row
}
const dblClickRow = (row) => {
selectRow.value = row
handleConfirm()
}
const getBloodMatchInfo = () => {
queryOutInfo({ billNo: selectRow.value.bill_no }).then(res => {

View File

@ -354,7 +354,7 @@
<!-- 检索条件区 -->
<el-form :model="searchForm" label-width="auto" class="search-form">
<el-row :gutter="10">
<el-col :span="10">
<el-col :span="9">
<el-form-item label="检索时间">
<div class="date-range">
<el-date-picker v-model="searchForm.stime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@ -377,7 +377,7 @@
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="10">
<el-col :span="9">
<el-form-item label="申请单号">
<el-input v-model="searchForm.applyNo" placeholder="" />
</el-form-item>
@ -391,7 +391,8 @@
</el-form>
<!-- 结果表格区 -->
<el-table :data="tableData" border height="450" @row-click="jsRowclick" highlight-current-row>
<el-table :data="tableData" border height="450" @row-click="jsRowclick" @row-dblclick="dblClickRow"
highlight-current-row show-overflow-tooltip>
<el-table-column prop="patient_name" label="患者姓名" align="center" />
<el-table-column prop="bill_status" label="单据状态" align="center">
<template #default="{ row }">
@ -715,6 +716,11 @@ const jsRowclick = (row) => {
selectRow.value = row
}
const dblClickRow = (row) => {
selectRow.value = row
handleConfirm()
}
const handleRowClick = (row: any) => {
selectRow.value = row
getBloodMatchInfo()

View File

@ -344,8 +344,8 @@
</el-form>
<!-- 结果表格区 -->
<el-table :data="tableData" border height="450" @row-click="handleRowClick" highlight-current-row
show-overflow-tooltip>
<el-table :data="tableData" border height="450" @row-click="handleRowClick" @row-dblclick="dblClickRow"
highlight-current-row show-overflow-tooltip>
<el-table-column prop="bill_no" label="配血单号" align="center" width="150" />
<el-table-column prop="apply_no" label="申请单号" align="center" width="150" />
<el-table-column prop="beinhos_id" label="住院号/ID号" align="center" width="120" />
@ -524,6 +524,11 @@ const handleRowClick = (row: TableRowItem) => {
selectedRow.value = row
}
const dblClickRow = (row: TableRowItem) => {
selectedRow.value = row
handleConfirm()
}
const handleSearch = () => {
searchForm.value.stime = dayjs(searchForm.value.stime).format('YYYY-MM-DD') + ' 00:00:00'
searchForm.value.etime = dayjs(searchForm.value.etime).format('YYYY-MM-DD') + ' 23:59:59'

View File

@ -344,7 +344,7 @@
<el-select v-model="queryForm.bill_status" style="width:110px" size="small" @change="getSqdList">
<el-option v-for="item in dictData.billApplyStatus" :label="item.label" :value="item.value" />
</el-select>
<el-input v-model="queryForm.day" type="number" style="width:80px" class="ml10" size="small"
<el-input v-model="queryForm.day" type="number" style="width:80px" class="ml10" size="small" :max="30"
@keydown.enter="getSqdList" />天内
</div>
</div>
@ -508,7 +508,7 @@
<!-- 结果表格区 -->
<el-table :data="jsTabdeList" border style="width: 100%; margin-top: 10px" height="350" show-overflow-tooltip
@row-click="handleRowClick" highlight-current-row :cell-style="cellStyle">
@row-click="handleRowClick" highlight-current-row :cell-style="cellStyle" @row-dblclick="dblClickRow">
<el-table-column prop="bill_stasus" label="单据状态" align="center">
<template #default="scope">
{{ formatDict(scope.row.bill_stasus, 'billApplyStatus') }}
@ -803,6 +803,11 @@ const handleConfirm = () => {
const handleRowClick = (row) => {
selectRow.value = row
}
const dblClickRow = (row) => {
getQueryOneInfo(row.bill_no)
visible.value = false
}
// 检索列表
const getList = () => {
const data = {

View File

@ -233,7 +233,7 @@
<!-- 结果表格区 -->
<el-table :data="tableData" border style="width: 100%; margin-top: 10px" show-overflow-tooltip height="350"
@row-click="handleRowClick" highlight-current-row>
@row-click="handleRowClick" highlight-current-row @row-dblclick="dblClick">
<el-table-column prop="bill_no" label="评估单号" align="center" width="150" />
<el-table-column prop="dept_id" label="科室" align="center" width="160">
<template #default="scope">
@ -423,6 +423,12 @@ const selectRow = ref({})
const handleRowClick = (row) => {
selectRow.value = row
}
const dblClick = (row) => {
evaluationInfo.value.billNo = row.bill_no
getBillInfo()
visible.value = false
}
//查询单据信息
const getList = () => {
const data = {