WXL (wul)
2026-05-08 f9902f7a3b79d22bde9f199263ac36de26816470
src/views/followvisit/tasklist/index.vue
@@ -253,9 +253,10 @@
              ><span class="button-xj">依照新增</span></el-button
            >
            <el-button
              v-if="scope.row.sendState != 5"
              size="medium"
              type="text"
              @click="handleAddpatient(scope.row)"
              @click="handleAddpatient(scope.row.taskid, scope.row.type)"
              ><span class="button-hz"
                ><i class="el-icon-circle-plus-outline"></i>新增患者</span
              ></el-button
@@ -381,9 +382,7 @@
    <Patient-Selection
      ref="Patient"
      :dialogVisiblepatient="dialogVisiblepatient"
      :overallCase="Patientlist"
      :tableLabel="tableLabelhz"
      @addoption="dialogVisiblepatient = false"
      @addoption="addoption"
      @kkoption="dialogVisiblepatient = true"
    />
  </div>
@@ -400,12 +399,7 @@
} from "@/api/system/user";
import {
  getTasklist,
  getTaskInfo,
  Editsingletask,
  delTaskInfo,
  Questionnairetasklist,
  Questionnairetaskget,
  Questionnairetasksponsor,
  TaskTemplateSendExecution,
} from "@/api/AiCentre/index";
import store from "@/store";
@@ -417,7 +411,7 @@
export default {
  name: "Tasklist",
  dicts: ["sys_normal_disable", "sys_user_sex", "task_status"],
  components: { Treeselect },
  components: { Treeselect, PatientSelection },
  data() {
    return {
      // 遮罩层
@@ -468,6 +462,7 @@
      previewtype: 2, //预览影像随访类型
      total: 0, // 总条数
      ImportQuantity: 999, //导影像随访数量
      orgname: null,
      //预览影像随访信息
      previewvalue: {
        username: "这个医生对你怎么样",
@@ -591,6 +586,8 @@
        pageNum: 1,
        pageSize: 10,
        type: 2,
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
        userName: undefined,
        tagid: undefined,
        topic: undefined,
@@ -648,14 +645,18 @@
  },
  watch: {},
  created() {
    // this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
    //   (obj) => obj.deptCode
    // );
    // this.topqueryParams.leavehospitaldistrictcodes =
    //   store.getters.belongWards.map((obj) => obj.districtCode);
    this.orgname = localStorage.getItem("orgname");
    if (this.orgname == "南华大学附属第一医院") {
      this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
        (obj) => obj.deptCode
      );
      this.topqueryParams.leavehospitaldistrictcodes =
        store.getters.belongWards.map((obj) => obj.districtCode);
    }
    this.tasktopic = this.$route.query.tasktopic
      ? this.$route.query.tasktopic
      : this.tasktopic;
    this.tasktopic = Number(this.tasktopic);
    this.getList();
    this.getConfigKey("sys.user.initPassword").then((response) => {
      this.initPassword = response.msg;
@@ -683,6 +684,7 @@
        this.tasktopic == 1 ||
        this.tasktopic == 7 ||
        this.tasktopic == 5 ||
        this.tasktopic == 18 ||
        this.tasktopic == 6
      ) {
        if (!this.topqueryParams.type) this.topqueryParams.type = "2";
@@ -696,8 +698,12 @@
            label: "问卷随访",
          },
        ];
        this.topqueryParams.type = 2;
      } else if (this.tasktopic == 4 || this.tasktopic == 8) {
        // this.topqueryParams.type = 2;
      } else if (
        this.tasktopic == 4 ||
        this.tasktopic == 8 ||
        this.tasktopic == 17
      ) {
        if (!this.topqueryParams.type) this.topqueryParams.type = "3";
        this.longtermlist = [
          {
@@ -722,7 +728,7 @@
            label: "宣教关怀",
          },
        ];
        this.topqueryParams.type = 2;
        // this.topqueryParams.type = 2;
      }
      this.topqueryParams.beginTime = this.dateRange[0];
      this.topqueryParams.endTime = this.dateRange[1];
@@ -1057,110 +1063,13 @@
      const item = data.find((item) => item.value === value);
      return item ? item.label : null;
    },
    //患者添加相关
    handleAddpatient(row) {
      this.allpids = [];
      this.overallCase.forEach((item) => {
        this.allpids.push(item.patid);
      });
      if (this.patientqueryParams.allhosp == 4) {
        this.tableLabelhz = [
          // { label: "入院日期", width: "170", prop: "starttime" },
          { label: "出院日期", width: "150", prop: "endtime" },
          { label: "患者", width: "", prop: "name" },
          { label: "患者诊断", width: "", prop: "leavediagname" },
          { label: "身份证", width: "200", prop: "idcardno" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "出院天数", width: "", prop: "endDay" },
          { label: "责任护士", width: "", prop: "nurseName" },
          { label: "医生", width: "", prop: "drname" },
          { label: "科室", width: "180", prop: "dept" },
          { label: "病区", width: "150", prop: "leavehospitaldistrictname" },
        ];
      } else if (this.patientqueryParams.allhosp == 1) {
        this.tableLabelhz = [
          { label: "入院日期", width: "150", prop: "starttime" },
          { label: "患者", width: "", prop: "name" },
          { label: "患者诊断", width: "", prop: "leavediagname" },
          { label: "身份证", width: "200", prop: "idcardno" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "出院天数", width: "", prop: "endDay" },
          { label: "责任护士", width: "", prop: "nurseName" },
          { label: "医生", width: "", prop: "drname" },
          { label: "科室", width: "180", prop: "dept" },
          { label: "病区", width: "150", prop: "leavehospitaldistrictname" },
        ];
      }
      if (this.allpids[0]) {
        this.patientqueryParams.pids = this.allpids;
      } else {
        this.patientqueryParams.pids = null;
      }
      // 来源判断
      if (this.patientqueryParams.allhosp == 4) {
        this.patientqueryParams.hospitaldistrictcodes = [];
        this.patientqueryParams.deptcodes = [];
      } else if (this.patientqueryParams.allhosp == 1) {
        this.patientqueryParams.deptcodes =
          this.patientqueryParams.leaveldeptcodes;
        this.patientqueryParams.hospitaldistrictcodes =
          this.patientqueryParams.leavehospitaldistrictcodes;
        this.patientqueryParams.leavehospitaldistrictcodes = [];
        this.patientqueryParams.leaveldeptcodes = [];
      }
      getTaskpatientQC(this.patientqueryParams).then((response) => {
        this.patientuserList = response.rows;
        this.patientuserList.forEach((item) => {
          if (item.endtime) {
            item.endDay = this.daysBetween(item.endtime);
          }
        });
        this.patienttotal = response.total;
        this.loading = false;
        this.Restorecheck();
      });
      this.dialogVisiblepatient = true;
    handleAddpatient(taskid) {
      this.$refs.Patient.handleAddpatient(taskid);
      this.dialogVisiblepatient = true; // 手动控制弹窗显示
    },
    // 查询
    handleQuery() {
      // 获取外部患者
      if (this.patientqueryParams.allhosp == 6) {
        this.Externallist();
        console.log();
        return;
      }
      if (this.patientqueryParams.searchscope == 1) {
        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.patientqueryParams.leavehospitaldistrictcodes = [];
      } else if (this.patientqueryParams.searchscope == 2) {
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
        this.patientqueryParams.leaveldeptcodes = [];
      } else {
        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      if (
        !this.patientqueryParams.leavehospitaldistrictcodes ||
        !this.patientqueryParams.leavehospitaldistrictcodes[0]
      )
        this.patientqueryParams.leavehospitaldistrictcodes = null;
      if (
        !this.patientqueryParams.leaveldeptcodes ||
        !this.patientqueryParams.leaveldeptcodes[0]
      )
        this.patientqueryParams.leaveldeptcodes = null;
      this.handleAddpatient();
    addoption() {
      this.dialogVisiblepatient = false; // 手动控制弹窗显示
      this.handleQuery();
    },
  },
};