WXL
2024-06-02 628fd01beea81bac2f0299472d528860ae07cf3f
src/views/followvisit/tasklist/index.vue
@@ -105,7 +105,6 @@
            size="medium"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['system:user:edit']"
            >修改</el-button
          >
        </el-col>
@@ -149,54 +148,44 @@
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="50" align="center" />
        <el-table-column label="序号" fixed align="center" key="id" prop="id" />
        <el-table-column
          label="序号"
          fixed
          align="center"
          key="taskid"
          prop="taskid"
        />
        <el-table-column
          label="任务名称"
          fixed
          align="center"
          sortable
          key="name"
          prop="name"
          key="taskName"
          prop="taskName"
          :show-overflow-tooltip="true"
        />
        <el-table-column
          label="任务描述"
          align="center"
          key="describe"
          prop="describe"
          key="taskDesc"
          prop="taskDesc"
        />
        <el-table-column
          label="待执行/总任务"
          align="center"
          key="nickName"
          prop="nickName"
        />
        <!-- <el-table-column
          label="审核人"
          align="center"
          key="create_by"
          prop="create_by"
          width="120"
          :show-overflow-tooltip="true"
        />
        <el-table-column
          label="审核时间"
          sortable
          align="center"
          prop="create_time"
          width="160"
        >
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.create_time) }}</span>
            <span>{{ scope.row.wfs }}/{{ scope.row.yfs }}</span>
          </template>
        </el-table-column> -->
        </el-table-column>
        <el-table-column
          label="创建人"
          align="center"
          key="create_by"
          prop="create_by"
          key="createBy"
          prop="createBy"
          width="120"
          :show-overflow-tooltip="true"
        />
@@ -204,11 +193,11 @@
          label="创建时间"
          sortable
          align="center"
          prop="create_time"
          prop="createTime"
          width="160"
        >
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.create_time) }}</span>
            <span>{{ parseTime(scope.row.createTime) }}</span>
          </template>
        </el-table-column>
@@ -229,12 +218,35 @@
        >
          <template slot-scope="scope">
            <el-button
              v-if="scope.row.sendState == 1 || scope.row.sendState == 3"
              size="medium"
              type="text"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['system:user:edit']"
              @click="sponsor(scope.row)"
              ><span class="button-zx"
                ><i class="el-icon-s-promotion"></i>开始执行</span
                ><i class="el-icon-s-promotion"></i>任务发起</span
              ></el-button
            >
            <el-button
              v-if="scope.row.sendState == 1 || scope.row.sendState == 3"
              size="medium"
              type="text"
              @click="immediateExecution(scope.row)"
              ><span class="button-lj"
                ><i class="el-icon-s-promotion"></i>立即执行</span
              ></el-button
            >
            <el-button size="medium" type="text" @click="newAdd(scope.row)"
              ><span class="button-xj"
                ><i class="el-icon-circle-plus-outline"></i>依照新增</span
              ></el-button
            >
            <el-button
              v-if="scope.row.sendState == 2"
              size="medium"
              type="text"
              @click="stop(scope.row)"
              ><span class="button-zt"
                ><i class="el-icon-circle-plus-outline"></i>暂停任务</span
              ></el-button
            >
          </template>
@@ -284,7 +296,7 @@
        <el-row :gutter="20">
          <el-col :span="12"
            ><el-form-item label="任务名称">
              <el-input v-model="form.name"></el-input> </el-form-item
              <el-input v-model="form.taskName"></el-input> </el-form-item
          ></el-col>
        </el-row>
        <el-row :gutter="20">
@@ -339,7 +351,13 @@
  resetUserPwd,
  changeUserStatus,
} from "@/api/system/user";
import { getTasklist, getTaskInfo } from "@/api/AiCentre/index";
import {
  getTasklist,
  getTaskInfo,
  Editsingletask,
  delTaskInfo,
  TaskTemplateSendExecution,
} from "@/api/AiCentre/index";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -382,6 +400,7 @@
      inputVisible: false,
      inputValue: "",
      previewVisible: false, //门诊随访预览弹框
      TaskOperation: {},
      radio: "",
      radios: [],
      previewtype: 2, //预览门诊随访类型
@@ -629,21 +648,7 @@
        this.options = [];
      }
    },
    // 门诊随访状态修改
    handleStatusChange(row) {
      let text = row.status === "0" ? "启用" : "停用";
      this.$modal
        .confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
        .then(function () {
          return changeUserStatus(row.userId, row.status);
        })
        .then(() => {
          this.$modal.msgSuccess(text + "成功");
        })
        .catch(function () {
          row.status = row.status === "0" ? "1" : "0";
        });
    },
    // 取消按钮
    cancel() {
      this.addalteropen = false;
@@ -717,26 +722,41 @@
    handleUpdate(row) {
      this.$router.push({
        path: "/followvisit/particty",
        query: { type: row.type, id: row.taskid },
        query: { type: row.hospType, id: row.taskid },
      });
    },
    // 删除任务
    deletefn(){},
    /** 重置密码按钮操作 */
    handleResetPwd(row) {
      this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        closeOnClickModal: false,
        inputPattern: /^.{5,20}$/,
        inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
      })
        .then(({ value }) => {
          resetUserPwd(row.userId, value).then((response) => {
            this.$modal.msgSuccess("修改成功,新密码是:" + value);
          });
        })
        .catch(() => {});
    deletefn() {},
    // 任务发起
    sponsor(row) {
      console.log(row, "任务信息");
      if (row.sendState != 2) {
        this.TaskOperation.taskId = row.taskid;
        this.TaskOperation.sendState = 2;
        TaskTemplateSendExecution(this.TaskOperation).then((res) => {});
      }
    },
    immediateExecution(row) {
      console.log(row, "任务信息");
      if (row.sendState != 2) {
        this.TaskOperation.taskId = row.taskid;
        this.TaskOperation.sendState = 2;
        this.TaskOperation.sendType = 2;
        TaskTemplateSendExecution(this.TaskOperation).then((res) => {});
      }
    },
    // 依照新增
    newAdd(row) {
      TaskTemplateSendExecution().then((res) => {});
    },
    // 暂停
    stop(row) {
      if (row.sendState == 2) {
        this.TaskOperation.taskId = row.taskId;
        this.TaskOperation.sendState = 3;
        TaskTemplateSendExecution().then((res) => {});
      }
    },
    /** 提交按钮 */
@@ -894,6 +914,24 @@
  border-radius: 1px;
  color: #ffffff;
}
.button-lj {
  background: #e9614f;
  padding: 5px;
  border-radius: 1px;
  color: #ffffff;
}
.button-xj {
  background: #815c94;
  padding: 5px;
  border-radius: 1px;
  color: #ffffff;
}
.button-zt {
  background: #f9c116;
  padding: 5px;
  border-radius: 1px;
  color: #ffffff;
}
::v-deep.el-radio-group {
  span {
@@ -901,6 +939,9 @@
  }
}
::v-deep.el-button + .el-button {
  margin-left: 0;
}
::v-deep.el-checkbox-group {
  span {
    font-size: 24px;