import { main, dict } from '@/api'
import request from '@/utils/require'

// 详情动态粮食,性质
export function getDataGroup(data) {
  let str = data.pdictCode ? `${dict}/dataDictionary/getDataGroup?groupId=${data.groupId}&pdictCode=${data.pdictCode}` : `${dict}/dataDictionary/getDataGroup?groupId=${data.groupId}`
  return request({
    url: str,
    method: 'get'
  })
}

//计划名称列表页
export function selectPageByEntity(data) {
  return request({
    url: `${main}/client/rotateplannm/rotatePlanMake/selectPageByEntity?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
    method: 'post',
    data: data
  })
}

//计划查
export function rotatePlanMakeById(data) {
  return request({
    url: `${main}/client/rotateplannm/rotatePlanMake/selectById`,
    method: 'post',
    data: data
  })
}

//月报新增
export function monthAddition(data) {
  return request({
    url: `${main}/client/planExecution/monthStatistics/addition`,
    method: 'post',
    data: data
  })
}

//列表分页
export function monthStatisticsList(data) {
  return request({
    url: `${main}/client/planExecution/monthStatistics/pageList?pageNum=${data.pageNum}&pageSize=${data.pageSize}&isReceive=${data.isReceive}&planName=${data.planName}&companyCode=${data.companyCode}`,
    method: 'get'
  })
}

//删除
export function monthStatisticsDel(id) {
  return request({
    url: `${main}/client/planExecution/monthStatistics/del/${id}`,
    method: 'delete'
  })
}

//查看
export function monthDetail(id) {
  return request({
    url: `${main}/client/planExecution/monthStatistics/lookOver/${id}`,
    method: 'get'
  })
}

//修改
export function monthUpdate(data) {
  return request({
    url: `${main}/client/planExecution/monthStatistics/renewal`,
    method: 'post',
    data: data
  })
}

//详情
export function monthSumDetail(data) {
  return request({
    url: `${main}/client/planExecution/monthStatistics/lookOver/statisticsDetail?planName=${data.jhmc}&planYear=${data.jhnd}`,
    method: 'get'
  })
}


