// 督查问题审批模块

import axios from 'axios'; // 引入axios
import request from '../utils/gw_ajax_request.js';

const baseurl = '';
// const baseurl = 'http://10.8.4.135:8872'
// const baseurl = 'http://36.250.234.48:8105'

// 获取待审核问题列表
export function getXSKPenddingTask(data) {
  return request({
    url: baseurl + '/dc/insp/pblm/findSpList',
    method: 'POST',
    data: data,
  });
}

// 获取非待审批状态的问题列表
export function getXSKOnGoingTask(data) {
  return request({
    url: baseurl + '/dc/insp/pblm/page/rever',
    method: 'POST',
    data: data,
  });
}

// 获取初步问题清单列表
export function getXSKInitQuestionList(data) {
  return request({
    url: baseurl + '/dc/insp/pblm/page/rever',
    method: 'POST',
    data: data,
  });
}

// 获取非待审批状态的问题列表
export function checkUserHasRole(persId, ptype) {
  return request({
    url: baseurl + '/sys/roles/checkUserHasRole/' + persId + '/' + ptype,
    method: 'GET',
    data: {},
  });
}

// 设置问题的清单类型(初步清单、最终清单)
export function setQuestionFlag(PblmAudit) {
  console.log(PblmAudit);
  return request({
    url: baseurl + '/dc/insp/pblm/submit',
    method: 'POST',
    data: PblmAudit,
  });
}

// 将流程节点状态码转换成节点名称
export function transferProcStatCodeToName(ProcActCode) {
  let ProcActivityName = '';
  switch (ProcActCode) {
    case '10':
      ProcActivityName = '专家填报';
      break;
    case '11':
      ProcActivityName = '组内审核';
      break;
    case '12':
      ProcActivityName = '专家修改';
      break;
    case '13':
      ProcActivityName = '监督处审核';
      break;
    case '14':
      ProcActivityName = '责任处室（单位）审核';
      break;
    case '14-1':
      ProcActivityName = '责任处室（单位）领导审核';
      break;
    case '15':
      ProcActivityName = '组内组织修改';
      break;
    case '16':
      ProcActivityName = '列入初步问题清单';
      break;
    case '17':
      ProcActivityName = '列入最终问题';
      break;
    case '18':
      ProcActivityName = '组内组织修改';
      break;
    case '18-1':
      ProcActivityName = '责任处室（单位）审核-业务处领导退回';
      break;
  }
  // console.log('current activity name : ' + ProcActCode + '-' + ProcActivityName)
  return ProcActivityName;
}
