import request from '@/utils/request'; import { AxiosPromise } from 'axios'; import { TimesheetPreAllocVO, TimesheetPreAllocForm, TimesheetPreAllocQuery } from '@/api/oa/erp/timesheetPreAlloc/types'; /** * 查询预投工时分配列表 * @param query * @returns {*} */ export const listTimesheetPreAlloc = (query?: TimesheetPreAllocQuery): AxiosPromise => { return request({ url: '/oa/erp/timesheetPreAlloc/list', method: 'get', params: query }); }; /** * 查询预投工时分配详细 * @param allocId */ export const getTimesheetPreAlloc = (allocId: string | number): AxiosPromise => { return request({ url: '/oa/erp/timesheetPreAlloc/' + allocId, method: 'get' }); }; /** * 新增预投工时分配 * @param data */ export const addTimesheetPreAlloc = (data: TimesheetPreAllocForm) => { return request({ url: '/oa/erp/timesheetPreAlloc', method: 'post', data: data }); }; /** * 修改预投工时分配 * @param data */ export const updateTimesheetPreAlloc = (data: TimesheetPreAllocForm) => { return request({ url: '/oa/erp/timesheetPreAlloc', method: 'put', data: data }); }; /** * 删除预投工时分配 * @param allocId */ export const delTimesheetPreAlloc = (allocId: string | number | Array) => { return request({ url: '/oa/erp/timesheetPreAlloc/' + allocId, method: 'delete' }); }; /** * 下拉框查询预投工时分配列表 * @param query * @returns {*} */ export function getErpTimesheetPreAllocList (query) { return request({ url: '/oa/erp/timesheetPreAlloc/getErpTimesheetPreAllocList', method: 'get', params: query }); };