import request from '@/utils/request';

export async function handleGetAccountList(params: any) {

    const data = await request(`/Verification/GetEndaccountList`, {
        method: 'GET',
        params
    })

    if (data.Result_Code === 500) {
        return []
    }

    return data.Result_Data
}
// 服务区下面的门店列表
export async function handleGetServiceShopList(params: any) {

  const data = await request(`/BaseInfo/GetServerpartShopDDL`, {
    method: 'GET',
    params
  })

  if (data.Result_Code === 500) {
    return []
  }

  return data.Result_Data
}

// 拿到该行的详情数据
export async function handleGetAccountDetail(params: any) {

  const data = await request(`/Verification/GetEndaccountDetail`, {
    method: 'GET',
    params
  })

  if (data.Result_Code === 500) {
    return []
  }

  return data.Result_Data
}

// 获取流水冲正的数据
export async function handleGetSupplement(params: any) {

    const data = await request(`/Verification/GetEndaccountSupplement`, {
        method: 'GET',
        params
    })

    if (data.Result_Code === 500) {
        return []
    }

    return data.Result_Data
}


// 财务审核 主任复核 驳回
export async function submitEndaccountState(params: any) {
  return  request(`/Verification/SubmitEndaccountState`, {
    method: 'POST',
    data: params,
  })
}
// 日结数据校验
export async function dailyVerifyEndaccount(params: any) {
  return  request(`/Verification/VerifyEndaccount`, {
    method: 'POST',
    data: params,
  })
}
// 批量审核
export async function handleBatchReview(params: any) {
  return  request(`/Verification/ApproveEndaccount`, {
    method: 'POST',
    data: params,
  })
}

// 日结账期异常处理
export async function handleDailyException(params: any) {
  return  request(`/Verification/ExceptionHandling`, {
    method: 'POST',
    data: params,
  })
}


// 查询历史账期列表
export async function handleGetEndaccountHisList(params: any) {

  const data = await request(`/Verification/GetEndaccountHisList`, {
      method: 'GET',
      params
  })

  if (data.Result_Code === 500) {
      return []
  }

  return data.Result_Data.List
}

// 获取补录账期列表
export async function handleGetSuppEndaccountList(params: any) {

  const data = await request(`/Verification/GetSuppEndaccountList`, {
      method: 'GET',
      params
  })

  if (data.Result_Code === 500) {
      return []
  }

  return data.Result_Data.List
}


// 门店列表
export async function handleGetServerpartShopList(params: any) {

  const data = await request(`/BaseInfo/GetServerpartShopList`, {
      method: 'POST',
      data: params
  })

  if (data.Result_Code === 500) {
      return []
  }

  return data.Result_Data.List
}