lkk
2024-10-24 b06a903d08d6f5432105d12686ccaf074b45323a
src/components/jianqianwenzhen/index.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <span class="txt">问诊信息</span>
    <span class="txt"></span>
    <el-form
      ref="form"
      :model="form"
@@ -821,6 +821,10 @@
            if (this.form.yinjiuyear == null) {
              this.form.yinjiuyear = "0";
            }
            // 设置默认值
            if (this.form.gongLing == null) {
              this.form.gongLing = 1; // 工龄默认值
            }
            this.form.tjAskHistorysList = response.data.tjAskHistorysList;
            // this.isdisabled= true
          });
@@ -968,11 +972,11 @@
          this.icdId = item.id;
        }
      });
      this.form.tjAskHistorysList.forEach(item => {
      this.form.tjAskHistorysList.forEach((item) => {
        if(item.diseaseName == sel){
          item.icdId =  this.icdId
          item.icdId = this.icdId;
        }
      })
      });
    },
    // 搜索
    getRemoteData(query) {
@@ -1025,7 +1029,7 @@
      this.chageall = selection;
    },
    /** 提交按钮 */
    submitForm() {
    /* submitForm() {
      // this.form.tjAskHistorysList.forEach(element=>{
      //   element.icdId = this.icdId;
      // })
@@ -1033,7 +1037,27 @@
        this.$modal.msgSuccess("修改成功");
        this.form = response.data;
      });
    },
    }, */
    submitForm() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$emit('submitLoading', true);
          updateHistory(this.form)
            .then((response) => {
              this.$message.success("修改成功");
              this.form = response.data; // 更新表单数据
            })
            .catch((error) => {
              this.$message.error("修改失败");
            })
            .finally(() => {
              this.$emit('submitLoading', false);
            });
        } else {
          this.$message.error("请检查表单内容");
        }
      });
    }
  },
};
</script>