WXL (wul)
昨天 e06cd3953ba8a6e0eee11c235bce9ced419a2800
src/views/followvisit/discharge/index.vue
@@ -172,8 +172,8 @@
          ></el-cascader>
        </el-form-item>
        <el-form-item label="任务状态" prop="status">
          <el-select v-model="topqueryParams.sendstate" placeholder="请选择">
        <el-form-item label="服务状态" prop="status">
          <el-select v-model="topqueryParams.sendstateView" placeholder="请选择">
            <el-option
              v-for="item in topicoptions"
              :key="item.value"
@@ -183,6 +183,7 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="排序方式" prop="status">
          <el-select v-model="topqueryParams.sort" placeholder="请选择">
            <el-option
@@ -210,7 +211,7 @@
      </el-form>
      <el-divider></el-divider>
      <el-row :gutter="10" class="mb8">
        <!-- <el-col :span="1.5">
        <el-col :span="1.5">
          <div class="documentf">
            <div class="document">
              <el-button
@@ -223,7 +224,7 @@
              >
            </div>
          </div>
        </el-col> -->
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="primary"
@@ -346,7 +347,12 @@
              size="medium"
              type="text"
              @click="
                gettoken360(scope.row.sfzh, scope.row.drcode, scope.row.drname)
                gettoken360(
                  scope.row.sfzh,
                  scope.row.drcode,
                  scope.row.drname,
                  scope.row.patid
                )
              "
              ><span class="button-textsc">{{
                scope.row.sendname
@@ -363,11 +369,12 @@
          :show-overflow-tooltip="true"
        >
        </el-table-column>
        <el-table-column
          label="任务状态"
          label="随访状态"
          align="center"
          key="sendstate"
          prop="sendstate"
          key="sendstateView"
          prop="sendstateView"
          width="120"
        >
          <template slot-scope="scope">
@@ -377,44 +384,34 @@
              :content="scope.row.remark"
              placement="top-start"
            >
              <div v-if="scope.row.sendstate == 1">
                <el-tag type="primary" :disable-transitions="false"
                  >表单已领取</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 2">
              <div v-if="scope.row.sendstateView == 1">
                <el-tag type="primary" :disable-transitions="false"
                  >待随访</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 3">
                <el-tag type="success" :disable-transitions="false"
                  >表单已发送</el-tag
              <div v-if="scope.row.sendstateView == 2">
                <el-tag type="primary" :disable-transitions="false"
                  >随访中</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 4">
                <el-tag type="info" :disable-transitions="false">不执行</el-tag>
              </div>
              <div v-if="scope.row.sendstate == 5">
                <el-tag type="danger" :disable-transitions="false"
                  >发送失败</el-tag
              <div v-if="scope.row.sendstateView == 3">
                <el-tag type="warning" :disable-transitions="false"
                  >未完成</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 6">
              <div v-if="scope.row.sendstateView == 4">
                <el-tag type="success" :disable-transitions="false"
                  >已完成</el-tag
                >
              </div>
              <div v-if="scope.row.sendstateView == 5">
                <el-tag type="danger" :disable-transitions="false"
                  >无需随访</el-tag
                >
              </div>
            </el-tooltip>
          </template>
        </el-table-column>
        <!-- <el-table-column
          label="任务异常说明"
          width="120"
          align="center"
          key="remark"
          prop="remark" -->
        />
        <el-table-column
          label="处理意见"
@@ -430,7 +427,18 @@
            />
          </template>
        </el-table-column>
        <el-table-column
          label="任务执行方式"
          align="center"
          key="preachform"
          prop="preachform"
          width="160"
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <span v-for="item in scope.row.preachform">{{ item }}、 </span>
          </template>
        </el-table-column>
        <el-table-column
          label="随访完成时间"
          sortable
@@ -457,13 +465,14 @@
          label="应随访日期"
          width="200"
          align="center"
          key="longSendTime"
          prop="longSendTime"
          key="visitTime"
          prop="visitTime"
        >
          <template slot-scope="scope">
            <span>{{ formatTime(scope.row.longSendTime) }}</span>
            <span>{{ formatTime(scope.row.visitTime) }}</span>
          </template></el-table-column
        >
        <!-- 原 -->
        <el-table-column
          label="主治医生"
          width="120"
@@ -556,18 +565,7 @@
          prop="templatename"
          width="200"
        />
        <el-table-column
          label="任务执行方式"
          align="center"
          key="preachform"
          prop="preachform"
          width="160"
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <span v-for="item in scope.row.preachform">{{ item }}、 </span>
          </template>
        </el-table-column>
        <!-- <el-table-column
          label="任务发送流程"
          align="center"
@@ -1076,6 +1074,7 @@
  addserviceSubtask,
  query360PatInfo,
  addsatisfaction,
  query360PatInfonh,
} from "@/api/AiCentre/index";
import { alterpatient, particularpatient } from "@/api/patient/homepage";
import Treeselect from "@riophae/vue-treeselect";
@@ -1244,12 +1243,17 @@
          value: 8,
          label: "应随访日期(倒序)",
        },
        {
          value: 9,
          label: "按照患者排序",
        },
      ],
      // 查询参数
      topqueryParams: {
        pageNum: 1,
        pageSize: 10,
        sendstate: 2,
        sendstateView:
          localStorage.getItem("orgname") == "省立同德翠苑院区" ? null : 1,
        sort: localStorage.getItem("orgname") == "丽水市中医院" ? 8 : 2, //0 出院时间(正序)    1 出院时间(倒序)   2 发送时间(正序)    3 发送时间(倒序)  7应随访日期(倒序) 应随访日期(正序)
        serviceType: 2,
        searchscope: 3,
@@ -1269,29 +1273,26 @@
        },
        {
          value: 1,
          label: "表单已领取",
        },
        {
          value: 2,
          label: "待随访",
        },
        {
          value: 2,
          label: "随访中",
        },
        {
          value: 3,
          label: "表单已发送",
          label: "未完成",
        },
        {
          value: 4,
          label: "不执行",
          label: "已完成",
        },
        {
          value: 5,
          label: "发送失败",
        },
        {
          value: 6,
          label: "已完成",
          label: "无需随访",
        },
      ],
      sextype: [
        {
          value: 1,
@@ -1359,12 +1360,25 @@
      rules: {},
    };
  },
  watch: {},
  watch: {
    // 监听路由参数变化
    "$route.query": {
      handler(newQuery, oldQuery) {
        if (newQuery.errtype !== oldQuery.errtype) {
          console.log(22);
          this.loadData(); // 重新加载数据
        }
      },
      immediate: true,
    },
  },
  created() {
    this.serviceState = store.getters.serviceState;
    this.checkboxlist = store.getters.checkboxlist;
    this.errtype = this.$route.query.errtype;
    this.orgname = localStorage.getItem("orgname");
    this.errtype = this.$route.query.errtype;
    this.leavehospitaldistrictcode =
      this.$route.query.leavehospitaldistrictcode;
    this.sourcetype[0].children = store.getters.belongDepts.map((dept) => {
@@ -1379,8 +1393,20 @@
        value: dept.districtCode,
      };
    });
    if (this.errtype) {
    if (this.errtype == 1) {
      this.toleadExport(2);
    } else if (this.errtype == 2) {
      // 待随访
      this.toleadExport(3);
    } else if (this.errtype == 3) {
      // 失败
      this.toleadExport(4);
    } else if (this.errtype == 4) {
      // 异常
      this.toleadExport(2);
    } else if (this.errtype == 5) {
      // 全部
      this.toleadExport(5);
    } else {
      this.getList(1);
    }
@@ -1389,7 +1415,24 @@
    });
  },
  activated() {
    this.getList(1);
    this.errtype = this.$route.query.errtype;
    if (this.errtype == 1) {
      this.toleadExport(2);
    } else if (this.errtype == 2) {
      // 待随访
      this.toleadExport(3);
    } else if (this.errtype == 3) {
      // 失败
      this.toleadExport(4);
    } else if (this.errtype == 4) {
      // 异常
      this.toleadExport(2);
    } else if (this.errtype == 5) {
      // 全部
      this.toleadExport(5);
    } else {
      this.getList(1);
    }
  },
  methods: {
    /** 查询随访服务列表 */
@@ -1414,7 +1457,6 @@
        this.topqueryParams.leavehospitaldistrictcodes.push(
          this.leavehospitaldistrictcode
        );
        console.log(this.topqueryParams.leavehospitaldistrictcodes, "11");
      }
      this.loading = true;
      if (
@@ -1425,12 +1467,19 @@
      } else {
        this.topqueryParams.deptOrDistrict = 1;
      }
      if (!this.followupAuthority()) {
        this.$message.warning("未配置科室/病区相关权限不可查询");
        return Promise.reject(new Error("无权限查询"));
      }
      getTaskservelist(this.topqueryParams).then((response) => {
        this.userList = response.rows[0].serviceSubtaskList;
        this.total = response.total;
        if (refresh) {
          this.cardlist[0].value =
            Number(response.rows[0].wzx) + Number(response.rows[0].ysf);
            Number(response.rows[0].wzx) +
            Number(response.rows[0].ysf) +
            Number(response.rows[0].fssb);
          // this.cardlist[1].value = response.rows[0].wzx;
          this.cardlist[1].value = response.rows[0].ysf;
          this.ycvalue = response.rows[0].yc;
@@ -1465,6 +1514,26 @@
        });
        this.total = response.total;
      });
    },
    loadData() {
      this.errtype = this.$route.query.errtype;
      if (this.errtype == 1) {
        this.toleadExport(2);
      } else if (this.errtype == 2) {
        // 待随访
        this.toleadExport(3);
      } else if (this.errtype == 3) {
        // 失败
        this.toleadExport(4);
      } else if (this.errtype == 4) {
        // 异常
        this.toleadExport(2);
      } else if (this.errtype == 5) {
        // 全部
        this.toleadExport(5);
      } else {
        this.getList(1);
      }
    },
    // 时间
    getEndOfDay() {
@@ -1618,10 +1687,13 @@
          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];
      // 判断是不是工作台快捷查询
      if (this.errtype != 2) {
        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.getList(refresh);
    },
    // 患者范围处理
@@ -1649,7 +1721,7 @@
      this.topqueryParams = {
        pageNum: 1,
        pageSize: 10,
        sendstate: 2,
        sendstateView: 1,
        sort: 2, //0 出院时间(正序)    1 出院时间(倒序)   2 发送时间(正序)    3 发送时间(倒序)
        serviceType: 2,
        searchscope: 3,
@@ -1750,8 +1822,25 @@
      });
    },
    //患者360跳转
    gettoken360(sfzh, drcode, drname) {
      // this.$modal.msgWarning("360功能暂未开通");
    gettoken360(sfzh, drcode, drname, id) {
      const orgname = localStorage.getItem("orgname");
      if (orgname == "南华大学附属第一医院") {
        query360PatInfonh(id).then((res) => {
          if (res.data) {
            window.open(res.data, "_blank");
          } else {
            this.$modal.msgWarning("360查询无结果");
          }
        });
        return;
      } else if (
        orgname == "第一人民医院湖滨院区" ||
        orgname == "第一人民医院吴山院区"
      ) {
        let url = `http://192.200.81.189:9100/blj/view?BINGRENID=${id}&YONGHUID=DBA`;
        window.open(url, "_blank");
        return;
      }
      this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh;
@@ -1929,16 +2018,38 @@
    },
    // 便捷按钮
    toleadExport(too) {
      console.log(too, "too");
      if (too == 1) {
        this.topqueryParams.sendstate = 4;
        this.topqueryParams.excep = null;
      } else if (too == 2) {
        this.topqueryParams.excep = 1;
        this.topqueryParams.sendstate = null;
      } else if (too == 3) {
        this.topqueryParams.endSendDateTime = this.formatDateToYYYYMMDDHHMMSS(
          this.getEndOfDay()
        );
        console.log(1111, this.topqueryParams.endSendDateTime);
        this.topqueryParams.excep = null;
        this.topqueryParams.sendstate = 2;
        this.topqueryParams.scopetype = null;
      } else if (too == 4) {
        this.topqueryParams.excep = null;
        this.topqueryParams.sendstate = 5;
        this.topqueryParams.scopetype = null;
      } else if (too == 5) {
        this.topqueryParams.excep = null;
        this.topqueryParams.sendstate = null;
        this.topqueryParams.scopetype = null;
      }
      this.handleQuery(1);
    },
    /** 导出按钮操作 */
    handleExport() {
      const originalPageNum = this.topqueryParams.pageNum;
      const originalPageSize = this.topqueryParams.pageSize;
      this.topqueryParams.pageNum = null;
      this.topqueryParams.pageSize = null;
      this.download(
@@ -1947,7 +2058,12 @@
          ...this.topqueryParams,
        },
        `user_${new Date().getTime()}.xlsx`
      );
      ).finally(() => {
        // 导出后恢复分页参数
        this.topqueryParams.pageNum = originalPageNum;
        this.topqueryParams.pageSize = originalPageSize;
        this.getList();
      });
    },
    // 异常列渲染
    tableRowClassName({ row, rowIndex }) {
@@ -1965,7 +2081,7 @@
          this.zcform.remark =
            this.zcform.remark + "【" + this.getCurrentTime() + "】";
          let form = structuredClone(this.zcform);
          form.longSendTime = this.formatTime(form.date1);
          form.visitTime = this.formatTime(form.date1);
          form.finishtime = "";
          if (form.resource) {
            if (form.resource == 2) {