提交
This commit is contained in:
1 parent
e1d6de45a3
commit
5ad07c8cac
616 files changed
+181132
-35125
No files matched your search
@@ -1,5 +1,11 @@
|
||||
import request from '@/utils/http'
|
||||
|
||||
export type ProductionTaskOperateScope = 'mine' | 'manage'
|
||||
|
||||
function scopeQuery(scope?: ProductionTaskOperateScope) {
|
||||
return scope === 'mine' ? { operateScope: 'mine' } : undefined
|
||||
}
|
||||
|
||||
export function fetchCreateProductionTask(data: Record<string, any>) {
|
||||
return request.post({ url: '/web/admin/production-tasks', params: data })
|
||||
}
|
||||
@@ -22,6 +28,45 @@ export function fetchProductionTaskList(params?: {
|
||||
}>({ url: '/web/admin/production-tasks', params })
|
||||
}
|
||||
|
||||
export function fetchMyProductionTasks(params: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
taskStatus?: string
|
||||
workOrderType?: string
|
||||
scope: 'current' | 'history'
|
||||
}) {
|
||||
return request.get<{
|
||||
list: any[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}>({ url: '/web/admin/production-tasks/mine', params })
|
||||
}
|
||||
|
||||
export function fetchForwardProductionTask(
|
||||
id: string,
|
||||
data: { toUserId: string; remark?: string },
|
||||
operateScope: ProductionTaskOperateScope = 'mine'
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/production-tasks/${id}/forward`,
|
||||
data,
|
||||
params: { operateScope }
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReassignProductionTask(
|
||||
id: string,
|
||||
data: { assigneeUserId: string; remark?: string }
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${id}/assignee`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchProductionTaskDetail(id: string) {
|
||||
return request.get<any>({ url: `/web/admin/production-tasks/${id}` })
|
||||
}
|
||||
@@ -30,69 +75,165 @@ export function fetchUpdateProductionTask(id: string, data: Record<string, any>)
|
||||
return request.put({ url: `/web/admin/production-tasks/${id}`, params: data })
|
||||
}
|
||||
|
||||
export function fetchUpdateProductionTaskStatus(id: string, data: Record<string, any>) {
|
||||
return request.put({ url: `/web/admin/production-tasks/${id}/status`, params: data })
|
||||
export function fetchUpdateProductionTaskStatus(
|
||||
id: string,
|
||||
data: Record<string, any>,
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${id}/status`,
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDeleteProductionTask(id: string) {
|
||||
return request.del({ url: `/web/admin/production-tasks/${id}` })
|
||||
}
|
||||
|
||||
export function fetchAddTaskStep(taskId: string, data: Record<string, any>) {
|
||||
return request.post({ url: `/web/admin/production-tasks/${taskId}/steps`, params: data })
|
||||
export function fetchAddTaskStep(
|
||||
taskId: string,
|
||||
data: Record<string, any>,
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps`,
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchUpdateTaskStep(taskId: string, stepId: string, data: Record<string, any>) {
|
||||
return request.put({ url: `/web/admin/production-tasks/${taskId}/steps/${stepId}`, params: data })
|
||||
export function fetchUpdateTaskStep(
|
||||
taskId: string,
|
||||
stepId: string,
|
||||
data: Record<string, any>,
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps/${stepId}`,
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDeleteTaskStep(taskId: string, stepId: string) {
|
||||
return request.del({ url: `/web/admin/production-tasks/${taskId}/steps/${stepId}` })
|
||||
export function fetchDeleteTaskStep(
|
||||
taskId: string,
|
||||
stepId: string,
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.del({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps/${stepId}`,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReplaceStepReagents(taskId: string, stepId: string, data: any[]) {
|
||||
export function fetchReplaceStepReagents(
|
||||
taskId: string,
|
||||
stepId: string,
|
||||
data: any[],
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps/${stepId}/reagents`,
|
||||
params: data
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReplaceStepConsumables(taskId: string, stepId: string, data: any[]) {
|
||||
export function fetchReplaceStepConsumables(
|
||||
taskId: string,
|
||||
stepId: string,
|
||||
data: any[],
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps/${stepId}/consumables`,
|
||||
params: data
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReplaceStepDataCollection(taskId: string, stepId: string, data: any[]) {
|
||||
export function fetchReplaceStepConfiguredReagents(
|
||||
taskId: string,
|
||||
stepId: string,
|
||||
data: any[],
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps/${stepId}/configured-reagents`,
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReplaceStepDataCollection(
|
||||
taskId: string,
|
||||
stepId: string,
|
||||
data: any[],
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps/${stepId}/data-collection`,
|
||||
params: data
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchSetTaskInputs(taskId: string, data: any[] | Record<string, any>) {
|
||||
return request.post({ url: `/web/admin/production-tasks/${taskId}/inputs`, params: data })
|
||||
export function fetchSetTaskInputs(
|
||||
taskId: string,
|
||||
data: any[] | Record<string, any>,
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/production-tasks/${taskId}/inputs`,
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchSetTaskOutputs(taskId: string, data: any[] | Record<string, any>) {
|
||||
return request.post({ url: `/web/admin/production-tasks/${taskId}/outputs`, params: data })
|
||||
export function fetchSetTaskOutputs(
|
||||
taskId: string,
|
||||
data: any[] | Record<string, any>,
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/production-tasks/${taskId}/outputs`,
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReorderTaskSteps(data: { taskId: string; stepIds: string[] }) {
|
||||
return request.put({ url: '/web/admin/production-tasks/step/reorder', params: data })
|
||||
export function fetchReorderTaskSteps(
|
||||
data: { taskId: string; stepIds: string[] },
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: '/web/admin/production-tasks/step/reorder',
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCopyTaskStep(data: { taskId: string; stepId: string }) {
|
||||
export function fetchCopyTaskStep(
|
||||
data: { taskId: string; stepId: string },
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/production-tasks/${data.taskId}/steps/${data.stepId}/copy`,
|
||||
params: data
|
||||
data: {},
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReplaceStepOutputs(taskId: string, stepId: string, data: any[]) {
|
||||
export function fetchReplaceStepOutputs(
|
||||
taskId: string,
|
||||
stepId: string,
|
||||
data: any[],
|
||||
operateScope?: ProductionTaskOperateScope
|
||||
) {
|
||||
return request.put({
|
||||
url: `/web/admin/production-tasks/${taskId}/steps/${stepId}/outputs`,
|
||||
params: data
|
||||
data,
|
||||
params: scopeQuery(operateScope)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user