WXL (wul)
6 天以前 d90b45d7e9e38e34c044b772006004f2a4cb8b8e
src/views/patient/questionnaire/index.vue
@@ -103,21 +103,22 @@
            v-model="topqueryParams.scopetype"
            placeholder="默认全部"
            :options="sourcetype"
            filterable
            clearable
            :props="{ expandTrigger: 'hover' }"
            @change="handleChange"
          ></el-cascader>
        </el-form-item>
        <el-form-item label="任务状态" prop="status">
          <el-select v-model="topqueryParams.sendstate" placeholder="请选择">
            <el-option
              v-for="item in topicoptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        <el-form-item label="随访状态" prop="status">
          <el-cascader
            v-model="serviceStatusValue"
            placeholder="请选择"
            :options="serviceStatusOptions"
            :props="cascaderProps"
            @change="handleServiceStatusChange"
            clearable
          ></el-cascader>
        </el-form-item>
        <el-form-item>
@@ -213,39 +214,35 @@
          prop="sendname"
        />
        <el-table-column
          label="任务状态"
          label="随访状态"
          align="center"
          key="sendstate"
          prop="sendstate"
          key="sendstateView"
          prop="sendstateView"
          width="120"
        >
          <template slot-scope="scope">
            <div v-if="scope.row.sendstate == 1">
              <el-tag type="primary" :disable-transitions="false"
                >表单已领取</el-tag
              >
            </div>
            <div v-if="scope.row.sendstate == 2">
              <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>
            <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>
            <div v-if="scope.row.sendstate == 6">
              <el-tag type="danger" :disable-transitions="false">已完成</el-tag>
            </div>
             <el-tooltip
              class="item"
              effect="dark"
              :content="scope.row.remark"
              placement="top-start"
            >
              <div v-if="scope.row.sendstateView == 1">
                <el-tag type="primary" :disable-transitions="false"
                  >待随访</el-tag
                >
              </div>
              <div v-if="scope.row.sendstateView == 2">
                <el-tag type="success" :disable-transitions="false"
                  >已完成</el-tag
                >
              </div>
              <div v-if="scope.row.sendstateView == 3">
                <el-tag type="warning" :disable-transitions="false"
                  >无需随访</el-tag
                >
              </div>
            </el-tooltip>
          </template>
        </el-table-column>
        <!-- <el-table-column
@@ -290,7 +287,7 @@
        </el-table-column>
        <el-table-column
          label="出院日期"
          width="200"
          width="146"
          align="center"
          key="endtime"
          prop="endtime"
@@ -301,7 +298,7 @@
        >
        <el-table-column
          label="应随访日期"
          width="200"
          width="146"
          align="center"
          key="visitTime"
          prop="visitTime"
@@ -396,6 +393,54 @@
          prop="templatename"
          width="200"
        />
         <el-table-column
          label="任务状态"
          align="center"
          key="sendstate"
          prop="sendstate"
          width="120"
        >
          <template slot-scope="scope">
            <el-tooltip
              class="item"
              effect="dark"
              :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">
                <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>
              <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>
              <div v-if="scope.row.sendstate == 6">
                <el-tag type="success" :disable-transitions="false"
                  >已完成</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 7">
                <el-tag type="danger" :disable-transitions="false">超时</el-tag>
              </div>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column
          label="任务执行方式"
          align="center"
@@ -712,41 +757,62 @@
        },
      ],
      loading: false,
      serviceStatusValue: 10,
      cascaderProps: {
        expandTrigger: "hover", // 悬停展开
        checkStrictly: true, // ✅ 关键:允许选中任意一级
        emitPath: false, // ✅ 只返回选中的值,不返回路径数组
      },
      // 随访状态级联选择器
      serviceStatusOptions: [
        {
          value: null,
          label: "全部",
        },
        {
          value: 10, // 一级:待随访
          label: "待随访",
          children: [
            { value: 1, label: "被领取" },
            { value: 2, label: "待发送" },
            { value: 3, label: "已发送" },
            { value: 5, label: "发送失败" },
            { value: 7, label: "超时" },
          ],
        },
        {
          value: 20, // 一级:已完成
          label: "已完成",
          children: [{ value: 6, label: "已完成" }],
        },
        {
          value: 30, // 一级:无需随访
          label: "无需随访",
          children: [{ value: 4, label: "不执行" }],
        },
      ],
      cardlist: [
        {
          name: "出院服务总量",
          value: 0,
        },
        // {
        //   name: "患者过滤",
        //   value: 0,
        // },
        {
          name: "需随访",
          name: "患者服务总量",
          value: 0,
        },
        // {
        //   name: "异常",
        //   value: 0,
        // },
        {
          name: "发送失败",
          name: "无需随访",
          value: 0,
        },
        {
          name: "需随访",
          value: 0,
        },
        {
          name: "待随访",
          value: 0,
        },
        // {
        //   name: "已发送",
        //   value: 0,
        // },
        // {
        //   name: "表单已发送",
        //   value: 0,
        // },
        {
          name: "已完成",
          value: 0,
        },
      ],
      // 表单参数
@@ -772,34 +838,30 @@
      propss: { multiple: true },
      options: [],
      topicoptions: [
       topicoptions: [
        {
          value: 1,
          label: "表单已领取",
          value: null,
          label: "全部",
        },
        {
          value: 2,
          value: 1,
          label: "待随访",
        },
        {
          value: 2,
          label: "随访中",
        },
        {
          value: 3,
          label: "表单已发送",
          label: "未完成",
        },
        {
          value: 4,
          label: "不执行",
        },
         {
          value: 5,
          label: "发送失败",
        },
        {
          value: 6,
          label: "已完成",
        },
         {
          value: 7,
          label: "超时",
        {
          value: 5,
          label: "无需随访",
        },
      ],
      topicoptionsyj: [
@@ -885,13 +947,13 @@
        this.total = response.total;
        if (refresh) {
          this.cardlist[0].value =
            Number(response.rows[0].wzx) + Number(response.rows[0].ysf);
            Number(response.rows[0].wxsf) + Number(response.rows[0].xsf) || 0;
          // this.cardlist[1].value = response.rows[0].wzx;
          this.cardlist[1].value = response.rows[0].ysf;
          this.cardlist[1].value = response.rows[0].wxsf || 0;
          this.ycvalue = response.rows[0].yc;
          this.cardlist[2].value = response.rows[0].fssb;
          this.cardlist[3].value = response.rows[0].dsf;
          // this.cardlist[4].value = response.rows[0].yfs2;
          this.cardlist[2].value = response.rows[0].xsf || 0;
          this.cardlist[3].value = response.rows[0].dsf || 0;
          this.cardlist[4].value = response.rows[0].ywc || 0;
          this.yfsvalue = response.rows[0].yfs;
        }
        this.loading = false;
@@ -991,6 +1053,37 @@
      this.getList(refresh);
    },
    // 随访状态变更处理
    handleServiceStatusChange(value) {
      // 清空选择
      if (value === null || value === undefined || value === "") {
        this.topqueryParams.sendstateView = null;
        this.topqueryParams.sendstate = null;
        return;
      }
      console.log(value, "value");
      // 一级节点的值(大于等于10)
      if (value >= 10) {
        // 选中了一级
        switch (value) {
          case 10:
            this.topqueryParams.sendstateView = 1; // 待随访
            break;
          case 20:
            this.topqueryParams.sendstateView = 2; // 已完成
            break;
          case 30:
            this.topqueryParams.sendstateView = 3; // 无需随访
            break;
        }
        this.topqueryParams.sendstate = null;
      } else {
        // 选中了二级(具体状态)
        this.topqueryParams.sendstateView = null;
        this.topqueryParams.sendstate = value;
      }
    },
    // 患者范围处理
    handleChange(value) {
      let type = value[0];