import request from '@/config/axios'

// 盘点配置 VO
export interface CheckConfVO {
  checkOrder: number // 盘点排序
  checkAsyn: string // 异步类型
  checkName: string // 盘点名称
  checkScanType: string // 盘点类型
  isEnable: boolean // 是否启用
  checkType: string // 上位状态码
}

// 盘点配置 API
export const CheckConfApi = {
  // 查询盘点配置分页
  getCheckConfPage: async (params: any) => {
    return await request.get({ url: `/logistics/check-conf/page`, params })
  },

  // 查询盘点配置详情
  getCheckConf: async (id: number) => {
    return await request.get({ url: `/logistics/check-conf/get?id=` + id })
  },

  // 新增盘点配置
  createCheckConf: async (data: CheckConfVO) => {
    return await request.post({ url: `/logistics/check-conf/create`, data })
  },

  // 修改盘点配置
  updateCheckConf: async (data: CheckConfVO) => {
    return await request.put({ url: `/logistics/check-conf/update`, data })
  },

  // 删除盘点配置
  deleteCheckConf: async (id: number) => {
    return await request.delete({ url: `/logistics/check-conf/delete?id=` + id })
  },

  // 导出盘点配置 Excel
  exportCheckConf: async (params) => {
    return await request.download({ url: `/logistics/check-conf/export-excel`, params })
  },
}
