1
wwl
2 天以前 05c1bc4570f3a5faf4dad7683bfced0712908aba
1
2个文件已修改
118 ■■■■■ 已修改文件
src/utils/websocket.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/inspectCheck/index.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/websocket.js
@@ -24,7 +24,15 @@
    closeWebSocket();
  }
  const wsUrl = `ws://192.168.1.244:5011/ws?token=${token}`;
// 取当前页面的协议(http/https),主机(域名 + 端口)
const loc = window.location;
const protocol = loc.protocol === 'https:' ? 'wss:' : 'ws:'; // 安全协议自动切换
const host = loc.host; // 域名 + 端口,比如 localhost:8080
// 拼接 WebSocket 地址
const wsUrl = `${protocol}//${host}/ws?token=${token}`;
console.log(wsUrl,"wsUrl");
  ws = new WebSocket(wsUrl);
  ws.onopen = () => {
src/views/doctor/inspectCheck/index.vue
@@ -1,48 +1,18 @@
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      label-width="68px"
      @submit.native.prevent
    >
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" @submit.native.prevent>
      <el-form-item label="体检号" prop="reportDoctorCode">
        <el-input
          ref="inputName"
          v-model="queryParams.tjNum"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
        />
        <el-input ref="inputName" v-model="queryParams.tjNum" placeholder="请输入体检号" clearable
          @keyup.enter.native="handleQuery" style="width: 170px" />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          style="margin-right: 15px"
        >
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" style="margin-right: 15px">
          查询
        </el-button>
        <el-button
          icon="el-icon-refresh"
          type="primary"
          size="mini"
          @click="resetQuery"
        >
        <el-button icon="el-icon-refresh" type="primary" size="mini" @click="resetQuery">
          重置
        </el-button>
        <el-button
          icon="el-icon-check"
          type="primary"
          size="mini"
          style="margin-right: 15px"
          @click="tongbu"
        >
        <el-button icon="el-icon-check" type="primary" size="mini" style="margin-right: 15px" @click="tongbu">
          同步
        </el-button>
      </el-form-item>
@@ -51,27 +21,14 @@
    <div class="box">
      <div class="table-header">检验记录</div>
      <div>
        <el-table
          :data="exaLists"
          border
          style="width: 100%"
          @selection-change="handleSelectionChange"
          :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }"
          height="350"
          ref="firstTable"
        >
        <el-table :data="exaLists" border style="width: 100%" @selection-change="handleSelectionChange"
          :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }" height="350" ref="firstTable">
          <el-table-column fixed type="selection" align="center" label="选择" width="50" />
          <el-table-column label="姓名" align="center" prop="name" width="80" />
          <el-table-column label="性别" align="center" prop="gender" width="80" />
          <el-table-column label="年龄" align="center" prop="patientAge" width="80" />
          <el-table-column label="送检科室" align="center" prop="deptName" width="100" />
          <el-table-column
            label="检验项目"
            align="center"
            prop="checkParts"
            width="350"
            :show-overflow-tooltip="true"
          />
          <el-table-column label="检验项目" align="center" prop="checkParts" width="350" :show-overflow-tooltip="true" />
          <el-table-column label="项目编号" align="center" prop="jcxmid" width="150" />
          <el-table-column label="审核医师" align="center" prop="shys" width="150" />
          <el-table-column label="报告时间" align="center" prop="examinationDate" width="150" />
@@ -111,24 +68,11 @@
      </h3>
    </div>
    <el-table
      border
      height="350"
      ref="tab1"
      :data="checkList"
      v-loading="loading"
      style="width: 100%"
    <el-table border height="350" ref="tab1" :data="checkList" v-loading="loading" style="width: 100%"
      @selection-change="handleSelectionChangeSecond"
      :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }"
    >
      :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }">
      <el-table-column type="selection" width="60" />
      <el-table-column
        label="状态"
        align="center"
        prop="type"
        :show-overflow-tooltip="true"
        min-width="60"
      >
      <el-table-column label="状态" align="center" prop="type" :show-overflow-tooltip="true" min-width="60">
        <template slot-scope="scope">
          <span v-if="scope.row.type == '0'">未检</span>
          <span v-if="scope.row.type == '1'">已检</span>
@@ -269,17 +213,32 @@
    },
    tongbu() {
      this.$modal.loading("正在同步,请稍候...");
      const requestData = {
        lis: this.selectedFirstTable,
        lis: this.selectedFirstTable ? this.selectedFirstTable.map((item) => ({
          ...item,
          tjNum: this.queryParams.tjNum,
        })) : [],
        jcxmid: this.selectedFirstTable && this.selectedFirstTable.length > 0 ? this.selectedFirstTable[0].jcxmid : null,
        shys: this.selectedFirstTable && this.selectedFirstTable.length > 0 ? this.selectedFirstTable[0].shys : null,
        tj: this.selectedSecondTable[0],
      };
      asyncPacs(requestData).then(res => {
      asyncPacs(requestData)
        .then((res) => {
        if (res.code === 200) {
          this.$message.success("同步成功!");
          this.fetchRightTableData();
            clearInterval(this.clearTimeSet);
            this.clearTimeSet = null;
            this.$modal.closeLoading();
            this.$modal.msgSuccess("同步成功!");
        } else {
          this.$message.error(res.message || "同步失败");
            this.$message.error(res.message || "同步失败,请稍后重试");
        }
        })
        .catch((error) => {
          clearInterval(this.clearTimeSet);
          this.clearTimeSet = null;
          this.$modal.closeLoading();
      });
    },
  },
@@ -291,6 +250,7 @@
  padding: 20px;
  background: #f5f7fa;
}
.table-header {
  text-align: center;
  background-color: #aad8df;
@@ -301,11 +261,13 @@
  margin-top: 10px;
  border-radius: 4px 4px 0 0;
}
.table-title {
  text-align: left;
  margin: 20px 0;
  padding: 10px 0;
}
.table-title h3 {
  font-size: 16px;
  color: #333;
@@ -316,10 +278,12 @@
  flex-wrap: wrap;
  gap: 20px;
}
.table-title .highlight {
  font-weight: bold;
  color: #2c3e50;
}
.el-table {
  border-radius: 4px;
  font-size: 14px;