WXL
2023-12-18 d94d00d2cd9eaf87bb3776f72f8e73410b93cb7a
src/views/patient/patient/profile/index.vue
@@ -6,14 +6,27 @@
        <el-col :span="18">
          <div class="headportrait">
            <div class="text-center">
              <img v-imgError="require('@/assets/common/head.jpg')" src="" />
              <img
                v-imgError="require('@/assets/images/shoushuzhudaoyisheng.png')"
                src=""
              />
            </div>
            <div style="margin-left: 10px">吴大龙</div>
            <div style="margin-left: 10px" class="text-title">男</div>
            <div style="margin-left: 10px" class="text-title">66岁</div>
            <div style="margin-left: 10px" class="text-title">1999.12.18</div>
            <div style="margin-left: 10px" class="text-title">汉族</div>
            <div style="margin-left: 10px" class="text-title">河南信阳</div>
            <div style="margin-left: 10px">{{ userform.name }}</div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.sex == 1 ? "男" : "女" }}
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.age }}岁
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.birthdate }}
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.nation }}
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.birthplace }}
            </div>
          </div></el-col
        >
      </el-row>
@@ -95,35 +108,36 @@
    <!-- 健康档案模块 -->
    <div class="information-content" v-if="activeName == 'health'">
      <div class="top-message">
        <div class="headline">基础信息</div>
        <div class="headlines">
          <div>基础信息</div>
          <el-button type="primary" @click="savefile">保存患者档案</el-button>
        </div>
        <div class="detailed">
          <el-row :gutter="20">
            <el-col :span="12"
              ><div class="grid-content bg-purple">
                患者姓名:<span class="spanvalue">王大美</span>
                患者姓名:<span class="spanvalue">{{ userform.name }}</span>
              </div></el-col
            >
            <el-col :span="12"
              ><div class="grid-content bg-purple">
                联系电话:<span class="spanvalue">13803963330</span>
                联系电话:<span class="spanvalue">{{ userform.telcode }}</span>
              </div></el-col
            >
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24"
              ><div class="grid-content bg-purple">
                出生地:<span class="spanvalue"
                  >浙江省杭州市余杭区余杭街道</span
                >
                出生地:<span class="spanvalue">{{ userform.birthplace }}</span>
              </div></el-col
            >
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24"
              ><div class="grid-content bg-purple">
                居住地:<span class="spanvalue"
                  >浙江省杭州市余杭区余杭街道</span
                >
                居住地:<span class="spanvalue">{{
                  userform.placeOfResidence
                }}</span>
              </div></el-col
            >
          </el-row>
@@ -145,13 +159,15 @@
                  v-if="inputVisible"
                  @change="handleInputConfirm"
                  filterable
                  allow-create
                  default-first-option
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in options"
                    :key="item.label"
                    :label="item.label"
                    :value="item.label"
                    :key="item.tagname"
                    :label="item.tagname"
                    :value="item.tagname"
                  >
                  </el-option>
                </el-select>
@@ -171,12 +187,12 @@
      <div class="top-message">
        <div class="headline">病史</div>
        <div class="detailed">
          <el-form ref="form" :model="form" :rules="rules" label-width="100px">
          <el-form ref="form" :model="form" label-width="100px">
            <el-row>
              <el-col :span="8">
                <el-form-item label="过往疾病" prop="name">
                  <el-input
                    v-model="form.name"
                    v-model="form.pastIllnesses"
                    placeholder="请输入"
                    maxlength="30"
                  />
@@ -185,7 +201,7 @@
              <el-col :span="8">
                <el-form-item label="药物过敏" prop="sex">
                  <el-input
                    v-model="form.name"
                    v-model="form.drugAllergy"
                    placeholder="请输入具体药物/无"
                    maxlength="30"
                  />
@@ -194,7 +210,7 @@
              <el-col :span="8">
                <el-form-item label="家族病史" prop="age">
                  <el-input
                    v-model="form.age"
                    v-model="form.familyHistory"
                    placeholder="请输入具体疾病/无"
                    maxlength="30"
                  />
@@ -205,7 +221,7 @@
              <el-col :span="8">
                <el-form-item label="手术史" prop="name">
                  <el-input
                    v-model="form.name"
                    v-model="form.surgicalHistory"
                    placeholder="请输入手术/无"
                    maxlength="30"
                  />
@@ -214,62 +230,62 @@
              <el-col :span="8">
                <el-form-item label="生育史" prop="age">
                  <el-input
                    v-model="form.age"
                    v-model="form.reproductiveHistory"
                    placeholder="请输入胎数/无"
                    maxlength="30"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="月经史" prop="telcode">
                  <el-radio-group v-model="form.radio">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="月经史" prop="menstrualHistory">
                  <el-radio-group v-model="form.menstrualHistory">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="吸烟情况" prop="idtype">
                  <el-radio-group v-model="form.radio">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="吸烟情况" prop="smoking">
                  <el-radio-group v-model="form.smoking">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="饮酒情况" prop="idno">
                  <el-radio-group v-model="form.radios">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="饮酒情况" prop="drink">
                  <el-radio-group v-model="form.drink">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="运动情况" prop="idno">
                  <el-radio-group v-model="form.radiosa">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="运动情况" prop="motion">
                  <el-radio-group v-model="form.motion">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="饮食情况" prop="idno">
                  <el-radio-group v-model="form.radiosa">
                    <el-radio :label="1">多度饮食</el-radio>
                    <el-radio :label="2">正常饮食</el-radio>
                    <el-radio :label="2">食欲不振</el-radio>
                <el-form-item label="饮食情况" prop="diet">
                  <el-radio-group v-model="form.diet">
                    <el-radio label="1">过度饮食</el-radio>
                    <el-radio label="2">正常饮食</el-radio>
                    <el-radio label="3">食欲不振</el-radio>
                  </el-radio-group>
                </el-form-item> </el-col
              ><el-col :span="12">
                <el-form-item label="心理情况" prop="idno">
                  <el-radio-group v-model="form.radiosa">
                    <el-radio :label="1">心情愉悦</el-radio>
                    <el-radio :label="2">轻微焦虑</el-radio>
                    <el-radio :label="2">抑郁</el-radio>
                <el-form-item label="心理情况" prop="psychology">
                  <el-radio-group v-model="form.psychology">
                    <el-radio label="1">心情愉悦</el-radio>
                    <el-radio label="2">轻微焦虑</el-radio>
                    <el-radio label="3">抑郁</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
@@ -280,20 +296,22 @@
      <!-- 联系电话 -->
      <div class="bottom-message">
        <div class="headline">
          号码维护
          <el-button type="primary" @click="AddanumberVisible = true"
            >+新增</el-button
          >
          号码维护<span style="margin-right: 60px">&nbsp;&nbsp;</span>
          <el-button type="primary" @click="addcompiletb">+新增</el-button>
        </div>
        <div class="Table-screen">
          <el-table :data="tableData" style="width: 100%">
          <el-table
            :data="tableData"
            style="width: 100%"
            :row-class-name="tableRowClassName"
          >
            <el-table-column prop="id" label="序号" width="180">
            </el-table-column>
            <el-table-column prop="name" label="姓名" width="180">
            <el-table-column prop="contactname" label="姓名" width="180">
            </el-table-column>
            <el-table-column prop="phonenumber" label="联系方式" width="180">
            <el-table-column prop="contactway" label="联系方式" width="180">
            </el-table-column>
            <el-table-column prop="concern" label="关系"> </el-table-column>
            <el-table-column prop="relation" label="关系"> </el-table-column>
            <el-table-column
              label-class-name="columcz"
              fixed="right"
@@ -301,11 +319,22 @@
              width="300"
            >
              <template slot-scope="scope">
                <el-button type="success" size="small"
                <el-button
                  type="success"
                  size="small"
                  @click="defaulttb(scope.row)"
                  >设为默认联系方式</el-button
                >
                <el-button type="warning" size="small">编辑</el-button>
                <el-button type="danger" size="small">删除</el-button>
                <el-button
                  @click="compiletb(scope.row)"
                  type="warning"
                  size="small"
                  >编辑</el-button
                >
                <el-button @click="deltb(scope.row)" type="danger" size="small"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
@@ -562,21 +591,21 @@
      </div>
    </div>
    <el-dialog title="新增联系方式" :visible.sync="AddanumberVisible">
    <el-dialog :title="titletb" :visible.sync="AddanumberVisible">
      <el-form :model="numberform" label-width="100px">
        <el-form-item label="姓名">
          <el-input v-model="numberform.name"></el-input>
          <el-input v-model="numberform.contactname"></el-input>
        </el-form-item>
        <el-form-item label="联系电话">
          <el-input v-model="numberform.name"></el-input>
          <el-input v-model="numberform.contactway"></el-input>
        </el-form-item>
        <el-form-item label="关系">
          <el-input v-model="numberform.name"></el-input>
          <el-input v-model="numberform.relation"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="AddanumberVisible = false">取 消</el-button>
        <el-button type="primary" @click="Addanumber">确 定</el-button>
        <el-button type="primary" @click="archivecontact">确 定</el-button>
      </div>
    </el-dialog>
  </div>
@@ -588,16 +617,26 @@
import resetPwd from "./resetPwd";
import * as echarts from "echarts";
import SFtable from "@/components/SFtable"; //表格组件
import { getUserProfile } from "@/api/system/user";
import { listJob } from "@/api/monitor/job"; //获取列表接口待定
import { listtag } from "@/api/system/label";
import {
  messagelistpatient,
  addmedicalhistory,
  getmedicalhistory,
  editmedicalhistory,
  addcontactinformation,
  editcontactinformation,
  getcontactinformation,
  delcontactinformation,
  listcontactinformation,
  alterpatient,
} from "@/api/patient/homepage";
export default {
  name: "Profile",
  components: { userAvatar, userInfo, resetPwd, SFtable },
  data() {
    return {
      user: {},
      userform: {},
      roleGroup: {},
      postGroup: {},
      form: {},
@@ -608,11 +647,13 @@
      tjnumber: 12,
      yynumber: 12,
      total: 0, // 总条数
      titletb: "新增联系方式",
      activeTab: "userinfo",
      id: "",
      activeName: "health", //一类导航
      sonactiveName: "outpatient", //健康监测导航
      sontwoactiveName: "blood", //医疗档案导航
      dynamicTags: ["标签一", "标签二", "标签三"],
      dynamicTags: [],
      record: [
        {
          name: "宣教任务",
@@ -639,28 +680,7 @@
      echartdom: {},
      xtechartdom: {},
      tzechartdom: {},
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
      tableData: [],
      tableDatalist: [
        {
          id: 12,
@@ -754,20 +774,171 @@
      this.xueyangechartsInit();
      this.twechartsInit();
    });
    this.getList();
    this.id = this.$route.query.id;
    this.getuserinfo();
    this.gettabList();
  },
  methods() {},
  methods: {
    // 查询列表
    // 查询档案列表信息
    getList() {
      this.loading = true;
      listJob(this.queryParams).then((response) => {
        this.jobList = 1;
        this.total = 1;
        this.loading = false;
    },
    getcontactlist() {
      listcontactinformation({ patid: this.id }).then((response) => {
        this.tableData = response.rows;
      });
    },
    // 获取基础信息
    getuserinfo() {
      const queryParams = {
        pid: Number(this.id),
        allhosp: "0",
        pageNum: 1,
      };
      // 患者基础信息
      messagelistpatient(queryParams).then((response) => {
        this.userform = response.rows[0];
        this.dynamicTags = response.rows[0].tagList;
      });
      // 病史信息
      getmedicalhistory({ pid: this.id }).then((res) => {
        this.form = res.rows[0];
      });
      // 联系信息
      this.getcontactlist();
    },
    // 保存患者档案
    savefile() {
      this.userform.tagList = this.dynamicTags;
      alterpatient(this.userform).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("基础信息保存成功");
        } else {
          this.$modal.msgError("基础信息修改失败");
        }
      });
      // 病史
      this.medicalhistory();
    },
    // 病史
    medicalhistory() {
      if (this.form.id) {
        editmedicalhistory(this.form).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("病史保存成功");
          } else {
            this.$modal.msgError("病史修改失败");
          }
        });
      } else {
        this.form.pid = this.id;
        addmedicalhistory(this.form).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("病史保存成功");
          } else {
            this.$modal.msgError("病史修改失败");
          }
        });
      }
    },
    // 联系方式---------------
    archivecontact() {
      if (this.numberform.id) {
        editcontactinformation(this.numberform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("联系方式修改成功");
            this.getcontactlist();
            this.AddanumberVisible = false;
          } else {
            this.$modal.msgError("联系方式修改失败");
          }
        });
      } else {
        this.numberform.patid = this.id;
        addcontactinformation(this.numberform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("联系方式新增成功");
            this.getcontactlist();
            this.AddanumberVisible = false;
          } else {
            this.$modal.msgError("联系方式新增失败");
          }
        });
      }
      this.numberform = {};
    },
    deltb(row) {
      this.$modal
        .confirm("是否确认删除该数据项?")
        .then(() => {
          if (row.id) {
            delcontactinformation(row.id).then((res) => {
              if (res.code == 200) {
                this.$modal.msgSuccess("联系方式删除成功");
                this.getcontactlist();
              } else {
                this.$modal.msgError("联系方式删除失败");
              }
            });
          } else {
            let index = this.tableData.indexOf(obj);
            this.tableData.splice(index, 1);
          }
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    addcompiletb() {
      this.titletb = "新增联系方式";
      this.AddanumberVisible = true;
    },
    compiletb(row) {
      this.numberform = row;
      this.titletb = "修改联系方式";
      this.AddanumberVisible = true;
    },
    defaulttb(row) {
      this.$modal
        .confirm("是否确认设置该数据项为默认联系人?")
        .then(() => {
          this.tableData.forEach((obj, index) => {
            if (obj === row) {
              obj.isdefault = 1;
              this.numberform = obj;
              this.archivecontact();
            } else if (obj.isdefault == 1) {
              obj.isdefault = 0;
              this.numberform = obj;
              this.archivecontact();
            } else {
              obj.isdefault = 0;
            }
          });
          this.$modal.msgSuccess("设置成功");
        })
        .catch(() => {});
    },
    tableRowClassName({ row, rowIndex }) {
      console.log(row);
      if (row.isdefault == "1") {
        return "warning-row";
      }
      return "";
    },
    /** 查询标签列表 */
    gettabList() {
      const tagqueryParams = {
        pageNum: 1,
        pageSize: 1000,
        tagcategoryid: "0",
      };
      listtag(tagqueryParams).then((response) => {
        this.options = response.rows;
      });
    },
    // tab切换
    handleClick(tab, event) {
      console.log(tab, event);
    },
@@ -869,10 +1040,8 @@
    // 血糖图表
    xtechartsInit() {
      // 基于准备好的dom,初始化echarts实例
      // console.log(echarts);
      console.log(this.xtechartdom);
      var myxyChart = echarts.init(this.xtechartdom);
      console.log(myxyChart);
      const data = [
        ["2000-06-05", 116],
        ["2000-06-06", 129],
@@ -963,15 +1132,13 @@
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
    // 体重图表
    tzechartsInit() {
      // 基于准备好的dom,初始化echarts实例
      console.log(echarts);
      console.log(this.tzechartdom);
      var myxyChart = echarts.init(this.tzechartdom);
      var option = {
        title: {
@@ -1030,7 +1197,6 @@
    // 心率
    xlechartsInit() {
      var myxyChart = echarts.init(this.xlechartdom);
      console.log(myxyChart);
      const data = [
        ["2000-06-05", 116],
        ["2000-06-06", 129],
@@ -1103,7 +1269,6 @@
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
@@ -1182,7 +1347,6 @@
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
@@ -1248,7 +1412,6 @@
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
@@ -1260,7 +1423,7 @@
.personages {
  height: 88px;
  width: 100%;
  background-color: #2486b9;
  background-color: #5e86f9;
  border-radius: 5px;
  padding: 20px;
  margin-bottom: 10px;
@@ -1350,6 +1513,15 @@
    margin-bottom: 10px;
    border-left: 8px solid rgb(65, 161, 190);
  }
  .headlines {
    font-size: 25px;
    display: flex;
    width: 88%;
    justify-content: space-between;
    padding-left: 5px;
    margin-bottom: 10px;
    border-left: 8px solid rgb(65, 161, 190);
  }
  .bottom-message {
    margin-bottom: 25px;
    margin-left: 100px;
@@ -1375,7 +1547,7 @@
.sontwoactiveName {
  margin: 0 auto;
}
// .columcz {
//   align-items: center!important;
// }
::v-deep.el-table .warning-row {
  background: oldlace;
}
</style>