import axios from '@/common/services/axios-instance'

class XmSingleDataService {
  // 重新起草-工作底稿
  againFlow(params, projectId) {
    return axios({
      url: 'api/xcoa-mobile/v1/cpm-work-paper/againFlow?projectId=' + projectId,
      method: 'post',
      data: params,
    })
  }

  // 查看详情-法律队伍
  lawTeamDetail(orgId) {
    return axios({
      url: 'api/framework/v1/lawteam/isViewPri?orgId=' + orgId,
      method: 'get',
    })
  }

  // 分案-保存分案外部处理人
  saveLawDivisionOut(params) {
    return axios({
      url: 'api/xcoa-mobile/v1/lawdivisionout/saveLawDivisionOut',
      method: 'post',
      data: params,
    })
  }

  // 分案-保存分案内部处理人
  saveLawDivisionIn(params) {
    return axios({
      url: 'api/xcoa-mobile/v1/lawdivisionin/saveLawDivisionIn',
      method: 'post',
      data: params,
    })
  }

  // 分案-停用/启用外部处理人
  changeUserStatusOut(id, status) {
    return axios({
      url: `api/xcoa-mobile/v1/lawdivisionout/stopLawDivisionUser?id=${id}&agentStatus=${status}`,
      method: 'post',
    })
  }

  // 分案-停用/启用内部处理人
  changeUserStatusIn(id, status) {
    return axios({
      url: `api/xcoa-mobile/v1/lawdivisionin/stopLawDivisionUser?id=${id}&agentStatus=${status}`,
      method: 'post',
    })
  }

  // 转案件进展
  fnZhuanCaseProgress(caseid) {
    return axios({
      url: 'api/framework/v1/lawexecuteproceure/updateCaseStatus?caseId=' + caseid,
      method: 'post',
    })
  }

  // 获取业务类型id
  getTypeBusId(id) {
    return axios({
      url: 'api/framework/v1/businesstype-manage/auth-businesstypes/moduleid?appModuleId=' + id,
      method: 'get',
    })
  }

  // 获取数据信息
  getBeanByFormId(id, formId) {
    const url = 'api/framework/v1/page/wp/' + formId
    return axios.post(url, { id: id }).then(function (res) {
      return res
    })
  }
}

export default new XmSingleDataService()
