WXL (wul)
3 天以前 c899dff1fce7f8054008cd9887a9729cdffd88cb
src/views/followvisit/mzsatisfaction/index.vue
@@ -15,7 +15,7 @@
        v-show="showSearch"
        label-width="98px"
      >
        <el-form-item label="出院时间">
        <el-form-item label="完成时间">
          <el-date-picker
            v-model="dateRange"
            style="width: 240px"
@@ -55,6 +55,24 @@
            :props="{ expandTrigger: 'hover' }"
            @change="handleChange"
          ></el-cascader>
        </el-form-item>
        <el-form-item label="点位" prop="pointLocations" v-if="isTongdeCampus">
          <el-select
            v-model="topqueryParams.pointLocations"
            multiple
            filterable
            clearable
            placeholder="请选择点位"
            style="width: 240px"
            @change="handlePointLocationChange"
          >
            <el-option
              v-for="item in pointOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="服务状态" prop="status">
@@ -173,7 +191,7 @@
            </div>
          </div>
        </el-col>
        <el-col :span="1.5">
        <!-- <el-col :span="1.5">
          <div class="documentf">
            <div class="document">
              <el-button
@@ -185,7 +203,7 @@
              >
            </div>
          </div>
        </el-col>
        </el-col> -->
        <el-col :span="1.5">
          <div class="documentf">
            <div class="document">
@@ -363,8 +381,8 @@
        <el-table-column
          label="科室"
          align="center"
          key="deptname"
          prop="deptname"
          key="leaveldeptname"
          prop="leaveldeptname"
          width="120"
        >
        </el-table-column>
@@ -376,13 +394,25 @@
          width="120"
        >
        </el-table-column>
        <el-table-column
          v-if="isTongdeCampus"
          label="点位"
          width="120"
          align="center"
          key="pointLocation"
        >
          <template slot-scope="scope">
            {{ pointNameOf(scope.row) }}
          </template>
        </el-table-column>
        <el-table-column
          label="处理人员"
          align="center"
          key="updateBy"
          prop="updateBy"
          width="120"
          min-width="120"
          :show-overflow-tooltip="true"
        />
        <el-table-column
          label="门诊满意度模板名称"
@@ -871,7 +901,7 @@
          <el-input
            style="width: 400px"
            disabled
            v-model="zcform.deptname"
            v-model="zcform.leaveldeptname"
          ></el-input>
        </el-form-item>
        <el-form-item label="病区">
@@ -924,6 +954,7 @@
  updateUser,
  resetUserPwd,
  changeUserStatus,
  deptTreeSelect,
} from "@/api/system/user";
import {
  getTaskservelist,
@@ -1129,6 +1160,7 @@
        scopetype: [],
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
        pointLocations: [],
      },
      propss: { multiple: true },
      options: [],
@@ -1220,6 +1252,10 @@
      leavehospitaldistrictcode: "",
      serviceState: [],
      checkboxlist: [],
      // 点位列表(同德院区,deptType=3)
      pointOptions: [],
      // 点位选择历史值(用于“全部/具体点位”互斥判断)
      pointPrevLocations: [],
      // 表单校验
      rules: {},
    };
@@ -1250,6 +1286,7 @@
    } else {
      this.getList(1);
    }
    this.getPointOptions();
    this.getConfigKey("sys.user.initPassword").then((response) => {
      this.initPassword = response.msg;
    });
@@ -1276,21 +1313,26 @@
        );
        console.log(this.topqueryParams.leavehospitaldistrictcodes, "11");
      }
      const queryParams = this.buildQueryParams();
      this.loading = true;
      if (
        this.topqueryParams.leavehospitaldistrictcodes[0] &&
        this.topqueryParams.leaveldeptcodes[0]
        queryParams.leavehospitaldistrictcodes &&
        queryParams.leavehospitaldistrictcodes[0] &&
        queryParams.leaveldeptcodes &&
        queryParams.leaveldeptcodes[0]
      ) {
        this.topqueryParams.deptOrDistrict = 2;
        queryParams.deptOrDistrict = 2;
      } else {
        this.topqueryParams.deptOrDistrict = 1;
        queryParams.deptOrDistrict = 1;
      }
      if (!this.followupAuthority()) {
        this.$message.warning("未配置科室/病区相关权限不可查询");
        return Promise.reject(new Error("无权限查询"));
      }
      getTaskservelist(this.topqueryParams).then((response) => {
      getTaskservelist(queryParams).then((response) => {
        this.userList = response.rows[0].serviceSubtaskList;
        this.total = response.total;
        if (refresh) {
@@ -1341,22 +1383,79 @@
      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() {
      const now = new Date();
      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);
    // 点位列表(同德院区,deptType=3)
    getPointOptions() {
      if (!this.isTongdeCampus) return;
      deptTreeSelect(3).then((response) => {
        const flat = [];
        const walk = (nodes) => {
          (Array.isArray(nodes) ? nodes : []).forEach((n) => {
            if (n.label && n.deptCode) {
              flat.push({ label: n.label, value: String(n.deptCode) });
            }
            if (n.children && n.children.length) walk(n.children);
          });
        };
        walk(response && response.data);
        this.pointOptions = [{ label: "全部", value: "all" }, ...flat];
        // 进入页面默认查询全部点位
        this.topqueryParams.pointLocations = ["all"];
        this.pointPrevLocations = ["all"];
        if (!this.errtype) {
          this.getList(1);
        }
      });
    },
    // 点位选择:全部与具体点位互斥
    handlePointLocationChange(val) {
      const all = "all";
      const hasAll = val.includes(all);
      if (hasAll && val.length > 1) {
        const prev = this.pointPrevLocations || [];
        if (prev.includes(all)) {
          // 之前已选“全部”,本次新增具体点位 → 去掉“全部”
          this.topqueryParams.pointLocations = val.filter((v) => v !== all);
        } else {
          // 本次新增“全部” → 只保留“全部”
          this.topqueryParams.pointLocations = [all];
        }
      }
      this.pointPrevLocations = [...this.topqueryParams.pointLocations];
    },
    // 点位名称:将 pointLocation 编码映射为点位名称
    pointNameOf(row) {
      if (
        !row ||
        row.pointLocation === undefined ||
        row.pointLocation === null ||
        row.pointLocation === ""
      ) {
        return "";
      }
      const found = this.pointOptions.find(
        (p) => String(p.value) === String(row.pointLocation)
      );
      return found ? found.label : row.pointLocation;
    },
    buidegetTasklist(type) {
      // 用户权限下所有待随访任务:传递全部科室和病区
      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(
@@ -1368,7 +1467,7 @@
        pageSize: 10,
        leavehospitaldistrictcodes:
          this.topqueryParams.leavehospitaldistrictcodes,
        sendstates: [2, 3],
        sendstateView: 1,
        leaveldeptcodes: this.topqueryParams.leaveldeptcodes,
      };
      buidegetTasklist(obj).then((response) => {
@@ -1504,11 +1603,27 @@
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      this.topqueryParams.pageNum = 1;
      this.topqueryParams.startOutHospTime = this.dateRange[0];
      this.topqueryParams.endOutHospTime = this.dateRange[1];
      this.topqueryParams.startSendDateTime = this.dateRangefs[0];
      this.topqueryParams.endSendDateTime = this.dateRangefs[1];
      this.topqueryParams.finishtimeStart = this.dateRange[0];
      this.topqueryParams.finishtimeEnd = this.dateRange[1];
      this.getList(refresh);
    },
    // 构造查询/导出参数:选择点位时科室/病区传 null,否则保持原值
    buildQueryParams() {
      const params = { ...this.topqueryParams };
      let locations = this.topqueryParams.pointLocations || [];
      // “全部”点位:展开为所有实际点位编码
      if (locations.includes("all")) {
        locations = this.pointOptions
          .filter((p) => p.value !== "all")
          .map((p) => p.value);
      }
      params.pointLocations = locations;
      if (locations.length > 0) {
        params.leaveldeptcodes = null;
        params.leavehospitaldistrictcodes = null;
      }
      return params;
    },
    // 患者范围处理
    handleChange(value) {
@@ -1546,7 +1661,9 @@
        scopetype: [],
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
        pointLocations: ["all"],
      };
      this.pointPrevLocations = ["all"];
      this.handleQuery(1);
    },
    handleSelectionChange(rows) {
@@ -1811,15 +1928,22 @@
    },
    /** 导出按钮操作 */
    handleExport() {
      // 导出需要全量数据,临时去掉分页;导出后必须还原,否则分页会算成 Infinity(页码显示 infinity)
      const originalPageNum = this.topqueryParams.pageNum;
      const originalPageSize = this.topqueryParams.pageSize;
      this.topqueryParams.pageNum = null;
      this.topqueryParams.pageSize = null;
      this.download(
        "smartor/serviceSubtask/patItemExport",
        {
          ...this.topqueryParams,
          ...this.buildQueryParams(),
        },
        `user_${new Date().getTime()}.xlsx`
      );
      ).finally(() => {
        this.topqueryParams.pageNum = originalPageNum;
        this.topqueryParams.pageSize = originalPageSize;
        this.getList();
      });
    },
    // 异常列渲染
    tableRowClassName({ row, rowIndex }) {