import request from '@/config/axios'

export interface IotRyImproveDailyReportVO {
  id?: number
  title: string
  createTime: number
  workLocation: string
  workPurpose: string
  relocationDays: number
  personnel: string
  improveReportDetails: IotRyImproveDailyReportDetailVO[]
  auditStatus?: 0 | 10 | 20 | 30 | 40
  opinion?: string
}

export interface IotRyImproveDailyReportDetailVO {
  projectName: string
  constructionDetail: string
  nextPlan: string
}

export interface IotRyImproveDailyReportApprovalVO {
  id: number
  auditStatus: 20 | 30
  opinion?: string
}

export const IotRyImproveDailyReportApi = {
  getIotRyImproveDailyReportPage: async (params: any) => {
    return await request.get({ url: `/pms/iot-ry-improve-daily-report/page`, params })
  },

  getIotRyImproveDailyReport: async (id: number) => {
    return await request.get({ url: `/pms/iot-ry-improve-daily-report/get?id=` + id })
  },

  createIotRyImproveDailyReport: async (data: IotRyImproveDailyReportVO) => {
    return await request.post({ url: `/pms/iot-ry-improve-daily-report/create`, data })
  },

  updateIotRyImproveDailyReport: async (data: IotRyImproveDailyReportVO) => {
    return await request.put({ url: `/pms/iot-ry-improve-daily-report/update`, data })
  },

  approvalIotRyImproveDailyReport: async (data: IotRyImproveDailyReportApprovalVO) => {
    return await request.put({ url: `/pms/iot-ry-improve-daily-report/approval`, data })
  }
}
