index.vue 9.58 KB
<template>
  <div class="app-container">

    <taskCard :task="task"  v-for="task in taskList" @sendToParent="showTask"/>

    <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />


    <el-dialog :title="title" :visible.sync="open2" width="300px" append-to-body>
      <threestepInfo :businessKey="businessKey"  v-if="open2"/>
      </el-dialog>

    <el-dialog :title="title" :visible.sync="construct" width="300px" append-to-body>
      <constructsiteInfo :businessKey="businessKey" :signData="signData" v-if="construct" />
    </el-dialog>
    <!--  会议管理  -->
    <el-dialog :title="title" :visible.sync="conferenceOpen" width="300px" append-to-body>
      <conferenceInfo :idInfo="idInfo" v-if="conferenceOpen"/>
    </el-dialog>

    <!--  请假申请  -->
    <el-dialog :title="title" :visible.sync="leaveApplicationOpen" width="300px" append-to-body>
      <leaveApplicationInfo :idInfo="idInfo" v-if="leaveApplicationOpen"/>
    </el-dialog>


    <el-dialog :title="title" :visible.sync="earthsites" width="300px" append-to-body>
      <earthsitesInfo :businessKey="businessKey"  v-if="earthsites" />
    </el-dialog>

    <el-dialog :title="title" :visible.sync="contract" width="300px" append-to-body>
      <contractInfo :businessKey="businessKey"  v-if="contract" />
    </el-dialog>



    <!--  后勤管理  -->
    <el-dialog :title="title" :visible.sync="logisticsInfoOpen" width="300px" append-to-body
               :close-on-click-modal="false">
      <logisticsInfo :idInfo="idInfo" v-if="logisticsInfoOpen"/>
    </el-dialog>

    <!--  办文办事  -->
    <el-dialog :title="title" :visible.sync="handleAffairsInfoOpen" width="300px" append-to-body
               :close-on-click-modal="false">
      <handleInfo ref="handleAffairsInfoRef" :idInfo="idInfo" v-if="handleAffairsInfoOpen" :depts="depts"
                  :businessKey="definitionKey"
                  :controlId="controlId"/>
    </el-dialog>

    <!--  线下案卷交办  -->
    <el-dialog :title="title" :visible.sync="caseOffline" width="300px" append-to-body :close-on-click-modal="false">
      <caseOfflineInfo :businessKey="businessKey" v-if="caseOffline"/>
    </el-dialog>

    <!--  平台违规信息  -->
    <el-dialog :title="title" :visible.sync="violationCaseFile" width="300px" append-to-body :close-on-click-modal="false">
      <violationCaseFileInfo :idInfo="businessKey" v-if="violationCaseFile"/>
    </el-dialog>

    <!--  违规预警信息  -->
    <el-dialog :title="title" :visible.sync="violationCaseFile1" width="300px" append-to-body :close-on-click-modal="false">
      <violationWarningInformationInfo :idInfo="businessKey" v-if="violationCaseFile1"/>
    </el-dialog>
  </div>
</template>


<script>
  import {
    listEndTask,
    listTask,
    formDataShow
  } from "@/api/activiti/taskhistory";

  import Treeselect from "@riophae/vue-treeselect";
  import '@riophae/vue-treeselect/dist/vue-treeselect.css'

  import {  getSignByObjId, addSign, updateSign } from "@/api/sign/sign";
  import pagination from '../Pagination';

  import threestepInfo from "@/views/h5/task/threestepInfo";
  import taskCard from "@/views/h5/task/taskCard";
  import conferenceInfo from "@/views/h5/task/conferenceInfo";
  import leaveApplicationInfo from "@/views/h5/leaveApplication/leaveApplicationInfo";
  import constructsiteInfo from "@/views/h5/task/constructsiteInfo";
  import earthsitesInfo from "@/views/h5/task/earthsitesInfo";
  import contractInfo from "@/views/h5/task/contractInfo";
  import logisticsInfo from "@/views/h5/task/logisticsInfo";
  import handleInfo from "@/views/h5/task/handleInfo";
  import caseOfflineInfo from "@/views/h5/caseOffline/caseOfflineInfo";
  import violationCaseFileInfo from "@/views/h5/task/violationCaseFileInfo";
  import violationWarningInformationInfo from "@/views/h5/task/violationWarningInformationInfo";

  export default {
    name: "taskHistory",
    props: {
      type: {
        type: Number
      }
    },
    components: {
      taskCard,
      threestepInfo,
      conferenceInfo,
      leaveApplicationInfo,
      logisticsInfo,
      handleInfo,
      constructsiteInfo,
      Treeselect,
      earthsitesInfo,
      contractInfo,
      caseOfflineInfo,
      violationCaseFileInfo,
      pagination,
      violationWarningInformationInfo
    },
    data() {
      return {
        id: '',
        definitionKey: '',
        businessKey: '',
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 请假表格数据
        taskList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        open2:false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
        },
        // 表单参数
        form: {
          formData: []
        },
        needShow:false,
        // 表单校验
        rules: {},

        uploadImageDialog: false,
        conferenceOpen: false,
        construct:false,
        idInfo:null,
        leaveApplicationOpen:false,
        signData:null,
        earthsites:false,
        contract:false,
        supervisionOpen:false,
        logisticsInfoOpen: false,
        handleAffairsInfoOpen: false,
        caseOffline: false,
        violationCaseFile: false,
        violationCaseFile1: false,
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询请假列表 */
      getList() {
        this.loading = true;

        if(this.type == 1){
          listEndTask(this.queryParams).then(response => {
            this.taskList = response.rows;
            this.total = response.total;
            this.loading = false;
          });
        }else{
          listTask(this.queryParams).then(response => {
            this.taskList = response.rows;
            this.total = response.total;
            this.loading = false;
          });
        }


      },

      // 取消按钮
      cancel() {
        this.earthsites=false;
        this.contract=false;
        this.logisticsInfoOpen=false;
        this.handleAffairsInfoOpen=false;
        this.caseOffline=false;
        this.violationCaseFile=false;
        this.violationCaseFile1=false;
        this.supervisionOpen=false;
        this.open=false;
        this.open2=false;
        this.conferenceOpen=false;
        this.construct=false;
        this.leaveApplicationOpen=false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.definitionKey = '',
          this.businessKey = '',
          this.form = {
            formData: [],
          };
        this.resetForm("form");
      },
      showTask(row,idx) {

        this.needShow = false;
        this.reset();
        this.definitionKey = row.definitionKey;
        this.businessKey = row.businessKey;
        this.id = row.id;

        this.title = "详情";

        if(this.definitionKey == "conference"){
          this.idInfo = row.businessKey.substring(row.businessKey.indexOf(":")+1);
          this.conferenceOpen = true;
          return;
        }
        if(this.definitionKey == "workflow_leave"){
          this.idInfo = row.businessKey.substring(row.businessKey.lastIndexOf(":")+1);
          this.leaveApplicationOpen = true;
          return;
        }

        if(this.definitionKey == "workflow_constructsite"){
          getSignByObjId(this.businessKey.split(":")[1]).then(res=>{
              this.signData = res;
              this.construct = true;
          });
          return;
        }
          if(this.definitionKey == "workflow_earthsites"){
            this.earthsites = true;
            return;
          }
          if(this.definitionKey == "workflow_conract"){
            this.contract = true;
            return;
          }


          if(this.definitionKey == "workflow_threestep"){
            this.open2 = true;
            return;
          }

          if (this.definitionKey == "logistics") {
            this.idInfo = row.businessKey.substring(row.businessKey.lastIndexOf(":") + 1);
            this.logisticsInfoOpen = true;
            return;
          }
          if (this.definitionKey == "handleAffairs" || this.definitionKey == "gongwenchuli" || this.definitionKey == "yuelan" || this.definitionKey=="yuelanxuexi") {
            this.idInfo = row.businessKey.split(":")[1];
            this.handleAffairsInfoOpen = true;
            return;
          }
          if(this.definitionKey == "workflow_caseoffline"){
            this.caseOffline = true;
            return;
          }

          if(this.definitionKey == "workflow_casefile"){
            this.violationCaseFile = true;
            return;
          }

          if(this.definitionKey == "violation_warning"){
            this.violationCaseFile1 = true;
            return;
          }
        if(this.definitionKey.indexOf("supervision")>-1){
                const params = {
                  id: row.businessKey.split(":")[1],
                }
                getSupervision(params).then(res=>{
                  if(res.result==null){
                    this.$message.error("获取纪检督察详情失败!请重试")
                    return;
                  }
                  this.supervisionData = res.result;
                  this.supervisionOpen = true;
                })
                return;
              }

      },

    }
  };
</script>

<style>
  @import '../../../assets/css/task.css'
</style>
<style scope>
  .el-select-dropdown__item{
    width:300px;
  }
</style>