1
lkk
2025-06-04 0b9fdc86295c156a763bf178ad41653fd949d57c
1
2个文件已修改
499 ■■■■ 已修改文件
src/components/public/index.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/picture/picture/index.vue 465 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/public/index.vue
@@ -291,6 +291,8 @@
    updateFormContent(selection) {
      // if (!selection.length) return;
      console.log(selection, 123456);
      this.updateData(this.proResult, this.conclusion);
      // 如果处于检查状态,使用传入的值
      // if (this.checkStatus === "1") {
@@ -314,29 +316,23 @@
      //   .join(",");
    },
    /* handleOk() {
    handleOk() {
      if (!this.form.desc && !this.form.jcsj) {
        this.$message.warning("请选择数据");
        return;
      }
      } else {
        const desc = this.form.desc?.trim();
        const jcsj = this.form.jcsj?.trim();
      try {
        this.$emit("add", this.form.desc, this.form.jcsj);
        this.resetForm();
        this.open = false;
      } catch (error) {
        console.error("处理数据失败:", error);
        this.$message.error("操作失败");
      }
    }, */
    handleOk() {
      const jcsjTrim = this.form.jcsj?.trim();
      const descTrim = this.form.desc?.trim();
      if (!jcsjTrim || !descTrim) {
        this.$message.warning("检查所见和检查结论不能为空");
        return;
        // 如果没有选中表格项
        if (!this.list || this.list.length === 0) {
          if (!desc && !jcsj) {
            this.$message.warning(
              "请填写有效的检查所见和检查结论,或选择表格数据"
            );
            return;
          }
        }
      }
      try {
src/views/picture/picture/index.vue
@@ -1,54 +1,156 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      label-width="68px"
    >
      <el-form-item label="体检号" prop="tjNumber">
        <el-input ref="inputName" v-model="queryParams.tjNumber" placeholder="请输入体检号" clearable
          @keyup.enter.native="handleQuery" @blur="hb" style="width: 170px" />
        <el-input
          ref="inputName"
          v-model="queryParams.tjNumber"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          @blur="hb"
          style="width: 170px"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"
          style="width: 110px" />
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 110px"
        />
      </el-form-item>
      <el-form-item label="单位名称" prop="tjCompName" style="margin-left: 20px">
        <el-select :remote-method="getRemoteData" v-model="queryParams.tjCompName" value-key="drugManufacturerId"
          style="width: 180px" remote filterable placeholder="请选择单位名称" clearable @change="searchSelect">
          <el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName" :value="dict" />
      <el-form-item
        label="单位名称"
        prop="tjCompName"
        style="margin-left: 20px"
      >
        <el-select
          :remote-method="getRemoteData"
          v-model="queryParams.tjCompName"
          value-key="drugManufacturerId"
          style="width: 180px"
          remote
          filterable
          placeholder="请选择单位名称"
          clearable
          @change="searchSelect"
        >
          <el-option
            v-for="dict in CompanyList"
            :key="dict.drugManufacturerId"
            :label="dict.cnName"
            :value="dict"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="项目" prop="tcm">
        <el-input v-model="queryParams.tcm" placeholder="请输入项目" clearable @keyup.enter.native="handleQuery"
          style="width: 170px" />
        <el-input
          v-model="queryParams.tcm"
          placeholder="请输入项目"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
        />
      </el-form-item>
      <el-form-item label="登记时间" prop="createTimeList" v-show="isCollapsed == 1">
        <el-date-picker v-model="createTimeList" type="datetimerange" align="right" :picker-options="pickerOptions"
          style="width: 310px" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"
          format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" @change="dateChangebirthday1">
      <el-form-item
        label="登记时间"
        prop="createTimeList"
        v-show="isCollapsed == 1"
      >
        <el-date-picker
          v-model="createTimeList"
          type="datetimerange"
          align="right"
          :picker-options="pickerOptions"
          style="width: 310px"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="['00:00:00', '23:59:59']"
          format="yyyy-MM-dd HH:mm"
          value-format="yyyy-MM-dd HH:mm"
          @change="dateChangebirthday1"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" size="mini" @click="toggleCollapse" style="margin-right: 15px"
          v-show="isCollapsed == 0">展开更多</el-button>
        <el-button type="primary" size="mini" @click="toggleCollapse3" style="margin-right: 15px"
          v-show="isCollapsed == 1">收起更多</el-button>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
          style="margin-right: 15px">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button
          type="primary"
          size="mini"
          @click="toggleCollapse"
          style="margin-right: 15px"
          v-show="isCollapsed == 0"
          >展开更多</el-button
        >
        <el-button
          type="primary"
          size="mini"
          @click="toggleCollapse3"
          style="margin-right: 15px"
          v-show="isCollapsed == 1"
          >收起更多</el-button
        >
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          style="margin-right: 15px"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
    <el-radio-group v-model="checkStatus" @input="radioChange" style="margin: 10px 15px">
    <el-radio-group
      v-model="checkStatus"
      @input="radioChange"
      style="margin: 10px 15px"
    >
      <el-radio-button label="0">未检</el-radio-button>
      <el-radio-button label="1">已检</el-radio-button>
    </el-radio-group>
    <el-row :gutter="20">
      <el-col :span="11">
        <el-table v-loading="loading" ref="tb" :data="pictureList" highlight-current-row
          :row-class-name="tableRowClassName" @current-change="handleCurrentChange" border height="520px">
          <el-table-column label="体检号" align="center" prop="tjNumber" min-width="130" />
          <el-table-column label="姓名" align="center" prop="cusName" min-width="80" />
          <el-table-column label="性别" align="center" prop="cusSex" min-width="50">
        <el-table
          v-loading="loading"
          ref="tb"
          :data="pictureList"
          highlight-current-row
          :row-class-name="tableRowClassName"
          @current-change="handleCurrentChange"
          border
          height="520px"
        >
          <el-table-column
            label="体检号"
            align="center"
            prop="tjNumber"
            min-width="130"
          />
          <el-table-column
            label="姓名"
            align="center"
            prop="cusName"
            min-width="80"
          />
          <el-table-column
            label="性别"
            align="center"
            prop="cusSex"
            min-width="50"
          >
            <template slot-scope="scope">
              <span v-if="scope.row.cusSex == '0'">男</span>
              <span v-if="scope.row.cusSex == '1'">女</span>
@@ -56,36 +158,102 @@
              <span v-if="scope.row.cusSex == '9'">未说明性别</span>
            </template>
          </el-table-column>
          <el-table-column label="身份证号" align="center" prop="cusIdcard" min-width="190" />
          <el-table-column label="套餐名" align="center" prop="tcm" min-width="100" />
          <el-table-column label="登记时间" align="center" prop="tjTime" min-width="120" />
          <el-table-column label="审核状态" align="center" prop="confirmStatus" min-width="80">
          <el-table-column
            label="身份证号"
            align="center"
            prop="cusIdcard"
            min-width="190"
          />
          <el-table-column
            label="套餐名"
            align="center"
            prop="tcm"
            min-width="100"
          />
          <el-table-column
            label="登记时间"
            align="center"
            prop="tjTime"
            min-width="120"
          />
          <el-table-column
            label="审核状态"
            align="center"
            prop="confirmStatus"
            min-width="80"
          >
            <template slot-scope="scope">
              <span :style="{ color: scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29' }"
                v-if="scope.row.confirmStatus == '301'">已通过</span>
              <span :style="{ color: scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29' }"
                v-if="scope.row.confirmStatus == '299'">已驳回</span>
              <span
                :style="{
                  color:
                    scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29',
                }"
                v-if="scope.row.confirmStatus == '301'"
                >已通过</span
              >
              <span
                :style="{
                  color:
                    scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29',
                }"
                v-if="scope.row.confirmStatus == '299'"
                >已驳回</span
              >
            </template>
          </el-table-column>
        </el-table>
        <div class="pag">
          <div class="pag1">
            <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page"
              :limit.sync="queryParams.pageSize" @pagination="submitForm" />
            <pagination
              v-show="total > 0"
              :total="total"
              :page.sync="queryParams.page"
              :limit.sync="queryParams.pageSize"
              @pagination="submitForm"
            />
          </div>
        </div>
      </el-col>
      <el-col :span="11">
        <el-table v-loading="loading" ref="mu" :data="tableList" :row-class-name="tableRowClassName"
          @header-click="handleHeaderClick" highlight-current-row @selection-change="handleChange" border
          style="height: 400px">
        <el-table
          v-loading="loading"
          ref="mu"
          :data="tableList"
          :row-class-name="tableRowClassName"
          @header-click="handleHeaderClick"
          highlight-current-row
          @selection-change="handleChange"
          border
          style="height: 400px"
        >
          <el-table-column type="selection" width="50" align="center" />
          <el-table-column label="科室" align="center" prop="deptName" min-width="100" :show-overflow-tooltip="true" />
          <el-table-column label="项目" align="center" prop="proName" min-width="150" :show-overflow-tooltip="true" />
          <el-table-column label="状态" align="center" prop="type" :show-overflow-tooltip="true" min-width="100">
          <el-table-column
            label="科室"
            align="center"
            prop="deptName"
            min-width="100"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="项目"
            align="center"
            prop="proName"
            min-width="150"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="状态"
            align="center"
            prop="type"
            :show-overflow-tooltip="true"
            min-width="100"
          >
            <template slot-scope="scope">
              <span v-if="scope.row.type == '0'" :style="type == 0 ? { color: 'red' } : { color: '#409EFF' }">
              <span
                v-if="scope.row.type == '0'"
                :style="type == 0 ? { color: 'red' } : { color: '#409EFF' }"
              >
                {{ type == 0 ? "未 检" : "在 检" }}
              </span>
              <span v-if="scope.row.type == '1'">已完成</span>
@@ -95,50 +263,110 @@
          </el-table-column>
          <el-table-column label="图片" align="center" min-width="100">
            <template slot-scope="scope">
              <img v-if="scope.row.imageUrl" :src="scope.row.imageUrl" alt="图片"
                style="width: 50px; height: 50px; object-fit: cover;" />
              <img
                v-if="scope.row.imageUrl"
                :src="scope.row.imageUrl"
                alt="图片"
                style="width: 50px; height: 50px; object-fit: cover"
              />
              <span v-else>无图片</span>
            </template>
          </el-table-column>
          <el-table-column label="检查时间" align="center" prop="bcupdateTime" min-width="160" />
          <el-table-column
            label="检查时间"
            align="center"
            prop="bcupdateTime"
            min-width="160"
          />
          <el-table-column label="操作" align="center" width="100">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="showImagePreview(scope.row.imageUrl)"
                :disabled="!scope.row.imageUrl">查看图片</el-button>
              <el-button
                type="text"
                size="small"
                @click="showImagePreview(scope.row.imageUrl)"
                :disabled="!scope.row.imageUrl"
                >查看图片</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <div style="margin-top: 10px">
          <el-form :model="form" ref="queryForm" size="small" :inline="false" label-width="68px">
          <el-form
            :model="form"
            ref="queryForm"
            size="small"
            :inline="false"
            label-width="68px"
          >
            <el-form-item label="检查所见" prop="proResult">
              <el-input v-model="form.proResult" clearable type="textarea" @focus="submiepilog" />
              <el-input
                v-model="form.proResult"
                clearable
                type="textarea"
                @focus="submiepilog"
              />
            </el-form-item>
            <el-form-item label="检查结论" prop="conclusion">
              <el-input v-model="form.conclusion" clearable type="textarea" @focus="submiepilog" />
              <el-input
                v-model="form.conclusion"
                clearable
                type="textarea"
                @focus="submiepilog"
              />
            </el-form-item>
            <el-form-item>
              <el-upload action="" :http-request="uploadFile" :show-file-list="false" accept="image/*"
                :before-upload="beforeUpload" style="display: inline-block; margin-right: 10px;">
                <el-button type="primary" icon="el-icon-picture" size="mini"
                  :disabled="!isUploadEnabled">上传图片</el-button>
              <el-upload
                action=""
                :http-request="uploadFile"
                :show-file-list="false"
                accept="image/*"
                :before-upload="beforeUpload"
                style="display: inline-block; margin-right: 10px"
              >
                <el-button
                  type="primary"
                  icon="el-icon-picture"
                  size="mini"
                  :disabled="!isUploadEnabled"
                  >上传图片</el-button
                >
              </el-upload>
              <el-button type="primary" icon="el-icon-search" size="mini" @click="submito">提交</el-button>
              <el-button
                type="primary"
                icon="el-icon-search"
                size="mini"
                @click="submito"
                >提交</el-button
              >
            </el-form-item>
          </el-form>
        </div>
      </el-col>
    </el-row>
    <el-dialog title="图片预览" :visible.sync="imagePreviewVisible" width="60%" class="image-preview-dialog">
    <el-dialog
      title="图片预览"
      :visible.sync="imagePreviewVisible"
      width="60%"
      class="image-preview-dialog"
    >
      <div class="image-container">
        <img :src="currentImageUrl" alt="图片" class="preview-image" />
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="imagePreviewVisible = false">确定</el-button>
        <el-button type="primary" @click="imagePreviewVisible = false"
          >确定</el-button
        >
      </span>
    </el-dialog>
    <Public ref="aaa" :check-status="checkStatus" :pro-result="form.proResult" :conclusion="form.conclusion"
      @add="handleChanges" :project-list="projectList" />
    <Public
      ref="aaa"
      :check-status="checkStatus"
      :pro-result="form.proResult"
      :conclusion="form.conclusion"
      @add="handleChanges"
      :project-list="projectList"
    />
  </div>
</template>
<script>
@@ -279,18 +507,22 @@
      }
    },
    beforeUpload(file) {
      const isImage = file.type.startsWith('image/');
      const isImage = file.type.startsWith("image/");
      if (!isImage) {
        this.$message.error('只能上传图片文件!');
        this.$message.error("只能上传图片文件!");
        return false;
      }
      const isLt5M = file.size / 1024 / 1024 < 5;
      if (!isLt5M) {
        this.$message.error('图片大小不能超过 5MB!');
        this.$message.error("图片大小不能超过 5MB!");
        return false;
      }
      if (!this.selectedRow || !this.selectedRow.proId || !this.selectedTjNumber) {
        this.$message.error('请先选择一个项目!');
      if (
        !this.selectedRow ||
        !this.selectedRow.proId ||
        !this.selectedTjNumber
      ) {
        this.$message.error("请先选择一个项目!");
        return false;
      }
      return true;
@@ -300,38 +532,40 @@
      const tjNumber = this.selectedTjNumber;
      const proId = this.selectedRow.proId;
      const fileExtension = file.name.split('.').pop();
      const fileExtension = file.name.split(".").pop();
      const newFileName = `${tjNumber}_${proId}.${fileExtension}`;
      const formData = new FormData();
      formData.append('file', file, newFileName);
      formData.append('tjh', tjNumber);
      formData.append('proId', proId);
      formData.append("file", file, newFileName);
      formData.append("tjh", tjNumber);
      formData.append("proId", proId);
      tupian(formData)
        .then(response => {
        .then((response) => {
          // console.log('成功了', response);
          if (response.code === 200) {
            this.$message.success('图片上传成功!');
            const index = this.tableList.findIndex(item => item.proId === proId);
            this.$message.success("图片上传成功!");
            const index = this.tableList.findIndex(
              (item) => item.proId === proId
            );
            if (index !== -1) {
              // 保存 base64 图像用于显示
              if (response.base64) {
                const base64Image = `data:image/${fileExtension};base64,${response.base64}`;
                this.$set(this.tableList[index], 'imageUrl', base64Image);
                this.$set(this.tableList[index], "imageUrl", base64Image);
              }
              // 保存返回的 url
              if (response.url) {
                this.$set(this.tableList[index], 'url', response.url);
                this.$set(this.tableList[index], "url", response.url);
              }
            }
          } else {
            this.$message.error('图片上传失败!');
            this.$message.error("图片上传失败!");
          }
        })
        .catch(error => {
        .catch((error) => {
          // console.log('上传失败', error);
          this.$message.error('图片上传失败!');
          this.$message.error("图片上传失败!");
        });
    },
    enterHandler() {
@@ -544,9 +778,9 @@
      let tjNumber = val;
      this.loading = true;
      getYxJcXx(tjNumber).then((res) => {
        this.tableList = res.data.map(item => {
        this.tableList = res.data.map((item) => {
          // 如果 imageUrl 存在且是纯 Base64 字符串,添加 data:image 前缀
          if (item.imageUrl && !item.imageUrl.startsWith('data:image')) {
          if (item.imageUrl && !item.imageUrl.startsWith("data:image")) {
            // 假设图片类型为 png,如果接口提供类型,可以替换为动态值
            item.imageUrl = `data:image/png;base64,${item.imageUrl}`;
          }
@@ -686,43 +920,48 @@
    },
    submito() {
      if (!this.selectedRow || !this.selectedRow.proId) {
        console.error("未选中行或缺少 proId");
        this.$message.error("请选择提交项目");
        return;
      }
      const proId = this.selectedRow.proId;
      const jcsj = this.form.proResult || " ";
      const jcjl = this.form.conclusion || " ";
      const url = this.selectedRow.url || ""; // 获取 url,如果不存在则为空字符串
      addYxJcXx({
        proId: proId,
        tjNumber: this.selectedTjNumber,
        jcsj: jcsj,
        jcjl: jcjl,
        url: url // 添加 url 参数
      })
        .then((response) => {
          this.form.proResult = "";
          this.form.conclusion = "";
          if (this.tableList.length == 1) {
            this.submitForm();
          } else {
            this.tableList.forEach((item, index) => {
              if (item.type == 0) {
                this.changtjNumber(this.selectedTjNumber);
              } else {
                this.submitForm();
              }
            });
          }
      if (!this.form.proResult && !this.form.conclusion) {
        this.$message.warning("请选择检查所见或检查结论!");
      } else {
        const proId = this.selectedRow.proId;
        const jcsj = this.form.proResult || " ";
        const jcjl = this.form.conclusion || " ";
        const url = this.selectedRow.url || ""; // 获取 url,如果不存在则为空字符串
        addYxJcXx({
          proId: proId,
          tjNumber: this.selectedTjNumber,
          jcsj: jcsj,
          jcjl: jcjl,
          url: url, // 添加 url 参数
        })
        .catch((error) => {
          console.error("提交失败", error);
        });
          .then((response) => {
            this.form.proResult = "";
            this.form.conclusion = "";
            if (this.tableList.length == 1) {
              this.submitForm();
            } else {
              this.tableList.forEach((item, index) => {
                if (item.type == 0) {
                  this.changtjNumber(this.selectedTjNumber);
                } else {
                  this.submitForm();
                }
              });
            }
          })
          .catch((error) => {
            console.error("提交失败", error);
          });
      }
    },
    handleDelete() { },
    handleExport() { },
    handleDelete() {},
    handleExport() {},
  },
};
</script>