liusheng
昨天 9903954c85f651dd5cc6d4b538cfe66b17fc5baa
src/views/followvisit/discharge/outpatientService.vue
@@ -64,6 +64,12 @@
            placeholder="请输入随访人员"
          ></el-input>
        </el-form-item>
        <el-form-item label="主治医生" prop="drname">
          <el-input
            v-model="topqueryParams.drname"
            placeholder="请输入主治医生"
          ></el-input>
        </el-form-item>
        <el-form-item label="患者范围" prop="status">
          <el-cascader
@@ -179,7 +185,7 @@
            </div>
          </div>
        </el-col>
        <el-col :span="1.5">
        <!-- <el-col :span="1.5">
          <div class="documentf">
            <div class="document">
              <el-button
@@ -191,7 +197,7 @@
              >
            </div>
          </div>
        </el-col>
        </el-col> -->
        <el-col :span="1.5">
          <div class="documentf">
            <div class="document">
@@ -394,8 +400,8 @@
        <el-table-column
          label="科室"
          align="center"
          key="deptname"
          prop="deptname"
          key="leaveldeptname"
          prop="leaveldeptname"
          width="120"
        >
        </el-table-column>
@@ -752,7 +758,7 @@
          <el-input
            style="width: 400px"
            disabled
            v-model="zcform.deptname"
            v-model="zcform.leaveldeptname"
          ></el-input>
        </el-form-item>
        <el-form-item label="病区">
@@ -842,6 +848,8 @@
      total: 0,
      // 用户表格数据
      userList: null,
      jgvalue: 0,
      // 弹出层标题
      title: "新增影像随访",
      // 是否显示修改、添加弹出层
@@ -864,7 +872,7 @@
      dynamicTags: ["选项一", "选项二", "选项三"], //选项
      inputVisible: false,
      Labelchange: false,
      ycvalue: "",
      ycvalue: 0,
      yfsvalue: "",
      inputValue: "",
      preachform: "",
@@ -1109,7 +1117,21 @@
      rules: {},
    };
  },
  watch: {},
  watch: {
    // 右下角「待处理随访任务」卡片再次点击(当前已在本页)
    "$route.query": {
      handler(newQuery) {
        if (
          newQuery?.month &&
          newQuery?.fromPendingTask === "1" &&
          this.taskQueryReady
        ) {
          this.applyPendingTaskQuery();
        }
      },
      immediate: true,
    },
  },
  created() {
    this.serviceState = store.getters.serviceState;
    this.checkboxlist = store.getters.checkboxlist;
@@ -1128,7 +1150,9 @@
        value: dept.districtCode,
      };
    });
    if (this.errtype) {
    if (this.applyPendingTaskQuery()) {
      // 右下角「待处理随访任务」卡片跳转:已按年月 + 待随访条件查询
    } else if (this.errtype) {
      this.toleadExport(2);
    } else {
      this.getList(1);
@@ -1136,8 +1160,13 @@
    this.getConfigKey("sys.user.initPassword").then((response) => {
      this.initPassword = response.msg;
    });
    // created 初始化完成,之后路由 query 变化才按卡片条件重新查询
    this.taskQueryReady = true;
  },
  activated() {
    if (this.applyPendingTaskQuery()) {
      return;
    }
    this.getList(1);
  },
  methods: {
@@ -1219,8 +1248,10 @@
      this.getList(1);
    },
    onthatday() {
      this.topqueryParams.startSendDateTime = this.getCurrentDate();
      this.topqueryParams.endSendDateTime = this.getCurrentDate();
      this.topqueryParams.sendstateView = 1; // 待随访
      this.topqueryParams.sendstate = null;
      this.topqueryParams.startSendDateTime = null;
      this.topqueryParams.endSendDateTime = this.getCurrentDate(); // 开始随访日期 <= 今天
      this.getList(1);
    },
    getCurrentDate() {
@@ -1228,13 +1259,12 @@
      return now.toISOString().slice(0, 10); // 截取前10个字符,即 YYYY-MM-DD
    },
    buidegetTasklist(type) {
      if (this.topqueryParams.searchscope == 3) {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.topqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      // 用户权限下所有待随访任务:传递全部科室和病区
      this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
        (obj) => obj.deptCode
      );
      this.topqueryParams.leavehospitaldistrictcodes =
        store.getters.belongWards.map((obj) => obj.districtCode);
      // 接受异常跳转
      if (this.errtype) {
        this.topqueryParams.leavehospitaldistrictcodes.push(
@@ -1246,7 +1276,7 @@
        pageSize: 10,
        leavehospitaldistrictcodes:
          this.topqueryParams.leavehospitaldistrictcodes,
        sendstates: [2, 3],
        sendstateView: 1,
        leaveldeptcodes: this.topqueryParams.leaveldeptcodes,
      };
      buidegetTasklist(obj).then((response) => {
@@ -1341,6 +1371,60 @@
      };
      this.resetForm("form");
    },
    /**
     * 右下角「待处理随访任务」卡片点击数字跳转过来:
     * 按出院年月 + 待随访(sendstate 1/2/3/5/7)+ 出院满 7 天 过滤,口径与卡片一致
     * @returns {boolean} 是否已按卡片条件发起查询
     */
    applyPendingTaskQuery() {
      const query = this.$route.query || {};
      if (!query.month || query.fromPendingTask !== "1") {
        return false;
      }
      // 页面被 keep-alive 复用时会重复触发 activated,同一次点击只处理一次
      if (this.pendingTaskToken && this.pendingTaskToken === query._t) {
        return false;
      }
      this.pendingTaskToken = query._t;
      const month = String(query.month);
      const serviceType = Number(query.serviceType) === 3 ? 3 : 2;
      this.errtype = undefined;
      const start = month + "-01";
      let end = this.pendingTaskMonthEnd(month);
      // 月初 7 天内,"今天-7天" 会早于月初,兜底成月初,避免日期区间倒挂
      if (end < start) {
        end = start;
      }
      this.dateRange = [start, end];
      this.topqueryParams.serviceType = serviceType;
      this.topqueryParams.sendstateView = 1;
      this.topqueryParams.sendstate = null;
      // 卡片统计的是全部待随访任务(不区分首轮/复诊),列表这里同步放开
      this.topqueryParams.visitCount = null;
      this.topqueryParams.pageNum = 1;
      this.handleQuery(1);
      return true;
    },
    /**
     * 卡片口径的月份结束日:
     * 当月只统计出院满 7 天的,所以取「今天 - 7 天」;历史月份取当月最后一天
     */
    pendingTaskMonthEnd(month) {
      const parts = String(month).split("-");
      const year = Number(parts[0]);
      const mon = Number(parts[1]);
      const now = new Date();
      let date;
      if (year === now.getFullYear() && mon === now.getMonth() + 1) {
        date = new Date(year, mon - 1, now.getDate() - 7);
      } else {
        date = new Date(year, mon, 0);
      }
      const mm = String(date.getMonth() + 1).padStart(2, "0");
      const dd = String(date.getDate()).padStart(2, "0");
      return date.getFullYear() + "-" + mm + "-" + dd;
    },
    /** 搜索按钮操作 */
    handleQuery(refresh) {
      if (this.topqueryParams.searchscope == 3) {
@@ -1410,10 +1494,12 @@
    resetQuery() {
      this.dateRange = [];
      this.dateRangefs = [];
      this.serviceStatusValue = 10;
      this.topqueryParams = {
        pageNum: 1,
        pageSize: 10,
        sendstateView:2,
        sendstateView:1,
        sort: 2, //0 出院时间(正序)    1 出院时间(倒序)   2 发送时间(正序)    3 发送时间(倒序)
        serviceType: 3,
        searchscope: 3,
@@ -1732,8 +1818,8 @@
<style lang="scss" scoped>
.el-button--primary.is-plain {
  color: #ffffff;
  background: #409eff;
  border-color: #4fabe9;
  background: #5b7cfa;
  border-color: #5b7cfa;
}
.document {
@@ -1908,4 +1994,75 @@
  flex-shrink: 0;
  margin-top: 2px;
}
/* ================= 清新高级简约风 ================= */
.app-container {
  background: #f5f7fb;
  border-radius: 14px;
  padding: 20px;
}
/* 查询表单:白色圆角卡片 */
::v-deep .el-form--inline {
  background: #ffffff;
  border-radius: 14px;
  padding: 22px 22px 8px;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
/* 隐藏分割线 */
::v-deep .el-divider {
  display: none;
}
/* 工具栏底部间距 */
.mb8 {
  margin-bottom: 18px;
}
/* 按钮:圆角 + 柔和过渡 */
::v-deep .el-button {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.25s ease;
}
/* 主按钮:清新靛蓝 */
::v-deep .el-button--primary:not(.is-plain) {
  background: #5b7cfa;
  border-color: #5b7cfa;
}
::v-deep .el-button--primary:not(.is-plain):hover,
::v-deep .el-button--primary:not(.is-plain):focus {
  background: #7593fb;
  border-color: #7593fb;
}
/* 表格:白色圆角卡片 + 柔和表头 */
::v-deep .el-table {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
::v-deep .el-table::before {
  display: none;
}
::v-deep .el-table th {
  background: #f7f9fd !important;
  color: #3f4d63;
  font-weight: 600;
}
::v-deep .el-table td {
  padding: 12px 0;
}
/* 标签圆角 */
::v-deep .el-tag {
  border-radius: 6px;
}
/* 分页间距 */
::v-deep .pagination-container {
  padding-top: 18px;
}
</style>