index.vue 6.17 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="800px" append-to-body>
      <threestepInfo :businessKey="businessKey"  v-if="open2"/>
      </el-dialog>

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

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


    <el-dialog :title="title" :visible.sync="earthsites" width="800px" append-to-body>
      <earthsitesInfo :businessKey="businessKey"  v-if="earthsites" />
      <div slot="footer" class="dialog-footer">
          <el-button type="danger" @click="submitForm(form.formData[0].controlId ,1)">驳回</el-button>
          <el-button type="primary" @click="submitForm(form.formData[0].controlId ,0)">通过</el-button>
        </div>
    </el-dialog>

    <el-dialog :title="title" :visible.sync="contract" width="800px" append-to-body>
      <contractInfo :businessKey="businessKey"  v-if="contract" />
      <div slot="footer" class="dialog-footer">
          <el-button type="danger" @click="submitForm(form.formData[0].controlId ,1)">驳回</el-button>
          <el-button type="primary" @click="submitForm(form.formData[0].controlId ,0)">通过</el-button>
        </div>
    </el-dialog>
  </div>
</template>

<style>
  @import '../../../assets/css/task.css'
</style>

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




  import taskCard from "@/views/activiti/task/taskCard";
  import leaveHistoryForm from "@/views/workflow/leaveHistoryForm";
  import threestepInfo from "@/views/business/threestep/threestepInfo";


import {  getSignByObjId, addSign, updateSign } from "@/api/sign/sign";
import constructsiteInfo from "@/views/activiti/task/constructsiteInfo";

  import conferenceInfo from "@/views/office/conference/conferenceInfo";
  import leaveApplicationInfo from "@/views/office/leaveApplication/leaveApplicationInfo";
  import earthsitesInfo from "@/views/activiti/task/earthsitesInfo";
  import contractInfo from "@/views/activiti/task/contractInfo";



  export default {
    name: "taskHistory",
    components: {
      taskCard,
      leaveHistoryForm,
      threestepInfo,
      leaveApplicationInfo,
      conferenceInfo,
      constructsiteInfo,
    },
    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,
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询请假列表 */
      getList() {
        this.loading = true;
        listTask(this.queryParams).then(response => {
          this.taskList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },

      // 取消按钮
      cancel() {
        this.open = 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;


        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_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;
       }






      },
      /** 提交按钮 */
      submitForm() {
        formDataSave(this.id, this.form.formData).then(response => {
          this.msgSuccess("审批成功");
          this.open = false;
          this.getList();
        });
      },
    }
  };
</script>