taskhismethod.js 7.38 KB
import {
  listEndTask,
  listTask,
  formDataShow
} from "@/api/activiti/taskhistory";



import {historyFromData} from '@/api/activiti/historyFormdata'
import {addSign, getSignByObjId} from "@/api/sign/sign";
import {updateCaseOffline} from "@/api/caseOffline/caseOffline";
import {updateViolationCaseFileReader} from "@/api/casefile/violationCaseFile";
import {updateViolationCaseFileReader1} from "@/api/casefile/violationWarningInformation";
import {getDict, getSupervision, getUsers} from "@/api/dict";
import {activeThreestep} from "@/api/business/threestep";
import {getToken} from "@/utils/auth";
import {addReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess";
import {updateHandleAffairs} from "@/api/office/handle";

export default {
    methods: {
      remoteName(value){
        getNames(value).then(res=>{

          this.names = res.data;

          this.queryParams.name = value;
        });
      },
      resetQuery(){
        this.queryParams = {};
        this.queryParams.pageNum=1;
        this.queryParams.pageSize=10;
        this.getList();
      },
      /** 查询请假列表 */
      getList() {
        this.loading = true;
        if (this.type == 1) {
          listEndTask(this.queryParams).then(response => {
            this.taskList = response.rows;
            this.total = response.total;
            this.loading = false;
            if(!this.names)
              this.names = response.names;
          });
        } else {
          listTask(this.queryParams).then(response => {
            this.taskList = response.rows;
            this.total = response.total;
            this.loading = false;

            if(!this.names)
              this.names = response.names;
          });
        }
      },

      // 取消按钮
      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;

        historyFromData(this.businessKey).then(response => {

          this.hisfromData = [];

            // this.hisfromData.push({createName:row.createBy,controlValue:row.reason,createTime:row.time});
            for(let i in response.data){

              this.hisfromData.push(response.data[i]);
            }
        })


        this.title = "详情";
        formDataShow(row.id).then(response => {
          let datas = response.data;
          let formData = []
          for (let i = 0; i < datas.length; i++) {
            let strings = datas[i].split('--__!!')
            let controlValue = null
            let controlDefault = null
            switch (strings[1]) {
              case 'radio':
                controlValue = idx;
                controlDefault = strings[4]
                break;
              // default:
            }
            formData.push({
              controlId: strings[0],
              controlType: strings[1],
              controlLable: strings[2],
              controlIsParam: strings[3],
              controlValue: controlValue,
              controlDefault: controlDefault
            })
          }
          if (this.definitionKey == "handleAffairs" || this.definitionKey == "gongwenchuli" || this.definitionKey == "yuelan" || this.definitionKey == "yuelanxuexi") {
            if(this.definitionKey == "yuelanxuexi"||this.definitionKey == "yuelan"){
              this.businessKey = 'yuelanxuexi1';
            }else if(this.definitionKey == "gongwenchuli"){
              this.businessKey = 'gongwenchuli';
            }
            this.idInfo = row.businessKey.split(":")[1];
            this.handleAffairsInfoOpen = true;
            return;
          }
        });

        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" || this.definitionKey == "workflow_constructsite_edit") {


            this.construct = true;
          return;
        }
        if (this.definitionKey == "workflow_earthsites" || this.definitionKey == "workflow_earthsites_edit") {
          this.earthsites = true;
          return;
        }
        if (this.definitionKey == "workflow_conract"  || this.definitionKey == "workflow_conract_edit") {
          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 == "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 == "workflow_company"){
            this.company = true;
            return;
          }
          if(this.definitionKey == "workflow_vehicle"){
            this.vehicle = true;
            return;
          }
          if(this.definitionKey == "workflow_driver"){
            this.driver = true;
            return;
          }
          if (this.definitionKey.indexOf("supervision") > -1) {
            getTrack(row.businessKey.split(":")[1]).then(res => {
              this.businessKey  = res.data.objectId;

              if(res.data.type == 0){
                this.construct = true;
              }else if(res.data.type == 1){
                this.earthsites = true;
              }else if(res.data.type == 2){
                this.company = true;
              }else if(res.data.type == 3){
                this.contract = true;
              }else if(res.data.type == 4){
                this.vehicle = true;
              }else if(res.data.type == 5){
                this.idInfo = row.businessKey.substring(row.businessKey.lastIndexOf(":") + 1);
                this.logisticsInfoOpen = true;
              }else if(res.data.type == 6){
                this.caseOffline = true;
                return;
              }else if(res.data.type == 7){
                this.violationCaseFile = true;
                this.videoSrc1 = [];
                this.slides1 = [];
              }

            })
            return;
          }
      },
    },
  }