WXL
2024-03-25 d84cde7ed98bf0c562a8631e660fd494de9a7d0b
src/views/patient/patient/profile/index.vue
@@ -145,27 +145,30 @@
            <el-col :span="24"
              ><div class="xinz-inf">
                <el-tag
                  :key="tag"
                  :key="tag.tagid"
                  type="success"
                  v-for="tag in dynamicTags"
                  closable
                  :disable-transitions="false"
                  @close="handleClose(tag)"
                >
                  {{ tag }}
                  {{ tag.tagname }}
                </el-tag>
                <el-select
                  v-model="inputValue"
                  v-if="inputVisible"
                  @change="handleInputConfirm"
                  :remote-method="remoteMethod"
                  remote
                  filterable
                  allow-create
                  default-first-option
                  placeholder="请选择"
                  placeholder="请选择/查询"
                  :loading="loading"
                >
                  <el-option
                    v-for="item in options"
                    :key="item.tagname"
                    :key="item.tagid"
                    :label="item.tagname"
                    :value="item.tagname"
                  >
@@ -650,6 +653,7 @@
      titletb: "新增联系方式",
      activeTab: "userinfo",
      id: "",
      loading: false,
      activeName: "health", //一类导航
      sonactiveName: "outpatient", //健康监测导航
      sontwoactiveName: "blood", //医疗档案导航
@@ -789,6 +793,9 @@
        this.tableData = response.rows;
      });
    },
    processElement(element) {
      return { ...element, isoperation: null };
    },
    // 获取基础信息
    getuserinfo() {
      const queryParams = {
@@ -799,7 +806,8 @@
      // 患者基础信息
      messagelistpatient(queryParams).then((response) => {
        this.userform = response.rows[0];
        this.dynamicTags = response.rows[0].tagList;
        // this.dynamicTags = response.rows[0].tagList;
        this.dynamicTags = response.rows[0].tagList.map(this.processElement);
      });
      // 病史信息
      getmedicalhistory({ pid: this.id }).then((res) => {
@@ -810,7 +818,8 @@
    },
    // 保存患者档案
    savefile() {
      this.userform.tagList = this.dynamicTags;
      // this.userform.tagList = this.dynamicTags;
      this.userform.isoperation = 2;
      alterpatient(this.userform).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("基础信息保存成功");
@@ -818,7 +827,7 @@
          this.$modal.msgError("基础信息修改失败");
        }
      });
      // 病史
      // 病史是
      this.medicalhistory();
    },
    // 病史
@@ -920,12 +929,18 @@
        .catch(() => {});
    },
    tableRowClassName({ row, rowIndex }) {
      console.log(row);
      if (row.isdefault == "1") {
        return "warning-row";
      }
      return "";
    },
    // tab切换
    handleClick(tab, event) {
      console.log(tab, event);
    },
    // 联系方式新增
    Addanumber() {},
    // 标签--------------------------
    /** 查询标签列表 */
    gettabList() {
      const tagqueryParams = {
@@ -937,28 +952,59 @@
        this.options = response.rows;
      });
    },
    // tab切换
    handleClick(tab, event) {
      console.log(tab, event);
    remoteMethod(value) {
      const illnessqueryParams = {
        pageNum: 1,
        pageSize: 100,
        tagname: value,
        tagcategoryid: "0",
      };
      this.loading = true;
      setTimeout(() => {
        this.loading = false;
        listtag(illnessqueryParams).then((response) => {
          this.options = response.rows;
        });
      }, 200);
    },
    // 联系方式新增
    Addanumber() {},
    handleClose(tag) {
      const lindex = this.dynamicTags.indexOf(tag);
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
      this.userform.tagList[lindex].isoperation = 3;
    },
    showInput() {
      this.inputVisible = true;
      this.$nextTick((_) => {
        this.$refs.saveTagInput.$refs.input.focus();
      });
      // this.$nextTick((_) => {
      //   this.$refs.saveTagInput.$refs.input.focus();
      // });
    },
    handleInputConfirm() {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.dynamicTags.push(inputValue);
      let tagvalue = {};
      let tagname = this.inputValue;
      if (tagname) {
        listtag({
          pageNum: 1,
          pageSize: 1000,
          tagcategoryid: "0",
          tagname: tagname,
        }).then((res) => {
          if (res.rows[0]) {
            tagvalue = res.rows[0];
            tagvalue.isoperation = 1;
          } else {
            tagvalue = {
              tagname: tagname,
              isoperation: 1,
            };
          }
          console.log(tagvalue);
          this.userform.tagList.push(tagvalue);
          this.dynamicTags.push(tagvalue);
          console.log(this.userform.tagList);
          console.log(this.dynamicTags);
        });
      }
      this.inputVisible = false;
      this.inputValue = "";
@@ -1452,7 +1498,7 @@
}
.xinz-inf {
  font-size: 18px;
  white-space: nowrap;
  // white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;