lkk
2024-12-30 105242d9df9bda200da395b04972b65cb22a4496
拼音码页面
3个文件已修改
569 ■■■■■ 已修改文件
src/api/hosp/project.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hosp/pinyin/index.vue 558 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/tijian/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/hosp/project.js
@@ -137,4 +137,13 @@
    url: '/system/config/tbhisproprice',
    method: 'get',
  })
}
// 查询表名、字段、拼音
export function getPinyin(tbname,zd,pymzd) {
  return request({
    url: '/hosp/project/plxgpym',
    method: 'get',
    params: {tbname:tbname,zd:zd,pymzd,pymzd}
  })
}
src/views/hosp/pinyin/index.vue
@@ -1,146 +1,103 @@
<template>
    <div class="app-container">
      <el-form
        :model="queryParams"
        ref="queryForm"
        size="small"
        :inline="true"
        label-width="68px"
      >
        <el-form-item label="表名" prop="reportDoctorCode">
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      label-width="68px"
    >
      <el-form-item label="表名" prop="tbname">
        <el-input
          ref="inputName"
          v-model="queryParams.tbname"
          placeholder="请输入表名"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
        />
      </el-form-item>
      <el-form-item label="字段名" prop="zd">
        <el-input
          v-model="queryParams.zd"
          placeholder="请输入字段名"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
        />
      </el-form-item>
      <el-form-item label="拼音名" prop="pymzd">
        <el-input
          v-model="queryParams.pymzd"
          placeholder="请输入拼音名"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
        />
      </el-form-item>
      <el-form-item>
        <el-button :loading="loading" type="primary" @click="handleSubmit"
          >提交</el-button
        >
        <el-button @click="handleCancel">取消</el-button>
      </el-form-item>
    </el-form>
    <div class="title">必须和数据库表名、字段名严格保持一致!</div>
    <el-table
      id="ta"
      ref="tb"
      :data="pyList"
      v-loading="loading"
      border
      @current-change="handleCurrentChange"
      @selection-change="handleSelectionChange"
    >
      <el-table-column label="表名" align="center" prop="tj_project_copy"  />
      <el-table-column label="表名" align="center" prop="pro_name" />
      <el-table-column label="表名" align="center" prop="pro_eng_name" />
    </el-table>
    <!-- <div>
        <div class="title">必须和数据库表名、字段名严格保持一致</div>
    </div> -->
    <!-- <div>
      <el-form :model="queryParams">
        <el-form-item label="表名" prop="tbname">
          <el-input
            ref="inputName"
            v-model="queryParams.tjNum"
            v-model="queryParams.tbname"
            placeholder="请输入表名"
            clearable
            @keyup.enter.native="handleQuery"
            style="width: 170px"
          />
          ></el-input>
        </el-form-item>
        <el-form-item label="字段名" prop="name">
        <el-form-item label="字段" prop="zd">
          <el-input
            v-model="queryParams.name"
            placeholder="请输入字段名"
            clearable
            @keyup.enter.native="handleQuery"
            style="width: 110px"
          />
            v-model="queryParams.zd"
            placeholder="请输入字段"
          ></el-input>
        </el-form-item>
        <el-form-item label="拼音名" prop="name">
        <el-form-item label="拼音字段" prop="pymzd">
          <el-input
            v-model="queryParams.name"
            placeholder="请输入拼音名"
            clearable
            @keyup.enter.native="handleQuery"
            style="width: 110px"
          />
            v-model="queryParams.pymzd"
            placeholder="请输入拼音字段"
          ></el-input>
        </el-form-item>
       <!--  <el-form-item label="登记时间" prop="createTimeList">
          <el-date-picker
            v-model="createTimeList"
            type="datetimerange"
            align="right"
            :picker-options="pickerOptions"
            style="width: 310px"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            format="yyyy.MM.dd"
            value-format="yyyy.MM.dd "
            @change="handleDateChange"
          >
          </el-date-picker>
        </el-form-item> -->
        <el-form-item>
          <el-button
            type="primary"
            icon="el-icon-search"
            size="mini"
            @click="handleQuery"
            style="margin-right: 15px"
            >查询</el-button
          <el-button :loading="loading" type="primary" @click="handleSubmit"
            >提交</el-button
          >
          <el-button
            icon="el-icon-refresh"
            type="primary"
            size="mini"
            @click="resetQuery"
            >重置</el-button
          >
          <el-button @click="handleCancel">取消</el-button>
        </el-form-item>
      </el-form>
      <el-table
        id="ta"
        ref="tb"
        style="width: 100%"
        :data="exaLists"
        v-loading="loading"
        border
        @current-change="handleCurrentChange"
        @selection-change="handleSelectionChange"
        :row-class-name="tableRowClassName"
      >
        <!-- <el-table-column
          fixed
          type="selection"
          align="center"
          label="选择"
          width="40"
          :selectable="isSelectable"
        >
        </el-table-column> -->
        <!-- <el-table-column label="姓名" align="center" prop="name" width="80px" />
        <el-table-column label="性别" align="center" prop="gender" width="80px" />
        <el-table-column
          label="年龄"
          align="center"
          prop="patientAge"
          width="80px"
        >
        </el-table-column>
        <el-table-column
          label="送检科室"
          align="center"
          prop="deptName"
          width="100px"
        />
        <el-table-column
          label="检查项目"
          align="center"
          prop="checkParts"
          width="150px"
        />
        <el-table-column
          label="报告时间"
          align="center"
          prop="examinationDate"
          width="150px"
        />
        <el-table-column label="门诊号" align="center" prop="mzh" width="140px" />
        <el-table-column
          label="申请单号"
          align="center"
          prop="brid"
          width="145px"
        />
        <el-table-column
          label="结果状态"
          align="center"
          prop="diagnosis"
          width="150"
          :show-overflow-tooltip="true"
        /> -->
      </el-table>
      <div class="pag">
        <div class="pag1">
          <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page"
    </div> -->
    <div class="pag">
      <div class="pag1">
        <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page"
                    :page-sizes="pageSize" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="total">
                </el-pagination> -->
          <!-- <pagination
        <!-- <pagination
            v-show="total > 0"
            :total="total"
            :pager-count="5"
@@ -148,233 +105,146 @@
            :limit.sync="queryParams.pageSize"
            @pagination="getList"
          /> -->
        </div>
      </div>
    </div>
  </template>
  </div>
</template>
    
    <script>
  import { getLeftList, getRightList, asyncPacs } from "@/api/doctor/pacsCheck";
import { getPinyin } from "@/api/hosp/project";
  export default {
    dicts: ["dict_tj_status"],
    data() {
      return {
        dis: false,
        code: null,
        createTimeList: "",
        total: 0,
        loading: false,
        isSyncing: false,
        // 查询参数
        queryParams: {
          // page: 1,
          // pageSize: 20,
          name: null,
          start: null,
          end: null,
          tjNum: null,
        },
        // 绑定单选按钮
        checkStatus: "0",
        exaLists: [],
        selectedFirstTable: null, // 第一个表格选中行
        selectedSecondTable: [], // 第二个表格选中行
        // 表单参数
        form: {},
        clearTimeSet: null,
        tjNumbers: "",
        multipleSelection: "",
        tjnum: "",
        xiangmuList: [],
        checkList: [],
        tg: true,
        bh: true,
        pickerOptions: {
          shortcuts: [
            {
              text: "最近一周",
              onClick(picker) {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                picker.$emit("pick", [start, end]);
              },
            },
            {
              text: "最近一个月",
              onClick(picker) {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                picker.$emit("pick", [start, end]);
              },
            },
            {
              text: "最近三个月",
              onClick(picker) {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                picker.$emit("pick", [start, end]);
              },
            },
          ],
        },
      };
export default {
  dicts: ["dict_tj_status"],
  data() {
    return {
      loading: false,
      pyList:[],
      // 查询参数
      queryParams: {
        tbname: "",
        zd: "",
        pymzd: "",
      },
    };
  },
  created() {
  },
  methods: {
    handleSelectionChange(val) {
      console.log(val);
      if (val.length > 1) {
        let del_row = val.shift();
        this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      console.log(val, 999);
      if (val.length > 0) {
        const selectedRow = val[0];
        this.selectedFirstTable = selectedRow;
        console.log("当前选中的行数据:", this.selectedFirstTable);
        this.fetchRightTableData(selectedRow);
      } else {
        this.selectedFirstTable = null;
        this.checkList = [];
      }
    },
    mounted() {
      this.$nextTick(() => {
        this.$refs.inputName.focus();
    // 根据选中的行数据请求右边表格数据
    fetchRightTableData(selectedRow) {
      const code = selectedRow.mzh;
      if (!code) return;
      this.loading = true;
      getRightList(code).then((response) => {
        this.checkList = response.data;
        this.loading = false;
      });
    },
    methods: {
      handleDateChange(val){
        if (val && val.length === 2) {
          this.queryParams.start = val[0]; // 设置开始时间
          this.queryParams.end = val[1];   // 设置结束时间
        } else {
          this.queryParams.start = null;
          this.queryParams.end = null;
        }
        console.log('Query Params:', this.queryParams);
      },
      isSelectable(row) {
        return !!row.mzh;
      },
      tableRowClassName({ row }) {
        return !row.mzh ? "row-disabled" : "";
      },
      handleSelectionChange(val) {
        console.log(val);
        if (val.length > 1) {
          let del_row = val.shift();
          this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
        }
        console.log(val, 999);
        if (val.length > 0) {
          const selectedRow = val[0];
          this.selectedFirstTable = selectedRow;
          console.log("当前选中的行数据:", this.selectedFirstTable);
          this.fetchRightTableData(selectedRow);
        } else {
          this.selectedFirstTable = null;
          this.checkList = [];
        }
      },
      // 根据选中的行数据请求右边表格数据
      fetchRightTableData(selectedRow) {
        const code = selectedRow.mzh;
        if (!code) return;
        this.loading = true;
        getRightList(code).then((response) => {
          this.checkList = response.data;
    handleSubmit() {
      this.loading = true;
      const { tbname, zd, pymzd } = this.queryParams;
      // 调用 API 获取拼音
      getPinyin(tbname, zd, pymzd)
        .then((res) => {
          console.log(res, "返回的数据");
          if (res.code === 200) {
            this.pyList = res.data;
            console.log(this.pyList,9988);
            this.$message.success("提交成功");
          } else {
            this.$message.error(res.msg || "查询失败,请稍后重试");
          }
        })
        .catch((error) => {
          this.$message.error(error.msg || "查询失败,请稍后重试");
        })
        .finally(() => {
          this.loading = false;
        });
      },
      handleSelectionChangeSecond(selectedRows) {
        this.selectedSecondTable = selectedRows;
        console.log("当前选中的行数据:", this.selectedSecondTable);
      },
      getList() {
        if (this.createTimeList) {
          this.queryParams.start = this.createTimeList[0];
          this.queryParams.end = this.createTimeList[1];
        } else if (this.createTimeList == null) {
          this.queryParams.start = null;
          this.queryParams.end = null;
        }
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.loading = true;
        getLeftList(this.queryParams)
          .then((res) => {
            console.log(res, 1111);
            if (res.code == 200) {
              this.loading = false;
              this.exaLists = res.data;
              this.code = this.exaLists.mzh;
            }
          })
          .catch((error) => {
            this.loading = false;
            this.$message.error(res.msg || "查询失败,请稍后重试");
          });
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.createTimeList = [];
        this.resetForm("queryForm");
        this.queryParams = {
          name: null,
          start: null,
          end: null,
          tjNum: null,
        };
        // 清空其他依赖数据
        this.checkList = [];
        this.exaLists = [];
      },
      handleCurrentChange(row) {
        this.currentRow = row;
      },
      setTime() {
        //设置定时器
        this.clearTimeSet = setInterval(() => {
          this.$modal.closeLoading();
        }, 300000);
      },
      tongbu(row) {
        this.$modal.loading("正在同步,请稍候...");
        this.setTime();
        const requestData = {
          pacs: this.selectedFirstTable, // 左侧表格选中数据
          tj: this.selectedSecondTable[0], // 右侧表格选中数据
        };
        if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
          this.$message.error("至少选一条数据!");
          return;
        }
        asyncPacs(requestData)
          .then((res) => {
            if (res.code == 200) {
              this.fetchRightTableData(this.selectedFirstTable);
              clearInterval(this.clearTimeSet);
              this.clearTimeSet = null;
              this.$modal.closeLoading();
              this.$modal.msgSuccess("同步成功!");
            } else {
              this.$message.error(res.message || "同步失败,请稍后重试");
            }
          })
          .catch((error) => {
            clearInterval(this.clearTimeSet);
            this.clearTimeSet = null;
            this.$modal.closeLoading();
          })
      },
    },
  };
  </script>
    // 取消操作
    handleCancel() {
      this.queryParams.tbname = '';
      this.queryParams.zd = '';
      this.queryParams.pymzd = '';
      this.$message.info('已取消');
    },
    handleSelectionChangeSecond(selectedRows) {
      this.selectedSecondTable = selectedRows;
      console.log("当前选中的行数据:", this.selectedSecondTable);
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.loading = true;
      getPinyin(this.queryParams)
        .then((res) => {
          console.log(res, 1111);
          if (res.code == 200) {
            // this.loading = false;
            // this.exaLists = res.data;
            // this.code = this.exaLists.mzh;
          }
        })
        .catch((error) => {
          //   this.loading = false;
          //   this.$message.error(res.msg || "查询失败,请稍后重试");
        });
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.createTimeList = [];
      this.resetForm("queryForm");
      this.queryParams = {
        name: null,
        start: null,
        end: null,
        tjNum: null,
      };
      // 清空其他依赖数据
      this.checkList = [];
      this.exaLists = [];
    },
    handleCurrentChange(row) {
      this.currentRow = row;
    },
  },
};
</script>
    
    <style lang="scss" scoped>
  /* #ta .el-table__header-wrapper .el-checkbox {
    .title{
        margin-bottom: 20px;
        color: red;
    }
/* #ta .el-table__header-wrapper .el-checkbox {
    display: none;
  }
  
@@ -404,4 +274,4 @@
  .pag1 {
    width: 30%;
  } */
  </style>
</style>
src/views/system/tijian/index.vue
@@ -1510,8 +1510,6 @@
  getByTjNum,
} from "@/api/hosp/customer";
import { getPrintSetUp } from "@/api/system/examcharge";
import axios from "axios";
import { getIp } from "@/utils/auth";
import {
  deptTreeSelect,
  projectGetList,