src/views/projectProcess/detail/index.vue
@@ -82,26 +82,32 @@
          width="100">
          <template slot-scope="scope">
            <el-button v-if="scope.row.taskStatus !== '未开始'" @click="goToProcessDetail(scope.row)" type="text" size="small">查看</el-button>
            <el-button v-if="scope.row.taskStatus === '待办'" @click="goToDo(scope.row)" type="text" size="small">办理</el-button>
            <el-button v-if="showHandle(scope.row)" @click="goToDo(scope.row)" type="text" size="small">办理</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div>
        <el-pagination
          v-if="total > queryParams.pageSize"
          :page-size="queryParams.pageSize"
          :current-page="queryParams.currentPage"
          :total="total"
          layout="total, prev, pager, next"
          @current-change="getList"
        ></el-pagination>
      </div>
    </div>
    <div class="table" style="margin-top: 15px">
      <el-pagination
        v-if="total > queryParams.pageSize"
        @size-change="getList"
        @current-change="getList"
        :current-page.sync="queryParams.currentPage"
        :page-sizes="[5, 10, 20]"
        :page-size="100"
        layout="sizes, prev, pager, next"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>
<script>
import {getProjectProcessDetail, getProjectProcessDetailTaskList} from "@/api/projectProcess/projectProcess";
import {
  getProjectProcessDetail,
  getProjectProcessDetailTaskList,
  getTaskIsAuditing
} from "@/api/projectProcess/projectProcess";
export default {
  name: "index",
@@ -130,22 +136,31 @@
    this.getProjectProcessInfo()
  },
  methods: {
    showHandle(row) {
      console.log(this.$store.state.user, "用户信息")
      if (row.taskStatus === '待办') {
        if (row.handlerType === "USER") {
          return this.$store.state.user.id === row.handlerId
        } else if (row.handlerType === "DEPT") {
          return this.$store.state.user.id === row.handlerId
        } else if (row.handlerType === "ROLE") {
          return this.$auth.hasRole(row.handlerUnitName)
        }
      } else {
        return false
      }
    },
    goToDo(row) {
      // TODO 这里的判断条件根据实际情况设置
      if (this.$auth.hasRole('admin')) {
      // let params = {
      //   processDefId: row.processDefId,
      //   taskId: row.taskId
      // }
      // getTaskIsAuditing(params).then(res => {
      //
      // })
      // if (this.showHandle(row)) {
        console.log("zhe")
        this.$router.push({
          path: '/flowable/task/todo/detail/index',
          query: {
            taskName: row.taskName,
            startUser: row.promoterName,
            deployId: row.deployId,
            taskId: row.taskId,
            procInsId: row.processInsId,
            executionId: row.executionId
          }
        })
      } else {
        this.$router.push({
          path: '/flowable/task/myProcess/send/index',
          query: {
@@ -155,7 +170,19 @@
            taskId: row.taskId
          }
        })
      }
      // } else {
      //   this.$router.push({
      //     path: '/flowable/task/todo/detail/index',
      //     query: {
      //       taskName: row.taskName,
      //       startUser: row.promoterName,
      //       deployId: row.deployId,
      //       taskId: row.taskId,
      //       procInsId: row.processInsId,
      //       executionId: row.executionId
      //     }
      //   })
      // }
    },
    goToProcessDetail(row) {
      this.$router.push({ path: '/flowable/task/myProcess/detail/index',
@@ -178,6 +205,7 @@
      getProjectProcessDetail(this.queryParams.projectId, this.queryParams.processDefId).then(res => {
        this.detailData = res.data
        this.taskList = res.taskList
        this.total = res.total
        this.loading = false
      })
    },