liusheng
2 天以前 bbbc478129f72b26e2ec4a2e981ed8698a96880c
src/views/followvisit/zysatisfaction/index.vue
@@ -15,7 +15,19 @@
        v-show="showSearch"
        label-width="98px"
      >
        <el-form-item label="出院时间">
        <el-form-item label="满意度类型" prop="satisfactionScope">
          <el-select
            v-model="satisfactionScope"
            placeholder="默认离院"
            clearable
            style="width: 150px"
            @change="handleSatisfactionScopeChange"
          >
            <el-option label="离院满意度" value="leave" />
            <el-option label="在院满意度" value="hospital" />
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="出院时间">
          <el-date-picker
            v-model="dateRange"
            style="width: 240px"
@@ -25,8 +37,19 @@
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>
        </el-form-item> -->
        <el-form-item label="完成时间">
          <el-date-picker
            v-model="dateRangefs"
            style="width: 240px"
            value-format="yyyy-MM-dd"
            type="daterange"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="患者姓名" prop="sendname">
          <el-input
            v-model="topqueryParams.sendname"
@@ -71,12 +94,16 @@
            </el-option>
          </el-select>
        </el-form-item> -->
        <!-- 处理状态:保留级联联动(一级大类 → 二级具体状态),
             面板挂在本组件内(popper-append-to-body=false),避免下拉跑到别处 -->
        <el-form-item label="处理状态" prop="status">
          <el-cascader
            v-model="serviceStatusValue"
            placeholder="请选择"
            :options="serviceStatusOptions"
            :props="cascaderProps"
            :popper-append-to-body="false"
            style="width: 180px"
            @change="handleServiceStatusChange"
            clearable
          ></el-cascader>
@@ -173,7 +200,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 +212,7 @@
              >
            </div>
          </div>
        </el-col>
        </el-col> -->
        <el-col :span="1.5">
          <div class="documentf">
            <div class="document">
@@ -363,18 +390,22 @@
        <el-table-column
          label="科室"
          align="center"
          key="deptname"
          prop="deptname"
          key="leaveldeptname"
          width="120"
        >
          <template slot-scope="scope">
            {{ deptNameOf(scope.row) }}
          </template>
        </el-table-column>
        <el-table-column
          label="病区"
          align="center"
          key="leavehospitaldistrictname"
          prop="leavehospitaldistrictname"
          width="120"
        >
          <template slot-scope="scope">
            {{ wardNameOf(scope.row) }}
          </template>
        </el-table-column>
        <el-table-column
@@ -1078,6 +1109,8 @@
          label: "应随访日期(倒序)",
        },
      ],
      // 满意度类型:leave=离院满意度(按离院科室/病区查),hospital=在院满意度(按在院科室/病区查)
      satisfactionScope: "leave",
      // 查询参数
      topqueryParams: {
        pageNum: 1,
@@ -1253,7 +1286,7 @@
        this.$message.warning("未配置科室/病区相关权限不可查询");
        return Promise.reject(new Error("无权限查询"));
      }
      getTaskservelist(this.topqueryParams).then((response) => {
      getTaskservelist(this.buildScopePayload(this.topqueryParams)).then((response) => {
        this.userList = response.rows[0].serviceSubtaskList;
        this.total = response.total;
        if (refresh) {
@@ -1298,6 +1331,47 @@
        this.total = response.total;
      });
    },
    // 切换满意度类型(离院/在院)后重新查询
    handleSatisfactionScopeChange() {
      this.topqueryParams.pageNum = 1;
      this.getList(1);
    },
    // 按满意度类型组装科室/病区条件:
    // 离院满意度 => leaveldeptcodes / leavehospitaldistrictcodes;
    // 在院满意度 => deptcodes / hospitaldistrictcodes(在院科室、在院病区)
    buildScopePayload(params) {
      const payload = { ...params };
      if (this.satisfactionScope === "hospital") {
        payload.deptcodes = params.leaveldeptcodes || [];
        payload.hospitaldistrictcodes = params.leavehospitaldistrictcodes || [];
        delete payload.leaveldeptcodes;
        delete payload.leavehospitaldistrictcodes;
      }
      return payload;
    },
    // 科室名称:在院满意度优先取在院科室,其余取出院科室
    deptNameOf(row) {
      if (!row) return "-";
      return (
        (this.satisfactionScope === "hospital"
          ? row.deptname || row.leaveldeptname
          : row.leaveldeptname || row.deptname) || "-"
      );
    },
    // 病区名称:在院满意度优先取在院病区,其余取出院病区
    wardNameOf(row) {
      if (!row) return "-";
      return (
        (this.satisfactionScope === "hospital"
          ? row.hospitaldistrictname || row.leavehospitaldistrictname
          : row.leavehospitaldistrictname || row.hospitaldistrictname) || "-"
      );
    },
    // 服务状态变更处理
    handleServiceStatusChange(value) {
      // 清空选择
@@ -1330,13 +1404,17 @@
      }
    },
    affiliation() {
      this.resetQuerykj();
      this.topqueryParams.managementDoctorCode = store.getters.hisUserId;
      this.getList(1);
    },
    onthatday() {
      this.topqueryParams.startSendDateTime = this.getCurrentDate();
      this.topqueryParams.endSendDateTime = this.getCurrentDate();
      this.resetQuerykj();
      this.topqueryParams.finishtimeStart = this.getCurrentDate();
      this.topqueryParams.finishtimeEnd = this.getCurrentDate();
      this.getList(1);
    },
    getCurrentDate() {
@@ -1344,13 +1422,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(
@@ -1362,7 +1439,7 @@
        pageSize: 10,
        leavehospitaldistrictcodes:
          this.topqueryParams.leavehospitaldistrictcodes,
        sendstates: [2, 3],
        sendstateView: 1,
        leaveldeptcodes: this.topqueryParams.leaveldeptcodes,
      };
      buidegetTasklist(obj).then((response) => {
@@ -1467,10 +1544,10 @@
          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.startOutHospTime = this.dateRange[0];
      // this.topqueryParams.endOutHospTime = this.dateRange[1];
      this.topqueryParams.finishtimeStart = this.dateRangefs[0];
      this.topqueryParams.finishtimeEnd = this.dateRangefs[1];
      this.getList(refresh);
    },
    // 患者范围处理
@@ -1510,6 +1587,26 @@
        leavehospitaldistrictcodes: [],
      };
      this.handleQuery(1);
    },
    /** 重置按钮操作 */
    resetQuerykj() {
      this.dateRange = [];
      this.dateRangefs = [];
      this.serviceStatusValue = null;
      this.topqueryParams = {
        pageNum: 1,
        pageSize: 10,
        sendstate: null,
        sendstateView: null,
        sort: 2, //0 出院时间(正序)    1 出院时间(倒序)   2 发送时间(正序)    3 发送时间(倒序)
        serviceType: 6,
        searchscope: 3,
        visitCount: 1,
        scopetype: [],
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
      };
    },
    handleSelectionChange(rows) {
      this.selectedRows = rows.map((row) => {
@@ -1807,7 +1904,7 @@
      this.download(
        "smartor/serviceSubtask/patItemExport",
        {
          ...this.topqueryParams,
          ...this.buildScopePayload(this.topqueryParams),
        },
        `user_${new Date().getTime()}.xlsx`
      );
@@ -2051,6 +2148,11 @@
  box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
/* 级联下拉挂在本组件内时,以所在表单项为定位基准,避免面板跑到页面别处 */
::v-deep .el-form--inline .el-form-item {
  position: relative;
}
/* 隐藏分割线 */
::v-deep .el-divider {
  display: none;