From 82e27d0cadbddfc73e8b978e778b802dc8e51fa1 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 29 三月 2024 10:51:36 +0800 Subject: [PATCH] 报工入参修改和工序ID修改 --- src/api/index.ts | 207 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 198 insertions(+), 9 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 6b41213..185ed66 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,14 +1,22 @@ import { request } from '@/common/utils' -import type { CraftParamsResponse, TasksGroupByChannel } from './task' +import type { CraftParamsResponse, TasksGroupByChannel, Task } from './task' import type { PLCResponse } from './plc' import type { Devices } from './device' import type { CraftModel } from './craftModel' import type { Problem } from './problem' +import type { ReportingRecord } from './reporting' export interface BaseResponse<T = any> { code: number data: T msg: string +} + +export interface ListResponse<T = any> { + code: number + data: T + msg: string + total: number } export interface TaskListParams { @@ -20,6 +28,8 @@ offset: number /** 鏌ュ灏戞潯 */ limit: number + /** 璁惧id */ + deviceID: string } /** @@ -28,7 +38,26 @@ */ export function getTaskList(params: TaskListParams) { return request<BaseResponse<TasksGroupByChannel>>({ - url: '/v1/task/list', + url: '/api-s/v1/reportWork/taskList', + method: 'get', + params + }) +} + +export interface TaskInfoParams { + /** 璁惧id */ + deviceID: string + /** 宸ュ簭id */ + procedureID: number +} + +/** + * 鑾峰彇浠诲姟璇︽儏 + * @param params + */ +export function getTaskInfo(params: TaskInfoParams) { + return request<BaseResponse<Task>>({ + url: '/api-s/v1/reportWork/taskInfo', method: 'get', params }) @@ -36,7 +65,7 @@ export interface ProductProgressParams { channel: number - procedureId: number + procedureId?: number } /** @@ -98,13 +127,61 @@ }) } +export interface ProcedureUpdateParams { + isFinish: boolean + isProcessing: boolean + workOrderProcedureID: number +} + +/** + * 寮�濮嬩换鍔�/瀹屾垚浠诲姟 (鍘� 鑾峰彇宸ヨ壓鍙傛暟/缁撴潫浠诲姟) + * @param params + */ +export function procedureUpdate(params: ProcedureUpdateParams) { + return request<BaseResponse>({ + url: `/api-s/v1/reportWork/procedureUpdate`, + method: 'post', + data: params + }) +} + /** * 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛� */ export function getDeviceList() { return request<BaseResponse<Devices>>({ - url: `/v1/device/list`, + url: `/api-s/v1/reportWork/deviceList`, method: 'get' + }) +} + +export interface SetCurrentDeviceParams { + currentDeviceID: string +} + +/** + * 璁惧畾褰撳墠璁惧 + */ +export function apiSetCurrentDevice(data: SetCurrentDeviceParams) { + return request<BaseResponse>({ + url: `/api-s/v1/reportWork/setCurrentDeviceId`, + method: 'post', + data + }) +} + +export interface SetCurrentDeviceConfigParams { + needSetProcessParams: boolean +} + +/** + * 璁惧畾褰撳墠璁惧閰嶇疆 + */ +export function apiSetCurrentDeviceConfig(data: SetCurrentDeviceConfigParams) { + return request<BaseResponse>({ + url: `/v1/device/config`, + method: 'post', + data }) } @@ -119,7 +196,7 @@ * @param params */ export function apiGetCraftModelList(params: CraftModelListParams) { - return request<BaseResponse<CraftModel[]>>({ + return request<ListResponse<CraftModel[]>>({ url: '/v1/processModel/list', method: 'get', params @@ -145,9 +222,121 @@ /** * 鑾峰彇闂璇婃柇闂鍒楄〃 */ -export function apiGetProblemList() { - return request<BaseResponse<Problem[]>>({ - url: '/v1/system/problemList', - method: 'get' +// export function apiGetProblemList() { +// return request<BaseResponse<Problem[]>>({ +// url: '/v1/system/problemList', +// method: 'get' +// }) +// } + +export interface ReportingRecordListParams { + page?: number + pageSize?: number + workOrderProcedureID: number +} + +/** + * 鑾峰彇鎶ュ伐璁板綍鍒楄〃 + */ +export function apiGetReportingRecordList(params: ReportingRecordListParams) { + return request<ListResponse<ReportingRecord[]>>({ + url: '/api-s/v1/reportWork/list', + method: 'get', + params + }) +} + +export interface ReportWorkParams { + workOrderProcedureID: number + reportAmount: number + workerID: string + workerName: string +} + +/** + * 鎶ュ伐 + */ +export function apiReportWork(params: ReportWorkParams) { + return request<BaseResponse>({ + url: '/api-s/v1/reportWork/report', + method: 'post', + data: params + }) +} + +/** + * 鑾峰彇楠岃瘉鐮� + */ +export function getCaptcha() { + return request({ + url: '/api/base/captcha', + method: 'post' + }) +} + +export interface loginParams { + username: string + password: string + captcha: string + captchaId: string +} +/** + * 鐧诲綍 + */ +export function login(params: loginParams) { + return request({ + url: '/api/base/login', + method: 'post', + data: params + }) +} + +export interface qualityParams { + reportAmount: number + workOrderProcedureID: number + workerID: string + workerName: string +} +/** + * 鐪嬫澘璐ㄦ + */ +export function bulletinQualityInspection(params: qualityParams) { + return request({ + url: '/api-s/v1/reportWork/bulletinQualityInspection', + method: 'post', + data: params + }) +} + +export interface getQualityParams { + workOrderId: string + procedureId: string +} +/** + * 鐪嬫澘鑾峰彇璐ㄦ淇℃伅 + */ +export function getQualityInspection(params: getQualityParams) { + return request({ + url: '/api-s/v1/reportWork/bulletinGetQualityInspection', + method: 'post', + data: params + }) +} + +export interface bulletinReportParams { + reportAmount: number + workOrderProcedureID: number + workerID: string + workerName: string + ids: any[] +} +/** + * 鐪嬫澘鎶ュ伐 + */ +export function bulletinReport(params: bulletinReportParams) { + return request({ + url: '/api-s/v1/reportWork/bulletinReport', + method: 'post', + data: params }) } -- Gitblit v1.8.0