WXL (wul)
5 天以前 70e4d2c33cc2e3af590d1816c0c703da341538cf
src/views/patient/questionnaire/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <div class="leftvlue" style="margin-bottom: 20px">
    <!-- <div class="leftvlue" style="margin-bottom: 20px">
      <el-row :gutter="10">
        <el-col :span="2.5" v-for="(item, index) in cardlist" :key="index">
          <el-card
@@ -61,7 +61,13 @@
          </div>
        </el-col>
      </el-row>
    </div>
    </div> -->
    <statistics-cards
      :cardlist="cardlist"
      :ycvalue="ycvalue"
      :jgvalue="jgvalue"
      :show-warning-condition="orgname == '省立同德翠苑院区'"
    />
    <el-row :gutter="20">
      <!--用户数据-->
      <el-form
@@ -139,7 +145,7 @@
        <el-col :span="1.5">
          <el-button
            type="primary"
                        icon="el-icon-plus"
            icon="el-icon-plus"
            size="medium"
            @click="handleAdd"
            >新增</el-button
@@ -221,7 +227,7 @@
          width="120"
        >
          <template slot-scope="scope">
             <el-tooltip
            <el-tooltip
              class="item"
              effect="dark"
              :content="scope.row.remark"
@@ -393,7 +399,7 @@
          prop="templatename"
          width="200"
        />
         <el-table-column
        <el-table-column
          label="任务状态"
          align="center"
          key="sendstate"
@@ -681,13 +687,15 @@
} from "@/api/system/user";
import { getTaskservelist } from "@/api/AiCentre/index";
import Treeselect from "@riophae/vue-treeselect";
import StatisticsCards from "@/components/StatisticsCards";
import store from "@/store";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  name: "Discharge",
  dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
  components: { Treeselect },
  components: { Treeselect, StatisticsCards },
  data() {
    return {
      // 遮罩层
@@ -696,6 +704,8 @@
      ids: [],
      // 非单个禁用
      single: true,
      jgvalue: 0,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
@@ -723,7 +733,6 @@
      },
      dynamicTags: ["选项一", "选项二", "选项三"], //选项
      inputVisible: false,
      ycvalue: "",
      yfsvalue: "",
      inputValue: "",
      preachform: "",
@@ -739,6 +748,7 @@
      },
      value: [],
      list: [],
      orgname: "",
      sourcetype: [
        {
@@ -793,26 +803,39 @@
      ],
      cardlist: [
        {
          name: "患者服务总量",
          name: "出院服务总量",
          value: 0,
        },
        {
          name: "患者过滤",
          value: 0,
        },
        {
          name: "应随访",
          value: 0,
        },
        // {
        //   name: "异常",
        //   value: 0,
        // },
        {
          name: "无需随访",
          name: "发送失败",
          value: 0,
        },
        {
          name: "需随访",
          name: "待执行",
          value: 0,
        },
        {
          name: "待随访",
          value: 0,
        },
        {
          name: "已完成",
          value: 0,
        },
        // {
        //   name: "已发送",
        //   value: 0,
        // },
        // {
        //   name: "表单已发送",
        //   value: 0,
        // },
      ],
      // 表单参数
@@ -830,7 +853,7 @@
        pageSize: 10,
        serviceType: 7,
        searchscope: 3,
        sendstate:2,
        sendstate: 2,
        scopetype: [],
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
@@ -838,7 +861,7 @@
      propss: { multiple: true },
      options: [],
       topicoptions: [
      topicoptions: [
        {
          value: null,
          label: "全部",
@@ -875,6 +898,9 @@
        },
      ],
      errtype: "",
      ycvalue: 0,
      jgvalue: 0,
      leavehospitaldistrictcode: "",
      serviceState: [],
      checkboxlist: [],
@@ -889,6 +915,8 @@
    this.errtype = this.$route.query.errtype;
    this.leavehospitaldistrictcode =
      this.$route.query.leavehospitaldistrictcode;
    this.orgname = localStorage.getItem("orgname");
    this.sourcetype[0].children = store.getters.belongDepts.map((dept) => {
      return {
        label: dept.deptName,
@@ -915,48 +943,69 @@
  },
  methods: {
    /** 查询门诊随访服务列表 */
    getList(refresh) {
    async getList(refresh) {
      // 默认全部
      if (this.topqueryParams.searchscope == 3) {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
      this.applyDeptWardScope();
      if (this.endOut == 0) {
        this.topqueryParams.endSendDateTime = this.formatDateToYYYYMMDDHHMMSS(
          this.getEndOfDay()
        );
        this.topqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      // 接受异常跳转
      if (this.errtype) {
        this.topqueryParams.leavehospitaldistrictcodes.push(
          this.leavehospitaldistrictcode
        );
        console.log(this.topqueryParams.leavehospitaldistrictcodes, "11");
      }
      this.loading = true;
      if (this.topqueryParams.leavehospitaldistrictcodes[0]&&this.topqueryParams.leaveldeptcodes[0]) {
        this.topqueryParams.deptOrDistrict=2;
      }else{
        this.topqueryParams.deptOrDistrict=1;
      if (
        this.topqueryParams.leavehospitaldistrictcodes[0] &&
        this.topqueryParams.leaveldeptcodes[0]
      ) {
        this.topqueryParams.deptOrDistrict = 2;
      } else {
        this.topqueryParams.deptOrDistrict = 1;
      }
      if (!this.followupAuthority()) {
        this.$message.warning("未配置科室/病区相关权限不可查询");
        this.loading = false;
        return Promise.reject(new Error("无权限查询"));
      }
      getTaskservelist(this.topqueryParams).then((response) => {
      try {
        const response = await getTaskservelist(this.topqueryParams);
        // ✅ 第一步:先锁定恢复状态
        this.isRestoring = true;
        // ✅ 第二步:再更新数据(这会触发 selection-change,但被锁住了)
        this.userList = response.rows[0].serviceSubtaskList;
        this.total = response.total;
        // ✅ 第三步:恢复选中状态
        // this.restoreSelection();
        this.$nextTick(() => {
          this.restoreSelection();
        });
        // ✅ 第四步:处理其他数据
        if (refresh) {
          this.cardlist[0].value =
            Number(response.rows[0].wxsf) + Number(response.rows[0].xsf) || 0;
          // this.cardlist[1].value = response.rows[0].wzx;
          this.cardlist[1].value = response.rows[0].wxsf || 0;
          this.ycvalue = response.rows[0].yc;
          this.ycvalue = Number(response.rows[0].yc) || 0;
          this.jgvalue = response.rows[0].jg;
          this.cardlist[2].value = response.rows[0].xsf || 0;
          this.cardlist[3].value = response.rows[0].dsf || 0;
          this.cardlist[4].value = response.rows[0].ywc || 0;
          this.yfsvalue = response.rows[0].yfs;
        }
        this.loading = false;
        // ✅ 第五步:处理 preachform 等其他数据
        this.userList.forEach((item) => {
          let idArray = null;
          if (item.endtime) {
@@ -964,23 +1013,36 @@
          }
          if (item.preachform) {
            if (item.endtime) {
              item.preachformson = item.preachform;
              idArray = item.preachform.split(",");
            }
            item.preachformson = item.preachform;
            idArray = item.preachform.split(",");
            item.preachform = idArray.map((value) => {
              // 查找id对应的对象
              const item = this.checkboxlist.find(
                (item) => item.value == value
              );
              // 如果找到对应的id,返回label值,否则返回null
              return item ? item.label : null;
            });
          }
          if (item.currentPreachform) {
            item.currentPreachform = this.checkboxlist.find(
              (item) => item.value == item.currentPreachform
            )?.value;
            console.log(item.currentPreachform, "mi");
          }
        });
        this.total = response.total;
      });
        this.loading = false;
        // ✅ 第六步:解锁
        this.$nextTick(() => {
          this.isRestoring = false;
        });
      } catch (error) {
        console.error("获取列表失败:", error);
        this.loading = false;
        this.isRestoring = false;
      }
    },
    // 查看影像随访详情
    Referencequestion(row) {
@@ -1111,7 +1173,7 @@
        pageSize: 10,
        serviceType: 7,
        searchscope: 2,
        sendstate:2,
        sendstate: 2,
      };
      this.handleQuery(1);
    },
@@ -1250,9 +1312,9 @@
    Seedetails(row) {
      let type = "";
      console.log(row, "rwo");
        if (row.type == 1) {
          type = 1;
        }
      if (row.type == 1) {
        type = 1;
      }
      this.$router.push({
        path: "/followvisit/record/detailpage/",
        query: {
@@ -1389,11 +1451,11 @@
  }
}
::v-deep.leftvlue .el-card__body {
  background: #F2F8FF;
  color: #324A9B;
  background: #f2f8ff;
  color: #324a9b;
}
::v-deep.leftvlue .el-card__body:hover {
  background: #3664D9;
  background: #3664d9;
  color: #fff;
  cursor: pointer; /* 鼠标悬浮时变为手形 */
}