cmc-web/packages/api/system/workorder.js

30 lines
816 B
JavaScript
Raw Normal View History

2024-08-20 12:11:31 +00:00
import { request } from '@cmp/cmp-element'
import { wrapperParams } from 'utils'
const baseUrl = '/cos/v1/workorders'
export function getworkOrder(params) {
return request.get(baseUrl, {
params
})
}
export function getworkOrderDetail(id) {
return request.get(`${baseUrl}/${id}`)
}
export function createworkOrder(params) {
return request.post(baseUrl, wrapperParams(params))
}
export function modifyworkOrder(params) {
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
}
export function removeworkOrder(id) {
return request.delete(`${baseUrl}/${id}`)
}
export function recordWorkOrder(id) {
return request.get(`${baseUrl}/${id}/records`)
}
export function createRecordsWorkOrder(params) {
return request.post(`${baseUrl}/${params.orderId}/records`, wrapperParams(params))
}