WXL (wul)
4 天以前 fb34ba28cb908bd328cf6690ab0b19a56428f4e2
src/views/followvisit/discharge/index.vue
@@ -142,6 +142,16 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          v-if="isTongdeCampus"
          label="日间标记"
          prop="importanceFlagCode"
        >
          <el-input
            v-model="topqueryParams.importanceFlagCode"
            placeholder="请输入日间标记"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button
@@ -467,6 +477,16 @@
          key="currentPreachform"
          prop="currentPreachform"
          width="160"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
        <el-table-column
          v-if="isTongdeCampus"
          label="日间标记"
          align="center"
          key="importanceFlagCode"
          prop="importanceFlagCode"
          width="120"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
@@ -1421,6 +1441,7 @@
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
        currentPreachforms: [],
        importanceFlagCode: "",
      },
      orgname: "",
      propss: { multiple: true },
@@ -1702,9 +1723,13 @@
        // ✅ 第四步:处理其他数据
        if (refresh) {
          this.yfsvalue = response.rows[0].yfs;
          // 顶部卡片的数字不跟「随访状态/异常」走:单独查一次去掉状态条件的统计,
          // 否则筛了「待随访」后「已完成」永远是 0,看着像算错了
          this.refreshCardCounts(params);
          if (this.isTongdeOrg) {
            // 省立同德/南华:顶部卡片数字不跟「随访状态/异常」走,单独查一次去掉状态条件的统计
            this.refreshCardCounts(params);
          } else {
            // 其他医院:顶部数据跟随筛选条件变动,单次查询即可
            this.setCardValues(response.rows[0]);
          }
        }
        // ✅ 第五步:处理 preachform 等其他数据
@@ -1713,7 +1738,7 @@
          if (item.endtime) {
            item.endDay = this.daysBetween(item.endtime);
          }
          console.log(item,'3');
          console.log(item, "3");
          if (item.preachform) {
            item.preachformson = item.preachform;
@@ -2152,6 +2177,7 @@
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
        currentPreachforms: [],
        importanceFlagCode: "",
      };
      this.handleQuery(1);
    },
@@ -2173,6 +2199,7 @@
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
        currentPreachforms: [],
        importanceFlagCode: "",
      };
    },
    handleSelectionChange(rows) {
@@ -2495,6 +2522,18 @@
    // 顶部统计卡片点击:把对应筛选条件下带到下面的列表(数值为 0 的卡片同样可点)
    // 顶部卡片统计:去掉「随访状态 / 异常」条件后再统计,
    // 这样卡片数字只跟日期、科室/病区等条件走,不会因为筛了「待随访」就把「已完成」算成 0
    // 把一次查询返回的统计行写入顶部卡片
    setCardValues(row) {
      if (!row) return;
      this.cardlist[0].value = Number(row.wxsf || 0) + Number(row.xsf || 0);
      this.cardlist[1].value = Number(row.wxsf) || 0;
      this.cardlist[2].value = Number(row.xsf) || 0;
      this.cardlist[3].value = Number(row.dsf) || 0;
      this.cardlist[4].value = Number(row.fssb) || 0;
      this.cardlist[5].value = Number(row.ywc) || 0;
      this.ycvalue = Number(row.yc) || 0;
      this.jgvalue = Number(row.jg) || 0;
    },
    async refreshCardCounts(baseQuery) {
      const query = {
        ...(baseQuery || this.topqueryParams),
@@ -2512,14 +2551,7 @@
        if (!res || !res.rows || !res.rows.length) {
          return;
        }
        this.cardlist[0].value = Number(row.wxsf || 0) + Number(row.xsf || 0);
        this.cardlist[1].value = Number(row.wxsf) || 0;
        this.cardlist[2].value = Number(row.xsf) || 0;
        this.cardlist[3].value = Number(row.dsf) || 0;
        this.cardlist[4].value = Number(row.fssb) || 0;
        this.cardlist[5].value = Number(row.ywc) || 0;
        this.ycvalue = Number(row.yc) || 0;
        this.jgvalue = Number(row.jg) || 0;
        this.setCardValues(row);
      } catch (e) {
        console.warn("刷新顶部卡片统计失败", e);
      }